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 / compatibility / jet-booking / assets / build / frontend.js
jetformbuilder / compatibility / jet-booking / assets / build Last commit date
frontend.asset.php 1 year ago frontend.js 1 year 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:o}=JetFormBuilderAbstract,{isEmpty:r}=JetFormBuilderFunctions;function a(){o.call(this),this.sanitize((function(n){return r(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(o.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(o.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 o=n[1].diff(n[0],"days");return o=Number(o),i("per_nights")||o++,o};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,o]=this.input.nodes,{current:r}=this.input.value;if(r?.toString?.()!==n?.toString?.()){if(!r.length)return i.value="",o.value="",void this.updateCalendar();i.value=moment(r[0],t).format(e()),o.value=moment(r[1]??r[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:f}=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)}})),f("jet.fb.inputs","jet-form-builder/booking-compatibility",(function(t){return[u,...t]})),f("jet.fb.signals","jet-form-builder/booking-compatibility",(function(t){return[l,...t]})),f("jet.fb.formula.node.exists","jet-form-builder/booking-compatibility",(function(t,e,n){const i=e.match(/ADVANCED_PRICE::([\w\-]+)/);return i&&i?.length&&(t=n.root.rootNode[i[1]]),t})),f("jet.fb.onCalculate.part","jet-form-builder/booking-compatibility",(function(t,e){if("string"!=typeof t)return t;const n=t.match(/ADVANCED_PRICE::([\w\-]+)/);if(!n?.length||!e?.input)return t;const[,i]=n,o=e.input.root.getInput(i);return o?(e.cachedFields=e.cachedFields||[],e.cachedFields.includes(o.name)||(e.cachedFields.push(o.name),o.watch((()=>e.setResult()))),t):0})),f("jet.fb.calculated.callback","jet-form-builder/booking-field-parser",(function(t,e,n){return!1!==t||"checkin-checkout"!==e.inputType?t:e.parseValueForCalculated()}))})();