PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.6.3
JetFormBuilder — Dynamic Blocks Form Builder v3.5.6.3
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / modules / option-field / assets / build / checkbox.js
jetformbuilder / modules / option-field / assets / build Last commit date
checkbox.asset.php 7 months ago checkbox.css 1 year ago checkbox.js 7 months ago custom.options.restrictions.asset.php 2 years ago custom.options.restrictions.js 2 years ago editor.asset.php 6 months ago editor.css 7 months ago editor.js 6 months ago radio.asset.php 1 year ago radio.css 1 year ago radio.js 1 year ago select.asset.php 1 year ago select.css 1 year ago select.js 1 year ago
checkbox.js
1 lines
1 (()=>{"use strict";const e=function(e){return e.nextElementSibling.querySelector("input.text-field")},t=function(e,t,o){var i;if(e.checked=t?.includes(e.value),!e.checked)return;if(o.calcValue+=parseFloat(null!==(i=e.dataset?.calculate)&&void 0!==i?i:e.value),!o.isArray())return;const n=t.indexOf(e.value);t.splice(n,1)},{isEmpty:o}=JetFormBuilderFunctions,{InputData:i,ReactiveHook:n}=JetFormBuilderAbstract,{getParsedName:s}=JetFormBuilderFunctions;function r(){i.call(this),this.wrapper=null,this.isResetCalcValue=!1}r.prototype=Object.create(i.prototype),r.prototype.wrapper=null,r.prototype.isSupported=function(e){return e.classList.contains("checkradio-wrap")&&e.querySelector(".checkboxes-wrap")},r.prototype.addListeners=function(){this.enterKey=new n,this.wrapper.addEventListener("change",this.onChangeValue.bind(this)),this.wrapper.addEventListener("keydown",this.handleEnterKey.bind(this)),this.wrapper.addEventListener("focusout",(e=>{[...this.nodes].includes(e?.relatedTarget)||e?.relatedTarget?.closest?.(".jet-form-builder__field-wrap.custom-option")||this.reportOnBlur()})),this.addNewButton&&this.wrapper.addEventListener("click",(e=>{e?.target&&!this.addNewButton.isEqualNode(e.target)||(this.silenceSet([...this.value.current,!0]),this.getCustomNodes().at(-1).closest(".jet-form-builder__field-wrap").querySelector("span input.jet-form-builder__field").focus())})),this.isArray()&&this.sanitize((e=>function(e,t){return Array.isArray(e)?(!t?.keepCommas&&1===e.length&&e[0]&&1!=e[0]&&String(e[0]).includes(",")&&(e=(e=String(e[0]).split(",")).map((e=>"true"===e?"":"false"===e?null:e))),e):[e].filter(Boolean)}(e,this))),this.callable=null,this.sanitize((i=>function(i,n){n.calcValue=0;const s=n.isArray()?[...i]:i;for(const e of n.nodes)!e.dataset.custom&&t(e,s,n);if(!n.addNewButton)return i;const r=n.getCustomNodes();if(!r.length||s.length){for(let t=Math.max(r.length,s.length)-1;t>=0;t--){let i=r[t];const a=s[t];if(null==a){i&&i.closest(".custom-option").remove();continue}if(void 0===i){if(!1===a)continue;n.addCustomOption(),i=n.nodes[n.nodes.length-1]}const u=e(i);u.disabled=!1===a,u.disabled||o(a)||!0===a||(n.calcValue+=1),u.value!==a&&"boolean"!=typeof a&&(u.value=a)}return i.filter((e=>null!==e))}for(let e=Math.max(r.length,s.length)-1;e>=0;e--)if(r[e]){let t=r[e];void 0===s[e]&&t.closest(".custom-option").remove()}}(i,this)))},r.prototype.onChangeValue=function(e){this.value.current=this.getActiveValue()},r.prototype.setValue=function(){this.value.current=this.getActiveValue(),this.value.applySanitizers(this.value.current)},r.prototype.setNode=function(e){e.jfbSync=this,this.nodes=e.getElementsByClassName("jet-form-builder__field checkboxes-field"),this.rawName=this.nodes[0].name,this.name=s(this.rawName),this.inputType="checkbox",this.wrapper=e,this.addNewButton=e.querySelector(".jet-form-builder__field-wrap.custom-option .add-custom-option")},r.prototype.getActiveValue=function(){var e;const t=[];this.keepCommas=!1;for(const e of this.nodes)e.checked&&"1"===e.dataset.keepCommas&&(this.keepCommas=!0),this.processValueFormSingleChoice(e,t);return this.isArray()?t:null!==(e=t?.[0])&&void 0!==e?e:""},r.prototype.processValueFormSingleChoice=function(t,o){if(!t.dataset.custom&&!t.checked)return;if(!t.dataset.custom)return void o.push(t.value);const i=e(t);t.checked||i.value?i.value||!t.checked?i.value&&o.push(!!t.checked&&i.value):o.push(!0):o.push(null)},r.prototype.isArray=function(){return Boolean(this.addNewButton)||this.nodes.item&&this.nodes.item(0)?.name?.includes?.("[]")},r.prototype.addCustomOption=function(){const e=this.addNewButton.closest(".custom-option");return this.wrapper.insertBefore(this.getCustomOptionNode(),e)},r.prototype.getCustomOptionNode=function(){if(!this.addNewButton)return!1;const e=this.addNewButton.querySelector("template"),t=document.createElement("template");return t.innerHTML=e.innerHTML.trim(),t.content.firstChild},r.prototype.getCustomNodes=function(){return[...this.nodes].filter((e=>e.dataset.custom&&e.nextElementSibling))};const a=r,{addFilter:u}=JetPlugins.hooks;window.JetFormBuilderAbstract={...window.JetFormBuilderAbstract,CheckboxData:a},u("jet.fb.inputs","jet-form-builder/checkbox-field",(function(e){return[a,...e]}))})();