PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 2.10.0
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v2.10.0
V3.3.2 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 All 139 releases
bit-form / assets / bf-608-222.js

bf-608-222.js in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 2.10.0, at assets/bf-608-222.js

2 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var E=Object.defineProperty;var g=Object.getOwnPropertySymbols;var $=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var _=(c,l,d)=>l in c?E(c,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[l]=d,u=(c,l)=>{for(var d in l||(l={}))$.call(l,d)&&_(c,d,l[d]);if(g)for(var d of g(l))q.call(l,d)&&_(c,d,l[d]);return c};import{r as m,t as A,v as R,a as T,c as j,j as e,S as U,dc as n}from"./main-162.js";import{p as B,S as L}from"./bf-179-369.js";import{b as z}from"./bf-230-72.js";import{P as N,a as y,c as G,b as H}from"./bf-606-372.js";import"./bf-361-122.js";function Y({formFields:c,setIntegration:l,integrations:d,allIntegURL:F}){const[P,S]=m.useState([]),[C,w]=m.useState([]),{id:v}=A(),k=R();T();const[s,p]=m.useState(u({},d[v])),[I,b]=m.useState([]),[M,x]=m.useState({show:!1});m.useEffect(()=>{j({},"bitforms_get_pod_type").then(t=>{var a,o;t!=null&&t.success&&t!==void 0&&(S(Object.values((a=t.data)==null?void 0:a.post_types)),w((o=t.data)==null?void 0:o.users))}),j({pod_type:s==null?void 0:s.post_type},"bitforms_get_pod_field").then(t=>{t!=null&&t.success&&t!==void 0&&b(Object.values(t==null?void 0:t.data))})},[]);const r=(t,a,o)=>{const i=u({},s);o?i[t]=Number(a):i[t]=a,p(i)},D=(t,a)=>{const o=u({},s);o[t]=a,j({pod_type:a},"bitforms_get_pod_field").then(i=>{var f;i!=null&&i.success&&i!==void 0&&(b(Object.values(i==null?void 0:i.data)),i!=null&&i.data&&(o.pod_map=Object.values(i.data).filter(h=>h.required).map(h=>({formField:"",podFormField:h.key,required:h.required})),((f=o==null?void 0:o.pod_map)==null?void 0:f.length)<1&&(o.pod_map=[{}])),p(o))})},O=()=>{if(!G(s)){x({show:!0,msg:n("Please map mandatory fields")});return}if(!H(s)){x({show:!0,msg:n("Please map mandatory fields")});return}z(d,l,F,s,k,v,"edit")};return e.jsxs("div",{style:{width:900},children:[e.jsx(U,{snack:M,setSnackbar:x}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("Integration Name ")})}),e.jsx("input",{className:"btcd-paper-inp w-5 mt-1",onChange:t=>r(t.target.name,t.target.value),name:"name",value:s.name,type:"text",placeholder:n("Integration Name...")}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("Post Type")})}),e.jsxs("select",{name:"post_type",onChange:t=>D(t.target.name,t.target.value),value:s==null?void 0:s.post_type,className:"btcd-paper-inp w-5 mt-1",children:[e.jsx("option",{disabled:!0,selected:!0,children:"Select Type"}),P.map((t,a)=>e.jsx("option",{value:t.name,children:t.label},`pod-${a*2}`))]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("Post Status")})}),e.jsxs("select",{name:"post_status",onChange:t=>r(t.target.name,t.target.value),value:s==null?void 0:s.post_status,className:"btcd-paper-inp w-5 mt-1",children:[e.jsx("option",{disabled:!0,selected:!0,children:n("Select Status")}),e.jsx("option",{value:"publish",children:"Publish"}),e.jsx("option",{value:"draft",children:"Draft"}),e.jsx("option",{value:"inherit",children:"Inherit"}),e.jsx("option",{value:"auto-draft",children:"Auto-Draft"}),e.jsx("option",{value:"private ",children:"Private"}),e.jsx("option",{value:"pending",children:"Pending"})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("Comment Status")})}),e.jsxs("select",{name:"comment_status",onChange:t=>r(t.target.name,t.target.value),value:s==null?void 0:s.comment_status,className:"btcd-paper-inp w-5 mt-1",children:[e.jsx("option",{disabled:!0,selected:!0,children:n("Select Status")}),e.jsx("option",{value:"open",children:"Open"}),e.jsx("option",{value:"closed",children:"Closed"})]}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:n("Author")})}),e.jsxs("select",{name:"post_author",onChange:t=>r(t.target.name,t.target.value),value:s==null?void 0:s.post_author,className:"btcd-paper-inp w-5 mt-1",children:[e.jsx("option",{disabled:!0,selected:!0,children:"Logged In User"}),C.map((t,a)=>e.jsx("option",{value:t.ID,children:t.display_name},`pod-${a*2}`))]}),e.jsx("div",{children:e.jsxs("p",{className:"p-1 f-m",children:[e.jsx("strong",{children:"Note"})," ",": All your taxonomies will be mapped automatically from your form fields."]})}),e.jsxs("div",{children:[e.jsx("div",{className:"mt-3 mb-1",children:e.jsx("b",{children:"Pod Fields Mapping"})}),e.jsx("div",{className:"btcd-hr"}),e.jsxs("div",{className:"flx flx-around mt-2 mb-1",children:[e.jsx("div",{className:"txt-dp",children:e.jsx("b",{children:n("Form Fields")})}),e.jsx("div",{className:"txt-dp",children:e.jsx("b",{children:n("Pod Fields")})})]})]}),s.pod_map.map((t,a)=>e.jsx(N,{i:a,type:"pod",field:t,formFields:c,dataConf:s,setDataConf:p,podFields:I},`analytics-m-${a+9}`)),e.jsx("div",{className:"txt-center mt-2",style:{marginRight:85},children:e.jsx("button",{onClick:()=>y("pod_map",s.pod_map.length,s,p),className:"icn-btn sh-sm",type:"button",children:"+"})}),e.jsxs("div",{children:[e.jsx("div",{className:"mt-3 mb-1",children:e.jsx("b",{children:"Post Fields Mapping"})}),e.jsx("div",{className:"btcd-hr"}),e.jsxs("div",{className:"flx flx-around mt-2 mb-1",children:[e.jsx("div",{className:"txt-dp",children:e.jsx("b",{children:n("Form Fields")})}),e.jsx("div",{className:"txt-dp",children:e.jsx("b",{children:n("Post Fields")})})]})]}),s.post_map.map((t,a)=>e.jsx(N,{i:a,type:"post",field:t,formFields:c,dataConf:s,setDataConf:p,podFields:B},`analytics-m-${a+9}`)),e.jsx("div",{className:"txt-center mt-2",style:{marginRight:85},children:e.jsx("button",{onClick:()=>y("post_map",s.post_map.length,s,p),className:"icn-btn sh-sm",type:"button",children:"+"})}),e.jsx(L,{onClick:()=>O()})]})}export{Y as default};
2