PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
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-737-129.js

bf-737-129.js in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder 3.3.1, at assets/bf-737-129.js

2 lines 5.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var T=Object.defineProperty,K=Object.defineProperties;var B=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var E=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var N=(a,s,t)=>s in a?T(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t,c=(a,s)=>{for(var t in s||(s={}))E.call(s,t)&&N(a,t,s[t]);if(v)for(var t of v(s))$.call(s,t)&&N(a,t,s[t]);return a},b=(a,s)=>K(a,B(s));import{j as e,T as O,_ as d,bw as S,cr as P,G as W,F as G,g as H,r as j,S as J,f as V}from"./main-762.js";/* empty css */import{s as y}from"./bf-767-42.js";import{g as _,h as q}from"./bf-660-157.js";import{A as z}from"./bf-752-73.js";import{S as F}from"./bf-432-66.js";import{A as Q}from"./bf-462-75.js";import{u as R}from"./bf-689-67.js";import"./bf-383-45.js";import"./bf-685-46.js";import"./bf-848-68.js";import"./bf-241-52.js";import"./bf-145-47.js";import"./bf-213-54.js";import"./bf-249-69.js";import"./bf-281-48.js";import"./bf-284-49.js";import"./bf-466-50.js";import"./bf-604-51.js";import"./bf-441-53.js";import"./bf-897-55.js";import"./bf-959-70.js";function U({dropboxConf:a,setDropboxConf:s}){var l;const t=(m,p)=>{const i=c({},a);m.target.checked?i.actions.delete_from_wp=!0:delete i.actions.delete_from_wp,s(c({},i))};return e.jsx("div",{className:"pos-rel d-flx w-8",children:e.jsx(O,{checked:((l=a.actions)==null?void 0:l.delete_from_wp)||!1,onChange:m=>t(m),className:"mt-4 mr-2",value:"delete_from_wp",title:d("Delete File From Wordpress"),subTitle:d("Delete file from Wordpress after upload in Dropbox")})})}const A=(a,s,t)=>{const l=c({},s);l.field_map.splice(a,0,{}),t(c({},l))},X=(a,s,t)=>{const l=c({},s);l.field_map.length>1&&l.field_map.splice(a,1),t(c({},l))};function Y({i:a,formFields:s,field:t,dropboxConf:l,setDropboxConf:m}){const p=(i,n)=>{const o=c({},l);o.field_map[n][i.target.name]=i.target.value,m(c({},o))};return e.jsx("div",{className:"flx mt-2 mr-1",children:e.jsxs("div",{className:"pos-rel flx",children:[e.jsxs("div",{className:"flx integ-fld-wrp",children:[e.jsxs("select",{className:"btcd-paper-inp mr-2",name:"formField",value:t.formField||"",onChange:i=>p(i,a),children:[e.jsx("option",{value:"",children:d("Select Field")}),s==null?void 0:s.filter(i=>S.includes(i.type)).map(i=>e.jsx("option",{value:i.key,children:i.name},`ff-rm-${i.key}`))]}),e.jsxs("select",{className:"btcd-paper-inp",name:"dropboxFormField",value:t.dropboxFormField,onChange:i=>p(i,a),children:[e.jsx("option",{value:"",children:d("Select Folder")}),P(l.foldersList,"lower_path","ASC").map(({name:i,lower_path:n})=>e.jsx("option",{value:n,children:n==null?void 0:n.substring(1).split("/").map(o=>o.replace("/",">")).join(" > ")},n))]})]}),e.jsx("button",{onClick:()=>A(a,l,m),className:"icn-btn sh-sm ml-2 mr-1",type:"button",children:"+"}),e.jsx("button",{onClick:()=>X(a,l,m),className:"icn-btn sh-sm ml-1",type:"button","aria-label":"btn",children:e.jsx(W,{})})]})})}function Z({formID:a,formFields:s,dropboxConf:t,setDropboxConf:l,isLoading:m,setIsLoading:p}){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mt-5",children:e.jsx("button",{onClick:()=>_(a,t,l),className:"icn-btn sh-sm ml-2 mr-2 tooltip",style:{"--tooltip-txt":`'${d("Fetch All Dropbox Folders")}'`},type:"button",children:"↻"})}),e.jsx("div",{className:"btcd-hr mt-1"}),e.jsxs("div",{className:"flx flx-around mt-2 mb-1",children:[e.jsx("div",{className:"txt-dp",children:e.jsx("b",{children:d("File Input")})}),e.jsx("div",{className:"txt-dp",children:e.jsx("b",{children:d("Dropbox Folder")})})]}),t==null?void 0:t.field_map.map((i,n)=>e.jsx(Y,{i:n,field:i,formFields:s,dropboxConf:t,setDropboxConf:l},`rp-m-${n+9}`)),e.jsxs("div",{className:"txt-center mt-2",style:{marginRight:85},children:[e.jsx("button",{onClick:()=>A(t.field_map.length,t,l),className:"icn-btn sh-sm",type:"button",children:"+"}),e.jsx(z,{fieldMap:t.field_map,formFields:(s==null?void 0:s.filter(i=>S.includes(i.type)))||[],integrationFields:t.foldersList||[],integKey:"dropboxFormField",integValueProp:"lower_path",onMapped:i=>l(n=>b(c({},n),{field_map:i}))})]}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("div",{className:"mt-4",children:e.jsx("b",{className:"wdt-100",children:d("Actions")})}),e.jsx("div",{className:"btcd-hr mt-1"}),e.jsx(U,{dropboxConf:t,setDropboxConf:l})]})}function ye({mode:a="new",formFields:s,integrations:t,setIntegration:l,allIntegURL:m}){const p=G(),{id:i,formID:n}=H(),[o,k]=j.useState(!1),[I,w]=j.useState({show:!1}),[r,h]=j.useState(()=>a==="edit"?c({},t[i]):{name:"Dropbox Integration",type:"Dropbox",apiKey:"",apiSecret:"",accessCode:"",field_map:[{formField:"",dropboxFormField:""}],foldersList:[],actions:{}}),D=u=>{const f=JSON.parse(u.integration_details);h(L=>V(L,x=>{x.parentAppId=u.id,x.apiKey=f.apiKey,x.apiSecret=f.apiSecret,x.tokenDetails=f.tokenDetails}))};j.useEffect(()=>{r!=null&&r.parentAppId&&_(n,r,h)},[r.parentAppId]);const M=()=>{a==="edit"?y(t,l,m,r,p,i,1):y(t,l,m,r,p)},g=a==="edit"||!!r.parentAppId;return R({conf:r,onSeed:u=>h(c({},u)),save:M,saveDisabled:r.field_map.length<1,ready:g}),e.jsxs("div",{children:[e.jsx(J,{snack:I,setSnackbar:w}),e.jsx(F,{title:d("Name this integration"),children:e.jsx("input",{className:"btcd-paper-inp w-10",onChange:u=>q(u,r,h),name:"name",value:r.name,type:"text",placeholder:d("Integration Name...")})}),e.jsx(Q,{type:"Dropbox",value:r.parentAppId,onSelect:D}),g&&e.jsx(F,{title:d("Field mapping"),subtitle:d("Choose the destination and match form fields to it."),children:e.jsx(Z,{formID:n,formFields:s,dropboxConf:r,setDropboxConf:h,isLoading:o,setIsLoading:k})})]})}export{ye as default};
2