| 1 |
import{i as M,g as T,u as B,ay as $,at as N,r as S,a as L,H as w,j as o,_ as a,M as R,eo as y,f as I,aY as d,bI as b,eq as z,dh as E,er as q,b1 as K}from"./main-96.js";import{F as n}from"./bf-460-326.js";import{A as V}from"./bf-721-323.js";import{I as Y}from"./bf-178-325.js";import{F}from"./bf-285-324.js";import{S as k}from"./bf-283-176.js";import"./bf-542-181.js";import"./bf-781-46.js";import"./bf-678-179.js";import"./bf-245-208.js";import"./bf-870-206.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";function de(){const[c,p]=M(K),{fieldKey:t}=T(),f=B($),j=B(N),[C,m]=S.useState(!1),[v,H]=S.useState(""),{css:i}=L(),e=w(c[t]),u=(e==null?void 0:e.clrBtn)||"",h=e.adminLbl||"",_=({target:{checked:s}})=>{s?(e.clrBtn=a("Clear"),e.clrBtnHide=!1,y(f,"clrBtn")):(delete e.clrBtn,delete e.clrPreIcn,delete e.clrSufIcn,e.clrBtnHide=!0);const r=s?"on":"off",l=I(c,A=>{A[t]=e});p(l),d(t),b({event:`Clear Button ${r}: ${u||h||t}`,type:`clr_btn_${r}`,state:{fields:l,fldKey:t}})},P=({target:{value:s}})=>{s===""?(delete e.clrBtn,d(t)):e.clrBtn=s;const r=I(c,l=>{l[t]=e});p(r),d(t),b({event:`Clear btn text updated: ${h||u||t}`,type:"change_clr_btn_txt",state:{fields:r,fldKey:t}})},g=s=>{z(j,t,E[s])||y(f,s),q(s,t),H(s),m(!0)},x=s=>{if(e[s]){delete e[s];const r=I(c,l=>{l[t]=e});p(r),d(t)}};return o.jsxs("div",{children:[o.jsxs(k,{id:"clr-button-stng",title:a("Clear Button"),className:i(n.fieldSection,n.hover_tip),switching:!0,tip:a("You can add or remove the Clear button from the Signature field with this toggle."),tipProps:{width:250,icnSize:17},toggleAction:_,toggleChecked:!(e!=null&&e.clrBtnHide),open:!(e!=null&&e.clrBtnHide),disable:e==null?void 0:e.clrBtnHide,children:[o.jsx("div",{className:i(n.placeholder),children:o.jsx(V,{id:"clr-btn-stng",ariaLabel:"Clear Button for this Field",placeholder:"Type clear button txt here...",value:u,changeAction:P})}),o.jsxs("div",{className:i(n.iconLayoutHorizontal),children:[o.jsx(F,{label:"Leading Icon",iconSrc:e==null?void 0:e.clrPreIcn,styleRoute:"clr-btn-pre-i",setIcon:()=>g("clrPreIcn"),removeIcon:()=>x("clrPreIcn"),proProperty:"leadingIcon",position:"prefix"}),o.jsx("span",{className:i(n.iconSeparator),children:"|"}),o.jsx(F,{label:"Trailing Icon",iconSrc:e==null?void 0:e.clrSufIcn,styleRoute:"clr-btn-suf-i",setIcon:()=>g("clrSufIcn"),removeIcon:()=>x("clrSufIcn"),proProperty:"trailingIcon",position:"suffix"})]})]}),o.jsxs(R,{md:!0,autoHeight:!0,show:C,setModal:m,className:"o-v",title:a("Icons"),children:[o.jsx("div",{className:"pos-rel"}),o.jsx(Y,{iconType:v,setModal:m})]})]})}export{de as default}; |