index6.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. import { g as P, m as S, br as _, d, r as w, bs as B, bt as k, b as T, bf as N, u as z, c as A, y as D, _ as h, a3 as I, o as W, i as E, bu as H, b0 as C, bv as j, f as $ } from "./index2.js";
  2. import { defineComponent as M, ref as R, computed as L, createVNode as b, Fragment as O } from "vue";
  3. const F = (e) => {
  4. const {
  5. componentCls: o,
  6. popoverBg: r,
  7. popoverColor: t,
  8. width: a,
  9. fontWeightStrong: s,
  10. popoverPadding: l,
  11. boxShadowSecondary: c,
  12. colorTextHeading: u,
  13. borderRadiusLG: g,
  14. zIndexPopup: p,
  15. marginXS: v,
  16. colorBgElevated: n
  17. } = e;
  18. return [
  19. {
  20. [o]: d(d({}, w(e)), {
  21. position: "absolute",
  22. top: 0,
  23. // use `left` to fix https://github.com/ant-design/ant-design/issues/39195
  24. left: {
  25. _skip_check_: !0,
  26. value: 0
  27. },
  28. zIndex: p,
  29. fontWeight: "normal",
  30. whiteSpace: "normal",
  31. textAlign: "start",
  32. cursor: "auto",
  33. userSelect: "text",
  34. "--antd-arrow-background-color": n,
  35. "&-rtl": {
  36. direction: "rtl"
  37. },
  38. "&-hidden": {
  39. display: "none"
  40. },
  41. [`${o}-content`]: {
  42. position: "relative"
  43. },
  44. [`${o}-inner`]: {
  45. backgroundColor: r,
  46. backgroundClip: "padding-box",
  47. borderRadius: g,
  48. boxShadow: c,
  49. padding: l
  50. },
  51. [`${o}-title`]: {
  52. minWidth: a,
  53. marginBottom: v,
  54. color: u,
  55. fontWeight: s
  56. },
  57. [`${o}-inner-content`]: {
  58. color: t
  59. }
  60. })
  61. },
  62. // Arrow Style
  63. B(e, {
  64. colorBg: "var(--antd-arrow-background-color)"
  65. }),
  66. // Pure Render
  67. {
  68. [`${o}-pure`]: {
  69. position: "relative",
  70. maxWidth: "none",
  71. [`${o}-content`]: {
  72. display: "inline-block"
  73. }
  74. }
  75. }
  76. ];
  77. }, G = (e) => {
  78. const {
  79. componentCls: o
  80. } = e;
  81. return {
  82. [o]: k.map((r) => {
  83. const t = e[`${r}-6`];
  84. return {
  85. [`&${o}-${r}`]: {
  86. "--antd-arrow-background-color": t,
  87. [`${o}-inner`]: {
  88. backgroundColor: t
  89. },
  90. [`${o}-arrow`]: {
  91. background: "transparent"
  92. }
  93. }
  94. };
  95. })
  96. };
  97. }, V = (e) => {
  98. const {
  99. componentCls: o,
  100. lineWidth: r,
  101. lineType: t,
  102. colorSplit: a,
  103. paddingSM: s,
  104. controlHeight: l,
  105. fontSize: c,
  106. lineHeight: u,
  107. padding: g
  108. } = e, p = l - Math.round(c * u), v = p / 2, n = p / 2 - r, i = g;
  109. return {
  110. [o]: {
  111. [`${o}-inner`]: {
  112. padding: 0
  113. },
  114. [`${o}-title`]: {
  115. margin: 0,
  116. padding: `${v}px ${i}px ${n}px`,
  117. borderBottom: `${r}px ${t} ${a}`
  118. },
  119. [`${o}-inner-content`]: {
  120. padding: `${s}px ${i}px`
  121. }
  122. }
  123. };
  124. }, X = P("Popover", (e) => {
  125. const {
  126. colorBgElevated: o,
  127. colorText: r,
  128. wireframe: t
  129. } = e, a = S(e, {
  130. popoverBg: o,
  131. popoverColor: r,
  132. popoverPadding: 12
  133. // Fixed Value
  134. });
  135. return [F(a), G(a), t && V(a), _(a, "zoom-big")];
  136. }, (e) => {
  137. let {
  138. zIndexPopupBase: o
  139. } = e;
  140. return {
  141. zIndexPopup: o + 30,
  142. width: 177
  143. };
  144. }), Z = () => d(d({}, j()), {
  145. content: $(),
  146. title: $()
  147. }), q = M({
  148. compatConfig: {
  149. MODE: 3
  150. },
  151. name: "APopover",
  152. inheritAttrs: !1,
  153. props: E(Z(), d(d({}, H()), {
  154. trigger: "hover",
  155. placement: "top",
  156. mouseEnterDelay: 0.1,
  157. mouseLeaveDelay: 0.1
  158. })),
  159. setup(e, o) {
  160. let {
  161. expose: r,
  162. slots: t,
  163. attrs: a
  164. } = o;
  165. const s = R();
  166. N(e.visible === void 0, "popover", "`visible` will be removed in next major version, please use `open` instead."), r({
  167. getPopupDomNode: () => {
  168. var n, i;
  169. return (i = (n = s.value) === null || n === void 0 ? void 0 : n.getPopupDomNode) === null || i === void 0 ? void 0 : i.call(n);
  170. }
  171. });
  172. const {
  173. prefixCls: l,
  174. configProvider: c
  175. } = z("popover", e), [u, g] = X(l), p = L(() => c.getPrefixCls()), v = () => {
  176. var n, i;
  177. const {
  178. title: m = C((n = t.title) === null || n === void 0 ? void 0 : n.call(t)),
  179. content: f = C((i = t.content) === null || i === void 0 ? void 0 : i.call(t))
  180. } = e, x = !!(Array.isArray(m) ? m.length : m), y = !!(Array.isArray(f) ? f.length : m);
  181. return !x && !y ? null : b(O, null, [x && b("div", {
  182. class: `${l.value}-title`
  183. }, [m]), b("div", {
  184. class: `${l.value}-inner-content`
  185. }, [f])]);
  186. };
  187. return () => {
  188. const n = A(e.overlayClassName, g.value);
  189. return u(b(D, h(h(h({}, W(e, ["title", "content"])), a), {}, {
  190. prefixCls: l.value,
  191. ref: s,
  192. overlayClassName: n,
  193. transitionName: I(p.value, "zoom-big", e.transitionName),
  194. "data-popover-inject": !0
  195. }), {
  196. title: v,
  197. default: t.default
  198. }));
  199. };
  200. }
  201. }), U = T(q);
  202. export {
  203. U as _
  204. };