@lrnwebcomponents/hax-body-behaviors
Advanced tools
Comparing version 0.0.19 to 0.0.20
@@ -1,79 +0,5 @@ | ||
import { HAXWiring } from "./lib/HAXWiring.js"; | ||
class HaxBodyBehaviors extends HTMLElement { | ||
getTemplate() { | ||
return ` | ||
import{HAXWiring}from"./lib/HAXWiring.js";class HaxBodyBehaviors extends HTMLElement{getTemplate(){return` | ||
<style> | ||
</style> | ||
`; | ||
} | ||
static get properties() { | ||
return {}; | ||
} | ||
static get tag() { | ||
return "hax-body-behaviors"; | ||
} | ||
get templateUrl() { | ||
return "hax-body-behaviors.html"; | ||
} | ||
get propertiesUrl() { | ||
return "hax-body-behaviors-properties.json"; | ||
} | ||
get styleUrl() { | ||
return "hax-body-behaviors.css"; | ||
} | ||
constructor(delayRender = !1) { | ||
super(); | ||
this.tag = HaxBodyBehaviors.tag; | ||
this.HAXWiring = new HAXWiring(); | ||
let obj = HaxBodyBehaviors.properties; | ||
for (let p in obj) { | ||
if (obj.hasOwnProperty(p)) { | ||
this[p] = obj[p].value; | ||
} | ||
} | ||
this._queue = []; | ||
this.template = document.createElement("template"); | ||
this.attachShadow({ mode: "open" }); | ||
if (!delayRender) { | ||
this.render(); | ||
} | ||
} | ||
connectedCallback() { | ||
if (window.ShadyCSS) { | ||
window.ShadyCSS.styleElement(this); | ||
} | ||
if (this._queue.length) { | ||
this._processQueue(); | ||
} | ||
} | ||
_copyAttribute(name, to) { | ||
const recipients = this.shadowRoot.querySelectorAll(to), | ||
value = this.getAttribute(name), | ||
fname = null == value ? "removeAttribute" : "setAttribute"; | ||
for (const node of recipients) { | ||
node[fname](name, value); | ||
} | ||
} | ||
_queueAction(action) { | ||
this._queue.push(action); | ||
} | ||
_processQueue() { | ||
this._queue.forEach(action => { | ||
this[`_${action.type}`](action.data); | ||
}); | ||
this._queue = []; | ||
} | ||
_setProperty({ name, value }) { | ||
this[name] = value; | ||
} | ||
render() { | ||
this.shadowRoot.innerHTML = null; | ||
this.template.innerHTML = this.html; | ||
if (window.ShadyCSS) { | ||
window.ShadyCSS.prepareTemplate(this.template, this.tag); | ||
} | ||
this.shadowRoot.appendChild(this.template.content.cloneNode(!0)); | ||
} | ||
} | ||
window.customElements.define(HaxBodyBehaviors.tag, HaxBodyBehaviors); | ||
`}static get properties(){return{}}static get tag(){return"hax-body-behaviors"}get templateUrl(){return"hax-body-behaviors.html"}get propertiesUrl(){return"hax-body-behaviors-properties.json"}get styleUrl(){return"hax-body-behaviors.css"}constructor(delayRender=!1){super();this.tag=HaxBodyBehaviors.tag;this.HAXWiring=new HAXWiring;let obj=HaxBodyBehaviors.properties;for(let p in obj){if(obj.hasOwnProperty(p)){this[p]=obj[p].value}}this._queue=[];this.template=document.createElement("template");this.attachShadow({mode:"open"});if(!delayRender){this.render()}}connectedCallback(){if(window.ShadyCSS){window.ShadyCSS.styleElement(this)}if(this._queue.length){this._processQueue()}}_copyAttribute(name,to){const recipients=this.shadowRoot.querySelectorAll(to),value=this.getAttribute(name),fname=null==value?"removeAttribute":"setAttribute";for(const node of recipients){node[fname](name,value)}}_queueAction(action){this._queue.push(action)}_processQueue(){this._queue.forEach(action=>{this[`_${action.type}`](action.data)});this._queue=[]}_setProperty({name,value}){this[name]=value}render(){this.shadowRoot.innerHTML=null;this.template.innerHTML=this.html;if(window.ShadyCSS){window.ShadyCSS.prepareTemplate(this.template,this.tag)}this.shadowRoot.appendChild(this.template.content.cloneNode(!0))}}window.customElements.define(HaxBodyBehaviors.tag,HaxBodyBehaviors); |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.0.19", | ||
"version": "0.0.20", | ||
"description": "Wire any element up to HAX", | ||
@@ -51,3 +51,3 @@ "repository": { | ||
}, | ||
"gitHead": "e7e556d70d4f43c46bfb1ec331dc5d9408464c03" | ||
"gitHead": "ec3be2a2e69e26a379759cd94667ecb5c43bca8a" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147
495441
3249