bootstrap-vue-wrapper
Version:
Bootstrap 5 components in Vue3 wrapper.
99 lines (98 loc) • 3.71 kB
JavaScript
import C from "./BsTable.vue2.js";
import { openBlock as t, createElementBlock as o, createElementVNode as r, Fragment as n, renderList as d, normalizeClass as k, renderSlot as i, createTextVNode as c, toDisplayString as p, createCommentVNode as y } from "vue";
import './BsTable.css';/* empty css */
import h from "../../_virtual/_plugin-vue_export-helper.js";
const m = { class: "table" }, v = ["onClick"], g = { key: 0 }, $ = ["colspan"], b = { key: 1 }, w = ["colspan"], f = ["textContent"], L = ["data-id", "onClick"], B = { key: 0 }, S = ["colspan"];
function T(e, u, D, N, V, A) {
return t(), o("table", m, [
r("thead", null, [
r("tr", null, [
(t(!0), o(n, null, d(e.fields, (s) => (t(), o("th", {
key: s.key,
class: k({
"cursor-pointer": e.isSortableField(s),
"active-order-by": e.isActiveOrderBy(s.key),
thClass: e.thClass
}),
onClick: (a) => e.onHeadClick(s)
}, [
i(e.$slots, "tr", {}, () => [
c(p(s.label) + " ", 1),
e.isActiveOrderBy(s.key) && e.sortDesc !== void 0 ? (t(), o("i", {
key: 0,
class: k(e.getSortIconClass())
}, null, 2)) : y("", !0)
], !0)
], 10, v))), 128))
])
]),
r("tbody", null, [
e.isLoading ? (t(), o(n, { key: 0 }, [
e.skeletonLoading ? (t(!0), o(n, { key: 1 }, d(e.skeletonLoadingRowCount, (s) => (t(), o("tr", { key: s }, [
(t(!0), o(n, null, d(e.fields, (a) => (t(), o("td", {
key: a.key
}, [...u[1] || (u[1] = [
r("div", { class: "bs-skeleton-line" }, null, -1)
])]))), 128))
]))), 128)) : (t(), o("tr", g, [
r("td", {
colspan: e.fields.length
}, [
i(e.$slots, "loading", {}, () => [
u[0] || (u[0] = r("div", { class: "d-flex justify-content-center p-2" }, [
r("div", { class: "spinner-border spinner-border-sm" })
], -1))
], !0)
], 8, $)
]))
], 64)) : e.items.length === 0 ? (t(), o("tr", b, [
r("td", {
colspan: e.fields.length
}, [
i(e.$slots, "empty", {}, () => [
e.emptyText !== void 0 ? (t(), o("div", {
key: 0,
class: "text-center text-muted small",
textContent: p(e.emptyText)
}, null, 8, f)) : y("", !0)
], !0)
], 8, w)
])) : (t(!0), o(n, { key: 2 }, d(e.items, (s, a) => (t(), o(n, { key: a }, [
r("tr", {
class: k([s.trClass || "", { "cursor-pointer": e.rowClickable }]),
"data-id": s.id,
onClick: (l) => e.$emit("rowClicked", s)
}, [
(t(!0), o(n, null, d(e.fields, (l) => (t(), o(n, {
key: l.key
}, [
e.isLoading ? y("", !0) : (t(), o("td", {
key: 0,
class: k(l.tdClass || e.tdClass)
}, [
i(e.$slots, "td", {
index: a,
field: l.key,
row: s,
value: l.key in s ? s[l.key] : null
}, () => [
c(p(s[l.key]), 1)
], !0)
], 2))
], 64))), 128))
], 10, L),
s._showRowDetails && !e.isLoading ? (t(), o("tr", B, [
r("td", {
colspan: e.fields.length
}, [
i(e.$slots, "row-details", { row: s }, void 0, !0)
], 8, S)
])) : y("", !0)
], 64))), 128))
])
]);
}
const R = /* @__PURE__ */ h(C, [["render", T], ["__scopeId", "data-v-cc113810"]]);
export {
R as default
};