index25.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650
  1. import { g as Ce, m as Te, d as r, r as ze, ag as A, t as ne, i as ie, u as $, ch as I, c as D, ci as X, _ as g, cj as H, o as oe, ck as s, cl as re, cm as y, am as Be, av as le, h as we, bk as Me, P as x, cn as Ae, co as Ie, aX as j, cp as q } from "./index2.js";
  2. import { defineComponent as m, computed as T, createVNode as i, isVNode as ae } from "vue";
  3. const De = (e) => {
  4. const {
  5. antCls: t,
  6. componentCls: a,
  7. cardHeadHeight: n,
  8. cardPaddingBase: o,
  9. cardHeadTabsMarginBottom: d
  10. } = e;
  11. return r(r({
  12. display: "flex",
  13. justifyContent: "center",
  14. flexDirection: "column",
  15. minHeight: n,
  16. marginBottom: -1,
  17. padding: `0 ${o}px`,
  18. color: e.colorTextHeading,
  19. fontWeight: e.fontWeightStrong,
  20. fontSize: e.fontSizeLG,
  21. background: "transparent",
  22. borderBottom: `${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`,
  23. borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`
  24. }, A()), {
  25. "&-wrapper": {
  26. width: "100%",
  27. display: "flex",
  28. alignItems: "center"
  29. },
  30. "&-title": r(r({
  31. display: "inline-block",
  32. flex: 1
  33. }, ne), {
  34. [`
  35. > ${a}-typography,
  36. > ${a}-typography-edit-content
  37. `]: {
  38. insetInlineStart: 0,
  39. marginTop: 0,
  40. marginBottom: 0
  41. }
  42. }),
  43. [`${t}-tabs-top`]: {
  44. clear: "both",
  45. marginBottom: d,
  46. color: e.colorText,
  47. fontWeight: "normal",
  48. fontSize: e.fontSize,
  49. "&-bar": {
  50. borderBottom: `${e.lineWidth}px ${e.lineType} ${e.colorBorderSecondary}`
  51. }
  52. }
  53. });
  54. }, He = (e) => {
  55. const {
  56. cardPaddingBase: t,
  57. colorBorderSecondary: a,
  58. cardShadow: n,
  59. lineWidth: o
  60. } = e;
  61. return {
  62. width: "33.33%",
  63. padding: t,
  64. border: 0,
  65. borderRadius: 0,
  66. boxShadow: `
  67. ${o}px 0 0 0 ${a},
  68. 0 ${o}px 0 0 ${a},
  69. ${o}px ${o}px 0 0 ${a},
  70. ${o}px 0 0 0 ${a} inset,
  71. 0 ${o}px 0 0 ${a} inset;
  72. `,
  73. transition: `all ${e.motionDurationMid}`,
  74. "&-hoverable:hover": {
  75. position: "relative",
  76. zIndex: 1,
  77. boxShadow: n
  78. }
  79. };
  80. }, Re = (e) => {
  81. const {
  82. componentCls: t,
  83. iconCls: a,
  84. cardActionsLiMargin: n,
  85. cardActionsIconSize: o,
  86. colorBorderSecondary: d
  87. } = e;
  88. return r(r({
  89. margin: 0,
  90. padding: 0,
  91. listStyle: "none",
  92. background: e.colorBgContainer,
  93. borderTop: `${e.lineWidth}px ${e.lineType} ${d}`,
  94. display: "flex",
  95. borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px `
  96. }, A()), {
  97. "& > li": {
  98. margin: n,
  99. color: e.colorTextDescription,
  100. textAlign: "center",
  101. "> span": {
  102. position: "relative",
  103. display: "block",
  104. minWidth: e.cardActionsIconSize * 2,
  105. fontSize: e.fontSize,
  106. lineHeight: e.lineHeight,
  107. cursor: "pointer",
  108. "&:hover": {
  109. color: e.colorPrimary,
  110. transition: `color ${e.motionDurationMid}`
  111. },
  112. [`a:not(${t}-btn), > ${a}`]: {
  113. display: "inline-block",
  114. width: "100%",
  115. color: e.colorTextDescription,
  116. lineHeight: `${e.fontSize * e.lineHeight}px`,
  117. transition: `color ${e.motionDurationMid}`,
  118. "&:hover": {
  119. color: e.colorPrimary
  120. }
  121. },
  122. [`> ${a}`]: {
  123. fontSize: o,
  124. lineHeight: `${o * e.lineHeight}px`
  125. }
  126. },
  127. "&:not(:last-child)": {
  128. borderInlineEnd: `${e.lineWidth}px ${e.lineType} ${d}`
  129. }
  130. }
  131. });
  132. }, Pe = (e) => r(r({
  133. margin: `-${e.marginXXS}px 0`,
  134. display: "flex"
  135. }, A()), {
  136. "&-avatar": {
  137. paddingInlineEnd: e.padding
  138. },
  139. "&-detail": {
  140. overflow: "hidden",
  141. flex: 1,
  142. "> div:not(:last-child)": {
  143. marginBottom: e.marginXS
  144. }
  145. },
  146. "&-title": r({
  147. color: e.colorTextHeading,
  148. fontWeight: e.fontWeightStrong,
  149. fontSize: e.fontSizeLG
  150. }, ne),
  151. "&-description": {
  152. color: e.colorTextDescription
  153. }
  154. }), Ge = (e) => {
  155. const {
  156. componentCls: t,
  157. cardPaddingBase: a,
  158. colorFillAlter: n
  159. } = e;
  160. return {
  161. [`${t}-head`]: {
  162. padding: `0 ${a}px`,
  163. background: n,
  164. "&-title": {
  165. fontSize: e.fontSize
  166. }
  167. },
  168. [`${t}-body`]: {
  169. padding: `${e.padding}px ${a}px`
  170. }
  171. };
  172. }, Le = (e) => {
  173. const {
  174. componentCls: t
  175. } = e;
  176. return {
  177. overflow: "hidden",
  178. [`${t}-body`]: {
  179. userSelect: "none"
  180. }
  181. };
  182. }, Ee = (e) => {
  183. const {
  184. componentCls: t,
  185. cardShadow: a,
  186. cardHeadPadding: n,
  187. colorBorderSecondary: o,
  188. boxShadow: d,
  189. cardPaddingBase: v
  190. } = e;
  191. return {
  192. [t]: r(r({}, ze(e)), {
  193. position: "relative",
  194. background: e.colorBgContainer,
  195. borderRadius: e.borderRadiusLG,
  196. [`&:not(${t}-bordered)`]: {
  197. boxShadow: d
  198. },
  199. [`${t}-head`]: De(e),
  200. [`${t}-extra`]: {
  201. // https://stackoverflow.com/a/22429853/3040605
  202. marginInlineStart: "auto",
  203. color: "",
  204. fontWeight: "normal",
  205. fontSize: e.fontSize
  206. },
  207. [`${t}-body`]: r({
  208. padding: v,
  209. borderRadius: ` 0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`
  210. }, A()),
  211. [`${t}-grid`]: He(e),
  212. [`${t}-cover`]: {
  213. "> *": {
  214. display: "block",
  215. width: "100%"
  216. },
  217. img: {
  218. borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`
  219. }
  220. },
  221. [`${t}-actions`]: Re(e),
  222. [`${t}-meta`]: Pe(e)
  223. }),
  224. [`${t}-bordered`]: {
  225. border: `${e.lineWidth}px ${e.lineType} ${o}`,
  226. [`${t}-cover`]: {
  227. marginTop: -1,
  228. marginInlineStart: -1,
  229. marginInlineEnd: -1
  230. }
  231. },
  232. [`${t}-hoverable`]: {
  233. cursor: "pointer",
  234. transition: `box-shadow ${e.motionDurationMid}, border-color ${e.motionDurationMid}`,
  235. "&:hover": {
  236. borderColor: "transparent",
  237. boxShadow: a
  238. }
  239. },
  240. [`${t}-contain-grid`]: {
  241. [`${t}-body`]: {
  242. display: "flex",
  243. flexWrap: "wrap"
  244. },
  245. [`&:not(${t}-loading) ${t}-body`]: {
  246. marginBlockStart: -e.lineWidth,
  247. marginInlineStart: -e.lineWidth,
  248. padding: 0
  249. }
  250. },
  251. [`${t}-contain-tabs`]: {
  252. [`> ${t}-head`]: {
  253. [`${t}-head-title, ${t}-extra`]: {
  254. paddingTop: n
  255. }
  256. }
  257. },
  258. [`${t}-type-inner`]: Ge(e),
  259. [`${t}-loading`]: Le(e),
  260. [`${t}-rtl`]: {
  261. direction: "rtl"
  262. }
  263. };
  264. }, We = (e) => {
  265. const {
  266. componentCls: t,
  267. cardPaddingSM: a,
  268. cardHeadHeightSM: n
  269. } = e;
  270. return {
  271. [`${t}-small`]: {
  272. [`> ${t}-head`]: {
  273. minHeight: n,
  274. padding: `0 ${a}px`,
  275. fontSize: e.fontSize,
  276. [`> ${t}-head-wrapper`]: {
  277. [`> ${t}-extra`]: {
  278. fontSize: e.fontSize
  279. }
  280. }
  281. },
  282. [`> ${t}-body`]: {
  283. padding: a
  284. }
  285. },
  286. [`${t}-small${t}-contain-tabs`]: {
  287. [`> ${t}-head`]: {
  288. [`${t}-head-title, ${t}-extra`]: {
  289. minHeight: n,
  290. paddingTop: 0,
  291. display: "flex",
  292. alignItems: "center"
  293. }
  294. }
  295. }
  296. };
  297. }, _e = Ce("Card", (e) => {
  298. const t = Te(e, {
  299. cardShadow: e.boxShadowCard,
  300. cardHeadHeight: e.fontSizeLG * e.lineHeightLG + e.padding * 2,
  301. cardHeadHeightSM: e.fontSize * e.lineHeight + e.paddingXS * 2,
  302. cardHeadPadding: e.padding,
  303. cardPaddingBase: e.paddingLG,
  304. cardHeadTabsMarginBottom: -e.padding - e.lineWidth,
  305. cardActionsLiMargin: `${e.paddingSM}px 0`,
  306. cardActionsIconSize: e.fontSize,
  307. cardPaddingSM: 12
  308. // Fixed padding.
  309. });
  310. return [
  311. // Style
  312. Ee(t),
  313. // Size
  314. We(t)
  315. ];
  316. }), Oe = () => r(r({}, H()), {
  317. size: String,
  318. block: Boolean
  319. }), de = m({
  320. compatConfig: {
  321. MODE: 3
  322. },
  323. name: "ASkeletonButton",
  324. props: ie(Oe(), {
  325. size: "default"
  326. }),
  327. setup(e) {
  328. const {
  329. prefixCls: t
  330. } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, {
  331. [`${t.value}-active`]: e.active,
  332. [`${t.value}-block`]: e.block
  333. }, n.value));
  334. return () => a(i("div", {
  335. class: o.value
  336. }, [i(X, g(g({}, e), {}, {
  337. prefixCls: `${t.value}-button`
  338. }), null)]));
  339. }
  340. }), se = m({
  341. compatConfig: {
  342. MODE: 3
  343. },
  344. name: "ASkeletonInput",
  345. props: r(r({}, oe(H(), ["shape"])), {
  346. size: String,
  347. block: Boolean
  348. }),
  349. setup(e) {
  350. const {
  351. prefixCls: t
  352. } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, {
  353. [`${t.value}-active`]: e.active,
  354. [`${t.value}-block`]: e.block
  355. }, n.value));
  356. return () => a(i("div", {
  357. class: o.value
  358. }, [i(X, g(g({}, e), {}, {
  359. prefixCls: `${t.value}-input`
  360. }), null)]));
  361. }
  362. }), je = "M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z", ce = m({
  363. compatConfig: {
  364. MODE: 3
  365. },
  366. name: "ASkeletonImage",
  367. props: oe(H(), ["size", "shape", "active"]),
  368. setup(e) {
  369. const {
  370. prefixCls: t
  371. } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, n.value));
  372. return () => a(i("div", {
  373. class: o.value
  374. }, [i("div", {
  375. class: `${t.value}-image`
  376. }, [i("svg", {
  377. viewBox: "0 0 1098 1024",
  378. xmlns: "http://www.w3.org/2000/svg",
  379. class: `${t.value}-image-svg`
  380. }, [i("path", {
  381. d: je,
  382. class: `${t.value}-image-path`
  383. }, null)])])]));
  384. }
  385. }), qe = () => r(r({}, H()), {
  386. shape: String
  387. }), ue = m({
  388. compatConfig: {
  389. MODE: 3
  390. },
  391. name: "ASkeletonAvatar",
  392. props: ie(qe(), {
  393. size: "default",
  394. shape: "circle"
  395. }),
  396. setup(e) {
  397. const {
  398. prefixCls: t
  399. } = $("skeleton", e), [a, n] = I(t), o = T(() => D(t.value, `${t.value}-element`, {
  400. [`${t.value}-active`]: e.active
  401. }, n.value));
  402. return () => a(i("div", {
  403. class: o.value
  404. }, [i(X, g(g({}, e), {}, {
  405. prefixCls: `${t.value}-avatar`
  406. }), null)]));
  407. }
  408. });
  409. s.Button = de;
  410. s.Avatar = ue;
  411. s.Input = se;
  412. s.Image = ce;
  413. s.Title = re;
  414. s.install = function(e) {
  415. return e.component(s.name, s), e.component(s.Button.name, de), e.component(s.Avatar.name, ue), e.component(s.Input.name, se), e.component(s.Image.name, ce), e.component(s.Title.name, re), e;
  416. };
  417. const {
  418. TabPane: Ke
  419. } = le, Ne = () => ({
  420. prefixCls: String,
  421. title: x.any,
  422. extra: x.any,
  423. bordered: {
  424. type: Boolean,
  425. default: !0
  426. },
  427. bodyStyle: {
  428. type: Object,
  429. default: void 0
  430. },
  431. headStyle: {
  432. type: Object,
  433. default: void 0
  434. },
  435. loading: {
  436. type: Boolean,
  437. default: !1
  438. },
  439. hoverable: {
  440. type: Boolean,
  441. default: !1
  442. },
  443. type: {
  444. type: String
  445. },
  446. size: {
  447. type: String
  448. },
  449. actions: x.any,
  450. tabList: {
  451. type: Array
  452. },
  453. tabBarExtraContent: x.any,
  454. activeTabKey: String,
  455. defaultActiveTabKey: String,
  456. cover: x.any,
  457. onTabChange: {
  458. type: Function
  459. }
  460. }), C = m({
  461. compatConfig: {
  462. MODE: 3
  463. },
  464. name: "ACard",
  465. inheritAttrs: !1,
  466. props: Ne(),
  467. slots: Object,
  468. setup(e, t) {
  469. let {
  470. slots: a,
  471. attrs: n
  472. } = t;
  473. const {
  474. prefixCls: o,
  475. direction: d,
  476. size: v
  477. } = $("card", e), [z, R] = _e(o), B = (p) => p.map((c, h) => ae(c) && !Ae(c) || !ae(c) ? i("li", {
  478. style: {
  479. width: `${100 / p.length}%`
  480. },
  481. key: `action-${h}`
  482. }, [i("span", null, [c])]) : null), w = (p) => {
  483. var u;
  484. (u = e.onTabChange) === null || u === void 0 || u.call(e, p);
  485. }, P = function() {
  486. let p = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], u;
  487. return p.forEach((c) => {
  488. c && Ie(c.type) && c.type.__ANT_CARD_GRID && (u = !0);
  489. }), u;
  490. };
  491. return () => {
  492. var p, u, c, h, G, L;
  493. const {
  494. headStyle: pe = {},
  495. bodyStyle: ge = {},
  496. loading: F,
  497. bordered: ve = !0,
  498. type: V,
  499. tabList: b,
  500. hoverable: $e,
  501. activeTabKey: U,
  502. defaultActiveTabKey: me,
  503. tabBarExtraContent: J = y((p = a.tabBarExtraContent) === null || p === void 0 ? void 0 : p.call(a)),
  504. title: E = y((u = a.title) === null || u === void 0 ? void 0 : u.call(a)),
  505. extra: W = y((c = a.extra) === null || c === void 0 ? void 0 : c.call(a)),
  506. actions: _ = y((h = a.actions) === null || h === void 0 ? void 0 : h.call(a)),
  507. cover: Q = y((G = a.cover) === null || G === void 0 ? void 0 : G.call(a))
  508. } = e, S = Be((L = a.default) === null || L === void 0 ? void 0 : L.call(a)), l = o.value, he = {
  509. [`${l}`]: !0,
  510. [R.value]: !0,
  511. [`${l}-loading`]: F,
  512. [`${l}-bordered`]: ve,
  513. [`${l}-hoverable`]: !!$e,
  514. [`${l}-contain-grid`]: P(S),
  515. [`${l}-contain-tabs`]: b && b.length,
  516. [`${l}-${v.value}`]: v.value,
  517. [`${l}-type-${V}`]: !!V,
  518. [`${l}-rtl`]: d.value === "rtl"
  519. }, be = i(s, {
  520. loading: !0,
  521. active: !0,
  522. paragraph: {
  523. rows: 4
  524. },
  525. title: !1
  526. }, {
  527. default: () => [S]
  528. }), Y = U !== void 0, Se = {
  529. size: "large",
  530. [Y ? "activeKey" : "defaultActiveKey"]: Y ? U : me,
  531. onChange: w,
  532. class: `${l}-head-tabs`
  533. };
  534. let Z;
  535. const k = b && b.length ? i(le, Se, {
  536. default: () => [b.map((f) => {
  537. const {
  538. tab: ee,
  539. slots: M
  540. } = f, te = M == null ? void 0 : M.tab;
  541. we(!M, "Card", "tabList slots is deprecated, Please use `customTab` instead.");
  542. let O = ee !== void 0 ? ee : a[te] ? a[te](f) : null;
  543. return O = Me(a, "customTab", f, () => [O]), i(Ke, {
  544. tab: O,
  545. key: f.key,
  546. disabled: f.disabled
  547. }, null);
  548. })],
  549. rightExtra: J ? () => J : null
  550. }) : null;
  551. (E || W || k) && (Z = i("div", {
  552. class: `${l}-head`,
  553. style: pe
  554. }, [i("div", {
  555. class: `${l}-head-wrapper`
  556. }, [E && i("div", {
  557. class: `${l}-head-title`
  558. }, [E]), W && i("div", {
  559. class: `${l}-extra`
  560. }, [W])]), k]));
  561. const fe = Q ? i("div", {
  562. class: `${l}-cover`
  563. }, [Q]) : null, ye = i("div", {
  564. class: `${l}-body`,
  565. style: ge
  566. }, [F ? be : S]), xe = _ && _.length ? i("ul", {
  567. class: `${l}-actions`
  568. }, [B(_)]) : null;
  569. return z(i("div", g(g({
  570. ref: "cardContainerRef"
  571. }, n), {}, {
  572. class: [he, n.class]
  573. }), [Z, fe, S && S.length ? ye : null, xe]));
  574. };
  575. }
  576. }), Xe = () => ({
  577. prefixCls: String,
  578. title: q(),
  579. description: q(),
  580. avatar: q()
  581. }), K = m({
  582. compatConfig: {
  583. MODE: 3
  584. },
  585. name: "ACardMeta",
  586. props: Xe(),
  587. slots: Object,
  588. setup(e, t) {
  589. let {
  590. slots: a
  591. } = t;
  592. const {
  593. prefixCls: n
  594. } = $("card", e);
  595. return () => {
  596. const o = {
  597. [`${n.value}-meta`]: !0
  598. }, d = j(a, e, "avatar"), v = j(a, e, "title"), z = j(a, e, "description"), R = d ? i("div", {
  599. class: `${n.value}-meta-avatar`
  600. }, [d]) : null, B = v ? i("div", {
  601. class: `${n.value}-meta-title`
  602. }, [v]) : null, w = z ? i("div", {
  603. class: `${n.value}-meta-description`
  604. }, [z]) : null, P = B || w ? i("div", {
  605. class: `${n.value}-meta-detail`
  606. }, [B, w]) : null;
  607. return i("div", {
  608. class: o
  609. }, [R, P]);
  610. };
  611. }
  612. }), Fe = () => ({
  613. prefixCls: String,
  614. hoverable: {
  615. type: Boolean,
  616. default: !0
  617. }
  618. }), N = m({
  619. compatConfig: {
  620. MODE: 3
  621. },
  622. name: "ACardGrid",
  623. __ANT_CARD_GRID: !0,
  624. props: Fe(),
  625. setup(e, t) {
  626. let {
  627. slots: a
  628. } = t;
  629. const {
  630. prefixCls: n
  631. } = $("card", e), o = T(() => ({
  632. [`${n.value}-grid`]: !0,
  633. [`${n.value}-grid-hoverable`]: e.hoverable
  634. }));
  635. return () => {
  636. var d;
  637. return i("div", {
  638. class: o.value
  639. }, [(d = a.default) === null || d === void 0 ? void 0 : d.call(a)]);
  640. };
  641. }
  642. });
  643. C.Meta = K;
  644. C.Grid = N;
  645. C.install = function(e) {
  646. return e.component(C.name, C), e.component(K.name, K), e.component(N.name, N), e;
  647. };
  648. export {
  649. C
  650. };