PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.2.2
JetFormBuilder — Dynamic Blocks Form Builder v3.2.2
3.6.5.1 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 / assets / js / frontend / calculated.field.js
jetformbuilder / assets / js / frontend Last commit date
lib 2 years ago advanced.reporting.js 2 years ago calculated.field.js 3 years ago checkbox.field.js 2 years ago conditional.block.js 3 years ago custom.options.restrictions.js 2 years ago dynamic.value.js 2 years ago main.js 2 years ago media.field.js 3 years ago media.field.restrictions.js 2 years ago multi.step.js 2 years ago radio.field.js 2 years ago repeater.field.js 2 years ago
calculated.field.js
1 lines
1 (()=>{"use strict";function t(t){return t.closest(".jet-form-builder__calculated-field")}function e(e){var r,n;return!(null===(r=null===(n=t(e))||void 0===n||null===(n=n.dataset)||void 0===n||null===(n=n.formula)||void 0===n?void 0:n.length)||void 0===r||!r)}var r,n,i=window.JetFormBuilderAbstract,u=i.InputData,l=i.CalculatedFormula,o=JetPlugins.hooks.applyFilters,a=(null!==(r=null===(n=window)||void 0===n||null===(n=n.JetFormBuilderMain)||void 0===n?void 0:n.filters)&&void 0!==r?r:{}).applyFilters,s=void 0!==a&&a;function c(){u.call(this),this.formula="",this.precision=0,this.sepDecimal="",this.sepThousands="",this.visibleValNode=null,this.valueTypeProp="number",this.isSupported=function(t){return e(t)},this.setValue=function(){var t=this,e=new l(this,{forceFunction:!0});e.observe(this.formula),e.setResult=function(){t.value.current=e.calculate()},e.relatedCallback=function(e){var r=o("jet.fb.calculated.callback",!1,e,t);if(!1!==r)return r;var n="number"===t.valueTypeProp?e.calcValue:e.value.current;if(!1===s)return n;var i=s("forms/calculated-field-value",e.value.current,jQuery(e.nodes[0]));return i===e.value.current?n:i},e.emptyValue=function(){return"number"===t.valueTypeProp?0:""},e.setResult(),this.value.current=this.value.applySanitizers(this.value.current),this.beforeSubmit((function(r){t.value.silence(),t.value.current=null,t.value.silence(),e.setResult(),r()}),this)},this.setNode=function(e){u.prototype.setNode.call(this,e);var r=t(e).dataset,n=r.formula,i=r.precision,l=r.sepDecimal,o=r.valueType,a=r.sepThousands;this.formula=n,this.precision=+i,this.sepDecimal=null!=l?l:"",this.sepThousands=null!=a?a:"",this.visibleValNode=e.nextElementSibling,this.valueTypeProp=o,this.inputType="calculated"},this.addListeners=function(){},this.report=function(){}}c.prototype=Object.create(u.prototype);const p=c;function f(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,u,l,o=[],a=!0,s=!1;try{if(u=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;a=!1}else for(;!(a=(n=u.call(r)).done)&&(o.push(n.value),o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{if(!a&&null!=r.return&&(l=r.return(),Object(l)!==l))return}finally{if(s)throw i}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return h(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var d=window.JetFormBuilderAbstract.BaseSignal;function v(){d.call(this),this.isSupported=function(t,r){return e(t)},this.baseSignal=function(){var t=f(this.input.nodes,1)[0],e="number"===this.input.valueTypeProp;this.input.calcValue=e?this.withPrecision():this.input.value.current,this.input.value.silence(),this.input.value.current=e?this.convertValue():this.input.value.current,this.input.value.silence(),this.input.visibleValNode.textContent=this.input.value.current,t.value=this.input.calcValue},this.runSignal=function(){this.baseSignal();var t=f(this.input.nodes,1)[0];this.triggerJQuery(t)}}v.prototype=Object.create(d.prototype),v.prototype.convertValue=function(){var t=this.input.value.current;if(Number.isNaN(Number(t)))return 0;var e=this.withPrecision().toString().split(".");return this.input.sepThousands&&(e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.input.sepThousands)),e.join(this.input.sepDecimal)},v.prototype.withPrecision=function(){return Number(this.input.value.current).toFixed(this.input.precision)};const y=v;function b(t){return function(t){if(Array.isArray(t))return m(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return m(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var g=JetPlugins.hooks.addFilter;g("jet.fb.inputs","jet-form-builder/calculated-field",(function(t){return[p].concat(b(t))})),g("jet.fb.signals","jet-form-builder/calculated-field",(function(t){return[y].concat(b(t))}))})();