| 1 |
import{a as M,g as v,i as C,aH as F,r as E,z as y,j as e,_ as n,U as L,bs as N,M as S,e9 as _,f,bG as k,ba as H}from"./main-294.js";import{F as h}from"./bf-821-385.js";import{E as I}from"./bf-409-457.js";import{O as K}from"./bf-977-460.js";import"./bf-176-80.js";import"./bf-934-246.js";import"./bf-186-103.js";import"./bf-85-248.js";import"./bf-487-72.js";import"./bf-867-113.js";import"./bf-22-244.js";function V({showUpload:g}){const{css:a}=M(),{fieldKey:s}=v(),[p,c]=C(F),[m,d]=E.useState(!1);if(!s)return null;const o=y(p[s]),u=y(p[s].opt),x=o.adminLbl||"",O=()=>{d(!0)},j=()=>{d(!1)},q=i=>{const l=i.filter(t=>t.req);l.length&&_({target:{checked:!0}});const r=f(p,t=>{t[s].opt=i,l.length&&t[s].err.req?(t[s].err.req.custom=!0,t[s].err.req.msg=`<p style="margin:0">${l.map(T=>T.lbl).join(",")} is required</p>`):t[s].err.req&&(t[s].err.req.msg=`<p style="margin:0">${n("This field is required")}</p>`)});c(r),k({event:`Options List Moddified: ${o.lbl||x||s}`,type:"option_list_modify",state:{fields:r,fldKey:s}}),H(s)},b=i=>{c(l=>f(l,r=>{r[s].customType=i}))};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:a(h.fieldSection),children:[e.jsx("div",{className:a(h.fieldSectionTitle),children:n("Options")}),e.jsx(K,{options:u,onClick:()=>d(!0)}),e.jsxs(L,{dataTestId:"edt-opt-stng",variant:"primary-outline",size:"sm",className:a({mt:10}),onClick:O,children:[n("Add/Edit Options"),e.jsx("span",{className:a($.plsIcn),children:e.jsx(N,{size:"13",stroke:"3"})})]})]}),e.jsx(S,{autoHeight:!0,show:m,setModal:j,className:"o-v",title:n("Options"),width:"755px",children:e.jsx(I,{optionMdl:m,options:u,setOptions:i=>q(i),lblKey:"lbl",valKey:"val",type:o.typ,isRating:o.typ,showUpload:g,customType:o.customType,setCustomType:b})})]})}const $={plsIcn:{ml:3,mt:3,tm:"rotate(45deg)"}};export{V as default}; |