UNPKG

@insightphp/panels

Version:
108 lines (107 loc) 4.1 kB
import { openBlock as t, createElementBlock as n, createElementVNode as l, defineComponent as d, toDisplayString as a, createCommentVNode as o, createBlock as r, unref as i, Fragment as h, renderList as _, renderSlot as y, createVNode as f } from "vue"; import { Portal as c, registerComponents as g } from "@insightphp/inertia-view"; function x(e, s) { return t(), n("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", "aria-hidden": "true" }, [ l("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 b = { class: "border border-gray-200 rounded-md bg-white" }, v = { key: 0, class: "border-b border-gray-200 flex flex-row items-center justify-between py-3 px-4" }, p = { class: "inline-flex flex-col" }, w = { class: "inline-flex items-center gap-2" }, k = { key: 0, class: "text-lg font-semibold text-gray-900" }, P = { key: 0, class: "text-sm text-gray-600 mt-1" }, j = { class: "inline-flex gap-3" }, C = { key: 1, class: "flex flex-col divide-y divide-gray-200" }, S = { class: "flex items-center flex-col py-10" }, M = { class: "inline-flex relative items-center justify-center w-14 h-14" }, O = /* @__PURE__ */ l("div", { class: "absolute w-14 h-14 block bg-primary-50 rounded-full" }, null, -1), V = /* @__PURE__ */ l("div", { class: "absolute w-10 h-10 block bg-primary-100 rounded-full" }, null, -1), $ = /* @__PURE__ */ l("h5", { class: "text-gray-900 font-semibold mt-2" }, "The panel is empty.", -1), B = /* @__PURE__ */ l("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), T = /* @__PURE__ */ d({ __name: "Panel", props: { title: null, subtitle: null, actions: null, items: null }, setup(e) { return (s, u) => (t(), n("div", b, [ e.actions || e.title || e.subtitle ? (t(), n("div", v, [ l("div", p, [ l("div", w, [ e.title ? (t(), n("h4", k, a(e.title), 1)) : o("", !0) ]), e.subtitle ? (t(), n("p", P, a(e.subtitle), 1)) : o("", !0) ]), l("div", j, [ e.actions ? (t(), r(i(c), { key: 0, component: e.actions }, null, 8, ["component"])) : o("", !0) ]) ])) : o("", !0), e.items.length > 0 ? (t(), n("div", C, [ (t(!0), n(h, null, _(e.items, (m) => (t(), r(i(c), { component: m }, null, 8, ["component"]))), 256)) ])) : y(s.$slots, "empty", { key: 2 }, () => [ l("div", S, [ l("div", M, [ O, V, f(i(x), { class: "absolute w-5 h-5 text-primary-600" }) ]), $, B ]) ]) ])); } }), z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: T }, Symbol.toStringTag, { value: "Module" })), N = { class: "w-full odd:bg-gray-50 flex flex-row px-4 py-3" }, R = { class: "w-1/3" }, E = { key: 0, class: "text-sm text-gray-600" }, A = /* @__PURE__ */ d({ __name: "PanelRow", props: { title: null, value: null }, setup(e) { return (s, u) => (t(), n("div", N, [ l("div", R, [ e.title ? (t(), n("span", E, a(e.title), 1)) : o("", !0) ]), l("div", null, [ e.value ? (t(), r(i(c), { key: 0, component: e.value }, null, 8, ["component"])) : o("", !0) ]) ])); } }), D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: A }, Symbol.toStringTag, { value: "Module" })), L = { install(e, s) { g(/* @__PURE__ */ Object.assign({ "./View/Components/Panel.vue": z, "./View/Components/PanelRow.vue": D }), "insight-panels"); } }; export { T as Panel, A as PanelRow, L as Panels };