1import{T as f}from"./tabulator.min-NWc-ChHA.js";import{A as w}from"./AuthenticatedLayout-BgPi6SK7.js";import{i as b,Z as v,r,f as g,a as n,w as d,b as t,e as y,F as x,T as k,o as M}from"./app-BFBm0Bhp.js";import{_ as C}from"./Modal-BCYUwSCy.js";import{_ as D}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-BDZZhcqx.js";import"./NavLink-XJ1F9B8R.js";import"./TextOutline-DJTNpM16.js";import"./DocumentTextOutline-CSPECrKp.js";import"./InformationCircleOutline-B09VKpeu.js";const _={components:{AuthenticatedLayout:w,Head:v,Link:b,Modal:C},props:{schoolFaculties:Array},data(){return{showDeleteModal:!1,facultyIdToDelete:null}},methods:{openDeleteModal(s){this.facultyIdToDelete=s,this.showDeleteModal=!0},closeDeleteModal(){this.showDeleteModal=!1,this.facultyIdToDelete=null},deleteFaculty(s){k({}).delete(route("admin.schoolfaculties.destroy",{schoolfaculty:s}),{onSuccess:()=>{this.closeDeleteModal(),location.reload()},preserveState:!1})}},mounted(){this.$nextTick(()=>{if(!document.querySelector("#tabulator-table")){console.error("Tabulator table element not found.");return}const e=this.schoolFaculties.map(o=>({id:o.id,name:o.faculty_name,school:o.school.school_name,school_code:o.school_code,active:o.active})),c=[{title:"ID",field:"id",width:50},{title:"Name",field:"name",headerFilter:"list",headerFilterParams:{valuesLookup:!0,clearable:!0}},{title:"School Name",field:"school",headerFilter:"input"},{title:"School ID",field:"school_code",width:50,headerFilter:"input"},{title:"Active",field:"active",sorter:"boolean",align:"center",formatter:"tickCross",width:100,headerFilter:"list",headerFilterParams:{valuesLookup:!0,clearable:!0}},{width:150,title:"Actions",field:"actions",formatter:()=>` 2 <div class="flex space-x-2"> 3 <button class="view-btn text-blue-500"><svg class="view-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" :class="styleClasses" viewBox="0 0 512 512"><path d="M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 00-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 000-17.47C428.89 172.28 347.8 112 255.66 112z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"/></svg></button> 4 <button class="edit-btn text-green-500"><svg class="edit-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path d="M459.94 53.25a16.06 16.06 0 00-23.22-.56L424.35 65a8 8 0 000 11.31l11.34 11.32a8 8 0 0011.34 0l12.06-12c6.1-6.09 6.67-16.01.85-22.38zM399.34 90L218.82 270.2a9 9 0 00-2.31 3.93L208.16 299a3.91 3.91 0 004.86 4.86l24.85-8.35a9 9 0 003.93-2.31L422 112.66a9 9 0 000-12.66l-9.95-10a9 9 0 00-12.71 0z"/></svg></button> 5 <button class="delete-btn text-red-500"><svg class="delete-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" :class="styleClasses" viewBox="0 0 512 512"><path d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352"/><path d="M192 112V72h0a23.93 23.93 0 0124-24h80a23.93 23.93 0 0124 24h0v40M256 176v224M184 176l8 224M328 176l-8 224" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg></button> 6 </div> 7 `,cellClick:(o,i)=>{const l=i.getRow().getData().id,a=o.target;a.classList.contains("view-btn")?window.location.href=route("admin.schoolfaculties.show",{schoolfaculty:l}):a.classList.contains("edit-btn")?window.location.href=route("admin.schoolfaculties.edit",{schoolfaculty:l}):a.classList.contains("delete-btn")&&this.openDeleteModal(l)}}];new f("#tabulator-table",{data:e,columns:c,layout:"fitColumns",responsiveLayout:"hide",pagination:"local",paginationSizeSelector:[30,50,100,500,1e3],paginationSize:30})})}},F={class:"flex"},L={class:"space-y-5"},S={class:"p-4 space-y-5"},T={class:"flex space-x-4"};function A(s,e,c,o,i,l){const a=r("Head"),h=r("Link"),p=r("Modal"),m=r("AuthenticatedLayout");return M(),g(x,null,[n(a,{title:"School Faculties"}),n(m,null,{header:d(()=>[t("div",F,[e[3]||(e[3]=t("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"},"School Faculties",-1)),e[4]||(e[4]=t("div",{class:"flex-grow"},null,-1)),n(h,{class:"btn btn-primary",href:s.route("admin.schoolfaculties.create")},{default:d(()=>[...e[2]||(e[2]=[y("Add Faculty",-1)])]),_:1},8,["href"])])]),default:d(()=>[e[8]||(e[8]=t("div",{class:"py-12 space-y-5"},[t("div",{class:"bg-white overflow-hidden shadow-sm sm:rounded-lg p-4 space-y-4"},[t("div",{id:"tabulator-table"})])],-1)),n(p,{show:i.showDeleteModal,onClose:l.closeDeleteModal},{default:d(()=>[t("div",L,[e[7]||(e[7]=t("div",{class:"w-full bg-gray-200 py-2 px-4"},[t("p",{class:"text-gray-700 font-bold"},"Delete confirmation")],-1)),t("div",S,[e[6]||(e[6]=t("h1",{class:"text-gray-700"},"Are you sure you want to delete this faculty?",-1)),t("div",T,[e[5]||
7(e[5]=t("div",{class:"flex-grow"},null,-1)),t("div",{class:"border border-gray-900 font-semibold text-white bg-gray-900 rounded-lg py-1 px-3 cursor-pointer",onClick:e[0]||(e[0]=(...u)=>l.closeDeleteModal&&l.closeDeleteModal(...u))},"Cancel"),t("div",{class:"border border-red-600 font-semibold text-white bg-red-600 rounded-lg py-1 px-3 cursor-pointer",onClick:e[1]||(e[1]=u=>l.deleteFaculty(i.facultyIdToDelete))},"Delete")])])])]),_:1},8,["show","onClose"])]),_:1})],64)}const R=D(_,[["render",A]]);export{R 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.