@lrnwebcomponents/hax-body-behaviors
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -0,2 +1,16 @@ | ||
/** | ||
* Copyright 2018 The Pennsylvania State University | ||
* @license Apache-2.0, see License.md for full text. | ||
*/ | ||
import { HAXWiring } from "./lib/HAXWiring.js"; | ||
/** | ||
* `hax-body-behaviors` | ||
* `HAX Body Behaviors to utilize in any element` | ||
* | ||
* @microcopy - language worth noting: | ||
* - | ||
* | ||
* @customElement | ||
* @demo demo/index.html | ||
*/ | ||
class HaxBodyBehaviors extends HTMLElement { | ||
@@ -10,21 +24,47 @@ getTemplate() { | ||
} | ||
// properties available to the custom element for data binding | ||
static get properties() { | ||
return {}; | ||
} | ||
/** | ||
* Store the tag name to make it easier to obtain directly. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
static get tag() { | ||
return "hax-body-behaviors"; | ||
} | ||
/** | ||
* A file that contains the HTML template for the element. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
get templateUrl() { | ||
return "hax-body-behaviors.html"; | ||
} | ||
/** | ||
* A file that contains the properties that will be wired into this element. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
get propertiesUrl() { | ||
return "hax-body-behaviors-properties.json"; | ||
} | ||
/** | ||
* A file that contains the css for this element to be mixed into the html block. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
get styleUrl() { | ||
return "hax-body-behaviors.css"; | ||
} | ||
constructor(delayRender = !1) { | ||
/** | ||
* life cycle | ||
*/ | ||
constructor(delayRender = false) { | ||
super(); | ||
// set tag for later use | ||
this.tag = HaxBodyBehaviors.tag; | ||
this.HAXWiring = new HAXWiring(); | ||
//this.HAXWiring.setHaxProperties(props, HaxBodyBehaviors.tag, this); | ||
// map our imported properties json to real props on the element | ||
// @notice static getter of properties is built via tooling | ||
// to edit modify src/HaxBodyBehaviors-properties.json | ||
let obj = HaxBodyBehaviors.properties; | ||
@@ -36,5 +76,8 @@ for (let p in obj) { | ||
} | ||
// optional queue for future use | ||
this._queue = []; | ||
this.template = document.createElement("template"); | ||
this.attachShadow({ mode: "open" }); | ||
if (!delayRender) { | ||
@@ -44,2 +87,5 @@ this.render(); | ||
} | ||
/** | ||
* life cycle, element is afixed to the DOM | ||
*/ | ||
connectedCallback() { | ||
@@ -49,2 +95,3 @@ if (window.ShadyCSS) { | ||
} | ||
if (this._queue.length) { | ||
@@ -54,6 +101,7 @@ this._processQueue(); | ||
} | ||
_copyAttribute(name, to) { | ||
const recipients = this.shadowRoot.querySelectorAll(to), | ||
value = this.getAttribute(name), | ||
fname = null == value ? "removeAttribute" : "setAttribute"; | ||
const recipients = this.shadowRoot.querySelectorAll(to); | ||
const value = this.getAttribute(name); | ||
const fname = value == null ? "removeAttribute" : "setAttribute"; | ||
for (const node of recipients) { | ||
@@ -63,5 +111,7 @@ node[fname](name, value); | ||
} | ||
_queueAction(action) { | ||
this._queue.push(action); | ||
} | ||
_processQueue() { | ||
@@ -71,16 +121,26 @@ this._queue.forEach(action => { | ||
}); | ||
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)); | ||
this.shadowRoot.appendChild(this.template.content.cloneNode(true)); | ||
} | ||
//static get observedAttributes() { | ||
// return []; | ||
//} | ||
// disconnectedCallback() {} | ||
// attributeChangedCallback(attr, oldValue, newValue) {} | ||
} | ||
window.customElements.define(HaxBodyBehaviors.tag, HaxBodyBehaviors); |
import { storiesOf } from "@storybook/polymer"; | ||
import { withKnobs, text, boolean, number, color, object, array, date, select } from "@storybook/addon-knobs/polymer"; | ||
import { | ||
withKnobs, | ||
text, | ||
boolean, | ||
number, | ||
color, | ||
object, | ||
array, | ||
date, | ||
select | ||
} from "@storybook/addon-knobs/polymer"; | ||
import "./hax-body-behaviors"; | ||
const stories = storiesOf("Body", module); | ||
stories.addDecorator(withKnobs); | ||
stories.add("hax-body-behaviors", | ||
() => { | ||
stories.add("hax-body-behaviors", () => { | ||
return ` | ||
@@ -10,0 +18,0 @@ <hax-body-behaviors > |
@@ -1,139 +0,2 @@ | ||
/** | ||
* Copyright 2018 The Pennsylvania State University | ||
* @license Apache-2.0, see License.md for full text. | ||
*/ | ||
import { HAXWiring } from "./lib/HAXWiring.js"; | ||
/** | ||
* `hax-body-behaviors` | ||
* `HAX Body Behaviors to utilize in any element` | ||
* | ||
* @microcopy - language worth noting: | ||
* - | ||
* | ||
* @customElement | ||
* @demo demo/index.html | ||
*/ | ||
class HaxBodyBehaviors extends HTMLElement { | ||
getTemplate() { | ||
return ` | ||
<style> | ||
</style> | ||
`; | ||
} | ||
// properties available to the custom element for data binding | ||
static get properties() { | ||
return {}; | ||
} | ||
/** | ||
* Store the tag name to make it easier to obtain directly. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
static get tag() { | ||
return "hax-body-behaviors"; | ||
} | ||
/** | ||
* A file that contains the HTML template for the element. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
get templateUrl() { | ||
return "hax-body-behaviors.html"; | ||
} | ||
/** | ||
* A file that contains the properties that will be wired into this element. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
get propertiesUrl() { | ||
return "hax-body-behaviors-properties.json"; | ||
} | ||
/** | ||
* A file that contains the css for this element to be mixed into the html block. | ||
* @notice function name must be here for tooling to operate correctly | ||
*/ | ||
get styleUrl() { | ||
return "hax-body-behaviors.css"; | ||
} | ||
/** | ||
* life cycle | ||
*/ | ||
constructor(delayRender = false) { | ||
super(); | ||
// set tag for later use | ||
this.tag = HaxBodyBehaviors.tag; | ||
this.HAXWiring = new HAXWiring(); | ||
//this.HAXWiring.setHaxProperties(props, HaxBodyBehaviors.tag, this); | ||
// map our imported properties json to real props on the element | ||
// @notice static getter of properties is built via tooling | ||
// to edit modify src/HaxBodyBehaviors-properties.json | ||
let obj = HaxBodyBehaviors.properties; | ||
for (let p in obj) { | ||
if (obj.hasOwnProperty(p)) { | ||
this[p] = obj[p].value; | ||
} | ||
} | ||
// optional queue for future use | ||
this._queue = []; | ||
this.template = document.createElement("template"); | ||
this.attachShadow({ mode: "open" }); | ||
if (!delayRender) { | ||
this.render(); | ||
} | ||
} | ||
/** | ||
* life cycle, element is afixed to the DOM | ||
*/ | ||
connectedCallback() { | ||
if (window.ShadyCSS) { | ||
window.ShadyCSS.styleElement(this); | ||
} | ||
if (this._queue.length) { | ||
this._processQueue(); | ||
} | ||
} | ||
_copyAttribute(name, to) { | ||
const recipients = this.shadowRoot.querySelectorAll(to); | ||
const value = this.getAttribute(name); | ||
const fname = value == null ? "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(true)); | ||
} | ||
//static get observedAttributes() { | ||
// return []; | ||
//} | ||
// disconnectedCallback() {} | ||
// attributeChangedCallback(attr, oldValue, newValue) {} | ||
} | ||
window.customElements.define(HaxBodyBehaviors.tag, HaxBodyBehaviors); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function i(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e,t,r){return(a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&n(o,r.prototype),o}).apply(null,arguments)}function u(e){var t="function"==typeof Map?new Map:void 0;return(u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return a(e,arguments,o(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n(i,e)})(e)}function d(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var p=function r(){var i=this;t(this,r),this.haxProperties={canScale:!1,canPosition:!1,canEditSource:!1,settings:{quick:[],configure:[],advanced:[]},wipeSlot:{}},this.setHaxProperties=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document;if("undefined"===e(t.api)&&(t.api="1"),"1"==t.api){if("undefined"===e(t.canPosition)&&(t.canPosition=!0),"undefined"===e(t.canScale)&&(t.canScale=!0),"undefined"===e(t.canEditSource)&&(t.canEditSource=!1),"undefined"===e(t.gizmo)&&(t.gizmo=!1),"undefined"!==e(t.settings)){"undefined"===e(t.settings.quick)&&(t.settings.quick=[]);for(var n=0;n<t.settings.quick.length;n++)t.settings.quick[n]=i.validateSetting(t.settings.quick[n]),t.settings.quick[n]||t.settings.quick.splice(n,1);"undefined"===e(t.settings.configure)&&(t.settings.configure=[]);for(var a=0;a<t.settings.configure.length;a++)t.settings.configure[a]=i.validateSetting(t.settings.configure[a]),t.settings.configure[a]||t.settings.configure.splice(a,1);"undefined"===e(t.settings.advanced)&&(t.settings.advanced=[]);for(var u=0;u<t.settings.advanced.length;u++)t.settings.advanced[u]=i.validateSetting(t.settings.advanced[u]),t.settings.advanced[u]||t.settings.advanced.splice(u,1);t.settings.advanced.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),t.settings.advanced.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),t.settings.advanced.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),t.settings.advanced.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),t.settings.advanced.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),t.settings.advanced.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),t.settings.advanced.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),t.settings.advanced.push({attribute:"slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"})}if("undefined"===e(t.saveOptions)&&(t.saveOptions={wipeSlot:!1}),"undefined"===("undefined"==typeof Polymer?"undefined":e(Polymer))){var d=new CustomEvent("hax-register-properties",{bubbles:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:t,polymer:!1}});o.dispatchEvent(d)}else if(""!==r&&"undefined"!==("undefined"==typeof Polymer?"undefined":e(Polymer))&&"undefined"!==e(Polymer.HaxStore)&&"undefined"!==e(Polymer.HaxStore.instance)&&null!=Polymer.HaxStore.instance&&"undefined"!==e(Polymer.HaxStore.instance.elementList)&&"undefined"===e(Polymer.HaxStore.instance.elementList[r.toLowerCase()])){var p=new CustomEvent("hax-register-properties",{bubbles:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:t}});o.dispatchEvent(p)}else if("undefined"!==("undefined"==typeof Polymer?"undefined":e(Polymer))&&"undefined"!==e(Polymer.HaxStore)&&"undefined"!==e(Polymer.HaxStore.instance)&&null!=Polymer.HaxStore.instance&&"undefined"!==e(Polymer.HaxStore.instance.elementList)&&"undefined"===e(Polymer.HaxStore.instance.elementList[i.tagName.toLowerCase()])){var s=new CustomEvent("hax-register-properties",{bubbles:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:t}});o.dispatchEvent(s)}""===r&&i.setHaxProperties(t)}else console.log("This is't a valid usage of hax-body-behaviors API. See hax-body-behaviors for more details on how to implement the API. Most likely your hax item just was placed in an iframe as a fallback as opposed to a custom element.")},this.validateSetting=function(t){return("undefined"!==e(t.property)||"undefined"!==e(t.slot)||"undefined"!==e(t.attribute))&&("undefined"===e(t.title)&&("undefined"===e(t.attribute)?t.title=t.property:t.title=t.attribute),"undefined"===e(t.description)&&(t.description=""),"undefined"===e(t.inputMethod)&&(t.inputMethod="textfield"),"undefined"===e(t.type)&&(t.type="settings"),"undefined"===e(t.icon)&&(t.icon="android"),"undefined"===e(t.options)&&(t.options={}),"undefined"===e(t.required)&&(t.required=!1),"undefined"===e(t.validation)&&(t.validation=".*"),"undefined"===e(t.validationType)&&(t.validationType=""),t)},this.getHaxProperties=function(){return i.haxProperties},this.getHaxJSONSchema=function(t,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;"undefined"===e(t)&&(t="configure"),"undefined"===e(r)&&(r=o.haxProperties);var n=r.settings[t],a={$schema:"http://json-schema.org/schema#",title:"HAX "+t+" form schema",type:"object",properties:{}};return a.properties=o._getHaxJSONSchemaProperty(n,o),a=o.postProcessgetHaxJSONSchema(a)},this.postProcessgetHaxJSONSchema=function(e){return e},this._getHaxJSONSchemaProperty=function(t,r){var i={};for(var o in t)if(t.hasOwnProperty(o))if("undefined"!==e(t[o].property))switch(i[t[o].property]={title:t[o].title,type:r.getHaxJSONSchemaType(t[o].inputMethod)},"undefined"!==e(r[t[o].property])&&(i[t[o].property].value=r[t[o].property]),"url"==t[o].validationType&&(i[t[o].property].format="uri"),"datepicker"==t[o].inputMethod&&(i[t[o].property].format="date-time"),".*"!=t[o].validation&&(i[t[o].property].pattern=t[o].validation),t[o].inputMethod){case"number":i[t[o].property].component={name:"paper-input",valueProperty:"value",properties:{required:t[o].required},attributes:{type:"number"}};break;case"select":if(slot="","undefined"!==e(t[o].options))for(var n in t[o].options)slot+='<paper-item value="'+n+'">'+t[o].options[n]+"</paper-item>\n";i[t[o].property].component={name:"dropdown-select",valueProperty:"value",slot:slot,properties:{required:t[o].required}};break;case"textarea":i[t[o].property].component={name:"paper-textarea",valueProperty:"value",properties:{required:t[o].required},attributes:{"auto-validate":"auto-validate","char-counter":"char-counter"}};break;case"code-editor":i[t[o].property].component={name:"code-editor",valueProperty:"editorValue",attributes:{id:"haxcodeeditor"},properties:{title:t[o].title,readOnly:!1,theme:"ace/theme/monokai",mode:"ace/mode/html",fontsize:"16px",className:"hax-code-editor"}};break;case"array":i[t[o].property].items={type:"object",properties:r._getHaxJSONSchemaProperty(t[o].properties,r)};break;case"textfield":i[t[o].property].component={name:"paper-input",valueProperty:"value",properties:{required:t[o].required},attributes:{"auto-validate":"auto-validate"}};break;case"alt":i[t[o].property].component={name:"paper-input-flagged",valueProperty:"value",properties:{required:t[o].required},attributes:{"auto-validate":"auto-validate"}};break;case"colorpicker":i[t[o].property].component={name:"paper-swatch-picker",valueProperty:"color",properties:{required:t[o].required}};break;case"iconpicker":i[t[o].property].component={name:"paper-icon-picker",valueProperty:"icon",properties:{required:t[o].required}},t[o].options.constructor===Array&&(i[t[o].property].component.properties.iconList=t[o].options);break;case"datepicker":i[t[o].property].component={name:"app-datepicker",valueProperty:"date",properties:{required:t[o].required,autoUpdateDate:!0}}}else if("undefined"!==e(t[o].attribute))switch(i[t[o].attribute]={title:t[o].title,type:r.getHaxJSONSchemaType(t[o].inputMethod)},"class"===t[o].attribute?i[t[o].attribute].value=r.className:"style"===t[o].attribute?i[t[o].attribute].value=r.style.cssText:"undefined"!==e(r.attributes[t[o].attribute])&&(i[t[o].attribute].value=r.getAttribute(t[o].attribute)),"href"!=o&&"src"!=o||(i[t[o].attribute].format="uri"),"url"==t[o].validationType&&(i[t[o].attribute].format="uri"),"datepicker"==t[o].inputMethod&&(i[t[o].attribute].format="date-time"),".*"!=t[o].validation&&(i[t[o].attribute].pattern=t[o].validation),t[o].inputMethod){case"number":i[t[o].attribute].component={name:"paper-input",valueProperty:"value",properties:{required:t[o].required},attributes:{type:"number"}};break;case"select":if(slot="","undefined"!==e(t[o].options))for(var n in t[o].options)slot+='<paper-item value="'+n+'">'+t[o].options[n]+"</paper-item>\n";i[t[o].attribute].component={name:"dropdown-select",valueProperty:"value",slot:slot,properties:{required:t[o].required}};break;case"textarea":i[t[o].attribute].component={name:"paper-textarea",valueProperty:"value",properties:{required:t[o].required},attributes:{"auto-validate":"auto-validate","char-counter":"char-counter"}};break;case"code-editor":i[t[o].attribute].component={name:"code-editor",valueProperty:"editorValue",attributes:{id:"haxcodeeditor"},properties:{title:t[o].title,readOnly:!1,theme:"ace/theme/monokai",mode:"ace/mode/html",fontsize:"16px",className:"hax-code-editor"}};break;case"textfield":i[t[o].attribute].component={name:"paper-input",valueProperty:"value",properties:{required:t[o].required},attributes:{"auto-validate":"auto-validate"}};break;case"alt":i[t[o].attribute].component={name:"paper-input-flagged",valueProperty:"value",properties:{required:t[o].required},attributes:{"auto-validate":"auto-validate"}};break;case"colorpicker":i[t[o].attribute].component={name:"paper-swatch-picker",valueProperty:"color",properties:{required:t[o].required}}}else{i[t[o].slot]={title:t[o].title,type:r.getHaxJSONSchemaType(t[o].inputMethod),value:"",component:{name:"code-editor",valueProperty:"editorValue",attributes:{id:"haxcodeeditor"},properties:{title:t[o].title,readOnly:!1,theme:"ace/theme/monokai",mode:"ace/mode/html",fontsize:"16px",className:"hax-code-editor"}}};var a="";if("undefined"!==("undefined"==typeof Polymer?"undefined":e(Polymer)))for(var u in Polymer.dom(r).childNodes)"undefined"!==e(Polymer.dom(r).childNodes[u])&&(1===Polymer.dom(r).childNodes[u].nodeType?a+=Polymer.dom(r).childNodes[u].innerHTML:1!==Polymer.dom(r).childNodes[u].nodeType&&"undefined"!==e(Polymer.dom(r).childNodes[u].textContent)&&""!==Polymer.dom(r).childNodes[u].textContent&&(a+=Polymer.dom(r).childNodes[u].textContent));i[t[o].slot].component.slot="<template>"+a+"</template>"}return i},this.getHaxJSONSchemaType=function(e){if(i.validHAXPropertyInputMethod().includes(e))switch(e){case"flipboolean":case"boolean":return"boolean";case"number":return"number";case"select":case"textarea":case"colorpicker":case"iconpicker":case"datepicker":case"textfield":case"alt":return"string";case"array":return"array";default:return"string"}},this.validHAXPropertyInputMethod=function(){return["flipboolean","boolean","select","textfield","textarea","datepicker","colorpicker","iconpicker","alt","number","code-editor","array"]},this.prototypeHaxProperties=function(){return{api:"1",canScale:!0,canPosition:!0,canEditSource:!1,gizmo:{title:"Tag name",description:"A description",icon:"av:play-circle-filled",color:"blue",groups:["Content"],handles:[{type:"data",url:"src"}],meta:{author:""}},settings:{quick:[{property:"title",title:"Title",inputMethod:"textfield",icon:"android"},{property:"primaryColor",title:"Primary color",inputMethod:"colorpicker",icon:"color"}],configure:[{slot:"",title:"Inner content",description:"The slotted content that lives inside the tag",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{slot:"button",title:"Button content",description:"The content that can override the button",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"title",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!0,validationType:"text"},{property:"primaryColor",title:"Title",description:"",inputMethod:"textfield",icon:"android",required:!1,validation:".*",validationType:"text"}],advanced:[{property:"secondaryColor",title:"Secondary color",description:"An optional secondary color used in certain edge cases.",inputMethod:"colorpicker",icon:"color"},{property:"endPoint",title:"API endpoint",description:"An optional endpoint to hit and load in more data dymaically.",inputMethod:"textfield",icon:"android",validation:"[a-z0-9]",validationType:"url"}]},saveOptions:{wipeSlot:!1,unsetAttributes:["end-point","secondary-color"]}}}},s=function(e){function r(){var e,i=arguments.length>0&&void 0!==arguments[0]&&arguments[0];t(this,r),(e=d(this,o(r).call(this))).tag=r.tag,e.HAXWiring=new p;var n=r.properties;for(var a in n)n.hasOwnProperty(a)&&(e[a]=n[a].value);return e._queue=[],e.template=document.createElement("template"),e.attachShadow({mode:"open"}),i||e.render(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}(r,u(HTMLElement)),i(r,[{key:"getTemplate",value:function(){return"\n<style>\n\n</style>\n"}},{key:"templateUrl",get:function(){return"hax-body-behaviors.html"}},{key:"propertiesUrl",get:function(){return"hax-body-behaviors-properties.json"}},{key:"styleUrl",get:function(){return"hax-body-behaviors.css"}}],[{key:"properties",get:function(){return{}}},{key:"tag",get:function(){return"hax-body-behaviors"}}]),i(r,[{key:"connectedCallback",value:function(){window.ShadyCSS&&window.ShadyCSS.styleElement(this),this._queue.length&&this._processQueue()}},{key:"_copyAttribute",value:function(e,t){var r=this.shadowRoot.querySelectorAll(t),i=this.getAttribute(e),o=null==i?"removeAttribute":"setAttribute",n=!0,a=!1,u=void 0;try{for(var d,p=r[Symbol.iterator]();!(n=(d=p.next()).done);n=!0){d.value[o](e,i)}}catch(e){a=!0,u=e}finally{try{n||null==p.return||p.return()}finally{if(a)throw u}}}},{key:"_queueAction",value:function(e){this._queue.push(e)}},{key:"_processQueue",value:function(){var e=this;this._queue.forEach(function(t){e["_".concat(t.type)](t.data)}),this._queue=[]}},{key:"_setProperty",value:function(e){var t=e.name,r=e.value;this[t]=r}},{key:"render",value:function(){this.shadowRoot.innerHTML=null,this.template.innerHTML=this.html,window.ShadyCSS&&window.ShadyCSS.prepareTemplate(this.template,this.tag),this.shadowRoot.appendChild(this.template.content.cloneNode(!0))}}]),r}();window.customElements.define(s.tag,s)}); | ||
//# sourceMappingURL=hax-body-behaviors.umd.js.map |
@@ -9,3 +9,3 @@ { | ||
}, | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"description": "Wire any element up to HAX", | ||
@@ -51,3 +51,3 @@ "repository": { | ||
}, | ||
"gitHead": "c96d8f92dc4af59d8ac0850a6af628e1bae7b970" | ||
"gitHead": "087c26dfea62950fb8d4c74bf48adf65ac5abb91" | ||
} |
@@ -5,2 +5,2 @@ // rollup.config.js | ||
export default configFactory(packageJson.wcfactory); | ||
export default configFactory(packageJson.wcfactory); |
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
495876
34
3324