| 1 |
import{g as h,a as x,i as f,H as j,j as e,_ as r,f as C,bI as b,b1 as y}from"./main-96.js";import{F as o}from"./bf-460-326.js";import{S as N}from"./bf-283-176.js";import"./bf-781-46.js";import"./bf-687-180.js";import"./bf-551-68.js";import"./bf-200-43.js";import"./bf-431-60.js";/* empty css */import"./bf-63-62.js";import"./bf-762-63.js";import"./bf-163-182.js";const t={penColor:r("Pen Color"),backgroundColor:r("Background Color"),maxWidth:r("Pen Width"),imgTyp:r("Image Type")};function B(){const{fieldKey:a}=h(),{css:i}=x(),[d,c]=f(y),n=j(d[a]);function s(u){const{value:p,name:l}=u.target;n.config[l]=l==="maxWidth"?v(p):p,c(C(d,g=>{g[a]=n})),b({event:`${t[l]} changed to ${p}: ${n.txt}`,type:`signature_pad_${l}`,state:{fields:d,fldKey:a}})}return e.jsx(N,{id:"signature-pad",title:r("Signature Pad"),className:i(o.fieldSection),open:!0,children:e.jsxs("div",{className:i(o.placeholder),children:[e.jsxs("div",{className:i(m.inpWrp),children:[e.jsx("label",{htmlFor:"maxWidth",children:t.maxWidth}),e.jsx("input",{className:i(o.input,{w:"30%"}),type:"number",name:"maxWidth",id:"maxWidth",min:"1",max:"10",value:n.config.maxWidth,step:"0.1",onChange:s})]}),e.jsxs("div",{className:i(m.inpWrp),children:[e.jsx("label",{htmlFor:"penColor",children:t.penColor}),e.jsx("input",{className:i(o.input,{w:"30%"}),type:"color",name:"penColor",id:"penColor",value:n.config.penColor,onChange:s})]}),e.jsxs("div",{className:i(m.inpWrp),children:[e.jsx("label",{htmlFor:"backgroundColor",children:t.backgroundColor}),e.jsx("input",{className:i(o.input,{w:"30%"}),type:"color",name:"backgroundColor",id:"backgroundColor",value:n.config.backgroundColor,onChange:s})]}),e.jsxs("div",{className:i(m.inpWrp),children:[e.jsx("label",{htmlFor:"imgTyp",children:t.imgTyp}),e.jsxs("select",{className:i(o.input,{w:"30%"}),name:"imgTyp",id:"imgTyp",value:n.config.imgTyp,onChange:s,children:[e.jsx("option",{value:"image/png",children:"PNG"}),e.jsx("option",{value:"image/jpeg",children:"JPEG"}),e.jsx("option",{value:"image/svg+xml",children:"SVG"})]})]})]})})}const v=a=>{if(a==="")return"";const i=Number(a);return Number.isNaN(i)?"":Math.min(10,Math.max(1,i))},m={inpWrp:{flx:"center-between",mx:5}};export{B as default}; |