@aquera/nile-elements 0.0.21 → 0.0.22
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-content-editor/nile-content-editor.css.js +4 -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
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.d.ts +8 -3
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js +58 -31
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-switcher/nile-switcher.css.js +5 -9
- 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 +29 -15
- 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/src/nile-tab/nile-tab.css.js +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/src/nile-tab/nile-tab.css.js.map +1 -1
- package/.rollup.cache/opt/atlassian/pipelines/agent/build/packages/nile-elements/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/index.iife.js +40 -35
- package/dist/nile-content-editor/nile-content-editor.cjs.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.cjs.js.map +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.cjs.js.map +1 -1
- package/dist/nile-content-editor/nile-content-editor.css.esm.js +4 -2
- package/dist/nile-content-editor/nile-content-editor.esm.js +5 -5
- 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 +7 -11
- package/dist/nile-switcher/nile-switcher.esm.js +33 -26
- package/dist/nile-tab/nile-tab.css.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.css.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.css.esm.js +1 -1
- package/dist/src/nile-content-editor/nile-content-editor.css.js +4 -2
- package/dist/src/nile-content-editor/nile-content-editor.css.js.map +1 -1
- package/dist/src/nile-content-editor/nile-content-editor.d.ts +8 -3
- package/dist/src/nile-content-editor/nile-content-editor.js +58 -31
- package/dist/src/nile-content-editor/nile-content-editor.js.map +1 -1
- package/dist/src/nile-switcher/nile-switcher.css.js +5 -9
- 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 +29 -15
- package/dist/src/nile-switcher/nile-switcher.js.map +1 -1
- package/dist/src/nile-tab/nile-tab.css.js +1 -1
- package/dist/src/nile-tab/nile-tab.css.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/nile-content-editor/nile-content-editor.css.ts +4 -2
- package/src/nile-content-editor/nile-content-editor.ts +74 -39
- package/src/nile-switcher/nile-switcher.css.ts +5 -9
- package/src/nile-switcher/nile-switcher.ts +46 -22
- package/src/nile-tab/nile-tab.css.ts +1 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{query as s,state as e,customElement as
|
1
|
+
import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";import{query as s,state as e,customElement as h}from"lit/decorators.js";import{s as o}from"./nile-content-editor.css.esm.js";import{classMap as n}from"lit/directives/class-map.js";import{N as r}from"../internal/nile-element.esm.js";import{w as a}from"../internal/watch.esm.js";import{K as l}from"../internal/enum.esm.js";import{live as p}from"lit/directives/live.js";import{n as d}from"../property-09139d3c.esm.js";import"lit";let c=class extends r{constructor(){super(...arguments),this.value="",this.showLabel=!0,this.labelText="",this.type="text|text-area",this.required=!0,this.openDropdown=!1,this.tagIdentifier="$",this.filteredValue="",this.helpText="",this.readonly=!1,this.errorMessage="",this.error=!1,this.noborder=!1,this.initialValue="",this.replaceText=""}connectedCallback(){this.handleOutsideClick=this.handleOutsideClick.bind(this),this.handleClipboardEvent=this.handleClipboardEvent.bind(this),super.connectedCallback(),this.emit("nile-init"),this.addOpenListeners(),this.setInitialValues()}addOpenListeners(){window.addEventListener("click",this.handleOutsideClick),this.addEventListener("cut",this.handleClipboardEvent),this.addEventListener("copy",this.handleClipboardEvent),this.addEventListener("paste",this.handleClipboardEvent)}removeOpenListeners(){this.removeEventListener("click",this.handleOutsideClick),this.removeEventListener("cut",this.handleClipboardEvent),this.removeEventListener("copy",this.handleClipboardEvent),this.removeEventListener("paste",this.handleClipboardEvent)}handleOutsideClick(t){t&&t.target&&!this.contains(t.target)&&this.toggleDropdown(!1)}async handleClipboardEvent(t){const i=window?.getSelection()?.toString();switch(t.type){case"cut":case"copy":i&&await navigator.clipboard.writeText(i),document.execCommand(t.type);break;case"paste":t.preventDefault();let s="";s=await navigator.clipboard.readText(),s=s.replace(/<(|\/)(html|body|meta|span)[^>]*?>/gi,"").trim(),document.execCommand("insertText",!1,s)}setTimeout((()=>{this.emitInputChange()}))}toggleDropdown(t){this.openDropdown=t}setInitialValues(){this.updateComplete.then((t=>{t&&(this.contentEditor.innerHTML=this.generateHTMLTagsWithValues(this.value))}))}handleTypeChange(){this.contentEditor.innerHTML=this.generateHTMLTagsWithValues(this.value)}disconnectedCallback(){super.disconnectedCallback(),this.removeOpenListeners(),this.emit("nile-destroy")}handlekeyDown(t){if(t.code!==l.ENTER||"text"!==this.type){if(![l.CUT,l.COPY,l.PASTE].includes(t.code)||!t.ctrlKey&&!t.metaKey)return t.code===l.ESCAPE?(t.preventDefault(),void this.toggleDropdown(!1)):void setTimeout((()=>{const t=this.contentEditor.innerText;this.emitInputChange(),t.includes(this.tagIdentifier)?(this.insertNodes(this.contentEditor,this.contentEditor.childNodes),this.filterOptions(),this.toggleDropdown(!0)):this.toggleDropdown(!1)}),10)}else t.preventDefault()}filterOptions(){this.filteredOptions=this.options,this.filteredValue=this.filteredValue.trim(),this.options.length&&this.filteredValue?this.filteredOptions=this.options.filter((t=>t.includes(this.filteredValue))):this.filteredOptions=this.options}generateValuesFromHTMLTags(t){this.error=!!t.match(/<span class="chips chip-error" contenteditable="false">(.*?)<\/span>/g);return t.replace(/<span class="chips(?: chip-error)?" contenteditable="false">(.*?)<\/span>/g,((t,i)=>"{{"+i+"}}"))}generateHTMLTagsWithValues(t){return t.replace(/{{(.*?)}}/g,((t,i)=>this.options.includes(i)?'<span class="chips" contenteditable="false">'+i+"</span>":this.setError(i)))}setError(t){return this.error=!0,'<span class="chips chip-error" contenteditable="false">'+t+"</span>"}emitInputChange(){if(this.contentEditor){let t=this.contentEditor.innerHTML;t=t.replace(/ /g," "),t=t.replace("<br>",""),this.emit("nile-change",{value:this.generateValuesFromHTMLTags(t)})}}insertNodes(t,i,s){[...i].forEach(((t,i)=>{if(t.hasChildNodes())s?this.insertNodes(t,t.childNodes,s):this.insertNodes(t,t.childNodes);else if(t.nodeValue?.includes(this.tagIdentifier))return s&&this.insertAutoOptionsTag(t,s),void this.setFilterValue(t.nodeValue)}))}insertAutoOptionsTag(t,i){const s=window.getSelection(),e=document.createRange(),h=t.nodeValue.indexOf(this.tagIdentifier);e.setStart(t,h),e.insertNode(i),e.setStartAfter(i),e.collapse(!0),s?.removeAllRanges(),s?.addRange(e),i.nextSibling?.nodeValue&&(i.nextSibling.nodeValue=i.nextSibling?.nodeValue?.replace(this.tagIdentifier+this.filteredValue,"")),this.contentEditor.focus()}setFilterValue(t){this.openDropdown||(this.replaceText=t.split(this.tagIdentifier).slice(1).join()),t&&this.openDropdown?this.filteredValue=t?.split(this.tagIdentifier).slice(1).join().replace(this.replaceText,""):this.filteredValue=""}handleOptions(t){this.toggleDropdown(!1);let i=document.createElement("span");i.setAttribute("class","chips"),i.setAttribute("contentEditable","false"),i.innerText=t,this.insertNodes(this.contentEditor,this.contentEditor.childNodes,i),this.resetOptions(),this.emitInputChange()}resetOptions(){this.filteredOptions=this.options,this.filteredValue=""}renderAutoOptions(){return i`<div
|
2
2
|
class="${n({"nile-options-container":!0,"dropdown-position":"text-area"===this.type})}"
|
3
3
|
>
|
4
4
|
${this.filteredOptions&&this.filteredOptions.map((t=>i` <nile-option
|
@@ -6,7 +6,7 @@ import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
|
|
6
6
|
@click="${i=>{this.handleOptions(t)}}"
|
7
7
|
>${t}
|
8
8
|
</nile-option>`))}
|
9
|
-
</div>`}render(){const t=!!this.helpText,s=!!this.error,e=!!this.errorMessage,
|
9
|
+
</div>`}render(){const t=!!this.helpText,s=!!this.error,e=!!this.errorMessage,h=!!this.readonly,o=!!this.noborder,r=this.type;return i`
|
10
10
|
<nile-popup
|
11
11
|
.active="${p(this.openDropdown)}"
|
12
12
|
sync="width"
|
@@ -17,9 +17,9 @@ import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
|
|
17
17
|
<div class="content-editable-wrapper" slot="anchor">
|
18
18
|
${this.showLabel&&this.labelText?i`<label class="ods-label">${this.labelText} </label> ${this.required?i`<span class="asterik">*</span>`:""}`:""}
|
19
19
|
<div
|
20
|
-
contenteditable="${!
|
20
|
+
contenteditable="${!h}"
|
21
21
|
spellcheck="false"
|
22
|
-
class=${n({"content-editable-input":!0,error:s||e,"read-only":
|
22
|
+
class=${n({"content-editable-input":!0,error:s||e,"read-only":h,"no-border":o,"text-area":"text-area"===r})}
|
23
23
|
@keydown=${this.handlekeyDown}
|
24
24
|
></div>
|
25
25
|
${t?i`
|
@@ -33,4 +33,4 @@ import{__decorate as t}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
|
|
33
33
|
</div>
|
34
34
|
${this.filteredOptions&&this.filteredOptions.length?this.renderAutoOptions():null}
|
35
35
|
</nile-popup>
|
36
|
-
`}};c.styles=
|
36
|
+
`}};c.styles=o,t([d()],c.prototype,"value",void 0),t([d()],c.prototype,"options",void 0),t([d()],c.prototype,"filteredOptions",void 0),t([d()],c.prototype,"showLabel",void 0),t([d()],c.prototype,"labelText",void 0),t([d()],c.prototype,"type",void 0),t([d()],c.prototype,"required",void 0),t([s(".content-editable-input")],c.prototype,"contentEditor",void 0),t([s(".nile-options-container")],c.prototype,"autoOptions",void 0),t([e()],c.prototype,"openDropdown",void 0),t([d({attribute:"help-text"})],c.prototype,"helpText",void 0),t([d({attribute:"readonly"})],c.prototype,"readonly",void 0),t([d({attribute:"error-message"})],c.prototype,"errorMessage",void 0),t([d({attribute:"error"})],c.prototype,"error",void 0),t([d({attribute:"noborder"})],c.prototype,"noborder",void 0),t([e()],c.prototype,"initialValue",void 0),t([a(["type","value"],{waitUntilFirstUpdate:!0})],c.prototype,"handleTypeChange",null),c=t([h("nile-content-editor")],c);export{c as N};
|
@@ -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,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.inputType;return i(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["<nile-select\n .placeholder=","\n .disabled=\"","\"\n .multiple=\"","\"\n @nile-change=","\n >\n ","\n </nile-select>"])),s,o,n,function(e){_this2.handleChange(e,t,l);},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>"])),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;return i(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["<nile-radio-group\n .value=","\n .disabled=","\n @change=","\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);}));}},{key:"renderContentEditor",value:function renderContentEditor(e,t){var _this6=this;var r=e.value,n=e.options,s=e.inputType,o=e.errorMessage,l=e.type,a=e.readonly,c=e.noborder;return i(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["<nile-content-editor\n .value=","\n .options=","\n .type=","\n .readonly=","\n .noborder=","\n .errorMessage=","\n @nile-change=","\n >\n </nile-content-editor>"])),r,n,l,a,c,o,function(e){_this6.handleChange(e,t,s);});}},{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(_templateObject9||(_templateObject9=_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(_templateObject10||(_templateObject10=_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(_templateObject11||(_templateObject11=_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","../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 </nile-radio-group>\n ",""])),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;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>"])),this.value,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),e([l()],d.prototype,"value",void 0),_export("N",d=e([t("nile-switcher")],d));}};});
|
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 inputType: inputTypeName,\n } = Input;\n return html`<nile-select\n .placeholder=${placeholder}\n .disabled=\"${disabled}\"\n .multiple=\"${multiple}\"\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 renderNileRadio(Input: switchInputType, inputType: string) {\n const { options, value, disabled, inputType: inputTypeName } = Input;\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 </nile-radio-group>`;\n }\n\n renderContentEditor(Input: switchInputType, inputType: string) {\n const {\n value,\n options,\n inputType: inputTypeName,\n errorMessage,\n type,\n readonly,\n noborder,\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","_this2","options","multiple","_templateObject2","map","option","_templateObject3","renderNileTextArea","readonly","_templateObject4","renderNileCheckBox","_templateObject5","renderNileRadio","_templateObject6","_templateObject7","renderContentEditor","type","noborder","_templateObject8","event","nileSwitchConfig","detail","checked","stopPropagation","config","renderIcon","defaultInput","switchInput","defaultHelperText","helperText","switchHelperText","icon","toggleSwitch","concat","_templateObject9","classMap","toggleField","confirmation","_objectSpread","singleFieldSwitcher","disable","defaultInputType","switchInputType","_templateObject10","choose","render","_this$nileSwitchConfi","_templateObject11","NileElement","styles","__decorate","property","Object","prototype","customElement"],"mappings":"+9KA8DA,CAAA,SAAYA,CACVA,CAAAA,CAAAA,CAAAA,CAAAC,OAAA,CAAA,cAAA,CACAD,EAAAE,MAAA,CAAA,aACD,EAHD,C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AA,WAAAtE,CAAA,GA5R+B8E,CAQhC,GAHOjF,EAAMkF,MAAmBA,CAAAA,CAAAA,CACJC,EAAA,CAA3BC,CAAAA,CAAS,CAAEnC,IAAMoC,CAAAA,MAAAA,CAAAA,CAAAA,CAAAA,CAAyCrF,CAAAsF,CAAAA,SAAAA,CAAA,uBAAA,EANhDtF,CAAAA,CAAAA,OAAAA,KAAAA,CAAAA,CAAYmF,EAAA,CADxBI,CAAAA,CAAc,kBACFvF"}
|
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 @property() value: string;\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 </nile-radio-group>\n ${haserrorMessage ? this.renderErrorMessage(errorMessage) : ''}`;\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 } = Input;\n return html`<nile-content-editor\n .value=${this.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,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,CAAA,CAAAC,QAAA,CAAA,WACAD,CAAA,CAAAE,IAAA,CAAA,MACAF,CAAAA,CAAAA,CAAAG,QAAA,CAAA,UAAA,CACAH,EAAAI,QAAA,CAAA,WAAA,CACAJ,CAAA,CAAAK,KAAA,CAAA,OACAL,CAAAA,CAAAA,CAAAM,cAAA,gBACD,EAPD,CAAYN,CAAAA,GAAAA,CAAAA,CAOX,CAAA,CAGM,CAAA,CAAA,CAAAO,OAAA,KAAMC,CAAN,uBAAAC,EAAA,EAAAC,SAAA,CAAAC,CAAA,CAAAF,EAAA,MAAAG,MAAA,CAAAC,YAAA,CAAAF,CAAA,WAAAA,EAAA,EAAAG,eAAA,MAAAH,CAAA,SAAAC,MAAA,CAAAG,KAAA,MAAAC,SAAA,GAAAC,YAAA,CAAAN,CAAA,GAAAO,GAAA,qBAAAC,KAAA,CAUL,SAAAC,kBAAA,EACEC,IAAAA,CAAAA,eAAAA,CAAAA,CAAAA,CAAAA,SAAAA,4BAAAA,IAAAA,OACAC,KAAKC,IAAK,CAAA,WAAA,CACX,EAED,GAAAL,GAA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,CAAA,CAAA,CADxBI,CAAc,CAAA,eAAA,CAAA,CAAA,CACFzF"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var i,_templateObject,
|
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 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: 99%;\n min-width: 99%;\n }\n\n nile-icon {\n max-height: 38px;\n }\n\n nile-radio {\n display: inline-block;\n padding-right: 10px;\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
|
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 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: 99%;\n min-width: 99%;\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,7 +1,5 @@
|
|
1
|
-
import{i}from"../index-cd2f9c12.esm.js";const
|
1
|
+
import{i}from"../index-cd2f9c12.esm.js";const n=i`
|
2
2
|
:host {
|
3
|
-
display: inline-block;
|
4
|
-
width: 100%;
|
5
3
|
box-sizing: border-box;
|
6
4
|
}
|
7
5
|
|
@@ -13,19 +11,17 @@ import{i}from"../index-cd2f9c12.esm.js";const o=i`
|
|
13
11
|
gap: 0.5rem;
|
14
12
|
}
|
15
13
|
|
16
|
-
.
|
17
|
-
|
18
|
-
|
19
|
-
flex-shrink: 0;
|
14
|
+
.input-container > :first-child {
|
15
|
+
max-width: 99%;
|
16
|
+
min-width: 99%;
|
20
17
|
}
|
21
18
|
|
22
|
-
|
23
|
-
|
24
|
-
flex-shrink: 0;
|
19
|
+
nile-icon {
|
20
|
+
max-height: 38px;
|
25
21
|
}
|
26
22
|
|
27
23
|
nile-radio {
|
28
24
|
display: inline-block;
|
29
25
|
padding-right: 10px;
|
30
26
|
}
|
31
|
-
`;export{
|
27
|
+
`;export{n as s};
|
@@ -1,17 +1,20 @@
|
|
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,
|
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,d;!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"}(d||(d={}));let c=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:d,inputType:c}=e;return i`<nile-input
|
2
2
|
.value=${r}
|
3
3
|
.label=${n}
|
4
4
|
.disabled=${o}
|
5
5
|
.required=${l}
|
6
|
-
.errorMessage=${
|
6
|
+
.errorMessage=${d}
|
7
7
|
.placeholder=${s}
|
8
8
|
.error=${a}
|
9
|
-
@nile-input=${e=>{this.handleChange(e,t,
|
10
|
-
></nile-input>`}renderDropdown(e,t){const{options:r,multiple:n,placeholder:s,disabled:o,inputType:
|
9
|
+
@nile-input=${e=>{this.handleChange(e,t,c)}}
|
10
|
+
></nile-input>`}renderDropdown(e,t){const{options:r,multiple:n,placeholder:s,disabled:o,value:l,error:a,errorMessage:d,inputType:c}=e;return i`<nile-select
|
11
11
|
.placeholder=${s}
|
12
12
|
.disabled="${o}"
|
13
13
|
.multiple="${n}"
|
14
|
-
|
14
|
+
.value="${l}"
|
15
|
+
.error="${a}"
|
16
|
+
.errorMessage="${d}"
|
17
|
+
@nile-change=${e=>{this.handleChange(e,t,c)}}
|
15
18
|
>
|
16
19
|
${r?.map((e=>i`<nile-option .value="${e}">${e} </nile-option>`))}
|
17
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,26 +25,30 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
|
|
22
25
|
.errorMessage=${o}
|
23
26
|
@nile-input=${e=>{this.handleChange(e,t,a)}}
|
24
27
|
></nile-textarea>`}renderNileCheckBox(e,t){const{value:r,label:n,disabled:s,inputType:o}=e;return i`<nile-checkbox
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
.
|
38
|
-
|
39
|
-
|
40
|
-
.
|
41
|
-
.
|
42
|
-
|
28
|
+
.checked=${r}
|
29
|
+
.label=${n}
|
30
|
+
.disabled=${s}
|
31
|
+
@valueChange=${e=>{this.handleChange(e,t,o)}}
|
32
|
+
></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}
|
35
|
+
.disabled=${s}
|
36
|
+
@change=${e=>{this.handleChange(e,t,o)}}
|
37
|
+
>
|
38
|
+
${r&&r.map((e=>i`<nile-radio .value="${e}">${e} </nile-radio>`))}
|
39
|
+
</nile-radio-group>
|
40
|
+
${a?this.renderErrorMessage(l):""}`}renderErrorMessage(e){return i`
|
41
|
+
<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}=e;return i`<nile-content-editor
|
43
|
+
.value=${this.value}
|
44
|
+
.options=${r}
|
45
|
+
.type=${o}
|
46
|
+
.readonly=${l}
|
47
|
+
.noborder=${a}
|
48
|
+
.errorMessage=${s}
|
49
|
+
@nile-change=${e=>{this.handleChange(e,t,n)}}
|
43
50
|
>
|
44
|
-
</nile-content-editor>`}handleChange(e,i,t){t===
|
51
|
+
</nile-content-editor>`}handleChange(e,i,t){t===d.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
|
45
52
|
class=${o({"tooltip-container":!0})}
|
46
53
|
content=${l}
|
47
54
|
placement="bottom"
|
@@ -54,8 +61,8 @@ import{__decorate as e}from"tslib";import{x as i}from"../index-cd2f9c12.esm.js";
|
|
54
61
|
@click=${this.toggleField}
|
55
62
|
></nile-icon>
|
56
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`
|
57
|
-
${r?s(l,[[
|
64
|
+
${r?s(l,[[d.TEXTAREA,()=>this.renderNileTextArea(t,a.SWITCH)],[d.TEXT,()=>this.renderNileText(t,a.SWITCH)],[d.CONTENTEDITOR,()=>this.renderContentEditor(t,a.SWITCH)]],(()=>this.renderNileTextArea(t,a.SWITCH))):s(o,[[d.TEXT,()=>this.renderNileText(e,a.DEFAULT)],[d.CHECKBOX,()=>this.renderNileCheckBox(e,a.DEFAULT)],[d.TEXTAREA,()=>this.renderNileTextArea(e,a.DEFAULT)],[d.RADIO,()=>this.renderNileRadio(e,a.DEFAULT)],[d.DROPDOWN,()=>this.renderDropdown(this.nileSwitchConfig.defaultInput,a.DEFAULT)],[d.CONTENTEDITOR,()=>this.renderContentEditor(this.nileSwitchConfig.defaultInput,a.DEFAULT)]],(()=>this.renderNileText(e,a.DEFAULT)))}
|
58
65
|
${n?"":this.renderIcon(e,t)}
|
59
66
|
`}render(){const{toggleSwitch:e,defaultInput:t,switchInput:r,disable:n}=this.nileSwitchConfig;return i`<div class="input-container">
|
60
67
|
${this.singleFieldSwitcher(t,r,e,!!n)}
|
61
|
-
</div>`}};
|
68
|
+
</div>`}};c.styles=r,e([l({type:Object})],c.prototype,"nileSwitchConfig",void 0),e([l()],c.prototype,"value",void 0),c=e([t("nile-switcher")],c);export{c as N};
|
@@ -1,2 +1,2 @@
|
|
1
|
-
System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var o,_templateObject,a;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",a=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n [hidden] {\n display: none !important;\n }\n\n :host {\n display: inline-block;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n border-radius: 8px;\n color: var(--nile-colors-dark-500);\n padding: 4px 4px 12px 4px;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n transition: 0.2s box-shadow, 0.2s color;\n font-family: Colfax-regular;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px;\n letter-spacing: 0.2px;\n }\n\n .tab:hover:not(.tab--disabled) {\n color: var(--nile-colors-dark-
|
1
|
+
System.register(["../index-cd83c5c8.cjs.js"],function(_export,_context){"use strict";var o,_templateObject,a;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",a=o(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n [hidden] {\n display: none !important;\n }\n\n :host {\n display: inline-block;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n border-radius: 8px;\n color: var(--nile-colors-dark-500);\n padding: 4px 4px 12px 4px;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n transition: 0.2s box-shadow, 0.2s color;\n font-family: Colfax-regular;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px;\n letter-spacing: 0.2px;\n }\n\n .tab:hover:not(.tab--disabled) {\n color: var(--nile-colors-dark-900);\n }\n\n .tab:focus {\n outline: none;\n }\n\n .tab:focus-visible:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--active:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--closable {\n padding-inline-end: 4px;\n }\n\n .tab.tab--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .tab__close-button {\n font-size: 14px;\n margin-inline-start: 4px;\n }\n\n .tab__close-button::part(base) {\n padding: 3px;\n }\n\n @media (forced-colors: active) {\n .tab.tab--active:not(.tab--disabled) {\n outline: solid 1px transparent;\n outline-offset: -3px;\n }\n }\n"]))));}};});
|
2
2
|
//# sourceMappingURL=nile-tab.css.cjs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"nile-tab.css.cjs.js","sources":["../../../src/nile-tab/nile-tab.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 * Tab CSS\n */\nexport const styles = css`\n [hidden] {\n display: none !important;\n }\n\n :host {\n display: inline-block;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n border-radius: 8px;\n color: var(--nile-colors-dark-500);\n padding: 4px 4px 12px 4px;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n transition: 0.2s box-shadow, 0.2s color;\n font-family: Colfax-regular;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px;\n letter-spacing: 0.2px;\n }\n\n .tab:hover:not(.tab--disabled) {\n color: var(--nile-colors-dark-
|
1
|
+
{"version":3,"file":"nile-tab.css.cjs.js","sources":["../../../src/nile-tab/nile-tab.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 * Tab CSS\n */\nexport const styles = css`\n [hidden] {\n display: none !important;\n }\n\n :host {\n display: inline-block;\n }\n\n .tab {\n display: inline-flex;\n align-items: center;\n border-radius: 8px;\n color: var(--nile-colors-dark-500);\n padding: 4px 4px 12px 4px;\n white-space: nowrap;\n user-select: none;\n cursor: pointer;\n transition: 0.2s box-shadow, 0.2s color;\n font-family: Colfax-regular;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 16px;\n letter-spacing: 0.2px;\n }\n\n .tab:hover:not(.tab--disabled) {\n color: var(--nile-colors-dark-900);\n }\n\n .tab:focus {\n outline: none;\n }\n\n .tab:focus-visible:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--active:not(.tab--disabled) {\n color: var(--nile-colors-primary-600);\n }\n\n .tab.tab--closable {\n padding-inline-end: 4px;\n }\n\n .tab.tab--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .tab__close-button {\n font-size: 14px;\n margin-inline-start: 4px;\n }\n\n .tab__close-button::part(base) {\n padding: 3px;\n }\n\n @media (forced-colors: active) {\n .tab.tab--active:not(.tab--disabled) {\n outline: solid 1px transparent;\n outline-offset: -3px;\n }\n }\n`;\n\nexport default [styles];\n"],"names":["styles","css","_templateObject","_taggedTemplateLiteral"],"mappings":"gXAYaA,CAAAA,CAASC,CAAG,CAAAC,eAAA,GAAAA,eAAA,CAAAC,sBAAA"}
|
@@ -10,7 +10,6 @@ import { css } from 'lit-element';
|
|
10
10
|
*/
|
11
11
|
export const styles = css `
|
12
12
|
:host {
|
13
|
-
width: 100%;
|
14
13
|
box-sizing: border-box;
|
15
14
|
font-size: 14px;
|
16
15
|
}
|
@@ -23,7 +22,7 @@ export const styles = css `
|
|
23
22
|
|
24
23
|
.dropdown-position {
|
25
24
|
position: relative;
|
26
|
-
bottom:
|
25
|
+
bottom: 1px;
|
27
26
|
}
|
28
27
|
.content-editable-input {
|
29
28
|
box-sizing: border-box;
|
@@ -31,6 +30,7 @@ export const styles = css `
|
|
31
30
|
padding: 9px;
|
32
31
|
border: 1px solid #c7ced4;
|
33
32
|
border-radius: 4px;
|
33
|
+
overflow: auto;
|
34
34
|
overflow-x: auto;
|
35
35
|
overflow-anchor: none;
|
36
36
|
scrollbar-width: none;
|
@@ -49,6 +49,8 @@ export const styles = css `
|
|
49
49
|
}
|
50
50
|
|
51
51
|
.read-only {
|
52
|
+
background-color: hsl(240 4.8% 95.9%);
|
53
|
+
opacity: 0.5;
|
52
54
|
cursor: not-allowed;
|
53
55
|
}
|
54
56
|
|
@@ -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
|
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"]}
|
@@ -38,14 +38,15 @@ export declare class NileContentEditor extends NileElement {
|
|
38
38
|
errorMessage: string;
|
39
39
|
error: boolean;
|
40
40
|
noborder: boolean;
|
41
|
+
initialValue: string;
|
41
42
|
static styles: CSSResultGroup;
|
42
43
|
connectedCallback(): void;
|
43
|
-
setInitialValues(): void;
|
44
44
|
addOpenListeners(): void;
|
45
45
|
removeOpenListeners(): void;
|
46
|
+
handleOutsideClick(event: any): void;
|
46
47
|
handleClipboardEvent(event: Event): Promise<void>;
|
47
48
|
toggleDropdown(value: boolean): void;
|
48
|
-
|
49
|
+
setInitialValues(): void;
|
49
50
|
handleTypeChange(): void;
|
50
51
|
disconnectedCallback(): void;
|
51
52
|
private handlekeyDown;
|
@@ -54,8 +55,12 @@ export declare class NileContentEditor extends NileElement {
|
|
54
55
|
generateHTMLTagsWithValues(string: any): string;
|
55
56
|
setError(option: any): string;
|
56
57
|
emitInputChange(): void;
|
57
|
-
|
58
|
+
replaceText: string;
|
59
|
+
insertNodes(parentNode: Node, childNodes: NodeList, autoOptionsTag?: HTMLElement): void;
|
60
|
+
insertAutoOptionsTag(node: any, autoOptionsTag: any): void;
|
61
|
+
setFilterValue(value: any): void;
|
58
62
|
handleOptions(option: any): void;
|
63
|
+
resetOptions(): void;
|
59
64
|
renderAutoOptions(): TemplateResult;
|
60
65
|
render(): TemplateResult;
|
61
66
|
}
|