@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
67 lines (66 loc) • 2.59 kB
JavaScript
import { defineComponent as F, inject as _, computed as n, openBlock as l, createElementBlock as x, normalizeClass as B, normalizeStyle as L, Fragment as v, renderList as y, createBlock as g, withCtx as W } from "vue";
import "./table-foot-cell.vue.mjs";
import "./table-row.vue.mjs";
import { useNameHelper as E } from "@vexip-ui/config";
import { getLast as d } from "@vexip-ui/utils";
import { TABLE_STORE as R } from "./symbol.mjs";
import T from "./table-row.vue2.mjs";
import $ from "./table-foot-cell.vue2.mjs";
const K = /* @__PURE__ */ F({
name: "TableFoot",
__name: "table-foot",
props: {
fixed: {
type: String,
default: null
},
above: {
type: Boolean,
default: !1
}
},
setup(m) {
const o = m, { state: e, getters: u, mutations: p } = _(R), b = E("table"), f = n(() => o.fixed === "left" ? e.leftFixedColumns : o.fixed === "right" ? e.rightFixedColumns : e.normalColumns), h = n(() => o.above ? e.aboveSummaries : e.belowSummaries), w = n(() => h.value.map((a) => {
const i = p.buildSummaryKey(a.key), t = e.rowMap.get(i) || p.createMinRowState(i);
return { summary: a, row: t };
})), k = n(() => [b.be("foot"), b.bem("foot", o.above ? "above" : "below")]), S = n(() => {
var s, r;
const a = o.fixed === "left" ? d(u.leftFixedWidths) : o.fixed === "right" ? d(u.rightFixedWidths) : d(u.normalWidths), i = ((s = f.value[0]) == null ? void 0 : s.fixed) === "left" && e.sidePadding[0] || 0, t = ((r = d(f.value)) == null ? void 0 : r.fixed) === "right" && e.sidePadding[1] || 0;
return {
minWidth: a && `${a + i + t}px`
};
});
return (a, i) => (l(), x("div", {
class: B(k.value),
role: "rowgroup",
style: L(S.value)
}, [
(l(!0), x(v, null, y(w.value, ({ row: t, summary: s }, r) => (l(), g(T, {
key: t.key,
"is-foot": "",
fixed: m.fixed,
row: t,
"aria-rowindex": r
}, {
default: W(() => [
(l(!0), x(v, null, y(f.value, (C, c) => (l(), g($, {
key: c,
row: t,
column: C,
"col-index": c,
summary: s,
"summary-index": r,
fixed: m.fixed,
above: m.above,
"aria-colindex": c
}, null, 8, ["row", "column", "col-index", "summary", "summary-index", "fixed", "above", "aria-colindex"]))), 128))
]),
_: 2
}, 1032, ["fixed", "row", "aria-rowindex"]))), 128))
], 6));
}
});
export {
K as default
};
//# sourceMappingURL=table-foot.vue2.mjs.map