| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068 |
- import { bp as T, bq as Q, e as he, f as J, bo as Z, bn as z, h as M, cx as q, d as f, _ as P, i as j, y as oe, g as re, m as se, r as le, cy as Se, u as ae, be as ve, bV as ce, bg as be, cz as de, b as Ce, c as B, o as pe, P as x, cA as ye, bc as Ie, F as xe, t as we, cB as Pe, cC as De, l as Te } from "./index2.js";
- import { defineComponent as O, computed as v, createVNode as p, Fragment as ue, ref as ge, onUpdated as We } from "vue";
- import { u as ze } from "./useRefs.js";
- const Oe = ["normal", "exception", "active", "success"], F = () => ({
- prefixCls: String,
- type: T(),
- percent: Number,
- format: z(),
- status: T(),
- showInfo: Z(),
- strokeWidth: Number,
- strokeLinecap: T(),
- strokeColor: J(),
- trailColor: String,
- /** @deprecated Use `size` instead */
- width: Number,
- success: he(),
- gapDegree: Number,
- gapPosition: T(),
- size: Q([String, Number, Array]),
- steps: Number,
- /** @deprecated Use `success` instead */
- successPercent: Number,
- title: String,
- progressStatus: T()
- });
- function X(e) {
- return !e || e < 0 ? 0 : e > 100 ? 100 : e;
- }
- function L(e) {
- let {
- success: t,
- successPercent: i
- } = e, n = i;
- return t && "progress" in t && (M(!1, "Progress", "`success.progress` is deprecated. Please use `success.percent` instead."), n = t.progress), t && "percent" in t && (n = t.percent), n;
- }
- function Xe(e) {
- let {
- percent: t,
- success: i,
- successPercent: n
- } = e;
- const o = X(L({
- success: i,
- successPercent: n
- }));
- return [o, X(X(t) - o)];
- }
- function _e(e) {
- let {
- success: t = {},
- strokeColor: i
- } = e;
- const {
- strokeColor: n
- } = t;
- return [n || q.green, i || null];
- }
- const G = (e, t, i) => {
- var n, o, s, c;
- let l = -1, r = -1;
- if (t === "step") {
- const u = i.steps, m = i.strokeWidth;
- typeof e == "string" || typeof e == "undefined" ? (l = e === "small" ? 2 : 14, r = m != null ? m : 8) : typeof e == "number" ? [l, r] = [e, e] : [l = 14, r = 8] = e, l *= u;
- } else if (t === "line") {
- const u = i == null ? void 0 : i.strokeWidth;
- typeof e == "string" || typeof e == "undefined" ? r = u || (e === "small" ? 6 : 8) : typeof e == "number" ? [l, r] = [e, e] : [l = -1, r = 8] = e;
- } else (t === "circle" || t === "dashboard") && (typeof e == "string" || typeof e == "undefined" ? [l, r] = e === "small" ? [60, 60] : [120, 120] : typeof e == "number" ? [l, r] = [e, e] : (process.env.NODE_ENV !== "production" && M(!1, "Progress", 'Type "circle" and "dashboard" do not accept array as `size`, please use number or preset size instead.'), l = (o = (n = e[0]) !== null && n !== void 0 ? n : e[1]) !== null && o !== void 0 ? o : 120, r = (c = (s = e[0]) !== null && s !== void 0 ? s : e[1]) !== null && c !== void 0 ? c : 120));
- return {
- width: l,
- height: r
- };
- };
- var Ne = function(e, t) {
- var i = {};
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (i[n] = e[n]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
- t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (i[n[o]] = e[n[o]]);
- return i;
- };
- const Ee = () => f(f({}, F()), {
- strokeColor: J(),
- direction: T()
- }), He = (e) => {
- let t = [];
- return Object.keys(e).forEach((i) => {
- const n = parseFloat(i.replace(/%/g, ""));
- isNaN(n) || t.push({
- key: n,
- value: e[i]
- });
- }), t = t.sort((i, n) => i.key - n.key), t.map((i) => {
- let {
- key: n,
- value: o
- } = i;
- return `${o} ${n}%`;
- }).join(", ");
- }, Me = (e, t) => {
- const {
- from: i = q.blue,
- to: n = q.blue,
- direction: o = t === "rtl" ? "to left" : "to right"
- } = e, s = Ne(e, ["from", "to", "direction"]);
- if (Object.keys(s).length !== 0) {
- const c = He(s);
- return {
- backgroundImage: `linear-gradient(${o}, ${c})`
- };
- }
- return {
- backgroundImage: `linear-gradient(${o}, ${i}, ${n})`
- };
- }, Ae = O({
- compatConfig: {
- MODE: 3
- },
- name: "ProgressLine",
- inheritAttrs: !1,
- props: Ee(),
- setup(e, t) {
- let {
- slots: i,
- attrs: n
- } = t;
- const o = v(() => {
- const {
- strokeColor: d,
- direction: $
- } = e;
- return d && typeof d != "string" ? Me(d, $) : {
- backgroundColor: d
- };
- }), s = v(() => e.strokeLinecap === "square" || e.strokeLinecap === "butt" ? 0 : void 0), c = v(() => e.trailColor ? {
- backgroundColor: e.trailColor
- } : void 0), l = v(() => {
- var d;
- return (d = e.size) !== null && d !== void 0 ? d : [-1, e.strokeWidth || (e.size === "small" ? 6 : 8)];
- }), r = v(() => G(l.value, "line", {
- strokeWidth: e.strokeWidth
- }));
- process.env.NODE_ENV !== "production" && M("strokeWidth" in e, "Progress", "`strokeWidth` is deprecated. Please use `size` instead.");
- const u = v(() => {
- const {
- percent: d
- } = e;
- return f({
- width: `${X(d)}%`,
- height: `${r.value.height}px`,
- borderRadius: s.value
- }, o.value);
- }), m = v(() => L(e)), g = v(() => {
- const {
- success: d
- } = e;
- return {
- width: `${X(m.value)}%`,
- height: `${r.value.height}px`,
- borderRadius: s.value,
- backgroundColor: d == null ? void 0 : d.strokeColor
- };
- }), S = {
- width: r.value.width < 0 ? "100%" : r.value.width,
- height: `${r.value.height}px`
- };
- return () => {
- var d;
- return p(ue, null, [p("div", P(P({}, n), {}, {
- class: [`${e.prefixCls}-outer`, n.class],
- style: [n.style, S]
- }), [p("div", {
- class: `${e.prefixCls}-inner`,
- style: c.value
- }, [p("div", {
- class: `${e.prefixCls}-bg`,
- style: u.value
- }, null), m.value !== void 0 ? p("div", {
- class: `${e.prefixCls}-success-bg`,
- style: g.value
- }, null) : null])]), (d = i.default) === null || d === void 0 ? void 0 : d.call(i)]);
- };
- }
- }), Re = {
- percent: 0,
- prefixCls: "vc-progress",
- strokeColor: "#2db7f5",
- strokeLinecap: "round",
- strokeWidth: 1,
- trailColor: "#D9D9D9",
- trailWidth: 1
- }, Be = (e) => {
- const t = ge(null);
- return We(() => {
- const i = Date.now();
- let n = !1;
- e.value.forEach((o) => {
- const s = (o == null ? void 0 : o.$el) || o;
- if (!s)
- return;
- n = !0;
- const c = s.style;
- c.transitionDuration = ".3s, .3s, .3s, .06s", t.value && i - t.value < 100 && (c.transitionDuration = "0s, 0s");
- }), n && (t.value = Date.now());
- }), e;
- }, Le = {
- gapDegree: Number,
- gapPosition: {
- type: String
- },
- percent: {
- type: [Array, Number]
- },
- prefixCls: String,
- strokeColor: {
- type: [Object, String, Array]
- },
- strokeLinecap: {
- type: String
- },
- strokeWidth: Number,
- trailColor: String,
- trailWidth: Number,
- transition: String
- };
- var je = function(e, t) {
- var i = {};
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (i[n] = e[n]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
- t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (i[n[o]] = e[n[o]]);
- return i;
- };
- let k = 0;
- function ee(e) {
- return +e.replace("%", "");
- }
- function te(e) {
- return Array.isArray(e) ? e : [e];
- }
- function ie(e, t, i, n) {
- let o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : 0, s = arguments.length > 5 ? arguments[5] : void 0;
- const c = 50 - n / 2;
- let l = 0, r = -c, u = 0, m = -2 * c;
- switch (s) {
- case "left":
- l = -c, r = 0, u = 2 * c, m = 0;
- break;
- case "right":
- l = c, r = 0, u = -2 * c, m = 0;
- break;
- case "bottom":
- r = c, m = 2 * c;
- break;
- }
- const g = `M 50,50 m ${l},${r}
- a ${c},${c} 0 1 1 ${u},${-m}
- a ${c},${c} 0 1 1 ${-u},${m}`, S = Math.PI * 2 * c, d = {
- stroke: i,
- strokeDasharray: `${t / 100 * (S - o)}px ${S}px`,
- strokeDashoffset: `-${o / 2 + e / 100 * (S - o)}px`,
- transition: "stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"
- // eslint-disable-line
- };
- return {
- pathString: g,
- pathStyle: d
- };
- }
- const Fe = O({
- compatConfig: {
- MODE: 3
- },
- name: "VCCircle",
- props: j(Le, Re),
- setup(e) {
- k += 1;
- const t = ge(k), i = v(() => te(e.percent)), n = v(() => te(e.strokeColor)), [o, s] = ze();
- Be(s);
- const c = () => {
- const {
- prefixCls: l,
- strokeWidth: r,
- strokeLinecap: u,
- gapDegree: m,
- gapPosition: g
- } = e;
- let S = 0;
- return i.value.map((d, $) => {
- const a = n.value[$] || n.value[n.value.length - 1], C = Object.prototype.toString.call(a) === "[object Object]" ? `url(#${l}-gradient-${t.value})` : "", {
- pathString: I,
- pathStyle: b
- } = ie(S, d, a, r, m, g);
- S += d;
- const y = {
- key: $,
- d: I,
- stroke: C,
- "stroke-linecap": u,
- "stroke-width": r,
- opacity: d === 0 ? 0 : 1,
- "fill-opacity": "0",
- class: `${l}-circle-path`,
- style: b
- };
- return p("path", P({
- ref: o($)
- }, y), null);
- });
- };
- return () => {
- const {
- prefixCls: l,
- strokeWidth: r,
- trailWidth: u,
- gapDegree: m,
- gapPosition: g,
- trailColor: S,
- strokeLinecap: d,
- strokeColor: $
- } = e, a = je(e, ["prefixCls", "strokeWidth", "trailWidth", "gapDegree", "gapPosition", "trailColor", "strokeLinecap", "strokeColor"]), {
- pathString: C,
- pathStyle: I
- } = ie(0, 100, S, r, m, g);
- delete a.percent;
- const b = n.value.find((h) => Object.prototype.toString.call(h) === "[object Object]"), y = {
- d: C,
- stroke: S,
- "stroke-linecap": d,
- "stroke-width": u || r,
- "fill-opacity": "0",
- class: `${l}-circle-trail`,
- style: I
- };
- return p("svg", P({
- class: `${l}-circle`,
- viewBox: "0 0 100 100"
- }, a), [b && p("defs", null, [p("linearGradient", {
- id: `${l}-gradient-${t.value}`,
- x1: "100%",
- y1: "0%",
- x2: "0%",
- y2: "0%"
- }, [Object.keys(b).sort((h, w) => ee(h) - ee(w)).map((h, w) => p("stop", {
- key: w,
- offset: h,
- "stop-color": b[h]
- }, null))])]), p("path", y, null), c().reverse()]);
- };
- }
- }), Ge = () => f(f({}, F()), {
- strokeColor: J()
- }), Ke = 3, Ve = (e) => Ke / e * 100, Ye = O({
- compatConfig: {
- MODE: 3
- },
- name: "ProgressCircle",
- inheritAttrs: !1,
- props: j(Ge(), {
- trailColor: null
- }),
- setup(e, t) {
- let {
- slots: i,
- attrs: n
- } = t;
- const o = v(() => {
- var a;
- return (a = e.width) !== null && a !== void 0 ? a : 120;
- }), s = v(() => {
- var a;
- return (a = e.size) !== null && a !== void 0 ? a : [o.value, o.value];
- }), c = v(() => G(s.value, "circle")), l = v(() => {
- if (e.gapDegree || e.gapDegree === 0)
- return e.gapDegree;
- if (e.type === "dashboard")
- return 75;
- }), r = v(() => ({
- width: `${c.value.width}px`,
- height: `${c.value.height}px`,
- fontSize: `${c.value.width * 0.15 + 6}px`
- })), u = v(() => {
- var a;
- return (a = e.strokeWidth) !== null && a !== void 0 ? a : Math.max(Ve(c.value.width), 6);
- }), m = v(() => e.gapPosition || e.type === "dashboard" && "bottom" || void 0), g = v(() => Xe(e)), S = v(() => Object.prototype.toString.call(e.strokeColor) === "[object Object]"), d = v(() => _e({
- success: e.success,
- strokeColor: e.strokeColor
- })), $ = v(() => ({
- [`${e.prefixCls}-inner`]: !0,
- [`${e.prefixCls}-circle-gradient`]: S.value
- }));
- return () => {
- var a;
- const C = p(Fe, {
- percent: g.value,
- strokeWidth: u.value,
- trailWidth: u.value,
- strokeColor: d.value,
- strokeLinecap: e.strokeLinecap,
- trailColor: e.trailColor,
- prefixCls: e.prefixCls,
- gapDegree: l.value,
- gapPosition: m.value
- }, null);
- return p("div", P(P({}, n), {}, {
- class: [$.value, n.class],
- style: [n.style, r.value]
- }), [c.value.width <= 20 ? p(oe, null, {
- default: () => [p("span", null, [C])],
- title: i.default
- }) : p(ue, null, [C, (a = i.default) === null || a === void 0 ? void 0 : a.call(i)])]);
- };
- }
- }), Ue = () => f(f({}, F()), {
- steps: Number,
- strokeColor: Q(),
- trailColor: String
- }), qe = O({
- compatConfig: {
- MODE: 3
- },
- name: "Steps",
- props: Ue(),
- setup(e, t) {
- let {
- slots: i
- } = t;
- const n = v(() => Math.round(e.steps * ((e.percent || 0) / 100))), o = v(() => {
- var l;
- return (l = e.size) !== null && l !== void 0 ? l : [e.size === "small" ? 2 : 14, e.strokeWidth || 8];
- }), s = v(() => G(o.value, "step", {
- steps: e.steps,
- strokeWidth: e.strokeWidth || 8
- })), c = v(() => {
- const {
- steps: l,
- strokeColor: r,
- trailColor: u,
- prefixCls: m
- } = e, g = [];
- for (let S = 0; S < l; S += 1) {
- const d = Array.isArray(r) ? r[S] : r, $ = {
- [`${m}-steps-item`]: !0,
- [`${m}-steps-item-active`]: S <= n.value - 1
- };
- g.push(p("div", {
- key: S,
- class: $,
- style: {
- backgroundColor: S <= n.value - 1 ? d : u,
- width: `${s.value.width / l}px`,
- height: `${s.value.height}px`
- }
- }, null));
- }
- return g;
- });
- return () => {
- var l;
- return p("div", {
- class: `${e.prefixCls}-steps-outer`
- }, [c.value, (l = i.default) === null || l === void 0 ? void 0 : l.call(i)]);
- };
- }
- }), Qe = new Se("antProgressActive", {
- "0%": {
- transform: "translateX(-100%) scaleX(0)",
- opacity: 0.1
- },
- "20%": {
- transform: "translateX(-100%) scaleX(0)",
- opacity: 0.5
- },
- to: {
- transform: "translateX(0) scaleX(1)",
- opacity: 0
- }
- }), Je = (e) => {
- const {
- componentCls: t,
- iconCls: i
- } = e;
- return {
- [t]: f(f({}, le(e)), {
- display: "inline-block",
- "&-rtl": {
- direction: "rtl"
- },
- "&-line": {
- position: "relative",
- width: "100%",
- fontSize: e.fontSize,
- marginInlineEnd: e.marginXS,
- marginBottom: e.marginXS
- },
- [`${t}-outer`]: {
- display: "inline-block",
- width: "100%"
- },
- [`&${t}-show-info`]: {
- [`${t}-outer`]: {
- marginInlineEnd: `calc(-2em - ${e.marginXS}px)`,
- paddingInlineEnd: `calc(2em + ${e.paddingXS}px)`
- }
- },
- [`${t}-inner`]: {
- position: "relative",
- display: "inline-block",
- width: "100%",
- overflow: "hidden",
- verticalAlign: "middle",
- backgroundColor: e.progressRemainingColor,
- borderRadius: e.progressLineRadius
- },
- [`${t}-inner:not(${t}-circle-gradient)`]: {
- [`${t}-circle-path`]: {
- stroke: e.colorInfo
- }
- },
- [`${t}-success-bg, ${t}-bg`]: {
- position: "relative",
- backgroundColor: e.colorInfo,
- borderRadius: e.progressLineRadius,
- transition: `all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`
- },
- [`${t}-success-bg`]: {
- position: "absolute",
- insetBlockStart: 0,
- insetInlineStart: 0,
- backgroundColor: e.colorSuccess
- },
- [`${t}-text`]: {
- display: "inline-block",
- width: "2em",
- marginInlineStart: e.marginXS,
- color: e.progressInfoTextColor,
- lineHeight: 1,
- whiteSpace: "nowrap",
- textAlign: "start",
- verticalAlign: "middle",
- wordBreak: "normal",
- [i]: {
- fontSize: e.fontSize
- }
- },
- [`&${t}-status-active`]: {
- [`${t}-bg::before`]: {
- position: "absolute",
- inset: 0,
- backgroundColor: e.colorBgContainer,
- borderRadius: e.progressLineRadius,
- opacity: 0,
- animationName: Qe,
- animationDuration: e.progressActiveMotionDuration,
- animationTimingFunction: e.motionEaseOutQuint,
- animationIterationCount: "infinite",
- content: '""'
- }
- },
- [`&${t}-status-exception`]: {
- [`${t}-bg`]: {
- backgroundColor: e.colorError
- },
- [`${t}-text`]: {
- color: e.colorError
- }
- },
- [`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]: {
- [`${t}-circle-path`]: {
- stroke: e.colorError
- }
- },
- [`&${t}-status-success`]: {
- [`${t}-bg`]: {
- backgroundColor: e.colorSuccess
- },
- [`${t}-text`]: {
- color: e.colorSuccess
- }
- },
- [`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]: {
- [`${t}-circle-path`]: {
- stroke: e.colorSuccess
- }
- }
- })
- };
- }, Ze = (e) => {
- const {
- componentCls: t,
- iconCls: i
- } = e;
- return {
- [t]: {
- [`${t}-circle-trail`]: {
- stroke: e.progressRemainingColor
- },
- [`&${t}-circle ${t}-inner`]: {
- position: "relative",
- lineHeight: 1,
- backgroundColor: "transparent"
- },
- [`&${t}-circle ${t}-text`]: {
- position: "absolute",
- insetBlockStart: "50%",
- insetInlineStart: 0,
- width: "100%",
- margin: 0,
- padding: 0,
- color: e.colorText,
- lineHeight: 1,
- whiteSpace: "normal",
- textAlign: "center",
- transform: "translateY(-50%)",
- [i]: {
- fontSize: `${e.fontSize / e.fontSizeSM}em`
- }
- },
- [`${t}-circle&-status-exception`]: {
- [`${t}-text`]: {
- color: e.colorError
- }
- },
- [`${t}-circle&-status-success`]: {
- [`${t}-text`]: {
- color: e.colorSuccess
- }
- }
- },
- [`${t}-inline-circle`]: {
- lineHeight: 1,
- [`${t}-inner`]: {
- verticalAlign: "bottom"
- }
- }
- };
- }, ke = (e) => {
- const {
- componentCls: t
- } = e;
- return {
- [t]: {
- [`${t}-steps`]: {
- display: "inline-block",
- "&-outer": {
- display: "flex",
- flexDirection: "row",
- alignItems: "center"
- },
- "&-item": {
- flexShrink: 0,
- minWidth: e.progressStepMinWidth,
- marginInlineEnd: e.progressStepMarginInlineEnd,
- backgroundColor: e.progressRemainingColor,
- transition: `all ${e.motionDurationSlow}`,
- "&-active": {
- backgroundColor: e.colorInfo
- }
- }
- }
- }
- };
- }, et = (e) => {
- const {
- componentCls: t,
- iconCls: i
- } = e;
- return {
- [t]: {
- [`${t}-small&-line, ${t}-small&-line ${t}-text ${i}`]: {
- fontSize: e.fontSizeSM
- }
- }
- };
- }, tt = re("Progress", (e) => {
- const t = e.marginXXS / 2, i = se(e, {
- progressLineRadius: 100,
- progressInfoTextColor: e.colorText,
- progressDefaultColor: e.colorInfo,
- progressRemainingColor: e.colorFillSecondary,
- progressStepMarginInlineEnd: t,
- progressStepMinWidth: t,
- progressActiveMotionDuration: "2.4s"
- });
- return [Je(i), Ze(i), ke(i), et(i)];
- });
- var it = function(e, t) {
- var i = {};
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (i[n] = e[n]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
- t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (i[n[o]] = e[n[o]]);
- return i;
- };
- const nt = O({
- compatConfig: {
- MODE: 3
- },
- name: "AProgress",
- inheritAttrs: !1,
- props: j(F(), {
- type: "line",
- percent: 0,
- showInfo: !0,
- // null for different theme definition
- trailColor: null,
- size: "default",
- strokeLinecap: "round"
- }),
- slots: Object,
- setup(e, t) {
- let {
- slots: i,
- attrs: n
- } = t;
- const {
- prefixCls: o,
- direction: s
- } = ae("progress", e), [c, l] = tt(o);
- process.env.NODE_ENV !== "production" && (M("successPercent" in e, "Progress", "`successPercent` is deprecated. Please use `success.percent` instead."), M("width" in e, "Progress", "`width` is deprecated. Please use `size` instead."));
- const r = v(() => Array.isArray(e.strokeColor) ? e.strokeColor[0] : e.strokeColor), u = v(() => {
- const {
- percent: $ = 0
- } = e, a = L(e);
- return parseInt(a !== void 0 ? a.toString() : $.toString(), 10);
- }), m = v(() => {
- const {
- status: $
- } = e;
- return !Oe.includes($) && u.value >= 100 ? "success" : $ || "normal";
- }), g = v(() => {
- const {
- type: $,
- showInfo: a,
- size: C
- } = e, I = o.value;
- return {
- [I]: !0,
- [`${I}-inline-circle`]: $ === "circle" && G(C, "circle").width <= 20,
- [`${I}-${$ === "dashboard" && "circle" || $}`]: !0,
- [`${I}-status-${m.value}`]: !0,
- [`${I}-show-info`]: a,
- [`${I}-${C}`]: C,
- [`${I}-rtl`]: s.value === "rtl",
- [l.value]: !0
- };
- }), S = v(() => typeof e.strokeColor == "string" || Array.isArray(e.strokeColor) ? e.strokeColor : void 0), d = () => {
- const {
- showInfo: $,
- format: a,
- type: C,
- percent: I,
- title: b
- } = e, y = L(e);
- if (!$) return null;
- let h;
- const w = a || (i == null ? void 0 : i.format) || ((W) => `${W}%`), D = C === "line";
- return a || i != null && i.format || m.value !== "exception" && m.value !== "success" ? h = w(X(I), X(y)) : m.value === "exception" ? h = D ? p(ve, null, null) : p(ce, null, null) : m.value === "success" && (h = D ? p(be, null, null) : p(de, null, null)), p("span", {
- class: `${o.value}-text`,
- title: b === void 0 && typeof h == "string" ? h : void 0
- }, [h]);
- };
- return () => {
- const {
- type: $,
- steps: a,
- title: C
- } = e, {
- class: I
- } = n, b = it(n, ["class"]), y = d();
- let h;
- return $ === "line" ? h = a ? p(qe, P(P({}, e), {}, {
- strokeColor: S.value,
- prefixCls: o.value,
- steps: a
- }), {
- default: () => [y]
- }) : p(Ae, P(P({}, e), {}, {
- strokeColor: r.value,
- prefixCls: o.value,
- direction: s.value
- }), {
- default: () => [y]
- }) : ($ === "circle" || $ === "dashboard") && (h = p(Ye, P(P({}, e), {}, {
- prefixCls: o.value,
- strokeColor: r.value,
- progressStatus: m.value
- }), {
- default: () => [y]
- })), c(p("div", P(P({
- role: "progressbar"
- }, b), {}, {
- class: [g.value, I],
- title: C
- }), [h]));
- };
- }
- }), ot = Ce(nt);
- function ne(e) {
- return typeof e == "string";
- }
- function rt() {
- }
- const me = () => ({
- prefixCls: String,
- itemWidth: String,
- active: {
- type: Boolean,
- default: void 0
- },
- disabled: {
- type: Boolean,
- default: void 0
- },
- status: T(),
- iconPrefix: String,
- icon: x.any,
- adjustMarginRight: String,
- stepNumber: Number,
- stepIndex: Number,
- description: x.any,
- title: x.any,
- subTitle: x.any,
- progressDot: ye(x.oneOfType([x.looseBool, x.func])),
- tailContent: x.any,
- icons: x.shape({
- finish: x.any,
- error: x.any
- }).loose,
- onClick: z(),
- onStepClick: z(),
- stepIcon: z(),
- itemRender: z(),
- __legacy: Z()
- }), fe = O({
- compatConfig: {
- MODE: 3
- },
- name: "Step",
- inheritAttrs: !1,
- props: me(),
- setup(e, t) {
- let {
- slots: i,
- emit: n,
- attrs: o
- } = t;
- const s = (l) => {
- n("click", l), n("stepClick", e.stepIndex);
- }, c = (l) => {
- let {
- icon: r,
- title: u,
- description: m
- } = l;
- const {
- prefixCls: g,
- stepNumber: S,
- status: d,
- iconPrefix: $,
- icons: a,
- progressDot: C = i.progressDot,
- stepIcon: I = i.stepIcon
- } = e;
- let b;
- const y = B(`${g}-icon`, `${$}icon`, {
- [`${$}icon-${r}`]: r && ne(r),
- [`${$}icon-check`]: !r && d === "finish" && (a && !a.finish || !a),
- [`${$}icon-cross`]: !r && d === "error" && (a && !a.error || !a)
- }), h = p("span", {
- class: `${g}-icon-dot`
- }, null);
- return C ? typeof C == "function" ? b = p("span", {
- class: `${g}-icon`
- }, [C({
- iconDot: h,
- index: S - 1,
- status: d,
- title: u,
- description: m,
- prefixCls: g
- })]) : b = p("span", {
- class: `${g}-icon`
- }, [h]) : r && !ne(r) ? b = p("span", {
- class: `${g}-icon`
- }, [r]) : a && a.finish && d === "finish" ? b = p("span", {
- class: `${g}-icon`
- }, [a.finish]) : a && a.error && d === "error" ? b = p("span", {
- class: `${g}-icon`
- }, [a.error]) : r || d === "finish" || d === "error" ? b = p("span", {
- class: y
- }, null) : b = p("span", {
- class: `${g}-icon`
- }, [S]), I && (b = I({
- index: S - 1,
- status: d,
- title: u,
- description: m,
- node: b
- })), b;
- };
- return () => {
- var l, r, u, m;
- const {
- prefixCls: g,
- itemWidth: S,
- active: d,
- status: $ = "wait",
- tailContent: a,
- adjustMarginRight: C,
- disabled: I,
- title: b = (l = i.title) === null || l === void 0 ? void 0 : l.call(i),
- description: y = (r = i.description) === null || r === void 0 ? void 0 : r.call(i),
- subTitle: h = (u = i.subTitle) === null || u === void 0 ? void 0 : u.call(i),
- icon: w = (m = i.icon) === null || m === void 0 ? void 0 : m.call(i),
- onClick: D,
- onStepClick: W
- } = e, _ = $ || "wait", K = B(`${g}-item`, `${g}-item-${_}`, {
- [`${g}-item-custom`]: w,
- [`${g}-item-active`]: d,
- [`${g}-item-disabled`]: I === !0
- }), N = {};
- S && (N.width = S), C && (N.marginRight = C);
- const E = {
- onClick: D || rt
- };
- W && !I && (E.role = "button", E.tabindex = 0, E.onClick = s);
- const A = p("div", P(P({}, pe(o, ["__legacy"])), {}, {
- class: [K, o.class],
- style: [o.style, N]
- }), [p("div", P(P({}, E), {}, {
- class: `${g}-item-container`
- }), [p("div", {
- class: `${g}-item-tail`
- }, [a]), p("div", {
- class: `${g}-item-icon`
- }, [c({
- icon: w,
- title: b,
- description: y
- })]), p("div", {
- class: `${g}-item-content`
- }, [p("div", {
- class: `${g}-item-title`
- }, [b, h && p("div", {
- title: typeof h == "string" ? h : void 0,
- class: `${g}-item-subtitle`
- }, [h])]), y && p("div", {
- class: `${g}-item-description`
- }, [y])])])]);
- return e.itemRender ? e.itemRender(A) : A;
- };
- }
- });
- var st = function(e, t) {
- var i = {};
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (i[n] = e[n]);
- if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(e); o < n.length; o++)
- t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (i[n[o]] = e[n[o]]);
- return i;
- };
- const lt = O({
- compatConfig: {
- MODE: 3
- },
- name: "Steps",
- props: {
- type: x.string.def("default"),
- prefixCls: x.string.def("vc-steps"),
- iconPrefix: x.string.def("vc"),
- direction: x.string.def("horizontal"),
- labelPlacement: x.string.def("horizontal"),
- status: T("process"),
- size: x.string.def(""),
- progressDot: x.oneOfType([x.looseBool, x.func]).def(void 0),
- initial: x.number.def(0),
- current: x.number.def(0),
- items: x.array.def(() => []),
- icons: x.shape({
- finish: x.any,
- error: x.any
- }).loose,
- stepIcon: z(),
- isInline: x.looseBool,
- itemRender: z()
- },
- emits: ["change"],
- setup(e, t) {
- let {
- slots: i,
- emit: n
- } = t;
- const o = (l) => {
- const {
- current: r
- } = e;
- r !== l && n("change", l);
- }, s = (l, r, u) => {
- const {
- prefixCls: m,
- iconPrefix: g,
- status: S,
- current: d,
- initial: $,
- icons: a,
- stepIcon: C = i.stepIcon,
- isInline: I,
- itemRender: b,
- progressDot: y = i.progressDot
- } = e, h = I || y, w = f(f({}, l), {
- class: ""
- }), D = $ + r, W = {
- active: D === d,
- stepNumber: D + 1,
- stepIndex: D,
- key: D,
- prefixCls: m,
- iconPrefix: g,
- progressDot: h,
- stepIcon: C,
- icons: a,
- onStepClick: o
- };
- return S === "error" && r === d - 1 && (w.class = `${m}-next-error`), w.status || (D === d ? w.status = S : D < d ? w.status = "finish" : w.status = "wait"), I && (w.icon = void 0, w.subTitle = void 0), u ? u(f(f({}, w), W)) : (b && (w.itemRender = (_) => b(w, _)), p(fe, P(P(P({}, w), W), {}, {
- __legacy: !1
- }), null));
- }, c = (l, r) => s(f({}, l.props), r, (u) => xe(l, u));
- return () => {
- var l;
- const {
- prefixCls: r,
- direction: u,
- type: m,
- labelPlacement: g,
- iconPrefix: S,
- status: d,
- size: $,
- current: a,
- progressDot: C = i.progressDot,
- initial: I,
- icons: b,
- items: y,
- isInline: h,
- itemRender: w
- } = e, D = st(e, ["prefixCls", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "initial", "icons", "items", "isInline", "itemRender"]), W = m === "navigation", _ = h || C, K = h ? "horizontal" : u, N = h ? void 0 : $, E = _ ? "vertical" : g, A = B(r, `${r}-${u}`, {
- [`${r}-${N}`]: N,
- [`${r}-label-${E}`]: K === "horizontal",
- [`${r}-dot`]: !!_,
- [`${r}-navigation`]: W,
- [`${r}-inline`]: h
- });
- return p("div", P({
- class: A
- }, D), [y.filter((V) => V).map((V, $e) => s(V, $e)), Ie((l = i.default) === null || l === void 0 ? void 0 : l.call(i)).map(c)]);
- };
- }
- }), at = (e) => {
- const {
- componentCls: t,
- stepsIconCustomTop: i,
- stepsIconCustomSize: n,
- stepsIconCustomFontSize: o
- } = e;
- return {
- [`${t}-item-custom`]: {
- [`> ${t}-item-container > ${t}-item-icon`]: {
- height: "auto",
- background: "none",
- border: 0,
- [`> ${t}-icon`]: {
- top: i,
- width: n,
- height: n,
- fontSize: o,
- lineHeight: `${n}px`
- }
- }
- },
- // Only adjust horizontal customize icon width
- [`&:not(${t}-vertical)`]: {
- [`${t}-item-custom`]: {
- [`${t}-item-icon`]: {
- width: "auto",
- background: "none"
- }
- }
- }
- };
- }, ct = (e) => {
- const {
- componentCls: t,
- stepsIconSize: i,
- lineHeight: n,
- stepsSmallIconSize: o
- } = e;
- return {
- [`&${t}-label-vertical`]: {
- [`${t}-item`]: {
- overflow: "visible",
- "&-tail": {
- marginInlineStart: i / 2 + e.controlHeightLG,
- padding: `${e.paddingXXS}px ${e.paddingLG}px`
- },
- "&-content": {
- display: "block",
- width: (i / 2 + e.controlHeightLG) * 2,
- marginTop: e.marginSM,
- textAlign: "center"
- },
- "&-icon": {
- display: "inline-block",
- marginInlineStart: e.controlHeightLG
- },
- "&-title": {
- paddingInlineEnd: 0,
- paddingInlineStart: 0,
- "&::after": {
- display: "none"
- }
- },
- "&-subtitle": {
- display: "block",
- marginBottom: e.marginXXS,
- marginInlineStart: 0,
- lineHeight: n
- }
- },
- [`&${t}-small:not(${t}-dot)`]: {
- [`${t}-item`]: {
- "&-icon": {
- marginInlineStart: e.controlHeightLG + (i - o) / 2
- }
- }
- }
- }
- };
- }, dt = (e) => {
- const {
- componentCls: t,
- stepsNavContentMaxWidth: i,
- stepsNavArrowColor: n,
- stepsNavActiveColor: o,
- motionDurationSlow: s
- } = e;
- return {
- [`&${t}-navigation`]: {
- paddingTop: e.paddingSM,
- [`&${t}-small`]: {
- [`${t}-item`]: {
- "&-container": {
- marginInlineStart: -e.marginSM
- }
- }
- },
- [`${t}-item`]: {
- overflow: "visible",
- textAlign: "center",
- "&-container": {
- display: "inline-block",
- height: "100%",
- marginInlineStart: -e.margin,
- paddingBottom: e.paddingSM,
- textAlign: "start",
- transition: `opacity ${s}`,
- [`${t}-item-content`]: {
- maxWidth: i
- },
- [`${t}-item-title`]: f(f({
- maxWidth: "100%",
- paddingInlineEnd: 0
- }, we), {
- "&::after": {
- display: "none"
- }
- })
- },
- [`&:not(${t}-item-active)`]: {
- [`${t}-item-container[role='button']`]: {
- cursor: "pointer",
- "&:hover": {
- opacity: 0.85
- }
- }
- },
- "&:last-child": {
- flex: 1,
- "&::after": {
- display: "none"
- }
- },
- "&::after": {
- position: "absolute",
- top: `calc(50% - ${e.paddingSM / 2}px)`,
- insetInlineStart: "100%",
- display: "inline-block",
- width: e.fontSizeIcon,
- height: e.fontSizeIcon,
- borderTop: `${e.lineWidth}px ${e.lineType} ${n}`,
- borderBottom: "none",
- borderInlineStart: "none",
- borderInlineEnd: `${e.lineWidth}px ${e.lineType} ${n}`,
- transform: "translateY(-50%) translateX(-50%) rotate(45deg)",
- content: '""'
- },
- "&::before": {
- position: "absolute",
- bottom: 0,
- insetInlineStart: "50%",
- display: "inline-block",
- width: 0,
- height: e.lineWidthBold,
- backgroundColor: o,
- transition: `width ${s}, inset-inline-start ${s}`,
- transitionTimingFunction: "ease-out",
- content: '""'
- }
- },
- [`${t}-item${t}-item-active::before`]: {
- insetInlineStart: 0,
- width: "100%"
- }
- },
- [`&${t}-navigation${t}-vertical`]: {
- [`> ${t}-item`]: {
- marginInlineEnd: 0,
- "&::before": {
- display: "none"
- },
- [`&${t}-item-active::before`]: {
- top: 0,
- insetInlineEnd: 0,
- insetInlineStart: "unset",
- display: "block",
- width: e.lineWidth * 3,
- height: `calc(100% - ${e.marginLG}px)`
- },
- "&::after": {
- position: "relative",
- insetInlineStart: "50%",
- display: "block",
- width: e.controlHeight * 0.25,
- height: e.controlHeight * 0.25,
- marginBottom: e.marginXS,
- textAlign: "center",
- transform: "translateY(-50%) translateX(-50%) rotate(135deg)"
- },
- [`> ${t}-item-container > ${t}-item-tail`]: {
- visibility: "hidden"
- }
- }
- },
- [`&${t}-navigation${t}-horizontal`]: {
- [`> ${t}-item > ${t}-item-container > ${t}-item-tail`]: {
- visibility: "hidden"
- }
- }
- };
- }, pt = (e) => {
- const {
- antCls: t,
- componentCls: i
- } = e;
- return {
- [`&${i}-with-progress`]: {
- [`${i}-item`]: {
- paddingTop: e.paddingXXS,
- [`&-process ${i}-item-container ${i}-item-icon ${i}-icon`]: {
- color: e.processIconColor
- }
- },
- [`&${i}-vertical > ${i}-item `]: {
- paddingInlineStart: e.paddingXXS,
- [`> ${i}-item-container > ${i}-item-tail`]: {
- top: e.marginXXS,
- insetInlineStart: e.stepsIconSize / 2 - e.lineWidth + e.paddingXXS
- }
- },
- [`&, &${i}-small`]: {
- [`&${i}-horizontal ${i}-item:first-child`]: {
- paddingBottom: e.paddingXXS,
- paddingInlineStart: e.paddingXXS
- }
- },
- [`&${i}-small${i}-vertical > ${i}-item > ${i}-item-container > ${i}-item-tail`]: {
- insetInlineStart: e.stepsSmallIconSize / 2 - e.lineWidth + e.paddingXXS
- },
- [`&${i}-label-vertical`]: {
- [`${i}-item ${i}-item-tail`]: {
- top: e.margin - 2 * e.lineWidth
- }
- },
- [`${i}-item-icon`]: {
- position: "relative",
- [`${t}-progress`]: {
- position: "absolute",
- insetBlockStart: (e.stepsIconSize - e.stepsProgressSize - e.lineWidth * 2) / 2,
- insetInlineStart: (e.stepsIconSize - e.stepsProgressSize - e.lineWidth * 2) / 2
- }
- }
- }
- };
- }, ut = (e) => {
- const {
- componentCls: t,
- descriptionWidth: i,
- lineHeight: n,
- stepsCurrentDotSize: o,
- stepsDotSize: s,
- motionDurationSlow: c
- } = e;
- return {
- [`&${t}-dot, &${t}-dot${t}-small`]: {
- [`${t}-item`]: {
- "&-title": {
- lineHeight: n
- },
- "&-tail": {
- top: Math.floor((e.stepsDotSize - e.lineWidth * 3) / 2),
- width: "100%",
- marginTop: 0,
- marginBottom: 0,
- marginInline: `${i / 2}px 0`,
- padding: 0,
- "&::after": {
- width: `calc(100% - ${e.marginSM * 2}px)`,
- height: e.lineWidth * 3,
- marginInlineStart: e.marginSM
- }
- },
- "&-icon": {
- width: s,
- height: s,
- marginInlineStart: (e.descriptionWidth - s) / 2,
- paddingInlineEnd: 0,
- lineHeight: `${s}px`,
- background: "transparent",
- border: 0,
- [`${t}-icon-dot`]: {
- position: "relative",
- float: "left",
- width: "100%",
- height: "100%",
- borderRadius: 100,
- transition: `all ${c}`,
- /* expand hover area */
- "&::after": {
- position: "absolute",
- top: -e.marginSM,
- insetInlineStart: (s - e.controlHeightLG * 1.5) / 2,
- width: e.controlHeightLG * 1.5,
- height: e.controlHeight,
- background: "transparent",
- content: '""'
- }
- }
- },
- "&-content": {
- width: i
- },
- [`&-process ${t}-item-icon`]: {
- position: "relative",
- top: (s - o) / 2,
- width: o,
- height: o,
- lineHeight: `${o}px`,
- background: "none",
- marginInlineStart: (e.descriptionWidth - o) / 2
- },
- [`&-process ${t}-icon`]: {
- [`&:first-child ${t}-icon-dot`]: {
- insetInlineStart: 0
- }
- }
- }
- },
- [`&${t}-vertical${t}-dot`]: {
- [`${t}-item-icon`]: {
- marginTop: (e.controlHeight - s) / 2,
- marginInlineStart: 0,
- background: "none"
- },
- [`${t}-item-process ${t}-item-icon`]: {
- marginTop: (e.controlHeight - o) / 2,
- top: 0,
- insetInlineStart: (s - o) / 2,
- marginInlineStart: 0
- },
- // https://github.com/ant-design/ant-design/issues/18354
- [`${t}-item > ${t}-item-container > ${t}-item-tail`]: {
- top: (e.controlHeight - s) / 2,
- insetInlineStart: 0,
- margin: 0,
- padding: `${s + e.paddingXS}px 0 ${e.paddingXS}px`,
- "&::after": {
- marginInlineStart: (s - e.lineWidth) / 2
- }
- },
- [`&${t}-small`]: {
- [`${t}-item-icon`]: {
- marginTop: (e.controlHeightSM - s) / 2
- },
- [`${t}-item-process ${t}-item-icon`]: {
- marginTop: (e.controlHeightSM - o) / 2
- },
- [`${t}-item > ${t}-item-container > ${t}-item-tail`]: {
- top: (e.controlHeightSM - s) / 2
- }
- },
- [`${t}-item:first-child ${t}-icon-dot`]: {
- insetInlineStart: 0
- },
- [`${t}-item-content`]: {
- width: "inherit"
- }
- }
- };
- }, gt = (e) => {
- const {
- componentCls: t
- } = e;
- return {
- [`&${t}-rtl`]: {
- direction: "rtl",
- [`${t}-item`]: {
- "&-subtitle": {
- float: "left"
- }
- },
- // nav
- [`&${t}-navigation`]: {
- [`${t}-item::after`]: {
- transform: "rotate(-45deg)"
- }
- },
- // vertical
- [`&${t}-vertical`]: {
- [`> ${t}-item`]: {
- "&::after": {
- transform: "rotate(225deg)"
- },
- [`${t}-item-icon`]: {
- float: "right"
- }
- }
- },
- // progress-dot
- [`&${t}-dot`]: {
- [`${t}-item-icon ${t}-icon-dot, &${t}-small ${t}-item-icon ${t}-icon-dot`]: {
- float: "right"
- }
- }
- }
- };
- }, mt = (e) => {
- const {
- componentCls: t,
- stepsSmallIconSize: i,
- // stepsSmallIconMargin,
- fontSizeSM: n,
- fontSize: o,
- colorTextDescription: s
- } = e;
- return {
- [`&${t}-small`]: {
- [`&${t}-horizontal:not(${t}-label-vertical) ${t}-item`]: {
- paddingInlineStart: e.paddingSM,
- "&:first-child": {
- paddingInlineStart: 0
- }
- },
- [`${t}-item-icon`]: {
- width: i,
- height: i,
- // margin: stepsSmallIconMargin,
- marginTop: 0,
- marginBottom: 0,
- marginInline: `0 ${e.marginXS}px`,
- fontSize: n,
- lineHeight: `${i}px`,
- textAlign: "center",
- borderRadius: i
- },
- [`${t}-item-title`]: {
- paddingInlineEnd: e.paddingSM,
- fontSize: o,
- lineHeight: `${i}px`,
- "&::after": {
- top: i / 2
- }
- },
- [`${t}-item-description`]: {
- color: s,
- fontSize: o
- },
- [`${t}-item-tail`]: {
- top: i / 2 - e.paddingXXS
- },
- [`${t}-item-custom ${t}-item-icon`]: {
- width: "inherit",
- height: "inherit",
- lineHeight: "inherit",
- background: "none",
- border: 0,
- borderRadius: 0,
- [`> ${t}-icon`]: {
- fontSize: i,
- lineHeight: `${i}px`,
- transform: "none"
- }
- }
- }
- };
- }, ft = (e) => {
- const {
- componentCls: t,
- stepsSmallIconSize: i,
- stepsIconSize: n
- } = e;
- return {
- [`&${t}-vertical`]: {
- display: "flex",
- flexDirection: "column",
- [`> ${t}-item`]: {
- display: "block",
- flex: "1 0 auto",
- paddingInlineStart: 0,
- overflow: "visible",
- [`${t}-item-icon`]: {
- float: "left",
- marginInlineEnd: e.margin
- },
- [`${t}-item-content`]: {
- display: "block",
- minHeight: e.controlHeight * 1.5,
- overflow: "hidden"
- },
- [`${t}-item-title`]: {
- lineHeight: `${n}px`
- },
- [`${t}-item-description`]: {
- paddingBottom: e.paddingSM
- }
- },
- [`> ${t}-item > ${t}-item-container > ${t}-item-tail`]: {
- position: "absolute",
- top: 0,
- insetInlineStart: e.stepsIconSize / 2 - e.lineWidth,
- width: e.lineWidth,
- height: "100%",
- padding: `${n + e.marginXXS * 1.5}px 0 ${e.marginXXS * 1.5}px`,
- "&::after": {
- width: e.lineWidth,
- height: "100%"
- }
- },
- [`> ${t}-item:not(:last-child) > ${t}-item-container > ${t}-item-tail`]: {
- display: "block"
- },
- [` > ${t}-item > ${t}-item-container > ${t}-item-content > ${t}-item-title`]: {
- "&::after": {
- display: "none"
- }
- },
- [`&${t}-small ${t}-item-container`]: {
- [`${t}-item-tail`]: {
- position: "absolute",
- top: 0,
- insetInlineStart: e.stepsSmallIconSize / 2 - e.lineWidth,
- padding: `${i + e.marginXXS * 1.5}px 0 ${e.marginXXS * 1.5}px`
- },
- [`${t}-item-title`]: {
- lineHeight: `${i}px`
- }
- }
- }
- };
- }, $t = (e) => {
- const {
- componentCls: t,
- inlineDotSize: i,
- inlineTitleColor: n,
- inlineTailColor: o
- } = e, s = e.paddingXS + e.lineWidth, c = {
- [`${t}-item-container ${t}-item-content ${t}-item-title`]: {
- color: n
- }
- };
- return {
- [`&${t}-inline`]: {
- width: "auto",
- display: "inline-flex",
- [`${t}-item`]: {
- flex: "none",
- "&-container": {
- padding: `${s}px ${e.paddingXXS}px 0`,
- margin: `0 ${e.marginXXS / 2}px`,
- borderRadius: e.borderRadiusSM,
- cursor: "pointer",
- transition: `background-color ${e.motionDurationMid}`,
- "&:hover": {
- background: e.controlItemBgHover
- },
- "&[role='button']:hover": {
- opacity: 1
- }
- },
- "&-icon": {
- width: i,
- height: i,
- marginInlineStart: `calc(50% - ${i / 2}px)`,
- [`> ${t}-icon`]: {
- top: 0
- },
- [`${t}-icon-dot`]: {
- borderRadius: e.fontSizeSM / 4
- }
- },
- "&-content": {
- width: "auto",
- marginTop: e.marginXS - e.lineWidth
- },
- "&-title": {
- color: n,
- fontSize: e.fontSizeSM,
- lineHeight: e.lineHeightSM,
- fontWeight: "normal",
- marginBottom: e.marginXXS / 2
- },
- "&-description": {
- display: "none"
- },
- "&-tail": {
- marginInlineStart: 0,
- top: s + i / 2,
- transform: "translateY(-50%)",
- "&:after": {
- width: "100%",
- height: e.lineWidth,
- borderRadius: 0,
- marginInlineStart: 0,
- background: o
- }
- },
- [`&:first-child ${t}-item-tail`]: {
- width: "50%",
- marginInlineStart: "50%"
- },
- [`&:last-child ${t}-item-tail`]: {
- display: "block",
- width: "50%"
- },
- "&-wait": f({
- [`${t}-item-icon ${t}-icon ${t}-icon-dot`]: {
- backgroundColor: e.colorBorderBg,
- border: `${e.lineWidth}px ${e.lineType} ${o}`
- }
- }, c),
- "&-finish": f({
- [`${t}-item-tail::after`]: {
- backgroundColor: o
- },
- [`${t}-item-icon ${t}-icon ${t}-icon-dot`]: {
- backgroundColor: o,
- border: `${e.lineWidth}px ${e.lineType} ${o}`
- }
- }, c),
- "&-error": c,
- "&-active, &-process": f({
- [`${t}-item-icon`]: {
- width: i,
- height: i,
- marginInlineStart: `calc(50% - ${i / 2}px)`,
- top: 0
- }
- }, c),
- [`&:not(${t}-item-active) > ${t}-item-container[role='button']:hover`]: {
- [`${t}-item-title`]: {
- color: n
- }
- }
- }
- }
- };
- };
- var H;
- (function(e) {
- e.wait = "wait", e.process = "process", e.finish = "finish", e.error = "error";
- })(H || (H = {}));
- const R = (e, t) => {
- const i = `${t.componentCls}-item`, n = `${e}IconColor`, o = `${e}TitleColor`, s = `${e}DescriptionColor`, c = `${e}TailColor`, l = `${e}IconBgColor`, r = `${e}IconBorderColor`, u = `${e}DotColor`;
- return {
- [`${i}-${e} ${i}-icon`]: {
- backgroundColor: t[l],
- borderColor: t[r],
- [`> ${t.componentCls}-icon`]: {
- color: t[n],
- [`${t.componentCls}-icon-dot`]: {
- background: t[u]
- }
- }
- },
- [`${i}-${e}${i}-custom ${i}-icon`]: {
- [`> ${t.componentCls}-icon`]: {
- color: t[u]
- }
- },
- [`${i}-${e} > ${i}-container > ${i}-content > ${i}-title`]: {
- color: t[o],
- "&::after": {
- backgroundColor: t[c]
- }
- },
- [`${i}-${e} > ${i}-container > ${i}-content > ${i}-description`]: {
- color: t[s]
- },
- [`${i}-${e} > ${i}-container > ${i}-tail::after`]: {
- backgroundColor: t[c]
- }
- };
- }, ht = (e) => {
- const {
- componentCls: t,
- motionDurationSlow: i
- } = e, n = `${t}-item`;
- return f(f(f(f(f(f({
- [n]: {
- position: "relative",
- display: "inline-block",
- flex: 1,
- overflow: "hidden",
- verticalAlign: "top",
- "&:last-child": {
- flex: "none",
- [`> ${n}-container > ${n}-tail, > ${n}-container > ${n}-content > ${n}-title::after`]: {
- display: "none"
- }
- }
- },
- [`${n}-container`]: {
- outline: "none"
- },
- [`${n}-icon, ${n}-content`]: {
- display: "inline-block",
- verticalAlign: "top"
- },
- [`${n}-icon`]: {
- width: e.stepsIconSize,
- height: e.stepsIconSize,
- marginTop: 0,
- marginBottom: 0,
- marginInlineStart: 0,
- marginInlineEnd: e.marginXS,
- fontSize: e.stepsIconFontSize,
- fontFamily: e.fontFamily,
- lineHeight: `${e.stepsIconSize}px`,
- textAlign: "center",
- borderRadius: e.stepsIconSize,
- border: `${e.lineWidth}px ${e.lineType} transparent`,
- transition: `background-color ${i}, border-color ${i}`,
- [`${t}-icon`]: {
- position: "relative",
- top: e.stepsIconTop,
- color: e.colorPrimary,
- lineHeight: 1
- }
- },
- [`${n}-tail`]: {
- position: "absolute",
- top: e.stepsIconSize / 2 - e.paddingXXS,
- insetInlineStart: 0,
- width: "100%",
- "&::after": {
- display: "inline-block",
- width: "100%",
- height: e.lineWidth,
- background: e.colorSplit,
- borderRadius: e.lineWidth,
- transition: `background ${i}`,
- content: '""'
- }
- },
- [`${n}-title`]: {
- position: "relative",
- display: "inline-block",
- paddingInlineEnd: e.padding,
- color: e.colorText,
- fontSize: e.fontSizeLG,
- lineHeight: `${e.stepsTitleLineHeight}px`,
- "&::after": {
- position: "absolute",
- top: e.stepsTitleLineHeight / 2,
- insetInlineStart: "100%",
- display: "block",
- width: 9999,
- height: e.lineWidth,
- background: e.processTailColor,
- content: '""'
- }
- },
- [`${n}-subtitle`]: {
- display: "inline",
- marginInlineStart: e.marginXS,
- color: e.colorTextDescription,
- fontWeight: "normal",
- fontSize: e.fontSize
- },
- [`${n}-description`]: {
- color: e.colorTextDescription,
- fontSize: e.fontSize
- }
- }, R(H.wait, e)), R(H.process, e)), {
- [`${n}-process > ${n}-container > ${n}-title`]: {
- fontWeight: e.fontWeightStrong
- }
- }), R(H.finish, e)), R(H.error, e)), {
- [`${n}${t}-next-error > ${t}-item-title::after`]: {
- background: e.colorError
- },
- [`${n}-disabled`]: {
- cursor: "not-allowed"
- }
- });
- }, St = (e) => {
- const {
- componentCls: t,
- motionDurationSlow: i
- } = e;
- return {
- [`& ${t}-item`]: {
- [`&:not(${t}-item-active)`]: {
- [`& > ${t}-item-container[role='button']`]: {
- cursor: "pointer",
- [`${t}-item`]: {
- [`&-title, &-subtitle, &-description, &-icon ${t}-icon`]: {
- transition: `color ${i}`
- }
- },
- "&:hover": {
- [`${t}-item`]: {
- "&-title, &-subtitle, &-description": {
- color: e.colorPrimary
- }
- }
- }
- },
- [`&:not(${t}-item-process)`]: {
- [`& > ${t}-item-container[role='button']:hover`]: {
- [`${t}-item`]: {
- "&-icon": {
- borderColor: e.colorPrimary,
- [`${t}-icon`]: {
- color: e.colorPrimary
- }
- }
- }
- }
- }
- }
- },
- [`&${t}-horizontal:not(${t}-label-vertical)`]: {
- [`${t}-item`]: {
- paddingInlineStart: e.padding,
- whiteSpace: "nowrap",
- "&:first-child": {
- paddingInlineStart: 0
- },
- [`&:last-child ${t}-item-title`]: {
- paddingInlineEnd: 0
- },
- "&-tail": {
- display: "none"
- },
- "&-description": {
- maxWidth: e.descriptionWidth,
- whiteSpace: "normal"
- }
- }
- }
- };
- }, vt = (e) => {
- const {
- componentCls: t
- } = e;
- return {
- [t]: f(f(f(f(f(f(f(f(f(f(f(f(f({}, le(e)), {
- display: "flex",
- width: "100%",
- fontSize: 0,
- textAlign: "initial"
- }), ht(e)), St(e)), at(e)), mt(e)), ft(e)), ct(e)), ut(e)), dt(e)), gt(e)), pt(e)), $t(e))
- };
- }, bt = re("Steps", (e) => {
- const {
- wireframe: t,
- colorTextDisabled: i,
- fontSizeHeading3: n,
- fontSize: o,
- controlHeight: s,
- controlHeightLG: c,
- colorTextLightSolid: l,
- colorText: r,
- colorPrimary: u,
- colorTextLabel: m,
- colorTextDescription: g,
- colorTextQuaternary: S,
- colorFillContent: d,
- controlItemBgActive: $,
- colorError: a,
- colorBgContainer: C,
- colorBorderSecondary: I
- } = e, b = e.controlHeight, y = e.colorSplit, h = se(e, {
- // Steps variable default.less
- processTailColor: y,
- stepsNavArrowColor: i,
- stepsIconSize: b,
- stepsIconCustomSize: b,
- stepsIconCustomTop: 0,
- stepsIconCustomFontSize: c / 2,
- stepsIconTop: -0.5,
- stepsIconFontSize: o,
- stepsTitleLineHeight: s,
- stepsSmallIconSize: n,
- stepsDotSize: s / 4,
- stepsCurrentDotSize: c / 4,
- stepsNavContentMaxWidth: "auto",
- // Steps component less variable
- processIconColor: l,
- processTitleColor: r,
- processDescriptionColor: r,
- processIconBgColor: u,
- processIconBorderColor: u,
- processDotColor: u,
- waitIconColor: t ? i : m,
- waitTitleColor: g,
- waitDescriptionColor: g,
- waitTailColor: y,
- waitIconBgColor: t ? C : d,
- waitIconBorderColor: t ? i : "transparent",
- waitDotColor: i,
- finishIconColor: u,
- finishTitleColor: r,
- finishDescriptionColor: g,
- finishTailColor: u,
- finishIconBgColor: t ? C : $,
- finishIconBorderColor: t ? u : $,
- finishDotColor: u,
- errorIconColor: l,
- errorTitleColor: a,
- errorDescriptionColor: a,
- errorTailColor: y,
- errorIconBgColor: a,
- errorIconBorderColor: a,
- errorDotColor: a,
- stepsNavActiveColor: u,
- stepsProgressSize: c,
- // Steps inline variable
- inlineDotSize: 6,
- inlineTitleColor: S,
- inlineTailColor: I
- });
- return [vt(h)];
- }, {
- descriptionWidth: 140
- }), Ct = () => ({
- prefixCls: String,
- iconPrefix: String,
- current: Number,
- initial: Number,
- percent: Number,
- responsive: Z(),
- items: Te(),
- labelPlacement: T(),
- status: T(),
- size: T(),
- direction: T(),
- progressDot: Q([Boolean, Function]),
- type: T(),
- onChange: z(),
- "onUpdate:current": z()
- }), Y = O({
- compatConfig: {
- MODE: 3
- },
- name: "ASteps",
- inheritAttrs: !1,
- props: j(Ct(), {
- current: 0,
- responsive: !0,
- labelPlacement: "horizontal"
- }),
- slots: Object,
- // emits: ['update:current', 'change'],
- setup(e, t) {
- let {
- attrs: i,
- slots: n,
- emit: o
- } = t;
- const {
- prefixCls: s,
- direction: c,
- configProvider: l
- } = ae("steps", e), [r, u] = bt(s), [, m] = Pe(), g = De(), S = v(() => e.responsive && g.value.xs ? "vertical" : e.direction), d = v(() => l.getPrefixCls("", e.iconPrefix)), $ = (y) => {
- o("update:current", y), o("change", y);
- }, a = v(() => e.type === "inline"), C = v(() => a.value ? void 0 : e.percent), I = (y) => {
- let {
- node: h,
- status: w
- } = y;
- if (w === "process" && e.percent !== void 0) {
- const D = e.size === "small" ? m.value.controlHeight : m.value.controlHeightLG;
- return p("div", {
- class: `${s.value}-progress-icon`
- }, [p(ot, {
- type: "circle",
- percent: C.value,
- size: D,
- strokeWidth: 4,
- format: () => null
- }, null), h]);
- }
- return h;
- }, b = v(() => ({
- finish: p(de, {
- class: `${s.value}-finish-icon`
- }, null),
- error: p(ce, {
- class: `${s.value}-error-icon`
- }, null)
- }));
- return () => {
- const y = B({
- [`${s.value}-rtl`]: c.value === "rtl",
- [`${s.value}-with-progress`]: C.value !== void 0
- }, i.class, u.value), h = (w, D) => w.description ? p(oe, {
- title: w.description
- }, {
- default: () => [D]
- }) : D;
- return r(p(lt, P(P(P({
- icons: b.value
- }, i), pe(e, ["percent", "responsive"])), {}, {
- items: e.items,
- direction: S.value,
- prefixCls: s.value,
- iconPrefix: d.value,
- class: y,
- onChange: $,
- isInline: a.value,
- itemRender: a.value ? h : void 0
- }), f({
- stepIcon: I
- }, n)));
- };
- }
- }), U = O(f(f({
- compatConfig: {
- MODE: 3
- }
- }, fe), {
- name: "AStep",
- props: me()
- })), wt = f(Y, {
- Step: U,
- install: (e) => (e.component(Y.name, Y), e.component(U.name, U), e)
- });
- export {
- ot as P,
- U as S,
- wt as _
- };
|