PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.2
JetFormBuilder — Dynamic Blocks Form Builder v3.4.2
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 / compatibility / jet-booking / assets / build / frontend.js
jetformbuilder / compatibility / jet-booking / assets / build Last commit date
frontend.asset.php 2 years ago frontend.js 2 years ago
frontend.js
1 lines
1 (()=>{"use strict";const t="YYYY-MM-DD";function e(){return window?.JetABAFInput?.field_format??t}function n(){return window?.JetABAFInput?.layout??"single"}function i(t){return window?.JetABAFData?.[t]}const{InputData:r}=JetFormBuilderAbstract,{isEmpty:o}=JetFormBuilderFunctions;function a(){r.call(this),this.sanitize((function(n){return o(n)||!Array.isArray(n)&&"string"!=typeof n?[]:Array.isArray(n)?n:(n=n.split(" - ")).length?n.map((n=>moment(n,e()).format(t))):[]})),this.isSupported=function(t){return"checkin-checkout"===t.dataset.field},this.addListeners=function(){this.reporting.makeInvalid=()=>{},this.reporting.makeValid=()=>{};const[t]=this.nodes;jQuery(t).on("change.JetFormBuilderMain",(()=>{this.value.current=this.value.isMaked?t.value:this.value.applySanitizers(t.value)}));const e=t.parentElement.querySelectorAll(".jet-abaf-field__input");for(const t of e)t.addEventListener("blur",(()=>this.reportOnBlur()))},this.setValue=function(){this.value.current=this.value.applySanitizers(this.nodes[0].value)},this.checkIsRequired=function(){const[t]=this.nodes;return!!t.required||!!t.parentElement.querySelector(".jet-abaf-field__input[required]")},this.setNode=function(t){if(r.prototype.setNode.call(this,t),this.inputType="checkin-checkout","single"===n())return;const e=t.closest(".jet-abaf-separate-fields");this.nodes.push(...e.querySelectorAll('.jet-abaf-field__input[type="text"]'),e)}}a.prototype=Object.create(r.prototype),a.prototype.parseValueForCalculated=function(){if(!this.getValue()?.length)return 0;if(window?.JetBooking?.calcBookedDates){const n=this.getValue().map((n=>moment(n,t).format(e())));return JetBooking.calcBookedDates(n.join(" - "))}if(i("one_day_bookings"))return 1;const n=this.value.current.map((t=>moment(t)));let r=n[1].diff(n[0],"days");return r=Number(r),i("per_nights")||r++,r};const u=a,{BaseSignal:s}=JetFormBuilderAbstract;function c(){s.call(this),this.isSupported=function(t,e){return e instanceof u},this.runSignal=function(t){"single"===n()?this.runSignalForSingle():this.runSignalForSeparate(t)},this.runSignalForSingle=function(){const[n]=this.input.nodes,{current:i}=this.input.value;i.length?n.value=i.map((n=>moment(n,t).format(e()))).join(" - "):n.value=""},this.runSignalForSeparate=function(n){const[,i,r]=this.input.nodes,{current:o}=this.input.value;if(o?.toString?.()!==n?.toString?.()){if(!o.length)return i.value="",r.value="",void this.updateCalendar();i.value=moment(o[0],t).format(e()),r.value=moment(o[1]??o[0],t).format(e()),this.updateCalendar()}},this.updateCalendar=function(){const{current:t}=this.input.value,[,,,n]=this.input.nodes;if(!t.length)return void jQuery(n).data("dateRangePicker").clear();const i=e();jQuery(n).data("dateRangePicker").setDateRange(moment(t[0]).format(i),moment(t[1]??t[0]).format(i),!0)}}c.prototype=Object.create(s.prototype);const l=c,{addAction:d,addFilter:p}=JetPlugins.hooks;d("jet.fb.observe.before","jet-form-builder/booking-compatibility",(function(t){const{rootNode:e}=t;for(const t of e.querySelectorAll(".field-type-check-in-out")){const e=t.querySelector('input[data-field="checkin-checkout"]');e&&(e.dataset.jfbSync=1)}})),p("jet.fb.inputs","jet-form-builder/booking-compatibility",(function(t){return[u,...t]})),p("jet.fb.signals","jet-form-builder/booking-compatibility",(function(t){return[l,...t]})),p("jet.fb.onCalculate.part","jet-form-builder/booking-compatibility",(function(t,e){const n=t.match(/ADVANCED_PRICE::([\w\-]+)/);if(!n?.length||!e?.input)return t;const[,i]=n,r=e.input.root.getInput(i);return r?(e.cachedFields=e.cachedFields||[],e.cachedFields.includes(r.name)||(e.cachedFields.push(r.name),r.watch((()=>e.setResult()))),t):0})),p("jet.fb.calculated.callback","jet-form-builder/booking-field-parser",(function(t,e,n){return!1!==t||"checkin-checkout"!==e.inputType?t:e.parseValueForCalculated()}))})();