UNPKG

@insightphp/panels

Version:
2 lines (1 loc) 3.98 kB
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@insightphp/inertia-view")):typeof define=="function"&&define.amd?define(["exports","vue","@insightphp/inertia-view"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.Panels={},n.Vue,n.InertiaViewComponents))})(this,function(n,e,o){"use strict";function i(t,l){return e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 010 3.75H5.625a1.875 1.875 0 010-3.75z"})])}const r={class:"border border-gray-200 rounded-md bg-white"},a={key:0,class:"border-b border-gray-200 flex flex-row items-center justify-between py-3 px-4"},d={class:"inline-flex flex-col"},m={class:"inline-flex items-center gap-2"},h={key:0,class:"text-lg font-semibold text-gray-900"},f={key:0,class:"text-sm text-gray-600 mt-1"},p={class:"inline-flex gap-3"},y={key:1,class:"flex flex-col divide-y divide-gray-200"},_={class:"flex items-center flex-col py-10"},k={class:"inline-flex relative items-center justify-center w-14 h-14"},g=e.createElementVNode("div",{class:"absolute w-14 h-14 block bg-primary-50 rounded-full"},null,-1),b=e.createElementVNode("div",{class:"absolute w-10 h-10 block bg-primary-100 rounded-full"},null,-1),u=e.createElementVNode("h5",{class:"text-gray-900 font-semibold mt-2"},"The panel is empty.",-1),x=e.createElementVNode("p",{class:"text-sm text-gray-600 max-w-sm text-center mt-1"},"The panel does not have any items. Add fields to you resource to display on the panel or disable the panel on the resource.",-1),c=e.defineComponent({__name:"Panel",props:{title:null,subtitle:null,actions:null,items:null},setup(t){return(l,C)=>(e.openBlock(),e.createElementBlock("div",r,[t.actions||t.title||t.subtitle?(e.openBlock(),e.createElementBlock("div",a,[e.createElementVNode("div",d,[e.createElementVNode("div",m,[t.title?(e.openBlock(),e.createElementBlock("h4",h,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0)]),t.subtitle?(e.openBlock(),e.createElementBlock("p",f,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",p,[t.actions?(e.openBlock(),e.createBlock(e.unref(o.Portal),{key:0,component:t.actions},null,8,["component"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),t.items.length>0?(e.openBlock(),e.createElementBlock("div",y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,j=>(e.openBlock(),e.createBlock(e.unref(o.Portal),{component:j},null,8,["component"]))),256))])):e.renderSlot(l.$slots,"empty",{key:2},()=>[e.createElementVNode("div",_,[e.createElementVNode("div",k,[g,b,e.createVNode(e.unref(i),{class:"absolute w-5 h-5 text-primary-600"})]),u,x])])]))}}),B=Object.freeze(Object.defineProperty({__proto__:null,default:c},Symbol.toStringTag,{value:"Module"})),w={class:"w-full odd:bg-gray-50 flex flex-row px-4 py-3"},E={class:"w-1/3"},V={key:0,class:"text-sm text-gray-600"},s=e.defineComponent({__name:"PanelRow",props:{title:null,value:null},setup(t){return(l,C)=>(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",E,[t.title?(e.openBlock(),e.createElementBlock("span",V,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",null,[t.value?(e.openBlock(),e.createBlock(e.unref(o.Portal),{key:0,component:t.value},null,8,["component"])):e.createCommentVNode("",!0)])]))}}),N=Object.freeze(Object.defineProperty({__proto__:null,default:s},Symbol.toStringTag,{value:"Module"})),P={install(t,l){o.registerComponents(Object.assign({"./View/Components/Panel.vue":B,"./View/Components/PanelRow.vue":N}),"insight-panels")}};n.Panel=c,n.PanelRow=s,n.Panels=P,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});