From 52661a4452efbf5ef47e6656d1d22daaf4bf77d8 Mon Sep 17 00:00:00 2001 From: "R.J. Steinert" Date: Mon, 7 Oct 2019 12:36:09 -0400 Subject: [PATCH] v4.3.3 --- dist/bundle.js | 5 ++++- package.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/bundle.js b/dist/bundle.js index dd56ae4c..3719c1bb 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -4842,6 +4842,9 @@ const _=s.a` .text-outer { position: relative; height: 100%; + display: flex; + align-items: center; + justify-content: center; } .text-inner { /* @@ -5223,7 +5226,7 @@ const _=s.a`
- `}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 \n \n \n \n
\n ${this.label?this.label:this.innerHTML}\n
\n ${this.hasAttribute("hint-text")?`\n \n `:""}\n \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\n \n \n \n
\n ${this.label?this.label:this.innerHTML}\n
\n ${this.hasAttribute("hint-text")?`\n \n `:""}\n \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` diff --git a/package.json b/package.json index 8a4bee97..20e572a4 100644 --- a/package.json +++ b/package.json @@ -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",