UNPKG

vue-amazing-ui

Version:

An Amazing Vue3 UI Components Library, Using TypeScript.

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