index10.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. import { Q as w, N as F, e as H, f as N, O as V, M as K, h as D, ae as E, d as P, _ as $, i as A, W as Y, g as Q, m as q, r as U, a3 as J, u as Z, af as ee, ac as te, ag as re, ad as oe, b as se } from "./index2.js";
  2. import { defineComponent as I, computed as u, createVNode as g, Fragment as B, ref as z, onUpdated as ne } from "vue";
  3. import { u as ie } from "./useRefs.js";
  4. const le = ["normal", "exception", "active", "success"], W = () => ({
  5. prefixCls: String,
  6. type: w(),
  7. percent: Number,
  8. format: K(),
  9. status: w(),
  10. showInfo: V(),
  11. strokeWidth: Number,
  12. strokeLinecap: w(),
  13. strokeColor: N(),
  14. trailColor: String,
  15. /** @deprecated Use `size` instead */
  16. width: Number,
  17. success: H(),
  18. gapDegree: Number,
  19. gapPosition: w(),
  20. size: F([String, Number, Array]),
  21. steps: Number,
  22. /** @deprecated Use `success` instead */
  23. successPercent: Number,
  24. title: String,
  25. progressStatus: w()
  26. });
  27. function x(e) {
  28. return !e || e < 0 ? 0 : e > 100 ? 100 : e;
  29. }
  30. function _(e) {
  31. let {
  32. success: t,
  33. successPercent: o
  34. } = e, r = o;
  35. return t && "progress" in t && (D(!1, "Progress", "`success.progress` is deprecated. Please use `success.percent` instead."), r = t.progress), t && "percent" in t && (r = t.percent), r;
  36. }
  37. function ae(e) {
  38. let {
  39. percent: t,
  40. success: o,
  41. successPercent: r
  42. } = e;
  43. const s = x(_({
  44. success: o,
  45. successPercent: r
  46. }));
  47. return [s, x(x(t) - s)];
  48. }
  49. function ce(e) {
  50. let {
  51. success: t = {},
  52. strokeColor: o
  53. } = e;
  54. const {
  55. strokeColor: r
  56. } = t;
  57. return [r || E.green, o || null];
  58. }
  59. const j = (e, t, o) => {
  60. var r, s, p, i;
  61. let n = -1, l = -1;
  62. if (t === "step") {
  63. const v = o.steps, d = o.strokeWidth;
  64. typeof e == "string" || typeof e == "undefined" ? (n = e === "small" ? 2 : 14, l = d != null ? d : 8) : typeof e == "number" ? [n, l] = [e, e] : [n = 14, l = 8] = e, n *= v;
  65. } else if (t === "line") {
  66. const v = o == null ? void 0 : o.strokeWidth;
  67. typeof e == "string" || typeof e == "undefined" ? l = v || (e === "small" ? 6 : 8) : typeof e == "number" ? [n, l] = [e, e] : [n = -1, l = 8] = e;
  68. } else (t === "circle" || t === "dashboard") && (typeof e == "string" || typeof e == "undefined" ? [n, l] = e === "small" ? [60, 60] : [120, 120] : typeof e == "number" ? [n, l] = [e, e] : (process.env.NODE_ENV !== "production" && D(!1, "Progress", 'Type "circle" and "dashboard" do not accept array as `size`, please use number or preset size instead.'), n = (s = (r = e[0]) !== null && r !== void 0 ? r : e[1]) !== null && s !== void 0 ? s : 120, l = (i = (p = e[0]) !== null && p !== void 0 ? p : e[1]) !== null && i !== void 0 ? i : 120));
  69. return {
  70. width: n,
  71. height: l
  72. };
  73. };
  74. var ue = function(e, t) {
  75. var o = {};
  76. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
  77. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var s = 0, r = Object.getOwnPropertySymbols(e); s < r.length; s++)
  78. t.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[s]) && (o[r[s]] = e[r[s]]);
  79. return o;
  80. };
  81. const de = () => P(P({}, W()), {
  82. strokeColor: N(),
  83. direction: w()
  84. }), ge = (e) => {
  85. let t = [];
  86. return Object.keys(e).forEach((o) => {
  87. const r = parseFloat(o.replace(/%/g, ""));
  88. isNaN(r) || t.push({
  89. key: r,
  90. value: e[o]
  91. });
  92. }), t = t.sort((o, r) => o.key - r.key), t.map((o) => {
  93. let {
  94. key: r,
  95. value: s
  96. } = o;
  97. return `${s} ${r}%`;
  98. }).join(", ");
  99. }, fe = (e, t) => {
  100. const {
  101. from: o = E.blue,
  102. to: r = E.blue,
  103. direction: s = t === "rtl" ? "to left" : "to right"
  104. } = e, p = ue(e, ["from", "to", "direction"]);
  105. if (Object.keys(p).length !== 0) {
  106. const i = ge(p);
  107. return {
  108. backgroundImage: `linear-gradient(${s}, ${i})`
  109. };
  110. }
  111. return {
  112. backgroundImage: `linear-gradient(${s}, ${o}, ${r})`
  113. };
  114. }, pe = I({
  115. compatConfig: {
  116. MODE: 3
  117. },
  118. name: "ProgressLine",
  119. inheritAttrs: !1,
  120. props: de(),
  121. setup(e, t) {
  122. let {
  123. slots: o,
  124. attrs: r
  125. } = t;
  126. const s = u(() => {
  127. const {
  128. strokeColor: a,
  129. direction: f
  130. } = e;
  131. return a && typeof a != "string" ? fe(a, f) : {
  132. backgroundColor: a
  133. };
  134. }), p = u(() => e.strokeLinecap === "square" || e.strokeLinecap === "butt" ? 0 : void 0), i = u(() => e.trailColor ? {
  135. backgroundColor: e.trailColor
  136. } : void 0), n = u(() => {
  137. var a;
  138. return (a = e.size) !== null && a !== void 0 ? a : [-1, e.strokeWidth || (e.size === "small" ? 6 : 8)];
  139. }), l = u(() => j(n.value, "line", {
  140. strokeWidth: e.strokeWidth
  141. }));
  142. process.env.NODE_ENV !== "production" && D("strokeWidth" in e, "Progress", "`strokeWidth` is deprecated. Please use `size` instead.");
  143. const v = u(() => {
  144. const {
  145. percent: a
  146. } = e;
  147. return P({
  148. width: `${x(a)}%`,
  149. height: `${l.value.height}px`,
  150. borderRadius: p.value
  151. }, s.value);
  152. }), d = u(() => _(e)), C = u(() => {
  153. const {
  154. success: a
  155. } = e;
  156. return {
  157. width: `${x(d.value)}%`,
  158. height: `${l.value.height}px`,
  159. borderRadius: p.value,
  160. backgroundColor: a == null ? void 0 : a.strokeColor
  161. };
  162. }), h = {
  163. width: l.value.width < 0 ? "100%" : l.value.width,
  164. height: `${l.value.height}px`
  165. };
  166. return () => {
  167. var a;
  168. return g(B, null, [g("div", $($({}, r), {}, {
  169. class: [`${e.prefixCls}-outer`, r.class],
  170. style: [r.style, h]
  171. }), [g("div", {
  172. class: `${e.prefixCls}-inner`,
  173. style: i.value
  174. }, [g("div", {
  175. class: `${e.prefixCls}-bg`,
  176. style: v.value
  177. }, null), d.value !== void 0 ? g("div", {
  178. class: `${e.prefixCls}-success-bg`,
  179. style: C.value
  180. }, null) : null])]), (a = o.default) === null || a === void 0 ? void 0 : a.call(o)]);
  181. };
  182. }
  183. }), he = {
  184. percent: 0,
  185. prefixCls: "vc-progress",
  186. strokeColor: "#2db7f5",
  187. strokeLinecap: "round",
  188. strokeWidth: 1,
  189. trailColor: "#D9D9D9",
  190. trailWidth: 1
  191. }, ve = (e) => {
  192. const t = z(null);
  193. return ne(() => {
  194. const o = Date.now();
  195. let r = !1;
  196. e.value.forEach((s) => {
  197. const p = (s == null ? void 0 : s.$el) || s;
  198. if (!p)
  199. return;
  200. r = !0;
  201. const i = p.style;
  202. i.transitionDuration = ".3s, .3s, .3s, .06s", t.value && o - t.value < 100 && (i.transitionDuration = "0s, 0s");
  203. }), r && (t.value = Date.now());
  204. }), e;
  205. }, me = {
  206. gapDegree: Number,
  207. gapPosition: {
  208. type: String
  209. },
  210. percent: {
  211. type: [Array, Number]
  212. },
  213. prefixCls: String,
  214. strokeColor: {
  215. type: [Object, String, Array]
  216. },
  217. strokeLinecap: {
  218. type: String
  219. },
  220. strokeWidth: Number,
  221. trailColor: String,
  222. trailWidth: Number,
  223. transition: String
  224. };
  225. var ye = function(e, t) {
  226. var o = {};
  227. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
  228. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var s = 0, r = Object.getOwnPropertySymbols(e); s < r.length; s++)
  229. t.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[s]) && (o[r[s]] = e[r[s]]);
  230. return o;
  231. };
  232. let R = 0;
  233. function M(e) {
  234. return +e.replace("%", "");
  235. }
  236. function T(e) {
  237. return Array.isArray(e) ? e : [e];
  238. }
  239. function X(e, t, o, r) {
  240. let s = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0, p = arguments.length > 5 ? arguments[5] : void 0;
  241. const i = 50 - r / 2;
  242. let n = 0, l = -i, v = 0, d = -2 * i;
  243. switch (p) {
  244. case "left":
  245. n = -i, l = 0, v = 2 * i, d = 0;
  246. break;
  247. case "right":
  248. n = i, l = 0, v = -2 * i, d = 0;
  249. break;
  250. case "bottom":
  251. l = i, d = 2 * i;
  252. break;
  253. }
  254. const C = `M 50,50 m ${n},${l}
  255. a ${i},${i} 0 1 1 ${v},${-d}
  256. a ${i},${i} 0 1 1 ${-v},${d}`, h = Math.PI * 2 * i, a = {
  257. stroke: o,
  258. strokeDasharray: `${t / 100 * (h - s)}px ${h}px`,
  259. strokeDashoffset: `-${s / 2 + e / 100 * (h - s)}px`,
  260. transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"
  261. // eslint-disable-line
  262. };
  263. return {
  264. pathString: C,
  265. pathStyle: a
  266. };
  267. }
  268. const Ce = I({
  269. compatConfig: {
  270. MODE: 3
  271. },
  272. name: "VCCircle",
  273. props: A(me, he),
  274. setup(e) {
  275. R += 1;
  276. const t = z(R), o = u(() => T(e.percent)), r = u(() => T(e.strokeColor)), [s, p] = ie();
  277. ve(p);
  278. const i = () => {
  279. const {
  280. prefixCls: n,
  281. strokeWidth: l,
  282. strokeLinecap: v,
  283. gapDegree: d,
  284. gapPosition: C
  285. } = e;
  286. let h = 0;
  287. return o.value.map((a, f) => {
  288. const c = r.value[f] || r.value[r.value.length - 1], b = Object.prototype.toString.call(c) === "[object Object]" ? `url(#${n}-gradient-${t.value})` : "", {
  289. pathString: y,
  290. pathStyle: S
  291. } = X(h, a, c, l, d, C);
  292. h += a;
  293. const k = {
  294. key: f,
  295. d: y,
  296. stroke: b,
  297. "stroke-linecap": v,
  298. "stroke-width": l,
  299. opacity: a === 0 ? 0 : 1,
  300. "fill-opacity": "0",
  301. class: `${n}-circle-path`,
  302. style: S
  303. };
  304. return g("path", $({
  305. ref: s(f)
  306. }, k), null);
  307. });
  308. };
  309. return () => {
  310. const {
  311. prefixCls: n,
  312. strokeWidth: l,
  313. trailWidth: v,
  314. gapDegree: d,
  315. gapPosition: C,
  316. trailColor: h,
  317. strokeLinecap: a,
  318. strokeColor: f
  319. } = e, c = ye(e, ["prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "strokeColor"]), {
  320. pathString: b,
  321. pathStyle: y
  322. } = X(0, 100, h, l, d, C);
  323. delete c.percent;
  324. const S = r.value.find((m) => Object.prototype.toString.call(m) === "[object Object]"), k = {
  325. d: b,
  326. stroke: h,
  327. "stroke-linecap": a,
  328. "stroke-width": v || l,
  329. "fill-opacity": "0",
  330. class: `${n}-circle-trail`,
  331. style: y
  332. };
  333. return g("svg", $({
  334. class: `${n}-circle`,
  335. viewBox: "0 0 100 100"
  336. }, c), [S && g("defs", null, [g("linearGradient", {
  337. id: `${n}-gradient-${t.value}`,
  338. x1: "100%",
  339. y1: "0%",
  340. x2: "0%",
  341. y2: "0%"
  342. }, [Object.keys(S).sort((m, O) => M(m) - M(O)).map((m, O) => g("stop", {
  343. key: O,
  344. offset: m,
  345. "stop-color": S[m]
  346. }, null))])]), g("path", k, null), i().reverse()]);
  347. };
  348. }
  349. }), be = () => P(P({}, W()), {
  350. strokeColor: N()
  351. }), $e = 3, Se = (e) => $e / e * 100, ke = I({
  352. compatConfig: {
  353. MODE: 3
  354. },
  355. name: "ProgressCircle",
  356. inheritAttrs: !1,
  357. props: A(be(), {
  358. trailColor: null
  359. }),
  360. setup(e, t) {
  361. let {
  362. slots: o,
  363. attrs: r
  364. } = t;
  365. const s = u(() => {
  366. var c;
  367. return (c = e.width) !== null && c !== void 0 ? c : 120;
  368. }), p = u(() => {
  369. var c;
  370. return (c = e.size) !== null && c !== void 0 ? c : [s.value, s.value];
  371. }), i = u(() => j(p.value, "circle")), n = u(() => {
  372. if (e.gapDegree || e.gapDegree === 0)
  373. return e.gapDegree;
  374. if (e.type === "dashboard")
  375. return 75;
  376. }), l = u(() => ({
  377. width: `${i.value.width}px`,
  378. height: `${i.value.height}px`,
  379. fontSize: `${i.value.width * 0.15 + 6}px`
  380. })), v = u(() => {
  381. var c;
  382. return (c = e.strokeWidth) !== null && c !== void 0 ? c : Math.max(Se(i.value.width), 6);
  383. }), d = u(() => e.gapPosition || e.type === "dashboard" && "bottom" || void 0), C = u(() => ae(e)), h = u(() => Object.prototype.toString.call(e.strokeColor) === "[object Object]"), a = u(() => ce({
  384. success: e.success,
  385. strokeColor: e.strokeColor
  386. })), f = u(() => ({
  387. [`${e.prefixCls}-inner`]: !0,
  388. [`${e.prefixCls}-circle-gradient`]: h.value
  389. }));
  390. return () => {
  391. var c;
  392. const b = g(Ce, {
  393. percent: C.value,
  394. strokeWidth: v.value,
  395. trailWidth: v.value,
  396. strokeColor: a.value,
  397. strokeLinecap: e.strokeLinecap,
  398. trailColor: e.trailColor,
  399. prefixCls: e.prefixCls,
  400. gapDegree: n.value,
  401. gapPosition: d.value
  402. }, null);
  403. return g("div", $($({}, r), {}, {
  404. class: [f.value, r.class],
  405. style: [r.style, l.value]
  406. }), [i.value.width <= 20 ? g(Y, null, {
  407. default: () => [g("span", null, [b])],
  408. title: o.default
  409. }) : g(B, null, [b, (c = o.default) === null || c === void 0 ? void 0 : c.call(o)])]);
  410. };
  411. }
  412. }), Pe = () => P(P({}, W()), {
  413. steps: Number,
  414. strokeColor: F(),
  415. trailColor: String
  416. }), xe = I({
  417. compatConfig: {
  418. MODE: 3
  419. },
  420. name: "Steps",
  421. props: Pe(),
  422. setup(e, t) {
  423. let {
  424. slots: o
  425. } = t;
  426. const r = u(() => Math.round(e.steps * ((e.percent || 0) / 100))), s = u(() => {
  427. var n;
  428. return (n = e.size) !== null && n !== void 0 ? n : [e.size === "small" ? 2 : 14, e.strokeWidth || 8];
  429. }), p = u(() => j(s.value, "step", {
  430. steps: e.steps,
  431. strokeWidth: e.strokeWidth || 8
  432. })), i = u(() => {
  433. const {
  434. steps: n,
  435. strokeColor: l,
  436. trailColor: v,
  437. prefixCls: d
  438. } = e, C = [];
  439. for (let h = 0; h < n; h += 1) {
  440. const a = Array.isArray(l) ? l[h] : l, f = {
  441. [`${d}-steps-item`]: !0,
  442. [`${d}-steps-item-active`]: h <= r.value - 1
  443. };
  444. C.push(g("div", {
  445. key: h,
  446. class: f,
  447. style: {
  448. backgroundColor: h <= r.value - 1 ? a : v,
  449. width: `${p.value.width / n}px`,
  450. height: `${p.value.height}px`
  451. }
  452. }, null));
  453. }
  454. return C;
  455. });
  456. return () => {
  457. var n;
  458. return g("div", {
  459. class: `${e.prefixCls}-steps-outer`
  460. }, [i.value, (n = o.default) === null || n === void 0 ? void 0 : n.call(o)]);
  461. };
  462. }
  463. }), we = new J("antProgressActive", {
  464. "0%": {
  465. transform: "translateX(-100%) scaleX(0)",
  466. opacity: 0.1
  467. },
  468. "20%": {
  469. transform: "translateX(-100%) scaleX(0)",
  470. opacity: 0.5
  471. },
  472. to: {
  473. transform: "translateX(0) scaleX(1)",
  474. opacity: 0
  475. }
  476. }), Oe = (e) => {
  477. const {
  478. componentCls: t,
  479. iconCls: o
  480. } = e;
  481. return {
  482. [t]: P(P({}, U(e)), {
  483. display: "inline-block",
  484. "&-rtl": {
  485. direction: "rtl"
  486. },
  487. "&-line": {
  488. position: "relative",
  489. width: "100%",
  490. fontSize: e.fontSize,
  491. marginInlineEnd: e.marginXS,
  492. marginBottom: e.marginXS
  493. },
  494. [`${t}-outer`]: {
  495. display: "inline-block",
  496. width: "100%"
  497. },
  498. [`&${t}-show-info`]: {
  499. [`${t}-outer`]: {
  500. marginInlineEnd: `calc(-2em - ${e.marginXS}px)`,
  501. paddingInlineEnd: `calc(2em + ${e.paddingXS}px)`
  502. }
  503. },
  504. [`${t}-inner`]: {
  505. position: "relative",
  506. display: "inline-block",
  507. width: "100%",
  508. overflow: "hidden",
  509. verticalAlign: "middle",
  510. backgroundColor: e.progressRemainingColor,
  511. borderRadius: e.progressLineRadius
  512. },
  513. [`${t}-inner:not(${t}-circle-gradient)`]: {
  514. [`${t}-circle-path`]: {
  515. stroke: e.colorInfo
  516. }
  517. },
  518. [`${t}-success-bg, ${t}-bg`]: {
  519. position: "relative",
  520. backgroundColor: e.colorInfo,
  521. borderRadius: e.progressLineRadius,
  522. transition: `all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`
  523. },
  524. [`${t}-success-bg`]: {
  525. position: "absolute",
  526. insetBlockStart: 0,
  527. insetInlineStart: 0,
  528. backgroundColor: e.colorSuccess
  529. },
  530. [`${t}-text`]: {
  531. display: "inline-block",
  532. width: "2em",
  533. marginInlineStart: e.marginXS,
  534. color: e.progressInfoTextColor,
  535. lineHeight: 1,
  536. whiteSpace: "nowrap",
  537. textAlign: "start",
  538. verticalAlign: "middle",
  539. wordBreak: "normal",
  540. [o]: {
  541. fontSize: e.fontSize
  542. }
  543. },
  544. [`&${t}-status-active`]: {
  545. [`${t}-bg::before`]: {
  546. position: "absolute",
  547. inset: 0,
  548. backgroundColor: e.colorBgContainer,
  549. borderRadius: e.progressLineRadius,
  550. opacity: 0,
  551. animationName: we,
  552. animationDuration: e.progressActiveMotionDuration,
  553. animationTimingFunction: e.motionEaseOutQuint,
  554. animationIterationCount: "infinite",
  555. content: '""'
  556. }
  557. },
  558. [`&${t}-status-exception`]: {
  559. [`${t}-bg`]: {
  560. backgroundColor: e.colorError
  561. },
  562. [`${t}-text`]: {
  563. color: e.colorError
  564. }
  565. },
  566. [`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]: {
  567. [`${t}-circle-path`]: {
  568. stroke: e.colorError
  569. }
  570. },
  571. [`&${t}-status-success`]: {
  572. [`${t}-bg`]: {
  573. backgroundColor: e.colorSuccess
  574. },
  575. [`${t}-text`]: {
  576. color: e.colorSuccess
  577. }
  578. },
  579. [`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]: {
  580. [`${t}-circle-path`]: {
  581. stroke: e.colorSuccess
  582. }
  583. }
  584. })
  585. };
  586. }, De = (e) => {
  587. const {
  588. componentCls: t,
  589. iconCls: o
  590. } = e;
  591. return {
  592. [t]: {
  593. [`${t}-circle-trail`]: {
  594. stroke: e.progressRemainingColor
  595. },
  596. [`&${t}-circle ${t}-inner`]: {
  597. position: "relative",
  598. lineHeight: 1,
  599. backgroundColor: "transparent"
  600. },
  601. [`&${t}-circle ${t}-text`]: {
  602. position: "absolute",
  603. insetBlockStart: "50%",
  604. insetInlineStart: 0,
  605. width: "100%",
  606. margin: 0,
  607. padding: 0,
  608. color: e.colorText,
  609. lineHeight: 1,
  610. whiteSpace: "normal",
  611. textAlign: "center",
  612. transform: "translateY(-50%)",
  613. [o]: {
  614. fontSize: `${e.fontSize / e.fontSizeSM}em`
  615. }
  616. },
  617. [`${t}-circle&-status-exception`]: {
  618. [`${t}-text`]: {
  619. color: e.colorError
  620. }
  621. },
  622. [`${t}-circle&-status-success`]: {
  623. [`${t}-text`]: {
  624. color: e.colorSuccess
  625. }
  626. }
  627. },
  628. [`${t}-inline-circle`]: {
  629. lineHeight: 1,
  630. [`${t}-inner`]: {
  631. verticalAlign: "bottom"
  632. }
  633. }
  634. };
  635. }, Ie = (e) => {
  636. const {
  637. componentCls: t
  638. } = e;
  639. return {
  640. [t]: {
  641. [`${t}-steps`]: {
  642. display: "inline-block",
  643. "&-outer": {
  644. display: "flex",
  645. flexDirection: "row",
  646. alignItems: "center"
  647. },
  648. "&-item": {
  649. flexShrink: 0,
  650. minWidth: e.progressStepMinWidth,
  651. marginInlineEnd: e.progressStepMarginInlineEnd,
  652. backgroundColor: e.progressRemainingColor,
  653. transition: `all ${e.motionDurationSlow}`,
  654. "&-active": {
  655. backgroundColor: e.colorInfo
  656. }
  657. }
  658. }
  659. }
  660. };
  661. }, _e = (e) => {
  662. const {
  663. componentCls: t,
  664. iconCls: o
  665. } = e;
  666. return {
  667. [t]: {
  668. [`${t}-small&-line, ${t}-small&-line ${t}-text ${o}`]: {
  669. fontSize: e.fontSizeSM
  670. }
  671. }
  672. };
  673. }, We = Q("Progress", (e) => {
  674. const t = e.marginXXS / 2, o = q(e, {
  675. progressLineRadius: 100,
  676. progressInfoTextColor: e.colorText,
  677. progressDefaultColor: e.colorInfo,
  678. progressRemainingColor: e.colorFillSecondary,
  679. progressStepMarginInlineEnd: t,
  680. progressStepMinWidth: t,
  681. progressActiveMotionDuration: "2.4s"
  682. });
  683. return [Oe(o), De(o), Ie(o), _e(o)];
  684. });
  685. var je = function(e, t) {
  686. var o = {};
  687. for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (o[r] = e[r]);
  688. if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var s = 0, r = Object.getOwnPropertySymbols(e); s < r.length; s++)
  689. t.indexOf(r[s]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[s]) && (o[r[s]] = e[r[s]]);
  690. return o;
  691. };
  692. const Ee = I({
  693. compatConfig: {
  694. MODE: 3
  695. },
  696. name: "AProgress",
  697. inheritAttrs: !1,
  698. props: A(W(), {
  699. type: "line",
  700. percent: 0,
  701. showInfo: !0,
  702. // null for different theme definition
  703. trailColor: null,
  704. size: "default",
  705. strokeLinecap: "round"
  706. }),
  707. slots: Object,
  708. setup(e, t) {
  709. let {
  710. slots: o,
  711. attrs: r
  712. } = t;
  713. const {
  714. prefixCls: s,
  715. direction: p
  716. } = Z("progress", e), [i, n] = We(s);
  717. process.env.NODE_ENV !== "production" && (D("successPercent" in e, "Progress", "`successPercent` is deprecated. Please use `success.percent` instead."), D("width" in e, "Progress", "`width` is deprecated. Please use `size` instead."));
  718. const l = u(() => Array.isArray(e.strokeColor) ? e.strokeColor[0] : e.strokeColor), v = u(() => {
  719. const {
  720. percent: f = 0
  721. } = e, c = _(e);
  722. return parseInt(c !== void 0 ? c.toString() : f.toString(), 10);
  723. }), d = u(() => {
  724. const {
  725. status: f
  726. } = e;
  727. return !le.includes(f) && v.value >= 100 ? "success" : f || "normal";
  728. }), C = u(() => {
  729. const {
  730. type: f,
  731. showInfo: c,
  732. size: b
  733. } = e, y = s.value;
  734. return {
  735. [y]: !0,
  736. [`${y}-inline-circle`]: f === "circle" && j(b, "circle").width <= 20,
  737. [`${y}-${f === "dashboard" && "circle" || f}`]: !0,
  738. [`${y}-status-${d.value}`]: !0,
  739. [`${y}-show-info`]: c,
  740. [`${y}-${b}`]: b,
  741. [`${y}-rtl`]: p.value === "rtl",
  742. [n.value]: !0
  743. };
  744. }), h = u(() => typeof e.strokeColor == "string" || Array.isArray(e.strokeColor) ? e.strokeColor : void 0), a = () => {
  745. const {
  746. showInfo: f,
  747. format: c,
  748. type: b,
  749. percent: y,
  750. title: S
  751. } = e, k = _(e);
  752. if (!f) return null;
  753. let m;
  754. const O = c || (o == null ? void 0 : o.format) || ((G) => `${G}%`), L = b === "line";
  755. return c || o != null && o.format || d.value !== "exception" && d.value !== "success" ? m = O(x(y), x(k)) : d.value === "exception" ? m = L ? g(ee, null, null) : g(te, null, null) : d.value === "success" && (m = L ? g(re, null, null) : g(oe, null, null)), g("span", {
  756. class: `${s.value}-text`,
  757. title: S === void 0 && typeof m == "string" ? m : void 0
  758. }, [m]);
  759. };
  760. return () => {
  761. const {
  762. type: f,
  763. steps: c,
  764. title: b
  765. } = e, {
  766. class: y
  767. } = r, S = je(r, ["class"]), k = a();
  768. let m;
  769. return f === "line" ? m = c ? g(xe, $($({}, e), {}, {
  770. strokeColor: h.value,
  771. prefixCls: s.value,
  772. steps: c
  773. }), {
  774. default: () => [k]
  775. }) : g(pe, $($({}, e), {}, {
  776. strokeColor: l.value,
  777. prefixCls: s.value,
  778. direction: p.value
  779. }), {
  780. default: () => [k]
  781. }) : (f === "circle" || f === "dashboard") && (m = g(ke, $($({}, e), {}, {
  782. prefixCls: s.value,
  783. strokeColor: l.value,
  784. progressStatus: d.value
  785. }), {
  786. default: () => [k]
  787. })), i(g("div", $($({
  788. role: "progressbar"
  789. }, S), {}, {
  790. class: [C.value, y],
  791. title: b
  792. }), [m]));
  793. };
  794. }
  795. }), Re = se(Ee);
  796. export {
  797. Re as P
  798. };