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