Skip to content

Commit

Permalink
v4.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rjcorwin committed Oct 7, 2019
1 parent 6a1adc8 commit 52661a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4842,6 +4842,9 @@ const _=s.a`<iron-iconset-svg name="editor" size="24">
.text-outer {
position: relative;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.text-inner {
/*
Expand Down Expand Up @@ -5223,7 +5226,7 @@ const _=s.a`<iron-iconset-svg name="editor" size="24">
</style>
<div class="container">
</div>
`}static get properties(){return{name:{type:String,value:"",reflectToAttribute:!0},value:{type:Array,value:[],reflectToAttribute:!0},atLeast:{type:Number,value:0,reflectToAttribute:!0},required:{type:Boolean,value:!1,reflectToAttribute:!0},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},label:{type:String,value:""},hidden:{type:Boolean,value:!1,reflectToAttribute:!0},incomplete:{type:Boolean,value:!0,reflectToAttribute:!0},invalid:{type:Boolean,value:!1,reflectToAttribute:!0},optionsListSource:{type:String,value:""},optionsListProperties:{type:String,value:""},optionsListExcludes:{type:String,value:""},optionsListExcludeBy:{type:String,value:""}}}get optionsList(){return this._optionsList?this._optionsList:void 0}set optionsList(e){this._optionsList=e}connectedCallback(){super.connectedCallback();let e=this;const t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===this.readyState&&200===this.status)try{e.optionsList=[];let t=JSON.parse(this.responseText),i=e.optionsListProperties.split(","),n=e.optionsListExcludes.split(","),r=i[0],a=i[1];for(let i of t){let t=!1;for(let r of n)i[e.optionsListExcludeBy]===r&&(t=!0);if(!t){let t={value:i[r],innerHTML:i[a]};e.optionsList.push(t)}}e.render(),e.dispatchEvent(new CustomEvent("checkbox-options-loaded"))}catch(e){}},t.open("GET",this.optionsListSource),t.send()}render(){let e=this.shadowRoot.querySelector(".container"),t=document.createElement("tangy-checkboxes");for(let e of this.optionsList){let i=document.createElement("option");i.name=e.value,i.innerHTML=e.innerHTML;try{t.appendChild(i)}catch(e){console.log("e: "+e)}}e.appendChild(t)}}window.customElements.define(R.is,R);class P extends n.a{static get template(){return n.b``}static get is(){return"tangy-radio-button"}static get properties(){return{hideButton:{type:Boolean,value:!1,reflectToAttribute:!0},name:{type:String,value:"",reflectToAttribute:!0},label:{type:String,value:""},required:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},disabled:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},invalid:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},incomplete:{type:Boolean,value:!0,reflectToAttribute:!0},hidden:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},value:{type:String,value:"",observer:"render",reflectToAttribute:!0}}}connectedCallback(){super.connectedCallback(),this.render()}render(){this.shadowRoot.innerHTML=` \n <style include="tangy-common-styles"></style>\n <style include="tangy-element-styles"></style>\n <style>\n .hint-text {\n color: gray;\n font-size: 0.8rem;\n font-weight: lighter;\n }\n </style>\n <paper-radio-button\n ${this.required?"required":""}\n ${this.invalid?"invalid":""}\n ${this.disabled?"disabled":""}\n ${this.hidden?"hidden":""}\n ${this.value?"checked":""}\n >\n <div>\n ${this.label?this.label:this.innerHTML}\n </div>\n ${this.hasAttribute("hint-text")?`\n <label class="hint-text">\n ${this.getAttribute("hint-text")}\n </label>\n `:""}\n </paper-radio-button>\n `,this.hideButton&&(this.shadowRoot.querySelector("paper-radio-button").shadowRoot.querySelector("#radioContainer").style.display="none"),this.shadowRoot.querySelector("paper-radio-button").addEventListener("change",e=>{e.stopPropagation();let t=!e.target.checked;this.value=e.target.checked?"on":"",this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("INPUT_VALUE_CHANGE",{bubbles:!0,detail:{inputName:this.name,inputValue:!!e.target.checked,inputIncomplete:t,inputInvalid:!this.shadowRoot.querySelector("paper-radio-button").validate()}}))})}}window.customElements.define(P.is,P);class B extends n.a{static get is(){return"tangy-radio-buttons"}constructor(){super(),this.value=[],this.t={selectOnlyOne:Object(h.a)("Select only one")}}static get template(){return n.b`
`}static get properties(){return{name:{type:String,value:"",reflectToAttribute:!0},value:{type:Array,value:[],reflectToAttribute:!0},atLeast:{type:Number,value:0,reflectToAttribute:!0},required:{type:Boolean,value:!1,reflectToAttribute:!0},disabled:{type:Boolean,value:!1,reflectToAttribute:!0},label:{type:String,value:""},hidden:{type:Boolean,value:!1,reflectToAttribute:!0},incomplete:{type:Boolean,value:!0,reflectToAttribute:!0},invalid:{type:Boolean,value:!1,reflectToAttribute:!0},optionsListSource:{type:String,value:""},optionsListProperties:{type:String,value:""},optionsListExcludes:{type:String,value:""},optionsListExcludeBy:{type:String,value:""}}}get optionsList(){return this._optionsList?this._optionsList:void 0}set optionsList(e){this._optionsList=e}connectedCallback(){super.connectedCallback();let e=this;const t=new XMLHttpRequest;t.onreadystatechange=function(){if(4===this.readyState&&200===this.status)try{e.optionsList=[];let t=JSON.parse(this.responseText),i=e.optionsListProperties.split(","),n=e.optionsListExcludes.split(","),r=i[0],a=i[1];for(let i of t){let t=!1;for(let r of n)i[e.optionsListExcludeBy]===r&&(t=!0);if(!t){let t={name:i[r],innerHTML:i[a]};e.optionsList.push(t)}}e.render(),e.dispatchEvent(new CustomEvent("checkbox-options-loaded"))}catch(e){}},t.open("GET",this.optionsListSource),t.send()}render(){let e=this.shadowRoot.querySelector(".container"),t=document.createElement("tangy-checkboxes");for(let e of this.optionsList){let i=document.createElement("option");i.name=e.name,i.value=e.name,i.innerHTML=e.innerHTML;try{t.appendChild(i)}catch(e){console.log("e: "+e)}}let i=[];t.addEventListener("change",this.onCheckboxesClick.bind(this)),i=t.getProps(),(!this.value||"object"==typeof this.value&&this.value.length<i.length)&&(this.value=i),e.appendChild(t)}onCheckboxesClick(e){let t=[];t=this.shadowRoot.querySelector("tangy-checkboxes").getProps(),this.value=t.value,this.dispatchEvent(new CustomEvent("change"))}}window.customElements.define(R.is,R);class P extends n.a{static get template(){return n.b``}static get is(){return"tangy-radio-button"}static get properties(){return{hideButton:{type:Boolean,value:!1,reflectToAttribute:!0},name:{type:String,value:"",reflectToAttribute:!0},label:{type:String,value:""},required:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},disabled:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},invalid:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},incomplete:{type:Boolean,value:!0,reflectToAttribute:!0},hidden:{type:Boolean,value:!1,observer:"render",reflectToAttribute:!0},value:{type:String,value:"",observer:"render",reflectToAttribute:!0}}}connectedCallback(){super.connectedCallback(),this.render()}render(){this.shadowRoot.innerHTML=` \n <style include="tangy-common-styles"></style>\n <style include="tangy-element-styles"></style>\n <style>\n .hint-text {\n color: gray;\n font-size: 0.8rem;\n font-weight: lighter;\n }\n </style>\n <paper-radio-button\n ${this.required?"required":""}\n ${this.invalid?"invalid":""}\n ${this.disabled?"disabled":""}\n ${this.hidden?"hidden":""}\n ${this.value?"checked":""}\n >\n <div>\n ${this.label?this.label:this.innerHTML}\n </div>\n ${this.hasAttribute("hint-text")?`\n <label class="hint-text">\n ${this.getAttribute("hint-text")}\n </label>\n `:""}\n </paper-radio-button>\n `,this.hideButton&&(this.shadowRoot.querySelector("paper-radio-button").shadowRoot.querySelector("#radioContainer").style.display="none"),this.shadowRoot.querySelector("paper-radio-button").addEventListener("change",e=>{e.stopPropagation();let t=!e.target.checked;this.value=e.target.checked?"on":"",this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.dispatchEvent(new CustomEvent("INPUT_VALUE_CHANGE",{bubbles:!0,detail:{inputName:this.name,inputValue:!!e.target.checked,inputIncomplete:t,inputInvalid:!this.shadowRoot.querySelector("paper-radio-button").validate()}}))})}}window.customElements.define(P.is,P);class B extends n.a{static get is(){return"tangy-radio-buttons"}constructor(){super(),this.value=[],this.t={selectOnlyOne:Object(h.a)("Select only one")}}static get template(){return n.b`
<style include="tangy-element-styles"></style>
<style include="tangy-common-styles"></style>

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tangy-form",
"description": "A form element for lazy loaded multipage forms",
"version": "4.3.2",
"version": "4.3.3",
"main": "tangy-form.js",
"scripts": {
"start": "polymer serve",
Expand Down

0 comments on commit 52661a4

Please sign in to comment.