1import{bg as i,b3 as S,Q as B,a0 as t,b_ as a,I as s,Z as n,bs as c,aL as w,aR as U,bz as F,y as k}from"./PW_UF68a.js";import{C as j}from"./B8iEwo1M.js";import{a as H,g as I,m as L,j as u}from"./-W1VOijv.js";import"./Bz2dEcw7.js";import"./CIhhRri8.js";import"./Bs5_TFWz.js";import"./B_aewNsK.js";import"./fgnZjpTr.js";import"./CH7vd0UB.js";import"./206wqFYJ.js";const M={name:"MolPartidePolitice",components:{ColorPicker:j},data(){return{partyHeaders:[{title:"Nume Partid",key:"name",align:"start"},{title:"Culoare",key:"color",align:"start"},{title:"AcÈiuni",key:"action",sortable:!1,align:"end"}],partyDialog:!1,editingParty:null,partyForm:{name:"",abbreviation:"",color:"#1976D2FF"},rules:{required:r=>r&&!!r||r===0||"Câmp Obligatoriu"}}},head(){return{title:"Partide Politice"}},computed:{...u("parties",["parties","party"]),...u("loader",["loading"]),...u("errors",["errors"]),...u("query",["queryParams"])},async mounted(){await this.createResource("parties"),await this.getData("parties")},methods:{...L("resources",["getData","createResource","deleteResource","updateResource","editResource","storeResource"]),...I("errors",["clearError"]),openPartyDialog(r=null){r?(this.editingParty=r,this.partyForm={name:r.name,abbreviation:r.abbreviation,color:r.color}):(this.editingParty=null,this.partyForm={name:"",abbreviation:"",color:"#1976D2FF"}),this.partyDialog=!0},closePartyDialog(){this.partyDialog=!1,this.editingParty=null,this.partyForm={name:"",abbreviation:"",color:"#1976D2FF"}},async saveParty(){const{valid:r}=await this.$refs.partyForm.validate();if(!r)return;await this.clearError();const e={name:this.partyForm.name,abbreviation:this.partyForm.abbreviation,color:this.partyForm.color};this.editingParty&&this.editingParty.id?await this.updateResource({scope:"parties",data:{...e,id:this.editingParty.id},id:this.editingParty.id,navigate:!1}):await this.storeResource({scope:"parties",data:e,navigate:!1}),Object.values(this.errors).some(d=>d&&(Array.isArray(d)?d.length>0:d!==""))||(this.closePartyDialog(),await this.getData("parties"))}}},O={class:"d-flex flex-column flex-grow-1",style:{"min-height":"100%"}},Q={class:"d-flex align-center"},T={class:"font-weight-medium mr-3"},Z={class:"d-flex align-center"},G={class:"d-flex flex-nowrap justify-end"},J={class:"font-weight-bold"},K={class:"font-weight-bold"};function W(r,e,D,d,l,p){const g=i("v-divider"),f=i("v-spacer"),m=i("v-btn"),_=i("v-card-title"),C=i("v-card-subtitle"),V=i("v-chip"),b=i("v-icon"),y=i("v-tooltip"),z=i("v-data-table"),x=i("v-card-text"),h=i("v-card"),P=i("v-text-field"),E=i("color-picker"),R=i("v-form"),q=i("v-card-actions"),A=i("v-dialog");return S(),B("div",O,[t(h,{class:"mt-4 mb-4",elevation:"5"},{default:a(()=>[t(_,{class:"d-flex align-center"},{default:a(()=>[e[8]||(e[8]=s("div",{class:"text-h5 text-md-h4"},"Partide politice",-1)),t(g,{vertical:"",class:"mx-2 d-none d-md-inline"}),t(f),t(m,{size:"large",color:"primary",class:"mt-2 mt-md-0 create-button",onClick:e[0]||(e[0]=o=>p.openPartyDialog())},{default:a(()=>[...e[7]||(e[7]=[n(" AdaugÄ Partid ",-1)])]),_:1})]),_:1}),t(C,{class:"ml-1 text-subtitle-1 font-weight-bold"},{default:a(()=>[...e[9]||(e[9]=[n(" Lista de partide politice ",-1)])]),_:1}),t(x,null,{default:a(()=>[t(z,{headers:l.partyHeaders,items:r.parties,class:"flex-grow-1 v2-style-table","items-per-page":10,"items-per-page-options":[{value:10,title:"10"},{value:15,title:"15"},{value:30,title:"30"},{value:60,title:"60"}]},{"item.name":a(({item:o})=>[s("div",Q,[s("span",T,c(o.name),1),t(V,{class:"local-council-chip",size:"small",color:o.color,theme:"dark"},{default:a(()=>[n(c(o.abbreviation),1)]),_:2},1032,["color"])])]),"item.color":a(({item:o})=>[s("div",Z,[s("div",{style:U({backgroundColor:o.color,width:"30px",height:"30px",borderRadius:"4px",border:"1px solid rgba(0,0,0,0.1)"})},null,4)])]),"item.action":a(({item:o})=>[s("div",G,[t(y,{location:"bottom"},{activator:a(({props:v})=>[t(m,w({icon:"",size:"medium",variant:"text",density:"compact",class:"mx-1"},v,{onClick:N=>p.openPartyDialog(o)}),{default:a(()=>[t(b,{size:"large"},{default:a(()=>[...e[10]||(e[10]=[n("mdi-square-edit-outline",-1)])]),_:1})]),_:1},16,["onClick"])]),default:a(()=>[s("span",null,[e[11]||(e[11]=n("EditeazÄ ",-1)),s("i",J,c(o.name),1)])]),_:2},1024),t(y,{location:"bottom"},{activator:a(({props:v})=>[t(m,w({icon:"",size:"medium",variant:"text",density:"compact",class:"mx-1"},v,{onClick:N=>r.deleteResource({scope:"parties",data:o})}),{default:a(()=>[t(b,{size:"large"},{default:a(()=>[...e[12]||(e[12]=[n("mdi-delete",-1)])]),_:1})]),_:1},16,["onClick"])]),default:a(()=>[s("span",null,[e[13]||(e[13]=n("Èterge ",-1)),s("i",K,c(o.name),1)])]),_:2},1024)])]),_:1},8,["headers","items"])]),_:1})]),_:1}),t(A,{modelValue:l.partyDialog,"onUpdate:modelValue":e[6]||(e[6]=o=>l.partyDialog=o),"max-width":"600px",persistent:""},{default:a(()=>[t(h,null,{default:a(()=>[t(_,{class:"bg-primary text-white dialog-title"},{default:a(()=>[n(c(l.editingParty?"EditeazÄ Partid":"AdaugÄ Partid"),1)]),_:1}),t(x,{class:"mt-5"},{default:a(()=>[t(R,{ref:"partyForm"},{default:a(()=>[t(P,{modelValue:l.partyForm.name,"onUpdate:modelValue":[e[1]||(e[1]=o=>l.partyForm.name=o),e[2]||(e[2]=o=>("clearError"in r?r.clearError:F(k))("name"))],label:"Nume Partid",variant:"outlined",density:"comfortable",class:"mb-4",required:"",rules:[l.rules.required],"error-messages":r.errors.name},null,8,["modelValue","rules","error-messages"]),t(P,{modelValue:l.partyForm.abbreviation,"onUpdate:modelValue":[e[3]||(e[3]=o=>l.partyForm.abbreviation=o),e[4]||(e[4]=o=>("clearError"in r?r.clearError:F(k))("abbreviation"))],label:"Abreviere",variant:"outlined",density:"comfortable",class:"mb-4",required:"",rules:[l.rules.required],"error-messages":r.errors.abbreviation},null,8,["modelValue","rules","error-messages"]),t(E,{modelValue:l.partyForm.color,"onUpdate:modelValue":e[5]||(e[5]=o=>l.partyForm.color=o),hint:"SelecteazÄ culoarea pentru partid"},null,8,["modelValue"])]),_:1},512)]),_:1}),t(g),t(q,null,{default:a(()=>[t(m,{color:"error","max-width":"200px","min-width":"100px",variant:"text",onClick:p.closePartyDialog},{default:a(()=>[...e[14]||(e[14]=[n(" AnuleazÄ ",-1)])]),_:1},8,["onClick"]),t(f),t(m,{color:"success","max-width":"200px","min-width":"100px",variant:"text",onClick:p.saveParty},{default:a(()=>[...e[15]||(e[15]=[n(" SalveazÄ ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])])}const se=H(M,[["render",W],["__scopeId","data-v-320208d1"]]);export{se 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.