"use strict";(self.webpackChunkkns_reports=self.webpackChunkkns_reports||[]).push([[7066],{24659:(e,t,i)=>{i.d(t,{A:()=>o});i(65043);var l=i(67784),a=i(4701),r=i(17392),s=i(10155),n=i(70579);const u=(0,a.A)({}),d=e=>{let{onClick:t}=e;return(0,n.jsx)(r.A,{onClick:t,children:(0,n.jsx)(s.A,{})})},o=e=>{const t=u();return(0,n.jsx)(l.A,{InputProps:{...t,endAdornment:(0,n.jsxs)(n.Fragment,{children:[" ",e.iscross&&(0,n.jsx)(d,{onClick:null!==e&&void 0!==e&&e.textclear?e.textclear:""})]})},...e})}},7066:(e,t,i)=>{i.r(t),i.d(t,{default:()=>D});var l=i(65043),a=i(68903),r=i(11906),s=i(53193),n=i(38624),u=i(96446),d=i(24659),o=i(63516),m=i(14556),h=i(73216),c=i(11852),y=i(66675),v=i(73033),A=(i(80445),i(70579));const p={AuthorityName:"",StatusValuesID:"",DisplayOrder:""},x=v.Ik().shape({AuthorityName:v.Yj("Enter Authority Name ").required("Authority Name is required"),DisplayOrder:v.ai("Enter Display Order ").positive("Order Should be Positive Number").required("Display Order is required"),StatusValuesID:v.Ik().nullable().required("Select Status")});function D(){const e=[{id:"Active",name:"Active"},{id:"InActive",name:"In Active"}],[t,i]=(0,l.useState)(p),v=(0,m.wA)(),D=(0,h.Zp)(),j=l.useRef(null),S=(0,h.zy)(),I=(null===S||void 0===S?void 0:S.state)._original;(0,l.useEffect)((()=>{I&&i({AuthorityName:null===I||void 0===I?void 0:I.authority_name,StatusValuesID:{id:null===I||void 0===I?void 0:I.status,name:null===I||void 0===I?void 0:I.status},DisplayOrder:null===I||void 0===I?void 0:I.display_order})}),[I]);console.log(I,"PlanningAuthorityInfoData");return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)("div",{className:"component-list",children:[(0,A.jsx)(a.Ay,{container:!0,className:"d-flex justify-content-between align-items-center",py:1,children:(0,A.jsxs)(a.Ay,{item:!0,className:"common-header-label",children:[(0,A.jsx)(r.A,{onClick:()=>{D(-1)},children:(0,A.jsx)(y.A,{})}),"Update Planning Authority"]})}),(0,A.jsx)(o.l1,{enableReinitialize:!0,innerRef:j,initialValues:t,validationSchema:x,onSubmit:async(e,t)=>{var i,l;const a={authorityID:null!==I&&void 0!==I&&I.id?null===I||void 0===I?void 0:I.id:"",authorityName:null!==e&&void 0!==e&&e.AuthorityName?null===e||void 0===e?void 0:e.AuthorityName:"",displayOrder:null!==e&&void 0!==e&&e.DisplayOrder?null===e||void 0===e?void 0:e.DisplayOrder:"",authorityStatus:null!==e&&void 0!==e&&null!==(i=e.StatusValuesID)&&void 0!==i&&i.id?null===e||void 0===e||null===(l=e.StatusValuesID)||void 0===l?void 0:l.id:""};t.setSubmitting(!0),await v((0,c.TQd)(a)),D("/BD-Master/PlanningAuthority")},children:t=>{let{errors:i,handleSubmit:m,handleChange:h,setFieldValue:c,handleBlur:y,isSubmitting:v,isValid:p,touched:x,values:D}=t;return(0,A.jsxs)(o.lV,{onSubmit:m,children:[(0,A.jsx)(a.Ay,{container:!0,className:"component-form",children:(0,A.jsxs)(a.Ay,{container:!0,children:[(0,A.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{id:"AuthorityName",name:"AuthorityName",fullWidth:!0,onBlur:y,onChange:h,value:D.AuthorityName,error:x.AuthorityName&&Boolean(i.AuthorityName),helperText:i.AuthorityName&&i.AuthorityName,size:"small",label:"Authority Name *",variant:"outlined"})}),(0,A.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(d.A,{id:"DisplayOrder",name:"DisplayOrder",type:"number",fullWidth:!0,onBlur:y,onChange:h,value:D.DisplayOrder,error:x.DisplayOrder&&Boolean(i.DisplayOrder),helperText:i.DisplayOrder&&i.DisplayOrder,size:"small",label:"Display Order *",variant:"outlined"})}),(0,A.jsx)(a.Ay,{item:!0,xs:12,sm:12,md:12,lg:12,p:1,children:(0,A.jsx)(s.A,{fullWidth:!0,variant:"standard",children:(0,A.jsx)(n.A,{disablePortal:!0,id:"StatusValuesID",options:e||[],name:"StatusValuesID",value:D.StatusValuesID,size:"small",getOptionLabel:e=>e.name||"",renderOption:(e,t)=>(0,l.createElement)("li",{...e,style:{textAlign:"left"},key:t.id},t.name),onChange:(e,t)=>{c("StatusValuesID",t)},renderInput:e=>(0,A.jsx)(d.A,{...e,fullWidth:!0,label:"Status*",name:"StatusValuesID",variant:"outlined",helperText:i.StatusValuesID&&i.StatusValuesID,error:i.StatusValuesID&&Boolean(i.StatusValuesID)})})})})]})}),(0,A.jsx)(a.Ay,{className:"d-flex justify-content-center",p:2,children:(0,A.jsx)(u.A,{children:(0,A.jsx)(r.A,{type:"submit",text:"SAVE",variant:"contained",size:"medium",disabled:v,children:"SAVE"})})})]})}})]})})}},10155:(e,t,i)=>{var l=i(24994);t.A=void 0;var a=l(i(40039)),r=i(70579);t.A=(0,a.default)((0,r.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,t,i)=>{var l=i(24994);t.A=void 0;var a=l(i(40039)),r=i(70579);t.A=(0,a.default)((0,r.jsx)("path",{d:"M3 18h13v-2H3zm0-5h10v-2H3zm0-7v2h13V6zm18 9.59L17.42 12 21 8.41 19.59 7l-5 5 5 5z"}),"MenuOpen")},80445:()=>{}}]);
//# sourceMappingURL=7066.ae0d62c5.chunk.js.map