import { g as j, m as F, d, r as k, b as U, u as R, bO as X, _ as M, dU as Y, c as q, bb as J, bn as K, P as O, bg as P, dV as I } from "./index2.js"; import { defineComponent as V, computed as o, createVNode as h, ref as N, watch as Q, Fragment as Z } from "vue"; import { u as tt } from "./useFlexGapSupport.js"; const et = (t) => { const { componentCls: e, sizePaddingEdgeHorizontal: l, colorSplit: a, lineWidth: i } = t; return { [e]: d(d({}, k(t)), { borderBlockStart: `${i}px solid ${a}`, // vertical "&-vertical": { position: "relative", top: "-0.06em", display: "inline-block", height: "0.9em", margin: `0 ${t.dividerVerticalGutterMargin}px`, verticalAlign: "middle", borderTop: 0, borderInlineStart: `${i}px solid ${a}` }, "&-horizontal": { display: "flex", clear: "both", width: "100%", minWidth: "100%", margin: `${t.dividerHorizontalGutterMargin}px 0` }, [`&-horizontal${e}-with-text`]: { display: "flex", alignItems: "center", margin: `${t.dividerHorizontalWithTextGutterMargin}px 0`, color: t.colorTextHeading, fontWeight: 500, fontSize: t.fontSizeLG, whiteSpace: "nowrap", textAlign: "center", borderBlockStart: `0 ${a}`, "&::before, &::after": { position: "relative", width: "50%", borderBlockStart: `${i}px solid transparent`, // Chrome not accept `inherit` in `border-top` borderBlockStartColor: "inherit", borderBlockEnd: 0, transform: "translateY(50%)", content: "''" } }, [`&-horizontal${e}-with-text-left`]: { "&::before": { width: "5%" }, "&::after": { width: "95%" } }, [`&-horizontal${e}-with-text-right`]: { "&::before": { width: "95%" }, "&::after": { width: "5%" } }, [`${e}-inner-text`]: { display: "inline-block", padding: "0 1em" }, "&-dashed": { background: "none", borderColor: a, borderStyle: "dashed", borderWidth: `${i}px 0 0` }, [`&-horizontal${e}-with-text${e}-dashed`]: { "&::before, &::after": { borderStyle: "dashed none none" } }, [`&-vertical${e}-dashed`]: { borderInlineStartWidth: i, borderInlineEnd: 0, borderBlockStart: 0, borderBlockEnd: 0 }, [`&-plain${e}-with-text`]: { color: t.colorText, fontWeight: "normal", fontSize: t.fontSize }, [`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]: { "&::before": { width: 0 }, "&::after": { width: "100%" }, [`${e}-inner-text`]: { paddingInlineStart: l } }, [`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]: { "&::before": { width: "100%" }, "&::after": { width: 0 }, [`${e}-inner-text`]: { paddingInlineEnd: l } } }) }; }, it = j("Divider", (t) => { const e = F(t, { dividerVerticalGutterMargin: t.marginXS, dividerHorizontalWithTextGutterMargin: t.margin, dividerHorizontalGutterMargin: t.marginLG }); return [et(e)]; }, { sizePaddingEdgeHorizontal: 0 }), nt = () => ({ prefixCls: String, type: { type: String, default: "horizontal" }, dashed: { type: Boolean, default: !1 }, orientation: { type: String, default: "center" }, plain: { type: Boolean, default: !1 }, orientationMargin: [String, Number] }), at = V({ name: "ADivider", inheritAttrs: !1, compatConfig: { MODE: 3 }, props: nt(), setup(t, e) { let { slots: l, attrs: a } = e; const { prefixCls: i, direction: f } = R("divider", t), [x, S] = it(i), b = o(() => t.orientation === "left" && t.orientationMargin != null), m = o(() => t.orientation === "right" && t.orientationMargin != null), c = o(() => { const { type: r, dashed: u, plain: _ } = t, s = i.value; return { [s]: !0, [S.value]: !!S.value, [`${s}-${r}`]: !0, [`${s}-dashed`]: !!u, [`${s}-plain`]: !!_, [`${s}-rtl`]: f.value === "rtl", [`${s}-no-default-orientation-margin-left`]: b.value, [`${s}-no-default-orientation-margin-right`]: m.value }; }), p = o(() => { const r = typeof t.orientationMargin == "number" ? `${t.orientationMargin}px` : t.orientationMargin; return d(d({}, b.value && { marginLeft: r }), m.value && { marginRight: r }); }), v = o(() => t.orientation.length > 0 ? "-" + t.orientation : t.orientation); return () => { var r; const u = X((r = l.default) === null || r === void 0 ? void 0 : r.call(l)); return x(h("div", M(M({}, a), {}, { class: [c.value, u.length ? `${i.value}-with-text ${i.value}-with-text${v.value}` : "", a.class], role: "separator" }), [u.length ? h("span", { class: `${i.value}-inner-text`, style: p.value }, [u]) : null])); }; } }), ut = U(at), rt = { small: 8, middle: 16, large: 24 }, lt = () => ({ prefixCls: String, size: { type: [String, Number, Array] }, direction: O.oneOf(P("horizontal", "vertical")).def("horizontal"), align: O.oneOf(P("start", "end", "center", "baseline")), wrap: K() }); function ot(t) { return typeof t == "string" ? rt[t] : t || 0; } const C = V({ compatConfig: { MODE: 3 }, name: "ASpace", inheritAttrs: !1, props: lt(), slots: Object, setup(t, e) { let { slots: l, attrs: a } = e; const { prefixCls: i, space: f, direction: x } = R("space", t), [S, b] = Y(i), m = tt(), c = o(() => { var n, g, $; return ($ = (n = t.size) !== null && n !== void 0 ? n : (g = f == null ? void 0 : f.value) === null || g === void 0 ? void 0 : g.size) !== null && $ !== void 0 ? $ : "small"; }), p = N(), v = N(); Q(c, () => { [p.value, v.value] = (Array.isArray(c.value) ? c.value : [c.value, c.value]).map((n) => ot(n)); }, { immediate: !0 }); const r = o(() => t.align === void 0 && t.direction === "horizontal" ? "center" : t.align), u = o(() => q(i.value, b.value, `${i.value}-${t.direction}`, { [`${i.value}-rtl`]: x.value === "rtl", [`${i.value}-align-${r.value}`]: r.value })), _ = o(() => x.value === "rtl" ? "marginLeft" : "marginRight"), s = o(() => { const n = {}; return m.value && (n.columnGap = `${p.value}px`, n.rowGap = `${v.value}px`), d(d({}, n), t.wrap && { flexWrap: "wrap", marginBottom: `${-v.value}px` }); }); return () => { var n, g; const { wrap: $, direction: L = "horizontal" } = t, A = (n = l.default) === null || n === void 0 ? void 0 : n.call(l), E = J(A), W = E.length; if (W === 0) return null; const y = (g = l.split) === null || g === void 0 ? void 0 : g.call(l), H = `${i.value}-item`, T = p.value, B = W - 1; return h("div", M(M({}, a), {}, { class: [u.value, a.class], style: [s.value, a.style] }), [E.map((D, z) => { let G = A.indexOf(D); G === -1 && (G = `$$space-${z}`); let w = {}; return m.value || (L === "vertical" ? z < B && (w = { marginBottom: `${T / (y ? 2 : 1)}px` }) : w = d(d({}, z < B && { [_.value]: `${T / (y ? 2 : 1)}px` }), $ && { paddingBottom: `${v.value}px` })), S(h(Z, { key: G }, [h("div", { class: H, style: w }, [D]), z < B && y && h("span", { class: `${H}-split`, style: w }, [y])])); })]); }; } }); C.Compact = I; C.install = function(t) { return t.component(C.name, C), t.component(I.name, I), t; }; export { C as S, ut as _ };