| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- import { g as P, m as S, bM as _, d, r as w, bN as B, bO as k, b as T, bA as N, u as A, c as z, y as D, _ as h, a3 as I, o as W, i as E, bP as H, aG as C, bQ as M, f as $ } from "./index2.js";
- import { defineComponent as j, ref as R, computed as O, createVNode as b, Fragment as G } from "vue";
- const L = (e) => {
- const {
- componentCls: o,
- popoverBg: r,
- popoverColor: t,
- width: a,
- fontWeightStrong: s,
- popoverPadding: l,
- boxShadowSecondary: c,
- colorTextHeading: u,
- borderRadiusLG: g,
- zIndexPopup: p,
- marginXS: v,
- colorBgElevated: n
- } = e;
- return [
- {
- [o]: d(d({}, w(e)), {
- position: "absolute",
- top: 0,
- // use `left` to fix https://github.com/ant-design/ant-design/issues/39195
- left: {
- _skip_check_: !0,
- value: 0
- },
- zIndex: p,
- fontWeight: "normal",
- whiteSpace: "normal",
- textAlign: "start",
- cursor: "auto",
- userSelect: "text",
- "--antd-arrow-background-color": n,
- "&-rtl": {
- direction: "rtl"
- },
- "&-hidden": {
- display: "none"
- },
- [`${o}-content`]: {
- position: "relative"
- },
- [`${o}-inner`]: {
- backgroundColor: r,
- backgroundClip: "padding-box",
- borderRadius: g,
- boxShadow: c,
- padding: l
- },
- [`${o}-title`]: {
- minWidth: a,
- marginBottom: v,
- color: u,
- fontWeight: s
- },
- [`${o}-inner-content`]: {
- color: t
- }
- })
- },
- // Arrow Style
- B(e, {
- colorBg: "var(--antd-arrow-background-color)"
- }),
- // Pure Render
- {
- [`${o}-pure`]: {
- position: "relative",
- maxWidth: "none",
- [`${o}-content`]: {
- display: "inline-block"
- }
- }
- }
- ];
- }, F = (e) => {
- const {
- componentCls: o
- } = e;
- return {
- [o]: k.map((r) => {
- const t = e[`${r}-6`];
- return {
- [`&${o}-${r}`]: {
- "--antd-arrow-background-color": t,
- [`${o}-inner`]: {
- backgroundColor: t
- },
- [`${o}-arrow`]: {
- background: "transparent"
- }
- }
- };
- })
- };
- }, Q = (e) => {
- const {
- componentCls: o,
- lineWidth: r,
- lineType: t,
- colorSplit: a,
- paddingSM: s,
- controlHeight: l,
- fontSize: c,
- lineHeight: u,
- padding: g
- } = e, p = l - Math.round(c * u), v = p / 2, n = p / 2 - r, i = g;
- return {
- [o]: {
- [`${o}-inner`]: {
- padding: 0
- },
- [`${o}-title`]: {
- margin: 0,
- padding: `${v}px ${i}px ${n}px`,
- borderBottom: `${r}px ${t} ${a}`
- },
- [`${o}-inner-content`]: {
- padding: `${s}px ${i}px`
- }
- }
- };
- }, V = P("Popover", (e) => {
- const {
- colorBgElevated: o,
- colorText: r,
- wireframe: t
- } = e, a = S(e, {
- popoverBg: o,
- popoverColor: r,
- popoverPadding: 12
- // Fixed Value
- });
- return [L(a), F(a), t && Q(a), _(a, "zoom-big")];
- }, (e) => {
- let {
- zIndexPopupBase: o
- } = e;
- return {
- zIndexPopup: o + 30,
- width: 177
- };
- }), X = () => d(d({}, M()), {
- content: $(),
- title: $()
- }), Z = j({
- compatConfig: {
- MODE: 3
- },
- name: "APopover",
- inheritAttrs: !1,
- props: E(X(), d(d({}, H()), {
- trigger: "hover",
- placement: "top",
- mouseEnterDelay: 0.1,
- mouseLeaveDelay: 0.1
- })),
- setup(e, o) {
- let {
- expose: r,
- slots: t,
- attrs: a
- } = o;
- const s = R();
- N(e.visible === void 0, "popover", "`visible` will be removed in next major version, please use `open` instead."), r({
- getPopupDomNode: () => {
- var n, i;
- return (i = (n = s.value) === null || n === void 0 ? void 0 : n.getPopupDomNode) === null || i === void 0 ? void 0 : i.call(n);
- }
- });
- const {
- prefixCls: l,
- configProvider: c
- } = A("popover", e), [u, g] = V(l), p = O(() => c.getPrefixCls()), v = () => {
- var n, i;
- const {
- title: m = C((n = t.title) === null || n === void 0 ? void 0 : n.call(t)),
- content: f = C((i = t.content) === null || i === void 0 ? void 0 : i.call(t))
- } = e, x = !!(Array.isArray(m) ? m.length : m), y = !!(Array.isArray(f) ? f.length : m);
- return !x && !y ? null : b(G, null, [x && b("div", {
- class: `${l.value}-title`
- }, [m]), b("div", {
- class: `${l.value}-inner-content`
- }, [f])]);
- };
- return () => {
- const n = z(e.overlayClassName, g.value);
- return u(b(D, h(h(h({}, W(e, ["title", "content"])), a), {}, {
- prefixCls: l.value,
- ref: s,
- overlayClassName: n,
- transitionName: I(p.value, "zoom-big", e.transitionName),
- "data-popover-inject": !0
- }), {
- title: v,
- default: t.default
- }));
- };
- }
- }), U = T(Z);
- export {
- U as _
- };
|