@lrnwebcomponents/hax-body-behaviors
Advanced tools
Comparing version 2.4.1 to 2.5.0
@@ -11,7 +11,7 @@ { | ||
"start": { | ||
"line": 1226, | ||
"line": 1234, | ||
"column": 26 | ||
}, | ||
"end": { | ||
"line": 1343, | ||
"line": 1351, | ||
"column": 1 | ||
@@ -36,7 +36,7 @@ } | ||
"start": { | ||
"line": 147, | ||
"line": 152, | ||
"column": 7 | ||
}, | ||
"end": { | ||
"line": 1221, | ||
"line": 1229, | ||
"column": 1 | ||
@@ -60,7 +60,7 @@ } | ||
"start": { | ||
"line": 1247, | ||
"line": 1255, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1264, | ||
"line": 1272, | ||
"column": 5 | ||
@@ -90,7 +90,7 @@ } | ||
"start": { | ||
"line": 1268, | ||
"line": 1276, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1276, | ||
"line": 1284, | ||
"column": 5 | ||
@@ -111,7 +111,7 @@ } | ||
"start": { | ||
"line": 1282, | ||
"line": 1290, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1284, | ||
"line": 1292, | ||
"column": 5 | ||
@@ -141,7 +141,7 @@ } | ||
"start": { | ||
"line": 1288, | ||
"line": 1296, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1290, | ||
"line": 1298, | ||
"column": 5 | ||
@@ -163,7 +163,7 @@ } | ||
"start": { | ||
"line": 1294, | ||
"line": 1302, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1296, | ||
"line": 1304, | ||
"column": 5 | ||
@@ -185,7 +185,7 @@ } | ||
"start": { | ||
"line": 1300, | ||
"line": 1308, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1302, | ||
"line": 1310, | ||
"column": 5 | ||
@@ -203,7 +203,7 @@ } | ||
"start": { | ||
"line": 1308, | ||
"line": 1316, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1310, | ||
"line": 1318, | ||
"column": 5 | ||
@@ -232,7 +232,7 @@ } | ||
"start": { | ||
"line": 1314, | ||
"line": 1322, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1316, | ||
"line": 1324, | ||
"column": 5 | ||
@@ -254,7 +254,7 @@ } | ||
"start": { | ||
"line": 1321, | ||
"line": 1329, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1323, | ||
"line": 1331, | ||
"column": 5 | ||
@@ -279,7 +279,7 @@ } | ||
"start": { | ||
"line": 1327, | ||
"line": 1335, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1329, | ||
"line": 1337, | ||
"column": 5 | ||
@@ -301,7 +301,7 @@ } | ||
"start": { | ||
"line": 1333, | ||
"line": 1341, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1335, | ||
"line": 1343, | ||
"column": 5 | ||
@@ -319,7 +319,7 @@ } | ||
"start": { | ||
"line": 1339, | ||
"line": 1347, | ||
"column": 4 | ||
}, | ||
"end": { | ||
"line": 1341, | ||
"line": 1349, | ||
"column": 5 | ||
@@ -337,7 +337,7 @@ } | ||
"start": { | ||
"line": 1227, | ||
"line": 1235, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1342, | ||
"line": 1350, | ||
"column": 3 | ||
@@ -344,0 +344,0 @@ } |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).HaxBodyBehaviors={})}(this,function(e){"use strict";function t(e){return(t="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})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(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}function p(e,t,r){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}var l=function e(){var i=this;r(this,e),this.haxProperties={canScale:!1,canPosition:!1,canEditSource:!1,settings:{quick:[],configure:[],advanced:[]},wipeSlot:{}},this.pathFromUrl=function(e){return e.substring(0,e.lastIndexOf("/")+1)},this.setup=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return"undefined"!==t(i.tagName)&&(r=i.tagName.toLowerCase()),window.addEventListener("hax-store-ready",i._haxStoreReady.bind(i)),"undefined"!==t(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?i.setHaxProperties(e,r,o,!0):i.setHaxProperties(e,r,o,!1)},this._haxStoreReady=function(e){if(e.detail&&"undefined"!==t(i.tagName)&&"undefined"!==t(i.haxProperties)){var r=i.tagName,o=i.haxProperties,a=i;if(""!=r&&"undefined"===t(window.HaxStore)){var n=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:o,polymer:!1}});a.dispatchEvent(n)}else if(""!=r&&"undefined"===t(window.HaxStore.instance.elementList[r.toLowerCase()])){var d=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:o}});a.dispatchEvent(d)}else if("undefined"!==t(i.tagName)&&"undefined"===t(window.HaxStore.instance.elementList[i.tagName.toLowerCase()])){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:o}});a.dispatchEvent(s)}}},this.setHaxProperties=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("undefined"===t(e.api)&&(e.api="1"),"1"==e.api){if("undefined"===t(e.canPosition)&&(e.canPosition=!0),"undefined"===t(e.canScale)&&(e.canScale=!0),"undefined"===t(e.canEditSource)&&(e.canEditSource=!1),"undefined"===t(e.gizmo))e.gizmo=!1;else if("undefined"!==t(e.gizmo.iconLib)){var n=i.pathFromUrl(decodeURIComponent("undefined"!=typeof document?document.currentScript&&document.currentScript.src||document.baseURI:new("undefined"!=typeof URL?URL:require("url").URL)("file:"+__filename).href));import("".concat(n,"../../../").concat(e.gizmo.iconLib))}if("undefined"!==t(e.settings)){"undefined"===t(e.settings.quick)&&(e.settings.quick=[]);for(var d=0;d<e.settings.quick.length;d++)e.settings.quick[d]=i.validateSetting(e.settings.quick[d]),e.settings.quick[d]||e.settings.quick.splice(d,1);"undefined"===t(e.settings.configure)&&(e.settings.configure=[]);for(var s=0;s<e.settings.configure.length;s++)e.settings.configure[s]=i.validateSetting(e.settings.configure[s]),e.settings.configure[s]||e.settings.configure.splice(s,1);"undefined"===t(e.settings.advanced)&&(e.settings.advanced=[]);for(var p=0;p<e.settings.advanced.length;p++)e.settings.advanced[p]=i.validateSetting(e.settings.advanced[p]),e.settings.advanced[p]||e.settings.advanced.splice(p,1);e.settings.advanced.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"data-hax-slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"})}if("undefined"===t(e.saveOptions)&&(e.saveOptions={wipeSlot:!1}),a)if(""!=r&&"undefined"===t(window.HaxStore)){var l=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:e,polymer:!1}});o.dispatchEvent(l)}else if(""!=r){var u=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:e}});o.dispatchEvent(u)}else if("undefined"!==t(i.tagName)){var c=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:e}});o.dispatchEvent(c)}else console.warn("".concat(r," missed our checks and has an issue in implementation with HAX"));""===r&&("function"==typeof i._setHaxProperties?i._setHaxProperties(e):i.haxProperties=e)}else console.warn("This is't a valid usage of hax API. See hax-body-behaviors/lib/HAXWiring.js 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(e){return("undefined"!==t(e.property)||"undefined"!==t(e.slot)||"undefined"!==t(e.attribute))&&("undefined"===t(e.title)&&("undefined"===t(e.attribute)?e.title=e.property:e.title=e.attribute),"undefined"===t(e.description)&&(e.description=""),"undefined"===t(e.inputMethod)&&(e.inputMethod="textfield"),"undefined"===t(e.type)&&(e.type="settings"),"undefined"===t(e.icon)&&(e.icon="android"),"undefined"===t(e.options)&&(e.options={}),"undefined"===t(e.required)&&(e.required=!1),"undefined"===t(e.disabled)&&(e.disabled=!1),"undefined"===t(e.validation)&&(e.validation=".*"),"undefined"===t(e.validationType)&&(e.validationType=""),"undefined"!==t(e.slot)&&("undefined"===t(e.slotWrapper)&&(e.slotWrapper="span"),"undefined"===t(e.slotAttributes)&&(e.slotAttributes={})),e)},this.getHaxProperties=function(){return i.haxProperties},this.getHaxJSONSchema=function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;"undefined"===t(e)&&(e="configure"),"undefined"===t(r)&&(r=o.haxProperties);var a=r.settings[e],n={$schema:"http://json-schema.org/schema#",title:"HAX "+e+" form schema",type:"object",properties:{}};if(n.properties=o._getHaxJSONSchemaProperty(a,o),r.gizmo&&r.gizmo.tag&&window.customElements.get(r.gizmo.tag)){var d=document.createElement(r.gizmo.tag);n="function"==typeof d.postProcessgetHaxJSONSchema?d.postProcessgetHaxJSONSchema(n):o.postProcessgetHaxJSONSchema(n)}else n=o.postProcessgetHaxJSONSchema(n);return n},this.postProcessgetHaxJSONSchema=function(e){return e},this._getHaxJSONSchemaProperty=function(e,r){var o={};for(var a in e)if(e.hasOwnProperty(a))if("undefined"!==t(e[a].property)){switch(o[e[a].property]={title:e[a].title,type:i.getHaxJSONSchemaType(e[a].inputMethod)},"undefined"!==t(r[e[a].property])&&(o[e[a].property].value=r[e[a].property]),"url"==e[a].validationType&&(o[e[a].property].format="uri"),"datepicker"==e[a].inputMethod&&(o[e[a].property].format="date-time"),".*"!=e[a].validation&&(o[e[a].property].pattern=e[a].validation),e[a].inputMethod){case"number":o[e[a].property].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{type:"number"}};break;case"select":var n=[];for(var d in e[a].options){var s=[{alt:e[a].options[d],value:d}];n.push(s)}o[e[a].property].component={name:"simple-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,options:n,disabled:e[a].disabled}};break;case"textarea":o[e[a].property].component={name:"paper-textarea",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"char-counter":"char-counter"}};break;case"code-editor":o[e[a].property].component={name:"code-editor",valueProperty:"value",properties:{editorValue:e[a].value,title:e[a].title,theme:"vs",mode:"html",className:"hax-code-editor"}};break;case"array":o[e[a].property].component={valueProperty:"value"},o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r),itemLabel:e[a].itemLabel},o[e[a].property].type="array";break;case"fieldset":o[e[a].property].component={valueProperty:"value"},o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r)},o[e[a].property].type="fieldset";break;case"tabs":o[e[a].property].component={valueProperty:"value"},e[a].properties.map(function(e){return e.inputMethod="tab",e}),o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r)},o[e[a].property].type="tabs";break;case"tab":o[e[a].property].property=e[a].property,o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r),label:e[a].itemLabel},o[e[a].property].type="tabs";break;case"textfield":o[e[a].property].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"markup":o[e[a].property].component={name:"marked-element",valueProperty:"markdown"},o[e[a].property].slot=e[a].value;break;case"alt":o[e[a].property].component={name:"paper-input-flagged",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"colorpicker":o[e[a].property].component={name:"simple-colors-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,label:e[a].title,disabled:e[a].disabled}};break;case"iconpicker":o[e[a].property].component={name:"simple-icon-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,hideOptionLabels:!0,label:e[a].title,disabled:e[a].disabled}};var p=void 0!==e[a].options&&null!==e[a].options?e[a].options:[];o[e[a].property].component.properties.icons=p;break;case"datepicker":o[e[a].property].component={name:"paper-input",valueProperty:"date",properties:{type:"date",required:e[a].required,disabled:e[a].disabled}};break;case"haxupload":o[e[a].property].component={name:"hax-upload-field",valueProperty:"value",properties:{formDataName:"file-upload",disabled:e[a].disabled,required:e[a].required,noCamera:e[a].noCamera,noVoiceRecord:e[a].noVoiceRecord}};break;case"slider":o[e[a].property].component={name:"paper-slider",valueProperty:"immediateValue",properties:{pin:!0,required:e[a].required,disabled:e[a].disabled,min:e[a].min,max:e[a].max,step:e[a].step}}}"undefined"!==e[a].hidden&&(o[e[a].property].hidden=e[a].hidden),"undefined"!==e[a].description&&(o[e[a].property].description=e[a].description)}else if("undefined"!==t(e[a].attribute)){switch(o[e[a].attribute]={title:e[a].title,type:r.getHaxJSONSchemaType(e[a].inputMethod)},"class"===e[a].attribute?o[e[a].attribute].value=r.className:"style"===e[a].attribute?o[e[a].attribute].value=r.style.cssText:"loading"===e[a].attribute?o[e[a].attribute].value="lazy":"undefined"!==t(r.attributes[e[a].attribute])&&(o[e[a].attribute].value=r.getAttribute(e[a].attribute)),"href"!=a&&"src"!=a||(o[e[a].attribute].format="uri"),"url"==e[a].validationType&&(o[e[a].attribute].format="uri"),"datepicker"==e[a].inputMethod&&(o[e[a].attribute].format="date-time"),".*"!=e[a].validation&&(o[e[a].attribute].pattern=e[a].validation),e[a].inputMethod){case"number":o[e[a].attribute].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{type:"number"}};break;case"select":var l=[];for(var d in e[a].options){var u=[{alt:e[a].options[d],value:d}];l.push(u)}o[e[a].attribute].component={name:"simple-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,options:l,disabled:e[a].disabled}};break;case"textarea":o[e[a].attribute].component={name:"paper-textarea",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"char-counter":"char-counter"}};break;case"code-editor":o[e[a].attribute].component={name:"code-editor",valueProperty:"value",properties:{editorValue:o[e[a].attribute].value,title:e[a].title,readOnly:!1,theme:"vs",mode:"html",className:"hax-code-editor"}};break;case"textfield":o[e[a].attribute].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"alt":o[e[a].attribute].component={name:"paper-input-flagged",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"colorpicker":o[e[a].attribute].component={name:"simple-colors-picker",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled}};break;case"haxupload":o[e[a].attribute].component={name:"hax-upload-field",valueProperty:"value",properties:{formDataName:"file-upload",required:e[a].required,disabled:e[a].disabled,noCamera:e[a].noCamera,noVoiceRecord:e[a].noVoiceRecord}};break;case"slider":o[e[a].attribute].component={name:"paper-slider",valueProperty:"immediateValue",properties:{pin:!0,required:e[a].required,disabled:e[a].disabled,min:e[a].min,max:e[a].max,step:e[a].step}}}"undefined"!==e[a].description&&(o[e[a].attribute].description=e[a].description)}else{o[e[a].slot]={title:e[a].title,type:r.getHaxJSONSchemaType(e[a].inputMethod),value:"",component:{name:"code-editor",valueProperty:"value",properties:{editorValue:e[a].value,title:e[a].title,theme:"vs",mode:"html",className:"hax-code-editor"}}};var c="";for(var h in r.childNodes)"undefined"!==t(r.childNodes[h])&&(1===r.childNodes[h].nodeType?e[a].slot===r.childNodes[h].slot&&(c+=r.childNodes[h].innerHTML):1!==r.childNodes[h].nodeType&&"undefined"!==t(r.childNodes[h].textContent)&&""!==r.childNodes[h].textContent&&(c+=r.childNodes[h].textContent));o[e[a].slot].component.properties.editorValue=c.trim(),"undefined"!==e[a].description&&(o[e[a].slot].description=e[a].description)}return o},this.getHaxJSONSchemaType=function(e){if(i.validHAXPropertyInputMethod().includes(e))switch(e){case"flipboolean":case"boolean":return"boolean";case"number":case"slider":return"number";case"select":case"textarea":case"colorpicker":case"iconpicker":case"datepicker":case"haxupload":case"markup":case"textfield":case"alt":return"string";case"array":return"array";default:return"string"}},this.validHAXPropertyInputMethod=function(){return["flipboolean","boolean","select","textfield","textarea","datepicker","haxupload","slider","markup","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"]}}}};window.HAXWiring=new l,window.HAXBehaviors=window.HAXBehaviors||{},window.HAXBehaviors.PropertiesBehaviors={properties:{haxProperties:window.HAXWiring.haxProperties},setHaxProperties:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==r&&"undefined"!==t(this.tagName)&&(r=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==t(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?window.HAXWiring.setHaxProperties(e,r,i,!0):window.HAXWiring.setHaxProperties(e,r,i,!1)},_haxStoreReady:function(e){return window.HAXWiring._haxStoreReady(e)},validateSetting:function(e){return window.HAXWiring.validateSetting(e)},getHaxProperties:function(){return this.haxProperties},getHaxJSONSchema:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return window.HAXWiring.getHaxJSONSchema(e,t,r)},postProcessgetHaxJSONSchema:function(e){return window.HAXWiring.postProcessgetHaxJSONSchema(e)},_getHaxJSONSchemaProperty:function(e,t){return window.HAXWiring._getHaxJSONSchemaProperty(e,t)},getHaxJSONSchemaType:function(e){return window.HAXWiring.getHaxJSONSchemaType(e)},validHAXPropertyInputMethod:function(){return window.HAXWiring.validHAXPropertyInputMethod()},prototypeHaxProperties:function(){return window.HAXWiring.prototypeHaxProperties()}},e.HAXWiring=l,e.HAXElement=function(e){return function(u){function c(){var e;return r(this,c),(e=s(this,n(c).call(this))).HAXWiring=new l,e}var h,f,m;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&&d(e,t)}(c,e),h=c,m=[{key:"properties",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},p(n(c),"properties",this),{haxProperties:window.HAXWiring.haxProperties})}}],(f=[{key:"setHaxProperties",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==r&&"undefined"!==t(this.tagName)&&(r=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==t(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?this.HAXWiring.setHaxProperties(e,r,i,!0):this.HAXWiring.setHaxProperties(e,r,i,!1)}},{key:"disconnectedCallback",value:function(){window.removeEventListener("hax-store-ready",this._haxStoreReady.bind(this)),p(n(c.prototype),"disconnectedCallback",this)&&p(n(c.prototype),"disconnectedCallback",this).call(this)}},{key:"setup",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.HAXWiring.setup(e,"",this)}},{key:"_haxStoreReady",value:function(e){return this.HAXWiring._haxStoreReady(e)}},{key:"validateSetting",value:function(e){return this.HAXWiring.validateSetting(e)}},{key:"getHaxProperties",value:function(){return this.haxProperties}},{key:"getHaxJSONSchema",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return this.HAXWiring.getHaxJSONSchema(e,t,r)}},{key:"postProcessgetHaxJSONSchema",value:function(e){return this.HAXWiring.postProcessgetHaxJSONSchema(e)}},{key:"_getHaxJSONSchemaProperty",value:function(e,t){return this.HAXWiring._getHaxJSONSchemaProperty(e,t)}},{key:"getHaxJSONSchemaType",value:function(e){return this.HAXWiring.getHaxJSONSchemaType(e)}},{key:"validHAXPropertyInputMethod",value:function(){return this.HAXWiring.validHAXPropertyInputMethod()}},{key:"prototypeHaxProperties",value:function(){return this.HAXWiring.prototypeHaxProperties()}}])&&i(h.prototype,f),m&&i(h,m),c}()},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).HaxBodyBehaviors={})}(this,function(e){"use strict";function t(e){return(t="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})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(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 o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}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}function p(e,t,r){return(p="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(r):o.value}})(e,t,r||e)}var l=function e(){var i=this;r(this,e),this.haxProperties={canScale:!1,canPosition:!1,canEditSource:!1,settings:{quick:[],configure:[],advanced:[]},wipeSlot:{}},this.pathFromUrl=function(e){return e.substring(0,e.lastIndexOf("/")+1)},this.setup=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;return"undefined"!==t(i.tagName)&&(r=i.tagName.toLowerCase()),window.addEventListener("hax-store-ready",i._haxStoreReady.bind(i)),"undefined"!==t(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?i.setHaxProperties(e,r,o,!0):i.setHaxProperties(e,r,o,!1)},this._haxStoreReady=function(e){if(e.detail&&"undefined"!==t(i.tagName)&&"undefined"!==t(i.haxProperties)){var r=i.tagName,o=i.haxProperties,a=i;if(""!=r&&"undefined"===t(window.HaxStore)){var n=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:o,polymer:!1}});a.dispatchEvent(n)}else if(""!=r&&"undefined"===t(window.HaxStore.instance.elementList[r.toLowerCase()])){var s=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:o}});a.dispatchEvent(s)}else if("undefined"!==t(i.tagName)&&"undefined"===t(window.HaxStore.instance.elementList[i.tagName.toLowerCase()])){var d=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:o}});a.dispatchEvent(d)}}},this.setHaxProperties=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if("undefined"===t(e.api)&&(e.api="1"),"1"==e.api){if("undefined"===t(e.canPosition)&&(e.canPosition=!0),"undefined"===t(e.canScale)&&(e.canScale=!0),"undefined"===t(e.canEditSource)&&(e.canEditSource=!1),"undefined"===t(e.gizmo))e.gizmo=!1;else if("undefined"!==t(e.gizmo.iconLib)){var n=i.pathFromUrl(decodeURIComponent("undefined"!=typeof document?document.currentScript&&document.currentScript.src||document.baseURI:new("undefined"!=typeof URL?URL:require("url").URL)("file:"+__filename).href));import("".concat(n,"../../../").concat(e.gizmo.iconLib))}if("undefined"!==t(e.settings)){"undefined"===t(e.settings.quick)&&(e.settings.quick=[]);for(var s=0;s<e.settings.quick.length;s++)e.settings.quick[s]=i.validateSetting(e.settings.quick[s]),e.settings.quick[s]||e.settings.quick.splice(s,1);"undefined"===t(e.settings.configure)&&(e.settings.configure=[]);for(var d=0;d<e.settings.configure.length;d++)e.settings.configure[d]=i.validateSetting(e.settings.configure[d]),e.settings.configure[d]||e.settings.configure.splice(d,1);"undefined"===t(e.settings.advanced)&&(e.settings.advanced=[]);for(var p=0;p<e.settings.advanced.length;p++)e.settings.advanced[p]=i.validateSetting(e.settings.advanced[p]),e.settings.advanced[p]||e.settings.advanced.splice(p,1);e.settings.advanced.push({attribute:"class",title:"Classes",description:"CSS classes applied manually to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"style",title:"Styles",description:"Custom CSS styles as applied to the element",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"prefix",title:"Schema: prefix",description:"Schema prefixes",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"typeof",title:"Schema: TypeOf",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"property",title:"Schema: Property",description:"typeof definition for Schema usage",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"resource",title:"Schema: Resource ID",description:"Schema resource identifier",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"id",title:"ID",description:"element ID, only set this if you know why",inputMethod:"textfield"}),e.settings.advanced.push({attribute:"slot",title:"slot",description:"DOM slot area",inputMethod:"textfield"})}if("undefined"===t(e.saveOptions)&&(e.saveOptions={wipeSlot:!1}),a)if(""!=r&&"undefined"===t(window.HaxStore)){var l=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:e,polymer:!1}});o.dispatchEvent(l)}else if(""!=r){var u=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:r.toLowerCase(),properties:e}});o.dispatchEvent(u)}else if("undefined"!==t(i.tagName)){var c=new CustomEvent("hax-register-properties",{bubbles:!0,composed:!0,cancelable:!0,detail:{tag:i.tagName.toLowerCase(),properties:e}});o.dispatchEvent(c)}else console.warn("".concat(r," missed our checks and has an issue in implementation with HAX"));""===r&&("function"==typeof i._setHaxProperties?i._setHaxProperties(e):i.haxProperties=e)}else console.warn("This is't a valid usage of hax API. See hax-body-behaviors/lib/HAXWiring.js 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(e){return("undefined"!==t(e.property)||"undefined"!==t(e.slot)||"undefined"!==t(e.attribute))&&("undefined"===t(e.title)&&("undefined"===t(e.attribute)?e.title=e.property:e.title=e.attribute),"undefined"===t(e.description)&&(e.description=""),"undefined"===t(e.inputMethod)&&(e.inputMethod="textfield"),"undefined"===t(e.type)&&(e.type="settings"),"undefined"===t(e.icon)&&(e.icon="android"),"undefined"===t(e.options)&&(e.options={}),"undefined"===t(e.required)&&(e.required=!1),"undefined"===t(e.disabled)&&(e.disabled=!1),"undefined"===t(e.validation)&&(e.validation=".*"),"undefined"===t(e.validationType)&&(e.validationType=""),"undefined"!==t(e.slot)&&("undefined"===t(e.slotWrapper)&&(e.slotWrapper="span"),"undefined"===t(e.slotAttributes)&&(e.slotAttributes={})),e)},this.getHaxProperties=function(){return i.haxProperties},this.getHaxJSONSchema=function(e,r){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i;"undefined"===t(e)&&(e="configure"),"undefined"===t(r)&&(r=o.haxProperties);var a=r.settings[e],n={$schema:"http://json-schema.org/schema#",title:"HAX "+e+" form schema",type:"object",properties:{}};if(n.properties=o._getHaxJSONSchemaProperty(a,o),r.gizmo&&r.gizmo.tag&&window.customElements.get(r.gizmo.tag)){var s=document.createElement(r.gizmo.tag);n="function"==typeof s.postProcessgetHaxJSONSchema?s.postProcessgetHaxJSONSchema(n):o.postProcessgetHaxJSONSchema(n)}else n=o.postProcessgetHaxJSONSchema(n);return n},this.postProcessgetHaxJSONSchema=function(e){return e},this._getHaxJSONSchemaProperty=function(e,r){var o={};for(var a in e)if(e.hasOwnProperty(a))if("undefined"!==t(e[a].property)){switch(o[e[a].property]={title:e[a].title,type:i.getHaxJSONSchemaType(e[a].inputMethod)},"undefined"!==t(r[e[a].property])&&(o[e[a].property].value=r[e[a].property]),"url"==e[a].validationType&&(o[e[a].property].format="uri"),"datepicker"==e[a].inputMethod&&(o[e[a].property].format="date-time"),".*"!=e[a].validation&&(o[e[a].property].pattern=e[a].validation),e[a].inputMethod){case"number":o[e[a].property].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{type:"number"}};break;case"select":var n=[];for(var s in e[a].options){var d=[{alt:e[a].options[s],value:s}];n.push(d)}o[e[a].property].component={name:"simple-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,options:n,disabled:e[a].disabled}};break;case"textarea":o[e[a].property].component={name:"paper-textarea",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"char-counter":"char-counter"}};break;case"code-editor":o[e[a].property].component={name:"code-editor",valueProperty:"value",properties:{editorValue:e[a].value,title:e[a].title,theme:"vs",mode:"html",className:"hax-code-editor"}};break;case"array":o[e[a].property].component={valueProperty:"value"},o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r),itemLabel:e[a].itemLabel},o[e[a].property].type="array";break;case"fieldset":o[e[a].property].component={valueProperty:"value"},o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r)},o[e[a].property].type="fieldset";break;case"tabs":o[e[a].property].component={valueProperty:"value"},e[a].properties.map(function(e){return e.inputMethod="tab",e}),o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r)},o[e[a].property].type="tabs";break;case"tab":o[e[a].property].property=e[a].property,o[e[a].property].items={type:"object",properties:i._getHaxJSONSchemaProperty(e[a].properties,r),label:e[a].itemLabel},o[e[a].property].type="tabs";break;case"textfield":o[e[a].property].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"markup":o[e[a].property].component={name:"marked-element",valueProperty:"markdown"},o[e[a].property].slot=e[a].value;break;case"alt":o[e[a].property].component={name:"paper-input-flagged",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"colorpicker":o[e[a].property].component={name:"simple-colors-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,label:e[a].title,disabled:e[a].disabled}};break;case"iconpicker":o[e[a].property].component={name:"simple-icon-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,hideOptionLabels:!0,label:e[a].title,disabled:e[a].disabled}};var p=void 0!==e[a].options&&null!==e[a].options?e[a].options:[];o[e[a].property].component.properties.icons=p;break;case"datepicker":o[e[a].property].component={name:"paper-input",valueProperty:"date",properties:{type:"date",required:e[a].required,disabled:e[a].disabled}};break;case"haxupload":o[e[a].property].component={name:"hax-upload-field",valueProperty:"value",properties:{formDataName:"file-upload",disabled:e[a].disabled,required:e[a].required,noCamera:e[a].noCamera,noVoiceRecord:e[a].noVoiceRecord}};break;case"slider":o[e[a].property].component={name:"paper-slider",valueProperty:"immediateValue",properties:{pin:!0,value:e[a].value,required:e[a].required,disabled:e[a].disabled,min:e[a].min,max:e[a].max,step:e[a].step}}}"undefined"!==e[a].hidden&&(o[e[a].property].hidden=e[a].hidden),"undefined"!==e[a].description&&(o[e[a].property].description=e[a].description)}else if("undefined"!==t(e[a].attribute)){switch(o[e[a].attribute]={title:e[a].title,type:r.getHaxJSONSchemaType(e[a].inputMethod)},"class"===e[a].attribute?o[e[a].attribute].value=r.className:"style"===e[a].attribute?o[e[a].attribute].value=r.style.cssText:"loading"===e[a].attribute?o[e[a].attribute].value="lazy":"undefined"!==t(r.attributes[e[a].attribute])&&(o[e[a].attribute].value=r.getAttribute(e[a].attribute)),"href"!=a&&"src"!=a||(o[e[a].attribute].format="uri"),"url"==e[a].validationType&&(o[e[a].attribute].format="uri"),"datepicker"==e[a].inputMethod&&(o[e[a].attribute].format="date-time"),".*"!=e[a].validation&&(o[e[a].attribute].pattern=e[a].validation),e[a].inputMethod){case"number":o[e[a].attribute].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{type:"number"}};break;case"select":var l=[];for(var s in e[a].options){var u=[{alt:e[a].options[s],value:s}];l.push(u)}o[e[a].attribute].component={name:"simple-picker",valueProperty:"value",properties:{allowNull:e[a].allowNull,blockLabel:!0,required:e[a].required,options:l,disabled:e[a].disabled}};break;case"textarea":o[e[a].attribute].component={name:"paper-textarea",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"char-counter":"char-counter"}};break;case"code-editor":o[e[a].attribute].component={name:"code-editor",valueProperty:"value",properties:{editorValue:o[e[a].attribute].value,title:e[a].title,readOnly:!1,theme:"vs",mode:"html",className:"hax-code-editor"}};break;case"textfield":o[e[a].attribute].component={name:"paper-input",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"alt":o[e[a].attribute].component={name:"paper-input-flagged",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled},attributes:{"auto-validate":"auto-validate"}};break;case"colorpicker":o[e[a].attribute].component={name:"simple-colors-picker",valueProperty:"value",properties:{required:e[a].required,disabled:e[a].disabled}};break;case"haxupload":o[e[a].attribute].component={name:"hax-upload-field",valueProperty:"value",properties:{formDataName:"file-upload",required:e[a].required,disabled:e[a].disabled,noCamera:e[a].noCamera,noVoiceRecord:e[a].noVoiceRecord}};break;case"slider":o[e[a].attribute].component={name:"paper-slider",valueProperty:"immediateValue",properties:{pin:!0,value:e[a].value,required:e[a].required,disabled:e[a].disabled,min:e[a].min,max:e[a].max,step:e[a].step}}}"undefined"!==e[a].description&&(o[e[a].attribute].description=e[a].description)}else{o[e[a].slot]={title:e[a].title,type:r.getHaxJSONSchemaType(e[a].inputMethod),value:"",component:{name:"code-editor",valueProperty:"value",properties:{editorValue:e[a].value,title:e[a].title,theme:"vs",mode:"html",className:"hax-code-editor"}}};var c="";for(var h in r.childNodes)"undefined"!==t(r.childNodes[h])&&(1===r.childNodes[h].nodeType?e[a].slot===r.childNodes[h].slot&&(c+=r.childNodes[h].innerHTML):1!==r.childNodes[h].nodeType&&"undefined"!==t(r.childNodes[h].textContent)&&""!==r.childNodes[h].textContent&&(c+=r.childNodes[h].textContent));o[e[a].slot].component.properties.editorValue=c.trim(),"undefined"!==e[a].description&&(o[e[a].slot].description=e[a].description)}return o},this.getHaxJSONSchemaType=function(e){if(i.validHAXPropertyInputMethod().includes(e))switch(e){case"flipboolean":case"boolean":return"boolean";case"number":case"slider":return"number";case"select":case"textarea":case"colorpicker":case"iconpicker":case"datepicker":case"haxupload":case"markup":case"textfield":case"alt":return"string";case"array":return"array";default:return"string"}},this.validHAXPropertyInputMethod=function(){return["flipboolean","boolean","select","textfield","textarea","datepicker","haxupload","slider","markup","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",type_exclusive:!1,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"]}}}};window.HAXWiring=new l,window.HAXBehaviors=window.HAXBehaviors||{},window.HAXBehaviors.PropertiesBehaviors={properties:{haxProperties:window.HAXWiring.haxProperties},setHaxProperties:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==r&&"undefined"!==t(this.tagName)&&(r=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==t(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?window.HAXWiring.setHaxProperties(e,r,i,!0):window.HAXWiring.setHaxProperties(e,r,i,!1)},_haxStoreReady:function(e){return window.HAXWiring._haxStoreReady(e)},validateSetting:function(e){return window.HAXWiring.validateSetting(e)},getHaxProperties:function(){return this.haxProperties},getHaxJSONSchema:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return window.HAXWiring.getHaxJSONSchema(e,t,r)},postProcessgetHaxJSONSchema:function(e){return window.HAXWiring.postProcessgetHaxJSONSchema(e)},_getHaxJSONSchemaProperty:function(e,t){return window.HAXWiring._getHaxJSONSchemaProperty(e,t)},getHaxJSONSchemaType:function(e){return window.HAXWiring.getHaxJSONSchemaType(e)},validHAXPropertyInputMethod:function(){return window.HAXWiring.validHAXPropertyInputMethod()},prototypeHaxProperties:function(){return window.HAXWiring.prototypeHaxProperties()}},e.HAXWiring=l,e.HAXElement=function(e){return function(u){function c(){var e;return r(this,c),(e=d(this,n(c).call(this))).HAXWiring=new l,e}var h,f,m;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&&s(e,t)}(c,e),h=c,m=[{key:"properties",get:function(){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},p(n(c),"properties",this),{haxProperties:window.HAXWiring.haxProperties})}}],(f=[{key:"setHaxProperties",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return""==r&&"undefined"!==t(this.tagName)&&(r=this.tagName.toLowerCase()),window.addEventListener("hax-store-ready",this._haxStoreReady.bind(this)),"undefined"!==t(window.HaxStore)&&null!=window.HaxStore.instance&&window.HaxStore.ready?this.HAXWiring.setHaxProperties(e,r,i,!0):this.HAXWiring.setHaxProperties(e,r,i,!1)}},{key:"disconnectedCallback",value:function(){window.removeEventListener("hax-store-ready",this._haxStoreReady.bind(this)),p(n(c.prototype),"disconnectedCallback",this)&&p(n(c.prototype),"disconnectedCallback",this).call(this)}},{key:"setup",value:function(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1],arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.HAXWiring.setup(e,"",this)}},{key:"_haxStoreReady",value:function(e){return this.HAXWiring._haxStoreReady(e)}},{key:"validateSetting",value:function(e){return this.HAXWiring.validateSetting(e)}},{key:"getHaxProperties",value:function(){return this.haxProperties}},{key:"getHaxJSONSchema",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;return this.HAXWiring.getHaxJSONSchema(e,t,r)}},{key:"postProcessgetHaxJSONSchema",value:function(e){return this.HAXWiring.postProcessgetHaxJSONSchema(e)}},{key:"_getHaxJSONSchemaProperty",value:function(e,t){return this.HAXWiring._getHaxJSONSchemaProperty(e,t)}},{key:"getHaxJSONSchemaType",value:function(e){return this.HAXWiring.getHaxJSONSchemaType(e)}},{key:"validHAXPropertyInputMethod",value:function(){return this.HAXWiring.validHAXPropertyInputMethod()}},{key:"prototypeHaxProperties",value:function(){return this.HAXWiring.prototypeHaxProperties()}}])&&i(h.prototype,f),m&&i(h,m),c}()},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=hax-body-behaviors.umd.js.map |
@@ -31,2 +31,6 @@ /** | ||
* | ||
* type_exclusive is a flag that can be used to force selections to default to this | ||
* when there are multiple options. This isn't always desired but HAX will determine | ||
* if it makes more sense to just use the default (for example when pulling in from a remote address). | ||
* | ||
* This is an example of th gizmo object that is expressed in the lrn-table tag: | ||
@@ -43,2 +47,3 @@ * 'gizmo': { | ||
* 'type': 'data', | ||
* 'type_exclusive': false, | ||
* 'url': 'csvFile' | ||
@@ -380,3 +385,3 @@ * } | ||
props.settings.advanced.push({ | ||
attribute: "data-hax-slot", | ||
attribute: "slot", | ||
title: "slot", | ||
@@ -824,2 +829,3 @@ description: "DOM slot area", | ||
pin: true, | ||
value: settings[value].value, | ||
required: settings[value].required, | ||
@@ -995,2 +1001,3 @@ disabled: settings[value].disabled, | ||
pin: true, | ||
value: settings[value].value, | ||
required: settings[value].required, | ||
@@ -1137,2 +1144,3 @@ disabled: settings[value].disabled, | ||
type: "data", | ||
type_exclusive: false, | ||
url: "src" | ||
@@ -1139,0 +1147,0 @@ } |
@@ -15,3 +15,3 @@ { | ||
}, | ||
"version": "2.4.1", | ||
"version": "2.5.0", | ||
"description": "Wire any element up to HAX", | ||
@@ -44,11 +44,11 @@ "repository": { | ||
"@lrnwebcomponents/deduping-fix": "^2.4.0", | ||
"@lrnwebcomponents/storybook-utilities": "^2.4.1", | ||
"@lrnwebcomponents/storybook-utilities": "^2.5.0", | ||
"@polymer/iron-component-page": "github:PolymerElements/iron-component-page", | ||
"@polymer/iron-demo-helpers": "3.1.0", | ||
"@webcomponents/webcomponentsjs": "^2.2.10", | ||
"concurrently": "4.1.0", | ||
"@webcomponents/webcomponentsjs": "2.4.1", | ||
"concurrently": "5.1.0", | ||
"gulp-babel": "8.0.0", | ||
"gulp-sourcemaps": "2.6.4", | ||
"lodash": "4.17.13", | ||
"polymer-cli": "1.9.9", | ||
"polymer-cli": "1.9.11", | ||
"wct-browser-legacy": "1.0.2" | ||
@@ -60,3 +60,3 @@ }, | ||
}, | ||
"gitHead": "27af689f6d96197fba00cc508a953cdd008f21b1" | ||
"gitHead": "3f7a6e3d9f51b13c9b2abaa53b1f75f3acb46f70" | ||
} |
Sorry, the diff of this file is not supported yet
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
195502
2123