PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.6.4.2
JetFormBuilder — Dynamic Blocks Form Builder v3.6.4.2
3.6.5 3.6.4.2 3.6.4.1 3.6.4 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 / select.js
jetformbuilder / modules / option-field / assets / build Last commit date
auto-update.asset.php 2 months ago auto-update.css 3 months ago auto-update.js 2 months ago checkbox.asset.php 2 months ago checkbox.css 1 year ago checkbox.js 2 months ago custom.options.restrictions.asset.php 2 months ago custom.options.restrictions.js 2 months ago editor.asset.php 2 months ago editor.css 3 months ago editor.js 2 months ago radio.asset.php 2 months ago radio.css 1 year ago radio.js 2 months ago select.asset.php 1 month ago select.css 1 year ago select.js 1 month ago
select.js
1 lines
1 (()=>{var t={554(){const{CalculatedFormula:t}=JetFormBuilderAbstract,{addAction:e}=JetPlugins.hooks,r="__JFB_OPTION_FIELD_DEFAULT_VALUE_OBSERVER__";function n(t){if("string"!=typeof t||t.length<2)return t;const e=t.charAt(0),r=t.charAt(t.length-1);return"'"===e&&"'"===r||'"'===e&&'"'===r?t.slice(1,-1):t}function i(t){return Array.isArray(t)?t.some(i):"string"==typeof t&&t.includes("%")}function s(t){return!(""===t||null===t||Array.isArray(t)&&!t.length)}function o(e,r){const o=Array.isArray(r)?r:[r],a=[],u=new Array(o.length);o.forEach((c,l)=>{const f=new t(e);f.observe(function(t){if("string"!=typeof t)return t;const e=t.trim();return!i(e)||function(t){if("string"!=typeof t||t.length<2)return!1;const e=t.charAt(0),r=t.charAt(t.length-1);return"'"===e&&"'"===r||'"'===e&&'"'===r}(e)?e:`'${e.replace(/'/g,"\\'")}'`}(c)),f.setResult=()=>{const t=f.calculate();s(t)&&(u[l]=t,Object.keys(u).length===o.length&&u.every(s)&&(function(t,e){if(Array.isArray(e))return void t.value.setIfEmpty(e.map(t=>n(""+t)));const r=n(""+e);if(!t.isArray())return function(t){if(t.isArray()||"select"!==t.inputType)return!1;const[e]=t.nodes;if(!e||"select-one"!==e.type||e.multiple||!e.options?.length)return!1;const r=Array.from(e.options),[n]=r;return!!n&&!r.some(t=>""===t.value)&&!r.some(t=>t.defaultSelected)&&0===e.selectedIndex&&e.value===n.value}(t)?void(t.value.current=r):void t.value.setIfEmpty(r);const i=function(t){if("string"!=typeof t)return t;const e=t.trim();try{const r=JSON.parse(e);return Array.isArray(r)?r:t}catch(r){if(e.startsWith("[")&&e.endsWith("]")&&e.includes("'"))try{const r=e.replace(/'((?:\\'|[^'])*)'/g,(t,e)=>`"${e.replace(/"/g,'\\"')}"`),n=JSON.parse(r);return Array.isArray(n)?n:t}catch(e){return t}return t}}(r);t.value.setIfEmpty(Array.isArray(i)?i.map(t=>n(""+t)):[r])}(e,Array.isArray(r)?u:u[0]),a.forEach(t=>t.clearWatchers())))},f.setResult(),a.push(f)})}function a(t){var e,r,n;const[s]=t.nodes,a=null!==(e=t.wrapper)&&void 0!==e?e:s,u=null!==(r=null!==(n=a?.dataset?.defaultVal)&&void 0!==n?n:s?.dataset?.defaultVal)&&void 0!==r?r:"",c=function(t){if("string"!=typeof t)return t;const e=t.trim();try{const t=JSON.parse(e);return Array.isArray(t)?t:e}catch(t){if(e.startsWith("[")&&e.endsWith("]")&&e.includes("'"))try{const t=e.replace(/'((?:\\'|[^'])*)'/g,(t,e)=>`"${e.replace(/"/g,'\\"')}"`),r=JSON.parse(t);return Array.isArray(r)?r:e}catch(t){return e}return e}}(u);(function(t,e){if(Array.isArray(e))return e.length>0;if("string"!=typeof t)return i(e);const r=t.trim();return i(e)||r.startsWith("[")&&r.endsWith("]")})(u,c)&&o(t,c)}window[r]||(window[r]=!0,e("jet.fb.observe.after","jet-form-builder/option-field-default-value",function(t){for(const e of t.getInputs()){const[t]=e.nodes;t&&["select","radio","checkbox"].includes(e.inputType)&&a(e)}}))}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n](s,s.exports,r),s.exports}(()=>{"use strict";const{InputData:t,ReactiveHook:e}=JetFormBuilderAbstract;function n(){function r(t){return Array.isArray(t)?(1===t.length&&t[0]&&t[0].includes(",")&&(t=t[0].split(",")),t):[t].filter(Boolean)}t.call(this),this.isSupported=function(t){return"select-multiple"===t?.type},this.addListeners=function(){this.sanitize(t=>Array.isArray(t)?t:[t]),this.sanitize(r);const[t]=this.nodes;t.addEventListener("change",()=>this.setValue()),t.addEventListener("blur",()=>this.reportOnBlur()),this.enterKey=new e,t.addEventListener("keydown",this.handleEnterKey.bind(this))},this.setValue=function(){this.value.current=this.getActiveValue()},this.getActiveValue=function(){const[t]=this.nodes;return Array.from(t.options).filter(t=>t.selected).map(t=>t.value)},this.onClear=function(){this.silenceSet([])}}n.prototype=Object.create(t.prototype);const i=n,{BaseSignal:s}=JetFormBuilderAbstract;function o(){s.call(this),this.isSupported=function(t,e){return["select-multiple","select-one"].includes(t?.type)},this.runSignal=function(){const[t]=this.input.nodes,e="select-one"!==t?.type,{value:r}=this.input;this.input.calcValue=0;for(const i of t.options){var n;i.selected=e?r.current?.includes(i.value):i.value===r.current,i.selected&&(this.input.calcValue+=parseFloat(null!==(n=i.dataset?.calculate)&&void 0!==n?n:i.value))}this.triggerJQuery(t)}}o.prototype=Object.create(s.prototype);const a=o;r(554);const{addFilter:u}=JetPlugins.hooks;window.JetFormBuilderAbstract={...window.JetFormBuilderAbstract,MultiSelectData:i,SignalSelect:a},u("jet.fb.inputs","jet-form-builder/select-field",function(t){return[i,...t]}),u("jet.fb.signals","jet-form-builder/select-field",function(t){return[a,...t]})})()})();