PageSourceSearch

https://www.eria.org/build/assets/PopupForm-CSWELucQ.js

js eria.org collected 2026-10-02 02:40:13 UTC 6,488 bytes, 3 lines download raw bytes

1import{r as c,j as e}from"./app-MLckdXAM.js";import{R as w}from"./RichEditor-krxvsD__.js";import H from"./PopupPeopleSogForm-DbKMhkIr.js";import"./Editor-vuAIUwKa.js";import"./index-M3x63IQR.js";import"./Combination-DH1XDAXM.js";import"./InputBase-C1ZTdEwS.js";import"./floating-ui.react-dom-4At_APn7.js";import"./clsx-B-dksMZM.js";function J({isOpen:i,mode:m="add",item:s=null,onClose:x,onSubmit:P,onSubmitPeople:S}){const[a,o]=c.useState({title:"",short_desc:"",content:"",image_name:"",image_file:null,image_preview:"",order_id:0,is_active:!0}),[d,C]=c.useState([]),[A,p]=c.useState(!1),[u,b]=c.useState("add"),[k,j]=c.useState(null),O=Number(s==null?void 0:s.id)=="1",N=m==="edit"&&Number(s==null?void 0:s.id)=="1",R=`Fellowship Application Guidelines (Now Open for 2026 Applications)
2
3[Call for Applicants](https://www.eria.org/research/call-for-applicants--eria-school-of-government-fellowship-batch-2)`,g=d.length>0?d:Array.isArray(s==null?void 0:s.list_items)?s.list_items:[];if(c.useEffect(()=>{i&&(o({title:(s==null?void 0:s.title)||"",short_desc:(s==null?void 0:s.short_desc)??(N?R:""),content:(s==null?void 0:s.content)||"",image_name:(s==null?void 0:s.image_name)||"",image_file:null,image_preview:(s==null?void 0:s.image_url)||"",order_id:(s==null?void 0:s.order_id)??0,is_active:s?s.is_active!="0":!0}),C(Array.isArray(s==null?void 0:s.list_items)?s.list_items:[]))},[i,s]),!i)return null;const n=l=>{const{name:t,value:D,type:_,checked:G,files:h}=l.target;if(_==="file"){const r=(h==null?void 0:h[0])||null;o(y=>({...y,image_file:r,image_preview:r?URL.createObjectURL(r):y.image_preview}));return}o(r=>({...r,[t]:_==="checkbox"?G:D}))},f=l=>{o(t=>({...t,content:l}))},E=l=>{l.preventDefault(),P({...a,id:(s==null?void 0:s.id)||null,order_id:Number(a.order_id)||0,list_items:d})},v=(l="add",t=null)=>{b(l),j(t),p(!0)},F=()=>{p(!1),j(null),b("add")},L=l=>{S(l,s,u)};return e.jsxs("div",{className:"modal fade show d-block",tabIndex:"-1",role:"dialog",style:{backgroundColor:"rgba(0,0,0,0.5)"},children:[e.jsx("div",{className:"modal-dialog modal-xl",role:"document",style:{maxHeight:"90vh"},children:e.jsxs("div",{className:"modal-content",style:{maxHeight:"90vh",overflow:"auto"},children:[e.jsxs("div",{className:"modal-header",children:[e.jsx("h5",{className:"modal-title",children:m==="edit"?"Edit SOG":"Add SOG"}),e.jsx("button",{type:"button",className:"close",onClick:x,children:e.jsx("span",{"aria-hidden":"true",children:"×"})})]}),e.jsxs("form",{onSubmit:E,children:[e.jsxs("div",{className:"modal-body",style:{overflowY:"auto",maxHeight:"calc(90vh - 130px)"},children:[e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"Title"}),e.jsx("input",{type:"text",name:"title",className:"form-control",value:a.title,onChange:n,required:!0})]}),e.jsxs("div",{className:"form-group mt-3",children:[e.jsx("label",{className:"form-label",children:"Content"}),e.jsx(w,{name:"content",value:a.content,onChange:f})]}),e.jsxs("div",{className:"form-group mt-3 hidden",children:[e.jsx("label",{className:"form-label",children:"Image"}),e.jsx("div",{className:"controls",children:e.jsx("input",{className:"form-control",id:"sog_image",name:"image_file",type:"file",accept:"image/*",onChange:n})}),e.jsx("span",{className:"text-danger text-sm",style:{fontStyle:"italic"},children:"(Please use dimensions 600 x 270 px*)"}),(a.image_preview||a.image_name)&&e.jsx("div",{className:"mt-3",children:e.jsx("img",{src:a.image_preview||a.image_name,alt:"Preview",style:{maxWidth:220,borderRadius:8,border:"1px solid #ccc"}})})]}),e.jsxs("div",{className:"form-group mt-3",children:[e.jsx("label",{className:"form-label",children:"Order"}),e.jsx("input",{type:"number",name:"order_id",className:"form-control",value:a.order_id,onChange:n})]}),e.jsxs("div",{className:"form-group mt-3",children:[e.jsx("label",{className:"form-label",children:"Status"}),e.jsxs("div",{className:"custom-control custom-checkbox",children:[e.jsx("input",{type:"checkbox",className:"custom-control-input",id:"sog_is_active",name:"is_active",checked:a.is_active,onChange:n}),e.jsx("label",{className:"custom-control-label",htmlFor:"sog_is_active",children:"Active"})]})]}),N&&e.jsxs("div",{className:"form-group mt-3",children:[e.jsx("label",{className:"form-label",children:"Short Description"}),e.jsx(w,{name:"short_desc",className:"form-control",rows:4,value:a.short_desc,onChange:f})]})]}),e.jsxs("div",{className:"modal-footer",children:[e.jsx("button",{type:"button",className:"btn btn-secondary",onClick:x,children:"Cancel"}),e.jsx("button",{type:"submit",className:"btn btn-primary",children:"Save"})]}),O&&e.jsx("div",{className:"px-3 pb-3",children:e.jsx("div",{className:"card border-light",children:e.jsxs("div",{className:"card-body",children:[e.jsxs("div",{className:"d-flex justify-content-between align-items-center mb-2",children:[e.jsx("label",{className:"form-label mb-0",children:"People List"}),e.jsxs("button",{type:"button",className:"btn btn-sm btn-primary",onClick:()=>v("add"),children:[e.jsx("i",{className:"fa fa-plus mr-1"})," Add"]})]}),g.length>0?e.jsx("div",{className:"table-responsive",children:e.jsxs("table",{className:"table table-bordered table-sm mb-0",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-center",style:{width:"5%"},children:"No"}),e.jsx("th",{style:{width:"25%"},children:"Name"}),e.jsx("th",{style:{width:"22%"},children:"Position"}),e.jsx("th",{className:"text-center",style:{width:"8%"},children:"Order"}),e.jsx("th",{className:"text-center",style:{width:"8%"},children:"Status"}),e.jsx("th",{className:"text-center",style:{width:"8%"},children:"Action"})]})}),e.jsx("tbody",{children:g.map((l,t)=>e.jsxs("tr",{children:[e.jsx("td",{className:"text-center",children:t+1}),e.jsx("td",{children:l.name||"-"}),e.jsx("td",{children:l.position||"-"}),e.jsx("td",{className:"text-center",children:l.order_id??"-"}),e.jsx("td",{className:"text-center",children:e.jsx("span",{className:`badge ${l.is_active=="0"?"badge-danger":"badge-success"}`,children:l.is_active?"Active":"Inactive"})}),e.jsx("td",{className:"text-center",children:e.jsx("button",{type:"button",className:"btn btn-sm btn-info",onClick:()=>v("edit",l),title:"Edit",children:e.jsx("i",{className:"fa fa-edit"})})})]},l.id||t))})]})}):e.jsx("div",{className:"alert alert-light mb-0",children:"No people data available."})]})})})]})]})}),e.jsx(H,{isOpen:A,mode:u,item:k,onClose:F,onSubmit:L})]})}export{J as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.