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-604-287.js

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

2 lines 4.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import{a as k,g as D,i as E,aH as I,u as L,k as M,r as C,z as H,j as t,_ as b,h as m,e3 as P,I as c,e4 as F,f as y,bG as $}from"./main-294.js";import{D as G,B as K}from"./bf-487-72.js";import{F as _}from"./bf-821-385.js";import{t as R}from"./bf-384-383.js";import{A as Z}from"./bf-446-382.js";import{E as T}from"./bf-28-232.js";import{S as U}from"./bf-908-241.js";import{S as V}from"./bf-22-458.js";import"./bf-176-80.js";import"./bf-867-113.js";import"./bf-663-270.js";import"./bf-957-268.js";import"./bf-645-110.js";import"./bf-986-242.js";import"./bf-764-245.js";import"./bf-250-243.js";import"./bf-22-244.js";import"./bf-934-246.js";import"./bf-188-247.js";import"./bf-85-248.js";import"./bf-930-249.js";import"./bf-5-86.js";import"./bf-112-250.js";import"./bf-399-251.js";import"./bf-379-106.js";import"./bf-508-252.js";import"./bf-128-253.js";import"./bf-889-272.js";import"./bf-766-384.js";import"./bf-383-274.js";import"./bf-108-386.js";import"./bf-297-387.js";var g=[{lbl:"Only Characters",val:"^[a-zA-Z]+$",msg:"Only characters allowed"},{lbl:"Only Digits",val:"^[0-9]+(^[.])?$",msg:"Only digits allowed"},{lbl:"Name",val:"^[a-zA-Z .]+$",msg:"Name cannot contain any number or special characters"},{lbl:"Username",val:"^[a-z0-9_.]+$",msg:"Username cannot contain any space or special characters"},{lbl:"Character Limit",val:"^.{0,100}$",msg:"Maximum 100 characters allowed"},{lbl:"Word Limit",val:"^(?:$_bf_$b$_bf_$w+$_bf_$b[$_bf_$s$_bf_$r$_bf_$n]*){1,30}$",msg:"Maximum 30 words allowed"},{lbl:"Only Gmail",val:"^[a-z0-9]($_bf_$.?[a-z0-9]){0,}@(gmail)$_bf_$.com$",msg:"Only Gmail is allowed"}];function Fe(){const{css:l}=k(),{fieldKey:s}=D(),[f,v]=E(I),N=L(M),x=C.useRef();if(!s)return null;const e=H(f[s]),h=e.adminLbl||"",j=e.valid.regexr||"",S=e.valid.flags||"",i=N.err||{},z=r=>{var p;if(!c)return;const{value:a}=r.target;if(a==="")delete e.valid.regexr;else{const o=F(a);e.valid.regexr=o,e.err||(e.err={}),e.err.regexr||(e.err.regexr={});const d=g.find(u=>u.val===o);e.err.regexr.dflt=d?`<p style="margin:0">${d.msg}</p>`:((p=i[e.typ])==null?void 0:p.regexr)||(i==null?void 0:i.regexr)||'<p style="margin:0">Pattern not matched</p>',e.err.regexr.show=!0,e.typ==="password"&&delete e.valid.validations}const n=y(f,o=>{o[s]=e});v(n),$({event:`Regex Pattern updated: ${e.lbl||h||s}`,type:"set_regexr",state:{fields:n,fldKey:s}})},w=r=>{var n,p,o;if((p=(n=x==null?void 0:x.current)==null?void 0:n._tippy)==null||p.hide(),!c)return;if(r==="")delete e.valid.regexr;else{const d=F(r);e.valid.regexr=d,e.err||(e.err={}),e.err.regexr||(e.err.regexr={});const u=g.find(O=>O.val===d);e.err.regexr.dflt=u?`<p style="margin:0">${u.msg}</p>`:((o=i[e.typ])==null?void 0:o.regexr)||(i==null?void 0:i.regexr)||'<p style="margin:0">Pattern not matched</p>',e.err.regexr.show=!0,e.typ==="password"&&delete e.valid.validations}const a=y(f,d=>{d[s]=e});v(a),$({event:`Regex Pattern updated: ${e.lbl||h||s}`,type:"set_regexr",state:{fields:a,fldKey:s}})},B=r=>{if(!c)return;r.target.value===""?delete e.valid.flags:e.valid.flags=r.target.value;const a=y(f,n=>{n[s]=e});v(a),$({event:`Regex Pattern Flag updated: ${e.lbl||h||s}`,type:"set_flags",state:{fields:a,fldKey:s}})};return t.jsx(U,{id:"ptrn-stng",title:b("RegEx Pattern"),className:l(_.fieldSection),isPro:!0,tip:R.pattern,proProperty:"regexPattern",children:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:l(m.mr2,m.mt3,m.pl1),children:[t.jsxs("div",{className:l(m.flxcb,m.ml1),children:[t.jsxs("h4",{className:l(m.m0,_.title),children:[b("Expression"),":"]}),t.jsxs(G,{instance:x,children:[t.jsx("button",{"data-testid":"ptrn-stng-exprsn-btn","data-close":!0,type:"button",className:l(A.dotBtn),unselectable:"on",draggable:"false",style:{cursor:"pointer"},title:b("Fields"),children:t.jsx(K,{size:19})}),t.jsx("div",{children:t.jsx("ul",{role:"menu",children:g==null?void 0:g.map((r,a)=>t.jsxs("li",{"data-testid":`ptrn-stng-expn-itm-${a}`,role:"menuitem",className:`${l(A.button)} btnHover`,onKeyDown:()=>w(r.val),onClick:()=>w(r.val),children:[t.jsx("span",{children:r.lbl}),t.jsx("br",{}),t.jsx("small",{children:P(r.val)})]},a))})})]})]}),t.jsx(Z,{id:"ptrn-stng-expn",ariaLabel:"Pattern for input field",placeholder:"e.g. ([A-Z])\\w+",list:"patterns",disabled:!c,value:P(j),changeAction:z})]}),t.jsx("div",{className:l({mr:5},m.pl1),children:t.jsx(V,{id:"ptrn-stng-flg",inpType:"text",title:b("Flags:"),value:S,action:B,placeholder:"e.g. g",cls:l(_.input),disabled:!c})}),j&&t.jsx(T,{id:"ptrn-stng-expn",type:"regexr",title:"Error Message",tipTitle:R.patternsErrMsg})]})})}const A={dotBtn:{b:0,brs:5,mr:15,curp:1},button:{dy:"block",w:"100%",ta:"left",b:0,bd:"none",p:3,curp:1,"&:hover":{bd:"var(--white-0-95)",cr:"var(--black-0)",brs:8},fs:11}};export{Fe as default};
2