"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[59681],{24659:(e,a,l)=>{l.d(a,{A:()=>u});l(65043);var n=l(67784),s=l(4701),t=l(17392),i=l(10155),r=l(70579);const d=(0,s.A)({}),m=e=>{let{onClick:a}=e;return(0,r.jsx)(t.A,{onClick:a,children:(0,r.jsx)(i.A,{})})},u=e=>{const a=d();return(0,r.jsx)(n.A,{InputProps:{...a,endAdornment:(0,r.jsxs)(r.Fragment,{children:[" ",e.iscross&&(0,r.jsx)(m,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},59681:(e,a,l)=>{l.r(a),l.d(a,{default:()=>k});var n=l(65043),s=l(68903),t=l(11906),i=l(38624),r=l(96446),d=l(63516),m=l(24659),u=l(73216),o=l(66675),c=l(14556),v=(l(96801),l(73033)),h=l(11852),x=l(70579);const p={PanelName:"",Remarks:"",status:""},A=v.Ik().shape({PanelName:v.Yj("Enter Panel Name ").required("Panel Name is required"),Remarks:v.Yj("Enter Remarks ").required("Remarks is required"),status:v.Ik().nullable().required("Select Status")});const k=function(e){const a=(0,c.wA)(),l=n.useRef(null),[v,k]=(0,n.useState)(p),j=(0,u.Zp)(),f=(0,u.zy)().state._original;return(0,n.useEffect)((()=>{f&&k({...v,PanelName:null===f||void 0===f?void 0:f.panel_name,Remarks:null===f||void 0===f?void 0:f.panel_remark,status:{id:null===f||void 0===f?void 0:f.status,name:null===f||void 0===f?void 0:f.status}})}),[f]),console.log(f,"ApftaskData"),(0,x.jsxs)("div",{className:"component-list",children:[(0,x.jsx)(s.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,x.jsxs)(s.Ay,{item:!0,className:"common-header-label",children:[(0,x.jsx)(t.A,{onClick:()=>{j(-1)},children:(0,x.jsx)(o.A,{})}),"Update APF Panel"]})}),(0,x.jsx)(d.l1,{enableReinitialize:!0,innerRef:l,initialValues:v,validationSchema:A,onSubmit:async(e,l)=>{var n,s;const t={apfPanelId:null===f||void 0===f?void 0:f.id,panelName:null!==e&&void 0!==e&&e.PanelName?null===e||void 0===e?void 0:e.PanelName:"",panelRemark:null!==e&&void 0!==e&&e.Remarks?e.Remarks:"",apfPanelStatus:null!==e&&void 0!==e&&null!==(n=e.status)&&void 0!==n&&n.id?null===e||void 0===e||null===(s=e.status)||void 0===s?void 0:s.id:""};l.setSubmitting(!0),await a((0,h.fXm)(t)),l.resetForm({}),j("/BD-Master/apf_panel")},children:e=>{let{errors:a,handleSubmit:l,handleChange:n,setFieldValue:u,handleBlur:o,isSubmitting:c,isValid:h,touched:p,values:A}=e;return(0,x.jsx)(d.lV,{onSubmit:l,children:(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(s.Ay,{container:!0,className:"component-form",children:(0,x.jsxs)(s.Ay,{container:!0,children:[(0,x.jsx)(s.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(m.A,{fullWidth:!0,name:"PanelName",onBlur:o,value:A.PanelName,onChange:(e,a)=>{u("PanelName",a),k({...v,PanelName:e.target.value})},id:"PanelName",size:"small",label:"Panel Name",variant:"outlined",error:a.PanelName&&Boolean(a.PanelName),helperText:a.PanelName&&a.PanelName})}),(0,x.jsx)(s.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(m.A,{fullWidth:!0,name:"Remarks",onBlur:o,value:A.Remarks,onChange:(e,a)=>{u("Remarks",a),k({...v,Remarks:e.target.value})},id:"Remarks",size:"small",label:"Remarks",variant:"outlined",error:a.Remarks&&Boolean(a.Remarks),helperText:a.Remarks&&a.Remarks})}),(0,x.jsx)(s.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,x.jsx)(i.A,{name:"status",value:A.status,fullWidth:!0,options:[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],onBlur:o,size:"small",getOptionLabel:e=>e.name||"",onChange:(e,a)=>{u("status",a),k({...v,status:a})},renderInput:e=>(0,x.jsx)(m.A,{...e,fullWidth:!0,label:"Status *",name:"status",variant:"outlined",helperText:a.status&&a.status,error:a.status&&Boolean(a.status)})})})]})}),(0,x.jsx)(s.Ay,{className:"d-flex justify-content-end",p:2,children:(0,x.jsx)(r.A,{children:(0,x.jsx)(t.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:c,children:"SAVE"})})})]})})}})]})}},10155:(e,a,l)=>{var n=l(24994);a.A=void 0;var s=n(l(40039)),t=l(70579);a.A=(0,s.default)((0,t.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear")},66675:(e,a,l)=>{var n=l(24994);a.A=void 0;var s=n(l(40039)),t=l(70579);a.A=(0,s.default)((0,t.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")}}]);
//# sourceMappingURL=59681.c470d134.chunk.js.map