PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V_3.0.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV_3.0.0
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
bit-form / assets / bf-618-341.js

bf-618-341.js in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder V_3.0.0, at assets/bf-618-341.js

2 lines 4.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import{g as w,i as L,aH as O,a as B,j as e,h as t,_ as p,f as y,bG as F}from"./main-294.js";import{h as C}from"./bf-176-80.js";import{F as x}from"./bf-821-385.js";import{l as D,f as H}from"./bf-253-462.js";import{F as b}from"./bf-766-384.js";import{C as u}from"./bf-186-103.js";import{S as $}from"./bf-22-458.js";import"./bf-934-246.js";import"./bf-22-244.js";function J({className:A=""}){var N;const{fieldKey:i}=w(),[r,g]=L(O),{css:a}=B();if(!i)return null;const l=r[i],m=(l==null?void 0:l.shippingType)==="dynamic",h=(l==null?void 0:l.taxType)==="dynamic",j=(N=l==null?void 0:l.lbl)!=null?N:"",v=()=>Object.entries(r).filter(n=>n[1].typ.match(/^(radio|number|currency)/)).map(n=>e.jsx("option",{value:n[0],children:n[1].adminLbl||n[1].lbl},n[0])),o=(s,d)=>{const n=y(r,c=>{if(d){if(c[i][s]=d,s==="locale"){const S=d.split(" - ");c[i].locale=S[S.length-1],c[i].language=d}}else delete c[i][s]});g(n),F({event:`${s} changed to ${d}: ${j||i}`,type:`${s}_changed`,state:{fields:n,fldKey:i}})},f=s=>{const{value:d}=s.target,n=y(r,c=>{d?c[i].shippingType=d:delete c[i].shippingType,delete c[i].shipping,delete c[i].shippingFld});g(n),F({event:`Shipping Type changed to "${d}": ${j||i}`,type:"set_shipping_type",state:{fields:n,fldKey:i}})},T=s=>{const{value:d}=s.target,n=y(r,c=>{d?c[i].taxType=d:delete c[i].taxType,delete c[i].tax,delete c[i].taxFld});g(n),F({event:`Tax type changed to "${d}": ${j||i}`,type:"set_tax_type",state:{fields:n,fldKey:i}})},_=()=>D.map(s=>({label:e.jsxs("div",{className:"flx flx-between",children:[e.jsx("span",{className:"btcd-ttl-ellipsis",children:s.region}),e.jsx("code",{className:"btcd-code",children:s.code})]}),title:`${s.region} - ${s.code}`,value:`${s.region} - ${s.code}`})),k=()=>H.map(s=>({label:s.label,value:s.value}));return e.jsxs("div",{className:A,children:[e.jsxs("div",{className:a(t.ml2,t.mr2,t.p1),children:[e.jsx("b",{children:p("Language")}),e.jsx(C,{className:"w-10 btcd-paper-drpdwn mt-1",options:_(),onChange:s=>o("locale",s),defaultValue:l.language||"",largeData:!0,singleSelect:!0})]}),e.jsx(b,{}),e.jsxs("div",{className:a(t.ml2,t.mr2,t.p1),children:[e.jsx("b",{children:p("Disable Card")}),e.jsx(C,{className:"w-10 btcd-paper-drpdwn mt-1 btcd-ttc",options:k(),onChange:s=>o("disableFunding",s),defaultValue:l.disableFunding||""})]}),e.jsx(b,{}),e.jsxs("div",{className:a(t.ml2,t.mr2,t.p1),children:[e.jsx("b",{children:p("Shipping Amount")}),e.jsx("br",{}),e.jsx(u,{id:"shpng-amnt-fxd",onChange:f,radio:!0,checked:!m,title:p("Fixed")}),e.jsx(u,{id:"shpng-amnt-dynmc",onChange:f,radio:!0,checked:m,title:p("Dynamic"),value:"dynamic"})]}),!m&&e.jsx("div",{className:a(t.ml2,t.mr2,t.p1),children:e.jsx($,{id:"spng-cst",cls:a(x.input),inpType:"number",title:p("Shipping Cost"),value:l.shipping||"",action:s=>o("shipping",s.target.value),className:a({mt:0})})}),m&&e.jsxs("div",{className:a(t.ml2,t.mr2,t.p1),children:[e.jsx("label",{htmlFor:"shippingFld",children:p("Select Shipping Amount Field")}),e.jsxs("select",{"data-testid":"slct-shpng-amnt",onChange:s=>o("shippingFld",s.target.value),name:"shippingFld",className:a(x.input),value:l.shippingFld||"",children:[e.jsx("option",{value:"",children:p("Select Field")}),v()]})]}),e.jsx(b,{}),e.jsxs("div",{className:a(t.ml2,t.mr2,t.p1),children:[e.jsx("b",{children:p("Tax Amount Type")}),e.jsx("br",{}),e.jsx(u,{id:"tx-amnt-fxd",onChange:T,radio:!0,checked:!h,title:p("Fixed")}),e.jsx(u,{id:"tx-amnt-dynmc",onChange:T,radio:!0,checked:h,title:p("Dynamic"),value:"dynamic"})]}),!h&&e.jsx("div",{className:a(t.ml2,t.mr2,t.p1),children:e.jsx($,{id:"tax",cls:a(x.input),inpType:"number",title:p("Tax (%)"),value:l.tax||"",action:s=>o("tax",s.target.value),className:a({mt:0})})}),h&&e.jsxs("div",{className:a(t.ml2,t.mr2,t.p1),children:[e.jsx("label",{htmlFor:"taxFld",children:p("Select Amount Field")}),e.jsxs("select",{"data-testid":"slct-amnt-fld",onChange:s=>o("taxFld",s.target.value),name:"taxFld",className:a(x.input),value:l.taxFld||"",children:[e.jsx("option",{value:"",children:p("Select Field")}),v()]})]})]})}export{J as default};
2