vue-amazing-ui
Version:
An Amazing Vue3 UI Components Library, Using TypeScript.
1,029 lines • 59.6 kB
JavaScript
import { defineComponent as zl, ref as f, computed as v, watch as we, watchEffect as He, onMounted as Nl, nextTick as fl, createElementBlock as n, openBlock as o, createVNode as D, unref as b, mergeProps as k, withCtx as A, createElementVNode as d, createBlock as H, createCommentVNode as c, normalizeClass as x, renderSlot as S, createTextVNode as $, toDisplayString as E, normalizeStyle as h, Fragment as w, renderList as K, isVNode as dl, resolveDynamicComponent as vl, withDirectives as cl, withModifiers as pl, vShow as hl } from "vue";
import Al from "../spin/index.js";
import Ce from "../empty/index.js";
import yl from "../scrollbar/index.js";
import xe from "../checkbox/index.js";
import gl from "../radio/index.js";
import bl from "../tooltip/index.js";
import Z from "../ellipsis/index.js";
import Hl from "../pagination/index.js";
import { useSlotsExist as Kl, useResizeObserver as Ol } from "../utils/index.js";
const Ul = {
key: 0,
class: "table-header"
}, Vl = ["rowspan"], ml = ["rowspan"], Gl = {
key: 1,
class: "table-selection"
}, Xl = ["rowspan", "colspan", "colstart", "colend", "onMouseenter", "onMouseleave", "onClick"], jl = { class: "table-cell-sorter" }, ql = { class: "table-cell-title" }, Jl = { key: 0 }, Ql = ["colspan"], Yl = ["onMouseenter", "onClick"], Zl = ["onClick"], Il = { class: "table-selection" }, et = { key: 0 }, lt = ["colspan"], tt = ["rowspan"], at = ["rowspan"], st = {
key: 1,
class: "table-selection"
}, it = ["rowspan", "colspan", "colstart", "colend", "title", "onMouseenter", "onMouseleave", "onClick"], ot = { class: "table-cell-sorter" }, nt = { class: "table-cell-title" }, rt = { key: 0 }, ut = ["colspan"], ft = ["onMouseenter", "onClick"], dt = ["onClick"], vt = { class: "table-selection" }, ct = { key: 0 }, pt = ["colspan"], ht = {
key: 3,
class: "table-footer"
}, Et = /* @__PURE__ */ zl({
__name: "Table",
props: {
header: { default: void 0 },
footer: { default: void 0 },
columns: { default: () => [] },
dataSource: { default: () => [] },
bordered: { type: Boolean, default: !1 },
rowClassName: { type: [String, Function], default: void 0 },
size: { default: "large" },
striped: { type: Boolean, default: !1 },
loading: { type: Boolean, default: !1 },
spinProps: { default: () => ({}) },
emptyProps: { default: () => ({}) },
ellipsisProps: { default: () => ({}) },
showSorterTooltip: { type: Boolean, default: !0 },
sortDirections: { default: () => ["ascend", "descend"] },
sortTooltipProps: { default: () => ({}) },
sticky: { type: Boolean, default: !1 },
showPagination: { type: Boolean, default: !0 },
pagination: { default: () => ({}) },
rowSelection: { default: void 0 },
scroll: { default: void 0 },
scrollbarProps: { default: () => ({}) },
tableLayout: { default: void 0 },
showExpandColumn: { type: Boolean, default: !1 },
expandColumnTitle: { default: void 0 },
expandColumnWidth: { default: 48 },
expandCell: { default: void 0 },
expandedRowRender: { default: void 0 },
expandFixed: { type: Boolean, default: !1 },
expandedRowKeys: { default: () => [] },
expandRowByClick: { type: Boolean, default: !1 }
},
emits: ["expand", "expandedRowsChange", "update:expandedRowKeys", "sortChange", "change"],
setup(kl, { emit: Sl }) {
const i = kl, Ke = f(), j = f(1), q = f(10), V = f(), Re = f([]), W = f([]), R = f([]), I = f(!1), $e = f(!1), y = f([]), T = f([]), ie = f([]), _ = f([]), oe = f([]), ne = f(), m = f(), J = f(), O = f(0), ee = f(0), Ee = f(0), G = f(0), Pe = f(0), Te = f(0), le = f(), Le = f(), X = f(), B = f([]), re = f(!1), Oe = f(null), C = f(null), U = f(null), P = f(null), ue = f(null), We = f(!1), Ue = Kl(["header", "footer"]), te = Sl, z = v(() => i.rowSelection !== void 0), Ve = v(() => {
var e;
return (e = i.rowSelection) == null ? void 0 : e.columnTitle;
}), me = v(() => {
var e, a;
return !((e = i.rowSelection) != null && e.hideSelectAll) && ((a = i.rowSelection) == null ? void 0 : a.type) !== "radio";
}), _e = v(() => {
var e;
return ((e = i.scroll) == null ? void 0 : e.x) !== void 0;
}), N = v(() => _e.value && ee.value > G.value), ae = v(() => {
var e;
return ((e = i.scroll) == null ? void 0 : e.y) !== void 0;
}), Me = v(() => ae.value && Ee.value > Pe.value), wl = v(() => O.value > 0), Cl = v(() => ee.value - G.value > Math.round(O.value)), xl = v(() => {
const e = i.columns.some((a) => a.fixed === "left");
return L.value || M.value || e;
}), Rl = v(() => i.columns.some((a) => a.fixed === "right")), Ge = v(() => Ue.header || i.header), $l = v(() => {
if (i.tableLayout === void 0) {
const e = i.columns.some((t) => t.ellipsis), a = i.columns.some((t) => t.fixed);
return e || a || L.value || M.value || ae.value ? "fixed" : "auto";
}
return i.tableLayout;
}), De = v(() => {
const e = {
minWidth: "100%"
}, a = i.scroll;
return _e.value && (typeof (a == null ? void 0 : a.x) == "boolean" ? e.width = "auto" : e.width = typeof (a == null ? void 0 : a.x) == "number" ? `${a.x}px` : a == null ? void 0 : a.x), e.tableLayout = $l.value, e;
}), Xe = v(() => ({
width: `${G.value}px`,
position: "sticky",
left: "0px",
overflow: "hidden"
})), Fe = v(() => ({
width: typeof i.expandColumnWidth == "number" ? `${i.expandColumnWidth}px` : i.expandColumnWidth
})), Be = v(() => {
var a;
const e = {
width: "32px"
};
return ((a = i.rowSelection) == null ? void 0 : a.columnWidth) !== void 0 && (typeof i.rowSelection.columnWidth == "number" ? e.width = `${i.rowSelection.columnWidth}px` : e.width = i.rowSelection.columnWidth), e;
}), fe = v(() => i.columns.filter((e) => e.colSpan !== 0)), ze = v(() => Ml(i.columns)), de = v(() => ze.value[0][0].fixed === "left"), M = v(() => !!(i.rowSelection !== void 0 && (i.rowSelection.fixed || de.value))), ve = v(() => M.value && !de.value), L = v(() => i.showExpandColumn && (i.expandFixed || M.value || !z.value && de.value)), ce = v(() => L.value && z.value && !M.value || L.value && !z.value && !de.value), je = v(() => ({
width: `${G.value + (i.bordered ? 1 : 0)}px`,
position: "sticky",
left: "0px",
overflow: "hidden"
})), El = v(() => ({
position: "relative",
left: `${-O.value}px`
})), Pl = v(() => {
const e = {};
if (ae.value) {
const a = i.scroll;
e.maxHeight = typeof (a == null ? void 0 : a.y) == "number" ? `${a.y}px` : a == null ? void 0 : a.y;
}
return e;
}), Tl = v(() => Ue.footer || i.footer), qe = v(() => {
let e = i.dataSource.length;
return i.showPagination && "total" in i.pagination && (e = i.pagination.total), e;
}), Je = v(() => i.showPagination && qe.value === i.dataSource.length);
we(
() => [
i.dataSource,
Je.value,
j.value,
q.value,
C.value,
U.value,
P.value
],
() => {
if (Je.value) {
let e;
C.value === null ? e = [...i.dataSource] : (e = [...i.dataSource].sort(U.value), P.value === "descend" && e.reverse()), W.value = e.slice(
(j.value - 1) * q.value,
j.value * q.value
);
} else {
let e;
C.value === null ? e = [...i.dataSource] : (e = [...i.dataSource].sort(U.value), P.value === "descend" && e.reverse()), W.value = e;
}
},
{
immediate: !0,
deep: !0
}
), we(W, (e) => {
var t, s, r;
y.value = new Array(e.length).fill(!1);
const a = e.length;
for (let u = 0; u < a; u++) {
const p = e[u];
if (T.value.includes(p.key) && (((t = i.rowSelection) == null ? void 0 : t.type) === void 0 || ((s = i.rowSelection) == null ? void 0 : s.type) === "checkbox" || ((r = i.rowSelection) == null ? void 0 : r.type) === "radio" && !y.value.includes(!0))) {
y.value[u] = !0;
continue;
}
y.value[u] = !1;
}
We.value && (We.value = !1, te("sortChange", Oe.value, e));
}), we(
() => {
var e, a;
return [(e = i.rowSelection) == null ? void 0 : e.selectedRowKeys, (a = i.rowSelection) == null ? void 0 : a.type];
},
() => {
T.value = [], _.value = [], W.value.forEach((e, a) => {
var t, s, r;
((t = i.rowSelection) == null ? void 0 : t.type) === "radio" ? (s = i.rowSelection) != null && s.selectedRowKeys && i.rowSelection.selectedRowKeys[0] === e.key ? (y.value[a] = !0, T.value.push(e.key), _.value.push(e)) : y.value[a] = !1 : (r = i.rowSelection) != null && r.selectedRowKeys && i.rowSelection.selectedRowKeys.includes(e.key) ? (y.value[a] = !0, T.value.push(e.key), _.value.push(e)) : y.value[a] = !1;
});
},
{
immediate: !0,
deep: !0
}
), we(
y,
(e) => {
var a, t;
if (((a = i.rowSelection) == null ? void 0 : a.type) === void 0 || ((t = i.rowSelection) == null ? void 0 : t.type) === "checkbox") {
const s = e.filter((u) => u);
let r = 0;
W.value.forEach((u, p) => {
var g;
const l = ((g = i.rowSelection) == null ? void 0 : g.getSelectionProps) && i.rowSelection.getSelectionProps(u, p);
l && "disabled" in l && l.disabled || r++;
}), $e.value = 0 < s.length && s.length < r, I.value = s.length === r;
}
},
{
immediate: !0,
deep: !0
}
), He(() => {
re.value || Ll();
}), He(() => {
i.showPagination && ("page" in i.pagination && (j.value = i.pagination.page), "pageSize" in i.pagination && (q.value = i.pagination.pageSize));
}), He(() => {
R.value = i.expandedRowKeys;
}), Nl(() => {
Ye(), Wl(), _l();
}), Ol(Ke, () => {
Ye();
});
function Qe(e) {
var a, t;
ie.value = [], oe.value = [], W.value.forEach((s, r) => {
var p;
const u = ((p = i.rowSelection) == null ? void 0 : p.getSelectionProps) && i.rowSelection.getSelectionProps(s, r);
u && "disabled" in u && u.disabled || (e ? y.value[r] || (y.value[r] = !0, T.value.push(s.key), _.value.push(s), ie.value.push(s.key), oe.value.push(s)) : (T.value = [], _.value = [], y.value[r] && (y.value[r] = !1, ie.value.push(s.key), oe.value.push(s))));
}), (a = i.rowSelection) != null && a.onSelectAll && i.rowSelection.onSelectAll(
e,
_.value,
oe.value,
T.value,
ie.value
), (t = i.rowSelection) != null && t.onChange && i.rowSelection.onChange(T.value, _.value);
}
function pe(e, a, t, s) {
var r, u, p;
e ? ((r = i.rowSelection) == null ? void 0 : r.type) === "radio" ? (y.value.forEach((l, g) => {
g !== a && l && (y.value[g] = !1);
}), T.value = [t], _.value = [s]) : (T.value.push(t), _.value.push(s)) : (T.value = T.value.filter((l) => l !== t), _.value = _.value.filter((l) => l.key !== t)), (u = i.rowSelection) != null && u.onSelect && i.rowSelection.onSelect(s, e, _.value, T.value), (p = i.rowSelection) != null && p.onChange && i.rowSelection.onChange(T.value, _.value);
}
function Ll() {
const e = B.value.filter((t) => t.colSpan !== 0), a = e.length;
for (let t = 0; t < a; t++) {
const s = e[t];
if (s.defaultSortOrder !== void 0) {
C.value = s.dataIndex, U.value = s.sorter, P.value = s.defaultSortOrder;
return;
}
}
}
function Ye() {
if (J.value) {
const e = J.value.getScrollData();
_e.value && (ee.value = e.scrollWidth, G.value = e.clientWidth, Te.value = ee.value - G.value), ae.value && (Ee.value = e.scrollHeight, Pe.value = e.clientHeight);
}
}
async function Wl() {
await fl(), ne.value && ne.value.forEach((e) => e.observeScroll());
}
async function _l() {
await fl(), m.value && m.value.forEach((e) => e.observeScroll());
}
function Ne(e, a) {
if (e && e.length) {
const t = e.length;
for (let s = 0; s < t; s++) {
const r = e[s];
if (r.fixed && r.fixed === a)
return !0;
if (Ne(r.children, a))
return !0;
}
}
return !1;
}
function Ze(e) {
let a = 0;
return e.forEach((t) => {
t.children && t.children.length > 0 ? a += Ze(t.children) : a += 1;
}), a;
}
function Q(e, a = 1) {
let t = a;
return e.forEach((s) => {
if (s.children && s.children.length > 0) {
const r = Q(s.children, a + 1);
r > t && (t = r);
}
}), t;
}
function Ml(e) {
B.value = [];
const a = Q(e), t = [];
for (let r = 0; r < a; r++)
t.push([]);
function s(r, u, p) {
r.forEach((l) => {
l.children && l.children.length > 0 ? (l.colSpan = Ze(l.children), l.colStart = p, l.colEnd = p + l.colSpan - 1, p += l.colSpan, s(l.children, u + 1, l.colStart)) : (l.rowSpan = a - u, l.colStart = p, l.colEnd = p, p += 1, B.value.push(l)), Ne(l.children, "left") && (l.fixed = "left"), Ne(l.children, "right") && (l.fixed = "right"), t[u].push(l);
});
}
return s(e, 0, i.showExpandColumn ? 1 : 0), t;
}
function Y(e, a) {
return B.value.filter((t) => {
if (t.customCell) {
const s = t.customCell(e, a, t);
if (s && ("colSpan" in s && s.colSpan === 0 || "rowSpan" in s && s.rowSpan === 0))
return !1;
}
return !0;
});
}
function F(e, a) {
let t = i[a];
return (e == null ? void 0 : e[a]) !== void 0 && (t = e[a]), t;
}
function Ie(e) {
const a = {
ascend: "点击升序",
descend: "点击降序"
}, t = F(e, "sortDirections");
return !re.value && C.value === e.dataIndex ? t.length === 2 && e.defaultSortOrder === t[0] ? a[t[1]] : "取消排序" : C.value === e.dataIndex ? P.value === "ascend" ? t.length === 1 ? "取消排序" : t[0] === "ascend" ? "点击降序" : "取消排序" : t.length === 1 || t[0] === "ascend" ? "取消排序" : "点击升序" : t.length > 0 ? a[t[0]] : void 0;
}
function el(e) {
We.value = !0, Oe.value = e, re.value || (re.value = !0);
const a = F(e, "sortDirections");
C.value === e.dataIndex ? P.value === "ascend" ? a.length === 1 ? (C.value = null, U.value = null, P.value = null) : a[0] === "ascend" ? P.value = "descend" : (C.value = null, U.value = null, P.value = null) : a.length === 1 || a[0] === "ascend" ? (C.value = null, U.value = null, P.value = null) : P.value = "ascend" : (C.value = e.dataIndex, U.value = e.sorter, a.length > 0 && (P.value = a[0])), ul();
}
function ll(e) {
ue.value = e;
}
function tl() {
ue.value = null;
}
function he(e, a, t) {
return a.fixed === "left" && t < e.length - 1 && e[t + 1].fixed !== "left";
}
function ye(e, a, t) {
return a.fixed === "right" && t > 0 && e[t - 1].fixed !== "right";
}
function Ae(e) {
const a = {};
return e.width !== void 0 && (a.width = typeof e.width == "number" ? `${e.width}px` : e.width), a;
}
function ge(e) {
const a = {};
return e && (a.position = "sticky", a.left = "0px"), a;
}
function be(e) {
const a = {};
return e && (a.position = "sticky", a.left = i.showExpandColumn ? `${le.value && le.value.offsetWidth}px` : "0px"), a;
}
function ke(e) {
const a = {};
if (e.fixed && X.value && X.value.length) {
if (a.position = "sticky", e.fixed === "left") {
const t = e.colStart;
let s = 0;
i.showExpandColumn && (s += le.value.offsetWidth), z.value && (s += Le.value.offsetWidth);
for (let r = 0; r < (i.showExpandColumn ? t - 1 : t); r++)
s += X.value[r].offsetWidth;
return a.left = `${s}px`, a;
}
if (e.fixed === "right") {
const t = e.colEnd;
let s = 0;
for (let r = X.value.length - 1; r > (i.showExpandColumn ? t - 1 : t); r--)
s += X.value[r].offsetWidth;
return a.right = `${s}px`, a;
}
}
return a;
}
function Dl(e, a) {
const t = [];
return i.columns.forEach((s, r) => {
if (s.customCell) {
const u = s.customCell(e, a, s);
u && "rowSpan" in u && u.rowSpan === 0 && t.push(r);
}
}), t;
}
function al(e, a, t) {
var s;
if (t >= 0) {
const r = (s = a.customCell) == null ? void 0 : s.call(a, e, t, a);
return r && "rowSpan" in r && r.rowSpan > 0 ? t : al(e, a, t - 1);
}
}
function sl(e, a) {
return typeof i.rowClassName == "function" ? i.rowClassName(e, a) : i.rowClassName;
}
function il(e, a) {
V.value = a;
const t = Dl(e, a);
t.length && t.forEach((s) => {
const r = i.columns[s];
Re.value.push({
row: al(W.value[a - 1], r, a - 1),
col: s
});
});
}
function ol() {
V.value = null, Re.value = [];
}
function nl(e, a) {
return Re.value.some((t) => t.row === e && t.col === a);
}
function Se(e) {
const a = e.key;
R.value.includes(a) ? R.value = R.value.filter((t) => t !== a) : R.value.push(a), te("expand", R.value.includes(a), e), te("expandedRowsChange", R.value), te("update:expandedRowKeys", R.value);
}
function rl(e, a) {
["left", "right"].includes(a) && (O.value = e.target.scrollLeft, ee.value = e.target.scrollWidth, G.value = e.target.clientWidth), ["top", "bottom"].includes(a) && (Ee.value = e.target.scrollHeight, Pe.value = e.target.clientHeight);
}
function Fl(e) {
if (e.deltaX) {
const a = e.deltaX * 1;
O.value + a > Te.value ? O.value = Te.value : O.value + a < 0 ? O.value = 0 : (e.stopPropagation(), e.preventDefault(), O.value += a), J.value.scrollTo({
left: O.value,
behavior: "instant"
});
}
}
function ul() {
var e;
(e = i.scroll) != null && e.initialScrollPositionOnChange && J.value.scrollTo({
top: 0,
left: 0,
behavior: "smooth"
});
}
function Bl(e, a) {
j.value = e, q.value = a, te("change", e, a), ul();
}
return (e, a) => (o(), n("div", {
ref_key: "tableRef",
ref: Ke,
class: "m-table-wrap"
}, [
D(b(Al), k({
size: "small",
spinning: e.loading
}, e.spinProps), {
default: A(() => [
d("div", {
class: x(["m-table", {
"table-shadow-left": wl.value,
"table-shadow-right": Cl.value,
"table-has-fix-left": xl.value,
"table-has-fix-right": Rl.value,
"table-small": e.size === "small",
"table-middle": e.size === "middle",
"table-striped": e.striped,
"table-bordered": e.bordered
}])
}, [
Ge.value ? (o(), n("div", Ul, [
S(e.$slots, "header", {}, () => [
$(E(e.header), 1)
], !0)
])) : c("", !0),
!ae.value && !e.sticky ? (o(), n("div", {
key: 1,
class: x(["table-container", { "container-no-x-scroll": !N.value }])
}, [
D(b(yl), k({
ref_key: "scrollbarRef",
ref: J,
style: Ge.value ? {} : { borderRadius: "8px 8px 0 0" },
"x-scrollable": N.value,
"y-scrollable": Me.value,
"auto-hide": !1,
onScroll: rl
}, e.scrollbarProps), {
default: A(() => [
d("table", {
style: h(De.value)
}, [
d("colgroup", null, [
e.showExpandColumn ? (o(), n("col", {
key: 0,
ref_key: "colExpandRef",
ref: le,
style: h(Fe.value)
}, null, 4)) : c("", !0),
z.value ? (o(), n("col", {
key: 1,
ref_key: "colSelectionRef",
ref: Le,
style: h(Be.value)
}, null, 4)) : c("", !0),
(o(!0), n(w, null, K(B.value, (t, s) => (o(), n("col", {
ref_for: !0,
ref_key: "colRef",
ref: X,
style: h(Ae(t)),
key: s
}, null, 4))), 128))
]),
d("thead", null, [
(o(!0), n(w, null, K(ze.value, (t, s) => {
var r, u, p;
return o(), n("tr", { key: s }, [
s === 0 ? (o(), n(w, { key: 0 }, [
e.showExpandColumn ? (o(), n("th", {
key: 0,
class: x(["table-th", {
"table-cell-fix-left": L.value,
"table-cell-fix-left-last": ce.value
}]),
style: h(ge(L.value)),
rowspan: Q(fe.value),
colstart: 0,
colend: 0
}, [
S(e.$slots, "expandColumnTitle", {}, () => [
$(E(e.expandColumnTitle), 1)
], !0)
], 14, Vl)) : c("", !0),
z.value ? (o(), n("th", {
key: 1,
class: x(["table-th table-th-selection", {
"table-cell-fix-left": M.value,
"table-cell-fix-left-last": ve.value
}]),
style: h(be(M.value)),
rowspan: Q(fe.value),
colstart: 0,
colend: 0
}, [
Ve.value ? (o(), n(w, { key: 0 }, [
dl((r = e.rowSelection) == null ? void 0 : r.columnTitle) ? (o(), H(vl((u = e.rowSelection) == null ? void 0 : u.columnTitle), { key: 0 })) : (o(), n(w, { key: 1 }, [
$(E((p = e.rowSelection) == null ? void 0 : p.columnTitle), 1)
], 64))
], 64)) : me.value ? (o(), n("div", Gl, [
D(b(xe), {
indeterminate: $e.value,
checked: I.value,
"onUpdate:checked": a[0] || (a[0] = (l) => I.value = l),
onChange: Qe
}, null, 8, ["indeterminate", "checked"])
])) : c("", !0)
], 14, ml)) : c("", !0)
], 64)) : c("", !0),
(o(!0), n(w, null, K(t, (l, g) => (o(), n(w, {
key: `${s}-${g}`
}, [
l.colSpan !== 0 ? (o(), n("th", {
key: 0,
class: x(["table-th", [
l.className,
{
"table-cell-has-sorter": l.sorter,
"table-cell-sort": C.value === l.dataIndex,
"table-cell-align-left": l.align === "left",
"table-cell-align-center": l.align === "center",
"table-cell-align-right": l.align === "right",
"table-cell-fix-left": l.fixed === "left",
"table-cell-fix-left-last": he(t, l, g),
"table-cell-fix-right": l.fixed === "right",
"table-cell-fix-right-first": ye(t, l, g)
}
]]),
style: h(ke(l)),
rowspan: l.rowSpan,
colspan: l.colSpan,
colstart: l.colStart,
colend: l.colEnd,
onMouseenter: (se) => l.sorter ? ll(l.dataIndex) : () => !1,
onMouseleave: (se) => l.sorter ? tl() : () => !1,
onClick: (se) => l.sorter ? el(l) : () => !1
}, [
l.sorter ? (o(), H(b(bl), k({
key: 0,
ref_for: !0,
ref_key: "tooltipRef",
ref: ne,
style: { width: "100%" },
"show-control": "",
show: ue.value === l.dataIndex,
"content-style": { width: "100%" },
tooltip: F(l, "showSorterTooltip") ? Ie(l) : void 0,
"tooltip-style": { fontWeight: "normal" }
}, F(l, "sortTooltipProps")), {
default: A(() => [
d("div", jl, [
d("span", ql, [
l.ellipsis ? S(e.$slots, "headerCell", {
key: 0,
column: l,
title: l.title
}, () => [
D(b(Z), k({
ref_for: !0,
ref_key: "ellipsisRef",
ref: m
}, F(l, "ellipsisProps")), {
default: A(() => [
$(E(l.title), 1)
]),
_: 2
}, 1040)
], !0) : S(e.$slots, "headerCell", {
key: 1,
column: l,
title: l.title
}, () => [
$(E(l.title), 1)
], !0)
]),
d("span", {
class: x(["table-cell-arrow", {
"ascend-arrow": C.value === l.dataIndex && P.value === "ascend",
"descend-arrow": C.value === l.dataIndex && P.value === "descend"
}])
}, a[3] || (a[3] = [
d("svg", {
width: "1.25em",
height: "1.25em",
fill: "currentColor",
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
viewBox: "0 0 16 16"
}, [
d("g", { fill: "none" }, [
d("path", {
d: "M8 14a.75.75 0 0 1-.75-.75V4.463L4.309 7.75a.75.75 0 0 1-1.118-1L7.441 2A.75.75 0 0 1 8.56 2l4.25 4.75a.75.75 0 1 1-1.118 1L8.75 4.463v8.787A.75.75 0 0 1 8 14z",
fill: "currentColor"
})
])
], -1)
]), 2)
])
]),
_: 2
}, 1040, ["show", "tooltip"])) : l.ellipsis ? S(e.$slots, "headerCell", {
key: 1,
column: l,
title: l.title
}, () => [
D(b(Z), k({
ref_for: !0,
ref_key: "ellipsisRef",
ref: m
}, F(l, "ellipsisProps")), {
default: A(() => [
$(E(l.title), 1)
]),
_: 2
}, 1040)
], !0) : S(e.$slots, "headerCell", {
key: 2,
column: l,
title: l.title
}, () => [
$(E(l.title), 1)
], !0)
], 46, Xl)) : c("", !0)
], 64))), 128))
]);
}), 128))
]),
d("tbody", null, [
W.value.length ? c("", !0) : (o(), n("tr", Jl, [
d("td", {
class: "table-empty",
colspan: B.value.length
}, [
N.value ? (o(), n("div", {
key: 0,
class: "table-empty-fixed",
style: h(Xe.value)
}, [
D(b(Ce), k({
class: "empty",
image: "outlined"
}, e.emptyProps), null, 16)
], 4)) : (o(), H(b(Ce), k({
key: 1,
class: "empty",
image: "outlined"
}, e.emptyProps), null, 16))
], 8, Ql)
])),
W.value.length ? (o(!0), n(w, { key: 1 }, K(W.value, (t, s) => {
var r, u, p;
return o(), n(w, { key: s }, [
d("tr", {
class: x(sl(t, s)),
onMouseenter: (l) => il(t, s),
onMouseleave: ol,
onClick: (l) => e.expandRowByClick ? Se(t) : () => !1
}, [
e.showExpandColumn ? (o(), n("td", {
key: 0,
class: x(["table-td table-td-expand", {
"table-cell-fix-left": L.value,
"table-cell-fix-left-last": ce.value,
"table-td-hover": V.value === s
}]),
style: h(ge(L.value)),
onClick: pl((l) => Se(t), ["stop"])
}, [
S(e.$slots, "expandCell", {
record: t,
index: s,
expanded: R.value.includes(t.key)
}, () => [
d("button", {
class: x(["expand-btn", { "expand-btn-collapsed": !R.value.includes(t.key) }])
}, null, 2)
], !0)
], 14, Zl)) : c("", !0),
z.value ? (o(), n("td", {
key: 1,
class: x(["table-td table-td-selection", {
"table-cell-fix-left": M.value,
"table-cell-fix-left-last": ve.value,
"table-td-hover": V.value === s
}]),
style: h(be(M.value))
}, [
d("div", Il, [
((r = e.rowSelection) == null ? void 0 : r.type) === "radio" ? (o(), H(b(gl), k({
key: 0,
checked: y.value[s],
"onUpdate:checked": (l) => y.value[s] = l,
onChange: (l) => pe(l, s, t.key, t),
ref_for: !0
}, ((u = e.rowSelection) == null ? void 0 : u.getSelectionProps) && e.rowSelection.getSelectionProps(t, s)), null, 16, ["checked", "onUpdate:checked", "onChange"])) : (o(), H(b(xe), k({
key: 1,
checked: y.value[s],
"onUpdate:checked": (l) => y.value[s] = l,
onChange: (l) => pe(l, s, t.key, t),
ref_for: !0
}, ((p = e.rowSelection) == null ? void 0 : p.getSelectionProps) && e.rowSelection.getSelectionProps(t, s)), null, 16, ["checked", "onUpdate:checked", "onChange"]))
])
], 6)) : c("", !0),
(o(!0), n(w, null, K(Y(t, s), (l, g) => (o(), n("td", k({
class: ["table-td", [
l.className,
{
"table-cell-sort": C.value === l.dataIndex,
"table-cell-align-left": l.align === "left",
"table-cell-align-center": l.align === "center",
"table-cell-align-right": l.align === "right",
"table-cell-fix-left": l.fixed === "left",
"table-cell-fix-left-last": he(
Y(t, s),
l,
g
),
"table-cell-fix-right": l.fixed === "right",
"table-cell-fix-right-first": ye(
Y(t, s),
l,
g
),
"table-td-hover": V.value === s || nl(s, g)
}
]],
style: ke(l),
key: `${s}-${g}`,
ref_for: !0
}, l.customCell && l.customCell(t, s, l)), [
l.ellipsis ? S(e.$slots, "bodyCell", {
key: 0,
column: l,
record: t,
text: t[l.dataIndex],
index: s
}, () => [
D(b(Z), k({
ref_for: !0,
ref_key: "ellipsisRef",
ref: m
}, F(l, "ellipsisProps")), {
default: A(() => [
$(E(t[l.dataIndex]), 1)
]),
_: 2
}, 1040)
], !0) : S(e.$slots, "bodyCell", {
key: 1,
column: l,
record: t,
text: t[l.dataIndex],
index: s
}, () => [
$(E(t[l.dataIndex]), 1)
], !0)
], 16))), 128))
], 42, Yl),
e.showExpandColumn ? cl((o(), n("tr", et, [
d("td", {
class: "table-td table-td-expand-row",
colspan: B.value.length + 1
}, [
L.value ? (o(), n("div", {
key: 0,
class: "table-expand-row-fixed",
style: h(je.value)
}, [
S(e.$slots, "expandedRowRender", {
record: t,
index: s,
expanded: R.value.includes(t.key)
}, void 0, !0)
], 4)) : S(e.$slots, "expandedRowRender", {
key: 1,
record: t,
index: s,
expanded: R.value.includes(t.key)
}, void 0, !0)
], 8, lt)
], 512)), [
[hl, R.value.includes(t.key)]
]) : c("", !0)
], 64);
}), 128)) : c("", !0)
])
], 4)
]),
_: 3
}, 16, ["style", "x-scrollable", "y-scrollable"])
], 2)) : (o(), n("div", {
key: 2,
class: x(["table-container", {
"container-vertical-no-x-scroll": !N.value,
"container-no-scroll": !N.value && !Me.value
}])
}, [
d("div", {
class: x(["table-head", { "table-head-sticky": e.sticky }])
}, [
d("table", {
style: h([De.value, El.value]),
onWheel: a[2] || (a[2] = (t) => N.value ? Fl(t) : () => !1)
}, [
d("colgroup", null, [
e.showExpandColumn ? (o(), n("col", {
key: 0,
ref_key: "colExpandRef",
ref: le,
style: h(Fe.value)
}, null, 4)) : c("", !0),
z.value ? (o(), n("col", {
key: 1,
ref_key: "colSelectionRef",
ref: Le,
style: h(Be.value)
}, null, 4)) : c("", !0),
(o(!0), n(w, null, K(B.value, (t, s) => (o(), n("col", {
ref_for: !0,
ref_key: "colRef",
ref: X,
style: h(Ae(t)),
key: s
}, null, 4))), 128))
]),
d("thead", null, [
(o(!0), n(w, null, K(ze.value, (t, s) => {
var r, u, p;
return o(), n("tr", { key: s }, [
s === 0 ? (o(), n(w, { key: 0 }, [
e.showExpandColumn ? (o(), n("th", {
key: 0,
class: x(["table-th", {
"table-cell-fix-left": L.value,
"table-cell-fix-left-last": ce.value
}]),
style: h(ge(L.value)),
rowspan: Q(fe.value),
colstart: 0,
colend: 0
}, [
S(e.$slots, "expandColumnTitle", {}, () => [
$(E(e.expandColumnTitle), 1)
], !0)
], 14, tt)) : c("", !0),
z.value ? (o(), n("th", {
key: 1,
class: x(["table-th table-th-selection", {
"table-cell-fix-left": M.value,
"table-cell-fix-left-last": ve.value
}]),
style: h(be(M.value)),
rowspan: Q(fe.value),
colstart: 0,
colend: 0
}, [
Ve.value ? (o(), n(w, { key: 0 }, [
dl((r = e.rowSelection) == null ? void 0 : r.columnTitle) ? (o(), H(vl((u = e.rowSelection) == null ? void 0 : u.columnTitle), { key: 0 })) : (o(), n(w, { key: 1 }, [
$(E((p = e.rowSelection) == null ? void 0 : p.columnTitle), 1)
], 64))
], 64)) : me.value ? (o(), n("div", st, [
D(b(xe), {
indeterminate: $e.value,
checked: I.value,
"onUpdate:checked": a[1] || (a[1] = (l) => I.value = l),
onChange: Qe
}, null, 8, ["indeterminate", "checked"])
])) : c("", !0)
], 14, at)) : c("", !0)
], 64)) : c("", !0),
(o(!0), n(w, null, K(t, (l, g) => (o(), n(w, {
key: `${s}-${g}`
}, [
l.colSpan !== 0 ? (o(), n("th", {
key: 0,
class: x(["table-th", [
l.className,
{
"table-cell-has-sorter": l.sorter,
"table-cell-sort": C.value === l.dataIndex,
"table-cell-align-left": l.align === "left",
"table-cell-align-center": l.align === "center",
"table-cell-align-right": l.align === "right",
"table-cell-fix-left": l.fixed === "left",
"table-cell-fix-left-last": he(t, l, g),
"table-cell-fix-right": l.fixed === "right",
"table-cell-fix-right-first": ye(t, l, g)
}
]]),
style: h(ke(l)),
rowspan: l.rowSpan,
colspan: l.colSpan,
colstart: l.colStart,
colend: l.colEnd,
title: l.ellipsis && N.value ? l.title : void 0,
onMouseenter: (se) => l.sorter ? ll(l.dataIndex) : () => !1,
onMouseleave: (se) => l.sorter ? tl() : () => !1,
onClick: (se) => l.sorter ? el(l) : () => !1
}, [
l.sorter ? (o(), H(b(bl), k({
key: 0,
ref_for: !0,
ref_key: "tooltipRef",
ref: ne,
style: { width: "100%" },
"show-control": "",
show: ue.value === l.dataIndex,
"content-style": { width: "100%" },
tooltip: F(l, "showSorterTooltip") ? Ie(l) : void 0,
"tooltip-style": { fontWeight: "normal" }
}, F(l, "sortTooltipProps")), {
default: A(() => [
d("div", ot, [
d("span", nt, [
l.ellipsis && !N.value ? S(e.$slots, "headerCell", {
key: 0,
column: l,
title: l.title
}, () => [
D(b(Z), k({
ref_for: !0,
ref_key: "ellipsisRef",
ref: m
}, F(l, "ellipsisProps")), {
default: A(() => [
$(E(l.title), 1)
]),
_: 2
}, 1040)
], !0) : S(e.$slots, "headerCell", {
key: 1,
column: l,
title: l.title
}, () => [
$(E(l.title), 1)
], !0)
]),
d("span", {
class: x(["table-cell-arrow", {
"ascend-arrow": C.value === l.dataIndex && P.value === "ascend",
"descend-arrow": C.value === l.dataIndex && P.value === "descend"
}])
}, a[4] || (a[4] = [
d("svg", {
width: "1.25em",
height: "1.25em",
fill: "currentColor",
xmlns: "http://www.w3.org/2000/svg",
"xmlns:xlink": "http://www.w3.org/1999/xlink",
viewBox: "0 0 16 16"
}, [
d("g", { fill: "none" }, [
d("path", {
d: "M8 14a.75.75 0 0 1-.75-.75V4.463L4.309 7.75a.75.75 0 0 1-1.118-1L7.441 2A.75.75 0 0 1 8.56 2l4.25 4.75a.75.75 0 1 1-1.118 1L8.75 4.463v8.787A.75.75 0 0 1 8 14z",
fill: "currentColor"
})
])
], -1)
]), 2)
])
]),
_: 2
}, 1040, ["show", "tooltip"])) : l.ellipsis && !N.value ? S(e.$slots, "headerCell", {
key: 1,
column: l,
title: l.title
}, () => [
D(b(Z), k({
ref_for: !0,
ref_key: "ellipsisRef",
ref: m
}, F(l, "ellipsisProps")), {
default: A(() => [
$(E(l.title), 1)
]),
_: 2
}, 1040)
], !0) : S(e.$slots, "headerCell", {
key: 2,
column: l,
title: l.title
}, () => [
$(E(l.title), 1)
], !0)
], 46, it)) : c("", !0)
], 64))), 128))
]);
}), 128))
])
], 36)
], 2),
D(b(yl), k({
ref_key: "scrollbarRef",
ref: J,
class: ["table-body", { "table-x-scrollbar-sticky": e.sticky }],
"x-scrollable": N.value,
"y-scrollable": Me.value,
"auto-hide": !1,
style: Pl.value,
onScroll: rl
}, e.scrollbarProps), {
default: A(() => [
d("table", {
style: h(De.value)
}, [
d("colgroup", null, [
e.showExpandColumn ? (o(), n("col", {
key: 0,
style: h(Fe.value)
}, null, 4)) : c("", !0),
z.value ? (o(), n("col", {
key: 1,
style: h