import { a$ as $n, aD as ft, d as g, P as ie, c as te, b0 as wn, b1 as pl, b2 as ml, b3 as Ut, b4 as lt, b5 as vl, p as Pt, q as Gt, b6 as hl, _ as G, g as In, m as Pn, b7 as gl, r as Dt, b8 as xl, b9 as Jt, ba as bl, bb as yl, u as Kt, ar as En, ak as Tn, bc as Cl, a3 as Be, j as qe, a4 as se, a1 as De, a2 as Ke, M as qt, L as Yt, bd as Qt, be as Zt, b as Sl, bf as $l, bg as wl, bh as Il, bi as Pl, bj as El, n as ze, bk as Ft, am as Rn, ac as Tl, h as Te, s as Rl, a as We, w as rt, R as On, bl as en, bm as tn, bn as Ol, x as Ve, bo as nn, bp as Nl, a0 as Bl, bq as zl, z as kl, aG as pt, aQ as Nn, br as _l, bs as mt, aS as Dl, bt as Kl, bu as Fl, a9 as Al, K as Bn, f as Ye, bv as Ml, bw as Hl, bx as jl, U as ln, by as Ll, V as on, t as Wl, ai as ot, ag as Vl, i as zn, al as Xl, o as Ul, aw as Gl } from "./index2.js"; import { defineComponent as ue, createVNode as u, ref as pe, computed as C, createTextVNode as At, toRef as xe, provide as Me, inject as He, shallowRef as ce, onMounted as et, watch as Fe, isVNode as ut, Text as Jl, onUnmounted as ql, watchEffect as Re, getCurrentInstance as Yl, Fragment as Xe, onBeforeUnmount as tt, reactive as Qe, onActivated as Ql, nextTick as at, toRefs as $t, onUpdated as Zl } from "vue"; import { c as eo, u as to, a as wt, b as no, d as lo } from "./useMaxLevel.js"; import { R as kn } from "./index9.js"; import { T as oo } from "./index10.js"; import { s as ro } from "./scrollTo.js"; const ao = (e) => ({ // FIXME: This use link but is a operation unit. Seems should be a colorPrimary. // And Typography use this to generate link style which should not do this. color: e.colorLink, textDecoration: "none", outline: "none", cursor: "pointer", transition: `color ${e.motionDurationSlow}`, "&:focus, &:hover": { color: e.colorLinkHover }, "&:active": { color: e.colorLinkActive } }); function io(e) { for (var t = -1, l = e == null ? 0 : e.length, n = {}; ++t < l; ) { var o = e[t]; n[o[0]] = o[1]; } return n; } const so = ue({ name: "MiniSelect", compatConfig: { MODE: 3 }, inheritAttrs: !1, props: $n(), Option: ft.Option, setup(e, t) { let { attrs: l, slots: n } = t; return () => { const o = g(g(g({}, e), { size: "small" }), l); return u(ft, o, n); }; } }), co = ue({ name: "MiddleSelect", inheritAttrs: !1, props: $n(), Option: ft.Option, setup(e, t) { let { attrs: l, slots: n } = t; return () => { const o = g(g(g({}, e), { size: "middle" }), l); return u(ft, o, n); }; } }), je = ue({ compatConfig: { MODE: 3 }, name: "Pager", inheritAttrs: !1, props: { rootPrefixCls: String, page: Number, active: { type: Boolean, default: void 0 }, last: { type: Boolean, default: void 0 }, locale: ie.object, showTitle: { type: Boolean, default: void 0 }, itemRender: { type: Function, default: () => { } }, onClick: { type: Function }, onKeypress: { type: Function } }, eimt: ["click", "keypress"], setup(e, t) { let { emit: l, attrs: n } = t; const o = () => { l("click", e.page); }, r = (a) => { l("keypress", a, o, e.page); }; return () => { const { showTitle: a, page: i, itemRender: s } = e, { class: p, style: c } = n, f = `${e.rootPrefixCls}-item`, x = te(f, `${f}-${e.page}`, { [`${f}-active`]: e.active, [`${f}-disabled`]: !e.page }, p); return u("li", { onClick: o, onKeypress: r, title: a ? String(i) : null, tabindex: "0", class: x, style: c }, [s({ page: i, type: "page", originalElement: u("a", { rel: "nofollow" }, [i]) })]); }; } }), Le = { ZERO: 48, NINE: 57, NUMPAD_ZERO: 96, NUMPAD_NINE: 105, BACKSPACE: 8, DELETE: 46, ENTER: 13, ARROW_UP: 38, ARROW_DOWN: 40 }, uo = ue({ compatConfig: { MODE: 3 }, props: { disabled: { type: Boolean, default: void 0 }, changeSize: Function, quickGo: Function, selectComponentClass: ie.any, current: Number, pageSizeOptions: ie.array.def(["10", "20", "50", "100"]), pageSize: Number, buildOptionText: Function, locale: ie.object, rootPrefixCls: String, selectPrefixCls: String, goButton: ie.any }, setup(e) { const t = pe(""), l = C(() => !t.value || isNaN(t.value) ? void 0 : Number(t.value)), n = (s) => `${s.value} ${e.locale.items_per_page}`, o = (s) => { const { value: p } = s.target; t.value !== p && (t.value = p); }, r = (s) => { const { goButton: p, quickGo: c, rootPrefixCls: f } = e; if (!(p || t.value === "")) if (s.relatedTarget && (s.relatedTarget.className.indexOf(`${f}-item-link`) >= 0 || s.relatedTarget.className.indexOf(`${f}-item`) >= 0)) { t.value = ""; return; } else c(l.value), t.value = ""; }, a = (s) => { t.value !== "" && (s.keyCode === Le.ENTER || s.type === "click") && (e.quickGo(l.value), t.value = ""); }, i = C(() => { const { pageSize: s, pageSizeOptions: p } = e; return p.some((c) => c.toString() === s.toString()) ? p : p.concat([s.toString()]).sort((c, f) => { const x = isNaN(Number(c)) ? 0 : Number(c), $ = isNaN(Number(f)) ? 0 : Number(f); return x - $; }); }); return () => { const { rootPrefixCls: s, locale: p, changeSize: c, quickGo: f, goButton: x, selectComponentClass: $, selectPrefixCls: b, pageSize: m, disabled: v } = e, h = `${s}-options`; let y = null, d = null, E = null; if (!c && !f) return null; if (c && $) { const O = e.buildOptionText || n, z = i.value.map((S, H) => u($.Option, { key: H, value: S }, { default: () => [O({ value: S })] })); y = u($, { disabled: v, prefixCls: b, showSearch: !1, class: `${h}-size-changer`, optionLabelProp: "children", value: (m || i.value[0]).toString(), onChange: (S) => c(Number(S)), getPopupContainer: (S) => S.parentNode }, { default: () => [z] }); } return f && (x && (E = typeof x == "boolean" ? u("button", { type: "button", onClick: a, onKeyup: a, disabled: v, class: `${h}-quick-jumper-button` }, [p.jump_to_confirm]) : u("span", { onClick: a, onKeyup: a }, [x])), d = u("div", { class: `${h}-quick-jumper` }, [p.jump_to, u(wn, { disabled: v, type: "text", value: t.value, onInput: o, onChange: o, onKeyup: a, onBlur: r }, null), p.page, E])), u("li", { class: `${h}` }, [y, d]); }; } }); var fo = function(e, t) { var l = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (l[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++) t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (l[n[o]] = e[n[o]]); return l; }; function po(e) { return typeof e == "number" && isFinite(e) && Math.floor(e) === e; } function mo(e) { let { originalElement: t } = e; return t; } function ke(e, t, l) { const n = typeof e == "undefined" ? t.statePageSize : e; return Math.floor((l.total - 1) / n) + 1; } const vo = ue({ compatConfig: { MODE: 3 }, name: "Pagination", mixins: [pl], inheritAttrs: !1, props: { disabled: { type: Boolean, default: void 0 }, prefixCls: ie.string.def("rc-pagination"), selectPrefixCls: ie.string.def("rc-select"), current: Number, defaultCurrent: ie.number.def(1), total: ie.number.def(0), pageSize: Number, defaultPageSize: ie.number.def(10), hideOnSinglePage: { type: Boolean, default: !1 }, showSizeChanger: { type: Boolean, default: void 0 }, showLessItems: { type: Boolean, default: !1 }, // showSizeChange: PropTypes.func.def(noop), selectComponentClass: ie.any, showPrevNextJumpers: { type: Boolean, default: !0 }, showQuickJumper: ie.oneOfType([ie.looseBool, ie.object]).def(!1), showTitle: { type: Boolean, default: !0 }, pageSizeOptions: ie.arrayOf(ie.oneOfType([ie.number, ie.string])), buildOptionText: Function, showTotal: Function, simple: { type: Boolean, default: void 0 }, locale: ie.object.def(ml), itemRender: ie.func.def(mo), prevIcon: ie.any, nextIcon: ie.any, jumpPrevIcon: ie.any, jumpNextIcon: ie.any, totalBoundaryShowSizeChanger: ie.number.def(50) }, data() { const e = this.$props; let t = Ut([this.current, this.defaultCurrent]); const l = Ut([this.pageSize, this.defaultPageSize]); return t = Math.min(t, ke(l, void 0, e)), { stateCurrent: t, stateCurrentInputValue: t, statePageSize: l }; }, watch: { current(e) { this.setState({ stateCurrent: e, stateCurrentInputValue: e }); }, pageSize(e) { const t = {}; let l = this.stateCurrent; const n = ke(e, this.$data, this.$props); l = l > n ? n : l, lt(this, "current") || (t.stateCurrent = l, t.stateCurrentInputValue = l), t.statePageSize = e, this.setState(t); }, stateCurrent(e, t) { this.$nextTick(() => { if (this.$refs.paginationNode) { const l = this.$refs.paginationNode.querySelector(`.${this.prefixCls}-item-${t}`); l && document.activeElement === l && l.blur(); } }); }, total() { const e = {}, t = ke(this.pageSize, this.$data, this.$props); if (lt(this, "current")) { const l = Math.min(this.current, t); e.stateCurrent = l, e.stateCurrentInputValue = l; } else { let l = this.stateCurrent; l === 0 && t > 0 ? l = 1 : l = Math.min(this.stateCurrent, t), e.stateCurrent = l; } this.setState(e); } }, methods: { getJumpPrevPage() { return Math.max(1, this.stateCurrent - (this.showLessItems ? 3 : 5)); }, getJumpNextPage() { return Math.min(ke(void 0, this.$data, this.$props), this.stateCurrent + (this.showLessItems ? 3 : 5)); }, getItemIcon(e, t) { const { prefixCls: l } = this.$props; return vl(this, e, this.$props) || u("button", { type: "button", "aria-label": t, class: `${l}-item-link` }, null); }, getValidValue(e) { const t = e.target.value, l = ke(void 0, this.$data, this.$props), { stateCurrentInputValue: n } = this.$data; let o; return t === "" ? o = t : isNaN(Number(t)) ? o = n : t >= l ? o = l : o = Number(t), o; }, isValid(e) { return po(e) && e !== this.stateCurrent; }, shouldDisplayQuickJumper() { const { showQuickJumper: e, pageSize: t, total: l } = this.$props; return l <= t ? !1 : e; }, // calculatePage (p) { // let pageSize = p // if (typeof pageSize === 'undefined') { // pageSize = this.statePageSize // } // return Math.floor((this.total - 1) / pageSize) + 1 // }, handleKeyDown(e) { (e.keyCode === Le.ARROW_UP || e.keyCode === Le.ARROW_DOWN) && e.preventDefault(); }, handleKeyUp(e) { const t = this.getValidValue(e), l = this.stateCurrentInputValue; t !== l && this.setState({ stateCurrentInputValue: t }), e.keyCode === Le.ENTER ? this.handleChange(t) : e.keyCode === Le.ARROW_UP ? this.handleChange(t - 1) : e.keyCode === Le.ARROW_DOWN && this.handleChange(t + 1); }, changePageSize(e) { let t = this.stateCurrent; const l = t, n = ke(e, this.$data, this.$props); t = t > n ? n : t, n === 0 && (t = this.stateCurrent), typeof e == "number" && (lt(this, "pageSize") || this.setState({ statePageSize: e }), lt(this, "current") || this.setState({ stateCurrent: t, stateCurrentInputValue: t })), this.__emit("update:pageSize", e), t !== l && this.__emit("update:current", t), this.__emit("showSizeChange", t, e), this.__emit("change", t, e); }, handleChange(e) { const { disabled: t } = this.$props; let l = e; if (this.isValid(l) && !t) { const n = ke(void 0, this.$data, this.$props); return l > n ? l = n : l < 1 && (l = 1), lt(this, "current") || this.setState({ stateCurrent: l, stateCurrentInputValue: l }), this.__emit("update:current", l), this.__emit("change", l, this.statePageSize), l; } return this.stateCurrent; }, prev() { this.hasPrev() && this.handleChange(this.stateCurrent - 1); }, next() { this.hasNext() && this.handleChange(this.stateCurrent + 1); }, jumpPrev() { this.handleChange(this.getJumpPrevPage()); }, jumpNext() { this.handleChange(this.getJumpNextPage()); }, hasPrev() { return this.stateCurrent > 1; }, hasNext() { return this.stateCurrent < ke(void 0, this.$data, this.$props); }, getShowSizeChanger() { const { showSizeChanger: e, total: t, totalBoundaryShowSizeChanger: l } = this.$props; return typeof e != "undefined" ? e : t > l; }, runIfEnter(e, t) { if (e.key === "Enter" || e.charCode === 13) { e.preventDefault(); for (var l = arguments.length, n = new Array(l > 2 ? l - 2 : 0), o = 2; o < l; o++) n[o - 2] = arguments[o]; t(...n); } }, runIfEnterPrev(e) { this.runIfEnter(e, this.prev); }, runIfEnterNext(e) { this.runIfEnter(e, this.next); }, runIfEnterJumpPrev(e) { this.runIfEnter(e, this.jumpPrev); }, runIfEnterJumpNext(e) { this.runIfEnter(e, this.jumpNext); }, handleGoTO(e) { (e.keyCode === Le.ENTER || e.type === "click") && this.handleChange(this.stateCurrentInputValue); }, renderPrev(e) { const { itemRender: t } = this.$props, l = t({ page: e, type: "prev", originalElement: this.getItemIcon("prevIcon", "prev page") }), n = !this.hasPrev(); return Pt(l) ? Gt(l, n ? { disabled: n } : {}) : l; }, renderNext(e) { const { itemRender: t } = this.$props, l = t({ page: e, type: "next", originalElement: this.getItemIcon("nextIcon", "next page") }), n = !this.hasNext(); return Pt(l) ? Gt(l, n ? { disabled: n } : {}) : l; } }, render() { const { prefixCls: e, disabled: t, hideOnSinglePage: l, total: n, locale: o, showQuickJumper: r, showLessItems: a, showTitle: i, showTotal: s, simple: p, itemRender: c, showPrevNextJumpers: f, jumpPrevIcon: x, jumpNextIcon: $, selectComponentClass: b, selectPrefixCls: m, pageSizeOptions: v } = this.$props, { stateCurrent: h, statePageSize: y } = this, d = hl(this.$attrs).extraAttrs, { class: E } = d, O = fo(d, ["class"]); if (l === !0 && this.total <= y) return null; const z = ke(void 0, this.$data, this.$props), S = []; let H = null, T = null, R = null, k = null, B = null; const M = r && r.goButton, J = a ? 1 : 2, Z = h - 1 > 0 ? h - 1 : 0, ee = h + 1 < z ? h + 1 : z, fe = this.hasPrev(), le = this.hasNext(); if (p) return M && (typeof M == "boolean" ? B = u("button", { type: "button", onClick: this.handleGoTO, onKeyup: this.handleGoTO }, [o.jump_to_confirm]) : B = u("span", { onClick: this.handleGoTO, onKeyup: this.handleGoTO }, [M]), B = u("li", { title: i ? `${o.jump_to}${h}/${z}` : null, class: `${e}-simple-pager` }, [B])), u("ul", G({ class: te(`${e} ${e}-simple`, { [`${e}-disabled`]: t }, E) }, O), [u("li", { title: i ? o.prev_page : null, onClick: this.prev, tabindex: fe ? 0 : null, onKeypress: this.runIfEnterPrev, class: te(`${e}-prev`, { [`${e}-disabled`]: !fe }), "aria-disabled": !fe }, [this.renderPrev(Z)]), u("li", { title: i ? `${h}/${z}` : null, class: `${e}-simple-pager` }, [u(wn, { type: "text", value: this.stateCurrentInputValue, disabled: t, onKeydown: this.handleKeyDown, onKeyup: this.handleKeyUp, onInput: this.handleKeyUp, onChange: this.handleKeyUp, size: "3" }, null), u("span", { class: `${e}-slash` }, [At("/")]), z]), u("li", { title: i ? o.next_page : null, onClick: this.next, tabindex: le ? 0 : null, onKeypress: this.runIfEnterNext, class: te(`${e}-next`, { [`${e}-disabled`]: !le }), "aria-disabled": !le }, [this.renderNext(ee)]), B]); if (z <= 3 + J * 2) { const K = { locale: o, rootPrefixCls: e, showTitle: i, itemRender: c, onClick: this.handleChange, onKeypress: this.runIfEnter }; z || S.push(u(je, G(G({}, K), {}, { key: "noPager", page: 1, class: `${e}-item-disabled` }), null)); for (let N = 1; N <= z; N += 1) { const A = h === N; S.push(u(je, G(G({}, K), {}, { key: N, page: N, active: A }), null)); } } else { const K = a ? o.prev_3 : o.prev_5, N = a ? o.next_3 : o.next_5; f && (H = u("li", { title: this.showTitle ? K : null, key: "prev", onClick: this.jumpPrev, tabindex: "0", onKeypress: this.runIfEnterJumpPrev, class: te(`${e}-jump-prev`, { [`${e}-jump-prev-custom-icon`]: !!x }) }, [c({ page: this.getJumpPrevPage(), type: "jump-prev", originalElement: this.getItemIcon("jumpPrevIcon", "prev page") })]), T = u("li", { title: this.showTitle ? N : null, key: "next", tabindex: "0", onClick: this.jumpNext, onKeypress: this.runIfEnterJumpNext, class: te(`${e}-jump-next`, { [`${e}-jump-next-custom-icon`]: !!$ }) }, [c({ page: this.getJumpNextPage(), type: "jump-next", originalElement: this.getItemIcon("jumpNextIcon", "next page") })])), k = u(je, { locale: o, last: !0, rootPrefixCls: e, onClick: this.handleChange, onKeypress: this.runIfEnter, key: z, page: z, active: !1, showTitle: i, itemRender: c }, null), R = u(je, { locale: o, rootPrefixCls: e, onClick: this.handleChange, onKeypress: this.runIfEnter, key: 1, page: 1, active: !1, showTitle: i, itemRender: c }, null); let A = Math.max(1, h - J), F = Math.min(h + J, z); h - 1 <= J && (F = 1 + J * 2), z - h <= J && (A = z - J * 2); for (let oe = A; oe <= F; oe += 1) { const V = h === oe; S.push(u(je, { locale: o, rootPrefixCls: e, onClick: this.handleChange, onKeypress: this.runIfEnter, key: oe, page: oe, active: V, showTitle: i, itemRender: c }, null)); } h - 1 >= J * 2 && h !== 3 && (S[0] = u(je, { locale: o, rootPrefixCls: e, onClick: this.handleChange, onKeypress: this.runIfEnter, key: A, page: A, class: `${e}-item-after-jump-prev`, active: !1, showTitle: this.showTitle, itemRender: c }, null), S.unshift(H)), z - h >= J * 2 && h !== z - 2 && (S[S.length - 1] = u(je, { locale: o, rootPrefixCls: e, onClick: this.handleChange, onKeypress: this.runIfEnter, key: F, page: F, class: `${e}-item-before-jump-next`, active: !1, showTitle: this.showTitle, itemRender: c }, null), S.push(T)), A !== 1 && S.unshift(R), F !== z && S.push(k); } let L = null; s && (L = u("li", { class: `${e}-total-text` }, [s(n, [n === 0 ? 0 : (h - 1) * y + 1, h * y > n ? n : h * y])])); const j = !fe || !z, q = !le || !z, w = this.buildOptionText || this.$slots.buildOptionText; return u("ul", G(G({ unselectable: "on", ref: "paginationNode" }, O), {}, { class: te({ [`${e}`]: !0, [`${e}-disabled`]: t }, E) }), [L, u("li", { title: i ? o.prev_page : null, onClick: this.prev, tabindex: j ? null : 0, onKeypress: this.runIfEnterPrev, class: te(`${e}-prev`, { [`${e}-disabled`]: j }), "aria-disabled": j }, [this.renderPrev(Z)]), S, u("li", { title: i ? o.next_page : null, onClick: this.next, tabindex: q ? null : 0, onKeypress: this.runIfEnterNext, class: te(`${e}-next`, { [`${e}-disabled`]: q }), "aria-disabled": q }, [this.renderNext(ee)]), u(uo, { disabled: t, locale: o, rootPrefixCls: e, selectComponentClass: b, selectPrefixCls: m, changeSize: this.getShowSizeChanger() ? this.changePageSize : null, current: h, pageSize: y, pageSizeOptions: v, buildOptionText: w || null, quickGo: this.shouldDisplayQuickJumper() ? this.handleChange : null, goButton: M }, null)]); } }), ho = (e) => { const { componentCls: t } = e; return { [`${t}-disabled`]: { "&, &:hover": { cursor: "not-allowed", [`${t}-item-link`]: { color: e.colorTextDisabled, cursor: "not-allowed" } }, "&:focus-visible": { cursor: "not-allowed", [`${t}-item-link`]: { color: e.colorTextDisabled, cursor: "not-allowed" } } }, [`&${t}-disabled`]: { cursor: "not-allowed", [`&${t}-mini`]: { [` &:hover ${t}-item:not(${t}-item-active), &:active ${t}-item:not(${t}-item-active), &:hover ${t}-item-link, &:active ${t}-item-link `]: { backgroundColor: "transparent" } }, [`${t}-item`]: { cursor: "not-allowed", "&:hover, &:active": { backgroundColor: "transparent" }, a: { color: e.colorTextDisabled, backgroundColor: "transparent", border: "none", cursor: "not-allowed" }, "&-active": { borderColor: e.colorBorder, backgroundColor: e.paginationItemDisabledBgActive, "&:hover, &:active": { backgroundColor: e.paginationItemDisabledBgActive }, a: { color: e.paginationItemDisabledColorActive } } }, [`${t}-item-link`]: { color: e.colorTextDisabled, cursor: "not-allowed", "&:hover, &:active": { backgroundColor: "transparent" }, [`${t}-simple&`]: { backgroundColor: "transparent", "&:hover, &:active": { backgroundColor: "transparent" } } }, [`${t}-simple-pager`]: { color: e.colorTextDisabled }, [`${t}-jump-prev, ${t}-jump-next`]: { [`${t}-item-link-icon`]: { opacity: 0 }, [`${t}-item-ellipsis`]: { opacity: 1 } } }, [`&${t}-simple`]: { [`${t}-prev, ${t}-next`]: { [`&${t}-disabled ${t}-item-link`]: { "&:hover, &:active": { backgroundColor: "transparent" } } } } }; }, go = (e) => { const { componentCls: t } = e; return { [`&${t}-mini ${t}-total-text, &${t}-mini ${t}-simple-pager`]: { height: e.paginationItemSizeSM, lineHeight: `${e.paginationItemSizeSM}px` }, [`&${t}-mini ${t}-item`]: { minWidth: e.paginationItemSizeSM, height: e.paginationItemSizeSM, margin: 0, lineHeight: `${e.paginationItemSizeSM - 2}px` }, [`&${t}-mini ${t}-item:not(${t}-item-active)`]: { backgroundColor: "transparent", borderColor: "transparent", "&:hover": { backgroundColor: e.colorBgTextHover }, "&:active": { backgroundColor: e.colorBgTextActive } }, [`&${t}-mini ${t}-prev, &${t}-mini ${t}-next`]: { minWidth: e.paginationItemSizeSM, height: e.paginationItemSizeSM, margin: 0, lineHeight: `${e.paginationItemSizeSM}px`, [`&:hover ${t}-item-link`]: { backgroundColor: e.colorBgTextHover }, [`&:active ${t}-item-link`]: { backgroundColor: e.colorBgTextActive }, [`&${t}-disabled:hover ${t}-item-link`]: { backgroundColor: "transparent" } }, [` &${t}-mini ${t}-prev ${t}-item-link, &${t}-mini ${t}-next ${t}-item-link `]: { backgroundColor: "transparent", borderColor: "transparent", "&::after": { height: e.paginationItemSizeSM, lineHeight: `${e.paginationItemSizeSM}px` } }, [`&${t}-mini ${t}-jump-prev, &${t}-mini ${t}-jump-next`]: { height: e.paginationItemSizeSM, marginInlineEnd: 0, lineHeight: `${e.paginationItemSizeSM}px` }, [`&${t}-mini ${t}-options`]: { marginInlineStart: e.paginationMiniOptionsMarginInlineStart, "&-size-changer": { top: e.paginationMiniOptionsSizeChangerTop }, "&-quick-jumper": { height: e.paginationItemSizeSM, lineHeight: `${e.paginationItemSizeSM}px`, input: g(g({}, xl(e)), { width: e.paginationMiniQuickJumperInputWidth, height: e.controlHeightSM }) } } }; }, xo = (e) => { const { componentCls: t } = e; return { [` &${t}-simple ${t}-prev, &${t}-simple ${t}-next `]: { height: e.paginationItemSizeSM, lineHeight: `${e.paginationItemSizeSM}px`, verticalAlign: "top", [`${t}-item-link`]: { height: e.paginationItemSizeSM, backgroundColor: "transparent", border: 0, "&:hover": { backgroundColor: e.colorBgTextHover }, "&:active": { backgroundColor: e.colorBgTextActive }, "&::after": { height: e.paginationItemSizeSM, lineHeight: `${e.paginationItemSizeSM}px` } } }, [`&${t}-simple ${t}-simple-pager`]: { display: "inline-block", height: e.paginationItemSizeSM, marginInlineEnd: e.marginXS, input: { boxSizing: "border-box", height: "100%", marginInlineEnd: e.marginXS, padding: `0 ${e.paginationItemPaddingInline}px`, textAlign: "center", backgroundColor: e.paginationItemInputBg, border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`, borderRadius: e.borderRadius, outline: "none", transition: `border-color ${e.motionDurationMid}`, color: "inherit", "&:hover": { borderColor: e.colorPrimary }, "&:focus": { borderColor: e.colorPrimaryHover, boxShadow: `${e.inputOutlineOffset}px 0 ${e.controlOutlineWidth}px ${e.controlOutline}` }, "&[disabled]": { color: e.colorTextDisabled, backgroundColor: e.colorBgContainerDisabled, borderColor: e.colorBorder, cursor: "not-allowed" } } } }; }, bo = (e) => { const { componentCls: t } = e; return { [`${t}-jump-prev, ${t}-jump-next`]: { outline: 0, [`${t}-item-container`]: { position: "relative", [`${t}-item-link-icon`]: { color: e.colorPrimary, fontSize: e.fontSizeSM, opacity: 0, transition: `all ${e.motionDurationMid}`, "&-svg": { top: 0, insetInlineEnd: 0, bottom: 0, insetInlineStart: 0, margin: "auto" } }, [`${t}-item-ellipsis`]: { position: "absolute", top: 0, insetInlineEnd: 0, bottom: 0, insetInlineStart: 0, display: "block", margin: "auto", color: e.colorTextDisabled, fontFamily: "Arial, Helvetica, sans-serif", letterSpacing: e.paginationEllipsisLetterSpacing, textAlign: "center", textIndent: e.paginationEllipsisTextIndent, opacity: 1, transition: `all ${e.motionDurationMid}` } }, "&:hover": { [`${t}-item-link-icon`]: { opacity: 1 }, [`${t}-item-ellipsis`]: { opacity: 0 } }, "&:focus-visible": g({ [`${t}-item-link-icon`]: { opacity: 1 }, [`${t}-item-ellipsis`]: { opacity: 0 } }, Jt(e)) }, [` ${t}-prev, ${t}-jump-prev, ${t}-jump-next `]: { marginInlineEnd: e.marginXS }, [` ${t}-prev, ${t}-next, ${t}-jump-prev, ${t}-jump-next `]: { display: "inline-block", minWidth: e.paginationItemSize, height: e.paginationItemSize, color: e.colorText, fontFamily: e.paginationFontFamily, lineHeight: `${e.paginationItemSize}px`, textAlign: "center", verticalAlign: "middle", listStyle: "none", borderRadius: e.borderRadius, cursor: "pointer", transition: `all ${e.motionDurationMid}` }, [`${t}-prev, ${t}-next`]: { fontFamily: "Arial, Helvetica, sans-serif", outline: 0, button: { color: e.colorText, cursor: "pointer", userSelect: "none" }, [`${t}-item-link`]: { display: "block", width: "100%", height: "100%", padding: 0, fontSize: e.fontSizeSM, textAlign: "center", backgroundColor: "transparent", border: `${e.lineWidth}px ${e.lineType} transparent`, borderRadius: e.borderRadius, outline: "none", transition: `all ${e.motionDurationMid}` }, [`&:focus-visible ${t}-item-link`]: g({}, Jt(e)), [`&:hover ${t}-item-link`]: { backgroundColor: e.colorBgTextHover }, [`&:active ${t}-item-link`]: { backgroundColor: e.colorBgTextActive }, [`&${t}-disabled:hover`]: { [`${t}-item-link`]: { backgroundColor: "transparent" } } }, [`${t}-slash`]: { marginInlineEnd: e.paginationSlashMarginInlineEnd, marginInlineStart: e.paginationSlashMarginInlineStart }, [`${t}-options`]: { display: "inline-block", marginInlineStart: e.margin, verticalAlign: "middle", "&-size-changer.-select": { display: "inline-block", width: "auto" }, "&-quick-jumper": { display: "inline-block", height: e.controlHeight, marginInlineStart: e.marginXS, lineHeight: `${e.controlHeight}px`, verticalAlign: "top", input: g(g({}, bl(e)), { width: e.controlHeightLG * 1.25, height: e.controlHeight, boxSizing: "border-box", margin: 0, marginInlineStart: e.marginXS, marginInlineEnd: e.marginXS }) } } }; }, yo = (e) => { const { componentCls: t } = e; return { [`${t}-item`]: g(g({ display: "inline-block", minWidth: e.paginationItemSize, height: e.paginationItemSize, marginInlineEnd: e.marginXS, fontFamily: e.paginationFontFamily, lineHeight: `${e.paginationItemSize - 2}px`, textAlign: "center", verticalAlign: "middle", listStyle: "none", backgroundColor: "transparent", border: `${e.lineWidth}px ${e.lineType} transparent`, borderRadius: e.borderRadius, outline: 0, cursor: "pointer", userSelect: "none", a: { display: "block", padding: `0 ${e.paginationItemPaddingInline}px`, color: e.colorText, transition: "none", "&:hover": { textDecoration: "none" } }, [`&:not(${t}-item-active)`]: { "&:hover": { transition: `all ${e.motionDurationMid}`, backgroundColor: e.colorBgTextHover }, "&:active": { backgroundColor: e.colorBgTextActive } } }, yl(e)), { "&-active": { fontWeight: e.paginationFontWeightActive, backgroundColor: e.paginationItemBgActive, borderColor: e.colorPrimary, a: { color: e.colorPrimary }, "&:hover": { borderColor: e.colorPrimaryHover }, "&:hover a": { color: e.colorPrimaryHover } } }) }; }, Co = (e) => { const { componentCls: t } = e; return { [t]: g(g(g(g(g(g(g(g({}, Dt(e)), { "ul, ol": { margin: 0, padding: 0, listStyle: "none" }, "&::after": { display: "block", clear: "both", height: 0, overflow: "hidden", visibility: "hidden", content: '""' }, [`${t}-total-text`]: { display: "inline-block", height: e.paginationItemSize, marginInlineEnd: e.marginXS, lineHeight: `${e.paginationItemSize - 2}px`, verticalAlign: "middle" } }), yo(e)), bo(e)), xo(e)), go(e)), ho(e)), { // media query style [`@media only screen and (max-width: ${e.screenLG}px)`]: { [`${t}-item`]: { "&-after-jump-prev, &-before-jump-next": { display: "none" } } }, [`@media only screen and (max-width: ${e.screenSM}px)`]: { [`${t}-options`]: { display: "none" } } }), // rtl style [`&${e.componentCls}-rtl`]: { direction: "rtl" } }; }, So = (e) => { const { componentCls: t } = e; return { [`${t}${t}-disabled`]: { "&, &:hover": { [`${t}-item-link`]: { borderColor: e.colorBorder } }, "&:focus-visible": { [`${t}-item-link`]: { borderColor: e.colorBorder } }, [`${t}-item, ${t}-item-link`]: { backgroundColor: e.colorBgContainerDisabled, borderColor: e.colorBorder, [`&:hover:not(${t}-item-active)`]: { backgroundColor: e.colorBgContainerDisabled, borderColor: e.colorBorder, a: { color: e.colorTextDisabled } }, [`&${t}-item-active`]: { backgroundColor: e.paginationItemDisabledBgActive } }, [`${t}-prev, ${t}-next`]: { "&:hover button": { backgroundColor: e.colorBgContainerDisabled, borderColor: e.colorBorder, color: e.colorTextDisabled }, [`${t}-item-link`]: { backgroundColor: e.colorBgContainerDisabled, borderColor: e.colorBorder } } }, [t]: { [`${t}-prev, ${t}-next`]: { "&:hover button": { borderColor: e.colorPrimaryHover, backgroundColor: e.paginationItemBg }, [`${t}-item-link`]: { backgroundColor: e.paginationItemLinkBg, borderColor: e.colorBorder }, [`&:hover ${t}-item-link`]: { borderColor: e.colorPrimary, backgroundColor: e.paginationItemBg, color: e.colorPrimary }, [`&${t}-disabled`]: { [`${t}-item-link`]: { borderColor: e.colorBorder, color: e.colorTextDisabled } } }, [`${t}-item`]: { backgroundColor: e.paginationItemBg, border: `${e.lineWidth}px ${e.lineType} ${e.colorBorder}`, [`&:hover:not(${t}-item-active)`]: { borderColor: e.colorPrimary, backgroundColor: e.paginationItemBg, a: { color: e.colorPrimary } }, "&-active": { borderColor: e.colorPrimary } } } }; }, $o = In("Pagination", (e) => { const t = Pn(e, { paginationItemSize: e.controlHeight, paginationFontFamily: e.fontFamily, paginationItemBg: e.colorBgContainer, paginationItemBgActive: e.colorBgContainer, paginationFontWeightActive: e.fontWeightStrong, paginationItemSizeSM: e.controlHeightSM, paginationItemInputBg: e.colorBgContainer, paginationMiniOptionsSizeChangerTop: 0, paginationItemDisabledBgActive: e.controlItemBgActiveDisabled, paginationItemDisabledColorActive: e.colorTextDisabled, paginationItemLinkBg: e.colorBgContainer, inputOutlineOffset: "0 0", paginationMiniOptionsMarginInlineStart: e.marginXXS / 2, paginationMiniQuickJumperInputWidth: e.controlHeightLG * 1.1, paginationItemPaddingInline: e.marginXXS * 1.5, paginationEllipsisLetterSpacing: e.marginXXS / 2, paginationSlashMarginInlineStart: e.marginXXS, paginationSlashMarginInlineEnd: e.marginSM, paginationEllipsisTextIndent: "0.13em" // magic for ui experience }, gl(e)); return [Co(t), e.wireframe && So(t)]; }); var wo = function(e, t) { var l = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (l[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++) t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (l[n[o]] = e[n[o]]); return l; }; const Io = () => ({ total: Number, defaultCurrent: Number, disabled: Be(), current: Number, defaultPageSize: Number, pageSize: Number, hideOnSinglePage: Be(), showSizeChanger: Be(), pageSizeOptions: qe(), buildOptionText: se(), showQuickJumper: De([Boolean, Object]), showTotal: se(), size: Ke(), simple: Be(), locale: Object, prefixCls: String, selectPrefixCls: String, totalBoundaryShowSizeChanger: Number, selectComponentClass: String, itemRender: se(), role: String, responsive: Boolean, showLessItems: Be(), onChange: se(), onShowSizeChange: se(), "onUpdate:current": se(), "onUpdate:pageSize": se() }), Po = ue({ compatConfig: { MODE: 3 }, name: "APagination", inheritAttrs: !1, props: Io(), // emits: ['change', 'showSizeChange', 'update:current', 'update:pageSize'], setup(e, t) { let { slots: l, attrs: n } = t; const { prefixCls: o, configProvider: r, direction: a, size: i } = Kt("pagination", e), [s, p] = $o(o), c = C(() => r.getPrefixCls("select", e.selectPrefixCls)), f = En(), [x] = Tn("Pagination", Cl, xe(e, "locale")), $ = (b) => { const m = u("span", { class: `${b}-item-ellipsis` }, [At("•••")]), v = u("button", { class: `${b}-item-link`, type: "button", tabindex: -1 }, [a.value === "rtl" ? u(qt, null, null) : u(Yt, null, null)]), h = u("button", { class: `${b}-item-link`, type: "button", tabindex: -1 }, [a.value === "rtl" ? u(Yt, null, null) : u(qt, null, null)]), y = u("a", { rel: "nofollow", class: `${b}-item-link` }, [u("div", { class: `${b}-item-container` }, [a.value === "rtl" ? u(Qt, { class: `${b}-item-link-icon` }, null) : u(Zt, { class: `${b}-item-link-icon` }, null), m])]), d = u("a", { rel: "nofollow", class: `${b}-item-link` }, [u("div", { class: `${b}-item-container` }, [a.value === "rtl" ? u(Zt, { class: `${b}-item-link-icon` }, null) : u(Qt, { class: `${b}-item-link-icon` }, null), m])]); return { prevIcon: v, nextIcon: h, jumpPrevIcon: y, jumpNextIcon: d }; }; return () => { var b; const { itemRender: m = l.itemRender, buildOptionText: v = l.buildOptionText, selectComponentClass: h, responsive: y } = e, d = wo(e, ["itemRender", "buildOptionText", "selectComponentClass", "responsive"]), E = i.value === "small" || !!(!((b = f.value) === null || b === void 0) && b.xs && !i.value && y), O = g(g(g(g(g({}, d), $(o.value)), { prefixCls: o.value, selectPrefixCls: c.value, selectComponentClass: h || (E ? so : co), locale: x.value, buildOptionText: v }), n), { class: te({ [`${o.value}-mini`]: E, [`${o.value}-rtl`]: a.value === "rtl" }, n.class, p.value), itemRender: m }); return s(u(vo, O, null)); }; } }), Eo = Sl(Po), _n = Symbol("TableContextProps"), To = (e) => { Me(_n, e); }, Ae = () => He(_n, {}), Ro = "RC_TABLE_KEY"; function Dn(e) { return e == null ? [] : Array.isArray(e) ? e : [e]; } function Kn(e, t) { if (!t && typeof t != "number") return e; const l = Dn(t); let n = e; for (let o = 0; o < l.length; o += 1) { if (!n) return null; const r = l[o]; n = n[r]; } return n; } function ht(e) { const t = [], l = {}; return e.forEach((n) => { const { key: o, dataIndex: r } = n || {}; let a = o || Dn(r).join("-") || Ro; for (; l[a]; ) a = `${a}_next`; l[a] = !0, t.push(a); }), t; } function Oo() { const e = {}; function t(r, a) { a && Object.keys(a).forEach((i) => { const s = a[i]; s && typeof s == "object" ? (r[i] = r[i] || {}, t(r[i], s)) : r[i] = s; }); } for (var l = arguments.length, n = new Array(l), o = 0; o < l; o++) n[o] = arguments[o]; return n.forEach((r) => { t(e, r); }), e; } function Et(e) { return e != null; } const Fn = Symbol("SlotsContextProps"), No = (e) => { Me(Fn, e); }, Mt = () => He(Fn, C(() => ({}))), An = Symbol("ContextProps"), Bo = (e) => { Me(An, e); }, zo = () => He(An, { onResizeColumn: () => { } }), Ze = "RC_TABLE_INTERNAL_COL_DEFINE", Mn = Symbol("HoverContextProps"), ko = (e) => { Me(Mn, e); }, _o = () => He(Mn, { startRow: ce(-1), endRow: ce(-1), onHover() { } }), Tt = ce(!1), Do = () => { et(() => { Tt.value = Tt.value || $l("position", "sticky"); }); }, Ko = () => Tt; var Fo = function(e, t) { var l = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (l[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++) t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (l[n[o]] = e[n[o]]); return l; }; function Ao(e, t, l, n) { const o = e + t - 1; return e <= n && o >= l; } function Mo(e) { return e && typeof e == "object" && !Array.isArray(e) && !ut(e); } const Ht = ue({ name: "Cell", props: ["prefixCls", "record", "index", "renderIndex", "dataIndex", "customRender", "component", "colSpan", "rowSpan", "fixLeft", "fixRight", "firstFixLeft", "lastFixLeft", "firstFixRight", "lastFixRight", "appendNode", "additionalProps", "ellipsis", "align", "rowType", "isSticky", "column", "cellType", "transformCellText"], setup(e, t) { let { slots: l } = t; const n = Mt(), { onHover: o, startRow: r, endRow: a } = _o(), i = C(() => { var m, v, h, y; return (h = (m = e.colSpan) !== null && m !== void 0 ? m : (v = e.additionalProps) === null || v === void 0 ? void 0 : v.colSpan) !== null && h !== void 0 ? h : (y = e.additionalProps) === null || y === void 0 ? void 0 : y.colspan; }), s = C(() => { var m, v, h, y; return (h = (m = e.rowSpan) !== null && m !== void 0 ? m : (v = e.additionalProps) === null || v === void 0 ? void 0 : v.rowSpan) !== null && h !== void 0 ? h : (y = e.additionalProps) === null || y === void 0 ? void 0 : y.rowspan; }), p = wl(() => { const { index: m } = e; return Ao(m, s.value || 1, r.value, a.value); }), c = Ko(), f = (m, v) => { var h; const { record: y, index: d, additionalProps: E } = e; y && o(d, d + v - 1), (h = E == null ? void 0 : E.onMouseenter) === null || h === void 0 || h.call(E, m); }, x = (m) => { var v; const { record: h, additionalProps: y } = e; h && o(-1, -1), (v = y == null ? void 0 : y.onMouseleave) === null || v === void 0 || v.call(y, m); }, $ = (m) => { const v = Tl(m)[0]; return ut(v) ? v.type === Jl ? v.children : Array.isArray(v.children) ? $(v.children) : void 0 : v; }, b = ce(null); return Fe([p, () => e.prefixCls, b], () => { const m = Il(b.value); m && (p.value ? Pl(m, `${e.prefixCls}-cell-row-hover`) : El(m, `${e.prefixCls}-cell-row-hover`)); }), () => { var m, v, h, y, d, E; const { prefixCls: O, record: z, index: S, renderIndex: H, dataIndex: T, customRender: R, component: k = "td", fixLeft: B, fixRight: M, firstFixLeft: J, lastFixLeft: Z, firstFixRight: ee, lastFixRight: fe, appendNode: le = (m = l.appendNode) === null || m === void 0 ? void 0 : m.call(l), additionalProps: L = {}, ellipsis: j, align: q, rowType: w, isSticky: K, column: N = {}, cellType: A } = e, F = `${O}-cell`; let oe, V; const ge = (v = l.default) === null || v === void 0 ? void 0 : v.call(l); if (Et(ge) || A === "header") V = ge; else { const ae = Kn(z, T); if (V = ae, R) { const I = R({ text: ae, value: ae, record: z, index: S, renderIndex: H, column: N.__originColumn__ }); Mo(I) ? (process.env.NODE_ENV !== "production" && ze(!1, "`columns.customRender` return cell props is deprecated with perf issue, please use `customCell` instead."), V = I.children, oe = I.props) : V = I; } if (!(Ze in N) && A === "body" && n.value.bodyCell && !(!((h = N.slots) === null || h === void 0) && h.customRender)) { const I = Ft(n.value, "bodyCell", { text: ae, value: ae, record: z, index: S, column: N.__originColumn__ }, () => { const P = V === void 0 ? ae : V; return [typeof P == "object" && Pt(P) || typeof P != "object" ? P : null]; }); V = Rn(I); } e.transformCellText && (V = e.transformCellText({ text: V, record: z, index: S, column: N.__originColumn__ })); } typeof V == "object" && !Array.isArray(V) && !ut(V) && (V = null), j && (Z || ee) && (V = u("span", { class: `${F}-content` }, [V])), Array.isArray(V) && V.length === 1 && (V = V[0]); const be = oe || {}, { colSpan: Se, rowSpan: Ee, style: Oe, class: ye } = be, $e = Fo(be, ["colSpan", "rowSpan", "style", "class"]), _ = (y = Se !== void 0 ? Se : i.value) !== null && y !== void 0 ? y : 1, Y = (d = Ee !== void 0 ? Ee : s.value) !== null && d !== void 0 ? d : 1; if (_ === 0 || Y === 0) return null; const D = {}, W = typeof B == "number" && c.value, X = typeof M == "number" && c.value; W && (D.position = "sticky", D.left = `${B}px`), X && (D.position = "sticky", D.right = `${M}px`); const re = {}; q && (re.textAlign = q); let U; const ne = j === !0 ? { showTitle: !0 } : j; ne && (ne.showTitle || w === "header") && (typeof V == "string" || typeof V == "number" ? U = V.toString() : ut(V) && (U = $([V]))); const he = g(g(g({ title: U }, $e), L), { colSpan: _ !== 1 ? _ : null, rowSpan: Y !== 1 ? Y : null, class: te(F, { [`${F}-fix-left`]: W && c.value, [`${F}-fix-left-first`]: J && c.value, [`${F}-fix-left-last`]: Z && c.value, [`${F}-fix-right`]: X && c.value, [`${F}-fix-right-first`]: ee && c.value, [`${F}-fix-right-last`]: fe && c.value, [`${F}-ellipsis`]: j, [`${F}-with-append`]: le, [`${F}-fix-sticky`]: (W || X) && K && c.value }, L.class, ye), onMouseenter: (ae) => { f(ae, Y); }, onMouseleave: x, style: [L.style, re, D, Oe] }); return u(k, G(G({}, he), {}, { ref: b }), { default: () => [le, V, (E = l.dragHandle) === null || E === void 0 ? void 0 : E.call(l)] }); }; } }); function Hn(e, t, l, n, o) { const r = l[e] || {}, a = l[t] || {}; let i, s; r.fixed === "left" ? i = n.left[e] : a.fixed === "right" && (s = n.right[t]); let p = !1, c = !1, f = !1, x = !1; const $ = l[t + 1], b = l[e - 1]; return o === "rtl" ? i !== void 0 ? x = !(b && b.fixed === "left") : s !== void 0 && (f = !($ && $.fixed === "right")) : i !== void 0 ? p = !($ && $.fixed === "left") : s !== void 0 && (c = !(b && b.fixed === "right")), { fixLeft: i, fixRight: s, lastFixLeft: p, firstFixRight: c, lastFixRight: f, firstFixLeft: x, isSticky: n.isSticky }; } const rn = { mouse: { start: "mousedown", move: "mousemove", stop: "mouseup" }, touch: { start: "touchstart", move: "touchmove", stop: "touchend" } }, an = 50, Ho = ue({ compatConfig: { MODE: 3 }, name: "DragHandle", props: { prefixCls: String, width: { type: Number, required: !0 }, minWidth: { type: Number, default: an }, maxWidth: { type: Number, default: 1 / 0 }, column: { type: Object, default: void 0 } }, setup(e) { let t = 0, l = { remove: () => { } }, n = { remove: () => { } }; const o = () => { l.remove(), n.remove(); }; ql(() => { o(); }), Re(() => { Te(!isNaN(e.width), "Table", "width must be a number when use resizable"); }); const { onResizeColumn: r } = zo(), a = C(() => typeof e.minWidth == "number" && !isNaN(e.minWidth) ? e.minWidth : an), i = C(() => typeof e.maxWidth == "number" && !isNaN(e.maxWidth) ? e.maxWidth : 1 / 0), s = Yl(); let p = 0; const c = ce(!1); let f; const x = (d) => { let E = 0; d.touches ? d.touches.length ? E = d.touches[0].pageX : E = d.changedTouches[0].pageX : E = d.pageX; const O = t - E; let z = Math.max(p - O, a.value); z = Math.min(z, i.value), rt.cancel(f), f = rt(() => { r(z, e.column.__originColumn__); }); }, $ = (d) => { x(d); }, b = (d) => { c.value = !1, x(d), o(); }, m = (d, E) => { c.value = !0, o(), p = s.vnode.el.parentNode.getBoundingClientRect().width, !(d instanceof MouseEvent && d.which !== 1) && (d.stopPropagation && d.stopPropagation(), t = d.touches ? d.touches[0].pageX : d.pageX, l = We(document.documentElement, E.move, $), n = We(document.documentElement, E.stop, b)); }, v = (d) => { d.stopPropagation(), d.preventDefault(), m(d, rn.mouse); }, h = (d) => { d.stopPropagation(), d.preventDefault(), m(d, rn.touch); }, y = (d) => { d.stopPropagation(), d.preventDefault(); }; return () => { const { prefixCls: d } = e, E = { [Rl ? "onTouchstartPassive" : "onTouchstart"]: (O) => h(O) }; return u("div", G(G({ class: `${d}-resize-handle ${c.value ? "dragging" : ""}`, onMousedown: v }, E), {}, { onClick: y }), [u("div", { class: `${d}-resize-handle-line` }, null)]); }; } }), jo = ue({ name: "HeaderRow", props: ["cells", "stickyOffsets", "flattenColumns", "rowComponent", "cellComponent", "index", "customHeaderRow"], setup(e) { const t = Ae(); return () => { const { prefixCls: l, direction: n } = t, { cells: o, stickyOffsets: r, flattenColumns: a, rowComponent: i, cellComponent: s, customHeaderRow: p, index: c } = e; let f; p && (f = p(o.map(($) => $.column), c)); const x = ht(o.map(($) => $.column)); return u(i, f, { default: () => [o.map(($, b) => { const { column: m } = $, v = Hn($.colStart, $.colEnd, a, r, n); let h; m && m.customHeaderCell && (h = $.column.customHeaderCell(m)); const y = m; return u(Ht, G(G(G({}, $), {}, { cellType: "header", ellipsis: m.ellipsis, align: m.align, component: s, prefixCls: l, key: x[b] }, v), {}, { additionalProps: h, rowType: "header", column: m }), { default: () => m.title, dragHandle: () => y.resizable ? u(Ho, { prefixCls: l, width: y.width, minWidth: y.minWidth, maxWidth: y.maxWidth, column: y }, null) : null }); })] }); }; } }); function Lo(e) { const t = []; function l(o, r) { let a = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0; t[a] = t[a] || []; let i = r; return o.filter(Boolean).map((p) => { const c = { key: p.key, class: te(p.className, p.class), // children: column.title, column: p, colStart: i }; let f = 1; const x = p.children; return x && x.length > 0 && (f = l(x, i, a + 1).reduce(($, b) => $ + b, 0), c.hasSubColumns = !0), "colSpan" in p && ({ colSpan: f } = p), "rowSpan" in p && (c.rowSpan = p.rowSpan), c.colSpan = f, c.colEnd = c.colStart + f - 1, t[a].push(c), i += f, f; }); } l(e, 0); const n = t.length; for (let o = 0; o < n; o += 1) t[o].forEach((r) => { !("rowSpan" in r) && !r.hasSubColumns && (r.rowSpan = n - o); }); return t; } const sn = ue({ name: "TableHeader", inheritAttrs: !1, props: ["columns", "flattenColumns", "stickyOffsets", "customHeaderRow"], setup(e) { const t = Ae(), l = C(() => Lo(e.columns)); return () => { const { prefixCls: n, getComponent: o } = t, { stickyOffsets: r, flattenColumns: a, customHeaderRow: i } = e, s = o(["header", "wrapper"], "thead"), p = o(["header", "row"], "tr"), c = o(["header", "cell"], "th"); return u(s, { class: `${n}-thead` }, { default: () => [l.value.map((f, x) => u(jo, { key: x, flattenColumns: a, cells: f, stickyOffsets: r, rowComponent: p, cellComponent: c, customHeaderRow: i, index: x }, null))] }); }; } }), jn = Symbol("ExpandedRowProps"), Wo = (e) => { Me(jn, e); }, Vo = () => He(jn, {}), Ln = ue({ name: "ExpandedRow", inheritAttrs: !1, props: ["prefixCls", "component", "cellComponent", "expanded", "colSpan", "isEmpty"], setup(e, t) { let { slots: l, attrs: n } = t; const o = Ae(), r = Vo(), { fixHeader: a, fixColumn: i, componentWidth: s, horizonScroll: p } = r; return () => { const { prefixCls: c, component: f, cellComponent: x, expanded: $, colSpan: b, isEmpty: m } = e; return u(f, { class: n.class, style: { display: $ ? null : "none" } }, { default: () => [u(Ht, { component: x, prefixCls: c, colSpan: b }, { default: () => { var v; let h = (v = l.default) === null || v === void 0 ? void 0 : v.call(l); return (m ? p.value : i.value) && (h = u("div", { style: { width: `${s.value - (a.value ? o.scrollbarSize : 0)}px`, position: "sticky", left: 0, overflow: "hidden" }, class: `${c}-expanded-row-fixed` }, [h])), h; } })] }); }; } }), Xo = ue({ name: "MeasureCell", props: ["columnKey"], setup(e, t) { let { emit: l } = t; const n = pe(); return et(() => { n.value && l("columnResize", e.columnKey, n.value.offsetWidth); }), () => u(On, { onResize: (o) => { let { offsetWidth: r } = o; l("columnResize", e.columnKey, r); } }, { default: () => [u("td", { ref: n, style: { padding: 0, border: 0, height: 0 } }, [u("div", { style: { height: 0, overflow: "hidden" } }, [At(" ")])])] }); } }), Wn = Symbol("BodyContextProps"), Uo = (e) => { Me(Wn, e); }, Vn = () => He(Wn, {}), Go = ue({ name: "BodyRow", inheritAttrs: !1, props: ["record", "index", "renderIndex", "recordKey", "expandedKeys", "rowComponent", "cellComponent", "customRow", "rowExpandable", "indent", "rowKey", "getRowKey", "childrenColumnName"], setup(e, t) { let { attrs: l } = t; const n = Ae(), o = Vn(), r = ce(!1), a = C(() => e.expandedKeys && e.expandedKeys.has(e.recordKey)); Re(() => { a.value && (r.value = !0); }); const i = C(() => o.expandableType === "row" && (!e.rowExpandable || e.rowExpandable(e.record))), s = C(() => o.expandableType === "nest"), p = C(() => e.childrenColumnName && e.record && e.record[e.childrenColumnName]), c = C(() => i.value || s.value), f = (v, h) => { o.onTriggerExpand(v, h); }, x = C(() => { var v; return ((v = e.customRow) === null || v === void 0 ? void 0 : v.call(e, e.record, e.index)) || {}; }), $ = function(v) { var h, y; o.expandRowByClick && c.value && f(e.record, v); for (var d = arguments.length, E = new Array(d > 1 ? d - 1 : 0), O = 1; O < d; O++) E[O - 1] = arguments[O]; (y = (h = x.value) === null || h === void 0 ? void 0 : h.onClick) === null || y === void 0 || y.call(h, v, ...E); }, b = C(() => { const { record: v, index: h, indent: y } = e, { rowClassName: d } = o; return typeof d == "string" ? d : typeof d == "function" ? d(v, h, y) : ""; }), m = C(() => ht(o.flattenColumns)); return () => { const { class: v, style: h } = l, { record: y, index: d, rowKey: E, indent: O = 0, rowComponent: z, cellComponent: S } = e, { prefixCls: H, fixedInfoList: T, transformCellText: R } = n, { flattenColumns: k, expandedRowClassName: B, indentSize: M, expandIcon: J, expandedRowRender: Z, expandIconColumnIndex: ee } = o, fe = u(z, G(G({}, x.value), {}, { "data-row-key": E, class: te(v, `${H}-row`, `${H}-row-level-${O}`, b.value, x.value.class), style: [h, x.value.style], onClick: $ }), { default: () => [k.map((L, j) => { const { customRender: q, dataIndex: w, className: K } = L, N = m[j], A = T[j]; let F; L.customCell && (F = L.customCell(y, d, L)); const oe = j === (ee || 0) && s.value ? u(Xe, null, [u("span", { style: { paddingLeft: `${M * O}px` }, class: `${H}-row-indent indent-level-${O}` }, null), J({ prefixCls: H, expanded: a.value, expandable: p.value, record: y, onExpand: f })]) : null; return u(Ht, G(G({ cellType: "body", class: K, ellipsis: L.ellipsis, align: L.align, component: S, prefixCls: H, key: N, record: y, index: d, renderIndex: e.renderIndex, dataIndex: w, customRender: q }, A), {}, { additionalProps: F, column: L, transformCellText: R, appendNode: oe }), null); })] }); let le; if (i.value && (r.value || a.value)) { const L = Z({ record: y, index: d, indent: O + 1, expanded: a.value }), j = B && B(y, d, O); le = u(Ln, { expanded: a.value, class: te(`${H}-expanded-row`, `${H}-expanded-row-level-${O + 1}`, j), prefixCls: H, component: z, cellComponent: S, colSpan: k.length, isEmpty: !1 }, { default: () => [L] }); } return u(Xe, null, [fe, le]); }; } }); function Xn(e, t, l, n, o, r) { const a = []; a.push({ record: e, indent: t, index: r }); const i = o(e), s = n == null ? void 0 : n.has(i); if (e && Array.isArray(e[l]) && s) for (let p = 0; p < e[l].length; p += 1) { const c = Xn(e[l][p], t + 1, l, n, o, p); a.push(...c); } return a; } function Jo(e, t, l, n) { return C(() => { const r = t.value, a = l.value, i = e.value; if (a != null && a.size) { const s = []; for (let p = 0; p < (i == null ? void 0 : i.length); p += 1) { const c = i[p]; s.push(...Xn(c, 0, r, a, n.value, p)); } return s; } return i == null ? void 0 : i.map((s, p) => ({ record: s, indent: 0, index: p })); }); } const Un = Symbol("ResizeContextProps"), qo = (e) => { Me(Un, e); }, Yo = () => He(Un, { onColumnResize: () => { } }), Qo = ue({ name: "TableBody", props: ["data", "getRowKey", "measureColumnWidth", "expandedKeys", "customRow", "rowExpandable", "childrenColumnName"], setup(e, t) { let { slots: l } = t; const n = Yo(), o = Ae(), r = Vn(), a = Jo(xe(e, "data"), xe(e, "childrenColumnName"), xe(e, "expandedKeys"), xe(e, "getRowKey")), i = ce(-1), s = ce(-1); let p; return ko({ startRow: i, endRow: s, onHover: (c, f) => { clearTimeout(p), p = setTimeout(() => { i.value = c, s.value = f; }, 100); } }), () => { var c; const { data: f, getRowKey: x, measureColumnWidth: $, expandedKeys: b, customRow: m, rowExpandable: v, childrenColumnName: h } = e, { onColumnResize: y } = n, { prefixCls: d, getComponent: E } = o, { flattenColumns: O } = r, z = E(["body", "wrapper"], "tbody"), S = E(["body", "row"], "tr"), H = E(["body", "cell"], "td"); let T; f.length ? T = a.value.map((k, B) => { const { record: M, indent: J, index: Z } = k, ee = x(M, B); return u(Go, { key: ee, rowKey: ee, record: M, recordKey: ee, index: B, renderIndex: Z, rowComponent: S, cellComponent: H, expandedKeys: b, customRow: m, getRowKey: x, rowExpandable: v, childrenColumnName: h, indent: J }, null); }) : T = u(Ln, { expanded: !0, class: `${d}-placeholder`, prefixCls: d, component: S, cellComponent: H, colSpan: O.length, isEmpty: !0 }, { default: () => [(c = l.emptyNode) === null || c === void 0 ? void 0 : c.call(l)] }); const R = ht(O); return u(z, { class: `${d}-tbody` }, { default: () => [$ && u("tr", { "aria-hidden": "true", class: `${d}-measure-row`, style: { height: 0, fontSize: 0 } }, [R.map((k) => u(Xo, { key: k, columnKey: k, onColumnResize: y }, null))]), T] }); }; } }), _e = {}; var Zo = function(e, t) { var l = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (l[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++) t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (l[n[o]] = e[n[o]]); return l; }; function Rt(e) { return e.reduce((t, l) => { const { fixed: n } = l, o = n === !0 ? "left" : n, r = l.children; return r && r.length > 0 ? [...t, ...Rt(r).map((a) => g({ fixed: o }, a))] : [...t, g(g({}, l), { fixed: o })]; }, []); } function er(e) { let t = !0; for (let n = 0; n < e.length; n += 1) { const o = e[n]; if (t && o.fixed !== "left") t = !1; else if (!t && o.fixed === "left") { ze(!1, `Index ${n - 1} of \`columns\` missing \`fixed='left'\` prop.`); break; } } let l = !0; for (let n = e.length - 1; n >= 0; n -= 1) { const o = e[n]; if (l && o.fixed !== "right") l = !1; else if (!l && o.fixed === "right") { ze(!1, `Index ${n + 1} of \`columns\` missing \`fixed='right'\` prop.`); break; } } } function tr(e) { return e.map((t) => { const { fixed: l } = t, n = Zo(t, ["fixed"]); let o = l; return l === "left" ? o = "right" : l === "right" && (o = "left"), g({ fixed: o }, n); }); } function nr(e, t) { let { prefixCls: l, columns: n, // children, expandable: o, expandedKeys: r, getRowKey: a, onTriggerExpand: i, expandIcon: s, rowExpandable: p, expandIconColumnIndex: c, direction: f, expandRowByClick: x, expandColumnWidth: $, expandFixed: b } = e; const m = Mt(), v = C(() => { if (o.value) { let d = n.value.slice(); if (process.env.NODE_ENV !== "production" && c.value >= 0 && ze(!1, "`expandIconColumnIndex` is deprecated. Please use `Table.EXPAND_COLUMN` in `columns` instead."), !d.includes(_e)) { const M = c.value || 0; M >= 0 && d.splice(M, 0, _e); } process.env.NODE_ENV !== "production" && d.filter((M) => M === _e).length > 1 && ze(!1, "There exist more than one `EXPAND_COLUMN` in `columns`."); const E = d.indexOf(_e); d = d.filter((M, J) => M !== _e || J === E); const O = n.value[E]; let z; (b.value === "left" || b.value) && !c.value ? z = "left" : (b.value === "right" || b.value) && c.value === n.value.length ? z = "right" : z = O ? O.fixed : null; const S = r.value, H = p.value, T = s.value, R = l.value, k = x.value, B = { [Ze]: { class: `${l.value}-expand-icon-col`, columnType: "EXPAND_COLUMN" }, title: Ft(m.value, "expandColumnTitle", {}, () => [""]), fixed: z, class: `${l.value}-row-expand-icon-cell`, width: $.value, customRender: (M) => { let { record: J, index: Z } = M; const ee = a.value(J, Z), fe = S.has(ee), le = H ? H(J) : !0, L = T({ prefixCls: R, expanded: fe, expandable: le, record: J, onExpand: i }); return k ? u("span", { onClick: (j) => j.stopPropagation() }, [L]) : L; } }; return d.map((M) => M === _e ? B : M); } return process.env.NODE_ENV !== "production" && n.value.includes(_e) && ze(!1, "`expandable` is not config but there exist `EXPAND_COLUMN` in `columns`."), n.value.filter((d) => d !== _e); }), h = C(() => { let d = v.value; return t.value && (d = t.value(d)), d.length || (d = [{ customRender: () => null }]), d; }), y = C(() => f.value === "rtl" ? tr(Rt(h.value)) : Rt(h.value)); return process.env.NODE_ENV !== "production" && Re(() => { setTimeout(() => { er(y.value); }); }), [h, y]; } function Gn(e) { const t = ce(e); let l; const n = ce([]); function o(r) { n.value.push(r), rt.cancel(l), l = rt(() => { const a = n.value; n.value = [], a.forEach((i) => { t.value = i(t.value); }); }); } return tt(() => { rt.cancel(l); }), [t, o]; } function lr(e) { const t = pe(null), l = pe(); function n() { clearTimeout(l.value); } function o(a) { t.value = a, n(), l.value = setTimeout(() => { t.value = null, l.value = void 0; }, 100); } function r() { return t.value; } return tt(() => { n(); }), [o, r]; } function or(e, t, l) { return C(() => { const o = [], r = []; let a = 0, i = 0; const s = e.value, p = t.value, c = l.value; for (let f = 0; f < p; f += 1) if (c === "rtl") { r[f] = i, i += s[f] || 0; const x = p - f - 1; o[x] = a, a += s[x] || 0; } else { o[f] = a, a += s[f] || 0; const x = p - f - 1; r[x] = i, i += s[x] || 0; } return { left: o, right: r }; }); } var rr = function(e, t) { var l = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (l[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++) t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (l[n[o]] = e[n[o]]); return l; }; function Jn(e) { let { colWidths: t, columns: l, columCount: n } = e; const o = [], r = n || l.length; let a = !1; for (let i = r - 1; i >= 0; i -= 1) { const s = t[i], p = l && l[i], c = p && p[Ze]; if (s || c || a) { const f = c || {}, x = rr(f, ["columnType"]); o.unshift(u("col", G({ key: i, style: { width: typeof s == "number" ? `${s}px` : s } }, x), null)), a = !0; } } return u("colgroup", null, [o]); } function Ot(e, t) { let { slots: l } = t; var n; return u("div", null, [(n = l.default) === null || n === void 0 ? void 0 : n.call(l)]); } Ot.displayName = "Panel"; let ar = 0; const ir = ue({ name: "TableSummary", props: ["fixed"], setup(e, t) { let { slots: l } = t; const n = Ae(), o = `table-summary-uni-key-${++ar}`, r = C(() => e.fixed === "" || e.fixed); return Re(() => { n.summaryCollect(o, r.value); }), tt(() => { n.summaryCollect(o, !1); }), () => { var a; return (a = l.default) === null || a === void 0 ? void 0 : a.call(l); }; } }), qn = Symbol("SummaryContextProps"), sr = (e) => { Me(qn, e); }, aa = () => He(qn, {}), ct = ue({ name: "TableFooter", inheritAttrs: !1, props: ["stickyOffsets", "flattenColumns"], setup(e, t) { let { slots: l } = t; const n = Ae(); return sr(Qe({ stickyOffsets: xe(e, "stickyOffsets"), flattenColumns: xe(e, "flattenColumns"), scrollColumnIndex: C(() => { const o = e.flattenColumns.length - 1, r = e.flattenColumns[o]; return r != null && r.scrollbar ? o : null; }) })), () => { var o; const { prefixCls: r } = n; return u("tfoot", { class: `${r}-summary` }, [(o = l.default) === null || o === void 0 ? void 0 : o.call(l)]); }; } }), ia = ir; function cr(e) { let { prefixCls: t, record: l, onExpand: n, expanded: o, expandable: r } = e; const a = `${t}-row-expand-icon`; if (!r) return u("span", { class: [a, `${t}-row-spaced`] }, null); const i = (s) => { n(l, s), s.stopPropagation(); }; return u("span", { class: { [a]: !0, [`${t}-row-expanded`]: o, [`${t}-row-collapsed`]: !o }, onClick: i }, null); } function ur(e, t, l) { const n = []; function o(r) { (r || []).forEach((a, i) => { n.push(t(a, i)), o(a[l]); }); } return o(e), n; } const dr = ue({ name: "StickyScrollBar", inheritAttrs: !1, props: ["offsetScroll", "container", "scrollBodyRef", "scrollBodySizeInfo"], emits: ["scroll"], setup(e, t) { let { emit: l, expose: n } = t; const o = Ae(), r = ce(0), a = ce(0), i = ce(0); Re(() => { r.value = e.scrollBodySizeInfo.scrollWidth || 0, a.value = e.scrollBodySizeInfo.clientWidth || 0, i.value = r.value && a.value * (a.value / r.value); }, { flush: "post" }); const s = ce(), [p, c] = Gn({ scrollLeft: 0, isHiddenScrollBar: !0 }), f = pe({ delta: 0, x: 0 }), x = ce(!1), $ = () => { x.value = !1; }, b = (S) => { f.value = { delta: S.pageX - p.value.scrollLeft, x: 0 }, x.value = !0, S.preventDefault(); }, m = (S) => { const { buttons: H } = S || (window == null ? void 0 : window.event); if (!x.value || H === 0) { x.value && (x.value = !1); return; } let T = f.value.x + S.pageX - f.value.x - f.value.delta; T <= 0 && (T = 0), T + i.value >= a.value && (T = a.value - i.value), l("scroll", { scrollLeft: T / a.value * (r.value + 2) }), f.value.x = S.pageX; }, v = () => { if (!e.scrollBodyRef.value) return; const S = tn(e.scrollBodyRef.value).top, H = S + e.scrollBodyRef.value.offsetHeight, T = e.container === window ? document.documentElement.scrollTop + window.innerHeight : tn(e.container).top + e.container.clientHeight; H - en() <= T || S >= T - e.offsetScroll ? c((R) => g(g({}, R), { isHiddenScrollBar: !0 })) : c((R) => g(g({}, R), { isHiddenScrollBar: !1 })); }; n({ setScrollLeft: (S) => { c((H) => g(g({}, H), { scrollLeft: S / r.value * a.value || 0 })); } }); let y = null, d = null, E = null, O = null; et(() => { y = We(document.body, "mouseup", $, !1), d = We(document.body, "mousemove", m, !1), E = We(window, "resize", v, !1); }), Ql(() => { at(() => { v(); }); }), et(() => { setTimeout(() => { Fe([i, x], () => { v(); }, { immediate: !0, flush: "post" }); }); }), Fe(() => e.container, () => { O == null || O.remove(), O = We(e.container, "scroll", v, !1); }, { immediate: !0, flush: "post" }), tt(() => { y == null || y.remove(), d == null || d.remove(), O == null || O.remove(), E == null || E.remove(); }), Fe(() => g({}, p.value), (S, H) => { S.isHiddenScrollBar !== (H == null ? void 0 : H.isHiddenScrollBar) && !S.isHiddenScrollBar && c((T) => { const R = e.scrollBodyRef.value; return R ? g(g({}, T), { scrollLeft: R.scrollLeft / R.scrollWidth * R.clientWidth }) : T; }); }, { immediate: !0 }); const z = en(); return () => { if (r.value <= a.value || !i.value || p.value.isHiddenScrollBar) return null; const { prefixCls: S } = o; return u("div", { style: { height: `${z}px`, width: `${a.value}px`, bottom: `${e.offsetScroll}px` }, class: `${S}-sticky-scroll` }, [u("div", { onMousedown: b, ref: s, class: te(`${S}-sticky-scroll-bar`, { [`${S}-sticky-scroll-bar-active`]: x.value }), style: { width: `${i.value}px`, transform: `translate3d(${p.value.scrollLeft}px, 0, 0)` } }, null)]); }; } }), cn = Ol() ? window : null; function fr(e, t) { return C(() => { const { offsetHeader: l = 0, offsetSummary: n = 0, offsetScroll: o = 0, getContainer: r = () => cn } = typeof e.value == "object" ? e.value : {}, a = r() || cn, i = !!e.value; return { isSticky: i, stickyClassName: i ? `${t.value}-sticky-holder` : "", offsetHeader: l, offsetSummary: n, offsetScroll: o, container: a }; }); } function pr(e, t) { return C(() => { const l = [], n = e.value, o = t.value; for (let r = 0; r < o; r += 1) { const a = n[r]; if (a !== void 0) l[r] = a; else return null; } return l; }); } const un = ue({ name: "FixedHolder", inheritAttrs: !1, props: ["columns", "flattenColumns", "stickyOffsets", "customHeaderRow", "noData", "maxContentScroll", "colWidths", "columCount", "direction", "fixHeader", "stickyTopOffset", "stickyBottomOffset", "stickyClassName"], emits: ["scroll"], setup(e, t) { let { attrs: l, slots: n, emit: o } = t; const r = Ae(), a = C(() => r.isSticky && !e.fixHeader ? 0 : r.scrollbarSize), i = pe(), s = (m) => { const { currentTarget: v, deltaX: h } = m; h && (o("scroll", { currentTarget: v, scrollLeft: v.scrollLeft + h }), m.preventDefault()); }, p = pe(); et(() => { at(() => { p.value = We(i.value, "wheel", s); }); }), tt(() => { var m; (m = p.value) === null || m === void 0 || m.remove(); }); const c = C(() => e.flattenColumns.every((m) => m.width && m.width !== 0 && m.width !== "0px")), f = pe([]), x = pe([]); Re(() => { const m = e.flattenColumns[e.flattenColumns.length - 1], v = { fixed: m ? m.fixed : null, scrollbar: !0, customHeaderCell: () => ({ class: `${r.prefixCls}-cell-scrollbar` }) }; f.value = a.value ? [...e.columns, v] : e.columns, x.value = a.value ? [...e.flattenColumns, v] : e.flattenColumns; }); const $ = C(() => { const { stickyOffsets: m, direction: v } = e, { right: h, left: y } = m; return g(g({}, m), { left: v === "rtl" ? [...y.map((d) => d + a.value), 0] : y, right: v === "rtl" ? h : [...h.map((d) => d + a.value), 0], isSticky: r.isSticky }); }), b = pr(xe(e, "colWidths"), xe(e, "columCount")); return () => { var m; const { noData: v, columCount: h, stickyTopOffset: y, stickyBottomOffset: d, stickyClassName: E, maxContentScroll: O } = e, { isSticky: z } = r; return u("div", { style: g({ overflow: "hidden" }, z ? { top: `${y}px`, bottom: `${d}px` } : {}), ref: i, class: te(l.class, { [E]: !!E }) }, [u("table", { style: { tableLayout: "fixed", visibility: v || b.value ? null : "hidden" } }, [(!v || !O || c.value) && u(Jn, { colWidths: b.value ? [...b.value, a.value] : [], columCount: h + 1, columns: x.value }, null), (m = n.default) === null || m === void 0 ? void 0 : m.call(n, g(g({}, e), { stickyOffsets: $.value, columns: f.value, flattenColumns: x.value }))])]); }; } }); function dn(e) { for (var t = arguments.length, l = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++) l[n - 1] = arguments[n]; return Qe(io(l.map((o) => [o, xe(e, o)]))); } const mr = [], vr = {}, Nt = "rc-table-internal-hook", hr = ue({ name: "VcTable", inheritAttrs: !1, props: ["prefixCls", "data", "columns", "rowKey", "tableLayout", "scroll", "rowClassName", "title", "footer", "id", "showHeader", "components", "customRow", "customHeaderRow", "direction", "expandFixed", "expandColumnWidth", "expandedRowKeys", "defaultExpandedRowKeys", "expandedRowRender", "expandRowByClick", "expandIcon", "onExpand", "onExpandedRowsChange", "onUpdate:expandedRowKeys", "defaultExpandAllRows", "indentSize", "expandIconColumnIndex", "expandedRowClassName", "childrenColumnName", "rowExpandable", "sticky", "transformColumns", "internalHooks", "internalRefs", "canExpandable", "onUpdateInternalRefs", "transformCellText"], emits: ["expand", "expandedRowsChange", "updateInternalRefs", "update:expandedRowKeys"], setup(e, t) { let { attrs: l, slots: n, emit: o } = t; const r = C(() => e.data || mr), a = C(() => !!r.value.length), i = C(() => Oo(e.components, {})), s = (I, P) => Kn(i.value, I) || P, p = C(() => { const I = e.rowKey; return typeof I == "function" ? I : (P) => { const Q = P && P[I]; return process.env.NODE_ENV !== "production" && ze(Q !== void 0, "Each record in table should have a unique `key` prop, or set `rowKey` to an unique primary key."), Q; }; }), c = C(() => e.expandIcon || cr), f = C(() => e.childrenColumnName || "children"), x = C(() => e.expandedRowRender ? "row" : e.canExpandable || r.value.some((I) => I && typeof I == "object" && I[f.value]) ? "nest" : !1), $ = ce([]); Re(() => { e.defaultExpandedRowKeys && ($.value = e.defaultExpandedRowKeys), e.defaultExpandAllRows && ($.value = ur(r.value, p.value, f.value)); })(); const m = C(() => new Set(e.expandedRowKeys || $.value || [])), v = (I) => { const P = p.value(I, r.value.indexOf(I)); let Q; const de = m.value.has(P); de ? (m.value.delete(P), Q = [...m.value]) : Q = [...m.value, P], $.value = Q, o("expand", !de, I), o("update:expandedRowKeys", Q), o("expandedRowsChange", Q); }; process.env.NODE_ENV !== "production" && e.expandedRowRender && r.value.some((I) => Array.isArray(I == null ? void 0 : I[f.value])) && ze(!1, "`expandedRowRender` should not use with nested Table"); const h = pe(0), [y, d] = nr(g(g({}, $t(e)), { // children, expandable: C(() => !!e.expandedRowRender), expandedKeys: m, getRowKey: p, onTriggerExpand: v, expandIcon: c }), C(() => e.internalHooks === Nt ? e.transformColumns : null)), E = C(() => ({ columns: y.value, flattenColumns: d.value })), O = pe(), z = pe(), S = pe(), H = pe({ scrollWidth: 0, clientWidth: 0 }), T = pe(), [R, k] = Ve(!1), [B, M] = Ve(!1), [J, Z] = Gn(/* @__PURE__ */ new Map()), ee = C(() => ht(d.value)), fe = C(() => ee.value.map((I) => J.value.get(I))), le = C(() => d.value.length), L = or(fe, le, xe(e, "direction")), j = C(() => e.scroll && Et(e.scroll.y)), q = C(() => e.scroll && Et(e.scroll.x) || !!e.expandFixed), w = C(() => q.value && d.value.some((I) => { let { fixed: P } = I; return P; })), K = pe(), N = fr(xe(e, "sticky"), xe(e, "prefixCls")), A = Qe({}), F = C(() => { const I = Object.values(A)[0]; return (j.value || N.value.isSticky) && I; }), oe = (I, P) => { P ? A[I] = P : delete A[I]; }, V = pe({}), ge = pe({}), be = pe({}); Re(() => { j.value && (ge.value = { overflowY: "scroll", maxHeight: nn(e.scroll.y) }), q.value && (V.value = { overflowX: "auto" }, j.value || (ge.value = { overflowY: "hidden" }), be.value = { width: e.scroll.x === !0 ? "auto" : nn(e.scroll.x), minWidth: "100%" }); }); const Se = (I, P) => { zl(O.value) && Z((Q) => { if (Q.get(I) !== P) { const de = new Map(Q); return de.set(I, P), de; } return Q; }); }, [Ee, Oe] = lr(); function ye(I, P) { if (!P) return; if (typeof P == "function") { P(I); return; } const Q = P.$el || P; Q.scrollLeft !== I && (Q.scrollLeft = I); } const $e = (I) => { let { currentTarget: P, scrollLeft: Q } = I; var de; const we = e.direction === "rtl", me = typeof Q == "number" ? Q : P.scrollLeft, Ce = P || vr; if ((!Oe() || Oe() === Ce) && (Ee(Ce), ye(me, z.value), ye(me, S.value), ye(me, T.value), ye(me, (de = K.value) === null || de === void 0 ? void 0 : de.setScrollLeft)), P) { const { scrollWidth: ve, clientWidth: Pe } = P; we ? (k(-me < ve - Pe), M(-me > 0)) : (k(me > 0), M(me < ve - Pe)); } }, _ = () => { q.value && S.value ? $e({ currentTarget: S.value }) : (k(!1), M(!1)); }; let Y; const D = (I) => { I !== h.value && (_(), h.value = O.value ? O.value.offsetWidth : I); }, W = (I) => { let { width: P } = I; if (clearTimeout(Y), h.value === 0) { D(P); return; } Y = setTimeout(() => { D(P); }, 100); }; Fe([q, () => e.data, () => e.columns], () => { q.value && _(); }, { flush: "post" }); const [X, re] = Ve(0); Do(), et(() => { at(() => { var I, P; _(), re(Nl(S.value).width), H.value = { scrollWidth: ((I = S.value) === null || I === void 0 ? void 0 : I.scrollWidth) || 0, clientWidth: ((P = S.value) === null || P === void 0 ? void 0 : P.clientWidth) || 0 }; }); }), Zl(() => { at(() => { var I, P; const Q = ((I = S.value) === null || I === void 0 ? void 0 : I.scrollWidth) || 0, de = ((P = S.value) === null || P === void 0 ? void 0 : P.clientWidth) || 0; (H.value.scrollWidth !== Q || H.value.clientWidth !== de) && (H.value = { scrollWidth: Q, clientWidth: de }); }); }), Re(() => { e.internalHooks === Nt && e.internalRefs && e.onUpdateInternalRefs({ body: S.value ? S.value.$el || S.value : null }); }, { flush: "post" }); const U = C(() => e.tableLayout ? e.tableLayout : w.value ? e.scroll.x === "max-content" ? "auto" : "fixed" : j.value || N.value.isSticky || d.value.some((I) => { let { ellipsis: P } = I; return P; }) ? "fixed" : "auto"), ne = () => { var I; return a.value ? null : ((I = n.emptyText) === null || I === void 0 ? void 0 : I.call(n)) || "No Data"; }; To(Qe(g(g({}, $t(dn(e, "prefixCls", "direction", "transformCellText"))), { getComponent: s, scrollbarSize: X, fixedInfoList: C(() => d.value.map((I, P) => Hn(P, P, d.value, L.value, e.direction))), isSticky: C(() => N.value.isSticky), summaryCollect: oe }))), Uo(Qe(g(g({}, $t(dn(e, "rowClassName", "expandedRowClassName", "expandRowByClick", "expandedRowRender", "expandIconColumnIndex", "indentSize"))), { columns: y, flattenColumns: d, tableLayout: U, expandIcon: c, expandableType: x, onTriggerExpand: v }))), qo({ onColumnResize: Se }), Wo({ componentWidth: h, fixHeader: j, fixColumn: w, horizonScroll: q }); const he = () => u(Qo, { data: r.value, measureColumnWidth: j.value || q.value || N.value.isSticky, expandedKeys: m.value, rowExpandable: e.rowExpandable, getRowKey: p.value, customRow: e.customRow, childrenColumnName: f.value }, { emptyNode: ne }), ae = () => u(Jn, { colWidths: d.value.map((I) => { let { width: P } = I; return P; }), columns: d.value }, null); return () => { var I; const { prefixCls: P, scroll: Q, tableLayout: de, direction: we, // Additional Part title: me = n.title, footer: Ce = n.footer, // Customize id: ve, showHeader: Pe, customHeaderRow: Ie } = e, { isSticky: nt, offsetHeader: st, offsetSummary: il, offsetScroll: sl, stickyClassName: cl, container: ul } = N.value, Lt = s(["table"], "table"), xt = s(["body"]), Ge = (I = n.summary) === null || I === void 0 ? void 0 : I.call(n, { pageData: r.value }); let bt = () => null; const yt = { colWidths: fe.value, columCount: d.value.length, stickyOffsets: L.value, customHeaderRow: Ie, fixHeader: j.value, scroll: Q }; if (process.env.NODE_ENV !== "production" && typeof xt == "function" && a.value && !j.value && ze(!1, "`components.body` with render props is only work on `scroll.y`."), j.value || nt) { let Ct = () => null; typeof xt == "function" ? (Ct = () => xt(r.value, { scrollbarSize: X.value, ref: S, onScroll: $e }), yt.colWidths = d.value.map((Je, fl) => { let { width: Xt } = Je; const St = fl === y.value.length - 1 ? Xt - X.value : Xt; return typeof St == "number" && !Number.isNaN(St) ? St : (ze(!1, "When use `components.body` with render props. Each column should have a fixed `width` value."), 0); })) : Ct = () => u("div", { style: g(g({}, V.value), ge.value), onScroll: $e, ref: S, class: te(`${P}-body`) }, [u(Lt, { style: g(g({}, be.value), { tableLayout: U.value }) }, { default: () => [ae(), he(), !F.value && Ge && u(ct, { stickyOffsets: L.value, flattenColumns: d.value }, { default: () => [Ge] })] })]); const Vt = g(g(g({ noData: !r.value.length, maxContentScroll: q.value && Q.x === "max-content" }, yt), E.value), { direction: we, stickyClassName: cl, onScroll: $e }); bt = () => u(Xe, null, [Pe !== !1 && u(un, G(G({}, Vt), {}, { stickyTopOffset: st, class: `${P}-header`, ref: z }), { default: (Je) => u(Xe, null, [u(sn, Je, null), F.value === "top" && u(ct, Je, { default: () => [Ge] })]) }), Ct(), F.value && F.value !== "top" && u(un, G(G({}, Vt), {}, { stickyBottomOffset: il, class: `${P}-summary`, ref: T }), { default: (Je) => u(ct, Je, { default: () => [Ge] }) }), nt && S.value && u(dr, { ref: K, offsetScroll: sl, scrollBodyRef: S, onScroll: $e, container: ul, scrollBodySizeInfo: H.value }, null)]); } else bt = () => u("div", { style: g(g({}, V.value), ge.value), class: te(`${P}-content`), onScroll: $e, ref: S }, [u(Lt, { style: g(g({}, be.value), { tableLayout: U.value }) }, { default: () => [ae(), Pe !== !1 && u(sn, G(G({}, yt), E.value), null), he(), Ge && u(ct, { stickyOffsets: L.value, flattenColumns: d.value }, { default: () => [Ge] })] })]); const dl = Bl(l, { aria: !0, data: !0 }), Wt = () => u("div", G(G({}, dl), {}, { class: te(P, { [`${P}-rtl`]: we === "rtl", [`${P}-ping-left`]: R.value, [`${P}-ping-right`]: B.value, [`${P}-layout-fixed`]: de === "fixed", [`${P}-fixed-header`]: j.value, /** No used but for compatible */ [`${P}-fixed-column`]: w.value, [`${P}-scroll-horizontal`]: q.value, [`${P}-has-fix-left`]: d.value[0] && d.value[0].fixed, [`${P}-has-fix-right`]: d.value[le.value - 1] && d.value[le.value - 1].fixed === "right", [l.class]: l.class }), style: l.style, id: ve, ref: O }), [me && u(Ot, { class: `${P}-title` }, { default: () => [me(r.value)] }), u("div", { class: `${P}-container` }, [bt()]), Ce && u(Ot, { class: `${P}-footer` }, { default: () => [Ce(r.value)] })]); return q.value ? u(On, { onResize: W }, { default: Wt }) : Wt(); }; } }); function gr() { const e = g({}, arguments.length <= 0 ? void 0 : arguments[0]); for (let t = 1; t < arguments.length; t++) { const l = t < 0 || arguments.length <= t ? void 0 : arguments[t]; l && Object.keys(l).forEach((n) => { const o = l[n]; o !== void 0 && (e[n] = o); }); } return e; } const Bt = 10; function xr(e, t) { const l = { current: e.current, pageSize: e.pageSize }; return Object.keys(t && typeof t == "object" ? t : {}).forEach((o) => { const r = e[o]; typeof r != "function" && (l[o] = r); }), l; } function br(e, t, l) { const n = C(() => t.value && typeof t.value == "object" ? t.value : {}), o = C(() => n.value.total || 0), [r, a] = Ve(() => ({ current: "defaultCurrent" in n.value ? n.value.defaultCurrent : 1, pageSize: "defaultPageSize" in n.value ? n.value.defaultPageSize : Bt })), i = C(() => { const c = gr(r.value, n.value, { total: o.value > 0 ? o.value : e.value }), f = Math.ceil((o.value || e.value) / c.pageSize); return c.current > f && (c.current = f || 1), c; }), s = (c, f) => { t.value !== !1 && a({ current: c != null ? c : 1, pageSize: f || i.value.pageSize }); }, p = (c, f) => { var x, $; t.value && (($ = (x = n.value).onChange) === null || $ === void 0 || $.call(x, c, f)), s(c, f), l(c, f || i.value.pageSize); }; return [C(() => t.value === !1 ? {} : g(g({}, i.value), { onChange: p })), s]; } function yr(e, t, l) { const n = ce({}); Fe([e, t, l], () => { const r = /* @__PURE__ */ new Map(), a = l.value, i = t.value; function s(p) { p.forEach((c, f) => { const x = a(c, f); r.set(x, c), c && typeof c == "object" && i in c && s(c[i] || []); }); } s(e.value), n.value = { kvMap: r }; }, { deep: !0, immediate: !0 }); function o(r) { return n.value.kvMap.get(r); } return [o]; } const Ne = {}, fn = "SELECT_ALL", pn = "SELECT_INVERT", mn = "SELECT_NONE", Cr = []; function Yn(e, t) { let l = []; return (t || []).forEach((n) => { l.push(n), n && typeof n == "object" && e in n && (l = [...l, ...Yn(e, n[e])]); }), l; } function Sr(e, t) { const l = C(() => { const T = e.value || {}, { checkStrictly: R = !0 } = T; return g(g({}, T), { checkStrictly: R }); }), [n, o] = kl(l.value.selectedRowKeys || l.value.defaultSelectedRowKeys || Cr, { value: C(() => l.value.selectedRowKeys) }), r = ce(/* @__PURE__ */ new Map()), a = (T) => { if (l.value.preserveSelectedRowKeys) { const R = /* @__PURE__ */ new Map(); T.forEach((k) => { let B = t.getRecordByKey(k); !B && r.value.has(k) && (B = r.value.get(k)), R.set(k, B); }), r.value = R; } }; Re(() => { a(n.value); }); const i = C(() => l.value.checkStrictly ? null : eo(t.data.value, { externalGetKey: t.getRowKey.value, childrenPropName: t.childrenColumnName.value }).keyEntities), s = C(() => Yn(t.childrenColumnName.value, t.pageData.value)), p = C(() => { const T = /* @__PURE__ */ new Map(), R = t.getRowKey.value, k = l.value.getCheckboxProps; return s.value.forEach((B, M) => { const J = R(B, M), Z = (k ? k(B) : null) || {}; T.set(J, Z), process.env.NODE_ENV !== "production" && ("checked" in Z || "defaultChecked" in Z) && Te(!1, "Table", "Do not set `checked` or `defaultChecked` in `getCheckboxProps`. Please use `selectedRowKeys` instead."); }), T; }), { maxLevel: c, levelEntities: f } = to(i), x = (T) => { var R; return !!(!((R = p.value.get(t.getRowKey.value(T))) === null || R === void 0) && R.disabled); }, $ = C(() => { if (l.value.checkStrictly) return [n.value || [], []]; const { checkedKeys: T, halfCheckedKeys: R } = wt(n.value, !0, i.value, c.value, f.value, x); return [T || [], R]; }), b = C(() => $.value[0]), m = C(() => $.value[1]), v = C(() => { const T = l.value.type === "radio" ? b.value.slice(0, 1) : b.value; return new Set(T); }), h = C(() => l.value.type === "radio" ? /* @__PURE__ */ new Set() : new Set(m.value)), [y, d] = Ve(null), E = (T) => { let R, k; a(T); const { preserveSelectedRowKeys: B, onChange: M } = l.value, { getRecordByKey: J } = t; B ? (R = T, k = T.map((Z) => r.value.get(Z))) : (R = [], k = [], T.forEach((Z) => { const ee = J(Z); ee !== void 0 && (R.push(Z), k.push(ee)); })), o(R), M == null || M(R, k); }, O = (T, R, k, B) => { const { onSelect: M } = l.value, { getRecordByKey: J } = t || {}; if (M) { const Z = k.map((ee) => J(ee)); M(J(T), R, Z, B); } E(k); }, z = C(() => { const { onSelectInvert: T, onSelectNone: R, selections: k, hideSelectAll: B } = l.value, { data: M, pageData: J, getRowKey: Z, locale: ee } = t; return !k || B ? null : (k === !0 ? [fn, pn, mn] : k).map((le) => le === fn ? { key: "all", text: ee.value.selectionAll, onSelect() { E(M.value.map((L, j) => Z.value(L, j)).filter((L) => { const j = p.value.get(L); return !(j != null && j.disabled) || v.value.has(L); })); } } : le === pn ? { key: "invert", text: ee.value.selectInvert, onSelect() { const L = new Set(v.value); J.value.forEach((q, w) => { const K = Z.value(q, w), N = p.value.get(K); N != null && N.disabled || (L.has(K) ? L.delete(K) : L.add(K)); }); const j = Array.from(L); T && (Te(!1, "Table", "`onSelectInvert` will be removed in future. Please use `onChange` instead."), T(j)), E(j); } } : le === mn ? { key: "none", text: ee.value.selectNone, onSelect() { R == null || R(), E(Array.from(v.value).filter((L) => { const j = p.value.get(L); return j == null ? void 0 : j.disabled; })); } } : le); }), S = C(() => s.value.length); return [(T) => { var R; const { onSelectAll: k, onSelectMultiple: B, columnWidth: M, type: J, fixed: Z, renderCell: ee, hideSelectAll: fe, checkStrictly: le } = l.value, { prefixCls: L, getRecordByKey: j, getRowKey: q, expandType: w, getPopupContainer: K } = t; if (!e.value) return process.env.NODE_ENV !== "production" && Te(!T.includes(Ne), "Table", "`rowSelection` is not config but `SELECTION_COLUMN` exists in the `columns`."), T.filter((D) => D !== Ne); let N = T.slice(); const A = new Set(v.value), F = s.value.map(q.value).filter((D) => !p.value.get(D).disabled), oe = F.every((D) => A.has(D)), V = F.some((D) => A.has(D)), ge = () => { const D = []; oe ? F.forEach((X) => { A.delete(X), D.push(X); }) : F.forEach((X) => { A.has(X) || (A.add(X), D.push(X)); }); const W = Array.from(A); k == null || k(!oe, W.map((X) => j(X)), D.map((X) => j(X))), E(W); }; let be; if (J !== "radio") { let D; if (z.value) { const ne = u(pt, { getPopupContainer: K.value }, { default: () => [z.value.map((he, ae) => { const { key: I, text: P, onSelect: Q } = he; return u(pt.Item, { key: I || ae, onClick: () => { Q == null || Q(F); } }, { default: () => [P] }); })] }); D = u("div", { class: `${L.value}-selection-extra` }, [u(Nn, { overlay: ne, getPopupContainer: K.value }, { default: () => [u("span", null, [u(_l, null, null)])] })]); } const W = s.value.map((ne, he) => { const ae = q.value(ne, he), I = p.value.get(ae) || {}; return g({ checked: A.has(ae) }, I); }).filter((ne) => { let { disabled: he } = ne; return he; }), X = !!W.length && W.length === S.value, re = X && W.every((ne) => { let { checked: he } = ne; return he; }), U = X && W.some((ne) => { let { checked: he } = ne; return he; }); be = !fe && u("div", { class: `${L.value}-selection` }, [u(mt, { checked: X ? re : !!S.value && oe, indeterminate: X ? !re && U : !oe && V, onChange: ge, disabled: S.value === 0 || X, "aria-label": D ? "Custom selection" : "Select all", skipGroup: !0 }, null), D]); } let Se; J === "radio" ? Se = (D) => { let { record: W, index: X } = D; const re = q.value(W, X), U = A.has(re); return { node: u(kn, G(G({}, p.value.get(re)), {}, { checked: U, onClick: (ne) => ne.stopPropagation(), onChange: (ne) => { A.has(re) || O(re, !0, [re], ne.nativeEvent); } }), null), checked: U }; } : Se = (D) => { let { record: W, index: X } = D; var re; const U = q.value(W, X), ne = A.has(U), he = h.value.has(U), ae = p.value.get(U); let I; return w.value === "nest" ? (I = he, Te(typeof (ae == null ? void 0 : ae.indeterminate) != "boolean", "Table", "set `indeterminate` using `rowSelection.getCheckboxProps` is not allowed with tree structured dataSource.")) : I = (re = ae == null ? void 0 : ae.indeterminate) !== null && re !== void 0 ? re : he, { node: u(mt, G(G({}, ae), {}, { indeterminate: I, checked: ne, skipGroup: !0, onClick: (P) => P.stopPropagation(), onChange: (P) => { let { nativeEvent: Q } = P; const { shiftKey: de } = Q; let we = -1, me = -1; if (de && le) { const Ce = /* @__PURE__ */ new Set([y.value, U]); F.some((ve, Pe) => { if (Ce.has(ve)) if (we === -1) we = Pe; else return me = Pe, !0; return !1; }); } if (me !== -1 && we !== me && le) { const Ce = F.slice(we, me + 1), ve = []; ne ? Ce.forEach((Ie) => { A.has(Ie) && (ve.push(Ie), A.delete(Ie)); }) : Ce.forEach((Ie) => { A.has(Ie) || (ve.push(Ie), A.add(Ie)); }); const Pe = Array.from(A); B == null || B(!ne, Pe.map((Ie) => j(Ie)), ve.map((Ie) => j(Ie))), E(Pe); } else { const Ce = b.value; if (le) { const ve = ne ? no(Ce, U) : lo(Ce, U); O(U, !ne, ve, Q); } else { const ve = wt([...Ce, U], !0, i.value, c.value, f.value, x), { checkedKeys: Pe, halfCheckedKeys: Ie } = ve; let nt = Pe; if (ne) { const st = new Set(Pe); st.delete(U), nt = wt(Array.from(st), { checked: !1, halfCheckedKeys: Ie }, i.value, c.value, f.value, x).checkedKeys; } O(U, !ne, nt, Q); } } d(U); } }), null), checked: ne }; }; const Ee = (D) => { let { record: W, index: X } = D; const { node: re, checked: U } = Se({ record: W, index: X }); return ee ? ee(U, W, X, re) : re; }; if (!N.includes(Ne)) if (N.findIndex((D) => { var W; return ((W = D[Ze]) === null || W === void 0 ? void 0 : W.columnType) === "EXPAND_COLUMN"; }) === 0) { const [D, ...W] = N; N = [D, Ne, ...W]; } else N = [Ne, ...N]; const Oe = N.indexOf(Ne); process.env.NODE_ENV !== "production" && N.filter((D) => D === Ne).length > 1 && Te(!1, "Table", "Multiple `SELECTION_COLUMN` exist in `columns`."), N = N.filter((D, W) => D !== Ne || W === Oe); const ye = N[Oe - 1], $e = N[Oe + 1]; let _ = Z; _ === void 0 && (($e == null ? void 0 : $e.fixed) !== void 0 ? _ = $e.fixed : (ye == null ? void 0 : ye.fixed) !== void 0 && (_ = ye.fixed)), _ && ye && ((R = ye[Ze]) === null || R === void 0 ? void 0 : R.columnType) === "EXPAND_COLUMN" && ye.fixed === void 0 && (ye.fixed = _); const Y = { fixed: _, width: M, className: `${L.value}-selection-column`, title: l.value.columnTitle || be, customRender: Ee, [Ze]: { class: `${L.value}-selection-col` } }; return N.map((D) => D === Ne ? Y : D); }, v]; } var $r = function(e, t) { var l = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (l[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++) t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (l[n[o]] = e[n[o]]); return l; }; function Ue(e, t) { return "key" in e && e.key !== void 0 && e.key !== null ? e.key : e.dataIndex ? Array.isArray(e.dataIndex) ? e.dataIndex.join(".") : e.dataIndex : t; } function it(e, t) { return t ? `${t}-${e}` : `${e}`; } function jt(e, t) { return typeof e == "function" ? e(t) : e; } function Qn() { let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; const t = Rn(e), l = []; return t.forEach((n) => { var o, r, a, i; if (!n) return; const s = n.key, p = ((o = n.props) === null || o === void 0 ? void 0 : o.style) || {}, c = ((r = n.props) === null || r === void 0 ? void 0 : r.class) || "", f = n.props || {}; for (const [v, h] of Object.entries(f)) f[Dl(v)] = h; const x = n.children || {}, { default: $ } = x, b = $r(x, ["default"]), m = g(g(g({}, b), f), { style: p, class: c }); if (s && (m.key = s), !((a = n.type) === null || a === void 0) && a.__ANT_TABLE_COLUMN_GROUP) m.children = Qn(typeof $ == "function" ? $() : $); else { const v = (i = n.children) === null || i === void 0 ? void 0 : i.default; m.customRender = m.customRender || v; } l.push(m); }), l; } const dt = "ascend", It = "descend"; function vt(e) { return typeof e.sorter == "object" && typeof e.sorter.multiple == "number" ? e.sorter.multiple : !1; } function vn(e) { return typeof e == "function" ? e : e && typeof e == "object" && e.compare ? e.compare : !1; } function wr(e, t) { return t ? e[e.indexOf(t) + 1] : e[0]; } function zt(e, t, l) { let n = []; function o(r, a) { n.push({ column: r, key: Ue(r, a), multiplePriority: vt(r), sortOrder: r.sortOrder }); } return (e || []).forEach((r, a) => { const i = it(a, l); r.children ? ("sortOrder" in r && o(r, i), n = [...n, ...zt(r.children, t, i)]) : r.sorter && ("sortOrder" in r ? o(r, i) : t && r.defaultSortOrder && n.push({ column: r, key: Ue(r, i), multiplePriority: vt(r), sortOrder: r.defaultSortOrder })); }), n; } function Zn(e, t, l, n, o, r, a, i) { return (t || []).map((s, p) => { const c = it(p, i); let f = s; if (f.sorter) { const x = f.sortDirections || o, $ = f.showSorterTooltip === void 0 ? a : f.showSorterTooltip, b = Ue(f, c), m = l.find((T) => { let { key: R } = T; return R === b; }), v = m ? m.sortOrder : null, h = wr(x, v), y = x.includes(dt) && u(Kl, { class: te(`${e}-column-sorter-up`, { active: v === dt }), role: "presentation" }, null), d = x.includes(It) && u(Fl, { role: "presentation", class: te(`${e}-column-sorter-down`, { active: v === It }) }, null), { cancelSort: E, triggerAsc: O, triggerDesc: z } = r || {}; let S = E; h === It ? S = z : h === dt && (S = O); const H = typeof $ == "object" ? $ : { title: S }; f = g(g({}, f), { className: te(f.className, { [`${e}-column-sort`]: v }), title: (T) => { const R = u("div", { class: `${e}-column-sorters` }, [u("span", { class: `${e}-column-title` }, [jt(s.title, T)]), u("span", { class: te(`${e}-column-sorter`, { [`${e}-column-sorter-full`]: !!(y && d) }) }, [u("span", { class: `${e}-column-sorter-inner` }, [y, d])])]); return $ ? u(Al, H, { default: () => [R] }) : R; }, customHeaderCell: (T) => { const R = s.customHeaderCell && s.customHeaderCell(T) || {}, k = R.onClick, B = R.onKeydown; return R.onClick = (M) => { n({ column: s, key: b, sortOrder: h, multiplePriority: vt(s) }), k && k(M); }, R.onKeydown = (M) => { M.keyCode === Bn.ENTER && (n({ column: s, key: b, sortOrder: h, multiplePriority: vt(s) }), B == null || B(M)); }, v && (R["aria-sort"] = v === "ascend" ? "ascending" : "descending"), R.class = te(R.class, `${e}-column-has-sorters`), R.tabindex = 0, R; } }); } return "children" in f && (f = g(g({}, f), { children: Zn(e, f.children, l, n, o, r, a, c) })), f; }); } function hn(e) { const { column: t, sortOrder: l } = e; return { column: t, order: l, field: t.dataIndex, columnKey: t.key }; } function gn(e) { const t = e.filter((l) => { let { sortOrder: n } = l; return n; }).map(hn); return t.length === 0 && e.length ? g(g({}, hn(e[e.length - 1])), { column: void 0 }) : t.length <= 1 ? t[0] || {} : t; } function kt(e, t, l) { const n = t.slice().sort((a, i) => i.multiplePriority - a.multiplePriority), o = e.slice(), r = n.filter((a) => { let { column: { sorter: i }, sortOrder: s } = a; return vn(i) && s; }); return r.length ? o.sort((a, i) => { for (let s = 0; s < r.length; s += 1) { const p = r[s], { column: { sorter: c }, sortOrder: f } = p, x = vn(c); if (x && f) { const $ = x(a, i, f); if ($ !== 0) return f === dt ? $ : -$; } } return 0; }).map((a) => { const i = a[l]; return i ? g(g({}, a), { [l]: kt(i, t, l) }) : a; }) : o; } function Ir(e) { let { prefixCls: t, mergedColumns: l, onSorterChange: n, sortDirections: o, tableLocale: r, showSorterTooltip: a } = e; const [i, s] = Ve(zt(l.value, !0)), p = C(() => { let b = !0; const m = zt(l.value, !1); if (!m.length) return i.value; const v = []; function h(d) { b ? v.push(d) : v.push(g(g({}, d), { sortOrder: null })); } let y = null; return m.forEach((d) => { y === null ? (h(d), d.sortOrder && (d.multiplePriority === !1 ? b = !1 : y = !0)) : (y && d.multiplePriority !== !1 || (b = !1), h(d)); }), v; }), c = C(() => { const b = p.value.map((m) => { let { column: v, sortOrder: h } = m; return { column: v, order: h }; }); return { sortColumns: b, // Legacy sortColumn: b[0] && b[0].column, sortOrder: b[0] && b[0].order }; }); function f(b) { let m; b.multiplePriority === !1 || !p.value.length || p.value[0].multiplePriority === !1 ? m = [b] : m = [...p.value.filter((v) => { let { key: h } = v; return h !== b.key; }), b], s(m), n(gn(m), m); } const x = (b) => Zn(t.value, b, p.value, f, o.value, r.value, a.value), $ = C(() => gn(p.value)); return [x, p, c, $]; } const Pr = (e) => { const { keyCode: t } = e; t === Bn.ENTER && e.stopPropagation(); }, Er = (e, t) => { let { slots: l } = t; var n; return u("div", { onClick: (o) => o.stopPropagation(), onKeydown: Pr }, [(n = l.default) === null || n === void 0 ? void 0 : n.call(l)]); }, xn = ue({ compatConfig: { MODE: 3 }, name: "FilterSearch", inheritAttrs: !1, props: { value: Ke(), onChange: se(), filterSearch: De([Boolean, Function]), tablePrefixCls: Ke(), locale: Ye() }, setup(e) { return () => { const { value: t, onChange: l, filterSearch: n, tablePrefixCls: o, locale: r } = e; return n ? u("div", { class: `${o}-filter-dropdown-search` }, [u(Ml, { placeholder: r.filterSearchPlaceholder, onChange: l, value: t, htmlSize: 1, class: `${o}-filter-dropdown-search-input` }, { prefix: () => u(Hl, null, null) })]) : null; }; } }); function bn(e, t) { let l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1; const n = /* @__PURE__ */ new Set(); function o(r, a) { let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1; const s = n.has(r); if (jl(!s, "Warning: There may be circular references"), s) return !1; if (r === a) return !0; if (l && i > 1) return !1; n.add(r); const p = i + 1; if (Array.isArray(r)) { if (!Array.isArray(a) || r.length !== a.length) return !1; for (let c = 0; c < r.length; c++) if (!o(r[c], a[c], p)) return !1; return !0; } if (r && a && typeof r == "object" && typeof a == "object") { const c = Object.keys(r); return c.length !== Object.keys(a).length ? !1 : c.every((f) => o(r[f], a[f], p)); } return !1; } return o(e, t); } const { SubMenu: Tr, Item: Rr } = pt; function Or(e) { return e.some((t) => { let { children: l } = t; return l && l.length > 0; }); } function el(e, t) { return typeof t == "string" || typeof t == "number" ? t == null ? void 0 : t.toString().toLowerCase().includes(e.trim().toLowerCase()) : !1; } function tl(e) { let { filters: t, prefixCls: l, filteredKeys: n, filterMultiple: o, searchValue: r, filterSearch: a } = e; return t.map((i, s) => { const p = String(i.value); if (i.children) return u(Tr, { key: p || s, title: i.text, popupClassName: `${l}-dropdown-submenu` }, { default: () => [tl({ filters: i.children, prefixCls: l, filteredKeys: n, filterMultiple: o, searchValue: r, filterSearch: a })] }); const c = o ? mt : kn, f = u(Rr, { key: i.value !== void 0 ? p : s }, { default: () => [u(c, { checked: n.includes(p) }, null), u("span", null, [i.text])] }); return r.trim() ? typeof a == "function" ? a(r, i) ? f : void 0 : el(r, i.text) ? f : void 0 : f; }); } const Nr = ue({ name: "FilterDropdown", props: ["tablePrefixCls", "prefixCls", "dropdownPrefixCls", "column", "filterState", "filterMultiple", "filterMode", "filterSearch", "columnKey", "triggerFilter", "locale", "getPopupContainer"], setup(e, t) { let { slots: l } = t; const n = Mt(), o = C(() => { var w; return (w = e.filterMode) !== null && w !== void 0 ? w : "menu"; }), r = C(() => { var w; return (w = e.filterSearch) !== null && w !== void 0 ? w : !1; }), a = C(() => e.column.filterDropdownOpen || e.column.filterDropdownVisible), i = C(() => e.column.onFilterDropdownOpenChange || e.column.onFilterDropdownVisibleChange); process.env.NODE_ENV !== "production" && [["filterDropdownVisible", "filterDropdownOpen", e.column.filterDropdownVisible], ["onFilterDropdownVisibleChange", "onFilterDropdownOpenChange", e.column.onFilterDropdownVisibleChange]].forEach((w) => { let [K, N, A] = w; Te(A == null, "Table", `\`${K}\` is deprecated. Please use \`${N}\` instead.`); }); const s = ce(!1), p = C(() => { var w; return !!(e.filterState && (!((w = e.filterState.filteredKeys) === null || w === void 0) && w.length || e.filterState.forceFiltered)); }), c = C(() => { var w; return gt((w = e.column) === null || w === void 0 ? void 0 : w.filters); }), f = C(() => { const { filterDropdown: w, slots: K = {}, customFilterDropdown: N } = e.column; return w || K.filterDropdown && n.value[K.filterDropdown] || N && n.value.customFilterDropdown; }), x = C(() => { const { filterIcon: w, slots: K = {} } = e.column; return w || K.filterIcon && n.value[K.filterIcon] || n.value.customFilterIcon; }), $ = (w) => { var K; s.value = w, (K = i.value) === null || K === void 0 || K.call(i, w); }, b = C(() => typeof a.value == "boolean" ? a.value : s.value), m = C(() => { var w; return (w = e.filterState) === null || w === void 0 ? void 0 : w.filteredKeys; }), v = ce([]), h = (w) => { let { selectedKeys: K } = w; v.value = K; }, y = (w, K) => { let { node: N, checked: A } = K; e.filterMultiple ? h({ selectedKeys: w }) : h({ selectedKeys: A && N.key ? [N.key] : [] }); }; Fe(m, () => { s.value && h({ selectedKeys: m.value || [] }); }, { immediate: !0 }); const d = ce([]), E = ce(), O = (w) => { E.value = setTimeout(() => { d.value = w; }); }, z = () => { clearTimeout(E.value); }; tt(() => { clearTimeout(E.value); }); const S = ce(""), H = (w) => { const { value: K } = w.target; S.value = K; }; Fe(s, () => { s.value || (S.value = ""); }); const T = (w) => { const { column: K, columnKey: N, filterState: A } = e, F = w && w.length ? w : null; if (F === null && (!A || !A.filteredKeys) || bn(F, A == null ? void 0 : A.filteredKeys, !0)) return null; e.triggerFilter({ column: K, key: N, filteredKeys: F }); }, R = () => { $(!1), T(v.value); }, k = function() { let { confirm: w, closeDropdown: K } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { confirm: !1, closeDropdown: !1 }; w && T([]), K && $(!1), S.value = "", e.column.filterResetToDefaultFilteredValue ? v.value = (e.column.defaultFilteredValue || []).map((N) => String(N)) : v.value = []; }, B = function() { let { closeDropdown: w } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { closeDropdown: !0 }; w && $(!1), T(v.value); }, M = (w) => { w && m.value !== void 0 && (v.value = m.value || []), $(w), !w && !f.value && R(); }, { direction: J } = Kt("", e), Z = (w) => { if (w.target.checked) { const K = c.value; v.value = K; } else v.value = []; }, ee = (w) => { let { filters: K } = w; return (K || []).map((N, A) => { const F = String(N.value), oe = { title: N.text, key: N.value !== void 0 ? F : A }; return N.children && (oe.children = ee({ filters: N.children })), oe; }); }, fe = (w) => { var K; return g(g({}, w), { text: w.title, value: w.key, children: ((K = w.children) === null || K === void 0 ? void 0 : K.map((N) => fe(N))) || [] }); }, le = C(() => ee({ filters: e.column.filters })), L = C(() => te({ [`${e.dropdownPrefixCls}-menu-without-submenu`]: !Or(e.column.filters || []) })), j = () => { const w = v.value, { column: K, locale: N, tablePrefixCls: A, filterMultiple: F, dropdownPrefixCls: oe, getPopupContainer: V, prefixCls: ge } = e; return (K.filters || []).length === 0 ? u(on, { image: on.PRESENTED_IMAGE_SIMPLE, description: N.filterEmptyText, imageStyle: { height: 24 }, style: { margin: 0, padding: "16px 0" } }, null) : o.value === "tree" ? u(Xe, null, [u(xn, { filterSearch: r.value, value: S.value, onChange: H, tablePrefixCls: A, locale: N }, null), u("div", { class: `${A}-filter-dropdown-tree` }, [F ? u(mt, { class: `${A}-filter-dropdown-checkall`, onChange: Z, checked: w.length === c.value.length, indeterminate: w.length > 0 && w.length < c.value.length }, { default: () => [N.filterCheckall] }) : null, u(oo, { checkable: !0, selectable: !1, blockNode: !0, multiple: F, checkStrictly: !F, class: `${oe}-menu`, onCheck: y, checkedKeys: w, selectedKeys: w, showIcon: !1, treeData: le.value, autoExpandParent: !0, defaultExpandAll: !0, filterTreeNode: S.value.trim() ? (be) => typeof r.value == "function" ? r.value(S.value, fe(be)) : el(S.value, be.title) : void 0 }, null)])]) : u(Xe, null, [u(xn, { filterSearch: r.value, value: S.value, onChange: H, tablePrefixCls: A, locale: N }, null), u(pt, { multiple: F, prefixCls: `${oe}-menu`, class: L.value, onClick: z, onSelect: h, onDeselect: h, selectedKeys: w, getPopupContainer: V, openKeys: d.value, onOpenChange: O }, { default: () => tl({ filters: K.filters || [], filterSearch: r.value, prefixCls: ge, filteredKeys: v.value, filterMultiple: F, searchValue: S.value }) })]); }, q = C(() => { const w = v.value; return e.column.filterResetToDefaultFilteredValue ? bn((e.column.defaultFilteredValue || []).map((K) => String(K)), w, !0) : w.length === 0; }); return () => { var w; const { tablePrefixCls: K, prefixCls: N, column: A, dropdownPrefixCls: F, locale: oe, getPopupContainer: V } = e; let ge; typeof f.value == "function" ? ge = f.value({ prefixCls: `${F}-custom`, setSelectedKeys: (Ee) => h({ selectedKeys: Ee }), selectedKeys: v.value, confirm: B, clearFilters: k, filters: A.filters, visible: b.value, column: A.__originColumn__, close: () => { $(!1); } }) : f.value ? ge = f.value : ge = u(Xe, null, [j(), u("div", { class: `${N}-dropdown-btns` }, [u(ln, { type: "link", size: "small", disabled: q.value, onClick: () => k() }, { default: () => [oe.filterReset] }), u(ln, { type: "primary", size: "small", onClick: R }, { default: () => [oe.filterConfirm] })])]); const be = u(Er, { class: `${N}-dropdown` }, { default: () => [ge] }); let Se; return typeof x.value == "function" ? Se = x.value({ filtered: p.value, column: A.__originColumn__ }) : x.value ? Se = x.value : Se = u(Ll, null, null), u("div", { class: `${N}-column` }, [u("span", { class: `${K}-column-title` }, [(w = l.default) === null || w === void 0 ? void 0 : w.call(l)]), u(Nn, { overlay: be, trigger: ["click"], open: b.value, onOpenChange: M, getPopupContainer: V, placement: J.value === "rtl" ? "bottomLeft" : "bottomRight" }, { default: () => [u("span", { role: "button", tabindex: -1, class: te(`${N}-trigger`, { active: p.value }), onClick: (Ee) => { Ee.stopPropagation(); } }, [Se])] })]); }; } }); function _t(e, t, l) { let n = []; return (e || []).forEach((o, r) => { var a, i; const s = it(r, l), p = o.filterDropdown || ((a = o == null ? void 0 : o.slots) === null || a === void 0 ? void 0 : a.filterDropdown) || o.customFilterDropdown; if (o.filters || p || "onFilter" in o) if ("filteredValue" in o) { let c = o.filteredValue; p || (c = (i = c == null ? void 0 : c.map(String)) !== null && i !== void 0 ? i : c), n.push({ column: o, key: Ue(o, s), filteredKeys: c, forceFiltered: o.filtered }); } else n.push({ column: o, key: Ue(o, s), filteredKeys: t && o.defaultFilteredValue ? o.defaultFilteredValue : void 0, forceFiltered: o.filtered }); "children" in o && (n = [...n, ..._t(o.children, t, s)]); }), n; } function nl(e, t, l, n, o, r, a, i) { return l.map((s, p) => { var c; const f = it(p, i), { filterMultiple: x = !0, filterMode: $, filterSearch: b } = s; let m = s; const v = s.filterDropdown || ((c = s == null ? void 0 : s.slots) === null || c === void 0 ? void 0 : c.filterDropdown) || s.customFilterDropdown; if (m.filters || v) { const h = Ue(m, f), y = n.find((d) => { let { key: E } = d; return h === E; }); m = g(g({}, m), { title: (d) => u(Nr, { tablePrefixCls: e, prefixCls: `${e}-filter`, dropdownPrefixCls: t, column: m, columnKey: h, filterState: y, filterMultiple: x, filterMode: $, filterSearch: b, triggerFilter: r, locale: o, getPopupContainer: a }, { default: () => [jt(s.title, d)] }) }); } return "children" in m && (m = g(g({}, m), { children: nl(e, t, m.children, n, o, r, a, f) })), m; }); } function gt(e) { let t = []; return (e || []).forEach((l) => { let { value: n, children: o } = l; t.push(n), o && (t = [...t, ...gt(o)]); }), t; } function yn(e) { const t = {}; return e.forEach((l) => { let { key: n, filteredKeys: o, column: r } = l; var a; const i = r.filterDropdown || ((a = r == null ? void 0 : r.slots) === null || a === void 0 ? void 0 : a.filterDropdown) || r.customFilterDropdown, { filters: s } = r; if (i) t[n] = o || null; else if (Array.isArray(o)) { const p = gt(s); t[n] = p.filter((c) => o.includes(String(c))); } else t[n] = null; }), t; } function Cn(e, t) { return t.reduce((l, n) => { const { column: { onFilter: o, filters: r }, filteredKeys: a } = n; return o && a && a.length ? l.filter((i) => a.some((s) => { const p = gt(r), c = p.findIndex((x) => String(x) === String(s)), f = c !== -1 ? p[c] : s; return o(f, i); })) : l; }, e); } function ll(e) { return e.flatMap((t) => "children" in t ? [t, ...ll(t.children || [])] : [t]); } function Br(e) { let { prefixCls: t, dropdownPrefixCls: l, mergedColumns: n, locale: o, onFilterChange: r, getPopupContainer: a } = e; const i = C(() => ll(n.value)), [s, p] = Ve(_t(i.value, !0)), c = C(() => { const b = _t(i.value, !1); if (b.length === 0) return b; let m = !0, v = !0; if (b.forEach((h) => { let { filteredKeys: y } = h; y !== void 0 ? m = !1 : v = !1; }), m) { const h = (i.value || []).map((y, d) => Ue(y, it(d))); return s.value.filter((y) => { let { key: d } = y; return h.includes(d); }).map((y) => { const d = i.value[h.findIndex((E) => E === y.key)]; return g(g({}, y), { column: g(g({}, y.column), d), forceFiltered: d.filtered }); }); } return Te(v, "Table", "Columns should all contain `filteredValue` or not contain `filteredValue`."), b; }), f = C(() => yn(c.value)), x = (b) => { const m = c.value.filter((v) => { let { key: h } = v; return h !== b.key; }); m.push(b), p(m), r(yn(m), m); }; return [(b) => nl(t.value, l.value, b, c.value, o.value, x, a.value), c, f]; } function ol(e, t) { return e.map((l) => { const n = g({}, l); return n.title = jt(n.title, t), "children" in n && (n.children = ol(n.children, t)), n; }); } function zr(e) { return [(l) => ol(l, e.value)]; } function kr(e) { return function(l) { let { prefixCls: n, onExpand: o, record: r, expanded: a, expandable: i } = l; const s = `${n}-row-expand-icon`; return u("button", { type: "button", onClick: (p) => { o(r, p), p.stopPropagation(); }, class: te(s, { [`${s}-spaced`]: !i, [`${s}-expanded`]: i && a, [`${s}-collapsed`]: i && !a }), "aria-label": a ? e.collapse : e.expand, "aria-expanded": a }, null); }; } function rl(e, t) { const l = t.value; return e.map((n) => { var o; if (n === Ne || n === _e) return n; const r = g({}, n), { slots: a = {} } = r; return r.__originColumn__ = n, Te(!("slots" in r), "Table", "`column.slots` is deprecated. Please use `v-slot:headerCell` `v-slot:bodyCell` instead."), Object.keys(a).forEach((i) => { const s = a[i]; r[i] === void 0 && l[s] && (r[i] = l[s]); }), t.value.headerCell && !(!((o = n.slots) === null || o === void 0) && o.title) && (r.title = Ft(t.value, "headerCell", { title: n.title, column: n }, () => [n.title])), "children" in r && Array.isArray(r.children) && (r.children = rl(r.children, t)), r; }); } function _r(e) { return [(l) => rl(l, e)]; } const Dr = (e) => { const { componentCls: t } = e, l = `${e.lineWidth}px ${e.lineType} ${e.tableBorderColor}`, n = (o, r, a) => ({ [`&${t}-${o}`]: { [`> ${t}-container`]: { [`> ${t}-content, > ${t}-body`]: { "> table > tbody > tr > td": { [`> ${t}-expanded-row-fixed`]: { margin: `-${r}px -${a + e.lineWidth}px` } } } } } }); return { [`${t}-wrapper`]: { [`${t}${t}-bordered`]: g(g(g({ // ============================ Title ============================= [`> ${t}-title`]: { border: l, borderBottom: 0 }, // ============================ Content ============================ [`> ${t}-container`]: { borderInlineStart: l, [` > ${t}-content, > ${t}-header, > ${t}-body, > ${t}-summary `]: { "> table": { // ============================= Cell ============================= "\n > thead > tr > th,\n > tbody > tr > td,\n > tfoot > tr > th,\n > tfoot > tr > td\n ": { borderInlineEnd: l }, // ============================ Header ============================ "> thead": { "> tr:not(:last-child) > th": { borderBottom: l }, "> tr > th::before": { backgroundColor: "transparent !important" } }, // Fixed right should provides additional border "\n > thead > tr,\n > tbody > tr,\n > tfoot > tr\n ": { [`> ${t}-cell-fix-right-first::after`]: { borderInlineEnd: l } }, // ========================== Expandable ========================== "> tbody > tr > td": { [`> ${t}-expanded-row-fixed`]: { margin: `-${e.tablePaddingVertical}px -${e.tablePaddingHorizontal + e.lineWidth}px`, "&::after": { position: "absolute", top: 0, insetInlineEnd: e.lineWidth, bottom: 0, borderInlineEnd: l, content: '""' } } } } }, [` > ${t}-content, > ${t}-header `]: { "> table": { borderTop: l } } }, // ============================ Scroll ============================ [`&${t}-scroll-horizontal`]: { [`> ${t}-container > ${t}-body`]: { "> table > tbody": { [` > tr${t}-expanded-row, > tr${t}-placeholder `]: { "> td": { borderInlineEnd: 0 } } } } } }, n("middle", e.tablePaddingVerticalMiddle, e.tablePaddingHorizontalMiddle)), n("small", e.tablePaddingVerticalSmall, e.tablePaddingHorizontalSmall)), { // ============================ Footer ============================ [`> ${t}-footer`]: { border: l, borderTop: 0 } }), // ============================ Nested ============================ [`${t}-cell`]: { [`${t}-container:first-child`]: { // :first-child to avoid the case when bordered and title is set borderTop: 0 }, // https://github.com/ant-design/ant-design/issues/35577 "&-scrollbar:not([rowspan])": { boxShadow: `0 ${e.lineWidth}px 0 ${e.lineWidth}px ${e.tableHeaderBg}` } } } }; }, Kr = (e) => { const { componentCls: t } = e; return { [`${t}-wrapper`]: { [`${t}-cell-ellipsis`]: g(g({}, Wl), { wordBreak: "keep-all", // Fixed first or last should special process [` &${t}-cell-fix-left-last, &${t}-cell-fix-right-first `]: { overflow: "visible", [`${t}-cell-content`]: { display: "block", overflow: "hidden", textOverflow: "ellipsis" } }, [`${t}-column-title`]: { overflow: "hidden", textOverflow: "ellipsis", wordBreak: "keep-all" } }) } }; }, Fr = (e) => { const { componentCls: t } = e; return { [`${t}-wrapper`]: { [`${t}-tbody > tr${t}-placeholder`]: { textAlign: "center", color: e.colorTextDisabled, "&:hover > td": { background: e.colorBgContainer } } } }; }, Ar = (e) => { const { componentCls: t, antCls: l, controlInteractiveSize: n, motionDurationSlow: o, lineWidth: r, paddingXS: a, lineType: i, tableBorderColor: s, tableExpandIconBg: p, tableExpandColumnWidth: c, borderRadius: f, fontSize: x, fontSizeSM: $, lineHeight: b, tablePaddingVertical: m, tablePaddingHorizontal: v, tableExpandedRowBg: h, paddingXXS: y } = e, d = n / 2 - r, E = d * 2 + r * 3, O = `${r}px ${i} ${s}`, z = y - r; return { [`${t}-wrapper`]: { [`${t}-expand-icon-col`]: { width: c }, [`${t}-row-expand-icon-cell`]: { textAlign: "center", [`${t}-row-expand-icon`]: { display: "inline-flex", float: "none", verticalAlign: "sub" } }, [`${t}-row-indent`]: { height: 1, float: "left" }, [`${t}-row-expand-icon`]: g(g({}, ao(e)), { position: "relative", float: "left", boxSizing: "border-box", width: E, height: E, padding: 0, color: "inherit", lineHeight: `${E}px`, background: p, border: O, borderRadius: f, transform: `scale(${n / E})`, transition: `all ${o}`, userSelect: "none", "&:focus, &:hover, &:active": { borderColor: "currentcolor" }, "&::before, &::after": { position: "absolute", background: "currentcolor", transition: `transform ${o} ease-out`, content: '""' }, "&::before": { top: d, insetInlineEnd: z, insetInlineStart: z, height: r }, "&::after": { top: z, bottom: z, insetInlineStart: d, width: r, transform: "rotate(90deg)" }, // Motion effect "&-collapsed::before": { transform: "rotate(-180deg)" }, "&-collapsed::after": { transform: "rotate(0deg)" }, "&-spaced": { "&::before, &::after": { display: "none", content: "none" }, background: "transparent", border: 0, visibility: "hidden" } }), [`${t}-row-indent + ${t}-row-expand-icon`]: { marginTop: (x * b - r * 3) / 2 - Math.ceil(($ * 1.4 - r * 3) / 2), marginInlineEnd: a }, [`tr${t}-expanded-row`]: { "&, &:hover": { "> td": { background: h } }, // https://github.com/ant-design/ant-design/issues/25573 [`${l}-descriptions-view`]: { display: "flex", table: { flex: "auto", width: "auto" } } }, // With fixed [`${t}-expanded-row-fixed`]: { position: "relative", margin: `-${m}px -${v}px`, padding: `${m}px ${v}px` } } }; }, Mr = (e) => { const { componentCls: t, antCls: l, iconCls: n, tableFilterDropdownWidth: o, tableFilterDropdownSearchWidth: r, paddingXXS: a, paddingXS: i, colorText: s, lineWidth: p, lineType: c, tableBorderColor: f, tableHeaderIconColor: x, fontSizeSM: $, tablePaddingHorizontal: b, borderRadius: m, motionDurationSlow: v, colorTextDescription: h, colorPrimary: y, tableHeaderFilterActiveBg: d, colorTextDisabled: E, tableFilterDropdownBg: O, tableFilterDropdownHeight: z, controlItemBgHover: S, controlItemBgActive: H, boxShadowSecondary: T } = e, R = `${l}-dropdown`, k = `${t}-filter-dropdown`, B = `${l}-tree`, M = `${p}px ${c} ${f}`; return [ { [`${t}-wrapper`]: { [`${t}-filter-column`]: { display: "flex", justifyContent: "space-between" }, [`${t}-filter-trigger`]: { position: "relative", display: "flex", alignItems: "center", marginBlock: -a, marginInline: `${a}px ${-b / 2}px`, padding: `0 ${a}px`, color: x, fontSize: $, borderRadius: m, cursor: "pointer", transition: `all ${v}`, "&:hover": { color: h, background: d }, "&.active": { color: y } } } }, { // Dropdown [`${l}-dropdown`]: { [k]: g(g({}, Dt(e)), { minWidth: o, backgroundColor: O, borderRadius: m, boxShadow: T, // Reset menu [`${R}-menu`]: { // https://github.com/ant-design/ant-design/issues/4916 // https://github.com/ant-design/ant-design/issues/19542 maxHeight: z, overflowX: "hidden", border: 0, boxShadow: "none", "&:empty::after": { display: "block", padding: `${i}px 0`, color: E, fontSize: $, textAlign: "center", content: '"Not Found"' } }, [`${k}-tree`]: { paddingBlock: `${i}px 0`, paddingInline: i, [B]: { padding: 0 }, [`${B}-treenode ${B}-node-content-wrapper:hover`]: { backgroundColor: S }, [`${B}-treenode-checkbox-checked ${B}-node-content-wrapper`]: { "&, &:hover": { backgroundColor: H } } }, [`${k}-search`]: { padding: i, borderBottom: M, "&-input": { input: { minWidth: r }, [n]: { color: E } } }, [`${k}-checkall`]: { width: "100%", marginBottom: a, marginInlineStart: a }, // Operation [`${k}-btns`]: { display: "flex", justifyContent: "space-between", padding: `${i - p}px ${i}px`, overflow: "hidden", backgroundColor: "inherit", borderTop: M } }) } }, // Dropdown Menu & SubMenu { // submenu of table filter dropdown [`${l}-dropdown ${k}, ${k}-submenu`]: { // Checkbox [`${l}-checkbox-wrapper + span`]: { paddingInlineStart: i, color: s }, "> ul": { maxHeight: "calc(100vh - 130px)", overflowX: "hidden", overflowY: "auto" } } } ]; }, Hr = (e) => { const { componentCls: t, lineWidth: l, colorSplit: n, motionDurationSlow: o, zIndexTableFixed: r, tableBg: a, zIndexTableSticky: i } = e, s = n; return { [`${t}-wrapper`]: { [` ${t}-cell-fix-left, ${t}-cell-fix-right `]: { position: "sticky !important", zIndex: r, background: a }, [` ${t}-cell-fix-left-first::after, ${t}-cell-fix-left-last::after `]: { position: "absolute", top: 0, right: { _skip_check_: !0, value: 0 }, bottom: -l, width: 30, transform: "translateX(100%)", transition: `box-shadow ${o}`, content: '""', pointerEvents: "none" }, [`${t}-cell-fix-left-all::after`]: { display: "none" }, [` ${t}-cell-fix-right-first::after, ${t}-cell-fix-right-last::after `]: { position: "absolute", top: 0, bottom: -l, left: { _skip_check_: !0, value: 0 }, width: 30, transform: "translateX(-100%)", transition: `box-shadow ${o}`, content: '""', pointerEvents: "none" }, [`${t}-container`]: { "&::before, &::after": { position: "absolute", top: 0, bottom: 0, zIndex: i + 1, width: 30, transition: `box-shadow ${o}`, content: '""', pointerEvents: "none" }, "&::before": { insetInlineStart: 0 }, "&::after": { insetInlineEnd: 0 } }, [`${t}-ping-left`]: { [`&:not(${t}-has-fix-left) ${t}-container`]: { position: "relative", "&::before": { boxShadow: `inset 10px 0 8px -8px ${s}` } }, [` ${t}-cell-fix-left-first::after, ${t}-cell-fix-left-last::after `]: { boxShadow: `inset 10px 0 8px -8px ${s}` }, [`${t}-cell-fix-left-last::before`]: { backgroundColor: "transparent !important" } }, [`${t}-ping-right`]: { [`&:not(${t}-has-fix-right) ${t}-container`]: { position: "relative", "&::after": { boxShadow: `inset -10px 0 8px -8px ${s}` } }, [` ${t}-cell-fix-right-first::after, ${t}-cell-fix-right-last::after `]: { boxShadow: `inset -10px 0 8px -8px ${s}` } } } }; }, jr = (e) => { const { componentCls: t, antCls: l } = e; return { [`${t}-wrapper`]: { // ========================== Pagination ========================== [`${t}-pagination${l}-pagination`]: { margin: `${e.margin}px 0` }, [`${t}-pagination`]: { display: "flex", flexWrap: "wrap", rowGap: e.paddingXS, "> *": { flex: "none" }, "&-left": { justifyContent: "flex-start" }, "&-center": { justifyContent: "center" }, "&-right": { justifyContent: "flex-end" } } } }; }, Lr = (e) => { const { componentCls: t, tableRadius: l } = e; return { [`${t}-wrapper`]: { [t]: { // https://github.com/ant-design/ant-design/issues/39115#issuecomment-1362314574 [`${t}-title, ${t}-header`]: { borderRadius: `${l}px ${l}px 0 0` }, [`${t}-title + ${t}-container`]: { borderStartStartRadius: 0, borderStartEndRadius: 0, table: { borderRadius: 0, "> thead > tr:first-child": { "th:first-child": { borderRadius: 0 }, "th:last-child": { borderRadius: 0 } } } }, "&-container": { borderStartStartRadius: l, borderStartEndRadius: l, "table > thead > tr:first-child": { "> *:first-child": { borderStartStartRadius: l }, "> *:last-child": { borderStartEndRadius: l } } }, "&-footer": { borderRadius: `0 0 ${l}px ${l}px` } } } }; }, Wr = (e) => { const { componentCls: t } = e; return { [`${t}-wrapper-rtl`]: { direction: "rtl", table: { direction: "rtl" }, [`${t}-pagination-left`]: { justifyContent: "flex-end" }, [`${t}-pagination-right`]: { justifyContent: "flex-start" }, [`${t}-row-expand-icon`]: { "&::after": { transform: "rotate(-90deg)" }, "&-collapsed::before": { transform: "rotate(180deg)" }, "&-collapsed::after": { transform: "rotate(0deg)" } } } }; }, Vr = (e) => { const { componentCls: t, antCls: l, iconCls: n, fontSizeIcon: o, paddingXS: r, tableHeaderIconColor: a, tableHeaderIconColorHover: i } = e; return { [`${t}-wrapper`]: { // ========================== Selections ========================== [`${t}-selection-col`]: { width: e.tableSelectionColumnWidth }, [`${t}-bordered ${t}-selection-col`]: { width: e.tableSelectionColumnWidth + r * 2 }, [` table tr th${t}-selection-column, table tr td${t}-selection-column `]: { paddingInlineEnd: e.paddingXS, paddingInlineStart: e.paddingXS, textAlign: "center", [`${l}-radio-wrapper`]: { marginInlineEnd: 0 } }, [`table tr th${t}-selection-column${t}-cell-fix-left`]: { zIndex: e.zIndexTableFixed + 1 }, [`table tr th${t}-selection-column::after`]: { backgroundColor: "transparent !important" }, [`${t}-selection`]: { position: "relative", display: "inline-flex", flexDirection: "column" }, [`${t}-selection-extra`]: { position: "absolute", top: 0, zIndex: 1, cursor: "pointer", transition: `all ${e.motionDurationSlow}`, marginInlineStart: "100%", paddingInlineStart: `${e.tablePaddingHorizontal / 4}px`, [n]: { color: a, fontSize: o, verticalAlign: "baseline", "&:hover": { color: i } } } } }; }, Xr = (e) => { const { componentCls: t } = e, l = (n, o, r, a) => ({ [`${t}${t}-${n}`]: { fontSize: a, [` ${t}-title, ${t}-footer, ${t}-thead > tr > th, ${t}-tbody > tr > td, tfoot > tr > th, tfoot > tr > td `]: { padding: `${o}px ${r}px` }, [`${t}-filter-trigger`]: { marginInlineEnd: `-${r / 2}px` }, [`${t}-expanded-row-fixed`]: { margin: `-${o}px -${r}px` }, [`${t}-tbody`]: { // ========================= Nest Table =========================== [`${t}-wrapper:only-child ${t}`]: { marginBlock: `-${o}px`, marginInline: `${e.tableExpandColumnWidth - r}px -${r}px` } }, // https://github.com/ant-design/ant-design/issues/35167 [`${t}-selection-column`]: { paddingInlineStart: `${r / 4}px` } } }); return { [`${t}-wrapper`]: g(g({}, l("middle", e.tablePaddingVerticalMiddle, e.tablePaddingHorizontalMiddle, e.tableFontSizeMiddle)), l("small", e.tablePaddingVerticalSmall, e.tablePaddingHorizontalSmall, e.tableFontSizeSmall)) }; }, Ur = (e) => { const { componentCls: t } = e; return { [`${t}-wrapper ${t}-resize-handle`]: { position: "absolute", top: 0, height: "100% !important", bottom: 0, left: " auto !important", right: " -8px", cursor: "col-resize", touchAction: "none", userSelect: "auto", width: "16px", zIndex: 1, "&-line": { display: "block", width: "1px", marginLeft: "7px", height: "100% !important", backgroundColor: e.colorPrimary, opacity: 0 }, "&:hover &-line": { opacity: 1 } }, [`${t}-wrapper ${t}-resize-handle.dragging`]: { overflow: "hidden", [`${t}-resize-handle-line`]: { opacity: 1 }, "&:before": { position: "absolute", top: 0, bottom: 0, content: '" "', width: "200vw", transform: "translateX(-50%)", opacity: 0 } } }; }, Gr = (e) => { const { componentCls: t, marginXXS: l, fontSizeIcon: n, tableHeaderIconColor: o, tableHeaderIconColorHover: r } = e; return { [`${t}-wrapper`]: { [`${t}-thead th${t}-column-has-sorters`]: { outline: "none", cursor: "pointer", transition: `all ${e.motionDurationSlow}`, "&:hover": { background: e.tableHeaderSortHoverBg, "&::before": { backgroundColor: "transparent !important" } }, "&:focus-visible": { color: e.colorPrimary }, // https://github.com/ant-design/ant-design/issues/30969 [` &${t}-cell-fix-left:hover, &${t}-cell-fix-right:hover `]: { background: e.tableFixedHeaderSortActiveBg } }, [`${t}-thead th${t}-column-sort`]: { background: e.tableHeaderSortBg, "&::before": { backgroundColor: "transparent !important" } }, [`td${t}-column-sort`]: { background: e.tableBodySortBg }, [`${t}-column-title`]: { position: "relative", zIndex: 1, flex: 1 }, [`${t}-column-sorters`]: { display: "flex", flex: "auto", alignItems: "center", justifyContent: "space-between", "&::after": { position: "absolute", inset: 0, width: "100%", height: "100%", content: '""' } }, [`${t}-column-sorter`]: { marginInlineStart: l, color: o, fontSize: 0, transition: `color ${e.motionDurationSlow}`, "&-inner": { display: "inline-flex", flexDirection: "column", alignItems: "center" }, "&-up, &-down": { fontSize: n, "&.active": { color: e.colorPrimary } }, [`${t}-column-sorter-up + ${t}-column-sorter-down`]: { marginTop: "-0.3em" } }, [`${t}-column-sorters:hover ${t}-column-sorter`]: { color: r } } }; }, Jr = (e) => { const { componentCls: t, opacityLoading: l, tableScrollThumbBg: n, tableScrollThumbBgHover: o, tableScrollThumbSize: r, tableScrollBg: a, zIndexTableSticky: i } = e, s = `${e.lineWidth}px ${e.lineType} ${e.tableBorderColor}`; return { [`${t}-wrapper`]: { [`${t}-sticky`]: { "&-holder": { position: "sticky", zIndex: i, background: e.colorBgContainer }, "&-scroll": { position: "sticky", bottom: 0, height: `${r}px !important`, zIndex: i, display: "flex", alignItems: "center", background: a, borderTop: s, opacity: l, "&:hover": { transformOrigin: "center bottom" }, // fake scrollbar style of sticky "&-bar": { height: r, backgroundColor: n, borderRadius: 100, transition: `all ${e.motionDurationSlow}, transform none`, position: "absolute", bottom: 0, "&:hover, &-active": { backgroundColor: o } } } } } }; }, Sn = (e) => { const { componentCls: t, lineWidth: l, tableBorderColor: n } = e, o = `${l}px ${e.lineType} ${n}`; return { [`${t}-wrapper`]: { [`${t}-summary`]: { position: "relative", zIndex: e.zIndexTableFixed, background: e.tableBg, "> tr": { "> th, > td": { borderBottom: o } } }, [`div${t}-summary`]: { boxShadow: `0 -${l}px 0 ${n}` } } }; }, qr = (e) => { const { componentCls: t, fontWeightStrong: l, tablePaddingVertical: n, tablePaddingHorizontal: o, lineWidth: r, lineType: a, tableBorderColor: i, tableFontSize: s, tableBg: p, tableRadius: c, tableHeaderTextColor: f, motionDurationMid: x, tableHeaderBg: $, tableHeaderCellSplitColor: b, tableRowHoverBg: m, tableSelectedRowBg: v, tableSelectedRowHoverBg: h, tableFooterTextColor: y, tableFooterBg: d, paddingContentVerticalLG: E } = e, O = `${r}px ${a} ${i}`; return { [`${t}-wrapper`]: g(g({ clear: "both", maxWidth: "100%" }, Vl()), { [t]: g(g({}, Dt(e)), { fontSize: s, background: p, borderRadius: `${c}px ${c}px 0 0` }), // https://github.com/ant-design/ant-design/issues/17611 table: { width: "100%", textAlign: "start", borderRadius: `${c}px ${c}px 0 0`, borderCollapse: "separate", borderSpacing: 0 }, // ============================= Cell ============================= [` ${t}-thead > tr > th, ${t}-tbody > tr > td, tfoot > tr > th, tfoot > tr > td `]: { position: "relative", padding: `${E}px ${o}px`, overflowWrap: "break-word" }, // ============================ Title ============================= [`${t}-title`]: { padding: `${n}px ${o}px` }, // ============================ Header ============================ [`${t}-thead`]: { "\n > tr > th,\n > tr > td\n ": { position: "relative", color: f, fontWeight: l, textAlign: "start", background: $, borderBottom: O, transition: `background ${x} ease`, "&[colspan]:not([colspan='1'])": { textAlign: "center" }, [`&:not(:last-child):not(${t}-selection-column):not(${t}-row-expand-icon-cell):not([colspan])::before`]: { position: "absolute", top: "50%", insetInlineEnd: 0, width: 1, height: "1.6em", backgroundColor: b, transform: "translateY(-50%)", transition: `background-color ${x}`, content: '""' } }, "> tr:not(:last-child) > th[colspan]": { borderBottom: 0 } }, // ============================ Body ============================ // Borderless Table has unique hover style, which would be implemented with `borderTop`. [`${t}:not(${t}-bordered)`]: { [`${t}-tbody`]: { "> tr": { "> td": { borderTop: O, borderBottom: "transparent" }, "&:last-child > td": { borderBottom: O }, [`&:first-child > td, &${t}-measure-row + tr > td`]: { borderTop: "none", borderTopColor: "transparent" } } } }, // Bordered Table remains simple `borderBottom`. // Ref issue: https://github.com/ant-design/ant-design/issues/38724 [`${t}${t}-bordered`]: { [`${t}-tbody`]: { "> tr": { "> td": { borderBottom: O } } } }, [`${t}-tbody`]: { "> tr": { "> td": { transition: `background ${x}, border-color ${x}`, // ========================= Nest Table =========================== [` > ${t}-wrapper:only-child, > ${t}-expanded-row-fixed > ${t}-wrapper:only-child `]: { [t]: { marginBlock: `-${n}px`, marginInline: `${e.tableExpandColumnWidth - o}px -${o}px`, [`${t}-tbody > tr:last-child > td`]: { borderBottom: 0, "&:first-child, &:last-child": { borderRadius: 0 } } } } }, [` &${t}-row:hover > td, > td${t}-cell-row-hover `]: { background: m }, [`&${t}-row-selected`]: { "> td": { background: v }, "&:hover > td": { background: h } } } }, // ============================ Footer ============================ [`${t}-footer`]: { padding: `${n}px ${o}px`, color: y, background: d } }) }; }, Yr = In("Table", (e) => { const { controlItemBgActive: t, controlItemBgActiveHover: l, colorTextPlaceholder: n, colorTextHeading: o, colorSplit: r, colorBorderSecondary: a, fontSize: i, padding: s, paddingXS: p, paddingSM: c, controlHeight: f, colorFillAlter: x, colorIcon: $, colorIconHover: b, opacityLoading: m, colorBgContainer: v, borderRadiusLG: h, colorFillContent: y, colorFillSecondary: d, controlInteractiveSize: E } = e, O = new ot($), z = new ot(b), S = t, H = 2, T = new ot(d).onBackground(v).toHexString(), R = new ot(y).onBackground(v).toHexString(), k = new ot(x).onBackground(v).toHexString(), B = Pn(e, { tableFontSize: i, tableBg: v, tableRadius: h, tablePaddingVertical: s, tablePaddingHorizontal: s, tablePaddingVerticalMiddle: c, tablePaddingHorizontalMiddle: p, tablePaddingVerticalSmall: p, tablePaddingHorizontalSmall: p, tableBorderColor: a, tableHeaderTextColor: o, tableHeaderBg: k, tableFooterTextColor: o, tableFooterBg: k, tableHeaderCellSplitColor: a, tableHeaderSortBg: T, tableHeaderSortHoverBg: R, tableHeaderIconColor: O.clone().setAlpha(O.getAlpha() * m).toRgbString(), tableHeaderIconColorHover: z.clone().setAlpha(z.getAlpha() * m).toRgbString(), tableBodySortBg: k, tableFixedHeaderSortActiveBg: T, tableHeaderFilterActiveBg: y, tableFilterDropdownBg: v, tableRowHoverBg: k, tableSelectedRowBg: S, tableSelectedRowHoverBg: l, zIndexTableFixed: H, zIndexTableSticky: H + 1, tableFontSizeMiddle: i, tableFontSizeSmall: i, tableSelectionColumnWidth: f, tableExpandIconBg: v, tableExpandColumnWidth: E + 2 * e.padding, tableExpandedRowBg: x, // Dropdown tableFilterDropdownWidth: 120, tableFilterDropdownHeight: 264, tableFilterDropdownSearchWidth: 140, // Virtual Scroll Bar tableScrollThumbSize: 8, tableScrollThumbBg: n, tableScrollThumbBgHover: o, tableScrollBg: r }); return [qr(B), jr(B), Sn(B), Gr(B), Mr(B), Dr(B), Lr(B), Ar(B), Sn(B), Fr(B), Vr(B), Hr(B), Jr(B), Kr(B), Xr(B), Ur(B), Wr(B)]; }), Qr = [], al = () => ({ prefixCls: Ke(), columns: qe(), rowKey: De([String, Function]), tableLayout: Ke(), rowClassName: De([String, Function]), title: se(), footer: se(), id: Ke(), showHeader: Be(), components: Ye(), customRow: se(), customHeaderRow: se(), direction: Ke(), expandFixed: De([Boolean, String]), expandColumnWidth: Number, expandedRowKeys: qe(), defaultExpandedRowKeys: qe(), expandedRowRender: se(), expandRowByClick: Be(), expandIcon: se(), onExpand: se(), onExpandedRowsChange: se(), "onUpdate:expandedRowKeys": se(), defaultExpandAllRows: Be(), indentSize: Number, /** @deprecated Please use `EXPAND_COLUMN` in `columns` directly */ expandIconColumnIndex: Number, showExpandColumn: Be(), expandedRowClassName: se(), childrenColumnName: Ke(), rowExpandable: se(), sticky: De([Boolean, Object]), dropdownPrefixCls: String, dataSource: qe(), pagination: De([Boolean, Object]), loading: De([Boolean, Object]), size: Ke(), bordered: Be(), locale: Ye(), onChange: se(), onResizeColumn: se(), rowSelection: Ye(), getPopupContainer: se(), scroll: Ye(), sortDirections: qe(), showSorterTooltip: De([Boolean, Object], !0), transformCellText: se() }), Zr = ue({ name: "InternalTable", inheritAttrs: !1, props: zn(g(g({}, al()), { contextSlots: Ye() }), { rowKey: "key" }), setup(e, t) { let { attrs: l, slots: n, expose: o, emit: r } = t; Te(!(typeof e.rowKey == "function" && e.rowKey.length > 1), "Table", "`index` parameter of `rowKey` function is deprecated. There is no guarantee that it will work as expected."), No(C(() => e.contextSlots)), Bo({ onResizeColumn: (_, Y) => { r("resizeColumn", _, Y); } }); const a = En(), i = C(() => { const _ = new Set(Object.keys(a.value).filter((Y) => a.value[Y])); return e.columns.filter((Y) => !Y.responsive || Y.responsive.some((D) => _.has(D))); }), { size: s, renderEmpty: p, direction: c, prefixCls: f, configProvider: x } = Kt("table", e), [$, b] = Yr(f), m = C(() => { var _; return e.transformCellText || ((_ = x.transformCellText) === null || _ === void 0 ? void 0 : _.value); }), [v] = Tn("Table", Xl.Table, xe(e, "locale")), h = C(() => e.dataSource || Qr), y = C(() => x.getPrefixCls("dropdown", e.dropdownPrefixCls)), d = C(() => e.childrenColumnName || "children"), E = C(() => h.value.some((_) => _ == null ? void 0 : _[d.value]) ? "nest" : e.expandedRowRender ? "row" : null), O = Qe({ body: null }), z = (_) => { g(O, _); }, S = C(() => typeof e.rowKey == "function" ? e.rowKey : (_) => _ == null ? void 0 : _[e.rowKey]), [H] = yr(h, d, S), T = {}, R = function(_, Y) { let D = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1; const { pagination: W, scroll: X, onChange: re } = e, U = g(g({}, T), _); D && (T.resetPagination(), U.pagination.current && (U.pagination.current = 1), W && W.onChange && W.onChange(1, U.pagination.pageSize)), X && X.scrollToFirstRowOnChange !== !1 && O.body && ro(0, { getContainer: () => O.body }), re == null || re(U.pagination, U.filters, U.sorter, { currentDataSource: Cn(kt(h.value, U.sorterStates, d.value), U.filterStates), action: Y }); }, k = (_, Y) => { R({ sorter: _, sorterStates: Y }, "sort", !1); }, [B, M, J, Z] = Ir({ prefixCls: f, mergedColumns: i, onSorterChange: k, sortDirections: C(() => e.sortDirections || ["ascend", "descend"]), tableLocale: v, showSorterTooltip: xe(e, "showSorterTooltip") }), ee = C(() => kt(h.value, M.value, d.value)), fe = (_, Y) => { R({ filters: _, filterStates: Y }, "filter", !0); }, [le, L, j] = Br({ prefixCls: f, locale: v, dropdownPrefixCls: y, mergedColumns: i, onFilterChange: fe, getPopupContainer: xe(e, "getPopupContainer") }), q = C(() => Cn(ee.value, L.value)), [w] = _r(xe(e, "contextSlots")), K = C(() => { const _ = {}, Y = j.value; return Object.keys(Y).forEach((D) => { Y[D] !== null && (_[D] = Y[D]); }), g(g({}, J.value), { filters: _ }); }), [N] = zr(K), A = (_, Y) => { R({ pagination: g(g({}, T.pagination), { current: _, pageSize: Y }) }, "paginate"); }, [F, oe] = br(C(() => q.value.length), xe(e, "pagination"), A); Re(() => { T.sorter = Z.value, T.sorterStates = M.value, T.filters = j.value, T.filterStates = L.value, T.pagination = e.pagination === !1 ? {} : xr(F.value, e.pagination), T.resetPagination = oe; }); const V = C(() => { if (e.pagination === !1 || !F.value.pageSize) return q.value; const { current: _ = 1, total: Y, pageSize: D = Bt } = F.value; return Te(_ > 0, "Table", "`current` should be positive number."), q.value.length < Y ? q.value.length > D ? q.value.slice((_ - 1) * D, _ * D) : q.value : q.value.slice((_ - 1) * D, _ * D); }); Re(() => { at(() => { const { total: _, pageSize: Y = Bt } = F.value; q.value.length < _ && q.value.length > Y && Te(!1, "Table", "`dataSource` length is less than `pagination.total` but large than `pagination.pageSize`. Please make sure your config correct data with async mode."); }); }, { flush: "post" }); const ge = C(() => e.showExpandColumn === !1 ? -1 : E.value === "nest" && e.expandIconColumnIndex === void 0 ? e.rowSelection ? 1 : 0 : e.expandIconColumnIndex > 0 && e.rowSelection ? e.expandIconColumnIndex - 1 : e.expandIconColumnIndex), be = pe(); Fe(() => e.rowSelection, () => { be.value = e.rowSelection ? g({}, e.rowSelection) : e.rowSelection; }, { deep: !0, immediate: !0 }); const [Se, Ee] = Sr(be, { prefixCls: f, data: q, pageData: V, getRowKey: S, getRecordByKey: H, expandType: E, childrenColumnName: d, locale: v, getPopupContainer: C(() => e.getPopupContainer) }), Oe = (_, Y, D) => { let W; const { rowClassName: X } = e; return typeof X == "function" ? W = te(X(_, Y, D)) : W = te(X), te({ [`${f.value}-row-selected`]: Ee.value.has(S.value(_, Y)) }, W); }; o({ selectedKeySet: Ee }); const ye = C(() => typeof e.indentSize == "number" ? e.indentSize : 15), $e = (_) => N(Se(le(B(w(_))))); return () => { var _; const { expandIcon: Y = n.expandIcon || kr(v.value), pagination: D, loading: W, bordered: X } = e; let re, U; if (D !== !1 && (!((_ = F.value) === null || _ === void 0) && _.total)) { let I; F.value.size ? I = F.value.size : I = s.value === "small" || s.value === "middle" ? "small" : void 0; const P = (we) => u(Eo, G(G({}, F.value), {}, { class: [`${f.value}-pagination ${f.value}-pagination-${we}`, F.value.class], size: I }), null), Q = c.value === "rtl" ? "left" : "right", { position: de } = F.value; if (de !== null && Array.isArray(de)) { const we = de.find((ve) => ve.includes("top")), me = de.find((ve) => ve.includes("bottom")), Ce = de.every((ve) => `${ve}` == "none"); !we && !me && !Ce && (U = P(Q)), we && (re = P(we.toLowerCase().replace("top", ""))), me && (U = P(me.toLowerCase().replace("bottom", ""))); } else U = P(Q); } let ne; typeof W == "boolean" ? ne = { spinning: W } : typeof W == "object" && (ne = g({ spinning: !0 }, W)); const he = te(`${f.value}-wrapper`, { [`${f.value}-wrapper-rtl`]: c.value === "rtl" }, l.class, b.value), ae = Ul(e, ["columns"]); return $(u("div", { class: he, style: l.style }, [u(Gl, G({ spinning: !1 }, ne), { default: () => [re, u(hr, G(G(G({}, l), ae), {}, { expandedRowKeys: e.expandedRowKeys, defaultExpandedRowKeys: e.defaultExpandedRowKeys, expandIconColumnIndex: ge.value, indentSize: ye.value, expandIcon: Y, columns: i.value, direction: c.value, prefixCls: f.value, class: te({ [`${f.value}-middle`]: s.value === "middle", [`${f.value}-small`]: s.value === "small", [`${f.value}-bordered`]: X, [`${f.value}-empty`]: h.value.length === 0 }), data: V.value, rowKey: S.value, rowClassName: Oe, internalHooks: Nt, internalRefs: O, onUpdateInternalRefs: z, transformColumns: $e, transformCellText: m.value }), g(g({}, n), { emptyText: () => { var I, P; return ((I = n.emptyText) === null || I === void 0 ? void 0 : I.call(n)) || ((P = e.locale) === null || P === void 0 ? void 0 : P.emptyText) || p("Table"); } })), U] })])); }; } }), sa = ue({ name: "ATable", inheritAttrs: !1, props: zn(al(), { rowKey: "key" }), slots: Object, setup(e, t) { let { attrs: l, slots: n, expose: o } = t; const r = pe(); return o({ table: r }), () => { var a; const i = e.columns || Qn((a = n.default) === null || a === void 0 ? void 0 : a.call(n)); return u(Zr, G(G(G({ ref: r }, l), e), {}, { columns: i || [], expandedRowRender: n.expandedRowRender || e.expandedRowRender, contextSlots: g({}, n) }), n); }; } }); export { Ht as C, _e as E, ia as F, fn as S, sa as T, aa as a, pn as b, mn as c, Ne as d, Hn as g, al as t, Ae as u };