PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.7
JetFormBuilder — Dynamic Blocks Form Builder v3.4.7
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 / assets / build / frontend / dynamic.value.js
jetformbuilder / assets / build / frontend Last commit date
advanced.reporting.asset.php 1 year ago advanced.reporting.js 1 year ago calculated.field.asset.php 1 year ago calculated.field.js 1 year ago conditional.block.asset.php 1 year ago conditional.block.js 1 year ago dynamic.value.asset.php 1 year ago dynamic.value.js 1 year ago main.asset.php 1 year ago main.css 1 year ago main.js 1 year ago media.field.asset.php 1 year ago media.field.js 1 year ago media.field.restrictions.asset.php 1 year ago media.field.restrictions.js 1 year ago multi.step.asset.php 1 year ago multi.step.js 1 year ago
dynamic.value.js
1 lines
1 (()=>{"use strict";const{CalculatedFormula:t,ConditionsList:e}=JetFormBuilderAbstract;function s(){}s.prototype={to_set:"",prevResult:null,prevValue:null,input:null,frequency:"",set_on_empty:!1,formulas:[],isSupported:t=>!0,observe({to_set:t,conditions:s=[],set_on_empty:o=!1,frequency:r="on_change"},n){this.input=n,this.frequency=r,this.set_on_empty=o,this.prevResult=null,this.prevValue=null,this.to_set=t,this.formulas=[],this.observeSetValue(s,n);const a=new e(s,n.root);if(a.conditions?.length)return a.onChangeRelated=()=>this.applyValue(a),a.observe(),void a.onChangeRelated();for(const t of this.formulas){const e=t.setResult.bind(t);t.setResult=()=>{e(),this.applyValue(!1,!0)},t.setResult()}},observeSetValue(e,s){const o=new t(s);o.observe(this.to_set),o.setResult=()=>{this.to_set=""+o.calculate()},o.setResult(),this.formulas.push(o)},applyValue(t,e=null){let s=!1;switch(s=t?t.getResult():e,this.frequency){case"always":this.setValue(s);break;case"on_change":if(this.prevResult===s)break;this.prevResult=s,this.setValue(s);break;case"once":if(!s)break;this.setValue(),t&&(t.onChangeRelated=()=>{}),this.formulas.forEach((t=>t.clearWatchers()))}},setValue(t=!0){t&&(this.set_on_empty?this.input.value.setIfEmpty(this.to_set):this.input.value.current=this.to_set)}};const o=s,{CalculatedFormula:r}=JetFormBuilderAbstract;function n(...t){o.call(this,...t)}n.prototype=Object.create(o.prototype),n.prototype.isSupported=function(t){return t.isArray()},n.prototype.observeSetValue=function(t,e){let s=[];Array.isArray(this.to_set)||(s=this.to_set.split(",").map((t=>t.trim()))),this.to_set={};for(const[t,o]of Object.entries(s)){const s=new r(e);s.observe(o),s.setResult=()=>{this.to_set[t]=""+s.calculate(),this.to_set=Object.values(this.to_set).filter(Boolean)},s.setResult(),this.formulas.push(s)}};const a=n,{CalculatedFormula:u}=JetFormBuilderAbstract;function l(t=""){this.attrName=t}l.prototype={attrName:"",isSupported(t){return t.attrs.hasOwnProperty(this.attrName)},runObserve(t){const e=t.attrs[this.attrName],s=new u(t);s.observe(e.initial),this.observe(e,s)},observe(t,e){e.setResult=()=>{t.value.current=e.calculate()},e.setResult()}};const i=l,{CalculatedFormula:c}=JetFormBuilderAbstract;function p(){this.isSupported=function(t){const[e]=t.nodes;return e.dataset.hasOwnProperty("value")},this.runObserve=function(t){const[e]=t.nodes,s=new c(t);s.observe(e.dataset.value),s.setResult=()=>{t.value.current=s.calculate()},s.setResult()}}p.prototype=Object.create(i.prototype);const h=p,{applyFilters:f}=JetPlugins.hooks;let d=[];const y=t=>{d.length||(d=f("jet.fb.dynamic.value.types",[a,o]));for(const e of d){const s=new e;if(s.isSupported(t))return s}};function v(t,e){const s=JSON.parse(t);for(const t of s)y(e).observe(t,e)}function b(t){const[e]=t.nodes,s=e.closest(".jet-form-builder-row");s&&s.dataset.hasOwnProperty("value")?v(s.dataset.value,t):e.dataset.hasOwnProperty("dynamicValue")&&v(e.dataset.dynamicValue,t);for(const e of function*(t){for(const e of m)e.isSupported(t)&&(yield e)}(t))e.runObserve(t)}const m=[new i("min"),new i("max"),new h],{addAction:_}=JetPlugins.hooks;_("jet.fb.observe.after","jet-form-builder/dynamic-value",(function(t){for(const e of t.getInputs())b(e)}))})();