@ghentcdh/ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +4 -4
  2. package/index.mjs +61 -61
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),se=require("vue-router"),b=(...t)=>`<svg
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ae=require("vue-router"),b=(...t)=>`<svg
2
2
  xmlns="http://www.w3.org/2000/svg"
3
3
  fill="none"
4
4
  viewBox="0 0 24 24"
@@ -10,6 +10,6 @@
10
10
  d="${n}"
11
11
  />`).join(`
12
12
  `)}
13
- </svg>`;var _=(t=>(t.Edit="Edit",t.Delete="Delete",t.BarsArrowDown="BarsArrowDown",t.BarsArrowUp="BarsArrowUp",t.Funnel="Funnel",t.Close="Close",t.Plus="Plus",t.PaperClip="PaperClip",t.Hamburger="Hamburger",t.ChevronDown="ChevronDown",t.ChevronUp="ChevronUp",t.Check="Check",t.View="View",t.Text="Text",t))(_||{});const O={Edit:b("m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"),Delete:b("m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"),BarsArrowDown:b("M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0-3.75-3.75M17.25 21 21 17.25"),BarsArrowUp:b("M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"),Funnel:b("M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"),Close:b("M6 18 18 6M6 6l12 12"),Plus:b("M12 9v6m3-3H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"),PaperClip:b("m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"),Hamburger:b("M4 6h16M4 12h16M4 18h16"),ChevronDown:b("M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z"),ChevronUp:b("M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z"),Check:b("m4.5 12.75 6 6 9-13.5"),View:b("M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"),Text:b("M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z")},ae=["innerHTML"],$=e.defineComponent({__name:"icon",props:{icon:{},size:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"w-full h-full":!o.size,"w-2 h-2":o.size==="xs","w-4 h-4":o.size==="sm"}]),innerHTML:e.unref(O)[o.icon]},null,10,ae))}}),ce={class:"dropdown dropdown-end"},ie={tabindex:"0",class:"menu dropdown-content bg-white z-1 mt-4 p-2 shadow-sm"},ue={class:"min-w-max flex-no-wrap text-black"},S=e.defineComponent({__name:"sub-menu",props:{label:{},items:{},action:{type:Function},disabled:{type:Boolean},btnClass:{},disableArrow:{type:Boolean}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",{tabindex:"0",role:"button",class:e.normalizeClass([o.btnClass,"btn btn-ghost text-right flex-nowrap flex"])},[e.createElementVNode("span",null,e.toDisplayString(o.label),1),o.disableArrow?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:e.unref(_).ChevronDown,size:"sm"},null,8,["icon"]))],2),e.createElementVNode("ul",ie,[e.createElementVNode("li",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createBlock(I,e.mergeProps({key:r.label},{ref_for:!0},r),null,16))),128))])])]))}}),L="btn btn-ghost text-left justify-between min-w-max font-normal",I=e.defineComponent({__name:"menu-item",props:{label:{},items:{},action:{},disabled:{type:Boolean,default:!1}},setup(t){const o=t,n=e.computed(()=>!o.disabled&&o.action&&"routerLink"in o.action),r=e.computed(()=>!o.disabled&&o.action),l=e.computed(()=>{var s;return(s=o.items)==null?void 0:s.length}),a=e.computed(()=>{const s=o.action;return s&&"routerLink"in s&&"params"in s?{name:s.routerLink,params:s.params}:""}),p=()=>{var s;(s=o.action)==null||s.call(o)};return(s,d)=>{const u=e.resolveComponent("RouterLink");return l.value?(e.openBlock(),e.createBlock(S,e.mergeProps({key:0},o,{"btn-class":L}),null,16)):n.value?(e.openBlock(),e.createBlock(u,{key:1,to:a.value,class:e.normalizeClass(L),onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:1},8,["to"])):r.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(L),onClick:p},e.toDisplayString(s.label),1)):(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass([L,{"btn-disabled":s.disabled}])},e.toDisplayString(s.label),3))}}}),de={class:"navbar bg-base-100 shadow-sm"},pe={class:"flex-1"},me={key:0,class:"breadcrumbs text-sm"},fe={class:"flex grow justify-end px-2"},ge={class:"flex items-stretch"},be=e.defineComponent({__name:"menu",props:{menu:{},breadcrumbs:{}},setup(t){return(o,n)=>{const r=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("nav",de,[e.createElementVNode("div",pe,[o.breadcrumbs?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.breadcrumbs,l=>(e.openBlock(),e.createElementBlock("li",{key:l.label},[l.routerLink?(e.openBlock(),e.createBlock(r,{key:0,to:{name:l.routerLink,params:l.params}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["to"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.label),1)],64))]))),128))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[e.createElementVNode("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menu,l=>(e.openBlock(),e.createBlock(I,e.mergeProps({key:l.label},{ref_for:!0},l),null,16))),128))])])])}}}),ke=e.defineComponent({__name:"dropdown",props:{items:{}},setup(t){const o=e.ref(!0);return(n,r)=>(e.openBlock(),e.createBlock(S,{items:n.items,label:"test",open:o.value,"btn-class":"","disable-arrow":!0},null,8,["items","open"]))}}),g=[];for(let t=0;t<256;++t)g.push((t+256).toString(16).slice(1));function he(t,o=0){return(g[t[o+0]]+g[t[o+1]]+g[t[o+2]]+g[t[o+3]]+"-"+g[t[o+4]]+g[t[o+5]]+"-"+g[t[o+6]]+g[t[o+7]]+"-"+g[t[o+8]]+g[t[o+9]]+"-"+g[t[o+10]]+g[t[o+11]]+g[t[o+12]]+g[t[o+13]]+g[t[o+14]]+g[t[o+15]]).toLowerCase()}let F;const ve=new Uint8Array(16);function ye(){if(!F){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");F=crypto.getRandomValues.bind(crypto)}return F(ve)}const Be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),H={randomUUID:Be};function x(t,o,n){var l;if(H.randomUUID&&!t)return H.randomUUID();t=t||{};const r=t.random??((l=t.rng)==null?void 0:l.call(t))??ye();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,he(r)}const Ce={class:"font-bold"},_e={class:"pt-4"},we={class:"modal-action"},K=e.defineComponent({__name:"modal",props:{modalTitle:{},buttonLabel:{},buttonSaveLabel:{},data:{},open:{type:Boolean,default:!1},disableClose:{type:Boolean,default:!1},width:{default:"sm"}},emits:["closeModal"],setup(t,{expose:o,emit:n}){const r={xs:"max-w-xs w-[50VW]",sm:"max-w-sm w-[50VW]",lg:"max-w-2xl w-[80VW]",xl:"max-w-[80VW] w-[80VW]"},l=t,a=`modal_${x()}`,p=n,s=()=>{const u=document.getElementById(a);u==null||u.showModal()},d=()=>{const u=document.getElementById(a);u==null||u.close(),p("closeModal")};return o({closeModal:d,openModal:s}),e.watch(()=>l.open,(u,c,k)=>{l.open?s():d()}),e.onMounted(()=>{l.open&&s()}),(u,c)=>(e.openBlock(),e.createElementBlock("dialog",{id:a,class:"modal"},[e.createElementVNode("div",{class:e.normalizeClass(["modal-box bg-white",r[u.width]])},[u.disableClose?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2",onClick:d}," ✕ ")),e.createElementVNode("h3",Ce,e.toDisplayString(u.modalTitle),1),e.createElementVNode("div",_e,[e.renderSlot(u.$slots,"content")]),e.createElementVNode("div",we,[e.renderSlot(u.$slots,"actions")])],2)]))}});var U=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(U||{}),R=(t=>(t.a="a",t.button="button",t))(R||{}),N=(t=>(t.blank="blank",t.primary="primary",t.secondary="secondary",t.error="error",t))(N||{});const Ve={blank:"btn-ghost",primary:"btn-primary",secondary:"btn-soft btn-primary",error:"btn-error text-white"},Ne={blank:"badge-ghost",primary:"badge-primary",secondary:"badge-soft badge-primary",error:"badge-error"},j={xs:"btn-xs",sm:"btn-sm",lg:"btn-sm",xl:"btn"},q={xs:"badge-xs text-xxs",sm:"badge-sm text-xs",lg:"badge-sm text-xs",xl:"badge text-xs"},E=e.defineComponent({__name:"btn",props:{href:{},disabled:{type:Boolean,default:!1},as:{default:R.button},icon:{},type:{default:U.button},outline:{type:Boolean,default:!1},color:{default:N.primary},size:{default:"sm"},square:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const n=t,r=o;return(l,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.as),e.mergeProps({class:["btn p-1 flex justify-center flex-nowrap",e.unref(Ve)[l.color],e.unref(j)[l.size],{"btn-outline":l.outline,"btn-square":l.square}]},n,{onClick:a[0]||(a[0]=p=>r("click"))}),{default:e.withCtx(()=>[l.icon?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:l.icon,size:l.size},null,8,["icon","size"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),Ee=["type","disabled"],$e=e.defineComponent({__name:"btn-badge",props:{icon:{default:void 0},type:{default:U.button},color:{default:void 0},disabled:{type:Boolean,default:!1},size:{default:"sm"}},emits:["click"],setup(t,{emit:o}){const n=o;return(r,l)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["badge gap-1",e.unref(q)[r.size],e.unref(Ne)[r.color]]),type:r.type,disabled:r.disabled,onClick:l[0]||(l[0]=a=>n("click"))},[e.renderSlot(r.$slots,"default"),r.icon?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:r.icon,size:r.size},null,8,["icon","size"])):e.createCommentVNode("",!0)],10,Ee))}}),W=e.defineComponent({__name:"confirmModal",props:{title:{},message:{},confirmLabel:{default:"Ok"},cancelLabel:{default:"Cancel"}},emits:["closeModal"],setup(t,{emit:o}){const n=o,r=l=>{n("closeModal",{confirmed:l})};return(l,a)=>(e.openBlock(),e.createBlock(K,{"modal-title":l.title,open:!0,"disable-close":!0},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.message),1)]),actions:e.withCtx(()=>[e.createVNode(e.unref(E),{color:e.unref(N).secondary,outline:!0,onClick:a[0]||(a[0]=p=>r(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.cancelLabel),1)]),_:1},8,["color"]),e.createVNode(e.unref(E),{onClick:a[1]||(a[1]=p=>r(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.confirmLabel),1)]),_:1})]),_:1},8,["modal-title"]))}});class z{constructor(){this.showModal=e.ref(!1),this.modals=[]}openModal(o){const n=o.props.onClose,r=x(),l=o;o.props.onClose=a=>{n(a),this.closeModal(r)},l.id=r,this.modals=[...this.modals,l],this.showModal.value=Date.now()}closeModal(o){this.modals=this.modals.filter(n=>n.id!==o),this.showModal.value=Date.now()}static showConfirm(o){this.getInstance().openModal({component:W,props:o})}static openModal(o){this.getInstance().openModal(o)}static getInstance(){return this.instance||(this.instance=new z),this.instance}static closeAll(){this.instance.closeAll()}closeAll(){this.modals=[],this.showModal.value=!1}}const Z=e.defineComponent({__name:"modalWrapper",setup(t){const o=z.getInstance(),n=e.computed(()=>o.showModal.value?o.modals:[]);return(r,l)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,a=>{var p;return e.openBlock(),e.createBlock(e.resolveDynamicComponent(a==null?void 0:a.component),e.mergeProps({key:a.id,ref_for:!0},a==null?void 0:a.props,{open:!0,onCloseModal:(p=a==null?void 0:a.props)==null?void 0:p.onClose}),null,16,["onCloseModal"])}),128))}}),G=e.defineComponent({__name:"notification-message",props:{message:{},type:{}},setup(t){const o={success:"alert-success",error:"alert-error",warning:"alert-warning",info:"alert-info"};return(n,r)=>(e.openBlock(),e.createElementBlock("div",{role:"alert",class:e.normalizeClass(`alert ${o[n.type]} `)},[e.createElementVNode("span",null,e.toDisplayString(n.message),1)],2))}}),Pe=5e3;class T{constructor(){this.notifications=e.ref([]),this.addNotification=(o,n="info")=>{const r={id:x(),duration:Pe,message:o,type:n};this.notifications.value.push(r),this.removeNotificationAfterDuration(r)},this.removeNotificationAfterDuration=o=>{setTimeout(()=>{this.removeNotification(o.id)},o.duration)},this.removeNotification=o=>{this.notifications.value=this.notifications.value.filter(n=>n.id!==o)}}static getInstance(){return this.instance||(this.instance=new T),this.instance}static info(o){this.getInstance().addNotification(o,"info")}static success(o){this.getInstance().addNotification(o,"success")}static warning(o){this.getInstance().addNotification(o,"warning")}static error(o){this.getInstance().addNotification(o,"error")}static removeNotification(o){this.getInstance().removeNotification(o)}}const Me={class:"toast toast-top toast-center z-[999]"},J=e.defineComponent({__name:"notifications",setup(t){const o=T.getInstance();return(n,r)=>(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).notifications.value,l=>(e.openBlock(),e.createBlock(G,e.mergeProps({key:l.id},{ref_for:!0},l),null,16))),128))]))}}),De={class:"drawer"},Le={class:"drawer-content flex flex-col h-[100VH]"},Se={class:"navbar bg-primary text-primary-content w-full z-100"},xe={class:"navbar-start"},ze={for:"my-drawer-3","aria-label":"open sidebar",class:"btn btn-square btn-ghost p-1"},Te={class:"navbar-center"},Ae=["href"],Fe={class:"navbar-end"},Ue={class:"p-2 bg-white mb-1 mr-1 flex-1 shadow-sm"},He={class:"drawer-side no-overflow"},Oe={class:"menu min-h-full h-full flex-col space-between m-0 !p-0 !pt-16"},Ie={class:"flex-grow-1 w-52 bg-base-200 p-4"},Ke={class:"bg-base-200 p-4"},Re=e.defineComponent({__name:"shell.component",props:{title:{},menu:{},user:{},version:{}},emits:["logout"],setup(t,{emit:o}){const r=t,l=o,a=e.computed(()=>r.user?{label:r.user.name,items:[{label:"Logout",action:()=>{l("logout")}}]}:null);return(p,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(J),e.createVNode(e.unref(Z)),e.createElementVNode("div",De,[s[1]||(s[1]=e.createElementVNode("input",{id:"my-drawer-3",type:"checkbox",class:"drawer-toggle"},null,-1)),e.createElementVNode("div",Le,[e.createElementVNode("nav",Se,[e.createElementVNode("div",xe,[e.createElementVNode("label",ze,[e.createVNode(e.unref($),{icon:e.unref(_).Hamburger},null,8,["icon"])])]),e.createElementVNode("div",Te,[e.createElementVNode("a",{class:"btn btn-ghost text-xl",href:e.unref("/")},e.toDisplayString(p.title),9,Ae)]),e.createElementVNode("div",Fe,[a.value?(e.openBlock(),e.createBlock(e.unref(S),e.mergeProps({key:0},a.value,{"btn-class":""}),null,16)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ue,[e.renderSlot(p.$slots,"default")])]),e.createElementVNode("div",He,[s[0]||(s[0]=e.createElementVNode("label",{for:"my-drawer-3","aria-label":"close sidebar",class:"drawer-overlay"},null,-1)),e.createElementVNode("div",Oe,[e.createElementVNode("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.menu,d=>(e.openBlock(),e.createElementBlock("li",{key:d.label},[e.createVNode(e.unref(se.RouterLink),{to:{name:d.routerLink,params:d.params}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["to"])]))),128))]),e.createElementVNode("div",Ke," version: "+e.toDisplayString(p.version),1)])])])],64))}}),P=e.defineComponent({__name:"pagination-button.component",props:{currentPage:{},page:{},label:{},neverActive:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["updatePage","updatePageSize"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>n.neverActive?!1:n.page===n.currentPage),a=e.computed(()=>n.neverActive?N.blank:l.value?N.primary:N.secondary),p=()=>{r("updatePage",n.page)};return(s,d)=>(e.openBlock(),e.createBlock(e.unref(E),{disabled:s.disabled,square:!0,size:"xs",color:a.value,onClick:d[0]||(d[0]=u=>p())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.label),1)]),_:1},8,["disabled","color"]))}}),je={class:"flex gap-2"},qe={class:"flex flex-1 justify-center items-center"},We={class:"flex gap-1"},Ze={class:"text-sm"},M=6,Q=e.defineComponent({__name:"pagination.component",props:{totalItems:{type:Number,default:0},itemsPerPage:{type:Number,default:1},currentPage:{type:Number,default:1}},emits:["updatePage","updatePageSize"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>{let c=Math.ceil(n.totalItems/n.itemsPerPage);return c<1?1:c}),a=M/2,p=e.computed(()=>{if(l.value<=M)return{min:1,max:l.value};let c=n.currentPage-a;c<=1?c=1:c+M>l.value&&(c=l.value-M);let k=c+M;return{min:c,max:k}}),s=c=>({label:"...",currentPage:c,page:-10,disabled:!0,neverActive:!0}),d=e.computed(()=>{let c=l.value;c<1&&(c=1);const k=n.currentPage,v=[],{min:B,max:w}=p.value;return Array.from({length:c},(m,y)=>{const i=y+1;i!==1&&i!==c&&(i>w||i<B)||(i===c&&c>1&&w<c&&v.push(s(k)),v.push({label:`${i}`,totalPages:c,currentPage:k,page:i}),i===1&&c>1&&B>1&&v.push(s(k)))}),v}),u=c=>{r("updatePage",c)};return(c,k)=>(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",qe,[e.createElementVNode("div",We,[e.createVNode(P,e.mergeProps(n,{page:1,label:"<<","current-page":t.currentPage,"never-active":!0,disabled:t.currentPage===1,onUpdatePage:u}),null,16,["current-page","disabled"]),e.createVNode(P,e.mergeProps(n,{page:t.currentPage-1,label:"<","current-page":t.currentPage,"never-active":!0,disabled:t.currentPage===1,onUpdatePage:u}),null,16,["page","current-page","disabled"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,v=>(e.openBlock(),e.createBlock(P,e.mergeProps({key:v.page,ref_for:!0},v,{onUpdatePage:u}),null,16))),128)),e.createVNode(P,e.mergeProps(n,{page:t.currentPage+1,label:">","current-page":t.currentPage,"never-active":!0,disabled:n.currentPage===l.value,onUpdatePage:u}),null,16,["page","current-page","disabled"]),e.createVNode(P,e.mergeProps(n,{page:l.value,label:">>","current-page":t.currentPage,"never-active":!0,disabled:n.currentPage===l.value,onUpdatePage:u}),null,16,["page","current-page","disabled"])])]),e.createElementVNode("div",Ze," page "+e.toDisplayString(t.currentPage)+" of "+e.toDisplayString(l.value),1)]))}}),X=(t,o)=>{const n=t.__vccOpts||t;for(const[r,l]of o)n[r]=l;return n},Ge=()=>({data:{type:Object,required:!0},column:{type:Object,required:!0},options:{type:Object,required:!1}}),Je=e.defineComponent({name:"TextCell",props:{...Ge()},computed:{value(){var o;const t=this.data[this.column.id];return t?((o=this.column.options)==null?void 0:o.format)==="keyValue"?t[this.column.options.key]:t:null}}}),Qe=Je;function Xe(t,o,n,r,l,a){return e.toDisplayString(t.value)}const Ye=X(Qe,[["render",Xe]]),et={class:"flex-grow pr-2"},tt={class:"h-4 w-4"},ot=e.defineComponent({__name:"sort.header",props:{column:{},sortColumn:{},sortDirection:{}},emits:["sort"],setup(t,{emit:o}){const n=t,r=e.computed(()=>n.sortDirection==="asc"?_.BarsArrowUp:_.BarsArrowDown),l=e.computed(()=>{var s;return((s=n.column.options)==null?void 0:s.sortId)??n.column.id}),a=()=>{p("sort",l.value)},p=o;return(s,d)=>(e.openBlock(),e.createElementBlock("button",{class:"flex items-center",onClick:a},[e.createElementVNode("span",et,e.toDisplayString(s.column.label),1),e.createElementVNode("div",tt,[s.sortColumn===l.value?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:r.value},null,8,["icon"])):e.createCommentVNode("",!0)])]))}}),nt={class:"table w-full"},lt={key:0},rt=["colspan"],st={class:"flex gap-2"},Y=e.defineComponent({__name:"table.component",props:{loading:{type:Boolean},actions:{},data:{},displayColumns:{},page:{},sort:{}},emits:["delete","edit","updatePage","sort"],setup(t,{emit:o}){const n=o,r=s=>{console.log("edit me",s),n("edit",s)},l=s=>{console.log("delete me",s),n("delete",s)},a=s=>{n("updatePage",s)},p=s=>{n("sort",s)};return(s,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("table",nt,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.displayColumns,u=>(e.openBlock(),e.createElementBlock("th",{key:u.scope},[e.createVNode(ot,e.mergeProps({column:u},{ref_for:!0},s.sort,{onSort:p}),null,16,["column"])]))),128)),d[0]||(d[0]=e.createElementVNode("th",null,null,-1))])]),e.createElementVNode("tbody",null,[s.loading?(e.openBlock(),e.createElementBlock("tr",lt,[e.createElementVNode("td",{colspan:s.displayColumns.length+1,class:"text-center"},d[1]||(d[1]=[e.createElementVNode("span",{class:"loading loading-bars loading-xs"},null,-1)]),8,rt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.data,u=>(e.openBlock(),e.createElementBlock("tr",{key:u.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.displayColumns,c=>(e.openBlock(),e.createElementBlock("td",{key:c.scope},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.component),e.mergeProps({ref_for:!0},c,{data:u,column:c}),null,16,["data","column"]))]))),128)),e.createElementVNode("td",null,[e.createElementVNode("span",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.actions,c=>(e.openBlock(),e.createBlock(E,{key:c.label,icon:c.icon,outline:!0,onClick:k=>c.action(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["icon","onClick"]))),128)),e.createVNode(E,{icon:e.unref(_).Edit,outline:!0,onClick:c=>r(u)},null,8,["icon","onClick"]),e.createVNode(E,{icon:e.unref(_).Delete,outline:!0,onClick:c=>l(u)},null,8,["icon","onClick"])])])]))),128))])]),s.page?(e.openBlock(),e.createBlock(Q,{key:0,class:"border-gray-300 border-t pt-4 border-x-0 border-b-0","total-items":s.page.count,"items-per-page":s.page.pageSize,"current-page":s.page.page,onUpdatePage:a},null,8,["total-items","items-per-page","current-page"])):e.createCommentVNode("",!0)],64))}}),at={},ct={class:"card bg-base-100 shadow-sm"},it={class:"card-body"},ut={key:0,class:"card-title"},dt={key:1,class:"card-actions justify-end"};function pt(t,o){return e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",it,[t.$slots.title?(e.openBlock(),e.createElementBlock("h2",ut,[e.renderSlot(t.$slots,"title")])):e.createCommentVNode("",!0),e.createElementVNode("p",null,[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"content")]),t.$slots.actions?(e.openBlock(),e.createElementBlock("div",dt,[e.renderSlot(t.$slots,"actions")])):e.createCommentVNode("",!0)])])}const mt=X(at,[["render",pt]]),ft=(t,o)=>{if(!t)return null;const n=r=>{t.contains(r.target)||o()};return document.addEventListener("click",n),n},gt=t=>{document.removeEventListener("click",t)},bt={beforeMount(t,o){t.clickOutsideEvent=function(n){t===n.target||t.contains(n.target)||o.value(n)},document.addEventListener("click",t.clickOutsideEvent)},unmounted(t){document.removeEventListener("click",t.clickOutsideEvent)}};function kt(t){const o=e.getCurrentInstance();if(!o)return!1;const n=o.vnode.props;return n?!!(n[e.toHandlerKey(t)]||n[e.toHandlerKey(e.camelize(t))]):!1}const ee={group:{root:"group",label:"text-primary text-lg font-bold",item:"group-item"},verticalLayout:{root:"flex flex-col gap-x-2",item:"w-full"},horizontalLayout:{root:"flex flex-row gap-x-2",item:"w-full"},arrayList:{root:"fieldset",legend:"fieldset-legend text-xl capitalize"},control:{root:"fieldset",wrapper:"fieldset",label:"fieldset-legend",error:"",input:"input",select:"select",description:"form-control--description label text-xs text-gray-500"},fixedArrayList:{root:"flex flex-row gap-x-2",item:"w-full"}},D=()=>({id:x(),visible:!0,required:!1,enabled:!0,isFocused:!1,isTouched:!1,hideLabel:!1,styles:ee}),te=()=>({...D(),options:[],valueKey:"value",labelKey:"label"}),oe=(t,o,n)=>!!(t&&n),ne=(t,o,n,r)=>o===void 0||o!==void 0&&!t||!r&&!n,ht={key:0},A=e.defineComponent({__name:"ControlWrapper",props:e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{}},D()),setup(t){const o=t,n=e.computed(()=>!ne(o.visible,o.description,o.isFocused,!0)),r=e.computed(()=>o.required),l=e.computed(()=>oe(o.isTouched,o.isFocused,o.errors));return(a,p)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(a.styles.control.wrapper)},[a.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("legend",{key:0,class:e.normalizeClass(a.styles.control.label)},[e.createTextVNode(e.toDisplayString(a.label)+" ",1),r.value?(e.openBlock(),e.createElementBlock("span",ht,"*")):e.createCommentVNode("",!0)],2)),e.renderSlot(a.$slots,"default"),e.createElementVNode("p",{class:e.normalizeClass(["fieldset-label h-4",{"text-error":l.value}])},e.toDisplayString(l.value?a.errors:n.value?a.description:null),3)],2))}}),vt=["disabled"],yt=["value"],Bt=e.defineComponent({__name:"SelectComponent",props:e.mergeModels(e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{},options:{},valueKey:{},labelKey:{}},{...D(),options:[],valueKey:"value",labelKey:"label"}),{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=o,l=e.useModel(t,"modelValue"),a=d=>{r("change",d)},p=d=>{r("focus",d)},s=d=>{r("blur",d)};return(d,u)=>(e.openBlock(),e.createBlock(A,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[0]||(u[0]=c=>l.value=c),disabled:!d.enabled,class:e.normalizeClass(["select select-bordered",d.styles.control.select]),onChange:a,onFocus:p,onBlur:s},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options,c=>(e.openBlock(),e.createElementBlock("option",{key:c[d.valueKey],value:c},e.toDisplayString(c[d.labelKey]),9,yt))),128))],42,vt),[[e.vModelSelect,l.value]])]),_:1},16))}}),Ct="GHENTCDH_AUTHENTICATION",_t=()=>{const t=e.inject(Ct);t||console.warn("No auth provided, authorized calls may not work");const o=async(n,r,l={contentType:"application/json"})=>{const a=(l==null?void 0:l.skipAuth)??(t==null?void 0:t.options.skipAuthentication),p={accept:"application/json",...r.headers??{}};l.contentType&&(p["Content-Type"]=l.contentType),a||(await(t==null?void 0:t.updateToken()),p.Authorization=`Bearer ${t==null?void 0:t.token()}`);const s=new URL(n,window.location.href);if(l!=null&&l.queryParams)for(const[u,c]of Object.entries(l.queryParams))s.searchParams.set(u,c);const d=await fetch(s.toString(),{...r,headers:p});return d.ok?d.json():(l!=null&&l.skipAuth,Promise.reject({content:d.body,status:d.status}))};return{get:(n,r)=>o(n,{method:"GET"},r),postFile:(n,r,l={},a)=>{const p=new FormData;for(const s in l)p.append(s,l[s]);return p.append("file",r),o(n,{method:"POST",body:p},{...a,contentType:void 0})},post:(n,r,l)=>o(n,{method:"POST",body:JSON.stringify(r)},l),patch:(n,r,l)=>o(n,{method:"PATCH",body:JSON.stringify(r)},l),delete:(n,r,l)=>o(n,{method:"DELETE",body:JSON.stringify(r)},l)}},wt=["disabled"],Vt={key:0,class:e.normalizeClass([`bg-base-100 w-52 shadow -mt-5
14
- absolute z-50`])},Nt=["onClick","onBlur"],Et=e.defineComponent({__name:"AutoComplete",props:e.mergeModels(e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{},config:{},options:{},valueKey:{},labelKey:{}},te()),{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=o,l=e.useModel(t,"modelValue"),a=e.ref(""),p=i=>{r("change",i)},s=i=>{r("focus",i)},d=i=>{r("blur",i)},u=e.ref(!1),c=e.ref([]),k=i=>{u.value=!0,v(i)},v=i=>{l.value=i,p(i)},B=i=>{var f;((f=c.value)==null?void 0:f.length)===i+1&&(c.value=[])},w=_t(),m=i=>i[n.valueKey],y=i=>(i==null?void 0:i[n.labelKey])??"";return e.watch(()=>l.value,i=>{i&&!m(i)||(u.value=!0,c.value=[],a.value=y(i))},{immediate:!0}),e.watch(()=>a.value,i=>{if(u.value){u.value=!1;return}if(v({[n.labelKey]:i}),n.config){const{uri:f,skipAuth:V,dataField:h}=n.config;w.get(`${f}${i}`,{skipAuth:V}).then(C=>{c.value=C[h]})}else n.options&&(c.value=n.options.filter(f=>y(f).toLowerCase().includes(i)).slice(0,10))}),(i,f)=>{const V=e.resolveDirective("click-outside");return e.openBlock(),e.createBlock(A,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>{var h;return[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=C=>a.value=C),autocomplete:"off",type:"text",class:e.normalizeClass([i.styles.control.select]),disabled:!i.enabled,onFocus:s,onBlur:d},null,42,wt),[[e.vModelText,a.value]]),e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[(h=c.value)!=null&&h.length?(e.openBlock(),e.createElementBlock("ul",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(C,le)=>(e.openBlock(),e.createElementBlock("li",{key:C[i.valueKey]},[e.createElementVNode("button",{class:"w-full h-8 border-b-1 border-gray-200 border-x-0 border-t-0 px-4 py-2 text-left hover:bg-primary-content cursor-pointer",type:"button",onClick:re=>k(C),onBlur:re=>B(le)},e.toDisplayString(y(C)),41,Nt)]))),128))])):e.createCommentVNode("",!0)])),[[V,()=>c.value=[]]])]}),_:1},16)}}}),$t={key:0,class:e.normalizeClass([`bg-base-100 w-52 shadow -mt-5
15
- absolute z-50 p-0`])},Pt=["onClick"],Mt={class:"w-4 mr-2"},Dt=e.defineComponent({__name:"MultiSelect",props:e.mergeModels(e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{},options:{},valueKey:{},labelKey:{}},{...D(),valueKey:"value",labelKey:"label"}),{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=o,l=e.useModel(t,"modelValue");let a=!1;const p=m=>{r("change",m)},s=e.ref(!1),d=()=>{s.value=!s.value,a=!0},u=()=>{a||(s.value=!1),a=!1},c=e.computed(()=>{var m;return((m=l.value)==null?void 0:m.map(y=>B(y)))??[]}),k=m=>c.value.includes(m),v=(m,y)=>{m.preventDefault();let i=l.value??[];const f=B(y);k(f)?i=i.filter(h=>B(h)!==f):i.push(y),l.value=i,p(i)},B=m=>m[n.valueKey],w=m=>(m==null?void 0:m[n.labelKey])??"";return(m,y)=>{const i=e.resolveDirective("click-outside");return e.openBlock(),e.createBlock(A,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>{var f,V;return[e.createElementVNode("button",{type:"button",class:e.normalizeClass([m.styles.control.select,"w-full truncate block"]),onClick:d},e.toDisplayString(((V=(f=l.value)==null?void 0:f.map)==null?void 0:V.call(f,h=>w(h)).join(", "))??"Select value"),3),e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[s.value?(e.openBlock(),e.createElementBlock("ul",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.options,h=>(e.openBlock(),e.createElementBlock("li",{key:h[m.valueKey]},[e.createElementVNode("button",{class:"w-full flex h-8 border-b-1 border-gray-200 border-x-0 border-t-0 p-2 text-left hover:bg-primary-content cursor-pointer",type:"button",onClick:C=>v(C,h)},[e.createElementVNode("div",Mt,[k(B(h))?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:e.unref(_).Check,size:"sm"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createTextVNode(" "+e.toDisplayString(w(h)),1)],8,Pt)]))),128))])):e.createCommentVNode("",!0)])),[[i,()=>u()]])]}),_:1},16)}}});exports.Autocomplete=Et;exports.BadgeSize=q;exports.Btn=E;exports.BtnBadge=$e;exports.ButtonSize=j;exports.Card=mt;exports.ClickOutside=bt;exports.Color=N;exports.ConfirmModal=W;exports.ControlWrapper=A;exports.DefaultAutoCompleteProperties=te;exports.DefaultControlProperties=D;exports.Dropdown=ke;exports.Icon=$;exports.IconEnum=_;exports.IconMap=O;exports.Menu=be;exports.Modal=K;exports.ModalService=z;exports.ModalWrapper=Z;exports.MultiSelect=Dt;exports.NotificationMessage=G;exports.NotificationService=T;exports.Notifications=J;exports.PaginationComponent=Q;exports.SelectComponent=Bt;exports.ShellComponent=Re;exports.SubMenu=S;exports.Table=Y;exports.TableComponent=Y;exports.TextCell=Ye;exports.addClickOutsideEventListener=ft;exports.hasCustomEventListener=kt;exports.isDescriptionHidden=ne;exports.myStyles=ee;exports.removeClickOutsideEventListener=gt;exports.showErrors=oe;
13
+ </svg>`;var _=(t=>(t.Edit="Edit",t.Delete="Delete",t.BarsArrowDown="BarsArrowDown",t.BarsArrowUp="BarsArrowUp",t.Funnel="Funnel",t.Close="Close",t.Plus="Plus",t.PaperClip="PaperClip",t.Hamburger="Hamburger",t.ChevronDown="ChevronDown",t.ChevronUp="ChevronUp",t.Check="Check",t.View="View",t.Text="Text",t))(_||{});const O={Edit:b("m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"),Delete:b("m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"),BarsArrowDown:b("M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0-3.75-3.75M17.25 21 21 17.25"),BarsArrowUp:b("M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"),Funnel:b("M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"),Close:b("M6 18 18 6M6 6l12 12"),Plus:b("M12 9v6m3-3H9m12 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"),PaperClip:b("m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"),Hamburger:b("M4 6h16M4 12h16M4 18h16"),ChevronDown:b("M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z"),ChevronUp:b("M11.47 7.72a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06L12 9.31l-6.97 6.97a.75.75 0 0 1-1.06-1.06l7.5-7.5Z"),Check:b("m4.5 12.75 6 6 9-13.5"),View:b("M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z","M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"),Text:b("M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z")},se=["innerHTML"],$=e.defineComponent({__name:"icon",props:{icon:{},size:{}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{"w-full h-full":!o.size,"w-2 h-2":o.size==="xs","w-4 h-4":o.size==="sm"}]),innerHTML:e.unref(O)[o.icon]},null,10,se))}}),ce={class:"dropdown dropdown-end"},ie={tabindex:"0",class:"menu dropdown-content bg-white z-1 mt-4 p-2 shadow-sm"},ue={class:"min-w-max flex-no-wrap text-black"},S=e.defineComponent({__name:"sub-menu",props:{label:{},items:{},action:{type:Function},disabled:{type:Boolean},btnClass:{},disableArrow:{type:Boolean}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createElementVNode("div",{tabindex:"0",role:"button",class:e.normalizeClass([o.btnClass,"btn btn-ghost text-right flex-nowrap flex"])},[e.createElementVNode("span",null,e.toDisplayString(o.label),1),o.disableArrow?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:e.unref(_).ChevronDown,size:"sm"},null,8,["icon"]))],2),e.createElementVNode("ul",ie,[e.createElementVNode("li",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.items,r=>(e.openBlock(),e.createBlock(I,e.mergeProps({key:r.label},{ref_for:!0},r),null,16))),128))])])]))}}),L="btn btn-ghost text-left justify-between min-w-max font-normal",I=e.defineComponent({__name:"menu-item",props:{label:{},items:{},action:{},disabled:{type:Boolean,default:!1}},setup(t){const o=t,n=e.computed(()=>!o.disabled&&o.action&&"routerLink"in o.action),r=e.computed(()=>!o.disabled&&o.action),l=e.computed(()=>{var a;return(a=o.items)==null?void 0:a.length}),s=e.computed(()=>{const a=o.action;return a&&"routerLink"in a&&"params"in a?{name:a.routerLink,params:a.params}:""}),p=()=>{var a;(a=o.action)==null||a.call(o)};return(a,d)=>{const u=e.resolveComponent("RouterLink");return l.value?(e.openBlock(),e.createBlock(S,e.mergeProps({key:0},o,{"btn-class":L}),null,16)):n.value?(e.openBlock(),e.createBlock(u,{key:1,to:s.value,class:e.normalizeClass(L),onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["to"])):r.value?(e.openBlock(),e.createElementBlock("button",{key:2,class:e.normalizeClass(L),onClick:p},e.toDisplayString(a.label),1)):(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass([L,{"btn-disabled":a.disabled}])},e.toDisplayString(a.label),3))}}}),de={class:"navbar bg-base-100 shadow-sm"},pe={class:"flex-1"},me={key:0,class:"breadcrumbs text-sm"},fe={class:"flex grow justify-end px-2"},ge={class:"flex items-stretch"},be=e.defineComponent({__name:"menu",props:{menu:{},breadcrumbs:{}},setup(t){return(o,n)=>{const r=e.resolveComponent("RouterLink");return e.openBlock(),e.createElementBlock("nav",de,[e.createElementVNode("div",pe,[o.breadcrumbs?(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.breadcrumbs,l=>(e.openBlock(),e.createElementBlock("li",{key:l.label},[l.routerLink?(e.openBlock(),e.createBlock(r,{key:0,to:{name:l.routerLink,params:l.params}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.label),1)]),_:2},1032,["to"])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(l.label),1)],64))]))),128))])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[e.createElementVNode("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.menu,l=>(e.openBlock(),e.createBlock(I,e.mergeProps({key:l.label},{ref_for:!0},l),null,16))),128))])])])}}}),ke=e.defineComponent({__name:"dropdown",props:{items:{}},setup(t){const o=e.ref(!0);return(n,r)=>(e.openBlock(),e.createBlock(S,{items:n.items,label:"test",open:o.value,"btn-class":"","disable-arrow":!0},null,8,["items","open"]))}}),g=[];for(let t=0;t<256;++t)g.push((t+256).toString(16).slice(1));function he(t,o=0){return(g[t[o+0]]+g[t[o+1]]+g[t[o+2]]+g[t[o+3]]+"-"+g[t[o+4]]+g[t[o+5]]+"-"+g[t[o+6]]+g[t[o+7]]+"-"+g[t[o+8]]+g[t[o+9]]+"-"+g[t[o+10]]+g[t[o+11]]+g[t[o+12]]+g[t[o+13]]+g[t[o+14]]+g[t[o+15]]).toLowerCase()}let F;const ve=new Uint8Array(16);function ye(){if(!F){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");F=crypto.getRandomValues.bind(crypto)}return F(ve)}const Be=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),H={randomUUID:Be};function x(t,o,n){var l;if(H.randomUUID&&!t)return H.randomUUID();t=t||{};const r=t.random??((l=t.rng)==null?void 0:l.call(t))??ye();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,he(r)}const Ce={class:"font-bold"},_e={class:"pt-4"},we={class:"modal-action"},K=e.defineComponent({__name:"modal",props:{modalTitle:{},buttonLabel:{},buttonSaveLabel:{},data:{},open:{type:Boolean,default:!1},disableClose:{type:Boolean,default:!1},width:{default:"sm"}},emits:["closeModal"],setup(t,{expose:o,emit:n}){const r={xs:"max-w-xs w-[50VW]",sm:"max-w-sm w-[50VW]",lg:"max-w-2xl w-[80VW]",xl:"max-w-[80VW] w-[80VW]"},l=t,s=`modal_${x()}`,p=n,a=()=>{const u=document.getElementById(s);u==null||u.showModal()},d=()=>{const u=document.getElementById(s);u==null||u.close(),p("closeModal")};return o({closeModal:d,openModal:a}),e.watch(()=>l.open,(u,c,k)=>{l.open?a():d()}),e.onMounted(()=>{l.open&&a()}),(u,c)=>(e.openBlock(),e.createElementBlock("dialog",{id:s,class:"modal"},[e.createElementVNode("div",{class:e.normalizeClass(["modal-box bg-white",r[u.width]])},[u.disableClose?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-sm btn-circle btn-ghost absolute right-2 top-2",onClick:d}," ✕ ")),e.createElementVNode("h3",Ce,e.toDisplayString(u.modalTitle),1),e.createElementVNode("div",_e,[e.renderSlot(u.$slots,"content")]),e.createElementVNode("div",we,[e.renderSlot(u.$slots,"actions")])],2)]))}});var U=(t=>(t.button="button",t.submit="submit",t.reset="reset",t))(U||{}),R=(t=>(t.a="a",t.button="button",t))(R||{}),N=(t=>(t.blank="blank",t.primary="primary",t.secondary="secondary",t.error="error",t))(N||{});const Ve={blank:"btn-ghost",primary:"btn-primary",secondary:"btn-soft btn-primary",error:"btn-error text-white"},Ne={blank:"badge-ghost",primary:"badge-primary",secondary:"badge-soft badge-primary",error:"badge-error"},j={xs:"btn-xs",sm:"btn-sm",lg:"btn-sm",xl:"btn"},q={xs:"badge-xs text-xxs",sm:"badge-sm text-xs",lg:"badge-sm text-xs",xl:"badge text-xs"},E=e.defineComponent({__name:"btn",props:{href:{},disabled:{type:Boolean,default:!1},as:{default:R.button},icon:{},type:{default:U.button},outline:{type:Boolean,default:!1},color:{default:N.primary},size:{default:"sm"},square:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const n=t,r=o;return(l,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.as),e.mergeProps({class:["btn p-1 flex justify-center flex-nowrap",e.unref(Ve)[l.color],e.unref(j)[l.size],{"btn-outline":l.outline,"btn-square":l.square}]},n,{onClick:s[0]||(s[0]=p=>r("click"))}),{default:e.withCtx(()=>[l.icon?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:l.icon,size:l.size},null,8,["icon","size"])):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default")]),_:3},16,["class"]))}}),Ee=["type","disabled"],$e=e.defineComponent({__name:"btn-badge",props:{icon:{default:void 0},type:{default:U.button},color:{default:void 0},disabled:{type:Boolean,default:!1},size:{default:"sm"}},emits:["click"],setup(t,{emit:o}){const n=o;return(r,l)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["badge gap-1",e.unref(q)[r.size],e.unref(Ne)[r.color]]),type:r.type,disabled:r.disabled,onClick:l[0]||(l[0]=s=>n("click"))},[e.renderSlot(r.$slots,"default"),r.icon?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:r.icon,size:r.size},null,8,["icon","size"])):e.createCommentVNode("",!0)],10,Ee))}}),W=e.defineComponent({__name:"confirmModal",props:{title:{},message:{},confirmLabel:{default:"Ok"},cancelLabel:{default:"Cancel"}},emits:["closeModal"],setup(t,{emit:o}){const n=o,r=l=>{n("closeModal",{confirmed:l})};return(l,s)=>(e.openBlock(),e.createBlock(K,{"modal-title":l.title,open:!0,"disable-close":!0},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.message),1)]),actions:e.withCtx(()=>[e.createVNode(e.unref(E),{color:e.unref(N).secondary,outline:!0,onClick:s[0]||(s[0]=p=>r(!1))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.cancelLabel),1)]),_:1},8,["color"]),e.createVNode(e.unref(E),{onClick:s[1]||(s[1]=p=>r(!0))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.confirmLabel),1)]),_:1})]),_:1},8,["modal-title"]))}});class z{constructor(){this.showModal=e.ref(!1),this.modals=[]}openModal(o){const n=o.props.onClose,r=x(),l=o;o.props.onClose=s=>{n(s),this.closeModal(r)},l.id=r,this.modals=[...this.modals,l],this.showModal.value=Date.now()}closeModal(o){this.modals=this.modals.filter(n=>n.id!==o),this.showModal.value=Date.now()}static showConfirm(o){this.getInstance().openModal({component:W,props:o})}static openModal(o){this.getInstance().openModal(o)}static getInstance(){return this.instance||(this.instance=new z),this.instance}static closeAll(){this.instance.closeAll()}closeAll(){this.modals=[],this.showModal.value=!1}}const Z=e.defineComponent({__name:"modalWrapper",setup(t){const o=z.getInstance(),n=e.computed(()=>o.showModal.value?o.modals:[]);return(r,l)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,s=>{var p;return e.openBlock(),e.createBlock(e.resolveDynamicComponent(s==null?void 0:s.component),e.mergeProps({key:s.id,ref_for:!0},s==null?void 0:s.props,{open:!0,onCloseModal:(p=s==null?void 0:s.props)==null?void 0:p.onClose}),null,16,["onCloseModal"])}),128))}}),G=e.defineComponent({__name:"notification-message",props:{message:{},type:{}},setup(t){const o={success:"alert-success",error:"alert-error",warning:"alert-warning",info:"alert-info"};return(n,r)=>(e.openBlock(),e.createElementBlock("div",{role:"alert",class:e.normalizeClass(`alert ${o[n.type]} `)},[e.createElementVNode("span",null,e.toDisplayString(n.message),1)],2))}}),Pe=5e3;class T{constructor(){this.notifications=e.ref([]),this.addNotification=(o,n="info")=>{const r={id:x(),duration:Pe,message:o,type:n};this.notifications.value.push(r),this.removeNotificationAfterDuration(r)},this.removeNotificationAfterDuration=o=>{setTimeout(()=>{this.removeNotification(o.id)},o.duration)},this.removeNotification=o=>{this.notifications.value=this.notifications.value.filter(n=>n.id!==o)}}static getInstance(){return this.instance||(this.instance=new T),this.instance}static info(o){this.getInstance().addNotification(o,"info")}static success(o){this.getInstance().addNotification(o,"success")}static warning(o){this.getInstance().addNotification(o,"warning")}static error(o){this.getInstance().addNotification(o,"error")}static removeNotification(o){this.getInstance().removeNotification(o)}}const Me={class:"toast toast-top toast-center z-[999]"},J=e.defineComponent({__name:"notifications",setup(t){const o=T.getInstance();return(n,r)=>(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).notifications.value,l=>(e.openBlock(),e.createBlock(G,e.mergeProps({key:l.id},{ref_for:!0},l),null,16))),128))]))}}),De={class:"drawer"},Le={class:"drawer-content flex flex-col h-[100VH]"},Se={class:"navbar bg-primary text-primary-content w-full z-100"},xe={class:"navbar-start"},ze={for:"my-drawer-3","aria-label":"open sidebar",class:"btn btn-square btn-ghost p-1"},Te={class:"navbar-center"},Ae=["href"],Fe={class:"navbar-end"},Ue={class:"p-2 bg-white mb-1 mr-1 flex-1 shadow-sm"},He={class:"drawer-side no-overflow"},Oe={class:"menu min-h-full h-full flex-col space-between m-0 !p-0 !pt-16"},Ie={class:"flex-grow-1 w-52 bg-base-200 p-4"},Ke={class:"bg-base-200 p-4"},Re=e.defineComponent({__name:"shell.component",props:{title:{},menu:{},user:{},version:{}},emits:["logout"],setup(t,{emit:o}){const r=t,l=o,s=e.computed(()=>r.user?{label:r.user.name,items:[{label:"Logout",action:()=>{l("logout")}}]}:null);return(p,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(J),e.createVNode(e.unref(Z)),e.createElementVNode("div",De,[a[1]||(a[1]=e.createElementVNode("input",{id:"my-drawer-3",type:"checkbox",class:"drawer-toggle"},null,-1)),e.createElementVNode("div",Le,[e.createElementVNode("nav",Se,[e.createElementVNode("div",xe,[e.createElementVNode("label",ze,[e.createVNode(e.unref($),{icon:e.unref(_).Hamburger},null,8,["icon"])])]),e.createElementVNode("div",Te,[e.createElementVNode("a",{class:"btn btn-ghost text-xl",href:e.unref("/")},e.toDisplayString(p.title),9,Ae)]),e.createElementVNode("div",Fe,[s.value?(e.openBlock(),e.createBlock(e.unref(S),e.mergeProps({key:0},s.value,{"btn-class":""}),null,16)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",Ue,[e.renderSlot(p.$slots,"default")])]),e.createElementVNode("div",He,[a[0]||(a[0]=e.createElementVNode("label",{for:"my-drawer-3","aria-label":"close sidebar",class:"drawer-overlay"},null,-1)),e.createElementVNode("div",Oe,[e.createElementVNode("ul",Ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.menu,d=>(e.openBlock(),e.createElementBlock("li",{key:d.label},[e.createVNode(e.unref(ae.RouterLink),{to:{name:d.routerLink,params:d.params}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.label),1)]),_:2},1032,["to"])]))),128))]),e.createElementVNode("div",Ke," version: "+e.toDisplayString(p.version),1)])])])],64))}}),P=e.defineComponent({__name:"pagination-button.component",props:{currentPage:{},page:{},label:{},neverActive:{type:Boolean,default:!1},disabled:{type:Boolean}},emits:["updatePage","updatePageSize"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>n.neverActive?!1:n.page===n.currentPage),s=e.computed(()=>n.neverActive?N.blank:l.value?N.primary:N.secondary),p=()=>{r("updatePage",n.page)};return(a,d)=>(e.openBlock(),e.createBlock(e.unref(E),{disabled:a.disabled,square:!0,size:"xs",color:s.value,onClick:d[0]||(d[0]=u=>p())},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.label),1)]),_:1},8,["disabled","color"]))}}),je={class:"flex gap-2"},qe={class:"flex flex-1 justify-center items-center"},We={class:"flex gap-1"},Ze={class:"text-sm"},M=6,Q=e.defineComponent({__name:"pagination.component",props:{totalItems:{type:Number,default:0},itemsPerPage:{type:Number,default:1},currentPage:{type:Number,default:1}},emits:["updatePage","updatePageSize"],setup(t,{emit:o}){const n=t,r=o,l=e.computed(()=>{let c=Math.ceil(n.totalItems/n.itemsPerPage);return c<1?1:c}),s=M/2,p=e.computed(()=>{if(l.value<=M)return{min:1,max:l.value};let c=n.currentPage-s;c<=1?c=1:c+M>l.value&&(c=l.value-M);let k=c+M;return{min:c,max:k}}),a=c=>({label:"...",currentPage:c,page:-10,disabled:!0,neverActive:!0}),d=e.computed(()=>{let c=l.value;c<1&&(c=1);const k=n.currentPage,v=[],{min:B,max:w}=p.value;return Array.from({length:c},(m,y)=>{const i=y+1;i!==1&&i!==c&&(i>w||i<B)||(i===c&&c>1&&w<c&&v.push(a(k)),v.push({label:`${i}`,totalPages:c,currentPage:k,page:i}),i===1&&c>1&&B>1&&v.push(a(k)))}),v}),u=c=>{r("updatePage",c)};return(c,k)=>(e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",qe,[e.createElementVNode("div",We,[e.createVNode(P,e.mergeProps(n,{page:1,label:"<<","current-page":t.currentPage,"never-active":!0,disabled:t.currentPage===1,onUpdatePage:u}),null,16,["current-page","disabled"]),e.createVNode(P,e.mergeProps(n,{page:t.currentPage-1,label:"<","current-page":t.currentPage,"never-active":!0,disabled:t.currentPage===1,onUpdatePage:u}),null,16,["page","current-page","disabled"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,v=>(e.openBlock(),e.createBlock(P,e.mergeProps({key:v.page,ref_for:!0},v,{onUpdatePage:u}),null,16))),128)),e.createVNode(P,e.mergeProps(n,{page:t.currentPage+1,label:">","current-page":t.currentPage,"never-active":!0,disabled:n.currentPage===l.value,onUpdatePage:u}),null,16,["page","current-page","disabled"]),e.createVNode(P,e.mergeProps(n,{page:l.value,label:">>","current-page":t.currentPage,"never-active":!0,disabled:n.currentPage===l.value,onUpdatePage:u}),null,16,["page","current-page","disabled"])])]),e.createElementVNode("div",Ze," page "+e.toDisplayString(t.currentPage)+" of "+e.toDisplayString(l.value),1)]))}}),X=(t,o)=>{const n=t.__vccOpts||t;for(const[r,l]of o)n[r]=l;return n},Ge=()=>({data:{type:Object,required:!0},column:{type:Object,required:!0},options:{type:Object,required:!1}}),Je=e.defineComponent({name:"TextCell",props:{...Ge()},computed:{value(){var o;const t=this.data[this.column.id];return t?((o=this.column.options)==null?void 0:o.format)==="keyValue"?t[this.column.options.key]:t:null}}}),Qe=Je;function Xe(t,o,n,r,l,s){return e.toDisplayString(t.value)}const Ye=X(Qe,[["render",Xe]]),et={class:"flex-grow pr-2"},tt={class:"h-4 w-4"},ot=e.defineComponent({__name:"sort.header",props:{column:{},sortColumn:{},sortDirection:{}},emits:["sort"],setup(t,{emit:o}){const n=t,r=e.computed(()=>n.sortDirection==="asc"?_.BarsArrowUp:_.BarsArrowDown),l=e.computed(()=>{var a;return((a=n.column.options)==null?void 0:a.sortId)??n.column.id}),s=()=>{p("sort",l.value)},p=o;return(a,d)=>(e.openBlock(),e.createElementBlock("button",{class:"flex items-center",onClick:s},[e.createElementVNode("span",et,e.toDisplayString(a.column.label),1),e.createElementVNode("div",tt,[a.sortColumn===l.value?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:r.value},null,8,["icon"])):e.createCommentVNode("",!0)])]))}}),nt={class:"table w-full"},lt={key:0},rt=["colspan"],at={class:"flex gap-2"},Y=e.defineComponent({__name:"table.component",props:{loading:{type:Boolean},actions:{},data:{},displayColumns:{},page:{},sort:{}},emits:["delete","edit","updatePage","sort"],setup(t,{emit:o}){const n=o,r=a=>{n("edit",a)},l=a=>{n("delete",a)},s=a=>{n("updatePage",a)},p=a=>{n("sort",a)};return(a,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("table",nt,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.displayColumns,u=>(e.openBlock(),e.createElementBlock("th",{key:u.scope},[e.createVNode(ot,e.mergeProps({column:u},{ref_for:!0},a.sort,{onSort:p}),null,16,["column"])]))),128)),d[0]||(d[0]=e.createElementVNode("th",null,null,-1))])]),e.createElementVNode("tbody",null,[a.loading?(e.openBlock(),e.createElementBlock("tr",lt,[e.createElementVNode("td",{colspan:a.displayColumns.length+1,class:"text-center"},d[1]||(d[1]=[e.createElementVNode("span",{class:"loading loading-bars loading-xs"},null,-1)]),8,rt)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.data,u=>(e.openBlock(),e.createElementBlock("tr",{key:u.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.displayColumns,c=>(e.openBlock(),e.createElementBlock("td",{key:c.scope},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.component),e.mergeProps({ref_for:!0},c,{data:u,column:c}),null,16,["data","column"]))]))),128)),e.createElementVNode("td",null,[e.createElementVNode("span",at,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.actions,c=>(e.openBlock(),e.createBlock(E,{key:c.label,icon:c.icon,outline:!0,onClick:k=>c.action(u)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.label),1)]),_:2},1032,["icon","onClick"]))),128)),e.createVNode(E,{icon:e.unref(_).Edit,outline:!0,onClick:c=>r(u)},null,8,["icon","onClick"]),e.createVNode(E,{icon:e.unref(_).Delete,outline:!0,onClick:c=>l(u)},null,8,["icon","onClick"])])])]))),128))])]),a.page?(e.openBlock(),e.createBlock(Q,{key:0,class:"border-gray-300 border-t pt-4 border-x-0 border-b-0","total-items":a.page.count,"items-per-page":a.page.pageSize,"current-page":a.page.page,onUpdatePage:s},null,8,["total-items","items-per-page","current-page"])):e.createCommentVNode("",!0)],64))}}),st={},ct={class:"card bg-base-100 shadow-sm"},it={class:"card-body"},ut={key:0,class:"card-title"},dt={key:1,class:"card-actions justify-end"};function pt(t,o){return e.openBlock(),e.createElementBlock("div",ct,[e.createElementVNode("div",it,[t.$slots.title?(e.openBlock(),e.createElementBlock("h2",ut,[e.renderSlot(t.$slots,"title")])):e.createCommentVNode("",!0),e.createElementVNode("p",null,[e.renderSlot(t.$slots,"default"),e.renderSlot(t.$slots,"content")]),t.$slots.actions?(e.openBlock(),e.createElementBlock("div",dt,[e.renderSlot(t.$slots,"actions")])):e.createCommentVNode("",!0)])])}const mt=X(st,[["render",pt]]),ft=(t,o)=>{if(!t)return null;const n=r=>{t.contains(r.target)||o()};return document.addEventListener("click",n),n},gt=t=>{document.removeEventListener("click",t)},bt={beforeMount(t,o){t.clickOutsideEvent=function(n){t===n.target||t.contains(n.target)||o.value(n)},document.addEventListener("click",t.clickOutsideEvent)},unmounted(t){document.removeEventListener("click",t.clickOutsideEvent)}};function kt(t){const o=e.getCurrentInstance();if(!o)return!1;const n=o.vnode.props;return n?!!(n[e.toHandlerKey(t)]||n[e.toHandlerKey(e.camelize(t))]):!1}const ee={group:{root:"group",label:"text-primary text-lg font-bold",item:"group-item"},verticalLayout:{root:"flex flex-col gap-x-2",item:"w-full"},horizontalLayout:{root:"flex flex-row gap-x-2",item:"w-full"},arrayList:{root:"fieldset",legend:"fieldset-legend text-xl capitalize"},control:{root:"fieldset",wrapper:"fieldset",label:"fieldset-legend",error:"",input:"input",select:"select",description:"form-control--description label text-xs text-gray-500"},fixedArrayList:{root:"flex flex-row gap-x-2",item:"w-full"}},D=()=>({id:x(),visible:!0,required:!1,enabled:!0,isFocused:!1,isTouched:!1,hideLabel:!1,styles:ee}),te=()=>({...D(),options:[],valueKey:"value",labelKey:"label"}),oe=(t,o,n)=>!!(t&&n),ne=(t,o,n,r)=>o===void 0||o!==void 0&&!t||!r&&!n,ht={key:0},A=e.defineComponent({__name:"ControlWrapper",props:e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{}},D()),setup(t){const o=t,n=e.computed(()=>!ne(o.visible,o.description,o.isFocused,!0)),r=e.computed(()=>o.required),l=e.computed(()=>oe(o.isTouched,o.isFocused,o.errors));return(s,p)=>(e.openBlock(),e.createElementBlock("fieldset",{class:e.normalizeClass(s.styles.control.wrapper)},[s.hideLabel?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("legend",{key:0,class:e.normalizeClass(s.styles.control.label)},[e.createTextVNode(e.toDisplayString(s.label)+" ",1),r.value?(e.openBlock(),e.createElementBlock("span",ht,"*")):e.createCommentVNode("",!0)],2)),e.renderSlot(s.$slots,"default"),e.createElementVNode("p",{class:e.normalizeClass(["fieldset-label h-4",{"text-error":l.value}])},e.toDisplayString(l.value?s.errors:n.value?s.description:null),3)],2))}}),vt=["disabled"],yt=["value"],Bt=e.defineComponent({__name:"SelectComponent",props:e.mergeModels(e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{},options:{},valueKey:{},labelKey:{}},{...D(),options:[],valueKey:"value",labelKey:"label"}),{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=o,l=e.useModel(t,"modelValue"),s=d=>{r("change",d)},p=d=>{r("focus",d)},a=d=>{r("blur",d)};return(d,u)=>(e.openBlock(),e.createBlock(A,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":u[0]||(u[0]=c=>l.value=c),disabled:!d.enabled,class:e.normalizeClass(["select select-bordered",d.styles.control.select]),onChange:s,onFocus:p,onBlur:a},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options,c=>(e.openBlock(),e.createElementBlock("option",{key:c[d.valueKey],value:c},e.toDisplayString(c[d.labelKey]),9,yt))),128))],42,vt),[[e.vModelSelect,l.value]])]),_:1},16))}}),Ct="GHENTCDH_AUTHENTICATION",_t=()=>{const t=e.inject(Ct);t||console.warn("No auth provided, authorized calls may not work");const o=async(n,r,l={contentType:"application/json"})=>{const s=(l==null?void 0:l.skipAuth)??(t==null?void 0:t.options.skipAuthentication),p={accept:"application/json",...r.headers??{}};l.contentType&&(p["Content-Type"]=l.contentType),s||(await(t==null?void 0:t.updateToken()),p.Authorization=`Bearer ${t==null?void 0:t.token()}`);const a=new URL(n,window.location.href);if(l!=null&&l.queryParams)for(const[u,c]of Object.entries(l.queryParams))a.searchParams.set(u,c);const d=await fetch(a.toString(),{...r,headers:p});return d.ok?d.json():(l!=null&&l.skipAuth,Promise.reject({content:d.body,status:d.status}))};return{get:(n,r)=>o(n,{method:"GET"},r),postFile:(n,r,l={},s)=>{const p=new FormData;for(const a in l)p.append(a,l[a]);return p.append("file",r),o(n,{method:"POST",body:p},{...s,contentType:void 0})},post:(n,r,l)=>o(n,{method:"POST",body:JSON.stringify(r)},l),patch:(n,r,l)=>o(n,{method:"PATCH",body:JSON.stringify(r)},l),delete:(n,r,l)=>o(n,{method:"DELETE",body:JSON.stringify(r)},l)}},wt=["disabled"],Vt={key:0,class:e.normalizeClass([`bg-base-100 w-52 shadow -mt-5
14
+ absolute z-50`])},Nt=["onClick","onBlur"],Et=e.defineComponent({__name:"AutoComplete",props:e.mergeModels(e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{},config:{},options:{},valueKey:{},labelKey:{}},te()),{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=o,l=e.useModel(t,"modelValue"),s=e.ref(""),p=i=>{r("change",i)},a=i=>{r("focus",i)},d=i=>{r("blur",i)},u=e.ref(!1),c=e.ref([]),k=i=>{u.value=!0,v(i)},v=i=>{l.value=i,p(i)},B=i=>{var f;((f=c.value)==null?void 0:f.length)===i+1&&(c.value=[])},w=_t(),m=i=>i[n.valueKey],y=i=>(i==null?void 0:i[n.labelKey])??"";return e.watch(()=>l.value,i=>{i&&!m(i)||(u.value=!0,c.value=[],s.value=y(i))},{immediate:!0}),e.watch(()=>s.value,i=>{if(u.value){u.value=!1;return}if(v({[n.labelKey]:i}),n.config){const{uri:f,skipAuth:V,dataField:h}=n.config;w.get(`${f}${i}`,{skipAuth:V}).then(C=>{c.value=C[h]})}else n.options&&(c.value=n.options.filter(f=>y(f).toLowerCase().includes(i)).slice(0,10))}),(i,f)=>{const V=e.resolveDirective("click-outside");return e.openBlock(),e.createBlock(A,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>{var h;return[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[0]||(f[0]=C=>s.value=C),autocomplete:"off",type:"text",class:e.normalizeClass([i.styles.control.select]),disabled:!i.enabled,onFocus:a,onBlur:d},null,42,wt),[[e.vModelText,s.value]]),e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[(h=c.value)!=null&&h.length?(e.openBlock(),e.createElementBlock("ul",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(C,le)=>(e.openBlock(),e.createElementBlock("li",{key:C[i.valueKey]},[e.createElementVNode("button",{class:"w-full h-8 border-b-1 border-gray-200 border-x-0 border-t-0 px-4 py-2 text-left hover:bg-primary-content cursor-pointer",type:"button",onClick:re=>k(C),onBlur:re=>B(le)},e.toDisplayString(y(C)),41,Nt)]))),128))])):e.createCommentVNode("",!0)])),[[V,()=>c.value=[]]])]}),_:1},16)}}}),$t={key:0,class:e.normalizeClass([`bg-base-100 w-52 shadow -mt-5
15
+ absolute z-50 p-0`])},Pt=["onClick"],Mt={class:"w-4 mr-2"},Dt=e.defineComponent({__name:"MultiSelect",props:e.mergeModels(e.mergeDefaults({id:{},description:{},errors:{},label:{},visible:{type:Boolean},required:{type:Boolean},enabled:{type:Boolean},isFocused:{type:Boolean},isTouched:{type:Boolean},hideLabel:{type:Boolean},styles:{},options:{},valueKey:{},labelKey:{}},{...D(),valueKey:"value",labelKey:"label"}),{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["change","focus","blur"],["update:modelValue"]),setup(t,{emit:o}){const n=t,r=o,l=e.useModel(t,"modelValue");let s=!1;const p=m=>{r("change",m)},a=e.ref(!1),d=()=>{a.value=!a.value,s=!0},u=()=>{s||(a.value=!1),s=!1},c=e.computed(()=>{var m;return((m=l.value)==null?void 0:m.map(y=>B(y)))??[]}),k=m=>c.value.includes(m),v=(m,y)=>{m.preventDefault();let i=l.value??[];const f=B(y);k(f)?i=i.filter(h=>B(h)!==f):i.push(y),l.value=i,p(i)},B=m=>m[n.valueKey],w=m=>(m==null?void 0:m[n.labelKey])??"";return(m,y)=>{const i=e.resolveDirective("click-outside");return e.openBlock(),e.createBlock(A,e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>{var f,V;return[e.createElementVNode("button",{type:"button",class:e.normalizeClass([m.styles.control.select,"w-full truncate block"]),onClick:d},e.toDisplayString(((V=(f=l.value)==null?void 0:f.map)==null?void 0:V.call(f,h=>w(h)).join(", "))??"Select value"),3),e.withDirectives((e.openBlock(),e.createElementBlock("div",null,[a.value?(e.openBlock(),e.createElementBlock("ul",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.options,h=>(e.openBlock(),e.createElementBlock("li",{key:h[m.valueKey]},[e.createElementVNode("button",{class:"w-full flex h-8 border-b-1 border-gray-200 border-x-0 border-t-0 p-2 text-left hover:bg-primary-content cursor-pointer",type:"button",onClick:C=>v(C,h)},[e.createElementVNode("div",Mt,[k(B(h))?(e.openBlock(),e.createBlock(e.unref($),{key:0,icon:e.unref(_).Check,size:"sm"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createTextVNode(" "+e.toDisplayString(w(h)),1)],8,Pt)]))),128))])):e.createCommentVNode("",!0)])),[[i,()=>u()]])]}),_:1},16)}}});exports.Autocomplete=Et;exports.BadgeSize=q;exports.Btn=E;exports.BtnBadge=$e;exports.ButtonSize=j;exports.Card=mt;exports.ClickOutside=bt;exports.Color=N;exports.ConfirmModal=W;exports.ControlWrapper=A;exports.DefaultAutoCompleteProperties=te;exports.DefaultControlProperties=D;exports.Dropdown=ke;exports.Icon=$;exports.IconEnum=_;exports.IconMap=O;exports.Menu=be;exports.Modal=K;exports.ModalService=z;exports.ModalWrapper=Z;exports.MultiSelect=Dt;exports.NotificationMessage=G;exports.NotificationService=T;exports.Notifications=J;exports.PaginationComponent=Q;exports.SelectComponent=Bt;exports.ShellComponent=Re;exports.SubMenu=S;exports.Table=Y;exports.TableComponent=Y;exports.TextCell=Ye;exports.addClickOutsideEventListener=ft;exports.hasCustomEventListener=kt;exports.isDescriptionHidden=ne;exports.myStyles=ee;exports.removeClickOutsideEventListener=gt;exports.showErrors=oe;
package/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as v, createElementBlock as u, openBlock as a, unref as h, normalizeClass as $, createElementVNode as c, createBlock as g, createCommentVNode as M, toDisplayString as f, Fragment as k, renderList as L, mergeProps as B, computed as C, resolveComponent as me, withCtx as D, createTextVNode as S, ref as O, watch as te, onMounted as _e, renderSlot as N, resolveDynamicComponent as oe, createVNode as T, getCurrentInstance as we, toHandlerKey as de, camelize as ke, mergeDefaults as Q, mergeModels as q, useModel as se, normalizeProps as ne, guardReactiveProps as le, withDirectives as J, vModelSelect as Ce, inject as $e, resolveDirective as be, vModelText as Me } from "vue";
1
+ import { defineComponent as g, createElementBlock as u, openBlock as a, unref as h, normalizeClass as $, createElementVNode as c, createBlock as v, createCommentVNode as M, toDisplayString as f, Fragment as k, renderList as L, mergeProps as B, computed as C, resolveComponent as me, withCtx as D, createTextVNode as S, ref as O, watch as te, onMounted as _e, renderSlot as N, resolveDynamicComponent as oe, createVNode as T, getCurrentInstance as we, toHandlerKey as de, camelize as ke, mergeDefaults as Q, mergeModels as q, useModel as se, normalizeProps as ne, guardReactiveProps as ae, withDirectives as J, vModelSelect as Ce, inject as $e, resolveDirective as be, vModelText as Me } from "vue";
2
2
  import { RouterLink as Pe } from "vue-router";
3
3
  const P = (...e) => `<svg
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -52,7 +52,7 @@ const Be = {
52
52
  Text: P(
53
53
  "M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"
54
54
  )
55
- }, Le = ["innerHTML"], E = /* @__PURE__ */ v({
55
+ }, Le = ["innerHTML"], E = /* @__PURE__ */ g({
56
56
  __name: "icon",
57
57
  props: {
58
58
  icon: {},
@@ -73,7 +73,7 @@ const Be = {
73
73
  }), Ae = { class: "dropdown dropdown-end" }, xe = {
74
74
  tabindex: "0",
75
75
  class: "menu dropdown-content bg-white z-1 mt-4 p-2 shadow-sm"
76
- }, De = { class: "min-w-max flex-no-wrap text-black" }, ae = /* @__PURE__ */ v({
76
+ }, De = { class: "min-w-max flex-no-wrap text-black" }, le = /* @__PURE__ */ g({
77
77
  __name: "sub-menu",
78
78
  props: {
79
79
  label: {},
@@ -91,7 +91,7 @@ const Be = {
91
91
  class: $([t.btnClass, "btn btn-ghost text-right flex-nowrap flex"])
92
92
  }, [
93
93
  c("span", null, f(t.label), 1),
94
- t.disableArrow ? M("", !0) : (a(), g(h(E), {
94
+ t.disableArrow ? M("", !0) : (a(), v(h(E), {
95
95
  key: 0,
96
96
  icon: h(H).ChevronDown,
97
97
  size: "sm"
@@ -99,14 +99,14 @@ const Be = {
99
99
  ], 2),
100
100
  c("ul", xe, [
101
101
  c("li", De, [
102
- (a(!0), u(k, null, L(t.items, (n) => (a(), g(fe, B({
102
+ (a(!0), u(k, null, L(t.items, (n) => (a(), v(fe, B({
103
103
  key: n.label
104
104
  }, { ref_for: !0 }, n), null, 16))), 128))
105
105
  ])
106
106
  ])
107
107
  ]));
108
108
  }
109
- }), G = "btn btn-ghost text-left justify-between min-w-max font-normal", fe = /* @__PURE__ */ v({
109
+ }), G = "btn btn-ghost text-left justify-between min-w-max font-normal", fe = /* @__PURE__ */ g({
110
110
  __name: "menu-item",
111
111
  props: {
112
112
  label: {},
@@ -130,7 +130,7 @@ const Be = {
130
130
  };
131
131
  return (l, m) => {
132
132
  const p = me("RouterLink");
133
- return s.value ? (a(), g(ae, B({ key: 0 }, t, { "btn-class": G }), null, 16)) : o.value ? (a(), g(p, {
133
+ return s.value ? (a(), v(le, B({ key: 0 }, t, { "btn-class": G }), null, 16)) : o.value ? (a(), v(p, {
134
134
  key: 1,
135
135
  to: r.value,
136
136
  class: $(G),
@@ -153,7 +153,7 @@ const Be = {
153
153
  }), Te = { class: "navbar bg-base-100 shadow-sm" }, Ve = { class: "flex-1" }, ze = {
154
154
  key: 0,
155
155
  class: "breadcrumbs text-sm"
156
- }, Se = { class: "flex grow justify-end px-2" }, Ne = { class: "flex items-stretch" }, eo = /* @__PURE__ */ v({
156
+ }, Se = { class: "flex grow justify-end px-2" }, Ne = { class: "flex items-stretch" }, eo = /* @__PURE__ */ g({
157
157
  __name: "menu",
158
158
  props: {
159
159
  menu: {},
@@ -169,7 +169,7 @@ const Be = {
169
169
  (a(!0), u(k, null, L(t.breadcrumbs, (s) => (a(), u("li", {
170
170
  key: s.label
171
171
  }, [
172
- s.routerLink ? (a(), g(n, {
172
+ s.routerLink ? (a(), v(n, {
173
173
  key: 0,
174
174
  to: { name: s.routerLink, params: s.params }
175
175
  }, {
@@ -186,7 +186,7 @@ const Be = {
186
186
  ]),
187
187
  c("div", Se, [
188
188
  c("div", Ne, [
189
- (a(!0), u(k, null, L(t.menu, (s) => (a(), g(fe, B({
189
+ (a(!0), u(k, null, L(t.menu, (s) => (a(), v(fe, B({
190
190
  key: s.label
191
191
  }, { ref_for: !0 }, s), null, 16))), 128))
192
192
  ])
@@ -194,14 +194,14 @@ const Be = {
194
194
  ]);
195
195
  };
196
196
  }
197
- }), to = /* @__PURE__ */ v({
197
+ }), to = /* @__PURE__ */ g({
198
198
  __name: "dropdown",
199
199
  props: {
200
200
  items: {}
201
201
  },
202
202
  setup(e) {
203
203
  const t = O(!0);
204
- return (o, n) => (a(), g(ae, {
204
+ return (o, n) => (a(), v(le, {
205
205
  items: o.items,
206
206
  label: "test",
207
207
  open: t.value,
@@ -236,7 +236,7 @@ function X(e, t, o) {
236
236
  throw new Error("Random bytes length must be >= 16");
237
237
  return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Ue(n);
238
238
  }
239
- const Ie = { class: "font-bold" }, Oe = { class: "pt-4" }, je = { class: "modal-action" }, Re = /* @__PURE__ */ v({
239
+ const Ie = { class: "font-bold" }, Oe = { class: "pt-4" }, je = { class: "modal-action" }, Re = /* @__PURE__ */ g({
240
240
  __name: "modal",
241
241
  props: {
242
242
  modalTitle: {},
@@ -313,7 +313,7 @@ const qe = {
313
313
  sm: "badge-sm text-xs",
314
314
  lg: "badge-sm text-xs",
315
315
  xl: "badge text-xs"
316
- }, R = /* @__PURE__ */ v({
316
+ }, R = /* @__PURE__ */ g({
317
317
  __name: "btn",
318
318
  props: {
319
319
  href: {},
@@ -329,7 +329,7 @@ const qe = {
329
329
  emits: ["click"],
330
330
  setup(e, { emit: t }) {
331
331
  const o = e, n = t;
332
- return (s, r) => (a(), g(oe(s.as), B({
332
+ return (s, r) => (a(), v(oe(s.as), B({
333
333
  class: [
334
334
  "btn p-1 flex justify-center flex-nowrap",
335
335
  h(qe)[s.color],
@@ -340,7 +340,7 @@ const qe = {
340
340
  onClick: r[0] || (r[0] = (b) => n("click"))
341
341
  }), {
342
342
  default: D(() => [
343
- s.icon ? (a(), g(h(E), {
343
+ s.icon ? (a(), v(h(E), {
344
344
  key: 0,
345
345
  icon: s.icon,
346
346
  size: s.size
@@ -350,7 +350,7 @@ const qe = {
350
350
  _: 3
351
351
  }, 16, ["class"]));
352
352
  }
353
- }), Ge = ["type", "disabled"], oo = /* @__PURE__ */ v({
353
+ }), Ge = ["type", "disabled"], oo = /* @__PURE__ */ g({
354
354
  __name: "btn-badge",
355
355
  props: {
356
356
  icon: { default: void 0 },
@@ -369,14 +369,14 @@ const qe = {
369
369
  onClick: s[0] || (s[0] = (r) => o("click"))
370
370
  }, [
371
371
  N(n.$slots, "default"),
372
- n.icon ? (a(), g(h(E), {
372
+ n.icon ? (a(), v(h(E), {
373
373
  key: 0,
374
374
  icon: n.icon,
375
375
  size: n.size
376
376
  }, null, 8, ["icon", "size"])) : M("", !0)
377
377
  ], 10, Ge));
378
378
  }
379
- }), Je = /* @__PURE__ */ v({
379
+ }), Je = /* @__PURE__ */ g({
380
380
  __name: "confirmModal",
381
381
  props: {
382
382
  title: {},
@@ -389,7 +389,7 @@ const qe = {
389
389
  const o = t, n = (s) => {
390
390
  o("closeModal", { confirmed: s });
391
391
  };
392
- return (s, r) => (a(), g(Re, {
392
+ return (s, r) => (a(), v(Re, {
393
393
  "modal-title": s.title,
394
394
  open: !0,
395
395
  "disable-close": !0
@@ -453,13 +453,13 @@ class ie {
453
453
  this.modals = [], this.showModal.value = !1;
454
454
  }
455
455
  }
456
- const Qe = /* @__PURE__ */ v({
456
+ const Qe = /* @__PURE__ */ g({
457
457
  __name: "modalWrapper",
458
458
  setup(e) {
459
459
  const t = ie.getInstance(), o = C(() => t.showModal.value ? t.modals : []);
460
460
  return (n, s) => (a(!0), u(k, null, L(o.value, (r) => {
461
461
  var b;
462
- return a(), g(oe(r == null ? void 0 : r.component), B({
462
+ return a(), v(oe(r == null ? void 0 : r.component), B({
463
463
  key: r.id,
464
464
  ref_for: !0
465
465
  }, r == null ? void 0 : r.props, {
@@ -468,7 +468,7 @@ const Qe = /* @__PURE__ */ v({
468
468
  }), null, 16, ["onCloseModal"]);
469
469
  }), 128));
470
470
  }
471
- }), Xe = /* @__PURE__ */ v({
471
+ }), Xe = /* @__PURE__ */ g({
472
472
  __name: "notification-message",
473
473
  props: {
474
474
  message: {},
@@ -526,21 +526,21 @@ class ce {
526
526
  this.getInstance().removeNotification(t);
527
527
  }
528
528
  }
529
- const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__ */ v({
529
+ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__ */ g({
530
530
  __name: "notifications",
531
531
  setup(e) {
532
532
  const t = ce.getInstance();
533
533
  return (o, n) => (a(), u("div", et, [
534
- (a(!0), u(k, null, L(h(t).notifications.value, (s) => (a(), g(Xe, B({
534
+ (a(!0), u(k, null, L(h(t).notifications.value, (s) => (a(), v(Xe, B({
535
535
  key: s.id
536
536
  }, { ref_for: !0 }, s), null, 16))), 128))
537
537
  ]));
538
538
  }
539
- }), ot = { class: "drawer" }, st = { class: "drawer-content flex flex-col h-[100VH]" }, nt = { class: "navbar bg-primary text-primary-content w-full z-100" }, lt = { class: "navbar-start" }, at = {
539
+ }), ot = { class: "drawer" }, st = { class: "drawer-content flex flex-col h-[100VH]" }, nt = { class: "navbar bg-primary text-primary-content w-full z-100" }, at = { class: "navbar-start" }, lt = {
540
540
  for: "my-drawer-3",
541
541
  "aria-label": "open sidebar",
542
542
  class: "btn btn-square btn-ghost p-1"
543
- }, rt = { class: "navbar-center" }, it = ["href"], ct = { class: "navbar-end" }, ut = { class: "p-2 bg-white mb-1 mr-1 flex-1 shadow-sm" }, dt = { class: "drawer-side no-overflow" }, pt = { class: "menu min-h-full h-full flex-col space-between m-0 !p-0 !pt-16" }, mt = { class: "flex-grow-1 w-52 bg-base-200 p-4" }, bt = { class: "bg-base-200 p-4" }, so = /* @__PURE__ */ v({
543
+ }, rt = { class: "navbar-center" }, it = ["href"], ct = { class: "navbar-end" }, ut = { class: "p-2 bg-white mb-1 mr-1 flex-1 shadow-sm" }, dt = { class: "drawer-side no-overflow" }, pt = { class: "menu min-h-full h-full flex-col space-between m-0 !p-0 !pt-16" }, mt = { class: "flex-grow-1 w-52 bg-base-200 p-4" }, bt = { class: "bg-base-200 p-4" }, so = /* @__PURE__ */ g({
544
544
  __name: "shell.component",
545
545
  props: {
546
546
  title: {},
@@ -572,8 +572,8 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
572
572
  }, null, -1)),
573
573
  c("div", st, [
574
574
  c("nav", nt, [
575
- c("div", lt, [
576
- c("label", at, [
575
+ c("div", at, [
576
+ c("label", lt, [
577
577
  T(h(E), {
578
578
  icon: h(H).Hamburger
579
579
  }, null, 8, ["icon"])
@@ -586,7 +586,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
586
586
  }, f(b.title), 9, it)
587
587
  ]),
588
588
  c("div", ct, [
589
- r.value ? (a(), g(h(ae), B({ key: 0 }, r.value, { "btn-class": "" }), null, 16)) : M("", !0)
589
+ r.value ? (a(), v(h(le), B({ key: 0 }, r.value, { "btn-class": "" }), null, 16)) : M("", !0)
590
590
  ])
591
591
  ]),
592
592
  c("div", ut, [
@@ -620,7 +620,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
620
620
  ])
621
621
  ], 64));
622
622
  }
623
- }), W = /* @__PURE__ */ v({
623
+ }), W = /* @__PURE__ */ g({
624
624
  __name: "pagination-button.component",
625
625
  props: {
626
626
  currentPage: {},
@@ -636,7 +636,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
636
636
  ), r = C(() => o.neverActive ? j.blank : s.value ? j.primary : j.secondary), b = () => {
637
637
  n("updatePage", o.page);
638
638
  };
639
- return (l, m) => (a(), g(h(R), {
639
+ return (l, m) => (a(), v(h(R), {
640
640
  disabled: l.disabled,
641
641
  square: !0,
642
642
  size: "xs",
@@ -649,7 +649,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
649
649
  _: 1
650
650
  }, 8, ["disabled", "color"]));
651
651
  }
652
- }), ft = { class: "flex gap-2" }, ht = { class: "flex flex-1 justify-center items-center" }, gt = { class: "flex gap-1" }, vt = { class: "text-sm" }, Z = 6, yt = /* @__PURE__ */ v({
652
+ }), ft = { class: "flex gap-2" }, ht = { class: "flex flex-1 justify-center items-center" }, vt = { class: "flex gap-1" }, gt = { class: "text-sm" }, Z = 6, yt = /* @__PURE__ */ g({
653
653
  __name: "pagination.component",
654
654
  props: {
655
655
  totalItems: { type: Number, default: 0 },
@@ -698,7 +698,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
698
698
  };
699
699
  return (i, A) => (a(), u("div", ft, [
700
700
  c("div", ht, [
701
- c("div", gt, [
701
+ c("div", vt, [
702
702
  T(W, B(o, {
703
703
  page: 1,
704
704
  label: "<<",
@@ -715,7 +715,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
715
715
  disabled: e.currentPage === 1,
716
716
  onUpdatePage: p
717
717
  }), null, 16, ["page", "current-page", "disabled"]),
718
- (a(!0), u(k, null, L(m.value, (V) => (a(), g(W, B({
718
+ (a(!0), u(k, null, L(m.value, (V) => (a(), v(W, B({
719
719
  key: V.page,
720
720
  ref_for: !0
721
721
  }, V, { onUpdatePage: p }), null, 16))), 128)),
@@ -737,10 +737,10 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
737
737
  }), null, 16, ["page", "current-page", "disabled"])
738
738
  ])
739
739
  ]),
740
- c("div", vt, " page " + f(e.currentPage) + " of " + f(s.value), 1)
740
+ c("div", gt, " page " + f(e.currentPage) + " of " + f(s.value), 1)
741
741
  ]));
742
742
  }
743
- }), ge = (e, t) => {
743
+ }), ve = (e, t) => {
744
744
  const o = e.__vccOpts || e;
745
745
  for (const [n, s] of t)
746
746
  o[n] = s;
@@ -758,7 +758,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
758
758
  type: Object,
759
759
  required: !1
760
760
  }
761
- }), wt = v({
761
+ }), wt = g({
762
762
  name: "TextCell",
763
763
  props: {
764
764
  ..._t()
@@ -774,7 +774,7 @@ const et = { class: "toast toast-top toast-center z-[999]" }, tt = /* @__PURE__
774
774
  function Ct(e, t, o, n, s, r) {
775
775
  return f(e.value);
776
776
  }
777
- const no = /* @__PURE__ */ ge(kt, [["render", Ct]]), $t = { class: "flex-grow pr-2" }, Mt = { class: "h-4 w-4" }, Pt = /* @__PURE__ */ v({
777
+ const no = /* @__PURE__ */ ve(kt, [["render", Ct]]), $t = { class: "flex-grow pr-2" }, Mt = { class: "h-4 w-4" }, Pt = /* @__PURE__ */ g({
778
778
  __name: "sort.header",
779
779
  props: {
780
780
  column: {},
@@ -797,14 +797,14 @@ const no = /* @__PURE__ */ ge(kt, [["render", Ct]]), $t = { class: "flex-grow pr
797
797
  }, [
798
798
  c("span", $t, f(l.column.label), 1),
799
799
  c("div", Mt, [
800
- l.sortColumn === s.value ? (a(), g(h(E), {
800
+ l.sortColumn === s.value ? (a(), v(h(E), {
801
801
  key: 0,
802
802
  icon: n.value
803
803
  }, null, 8, ["icon"])) : M("", !0)
804
804
  ])
805
805
  ]));
806
806
  }
807
- }), Bt = { class: "table w-full" }, Lt = { key: 0 }, At = ["colspan"], xt = { class: "flex gap-2" }, lo = /* @__PURE__ */ v({
807
+ }), Bt = { class: "table w-full" }, Lt = { key: 0 }, At = ["colspan"], xt = { class: "flex gap-2" }, ao = /* @__PURE__ */ g({
808
808
  __name: "table.component",
809
809
  props: {
810
810
  loading: { type: Boolean },
@@ -817,9 +817,9 @@ const no = /* @__PURE__ */ ge(kt, [["render", Ct]]), $t = { class: "flex-grow pr
817
817
  emits: ["delete", "edit", "updatePage", "sort"],
818
818
  setup(e, { emit: t }) {
819
819
  const o = t, n = (l) => {
820
- console.log("edit me", l), o("edit", l);
820
+ o("edit", l);
821
821
  }, s = (l) => {
822
- console.log("delete me", l), o("delete", l);
822
+ o("delete", l);
823
823
  }, r = (l) => {
824
824
  o("updatePage", l);
825
825
  }, b = (l) => {
@@ -852,14 +852,14 @@ const no = /* @__PURE__ */ ge(kt, [["render", Ct]]), $t = { class: "flex-grow pr
852
852
  (a(!0), u(k, null, L(l.displayColumns, (i) => (a(), u("td", {
853
853
  key: i.scope
854
854
  }, [
855
- (a(), g(oe(i.component), B({ ref_for: !0 }, i, {
855
+ (a(), v(oe(i.component), B({ ref_for: !0 }, i, {
856
856
  data: p,
857
857
  column: i
858
858
  }), null, 16, ["data", "column"]))
859
859
  ]))), 128)),
860
860
  c("td", null, [
861
861
  c("span", xt, [
862
- (a(!0), u(k, null, L(l.actions, (i) => (a(), g(R, {
862
+ (a(!0), u(k, null, L(l.actions, (i) => (a(), v(R, {
863
863
  key: i.label,
864
864
  icon: i.icon,
865
865
  outline: !0,
@@ -885,7 +885,7 @@ const no = /* @__PURE__ */ ge(kt, [["render", Ct]]), $t = { class: "flex-grow pr
885
885
  ]))), 128))
886
886
  ])
887
887
  ]),
888
- l.page ? (a(), g(yt, {
888
+ l.page ? (a(), v(yt, {
889
889
  key: 0,
890
890
  class: "border-gray-300 border-t pt-4 border-x-0 border-b-0",
891
891
  "total-items": l.page.count,
@@ -918,7 +918,7 @@ function Nt(e, t) {
918
918
  ])
919
919
  ]);
920
920
  }
921
- const ao = /* @__PURE__ */ ge(Dt, [["render", Nt]]), ro = (e, t) => {
921
+ const lo = /* @__PURE__ */ ve(Dt, [["render", Nt]]), ro = (e, t) => {
922
922
  if (!e) return null;
923
923
  const o = (n) => {
924
924
  e.contains(n.target) || t();
@@ -989,7 +989,7 @@ const Ut = {
989
989
  options: [],
990
990
  valueKey: "value",
991
991
  labelKey: "label"
992
- }), Ht = (e, t, o) => !!(e && o), Kt = (e, t, o, n) => t === void 0 || t !== void 0 && !e || !n && !o, It = { key: 0 }, ue = /* @__PURE__ */ v({
992
+ }), Ht = (e, t, o) => !!(e && o), Kt = (e, t, o, n) => t === void 0 || t !== void 0 && !e || !n && !o, It = { key: 0 }, ue = /* @__PURE__ */ g({
993
993
  __name: "ControlWrapper",
994
994
  props: /* @__PURE__ */ Q({
995
995
  id: {},
@@ -1031,7 +1031,7 @@ const Ut = {
1031
1031
  }, f(s.value ? r.errors : o.value ? r.description : null), 3)
1032
1032
  ], 2));
1033
1033
  }
1034
- }), Ot = ["disabled"], jt = ["value"], po = /* @__PURE__ */ v({
1034
+ }), Ot = ["disabled"], jt = ["value"], po = /* @__PURE__ */ g({
1035
1035
  __name: "SelectComponent",
1036
1036
  props: /* @__PURE__ */ q(/* @__PURE__ */ Q({
1037
1037
  id: {},
@@ -1066,7 +1066,7 @@ const Ut = {
1066
1066
  }, l = (m) => {
1067
1067
  n("blur", m);
1068
1068
  };
1069
- return (m, p) => (a(), g(ue, ne(le(o)), {
1069
+ return (m, p) => (a(), v(ue, ne(ae(o)), {
1070
1070
  default: D(() => [
1071
1071
  J(c("select", {
1072
1072
  "onUpdate:modelValue": p[0] || (p[0] = (i) => s.value = i),
@@ -1155,7 +1155,7 @@ const Ut = {
1155
1155
  `bg-base-100 w-52 shadow -mt-5
1156
1156
  absolute z-50`
1157
1157
  ])
1158
- }, Zt = ["onClick", "onBlur"], mo = /* @__PURE__ */ v({
1158
+ }, Zt = ["onClick", "onBlur"], mo = /* @__PURE__ */ g({
1159
1159
  __name: "AutoComplete",
1160
1160
  props: /* @__PURE__ */ q(/* @__PURE__ */ Q({
1161
1161
  id: {},
@@ -1215,7 +1215,7 @@ const Ut = {
1215
1215
  }
1216
1216
  ), (d, _) => {
1217
1217
  const I = be("click-outside");
1218
- return a(), g(ue, ne(le(o)), {
1218
+ return a(), v(ue, ne(ae(o)), {
1219
1219
  default: D(() => {
1220
1220
  var x;
1221
1221
  return [
@@ -1232,14 +1232,14 @@ const Ut = {
1232
1232
  ]),
1233
1233
  J((a(), u("div", null, [
1234
1234
  (x = i.value) != null && x.length ? (a(), u("ul", Wt, [
1235
- (a(!0), u(k, null, L(i.value, (F, ve) => (a(), u("li", {
1235
+ (a(!0), u(k, null, L(i.value, (F, ge) => (a(), u("li", {
1236
1236
  key: F[d.valueKey]
1237
1237
  }, [
1238
1238
  c("button", {
1239
1239
  class: "w-full h-8 border-b-1 border-gray-200 border-x-0 border-t-0 px-4 py-2 text-left hover:bg-primary-content cursor-pointer",
1240
1240
  type: "button",
1241
1241
  onClick: (ye) => A(F),
1242
- onBlur: (ye) => U(ve)
1242
+ onBlur: (ye) => U(ge)
1243
1243
  }, f(z(F)), 41, Zt)
1244
1244
  ]))), 128))
1245
1245
  ])) : M("", !0)
@@ -1258,7 +1258,7 @@ const Ut = {
1258
1258
  `bg-base-100 w-52 shadow -mt-5
1259
1259
  absolute z-50 p-0`
1260
1260
  ])
1261
- }, Jt = ["onClick"], Qt = { class: "w-4 mr-2" }, bo = /* @__PURE__ */ v({
1261
+ }, Jt = ["onClick"], Qt = { class: "w-4 mr-2" }, bo = /* @__PURE__ */ g({
1262
1262
  __name: "MultiSelect",
1263
1263
  props: /* @__PURE__ */ q(/* @__PURE__ */ Q({
1264
1264
  id: {},
@@ -1306,7 +1306,7 @@ const Ut = {
1306
1306
  }, U = (y) => y[o.valueKey], K = (y) => (y == null ? void 0 : y[o.labelKey]) ?? "";
1307
1307
  return (y, z) => {
1308
1308
  const d = be("click-outside");
1309
- return a(), g(ue, ne(le(o)), {
1309
+ return a(), v(ue, ne(ae(o)), {
1310
1310
  default: D(() => {
1311
1311
  var _, I;
1312
1312
  return [
@@ -1326,7 +1326,7 @@ const Ut = {
1326
1326
  onClick: (F) => V(F, x)
1327
1327
  }, [
1328
1328
  c("div", Qt, [
1329
- A(U(x)) ? (a(), g(h(E), {
1329
+ A(U(x)) ? (a(), v(h(E), {
1330
1330
  key: 0,
1331
1331
  icon: h(H).Check,
1332
1332
  size: "sm"
@@ -1352,7 +1352,7 @@ export {
1352
1352
  R as Btn,
1353
1353
  oo as BtnBadge,
1354
1354
  We as ButtonSize,
1355
- ao as Card,
1355
+ lo as Card,
1356
1356
  co as ClickOutside,
1357
1357
  j as Color,
1358
1358
  Je as ConfirmModal,
@@ -1374,9 +1374,9 @@ export {
1374
1374
  yt as PaginationComponent,
1375
1375
  po as SelectComponent,
1376
1376
  so as ShellComponent,
1377
- ae as SubMenu,
1378
- lo as Table,
1379
- lo as TableComponent,
1377
+ le as SubMenu,
1378
+ ao as Table,
1379
+ ao as TableComponent,
1380
1380
  no as TextCell,
1381
1381
  ro as addClickOutsideEventListener,
1382
1382
  uo as hasCustomEventListener,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ghentcdh/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {