UNPKG

vue-amazing-ui

Version:

An Amazing Vue3 UI Components Library, Using TypeScript.

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