File manager - Edit - /home/proidvn/me.proid.vn/wp-content/plugins/jetformbuilder/assets/build/frontend/calculated.field.js
Back
(()=>{"use strict";function t(t){return t.closest(".jet-form-builder__calculated-field")}function e(e){var i;return!(null===(i=t(e)?.dataset?.formula?.length)||void 0===i||!i)}var i;const{InputData:s,CalculatedFormula:u}=window.JetFormBuilderAbstract,{applyFilters:n}=JetPlugins.hooks,{applyFilters:r=!1}=null!==(i=window?.JetFormBuilderMain?.filters)&&void 0!==i?i:{};function l(){s.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(){const t=new u(this,{forceFunction:!0});t.observe(this.formula),t.setResult=()=>{this.value.current=t.calculate()},t.relatedCallback=t=>{const e=n("jet.fb.calculated.callback",!1,t,this);if(!1!==e)return e;const i="number"===this.valueTypeProp?t.calcValue:t.value.current;if(!1===r)return i;const s=r("forms/calculated-field-value",t.value.current,jQuery(t.nodes[0]));return s===t.value.current?i:s},t.emptyValue=()=>"number"===this.valueTypeProp?0:"",t.setResult(),this.value.current=this.value.applySanitizers(this.value.current),this.beforeSubmit((e=>{this.value.silence(),this.value.current=null,this.value.silence(),t.setResult(),e()}),this)},this.setNode=function(e){s.prototype.setNode.call(this,e),s.prototype.reQueryValue=()=>{};const{formula:i,precision:u,sepDecimal:n,valueType:r,sepThousands:l}=t(e).dataset;this.formula=i,this.precision=+u,this.sepDecimal=null!=n?n:"",this.sepThousands=null!=l?l:"",this.visibleValNode=e.nextElementSibling,this.valueTypeProp=r,this.inputType="calculated"},this.addListeners=function(){},this.report=()=>{},this.reQueryValue=()=>{},this.revertValue=()=>{}}l.prototype=Object.create(s.prototype);const a=l,{BaseSignal:o}=window.JetFormBuilderAbstract;function c(){o.call(this),this.isSupported=function(t){return e(t)},this.baseSignal=function(){const[t]=this.input.nodes,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();const[t]=this.input.nodes;this.triggerJQuery(t)}}c.prototype=Object.create(o.prototype),c.prototype.convertValue=function(){const t=this.input.value.current;if(Number.isNaN(Number(t)))return 0;const 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)},c.prototype.withPrecision=function(){return Number(this.input.value.current).toFixed(this.input.precision)};const p=c,{addFilter:h}=JetPlugins.hooks;h("jet.fb.inputs","jet-form-builder/calculated-field",(function(t){return[a,...t]})),h("jet.fb.signals","jet-form-builder/calculated-field",(function(t){return[p,...t]}))})();
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Generation time: 0.17 |
proxy
|
phpinfo
|
Settings