index6.js 22 KB

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