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