diff --git a/CHANGELOG.md b/CHANGELOG.md index e096b771f..42ddde0a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog +- v2.10.3 - Bugfix fbControlsLoaded [#853](https://github.com/kevinchappell/formBuilder/pull/853) - v2.10.2 - Bugfix i18n lookups [#852](https://github.com/kevinchappell/formBuilder/pull/852) - v2.10.1 - Bugfix typeUserAttrs [#851](https://github.com/kevinchappell/formBuilder/pull/851) - v2.10.0 - Release 2.10.0 [#842](https://github.com/kevinchappell/formBuilder/pull/842) diff --git a/README.md b/README.md index 95a9717a9..f8a50f4db 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -formBuilder v2.10.2 +formBuilder v2.10.3 =========== [![Join the chat at https://gitter.im/kevinchappell/formBuilder](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kevinchappell/formBuilder?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) diff --git a/demo/assets/js/control_plugins/starRating.min.js b/demo/assets/js/control_plugins/starRating.min.js index 3f1cd3e77..e18fd1f60 100644 --- a/demo/assets/js/control_plugins/starRating.min.js +++ b/demo/assets/js/control_plugins/starRating.min.js @@ -1 +1 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/assets/js/control_plugins",n(n.s=1)}([,function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n',{id:"trumbowyg-icons"}),this.markup("div",[this.icons,this.input,l,this.field])},t.prototype.onRender=function(o){var t=this,l=this.config.value||"";window.fbEditors.trumbowyg[this.id]&&window.fbEditors.trumbowyg[this.id].trumbowyg("destroy");var e=window.fbEditors.trumbowyg[this.id]=$(this.field);$.extend(!0,$.trumbowyg.langs.en,{insertImage:"Insert Remote Image",upload:"Upload Image",base64:"Embed Image"}),e.trumbowyg({autogrow:!0,resetCss:!0,btnsDef:{image:{dropdown:["insertImage","base64","upload"],ico:"insertImage"}},btns:[["viewHTML"],["undo","redo"],["formatting"],"btnGrp-design",["link"],["image"],"btnGrp-justify","btnGrp-lists",["foreColor","backColor"],["preformatted"],["horizontalRule"],["fullscreen"]],plugins:{upload:{serverPath:"https://api.imgur.com/3/image",fileFieldName:"image",headers:{Authorization:"Client-ID 9e57cb1c4791cea"},urlPropertyName:"data.link"}}}).on("tbwchange",function(){t.input.value=e.trumbowyg("html")}).trumbowyg("html",l)},e(t,null,[{key:"definition",get:function(){return{i18n:{default:"Trumbowyg"}}}}]),t}(l);l.register("trumbowyg",i,"textarea")})}]); \ No newline at end of file +!function(o){var t={};function l(e){if(t[e])return t[e].exports;var i=t[e]={i:e,l:!1,exports:{}};return o[e].call(i.exports,i,i.exports,l),i.l=!0,i.exports}l.m=o,l.c=t,l.d=function(o,t,e){l.o(o,t)||Object.defineProperty(o,t,{enumerable:!0,get:e})},l.r=function(o){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},l.t=function(o,t){if(1&t&&(o=l(o)),8&t)return o;if(4&t&&"object"==typeof o&&o&&o.__esModule)return o;var e=Object.create(null);if(l.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:o}),2&t&&"string"!=typeof o)for(var i in o)l.d(e,i,function(t){return o[t]}.bind(null,i));return e},l.n=function(o){var t=o&&o.__esModule?function(){return o.default}:function(){return o};return l.d(t,"a",t),t},l.o=function(o,t){return Object.prototype.hasOwnProperty.call(o,t)},l.p="/assets/js/control_plugins",l(l.s=1)}([,function(o,t,l){"use strict";var e=function(){function o(o,t){for(var l=0;l',{id:"trumbowyg-icons"}),this.markup("div",[this.icons,this.input,l,this.field])},t.prototype.onRender=function(o){var t=this,l=this.config.value||"";window.fbEditors.trumbowyg[this.id]&&window.fbEditors.trumbowyg[this.id].trumbowyg("destroy");var e=window.fbEditors.trumbowyg[this.id]=$(this.field);$.extend(!0,$.trumbowyg.langs.en,{insertImage:"Insert Remote Image",upload:"Upload Image",base64:"Embed Image"}),e.trumbowyg({autogrow:!0,resetCss:!0,btnsDef:{image:{dropdown:["insertImage","base64","upload"],ico:"insertImage"}},btns:[["viewHTML"],["undo","redo"],["formatting"],"btnGrp-design",["link"],["image"],"btnGrp-justify","btnGrp-lists",["foreColor","backColor"],["preformatted"],["horizontalRule"],["fullscreen"]],plugins:{upload:{serverPath:"https://api.imgur.com/3/image",fileFieldName:"image",headers:{Authorization:"Client-ID 9e57cb1c4791cea"},urlPropertyName:"data.link"}}}).on("tbwchange",function(){t.input.value=e.trumbowyg("html")}).trumbowyg("html",l)},e(t,null,[{key:"definition",get:function(){return{i18n:{default:"Trumbowyg"}}}}]),t}(l);l.register("trumbowyg",i,"textarea")})}]); \ No newline at end of file diff --git a/demo/assets/js/demo.min.js b/demo/assets/js/demo.min.js index d8141a87f..0e55a8c68 100644 --- a/demo/assets/js/demo.min.js +++ b/demo/assets/js/demo.min.js @@ -1,5 +1,5 @@ /*! * jQuery demo: https://formbuilder.online/ - * Version: 2.10.1 + * Version: 2.10.3 * Author: Kevin Chappell */!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=29)}({1:function(e,t,r){"use strict";t.__esModule=!0;var n=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};var l=t.trimObj=function(e){var t=[null,void 0,"",!1,"false"];for(var r in e)t.includes(e[r])?delete e[r]:Array.isArray(e[r])&&(e[r].length||delete e[r]);return e},s=t.validAttr=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},u=t.attrString=function(e){return Object.entries(e).map(function(e){var t=a(e,2),r=t[0],n=t[1];return s(r)&&Object.values(c(r,n)).join("")}).filter(Boolean).join(" ")},c=t.safeAttr=function(e,t){e=f(e);var r=void 0;return t&&(Array.isArray(t)?r=S(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),r=S(t.trim()))),{name:e,value:t=t?'="'+r+'"':""}},f=t.safeAttrName=function(e){return{className:"class"}[e]||d(e)},d=t.hyphenCase=function(e){return(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})).replace(/\s/g,"-").replace(/^-+/g,"")},p=t.camelCase=function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},m=t.bindEvents=function(e,t){if(t){var r=function(r){t.hasOwnProperty(r)&&e.addEventListener(r,function(e){return t[r](e)})};for(var n in t)r(n)}},b=t.nameAttr=function(e){var t=(new Date).getTime();return(e.type||d(e.label))+"-"+t},y=t.getContentType=function(e){return void 0===e?e:[["array",function(e){return Array.isArray(e)}],["node",function(e){return e instanceof window.Node||e instanceof window.HTMLElement}],["component",function(){return e&&e.dom}],[void 0===e?"undefined":o(e),function(){return!0}]].find(function(t){return t[1](e)})[0]},v=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=y(r),a=n.events,l=i(n,["events"]),s=document.createElement(t),u={string:function(e){s.innerHTML+=e},object:function(t){var r=t.tag,n=t.content,o=i(t,["tag","content"]);return s.appendChild(e(r,n,o))},node:function(e){return s.appendChild(e)},array:function(e){for(var t=0;t":">"};return"string"==typeof e?e.replace(/["&<>]/g,function(e){return t[e]||e}):e},E=t.escapeAttrs=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=S(e[t]));return e},O=t.forEach=function(e,t,r){for(var n=0;n-1&&t.splice(r,1)},D=t.getScripts=function(e,t){var r=jQuery,n=[];return Array.isArray(e)||(e=[e]),N(e)||(n=r.map(e,function(e){var n={dataType:"script",cache:!0,url:(t||"")+e};return r.ajax(n).done(function(){return window.fbLoaded.js.push(e)})})),n.push(r.Deferred(function(e){return r(e.resolve)})),r.when.apply(r,n)},N=t.isCached=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"js",r=!1,n=window.fbLoaded[t];return r=Array.isArray(e)?e.every(function(e){return n.includes(e)}):n.includes(e),r},T=t.getStyles=function(e,t){Array.isArray(e)||(e=[e]),e.forEach(function(e){var r="href",n=e,a="";if("object"==(void 0===e?"undefined":o(e))&&(r=e.type||(e.style?"inline":"href"),a=e.id,e="inline"==r?e.style:e.href,n=a||e.href||e.style),!N(n,"css")){if("href"==r){var i=document.createElement("link");i.type="text/css",i.rel="stylesheet",i.href=(t||"")+e,document.head.appendChild(i)}else $('").attr("id",a).appendTo($(document.head));window.fbLoaded.css.push(n)}})},C=t.capitalize=function(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})},F=t.merge=function e(t,r){var n=Object.assign({},t,r);for(var a in r)n.hasOwnProperty(a)&&(Array.isArray(r[a])?n[a]=Array.isArray(t[a])?B(t[a].concat(r[a])):r[a]:"object"===o(r[a])?n[a]=e(t[a],r[a]):n[a]=r[a]);return n},U=t.addEventListeners=function(e,t,r){return t.split(" ").forEach(function(t){return e.addEventListener(t,r,!1)})},k=t.closest=function(e,t){for(var r=t.replace(".","");(e=e.parentElement)&&!e.classList.contains(r););return e},L=t.mobileClass=function(){var e="";return function(t){/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&(e="fb-mobile")}(navigator.userAgent||navigator.vendor||window.opera),e},M=t.safename=function(e){return e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,"").toLowerCase()},R=t.forceNumber=function(e){return e.replace(/[^0-9]/g,"")},I=t.subtract=function(e,t){return t.filter(function(e){return!~this.indexOf(e)},e)},q=(t.insertStyle=function(e){var t=(e=Array.isArray(e)?e:[e]).map(function(e){var t=e.src,r=e.id;return new Promise(function(e,n){if(window.fbLoaded.css.includes(t))return e(t);var o=v("link",null,{href:t,rel:"stylesheet",id:r});document.head.insertBefore(o,document.head.firstChild)})});return Promise.all(t)},t.removeStyle=function(e){var t=document.getElementById(e);return t.parentElement.removeChild(t)},{addEventListeners:U,attrString:u,camelCase:p,capitalize:C,closest:k,getContentType:y,escapeAttr:S,escapeAttrs:E,escapeHtml:x,forceNumber:R,forEach:O,getScripts:D,getStyles:T,hyphenCase:d,isCached:N,markup:v,merge:F,mobileClass:L,nameAttr:b,parseAttrs:g,parsedHtml:A,parseOptions:h,parseXML:w,removeFromArray:j,safeAttr:c,safeAttrName:f,safename:M,subtract:I,trimObj:l,unique:B,validAttr:s});t.default=q},26:function(e,t,r){"use strict";t.__esModule=!0;var n=document.getElementById("currentFieldId");t.builderActions={showData:function(){return $(".build-wrap").formBuilder("showData")},clearFields:function(){return $(".build-wrap").formBuilder("clearFields")},getData:function(){console.log($(".build-wrap").formBuilder("getData"))},setData:function(){$(".build-wrap").formBuilder("setData",'[{"type":"text","label":"Full Name","subtype":"text","className":"form-control","name":"text-1476748004559"},{"type":"select","label":"Occupation","className":"form-control","name":"select-1476748006618","values":[{"label":"Street Sweeper","value":"option-1","selected":true},{"label":"Moth Man","value":"option-2"},{"label":"Chemist","value":"option-3"}]},{"type":"textarea","label":"Short Bio","rows":"5","className":"form-control","name":"textarea-1476748007461"}]')},addField:function(){var e={type:"text",class:"form-control",label:"Text Field added at: "+(new Date).getTime()};$(".build-wrap").formBuilder("addField",e)},removeField:function(){var e=n.value;$(".build-wrap").formBuilder("removeField",e)},getXML:function(){alert($(".build-wrap").formBuilder("getData","xml"))},getJSON:function(){alert($(".build-wrap").formBuilder("getData","json",!0))},getJS:function(){alert("check console"),console.log($(".build-wrap").formBuilder("getData"))},toggleEdit:function(){$(".build-wrap").formBuilder("toggleFieldEdit",n.value)},toggleAllEdit:function(){return $(".build-wrap").formBuilder("toggleAllFieldEdit")},getFieldTypes:function(){return console.log($(".build-wrap").formBuilder("getFieldTypes"))}},t.renderActions={loadUserForm:function(){$(".render-wrap").formRender({controlConfig:{"textarea.tinymce":{branding:!1,encoding:"xml",menubar:"edit insert format table",plugins:"preview searchreplace autolink link table lists textcolor colorpicker",toolbar:"formatselect | bold italic forecolor backcolor | link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | preview"}},formData:'[{"type":"autocomplete","label":"Autocomplete","className":"form-control","name":"autocomplete-1526094918549","requireValidOption":true,"values":[{"label":"Option 1","value":"option-1"},{"label":"Option 2","value":"option-2"},{"label":"Option 3","value":"option-3"}],"userData":["option-1"]},{"type":"checkbox-group","label":"Checkbox Group","name":"checkbox-group-1526095813035","other":true,"values":[{"label":"Option 1","value":"option-1"},{"label":"Option 2","value":"option-2"}],"userData":["option-1","Bilbo \\"baggins\\""]},{"type":"text","label":"Color Field","name":"text-1526099104236","subtype":"color","userData":["#00ff00"]},{"type":"text","label":"Text Field","name":"text-1526099104236","subtype":"tel","userData":["123-456-7890"]},{"type":"date","label":"Date Field","className":"form-control","name":"date-1526096579821","userData":["2018-01-01"]},{"type":"number","label":"Number","className":"form-control","name":"number-1526099204594","min":"1","max":"3","step":".2","userData":["1.1"]},{"type":"textarea","label":"Text Area","className":"form-control","name":"textarea-1526099273610","subtype":"textarea","userData":["Tennessee Welcomes You!"]},{"type":"textarea","subtype":"tinymce","label":"TinyMCE","className":"form-control","name":"textarea-1526099273610","userData":["<p><span style="color: #339966;">It's a great place</span></p>"]}]'})},clearUserForm:function(){$(".render-wrap").formRender("clear")},renderUserForm:function(){$(".render-wrap").formRender("render",'[{"type":"text","label":"Color picker","name":"text-1526099104236","subtype":"color","userData":["#00ff00"]},{"type":"text","label":"Text Field","name":"text-1526099104236","subtype":"tel","userData":["123-456-7890"]},{"type":"date","label":"Date Field","className":"form-control","name":"date-1526096579821","userData":["2018-01-01"]},{"type":"number","label":"Number","className":"form-control","name":"number-1526099204594","min":"1","max":"3","step":".2","userData":["1.1"]},{"type":"textarea","label":"Text Area","className":"form-control","name":"textarea-1526099273610","subtype":"textarea","userData":["Tennessee Welcomes You!"]},{"type":"textarea","subtype":"tinymce","label":"TinyMCE","className":"form-control","name":"textarea-1526099273610","userData":["<p><span style="color: #339966;">It's a great place</span></p>"]}]')},getHTML:function(){console.log($(".render-wrap").formRender("html"))},showUserData:function(){alert(JSON.stringify($(".render-wrap").formRender("userData")))}},t.demoActions={testSubmit:function(){var e=new FormData(document.forms[0]);console.log("Can submit: ",document.forms[0].checkValidity()),console.log("FormData:",e)},resetDemo:function(){window.sessionStorage.removeItem("formData"),location.reload()}}},27:function(e,t,r){(e.exports=r(9)(!1)).push([e.i,"body,html{height:100%}body{background-color:#f2f2f2;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxoZJUaCBj1CjH7GIaDbc9kqBY3W/Rgjda1iqQcOJu2WW+76pZC9QG7M00dffe9hNnseupFL53r8F7YHSwJWUKP2q+k7RdsxyOB11n0xtOvnW4irMMFNV4H0uqwS5ExsmP9AxbDTc9JwgneAT5vTiUSm1E7BSflSt3bfa1tv8Di3R8n3Af7MNWzs49hmauE2wP+ttrq+AsWpFG2awvsuOqbipWHgtuvuaAE+A1Z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==);font-family:Helvetica,Helvetica Neue,Arial,sans-serif}.form-rendered .build-wrap,.form-rendered .formbuilder-actions,.form-rendered .formbuilder-title,.formrender-actions,.formrender-title,.render-wrap{display:none}.form-rendered .formrender-actions,.form-rendered .formrender-title,.form-rendered .render-wrap{display:block}",""])},28:function(e,t,r){var n=r(27);"string"==typeof n&&(n=[[e.i,n,""]]);var o={attrs:{class:"formBuilder-injected-style"},sourceMap:!1,hmr:!0,transform:void 0,insertInto:void 0};r(8)(n,o);n.locals&&(e.exports=n.locals)},29:function(e,t,r){"use strict";var n=Object.assign||function(e){for(var t=1;t',onRender:function(){e(document.getElementById(t.name)).rateYo({rating:3.6})}}}},o={disabledSubtypes:{text:["password"]},disabledAttrs:["placeholder","name"],dataType:i,subtypes:{text:["datetime-local"]},onSave:function(e,t){window.sessionStorage.setItem("formData",JSON.stringify(t)),u()},onAddField:function(e){document.getElementById("currentFieldId").value=e},onClearAll:function(){return window.sessionStorage.removeItem("formData")},stickyControls:{enable:!0},sortableControls:!0,fields:[{type:"autocomplete",label:"Custom Autocomplete",required:!0,values:[{label:"SQL"},{label:"C#"},{label:"JavaScript"},{label:"Java"},{label:"Python"},{label:"C++"},{label:"PHP"},{label:"Swift"},{label:"Ruby"}]},{label:"Star Rating",attrs:{type:"starRating"},icon:"🌟"}],templates:r,inputSets:[{label:"User Details",icon:"👨",name:"user-details",showHeader:!0,fields:[{type:"text",label:"First Name",className:"form-control"},{type:"select",label:"Profession",className:"form-control",values:[{label:"Street Sweeper",value:"option-2",selected:!1},{label:"Brain Surgeon",value:"option-3",selected:!1}]},{type:"textarea",label:"Short Bio:",className:"form-control"}]},{label:"User Agreement",fields:[{type:"header",subtype:"h3",label:"Terms & Conditions",className:"header"},{type:"paragraph",label:"Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment."},{type:"paragraph",label:"Bring to the table win-win survival strategies to ensure proactive domination. At the end of the day, going forward, a new normal that has evolved from generation X is on the runway heading towards a streamlined cloud solution. User generated content in real-time will have multiple touchpoints for offshoring."},{type:"checkbox",label:"Do you agree to the terms and conditions?"}]}],typeUserDisabledAttrs:{autocomplete:["access"]},typeUserAttrs:{text:{shape:{label:"Class",multiple:!0,options:{"red form-control":"Red","green form-control":"Green","blue form-control":"Blue"},style:"border: 1px solid red"},readonly:{label:"readonly",value:!1}}},disableInjectedStyle:!1,actionButtons:[{id:"smile",className:"btn btn-success",label:"😁",type:"button",events:{click:function(){alert("😁😁😁 !SMILE! 😁😁😁")}}},"save"],disableFields:["autocomplete","custom-tinymce"],replaceFields:[{type:"textarea",subtype:"tinymce",datatype:"custom-tinymce",label:"tinyMCE",required:!0}],disabledFieldButtons:{text:["copy"]},controlPosition:"right",i18n:{override:(t={},t["en-US"]={number:"Big Numbers"},t)}},l=window.sessionStorage.getItem("formData"),s=!0;function u(){if(document.body.classList.toggle("form-rendered",s),s){var t=e(".build-wrap").formBuilder("getData");e(".render-wrap").formRender({formData:t,templates:r,dataType:i}),window.sessionStorage.setItem("formData",JSON.stringify(t))}else e(".build-wrap").formBuilder("setData",e(".render-wrap").formRender("userData"));return s=!s}l&&(o.formData=JSON.parse(l)),e(".build-wrap").formBuilder(o).promise.then(function(e){var t=n({},a.builderActions,a.renderActions,a.demoActions);Object.keys(t).forEach(function(e){document.getElementById(e).addEventListener("click",function(r){t[e]()})}),document.querySelectorAll(".editForm").forEach(function(e){return e.addEventListener("click",u)},!1);var r=document.getElementById("setLanguage"),o=window.sessionStorage.getItem("formBuilder-locale");o&&"en-US"!==o&&(r.value=o,e.actions.setLang(o)),r.addEventListener("change",function(t){var r=t.target.value;window.sessionStorage.setItem("formBuilder-locale",r),e.actions.setLang(r)},!1)})})},7:function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var r=t.protocol+"//"+t.host,n=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,a=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(a)?e:(o=0===a.indexOf("//")?a:0===a.indexOf("/")?r+a:n+a.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},8:function(e,t,r){var n={},o=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),a=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var r=function(e){return document.querySelector(e)}.call(this,e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}}(),i=null,l=0,s=[],u=r(7);function c(e,t){for(var r=0;r=0&&s.splice(t,1)}function m(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),b(t,e.attrs),d(e,t),t}function b(e,t){Object.keys(t).forEach(function(r){e.setAttribute(r,t[r])})}function y(e,t){var r,n,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var s=l++;r=i||(i=m(t)),n=g.bind(null,r,s,!1),o=g.bind(null,r,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",b(t,e.attrs),d(e,t),t}(t),n=function(e,t,r){var n=r.css,o=r.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(n=u(n));o&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([n],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}.bind(null,r,t),o=function(){p(r),r.href&&URL.revokeObjectURL(r.href)}):(r=m(t),n=function(e,t){var r=t.css,n=t.media;n&&e.setAttribute("media",n);if(e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}.bind(null,r),o=function(){p(r)});return n(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=f(e,t);return c(r,t),function(e){for(var o=[],a=0;a - */!function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=48)}([function(e,t,r){"use strict";t.__esModule=!0;var o="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},n=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],o=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(o=(a=l.next()).done)&&(r.push(a.value),!t||r.length!==t);o=!0);}catch(e){n=!0,i=e}finally{try{!o&&l.return&&l.return()}finally{if(n)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var r=0;r=o.length)break;a=o[i++]}else{if((i=o.next()).done)break;a=i.value}var l=a;this[l]=t[l],delete t[l]}t.id||(t.name?t.id=t.name:t.id="control-"+Math.floor(1e7*Math.random()+1)),this.id=t.id,this.type=t.type,this.description&&(t.title=this.description),e.controlConfig||(e.controlConfig={});var s=this.subtype?this.type+"."+this.subtype:this.type;this.classConfig=$.extend({},e.controlConfig[s]||{}),this.subtype&&(t.type=this.subtype),this.required&&(t.required="required",t["aria-required"]="true"),this.disabled&&(t.disabled="disabled"),this.config=t,this.configure()}return e.register=function(t,r,o){var n=o?o+".":"";e.classRegister||(e.classRegister={}),Array.isArray(t)||(t=[t]);var i=t,a=Array.isArray(i),l=0;for(i=a?i:i[Symbol.iterator]();;){var s;if(a){if(l>=i.length)break;s=i[l++]}else{if((l=i.next()).done)break;s=l.value}var u=s;-1===u.indexOf(".")?e.classRegister[n+u]=r:e.error("Ignoring type "+u+". Cannot use the character '.' in a type name.")}},e.getRegistered=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=Object.keys(e.classRegister);return r.length?r.filter(function(e){return t?e.indexOf(t+".")>-1:-1==e.indexOf(".")}):r},e.getRegisteredSubtypes=function(){var t={};for(var r in e.classRegister)if(e.classRegister.hasOwnProperty(r)){var o=r.split("."),i=n(o,2),a=i[0],l=i[1];if(!l)continue;t[a]||(t[a]=[]),t[a].push(l)}return t},e.getClass=function(t,r){var o=r?t+"."+r:t,n=e.classRegister[o]||e.classRegister[t];return n||e.error("Invalid control type. (Type: "+t+", Subtype: "+r+"). Please ensure you have registered it, and imported it correctly.")},e.loadCustom=function(t){var r=[];if(t&&(r=r.concat(t)),window.fbControls&&(r=r.concat(window.fbControls)),!window.fbControlsLoaded){var o=r,n=Array.isArray(o),i=0;for(o=n?o:o[Symbol.iterator]();;){var a;if(n){if(i>=o.length)break;a=o[i++]}else{if((i=o.next()).done)break;a=i.value}a(e,e.classRegister)}window.fbControlsLoaded=!0}},e.mi18n=function(e,t){var r=this.definition,n=r.i18n||{};n=n[l.default.locale]||n.default||n;var i=this.camelCase(e),a="object"==(void 0===n?"undefined":o(n))?n[i]||n[e]:n;if(a)return a;var s=r.mi18n;return"object"===(void 0===s?"undefined":o(s))&&(s=s[i]||s[e]),s||(s=i),l.default.get(s,t)},e.active=function(e){return!Array.isArray(this.definition.inactive)||-1==this.definition.inactive.indexOf(e)},e.label=function(e){return this.mi18n(e)},e.icon=function(e){var t=this.definition;return t&&"object"===o(t.icon)?t.icon[e]:t.icon},e.prototype.configure=function(){},e.prototype.build=function(){var e=this.config,t=e.label,r=e.type,o=function(e,t){var r={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}(e,["label","type"]);return this.markup(r,(0,a.parsedHtml)(t),o)},e.prototype.on=function(e){var t=this,r={prerender:function(e){},render:function(e){var r=function(){t.onRender&&t.onRender()};t.css&&(0,a.getStyles)(t.css),t.js&&!(0,a.isCached)(t.js)?(0,a.getScripts)(t.js).done(r):r()}};return e?r[e]:r},e.error=function(e){throw new Error(e)},e.prototype.markup=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.element=(0,a.markup)(e,t,r),this.element},e.prototype.parsedHtml=function(e){return(0,a.parsedHtml)(e)},e.camelCase=function(e){return(0,a.camelCase)(e)},i(e,null,[{key:"definition",get:function(){return{}}}]),e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};var l=t.trimObj=function(e){var t=[null,void 0,"",!1,"false"];for(var r in e)t.includes(e[r])?delete e[r]:Array.isArray(e[r])&&(e[r].length||delete e[r]);return e},s=t.validAttr=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},u=t.attrString=function(e){return Object.entries(e).map(function(e){var t=i(e,2),r=t[0],o=t[1];return s(r)&&Object.values(f(r,o)).join("")}).filter(Boolean).join(" ")},f=t.safeAttr=function(e,t){e=c(e);var r=void 0;return t&&(Array.isArray(t)?r=k(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),r=k(t.trim()))),{name:e,value:t=t?'="'+r+'"':""}},c=t.safeAttrName=function(e){return{className:"class"}[e]||d(e)},d=t.hyphenCase=function(e){return(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})).replace(/\s/g,"-").replace(/^-+/g,"")},p=t.camelCase=function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},m=t.bindEvents=function(e,t){if(t){var r=function(r){t.hasOwnProperty(r)&&e.addEventListener(r,function(e){return t[r](e)})};for(var o in t)r(o)}},b=t.nameAttr=function(e){var t=(new Date).getTime();return(e.type||d(e.label))+"-"+t},h=t.getContentType=function(e){return void 0===e?e:[["array",function(e){return Array.isArray(e)}],["node",function(e){return e instanceof window.Node||e instanceof window.HTMLElement}],["component",function(){return e&&e.dom}],[void 0===e?"undefined":n(e),function(){return!0}]].find(function(t){return t[1](e)})[0]},g=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=h(r),i=o.events,l=a(o,["events"]),s=document.createElement(t),u={string:function(e){s.innerHTML+=e},object:function(t){var r=t.tag,o=t.content,n=a(t,["tag","content"]);return s.appendChild(e(r,o,n))},node:function(e){return s.appendChild(e)},array:function(e){for(var t=0;t":">"};return"string"==typeof e?e.replace(/["&<>]/g,function(e){return t[e]||e}):e},O=t.escapeAttrs=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=k(e[t]));return e},q=t.forEach=function(e,t,r){for(var o=0;o-1&&t.splice(r,1)},j=t.getScripts=function(e,t){var r=jQuery,o=[];return Array.isArray(e)||(e=[e]),S(e)||(o=r.map(e,function(e){var o={dataType:"script",cache:!0,url:(t||"")+e};return r.ajax(o).done(function(){return window.fbLoaded.js.push(e)})})),o.push(r.Deferred(function(e){return r(e.resolve)})),r.when.apply(r,o)},S=t.isCached=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"js",r=!1,o=window.fbLoaded[t];return r=Array.isArray(e)?e.every(function(e){return o.includes(e)}):o.includes(e),r},T=t.getStyles=function(e,t){Array.isArray(e)||(e=[e]),e.forEach(function(e){var r="href",o=e,i="";if("object"==(void 0===e?"undefined":n(e))&&(r=e.type||(e.style?"inline":"href"),i=e.id,e="inline"==r?e.style:e.href,o=i||e.href||e.style),!S(o,"css")){if("href"==r){var a=document.createElement("link");a.type="text/css",a.rel="stylesheet",a.href=(t||"")+e,document.head.appendChild(a)}else $('").attr("id",i).appendTo($(document.head));window.fbLoaded.css.push(o)}})},L=t.capitalize=function(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})},N=t.merge=function e(t,r){var o=Object.assign({},t,r);for(var i in r)o.hasOwnProperty(i)&&(Array.isArray(r[i])?o[i]=Array.isArray(t[i])?E(t[i].concat(r[i])):r[i]:"object"===n(r[i])?o[i]=e(t[i],r[i]):o[i]=r[i]);return o},D=t.addEventListeners=function(e,t,r){return t.split(" ").forEach(function(t){return e.addEventListener(t,r,!1)})},R=t.closest=function(e,t){for(var r=t.replace(".","");(e=e.parentElement)&&!e.classList.contains(r););return e},M=t.mobileClass=function(){var e="";return function(t){/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&(e="fb-mobile")}(navigator.userAgent||navigator.vendor||window.opera),e},B=t.safename=function(e){return e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,"").toLowerCase()},F=t.forceNumber=function(e){return e.replace(/[^0-9]/g,"")},I=t.subtract=function(e,t){return t.filter(function(e){return!~this.indexOf(e)},e)},P=(t.insertStyle=function(e){var t=(e=Array.isArray(e)?e:[e]).map(function(e){var t=e.src,r=e.id;return new Promise(function(e,o){if(window.fbLoaded.css.includes(t))return e(t);var n=g("link",null,{href:t,rel:"stylesheet",id:r});document.head.insertBefore(n,document.head.firstChild)})});return Promise.all(t)},t.removeStyle=function(e){var t=document.getElementById(e);return t.parentElement.removeChild(t)},{addEventListeners:D,attrString:u,camelCase:p,capitalize:L,closest:R,getContentType:h,escapeAttr:k,escapeAttrs:O,escapeHtml:A,forceNumber:F,forEach:q,getScripts:j,getStyles:T,hyphenCase:d,isCached:S,markup:g,merge:N,mobileClass:M,nameAttr:b,parseAttrs:v,parsedHtml:x,parseOptions:y,parseXML:w,removeFromArray:C,safeAttr:f,safeAttrName:c,safename:B,subtract:I,trimObj:l,unique:E,validAttr:s});t.default=P},function(e,t){ + */!function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=48)}([function(e,t,r){"use strict";t.__esModule=!0;var o="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},n=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],o=!0,n=!1,i=void 0;try{for(var a,l=e[Symbol.iterator]();!(o=(a=l.next()).done)&&(r.push(a.value),!t||r.length!==t);o=!0);}catch(e){n=!0,i=e}finally{try{!o&&l.return&&l.return()}finally{if(n)throw i}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var r=0;r=o.length)break;a=o[i++]}else{if((i=o.next()).done)break;a=i.value}var l=a;this[l]=t[l],delete t[l]}t.id||(t.name?t.id=t.name:t.id="control-"+Math.floor(1e7*Math.random()+1)),this.id=t.id,this.type=t.type,this.description&&(t.title=this.description),e.controlConfig||(e.controlConfig={});var s=this.subtype?this.type+"."+this.subtype:this.type;this.classConfig=$.extend({},e.controlConfig[s]||{}),this.subtype&&(t.type=this.subtype),this.required&&(t.required="required",t["aria-required"]="true"),this.disabled&&(t.disabled="disabled"),this.config=t,this.configure()}return e.register=function(t,r,o){var n=o?o+".":"";e.classRegister||(e.classRegister={}),Array.isArray(t)||(t=[t]);var i=t,a=Array.isArray(i),l=0;for(i=a?i:i[Symbol.iterator]();;){var s;if(a){if(l>=i.length)break;s=i[l++]}else{if((l=i.next()).done)break;s=l.value}var u=s;-1===u.indexOf(".")?e.classRegister[n+u]=r:e.error("Ignoring type "+u+". Cannot use the character '.' in a type name.")}},e.getRegistered=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=Object.keys(e.classRegister);return r.length?r.filter(function(e){return t?e.indexOf(t+".")>-1:-1==e.indexOf(".")}):r},e.getRegisteredSubtypes=function(){var t={};for(var r in e.classRegister)if(e.classRegister.hasOwnProperty(r)){var o=r.split("."),i=n(o,2),a=i[0],l=i[1];if(!l)continue;t[a]||(t[a]=[]),t[a].push(l)}return t},e.getClass=function(t,r){var o=r?t+"."+r:t,n=e.classRegister[o]||e.classRegister[t];return n||e.error("Invalid control type. (Type: "+t+", Subtype: "+r+"). Please ensure you have registered it, and imported it correctly.")},e.loadCustom=function(t){var r=[];if(t&&(r=r.concat(t)),window.fbControls&&(r=r.concat(window.fbControls)),!this.fbControlsLoaded){var o=r,n=Array.isArray(o),i=0;for(o=n?o:o[Symbol.iterator]();;){var a;if(n){if(i>=o.length)break;a=o[i++]}else{if((i=o.next()).done)break;a=i.value}a(e,e.classRegister)}this.fbControlsLoaded=!0}},e.mi18n=function(e,t){var r=this.definition,n=r.i18n||{};n=n[l.default.locale]||n.default||n;var i=this.camelCase(e),a="object"==(void 0===n?"undefined":o(n))?n[i]||n[e]:n;if(a)return a;var s=r.mi18n;return"object"===(void 0===s?"undefined":o(s))&&(s=s[i]||s[e]),s||(s=i),l.default.get(s,t)},e.active=function(e){return!Array.isArray(this.definition.inactive)||-1==this.definition.inactive.indexOf(e)},e.label=function(e){return this.mi18n(e)},e.icon=function(e){var t=this.definition;return t&&"object"===o(t.icon)?t.icon[e]:t.icon},e.prototype.configure=function(){},e.prototype.build=function(){var e=this.config,t=e.label,r=e.type,o=function(e,t){var r={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}(e,["label","type"]);return this.markup(r,(0,a.parsedHtml)(t),o)},e.prototype.on=function(e){var t=this,r={prerender:function(e){},render:function(e){var r=function(){t.onRender&&t.onRender()};t.css&&(0,a.getStyles)(t.css),t.js&&!(0,a.isCached)(t.js)?(0,a.getScripts)(t.js).done(r):r()}};return e?r[e]:r},e.error=function(e){throw new Error(e)},e.prototype.markup=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.element=(0,a.markup)(e,t,r),this.element},e.prototype.parsedHtml=function(e){return(0,a.parsedHtml)(e)},e.camelCase=function(e){return(0,a.camelCase)(e)},i(e,null,[{key:"definition",get:function(){return{}}}]),e}();t.default=s},function(e,t,r){"use strict";t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};var l=t.trimObj=function(e){var t=[null,void 0,"",!1,"false"];for(var r in e)t.includes(e[r])?delete e[r]:Array.isArray(e[r])&&(e[r].length||delete e[r]);return e},s=t.validAttr=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},u=t.attrString=function(e){return Object.entries(e).map(function(e){var t=i(e,2),r=t[0],o=t[1];return s(r)&&Object.values(f(r,o)).join("")}).filter(Boolean).join(" ")},f=t.safeAttr=function(e,t){e=c(e);var r=void 0;return t&&(Array.isArray(t)?r=k(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),r=k(t.trim()))),{name:e,value:t=t?'="'+r+'"':""}},c=t.safeAttrName=function(e){return{className:"class"}[e]||d(e)},d=t.hyphenCase=function(e){return(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})).replace(/\s/g,"-").replace(/^-+/g,"")},p=t.camelCase=function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},m=t.bindEvents=function(e,t){if(t){var r=function(r){t.hasOwnProperty(r)&&e.addEventListener(r,function(e){return t[r](e)})};for(var o in t)r(o)}},b=t.nameAttr=function(e){var t=(new Date).getTime();return(e.type||d(e.label))+"-"+t},h=t.getContentType=function(e){return void 0===e?e:[["array",function(e){return Array.isArray(e)}],["node",function(e){return e instanceof window.Node||e instanceof window.HTMLElement}],["component",function(){return e&&e.dom}],[void 0===e?"undefined":n(e),function(){return!0}]].find(function(t){return t[1](e)})[0]},g=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=h(r),i=o.events,l=a(o,["events"]),s=document.createElement(t),u={string:function(e){s.innerHTML+=e},object:function(t){var r=t.tag,o=t.content,n=a(t,["tag","content"]);return s.appendChild(e(r,o,n))},node:function(e){return s.appendChild(e)},array:function(e){for(var t=0;t":">"};return"string"==typeof e?e.replace(/["&<>]/g,function(e){return t[e]||e}):e},O=t.escapeAttrs=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=k(e[t]));return e},q=t.forEach=function(e,t,r){for(var o=0;o-1&&t.splice(r,1)},j=t.getScripts=function(e,t){var r=jQuery,o=[];return Array.isArray(e)||(e=[e]),S(e)||(o=r.map(e,function(e){var o={dataType:"script",cache:!0,url:(t||"")+e};return r.ajax(o).done(function(){return window.fbLoaded.js.push(e)})})),o.push(r.Deferred(function(e){return r(e.resolve)})),r.when.apply(r,o)},S=t.isCached=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"js",r=!1,o=window.fbLoaded[t];return r=Array.isArray(e)?e.every(function(e){return o.includes(e)}):o.includes(e),r},T=t.getStyles=function(e,t){Array.isArray(e)||(e=[e]),e.forEach(function(e){var r="href",o=e,i="";if("object"==(void 0===e?"undefined":n(e))&&(r=e.type||(e.style?"inline":"href"),i=e.id,e="inline"==r?e.style:e.href,o=i||e.href||e.style),!S(o,"css")){if("href"==r){var a=document.createElement("link");a.type="text/css",a.rel="stylesheet",a.href=(t||"")+e,document.head.appendChild(a)}else $('").attr("id",i).appendTo($(document.head));window.fbLoaded.css.push(o)}})},L=t.capitalize=function(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})},N=t.merge=function e(t,r){var o=Object.assign({},t,r);for(var i in r)o.hasOwnProperty(i)&&(Array.isArray(r[i])?o[i]=Array.isArray(t[i])?E(t[i].concat(r[i])):r[i]:"object"===n(r[i])?o[i]=e(t[i],r[i]):o[i]=r[i]);return o},D=t.addEventListeners=function(e,t,r){return t.split(" ").forEach(function(t){return e.addEventListener(t,r,!1)})},R=t.closest=function(e,t){for(var r=t.replace(".","");(e=e.parentElement)&&!e.classList.contains(r););return e},M=t.mobileClass=function(){var e="";return function(t){/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&(e="fb-mobile")}(navigator.userAgent||navigator.vendor||window.opera),e},B=t.safename=function(e){return e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,"").toLowerCase()},F=t.forceNumber=function(e){return e.replace(/[^0-9]/g,"")},I=t.subtract=function(e,t){return t.filter(function(e){return!~this.indexOf(e)},e)},P=(t.insertStyle=function(e){var t=(e=Array.isArray(e)?e:[e]).map(function(e){var t=e.src,r=e.id;return new Promise(function(e,o){if(window.fbLoaded.css.includes(t))return e(t);var n=g("link",null,{href:t,rel:"stylesheet",id:r});document.head.insertBefore(n,document.head.firstChild)})});return Promise.all(t)},t.removeStyle=function(e){var t=document.getElementById(e);return t.parentElement.removeChild(t)},{addEventListeners:D,attrString:u,camelCase:p,capitalize:L,closest:R,getContentType:h,escapeAttr:k,escapeAttrs:O,escapeHtml:A,forceNumber:F,forEach:q,getScripts:j,getStyles:T,hyphenCase:d,isCached:S,markup:g,merge:N,mobileClass:M,nameAttr:b,parseAttrs:v,parsedHtml:x,parseOptions:y,parseXML:w,removeFromArray:C,safeAttr:f,safeAttrName:c,safename:B,subtract:I,trimObj:l,unique:E,validAttr:s});t.default=P},function(e,t){ /*! * mi18n - https://github.com/Draggable/mi18n * Version: 0.4.6 diff --git a/demo/assets/js/form-builder.min.js.gz b/demo/assets/js/form-builder.min.js.gz index 7226743d6..26beeaea0 100644 Binary files a/demo/assets/js/form-builder.min.js.gz and b/demo/assets/js/form-builder.min.js.gz differ diff --git a/demo/assets/js/form-render.min.js b/demo/assets/js/form-render.min.js index 2e093bef5..34697ebbb 100644 --- a/demo/assets/js/form-render.min.js +++ b/demo/assets/js/form-render.min.js @@ -1,8 +1,8 @@ /*! * jQuery formRender: https://formbuilder.online/ - * Version: 2.10.1 + * Version: 2.10.3 * Author: Kevin Chappell - */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=32)}([function(e,t,n){"use strict";t.__esModule=!0;var r="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},o=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var s=a;this[s]=t[s],delete t[s]}t.id||(t.name?t.id=t.name:t.id="control-"+Math.floor(1e7*Math.random()+1)),this.id=t.id,this.type=t.type,this.description&&(t.title=this.description),e.controlConfig||(e.controlConfig={});var l=this.subtype?this.type+"."+this.subtype:this.type;this.classConfig=$.extend({},e.controlConfig[l]||{}),this.subtype&&(t.type=this.subtype),this.required&&(t.required="required",t["aria-required"]="true"),this.disabled&&(t.disabled="disabled"),this.config=t,this.configure()}return e.register=function(t,n,r){var o=r?r+".":"";e.classRegister||(e.classRegister={}),Array.isArray(t)||(t=[t]);var i=t,a=Array.isArray(i),s=0;for(i=a?i:i[Symbol.iterator]();;){var l;if(a){if(s>=i.length)break;l=i[s++]}else{if((s=i.next()).done)break;l=s.value}var u=l;-1===u.indexOf(".")?e.classRegister[o+u]=n:e.error("Ignoring type "+u+". Cannot use the character '.' in a type name.")}},e.getRegistered=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Object.keys(e.classRegister);return n.length?n.filter(function(e){return t?e.indexOf(t+".")>-1:-1==e.indexOf(".")}):n},e.getRegisteredSubtypes=function(){var t={};for(var n in e.classRegister)if(e.classRegister.hasOwnProperty(n)){var r=n.split("."),i=o(r,2),a=i[0],s=i[1];if(!s)continue;t[a]||(t[a]=[]),t[a].push(s)}return t},e.getClass=function(t,n){var r=n?t+"."+n:t,o=e.classRegister[r]||e.classRegister[t];return o||e.error("Invalid control type. (Type: "+t+", Subtype: "+n+"). Please ensure you have registered it, and imported it correctly.")},e.loadCustom=function(t){var n=[];if(t&&(n=n.concat(t)),window.fbControls&&(n=n.concat(window.fbControls)),!window.fbControlsLoaded){var r=n,o=Array.isArray(r),i=0;for(r=o?r:r[Symbol.iterator]();;){var a;if(o){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}a(e,e.classRegister)}window.fbControlsLoaded=!0}},e.mi18n=function(e,t){var n=this.definition,o=n.i18n||{};o=o[s.default.locale]||o.default||o;var i=this.camelCase(e),a="object"==(void 0===o?"undefined":r(o))?o[i]||o[e]:o;if(a)return a;var l=n.mi18n;return"object"===(void 0===l?"undefined":r(l))&&(l=l[i]||l[e]),l||(l=i),s.default.get(l,t)},e.active=function(e){return!Array.isArray(this.definition.inactive)||-1==this.definition.inactive.indexOf(e)},e.label=function(e){return this.mi18n(e)},e.icon=function(e){var t=this.definition;return t&&"object"===r(t.icon)?t.icon[e]:t.icon},e.prototype.configure=function(){},e.prototype.build=function(){var e=this.config,t=e.label,n=e.type,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["label","type"]);return this.markup(n,(0,a.parsedHtml)(t),r)},e.prototype.on=function(e){var t=this,n={prerender:function(e){},render:function(e){var n=function(){t.onRender&&t.onRender()};t.css&&(0,a.getStyles)(t.css),t.js&&!(0,a.isCached)(t.js)?(0,a.getScripts)(t.js).done(n):n()}};return e?n[e]:n},e.error=function(e){throw new Error(e)},e.prototype.markup=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.element=(0,a.markup)(e,t,n),this.element},e.prototype.parsedHtml=function(e){return(0,a.parsedHtml)(e)},e.camelCase=function(e){return(0,a.camelCase)(e)},i(e,null,[{key:"definition",get:function(){return{}}}]),e}();t.default=l},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};var s=t.trimObj=function(e){var t=[null,void 0,"",!1,"false"];for(var n in e)t.includes(e[n])?delete e[n]:Array.isArray(e[n])&&(e[n].length||delete e[n]);return e},l=t.validAttr=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},u=t.attrString=function(e){return Object.entries(e).map(function(e){var t=i(e,2),n=t[0],r=t[1];return l(n)&&Object.values(c(n,r)).join("")}).filter(Boolean).join(" ")},c=t.safeAttr=function(e,t){e=f(e);var n=void 0;return t&&(Array.isArray(t)?n=O(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),n=O(t.trim()))),{name:e,value:t=t?'="'+n+'"':""}},f=t.safeAttrName=function(e){return{className:"class"}[e]||d(e)},d=t.hyphenCase=function(e){return(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})).replace(/\s/g,"-").replace(/^-+/g,"")},p=t.camelCase=function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},h=t.bindEvents=function(e,t){if(t){var n=function(n){t.hasOwnProperty(n)&&e.addEventListener(n,function(e){return t[n](e)})};for(var r in t)n(r)}},m=t.nameAttr=function(e){var t=(new Date).getTime();return(e.type||d(e.label))+"-"+t},b=t.getContentType=function(e){return void 0===e?e:[["array",function(e){return Array.isArray(e)}],["node",function(e){return e instanceof window.Node||e instanceof window.HTMLElement}],["component",function(){return e&&e.dom}],[void 0===e?"undefined":o(e),function(){return!0}]].find(function(t){return t[1](e)})[0]},y=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=b(n),i=r.events,s=a(r,["events"]),l=document.createElement(t),u={string:function(e){l.innerHTML+=e},object:function(t){var n=t.tag,r=t.content,o=a(t,["tag","content"]);return l.appendChild(e(n,r,o))},node:function(e){return l.appendChild(e)},array:function(e){for(var t=0;t":">"};return"string"==typeof e?e.replace(/["&<>]/g,function(e){return t[e]||e}):e},j=t.escapeAttrs=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=O(e[t]));return e},k=t.forEach=function(e,t,n){for(var r=0;r-1&&t.splice(n,1)},S=t.getScripts=function(e,t){var n=jQuery,r=[];return Array.isArray(e)||(e=[e]),A(e)||(r=n.map(e,function(e){var r={dataType:"script",cache:!0,url:(t||"")+e};return n.ajax(r).done(function(){return window.fbLoaded.js.push(e)})})),r.push(n.Deferred(function(e){return n(e.resolve)})),n.when.apply(n,r)},A=t.isCached=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"js",n=!1,r=window.fbLoaded[t];return n=Array.isArray(e)?e.every(function(e){return r.includes(e)}):r.includes(e),n},T=t.getStyles=function(e,t){Array.isArray(e)||(e=[e]),e.forEach(function(e){var n="href",r=e,i="";if("object"==(void 0===e?"undefined":o(e))&&(n=e.type||(e.style?"inline":"href"),i=e.id,e="inline"==n?e.style:e.href,r=i||e.href||e.style),!A(r,"css")){if("href"==n){var a=document.createElement("link");a.type="text/css",a.rel="stylesheet",a.href=(t||"")+e,document.head.appendChild(a)}else $('").attr("id",i).appendTo($(document.head));window.fbLoaded.css.push(r)}})},_=t.capitalize=function(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})},R=t.merge=function e(t,n){var r=Object.assign({},t,n);for(var i in n)r.hasOwnProperty(i)&&(Array.isArray(n[i])?r[i]=Array.isArray(t[i])?C(t[i].concat(n[i])):n[i]:"object"===o(n[i])?r[i]=e(t[i],n[i]):r[i]=n[i]);return r},L=t.addEventListeners=function(e,t,n){return t.split(" ").forEach(function(t){return e.addEventListener(t,n,!1)})},M=t.closest=function(e,t){for(var n=t.replace(".","");(e=e.parentElement)&&!e.classList.contains(n););return e},P=t.mobileClass=function(){var e="";return function(t){/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&(e="fb-mobile")}(navigator.userAgent||navigator.vendor||window.opera),e},N=t.safename=function(e){return e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,"").toLowerCase()},D=t.forceNumber=function(e){return e.replace(/[^0-9]/g,"")},F=t.subtract=function(e,t){return t.filter(function(e){return!~this.indexOf(e)},e)},U=(t.insertStyle=function(e){var t=(e=Array.isArray(e)?e:[e]).map(function(e){var t=e.src,n=e.id;return new Promise(function(e,r){if(window.fbLoaded.css.includes(t))return e(t);var o=y("link",null,{href:t,rel:"stylesheet",id:n});document.head.insertBefore(o,document.head.firstChild)})});return Promise.all(t)},t.removeStyle=function(e){var t=document.getElementById(e);return t.parentElement.removeChild(t)},{addEventListeners:L,attrString:u,camelCase:p,capitalize:_,closest:M,getContentType:b,escapeAttr:O,escapeAttrs:j,escapeHtml:q,forceNumber:D,forEach:k,getScripts:S,getStyles:T,hyphenCase:d,isCached:A,markup:y,merge:R,mobileClass:P,nameAttr:m,parseAttrs:g,parsedHtml:x,parseOptions:v,parseXML:w,removeFromArray:E,safeAttr:c,safeAttrName:f,safename:N,subtract:F,trimObj:s,unique:C,validAttr:l});t.default=U},function(e,t){ + */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=32)}([function(e,t,n){"use strict";t.__esModule=!0;var r="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},o=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),i=function(){function e(e,t){for(var n=0;n=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}var s=a;this[s]=t[s],delete t[s]}t.id||(t.name?t.id=t.name:t.id="control-"+Math.floor(1e7*Math.random()+1)),this.id=t.id,this.type=t.type,this.description&&(t.title=this.description),e.controlConfig||(e.controlConfig={});var l=this.subtype?this.type+"."+this.subtype:this.type;this.classConfig=$.extend({},e.controlConfig[l]||{}),this.subtype&&(t.type=this.subtype),this.required&&(t.required="required",t["aria-required"]="true"),this.disabled&&(t.disabled="disabled"),this.config=t,this.configure()}return e.register=function(t,n,r){var o=r?r+".":"";e.classRegister||(e.classRegister={}),Array.isArray(t)||(t=[t]);var i=t,a=Array.isArray(i),s=0;for(i=a?i:i[Symbol.iterator]();;){var l;if(a){if(s>=i.length)break;l=i[s++]}else{if((s=i.next()).done)break;l=s.value}var u=l;-1===u.indexOf(".")?e.classRegister[o+u]=n:e.error("Ignoring type "+u+". Cannot use the character '.' in a type name.")}},e.getRegistered=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=Object.keys(e.classRegister);return n.length?n.filter(function(e){return t?e.indexOf(t+".")>-1:-1==e.indexOf(".")}):n},e.getRegisteredSubtypes=function(){var t={};for(var n in e.classRegister)if(e.classRegister.hasOwnProperty(n)){var r=n.split("."),i=o(r,2),a=i[0],s=i[1];if(!s)continue;t[a]||(t[a]=[]),t[a].push(s)}return t},e.getClass=function(t,n){var r=n?t+"."+n:t,o=e.classRegister[r]||e.classRegister[t];return o||e.error("Invalid control type. (Type: "+t+", Subtype: "+n+"). Please ensure you have registered it, and imported it correctly.")},e.loadCustom=function(t){var n=[];if(t&&(n=n.concat(t)),window.fbControls&&(n=n.concat(window.fbControls)),!this.fbControlsLoaded){var r=n,o=Array.isArray(r),i=0;for(r=o?r:r[Symbol.iterator]();;){var a;if(o){if(i>=r.length)break;a=r[i++]}else{if((i=r.next()).done)break;a=i.value}a(e,e.classRegister)}this.fbControlsLoaded=!0}},e.mi18n=function(e,t){var n=this.definition,o=n.i18n||{};o=o[s.default.locale]||o.default||o;var i=this.camelCase(e),a="object"==(void 0===o?"undefined":r(o))?o[i]||o[e]:o;if(a)return a;var l=n.mi18n;return"object"===(void 0===l?"undefined":r(l))&&(l=l[i]||l[e]),l||(l=i),s.default.get(l,t)},e.active=function(e){return!Array.isArray(this.definition.inactive)||-1==this.definition.inactive.indexOf(e)},e.label=function(e){return this.mi18n(e)},e.icon=function(e){var t=this.definition;return t&&"object"===r(t.icon)?t.icon[e]:t.icon},e.prototype.configure=function(){},e.prototype.build=function(){var e=this.config,t=e.label,n=e.type,r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["label","type"]);return this.markup(n,(0,a.parsedHtml)(t),r)},e.prototype.on=function(e){var t=this,n={prerender:function(e){},render:function(e){var n=function(){t.onRender&&t.onRender()};t.css&&(0,a.getStyles)(t.css),t.js&&!(0,a.isCached)(t.js)?(0,a.getScripts)(t.js).done(n):n()}};return e?n[e]:n},e.error=function(e){throw new Error(e)},e.prototype.markup=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.element=(0,a.markup)(e,t,n),this.element},e.prototype.parsedHtml=function(e){return(0,a.parsedHtml)(e)},e.camelCase=function(e){return(0,a.camelCase)(e)},i(e,null,[{key:"definition",get:function(){return{}}}]),e}();t.default=l},function(e,t,n){"use strict";t.__esModule=!0;var r=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}window.fbLoaded={js:[],css:[]},window.fbEditors={quill:{},tinymce:{}};var s=t.trimObj=function(e){var t=[null,void 0,"",!1,"false"];for(var n in e)t.includes(e[n])?delete e[n]:Array.isArray(e[n])&&(e[n].length||delete e[n]);return e},l=t.validAttr=function(e){return!["values","enableOther","other","label","subtype"].includes(e)},u=t.attrString=function(e){return Object.entries(e).map(function(e){var t=i(e,2),n=t[0],r=t[1];return l(n)&&Object.values(c(n,r)).join("")}).filter(Boolean).join(" ")},c=t.safeAttr=function(e,t){e=f(e);var n=void 0;return t&&(Array.isArray(t)?n=O(t.join(" ")):("boolean"==typeof t&&(t=t.toString()),n=O(t.trim()))),{name:e,value:t=t?'="'+n+'"':""}},f=t.safeAttrName=function(e){return{className:"class"}[e]||d(e)},d=t.hyphenCase=function(e){return(e=(e=e.replace(/[^\w\s\-]/gi,"")).replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})).replace(/\s/g,"-").replace(/^-+/g,"")},p=t.camelCase=function(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})},h=t.bindEvents=function(e,t){if(t){var n=function(n){t.hasOwnProperty(n)&&e.addEventListener(n,function(e){return t[n](e)})};for(var r in t)n(r)}},m=t.nameAttr=function(e){var t=(new Date).getTime();return(e.type||d(e.label))+"-"+t},b=t.getContentType=function(e){return void 0===e?e:[["array",function(e){return Array.isArray(e)}],["node",function(e){return e instanceof window.Node||e instanceof window.HTMLElement}],["component",function(){return e&&e.dom}],[void 0===e?"undefined":o(e),function(){return!0}]].find(function(t){return t[1](e)})[0]},y=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=b(n),i=r.events,s=a(r,["events"]),l=document.createElement(t),u={string:function(e){l.innerHTML+=e},object:function(t){var n=t.tag,r=t.content,o=a(t,["tag","content"]);return l.appendChild(e(n,r,o))},node:function(e){return l.appendChild(e)},array:function(e){for(var t=0;t":">"};return"string"==typeof e?e.replace(/["&<>]/g,function(e){return t[e]||e}):e},j=t.escapeAttrs=function(e){for(var t in e)e.hasOwnProperty(t)&&(e[t]=O(e[t]));return e},k=t.forEach=function(e,t,n){for(var r=0;r-1&&t.splice(n,1)},S=t.getScripts=function(e,t){var n=jQuery,r=[];return Array.isArray(e)||(e=[e]),A(e)||(r=n.map(e,function(e){var r={dataType:"script",cache:!0,url:(t||"")+e};return n.ajax(r).done(function(){return window.fbLoaded.js.push(e)})})),r.push(n.Deferred(function(e){return n(e.resolve)})),n.when.apply(n,r)},A=t.isCached=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"js",n=!1,r=window.fbLoaded[t];return n=Array.isArray(e)?e.every(function(e){return r.includes(e)}):r.includes(e),n},T=t.getStyles=function(e,t){Array.isArray(e)||(e=[e]),e.forEach(function(e){var n="href",r=e,i="";if("object"==(void 0===e?"undefined":o(e))&&(n=e.type||(e.style?"inline":"href"),i=e.id,e="inline"==n?e.style:e.href,r=i||e.href||e.style),!A(r,"css")){if("href"==n){var a=document.createElement("link");a.type="text/css",a.rel="stylesheet",a.href=(t||"")+e,document.head.appendChild(a)}else $('").attr("id",i).appendTo($(document.head));window.fbLoaded.css.push(r)}})},_=t.capitalize=function(e){return e.replace(/\b\w/g,function(e){return e.toUpperCase()})},R=t.merge=function e(t,n){var r=Object.assign({},t,n);for(var i in n)r.hasOwnProperty(i)&&(Array.isArray(n[i])?r[i]=Array.isArray(t[i])?C(t[i].concat(n[i])):n[i]:"object"===o(n[i])?r[i]=e(t[i],n[i]):r[i]=n[i]);return r},L=t.addEventListeners=function(e,t,n){return t.split(" ").forEach(function(t){return e.addEventListener(t,n,!1)})},M=t.closest=function(e,t){for(var n=t.replace(".","");(e=e.parentElement)&&!e.classList.contains(n););return e},P=t.mobileClass=function(){var e="";return function(t){/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)&&(e="fb-mobile")}(navigator.userAgent||navigator.vendor||window.opera),e},N=t.safename=function(e){return e.replace(/\s/g,"-").replace(/[^a-zA-Z0-9[\]_-]/g,"").toLowerCase()},D=t.forceNumber=function(e){return e.replace(/[^0-9]/g,"")},F=t.subtract=function(e,t){return t.filter(function(e){return!~this.indexOf(e)},e)},U=(t.insertStyle=function(e){var t=(e=Array.isArray(e)?e:[e]).map(function(e){var t=e.src,n=e.id;return new Promise(function(e,r){if(window.fbLoaded.css.includes(t))return e(t);var o=y("link",null,{href:t,rel:"stylesheet",id:n});document.head.insertBefore(o,document.head.firstChild)})});return Promise.all(t)},t.removeStyle=function(e){var t=document.getElementById(e);return t.parentElement.removeChild(t)},{addEventListeners:L,attrString:u,camelCase:p,capitalize:_,closest:M,getContentType:b,escapeAttr:O,escapeAttrs:j,escapeHtml:q,forceNumber:D,forEach:k,getScripts:S,getStyles:T,hyphenCase:d,isCached:A,markup:y,merge:R,mobileClass:P,nameAttr:m,parseAttrs:g,parsedHtml:x,parseOptions:v,parseXML:w,removeFromArray:E,safeAttr:c,safeAttrName:f,safename:N,subtract:F,trimObj:s,unique:C,validAttr:l});t.default=U},function(e,t){ /*! * mi18n - https://github.com/Draggable/mi18n * Version: 0.4.6 diff --git a/demo/assets/js/form-render.min.js.gz b/demo/assets/js/form-render.min.js.gz index 54937a6e1..4bd03a5d6 100644 Binary files a/demo/assets/js/form-render.min.js.gz and b/demo/assets/js/form-render.min.js.gz differ diff --git a/package.json b/package.json index a5e074646..905cccf9e 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formBuilder", - "version": "2.10.2", + "version": "2.10.3", "main": "dist/form-builder.min.js", "files": [ "dist/form-builder.min.js", diff --git a/src/js/control.js b/src/js/control.js index bdcd59cf7..e7d476dab 100755 --- a/src/js/control.js +++ b/src/js/control.js @@ -200,11 +200,11 @@ export default class control { // loop through each defined custom control. // expects a function that receives the master control class to inherit from (or optional classRegister to inherit from subclass) // see src/js/control_plugins/ for an example - if (!window.fbControlsLoaded) { + if (!this.fbControlsLoaded) { for (const loadControl of controlClasses) { loadControl(control, control.classRegister) } - window.fbControlsLoaded = true + this.fbControlsLoaded = true } }