mirror of
https://github.com/beak-insights/felicity-lims.git
synced 2025-02-23 16:33:11 +08:00
1 line
3 KiB
JavaScript
1 line
3 KiB
JavaScript
import{d as g,r as x,x as w,o as s,c as l,b as t,t as i,I as u,F as c,E as f,D as d,h as k,k as K}from"./index-e62f5c21.js";const q={class:"min-h-[450px] flex flex-col"},S={class:"text-xl text-gray-700 font-semibold p-4 border-b"},I={class:"flex flex-1 overflow-hidden"},B={class:"divide-y"},C=k('<div class="flex items-start space-x-4"><div class="w-8 h-8 bg-gray-200 rounded-full"></div><div class="flex-1"><div class="h-4 bg-gray-200 rounded w-3/4 mb-2"></div><div class="h-3 bg-gray-200 rounded w-1/2"></div></div></div>',1),F=[C],H=["onClick"],N={class:"flex items-start space-x-4"},z={key:0,class:"inline-flex items-center justify-center w-8 h-8 text-xs font-bold text-white bg-gray-600 rounded-full"},D={class:"flex-1 min-w-0"},j={class:"flex justify-between"},E={class:"text-sm font-medium text-gray-900 truncate"},L={key:0,class:"text-xs font-medium text-orange-600"},V={class:"mt-1 text-sm text-gray-500 truncate"},A={class:"flex-1 overflow-y-auto bg-white"},M={key:0,class:"p-6"},P={class:"mb-4 border-b pb-4"},T={class:"text-2xl font-bold text-gray-900 mb-2"},W={key:0,class:"text-sm font-medium text-orange-600"},$=["innerHTML"],G={key:1,class:"h-full flex items-center justify-center text-gray-500"},J=g({__name:"FelInbox",props:{items:{type:Array,required:!0,default:()=>[]},title:{type:String,required:!1,default:"Inbox"},titleKey:{type:String,required:!1,default:"title"},bodyKey:{type:String,required:!1,default:"body"},statusKey:{type:String,required:!1,default:"status"},showNumbers:{type:Boolean,required:!1,default:!0},leftPanelWidth:{type:String,required:!1,default:"w-1/5"},sanitizeHtml:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1}},emits:["select"],setup(y,{emit:m}){const h=y,p=m,o=x(null),v=e=>{o.value=e,p("select",e)},_=(e,n=100)=>(h.sanitizeHtml&&(e=e.replace(/<[^>]*>/g,"")),e.length>n?`${e.substring(0,n)}...`:e),b=w(()=>Array(3).fill(null));return(e,n)=>(s(),l("div",q,[t("h1",S,i(e.title),1),t("div",I,[t("div",{class:u([e.leftPanelWidth,"border-r overflow-y-auto"])},[t("div",B,[e.loading?(s(!0),l(c,{key:0},f(b.value,(a,r)=>(s(),l("div",{key:r,class:"p-4 animate-pulse"},[...F]))),128)):(s(!0),l(c,{key:1},f(e.items,(a,r)=>(s(),l("div",{key:a.uid,onClick:O=>v(a),class:u(["p-4 cursor-pointer hover:bg-gray-50 transition-colors duration-150",o.value?.uid===a.uid?"bg-blue-50":""])},[t("div",N,[e.showNumbers?(s(),l("span",z,i(r+1),1)):d("",!0),t("div",D,[t("div",j,[t("h2",E,i(a[e.titleKey]),1),a[e.statusKey]?(s(),l("span",L,i(a[e.statusKey]),1)):d("",!0)]),t("p",V,i(_(a[e.bodyKey])),1)])])],10,H))),128))])],2),t("div",A,[o.value?(s(),l("article",M,[t("div",P,[t("h2",T,i(o.value[e.titleKey]),1),o.value[e.statusKey]?(s(),l("span",W,i(o.value[e.statusKey]),1)):d("",!0)]),t("div",{class:"prose max-w-none",innerHTML:(e.sanitizeHtml,o.value[e.bodyKey])},null,8,$)])):(s(),l("div",G," Select an item to view its contents "))])])]))}}),R=K(J,[["__file","/home/aurthurm/Documents/Development/felicity/felicity-lims/webapp/components/ui/inbox/FelInbox.vue"]]);export{R as default};
|