SFormLayout.js 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564
  1. import { defineComponent as U, createVNode as p, computed as O, resolveComponent as j, createElementBlock as H, openBlock as x, withCtx as P, createCommentVNode as T, createElementVNode as D, toDisplayString as Z, renderSlot as R, Fragment as tt, renderList as et, createBlock as L, normalizeStyle as G, normalizeClass as at, createTextVNode as K } from "vue";
  2. import { O as nt, M as B, P as g, a9 as ct, Q as X, c as Q, _ as z, o as ot, a1 as dt, d as c, p as pt, t as mt, g as gt, m as ht, r as ut, i as ft, u as $t, aa as St, ab as bt, ac as yt, ad as vt, N as Ct, h as It, W as xt, k as wt, D as _t } from "./index2.js";
  3. import { S as Tt } from "./index11.js";
  4. import { P as zt } from "./index10.js";
  5. import { T as Ht, _ as Dt } from "./index12.js";
  6. function it(t) {
  7. return typeof t == "string";
  8. }
  9. function Bt() {
  10. }
  11. const rt = () => ({
  12. prefixCls: String,
  13. itemWidth: String,
  14. active: {
  15. type: Boolean,
  16. default: void 0
  17. },
  18. disabled: {
  19. type: Boolean,
  20. default: void 0
  21. },
  22. status: X(),
  23. iconPrefix: String,
  24. icon: g.any,
  25. adjustMarginRight: String,
  26. stepNumber: Number,
  27. stepIndex: Number,
  28. description: g.any,
  29. title: g.any,
  30. subTitle: g.any,
  31. progressDot: ct(g.oneOfType([g.looseBool, g.func])),
  32. tailContent: g.any,
  33. icons: g.shape({
  34. finish: g.any,
  35. error: g.any
  36. }).loose,
  37. onClick: B(),
  38. onStepClick: B(),
  39. stepIcon: B(),
  40. itemRender: B(),
  41. __legacy: nt()
  42. }), st = U({
  43. compatConfig: {
  44. MODE: 3
  45. },
  46. name: "Step",
  47. inheritAttrs: !1,
  48. props: rt(),
  49. setup(t, e) {
  50. let {
  51. slots: i,
  52. emit: n,
  53. attrs: o
  54. } = e;
  55. const r = (d) => {
  56. n("click", d), n("stepClick", t.stepIndex);
  57. }, u = (d) => {
  58. let {
  59. icon: s,
  60. title: a,
  61. description: f
  62. } = d;
  63. const {
  64. prefixCls: l,
  65. stepNumber: I,
  66. status: h,
  67. iconPrefix: y,
  68. icons: m,
  69. progressDot: $ = i.progressDot,
  70. stepIcon: _ = i.stepIcon
  71. } = t;
  72. let S;
  73. const v = Q(`${l}-icon`, `${y}icon`, {
  74. [`${y}icon-${s}`]: s && it(s),
  75. [`${y}icon-check`]: !s && h === "finish" && (m && !m.finish || !m),
  76. [`${y}icon-cross`]: !s && h === "error" && (m && !m.error || !m)
  77. }), b = p("span", {
  78. class: `${l}-icon-dot`
  79. }, null);
  80. return $ ? typeof $ == "function" ? S = p("span", {
  81. class: `${l}-icon`
  82. }, [$({
  83. iconDot: b,
  84. index: I - 1,
  85. status: h,
  86. title: a,
  87. description: f,
  88. prefixCls: l
  89. })]) : S = p("span", {
  90. class: `${l}-icon`
  91. }, [b]) : s && !it(s) ? S = p("span", {
  92. class: `${l}-icon`
  93. }, [s]) : m && m.finish && h === "finish" ? S = p("span", {
  94. class: `${l}-icon`
  95. }, [m.finish]) : m && m.error && h === "error" ? S = p("span", {
  96. class: `${l}-icon`
  97. }, [m.error]) : s || h === "finish" || h === "error" ? S = p("span", {
  98. class: v
  99. }, null) : S = p("span", {
  100. class: `${l}-icon`
  101. }, [I]), _ && (S = _({
  102. index: I - 1,
  103. status: h,
  104. title: a,
  105. description: f,
  106. node: S
  107. })), S;
  108. };
  109. return () => {
  110. var d, s, a, f;
  111. const {
  112. prefixCls: l,
  113. itemWidth: I,
  114. active: h,
  115. status: y = "wait",
  116. tailContent: m,
  117. adjustMarginRight: $,
  118. disabled: _,
  119. title: S = (d = i.title) === null || d === void 0 ? void 0 : d.call(i),
  120. description: v = (s = i.description) === null || s === void 0 ? void 0 : s.call(i),
  121. subTitle: b = (a = i.subTitle) === null || a === void 0 ? void 0 : a.call(i),
  122. icon: C = (f = i.icon) === null || f === void 0 ? void 0 : f.call(i),
  123. onClick: w,
  124. onStepClick: W
  125. } = t, A = y || "wait", q = Q(`${l}-item`, `${l}-item-${A}`, {
  126. [`${l}-item-custom`]: C,
  127. [`${l}-item-active`]: h,
  128. [`${l}-item-disabled`]: _ === !0
  129. }), N = {};
  130. I && (N.width = I), $ && (N.marginRight = $);
  131. const M = {
  132. onClick: w || Bt
  133. };
  134. W && !_ && (M.role = "button", M.tabindex = 0, M.onClick = r);
  135. const F = p("div", z(z({}, ot(o, ["__legacy"])), {}, {
  136. class: [q, o.class],
  137. style: [o.style, N]
  138. }), [p("div", z(z({}, M), {}, {
  139. class: `${l}-item-container`
  140. }), [p("div", {
  141. class: `${l}-item-tail`
  142. }, [m]), p("div", {
  143. class: `${l}-item-icon`
  144. }, [u({
  145. icon: C,
  146. title: S,
  147. description: v
  148. })]), p("div", {
  149. class: `${l}-item-content`
  150. }, [p("div", {
  151. class: `${l}-item-title`
  152. }, [S, b && p("div", {
  153. title: typeof b == "string" ? b : void 0,
  154. class: `${l}-item-subtitle`
  155. }, [b])]), v && p("div", {
  156. class: `${l}-item-description`
  157. }, [v])])])]);
  158. return t.itemRender ? t.itemRender(F) : F;
  159. };
  160. }
  161. });
  162. var Wt = function(t, e) {
  163. var i = {};
  164. for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
  165. if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
  166. e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
  167. return i;
  168. };
  169. const Pt = U({
  170. compatConfig: {
  171. MODE: 3
  172. },
  173. name: "Steps",
  174. props: {
  175. type: g.string.def("default"),
  176. prefixCls: g.string.def("vc-steps"),
  177. iconPrefix: g.string.def("vc"),
  178. direction: g.string.def("horizontal"),
  179. labelPlacement: g.string.def("horizontal"),
  180. status: X("process"),
  181. size: g.string.def(""),
  182. progressDot: g.oneOfType([g.looseBool, g.func]).def(void 0),
  183. initial: g.number.def(0),
  184. current: g.number.def(0),
  185. items: g.array.def(() => []),
  186. icons: g.shape({
  187. finish: g.any,
  188. error: g.any
  189. }).loose,
  190. stepIcon: B(),
  191. isInline: g.looseBool,
  192. itemRender: B()
  193. },
  194. emits: ["change"],
  195. setup(t, e) {
  196. let {
  197. slots: i,
  198. emit: n
  199. } = e;
  200. const o = (d) => {
  201. const {
  202. current: s
  203. } = t;
  204. s !== d && n("change", d);
  205. }, r = (d, s, a) => {
  206. const {
  207. prefixCls: f,
  208. iconPrefix: l,
  209. status: I,
  210. current: h,
  211. initial: y,
  212. icons: m,
  213. stepIcon: $ = i.stepIcon,
  214. isInline: _,
  215. itemRender: S,
  216. progressDot: v = i.progressDot
  217. } = t, b = _ || v, C = c(c({}, d), {
  218. class: ""
  219. }), w = y + s, W = {
  220. active: w === h,
  221. stepNumber: w + 1,
  222. stepIndex: w,
  223. key: w,
  224. prefixCls: f,
  225. iconPrefix: l,
  226. progressDot: b,
  227. stepIcon: $,
  228. icons: m,
  229. onStepClick: o
  230. };
  231. return I === "error" && s === h - 1 && (C.class = `${f}-next-error`), C.status || (w === h ? C.status = I : w < h ? C.status = "finish" : C.status = "wait"), _ && (C.icon = void 0, C.subTitle = void 0), a ? a(c(c({}, C), W)) : (S && (C.itemRender = (A) => S(C, A)), p(st, z(z(z({}, C), W), {}, {
  232. __legacy: !1
  233. }), null));
  234. }, u = (d, s) => r(c({}, d.props), s, (a) => pt(d, a));
  235. return () => {
  236. var d;
  237. const {
  238. prefixCls: s,
  239. direction: a,
  240. type: f,
  241. labelPlacement: l,
  242. iconPrefix: I,
  243. status: h,
  244. size: y,
  245. current: m,
  246. progressDot: $ = i.progressDot,
  247. initial: _,
  248. icons: S,
  249. items: v,
  250. isInline: b,
  251. itemRender: C
  252. } = t, w = Wt(t, ["prefixCls", "direction", "type", "labelPlacement", "iconPrefix", "status", "size", "current", "progressDot", "initial", "icons", "items", "isInline", "itemRender"]), W = f === "navigation", A = b || $, q = b ? "horizontal" : a, N = b ? void 0 : y, M = A ? "vertical" : l, F = Q(s, `${s}-${a}`, {
  253. [`${s}-${N}`]: N,
  254. [`${s}-label-${M}`]: q === "horizontal",
  255. [`${s}-dot`]: !!A,
  256. [`${s}-navigation`]: W,
  257. [`${s}-inline`]: b
  258. });
  259. return p("div", z({
  260. class: F
  261. }, w), [v.filter((J) => J).map((J, lt) => r(J, lt)), dt((d = i.default) === null || d === void 0 ? void 0 : d.call(i)).map(u)]);
  262. };
  263. }
  264. }), Xt = (t) => {
  265. const {
  266. componentCls: e,
  267. stepsIconCustomTop: i,
  268. stepsIconCustomSize: n,
  269. stepsIconCustomFontSize: o
  270. } = t;
  271. return {
  272. [`${e}-item-custom`]: {
  273. [`> ${e}-item-container > ${e}-item-icon`]: {
  274. height: "auto",
  275. background: "none",
  276. border: 0,
  277. [`> ${e}-icon`]: {
  278. top: i,
  279. width: n,
  280. height: n,
  281. fontSize: o,
  282. lineHeight: `${n}px`
  283. }
  284. }
  285. },
  286. // Only adjust horizontal customize icon width
  287. [`&:not(${e}-vertical)`]: {
  288. [`${e}-item-custom`]: {
  289. [`${e}-item-icon`]: {
  290. width: "auto",
  291. background: "none"
  292. }
  293. }
  294. }
  295. };
  296. }, At = (t) => {
  297. const {
  298. componentCls: e,
  299. stepsIconSize: i,
  300. lineHeight: n,
  301. stepsSmallIconSize: o
  302. } = t;
  303. return {
  304. [`&${e}-label-vertical`]: {
  305. [`${e}-item`]: {
  306. overflow: "visible",
  307. "&-tail": {
  308. marginInlineStart: i / 2 + t.controlHeightLG,
  309. padding: `${t.paddingXXS}px ${t.paddingLG}px`
  310. },
  311. "&-content": {
  312. display: "block",
  313. width: (i / 2 + t.controlHeightLG) * 2,
  314. marginTop: t.marginSM,
  315. textAlign: "center"
  316. },
  317. "&-icon": {
  318. display: "inline-block",
  319. marginInlineStart: t.controlHeightLG
  320. },
  321. "&-title": {
  322. paddingInlineEnd: 0,
  323. paddingInlineStart: 0,
  324. "&::after": {
  325. display: "none"
  326. }
  327. },
  328. "&-subtitle": {
  329. display: "block",
  330. marginBottom: t.marginXXS,
  331. marginInlineStart: 0,
  332. lineHeight: n
  333. }
  334. },
  335. [`&${e}-small:not(${e}-dot)`]: {
  336. [`${e}-item`]: {
  337. "&-icon": {
  338. marginInlineStart: t.controlHeightLG + (i - o) / 2
  339. }
  340. }
  341. }
  342. }
  343. };
  344. }, Nt = (t) => {
  345. const {
  346. componentCls: e,
  347. stepsNavContentMaxWidth: i,
  348. stepsNavArrowColor: n,
  349. stepsNavActiveColor: o,
  350. motionDurationSlow: r
  351. } = t;
  352. return {
  353. [`&${e}-navigation`]: {
  354. paddingTop: t.paddingSM,
  355. [`&${e}-small`]: {
  356. [`${e}-item`]: {
  357. "&-container": {
  358. marginInlineStart: -t.marginSM
  359. }
  360. }
  361. },
  362. [`${e}-item`]: {
  363. overflow: "visible",
  364. textAlign: "center",
  365. "&-container": {
  366. display: "inline-block",
  367. height: "100%",
  368. marginInlineStart: -t.margin,
  369. paddingBottom: t.paddingSM,
  370. textAlign: "start",
  371. transition: `opacity ${r}`,
  372. [`${e}-item-content`]: {
  373. maxWidth: i
  374. },
  375. [`${e}-item-title`]: c(c({
  376. maxWidth: "100%",
  377. paddingInlineEnd: 0
  378. }, mt), {
  379. "&::after": {
  380. display: "none"
  381. }
  382. })
  383. },
  384. [`&:not(${e}-item-active)`]: {
  385. [`${e}-item-container[role='button']`]: {
  386. cursor: "pointer",
  387. "&:hover": {
  388. opacity: 0.85
  389. }
  390. }
  391. },
  392. "&:last-child": {
  393. flex: 1,
  394. "&::after": {
  395. display: "none"
  396. }
  397. },
  398. "&::after": {
  399. position: "absolute",
  400. top: `calc(50% - ${t.paddingSM / 2}px)`,
  401. insetInlineStart: "100%",
  402. display: "inline-block",
  403. width: t.fontSizeIcon,
  404. height: t.fontSizeIcon,
  405. borderTop: `${t.lineWidth}px ${t.lineType} ${n}`,
  406. borderBottom: "none",
  407. borderInlineStart: "none",
  408. borderInlineEnd: `${t.lineWidth}px ${t.lineType} ${n}`,
  409. transform: "translateY(-50%) translateX(-50%) rotate(45deg)",
  410. content: '""'
  411. },
  412. "&::before": {
  413. position: "absolute",
  414. bottom: 0,
  415. insetInlineStart: "50%",
  416. display: "inline-block",
  417. width: 0,
  418. height: t.lineWidthBold,
  419. backgroundColor: o,
  420. transition: `width ${r}, inset-inline-start ${r}`,
  421. transitionTimingFunction: "ease-out",
  422. content: '""'
  423. }
  424. },
  425. [`${e}-item${e}-item-active::before`]: {
  426. insetInlineStart: 0,
  427. width: "100%"
  428. }
  429. },
  430. [`&${e}-navigation${e}-vertical`]: {
  431. [`> ${e}-item`]: {
  432. marginInlineEnd: 0,
  433. "&::before": {
  434. display: "none"
  435. },
  436. [`&${e}-item-active::before`]: {
  437. top: 0,
  438. insetInlineEnd: 0,
  439. insetInlineStart: "unset",
  440. display: "block",
  441. width: t.lineWidth * 3,
  442. height: `calc(100% - ${t.marginLG}px)`
  443. },
  444. "&::after": {
  445. position: "relative",
  446. insetInlineStart: "50%",
  447. display: "block",
  448. width: t.controlHeight * 0.25,
  449. height: t.controlHeight * 0.25,
  450. marginBottom: t.marginXS,
  451. textAlign: "center",
  452. transform: "translateY(-50%) translateX(-50%) rotate(135deg)"
  453. },
  454. [`> ${e}-item-container > ${e}-item-tail`]: {
  455. visibility: "hidden"
  456. }
  457. }
  458. },
  459. [`&${e}-navigation${e}-horizontal`]: {
  460. [`> ${e}-item > ${e}-item-container > ${e}-item-tail`]: {
  461. visibility: "hidden"
  462. }
  463. }
  464. };
  465. }, Mt = (t) => {
  466. const {
  467. antCls: e,
  468. componentCls: i
  469. } = t;
  470. return {
  471. [`&${i}-with-progress`]: {
  472. [`${i}-item`]: {
  473. paddingTop: t.paddingXXS,
  474. [`&-process ${i}-item-container ${i}-item-icon ${i}-icon`]: {
  475. color: t.processIconColor
  476. }
  477. },
  478. [`&${i}-vertical > ${i}-item `]: {
  479. paddingInlineStart: t.paddingXXS,
  480. [`> ${i}-item-container > ${i}-item-tail`]: {
  481. top: t.marginXXS,
  482. insetInlineStart: t.stepsIconSize / 2 - t.lineWidth + t.paddingXXS
  483. }
  484. },
  485. [`&, &${i}-small`]: {
  486. [`&${i}-horizontal ${i}-item:first-child`]: {
  487. paddingBottom: t.paddingXXS,
  488. paddingInlineStart: t.paddingXXS
  489. }
  490. },
  491. [`&${i}-small${i}-vertical > ${i}-item > ${i}-item-container > ${i}-item-tail`]: {
  492. insetInlineStart: t.stepsSmallIconSize / 2 - t.lineWidth + t.paddingXXS
  493. },
  494. [`&${i}-label-vertical`]: {
  495. [`${i}-item ${i}-item-tail`]: {
  496. top: t.margin - 2 * t.lineWidth
  497. }
  498. },
  499. [`${i}-item-icon`]: {
  500. position: "relative",
  501. [`${e}-progress`]: {
  502. position: "absolute",
  503. insetBlockStart: (t.stepsIconSize - t.stepsProgressSize - t.lineWidth * 2) / 2,
  504. insetInlineStart: (t.stepsIconSize - t.stepsProgressSize - t.lineWidth * 2) / 2
  505. }
  506. }
  507. }
  508. };
  509. }, Rt = (t) => {
  510. const {
  511. componentCls: e,
  512. descriptionWidth: i,
  513. lineHeight: n,
  514. stepsCurrentDotSize: o,
  515. stepsDotSize: r,
  516. motionDurationSlow: u
  517. } = t;
  518. return {
  519. [`&${e}-dot, &${e}-dot${e}-small`]: {
  520. [`${e}-item`]: {
  521. "&-title": {
  522. lineHeight: n
  523. },
  524. "&-tail": {
  525. top: Math.floor((t.stepsDotSize - t.lineWidth * 3) / 2),
  526. width: "100%",
  527. marginTop: 0,
  528. marginBottom: 0,
  529. marginInline: `${i / 2}px 0`,
  530. padding: 0,
  531. "&::after": {
  532. width: `calc(100% - ${t.marginSM * 2}px)`,
  533. height: t.lineWidth * 3,
  534. marginInlineStart: t.marginSM
  535. }
  536. },
  537. "&-icon": {
  538. width: r,
  539. height: r,
  540. marginInlineStart: (t.descriptionWidth - r) / 2,
  541. paddingInlineEnd: 0,
  542. lineHeight: `${r}px`,
  543. background: "transparent",
  544. border: 0,
  545. [`${e}-icon-dot`]: {
  546. position: "relative",
  547. float: "left",
  548. width: "100%",
  549. height: "100%",
  550. borderRadius: 100,
  551. transition: `all ${u}`,
  552. /* expand hover area */
  553. "&::after": {
  554. position: "absolute",
  555. top: -t.marginSM,
  556. insetInlineStart: (r - t.controlHeightLG * 1.5) / 2,
  557. width: t.controlHeightLG * 1.5,
  558. height: t.controlHeight,
  559. background: "transparent",
  560. content: '""'
  561. }
  562. }
  563. },
  564. "&-content": {
  565. width: i
  566. },
  567. [`&-process ${e}-item-icon`]: {
  568. position: "relative",
  569. top: (r - o) / 2,
  570. width: o,
  571. height: o,
  572. lineHeight: `${o}px`,
  573. background: "none",
  574. marginInlineStart: (t.descriptionWidth - o) / 2
  575. },
  576. [`&-process ${e}-icon`]: {
  577. [`&:first-child ${e}-icon-dot`]: {
  578. insetInlineStart: 0
  579. }
  580. }
  581. }
  582. },
  583. [`&${e}-vertical${e}-dot`]: {
  584. [`${e}-item-icon`]: {
  585. marginTop: (t.controlHeight - r) / 2,
  586. marginInlineStart: 0,
  587. background: "none"
  588. },
  589. [`${e}-item-process ${e}-item-icon`]: {
  590. marginTop: (t.controlHeight - o) / 2,
  591. top: 0,
  592. insetInlineStart: (r - o) / 2,
  593. marginInlineStart: 0
  594. },
  595. // https://github.com/ant-design/ant-design/issues/18354
  596. [`${e}-item > ${e}-item-container > ${e}-item-tail`]: {
  597. top: (t.controlHeight - r) / 2,
  598. insetInlineStart: 0,
  599. margin: 0,
  600. padding: `${r + t.paddingXS}px 0 ${t.paddingXS}px`,
  601. "&::after": {
  602. marginInlineStart: (r - t.lineWidth) / 2
  603. }
  604. },
  605. [`&${e}-small`]: {
  606. [`${e}-item-icon`]: {
  607. marginTop: (t.controlHeightSM - r) / 2
  608. },
  609. [`${e}-item-process ${e}-item-icon`]: {
  610. marginTop: (t.controlHeightSM - o) / 2
  611. },
  612. [`${e}-item > ${e}-item-container > ${e}-item-tail`]: {
  613. top: (t.controlHeightSM - r) / 2
  614. }
  615. },
  616. [`${e}-item:first-child ${e}-icon-dot`]: {
  617. insetInlineStart: 0
  618. },
  619. [`${e}-item-content`]: {
  620. width: "inherit"
  621. }
  622. }
  623. };
  624. }, Lt = (t) => {
  625. const {
  626. componentCls: e
  627. } = t;
  628. return {
  629. [`&${e}-rtl`]: {
  630. direction: "rtl",
  631. [`${e}-item`]: {
  632. "&-subtitle": {
  633. float: "left"
  634. }
  635. },
  636. // nav
  637. [`&${e}-navigation`]: {
  638. [`${e}-item::after`]: {
  639. transform: "rotate(-45deg)"
  640. }
  641. },
  642. // vertical
  643. [`&${e}-vertical`]: {
  644. [`> ${e}-item`]: {
  645. "&::after": {
  646. transform: "rotate(225deg)"
  647. },
  648. [`${e}-item-icon`]: {
  649. float: "right"
  650. }
  651. }
  652. },
  653. // progress-dot
  654. [`&${e}-dot`]: {
  655. [`${e}-item-icon ${e}-icon-dot, &${e}-small ${e}-item-icon ${e}-icon-dot`]: {
  656. float: "right"
  657. }
  658. }
  659. }
  660. };
  661. }, Et = (t) => {
  662. const {
  663. componentCls: e,
  664. stepsSmallIconSize: i,
  665. // stepsSmallIconMargin,
  666. fontSizeSM: n,
  667. fontSize: o,
  668. colorTextDescription: r
  669. } = t;
  670. return {
  671. [`&${e}-small`]: {
  672. [`&${e}-horizontal:not(${e}-label-vertical) ${e}-item`]: {
  673. paddingInlineStart: t.paddingSM,
  674. "&:first-child": {
  675. paddingInlineStart: 0
  676. }
  677. },
  678. [`${e}-item-icon`]: {
  679. width: i,
  680. height: i,
  681. // margin: stepsSmallIconMargin,
  682. marginTop: 0,
  683. marginBottom: 0,
  684. marginInline: `0 ${t.marginXS}px`,
  685. fontSize: n,
  686. lineHeight: `${i}px`,
  687. textAlign: "center",
  688. borderRadius: i
  689. },
  690. [`${e}-item-title`]: {
  691. paddingInlineEnd: t.paddingSM,
  692. fontSize: o,
  693. lineHeight: `${i}px`,
  694. "&::after": {
  695. top: i / 2
  696. }
  697. },
  698. [`${e}-item-description`]: {
  699. color: r,
  700. fontSize: o
  701. },
  702. [`${e}-item-tail`]: {
  703. top: i / 2 - t.paddingXXS
  704. },
  705. [`${e}-item-custom ${e}-item-icon`]: {
  706. width: "inherit",
  707. height: "inherit",
  708. lineHeight: "inherit",
  709. background: "none",
  710. border: 0,
  711. borderRadius: 0,
  712. [`> ${e}-icon`]: {
  713. fontSize: i,
  714. lineHeight: `${i}px`,
  715. transform: "none"
  716. }
  717. }
  718. }
  719. };
  720. }, Ot = (t) => {
  721. const {
  722. componentCls: e,
  723. stepsSmallIconSize: i,
  724. stepsIconSize: n
  725. } = t;
  726. return {
  727. [`&${e}-vertical`]: {
  728. display: "flex",
  729. flexDirection: "column",
  730. [`> ${e}-item`]: {
  731. display: "block",
  732. flex: "1 0 auto",
  733. paddingInlineStart: 0,
  734. overflow: "visible",
  735. [`${e}-item-icon`]: {
  736. float: "left",
  737. marginInlineEnd: t.margin
  738. },
  739. [`${e}-item-content`]: {
  740. display: "block",
  741. minHeight: t.controlHeight * 1.5,
  742. overflow: "hidden"
  743. },
  744. [`${e}-item-title`]: {
  745. lineHeight: `${n}px`
  746. },
  747. [`${e}-item-description`]: {
  748. paddingBottom: t.paddingSM
  749. }
  750. },
  751. [`> ${e}-item > ${e}-item-container > ${e}-item-tail`]: {
  752. position: "absolute",
  753. top: 0,
  754. insetInlineStart: t.stepsIconSize / 2 - t.lineWidth,
  755. width: t.lineWidth,
  756. height: "100%",
  757. padding: `${n + t.marginXXS * 1.5}px 0 ${t.marginXXS * 1.5}px`,
  758. "&::after": {
  759. width: t.lineWidth,
  760. height: "100%"
  761. }
  762. },
  763. [`> ${e}-item:not(:last-child) > ${e}-item-container > ${e}-item-tail`]: {
  764. display: "block"
  765. },
  766. [` > ${e}-item > ${e}-item-container > ${e}-item-content > ${e}-item-title`]: {
  767. "&::after": {
  768. display: "none"
  769. }
  770. },
  771. [`&${e}-small ${e}-item-container`]: {
  772. [`${e}-item-tail`]: {
  773. position: "absolute",
  774. top: 0,
  775. insetInlineStart: t.stepsSmallIconSize / 2 - t.lineWidth,
  776. padding: `${i + t.marginXXS * 1.5}px 0 ${t.marginXXS * 1.5}px`
  777. },
  778. [`${e}-item-title`]: {
  779. lineHeight: `${i}px`
  780. }
  781. }
  782. }
  783. };
  784. }, Ft = (t) => {
  785. const {
  786. componentCls: e,
  787. inlineDotSize: i,
  788. inlineTitleColor: n,
  789. inlineTailColor: o
  790. } = t, r = t.paddingXS + t.lineWidth, u = {
  791. [`${e}-item-container ${e}-item-content ${e}-item-title`]: {
  792. color: n
  793. }
  794. };
  795. return {
  796. [`&${e}-inline`]: {
  797. width: "auto",
  798. display: "inline-flex",
  799. [`${e}-item`]: {
  800. flex: "none",
  801. "&-container": {
  802. padding: `${r}px ${t.paddingXXS}px 0`,
  803. margin: `0 ${t.marginXXS / 2}px`,
  804. borderRadius: t.borderRadiusSM,
  805. cursor: "pointer",
  806. transition: `background-color ${t.motionDurationMid}`,
  807. "&:hover": {
  808. background: t.controlItemBgHover
  809. },
  810. "&[role='button']:hover": {
  811. opacity: 1
  812. }
  813. },
  814. "&-icon": {
  815. width: i,
  816. height: i,
  817. marginInlineStart: `calc(50% - ${i / 2}px)`,
  818. [`> ${e}-icon`]: {
  819. top: 0
  820. },
  821. [`${e}-icon-dot`]: {
  822. borderRadius: t.fontSizeSM / 4
  823. }
  824. },
  825. "&-content": {
  826. width: "auto",
  827. marginTop: t.marginXS - t.lineWidth
  828. },
  829. "&-title": {
  830. color: n,
  831. fontSize: t.fontSizeSM,
  832. lineHeight: t.lineHeightSM,
  833. fontWeight: "normal",
  834. marginBottom: t.marginXXS / 2
  835. },
  836. "&-description": {
  837. display: "none"
  838. },
  839. "&-tail": {
  840. marginInlineStart: 0,
  841. top: r + i / 2,
  842. transform: "translateY(-50%)",
  843. "&:after": {
  844. width: "100%",
  845. height: t.lineWidth,
  846. borderRadius: 0,
  847. marginInlineStart: 0,
  848. background: o
  849. }
  850. },
  851. [`&:first-child ${e}-item-tail`]: {
  852. width: "50%",
  853. marginInlineStart: "50%"
  854. },
  855. [`&:last-child ${e}-item-tail`]: {
  856. display: "block",
  857. width: "50%"
  858. },
  859. "&-wait": c({
  860. [`${e}-item-icon ${e}-icon ${e}-icon-dot`]: {
  861. backgroundColor: t.colorBorderBg,
  862. border: `${t.lineWidth}px ${t.lineType} ${o}`
  863. }
  864. }, u),
  865. "&-finish": c({
  866. [`${e}-item-tail::after`]: {
  867. backgroundColor: o
  868. },
  869. [`${e}-item-icon ${e}-icon ${e}-icon-dot`]: {
  870. backgroundColor: o,
  871. border: `${t.lineWidth}px ${t.lineType} ${o}`
  872. }
  873. }, u),
  874. "&-error": u,
  875. "&-active, &-process": c({
  876. [`${e}-item-icon`]: {
  877. width: i,
  878. height: i,
  879. marginInlineStart: `calc(50% - ${i / 2}px)`,
  880. top: 0
  881. }
  882. }, u),
  883. [`&:not(${e}-item-active) > ${e}-item-container[role='button']:hover`]: {
  884. [`${e}-item-title`]: {
  885. color: n
  886. }
  887. }
  888. }
  889. }
  890. };
  891. };
  892. var E;
  893. (function(t) {
  894. t.wait = "wait", t.process = "process", t.finish = "finish", t.error = "error";
  895. })(E || (E = {}));
  896. const V = (t, e) => {
  897. const i = `${e.componentCls}-item`, n = `${t}IconColor`, o = `${t}TitleColor`, r = `${t}DescriptionColor`, u = `${t}TailColor`, d = `${t}IconBgColor`, s = `${t}IconBorderColor`, a = `${t}DotColor`;
  898. return {
  899. [`${i}-${t} ${i}-icon`]: {
  900. backgroundColor: e[d],
  901. borderColor: e[s],
  902. [`> ${e.componentCls}-icon`]: {
  903. color: e[n],
  904. [`${e.componentCls}-icon-dot`]: {
  905. background: e[a]
  906. }
  907. }
  908. },
  909. [`${i}-${t}${i}-custom ${i}-icon`]: {
  910. [`> ${e.componentCls}-icon`]: {
  911. color: e[a]
  912. }
  913. },
  914. [`${i}-${t} > ${i}-container > ${i}-content > ${i}-title`]: {
  915. color: e[o],
  916. "&::after": {
  917. backgroundColor: e[u]
  918. }
  919. },
  920. [`${i}-${t} > ${i}-container > ${i}-content > ${i}-description`]: {
  921. color: e[r]
  922. },
  923. [`${i}-${t} > ${i}-container > ${i}-tail::after`]: {
  924. backgroundColor: e[u]
  925. }
  926. };
  927. }, jt = (t) => {
  928. const {
  929. componentCls: e,
  930. motionDurationSlow: i
  931. } = t, n = `${e}-item`;
  932. return c(c(c(c(c(c({
  933. [n]: {
  934. position: "relative",
  935. display: "inline-block",
  936. flex: 1,
  937. overflow: "hidden",
  938. verticalAlign: "top",
  939. "&:last-child": {
  940. flex: "none",
  941. [`> ${n}-container > ${n}-tail, > ${n}-container > ${n}-content > ${n}-title::after`]: {
  942. display: "none"
  943. }
  944. }
  945. },
  946. [`${n}-container`]: {
  947. outline: "none"
  948. },
  949. [`${n}-icon, ${n}-content`]: {
  950. display: "inline-block",
  951. verticalAlign: "top"
  952. },
  953. [`${n}-icon`]: {
  954. width: t.stepsIconSize,
  955. height: t.stepsIconSize,
  956. marginTop: 0,
  957. marginBottom: 0,
  958. marginInlineStart: 0,
  959. marginInlineEnd: t.marginXS,
  960. fontSize: t.stepsIconFontSize,
  961. fontFamily: t.fontFamily,
  962. lineHeight: `${t.stepsIconSize}px`,
  963. textAlign: "center",
  964. borderRadius: t.stepsIconSize,
  965. border: `${t.lineWidth}px ${t.lineType} transparent`,
  966. transition: `background-color ${i}, border-color ${i}`,
  967. [`${e}-icon`]: {
  968. position: "relative",
  969. top: t.stepsIconTop,
  970. color: t.colorPrimary,
  971. lineHeight: 1
  972. }
  973. },
  974. [`${n}-tail`]: {
  975. position: "absolute",
  976. top: t.stepsIconSize / 2 - t.paddingXXS,
  977. insetInlineStart: 0,
  978. width: "100%",
  979. "&::after": {
  980. display: "inline-block",
  981. width: "100%",
  982. height: t.lineWidth,
  983. background: t.colorSplit,
  984. borderRadius: t.lineWidth,
  985. transition: `background ${i}`,
  986. content: '""'
  987. }
  988. },
  989. [`${n}-title`]: {
  990. position: "relative",
  991. display: "inline-block",
  992. paddingInlineEnd: t.padding,
  993. color: t.colorText,
  994. fontSize: t.fontSizeLG,
  995. lineHeight: `${t.stepsTitleLineHeight}px`,
  996. "&::after": {
  997. position: "absolute",
  998. top: t.stepsTitleLineHeight / 2,
  999. insetInlineStart: "100%",
  1000. display: "block",
  1001. width: 9999,
  1002. height: t.lineWidth,
  1003. background: t.processTailColor,
  1004. content: '""'
  1005. }
  1006. },
  1007. [`${n}-subtitle`]: {
  1008. display: "inline",
  1009. marginInlineStart: t.marginXS,
  1010. color: t.colorTextDescription,
  1011. fontWeight: "normal",
  1012. fontSize: t.fontSize
  1013. },
  1014. [`${n}-description`]: {
  1015. color: t.colorTextDescription,
  1016. fontSize: t.fontSize
  1017. }
  1018. }, V(E.wait, t)), V(E.process, t)), {
  1019. [`${n}-process > ${n}-container > ${n}-title`]: {
  1020. fontWeight: t.fontWeightStrong
  1021. }
  1022. }), V(E.finish, t)), V(E.error, t)), {
  1023. [`${n}${e}-next-error > ${e}-item-title::after`]: {
  1024. background: t.colorError
  1025. },
  1026. [`${n}-disabled`]: {
  1027. cursor: "not-allowed"
  1028. }
  1029. });
  1030. }, Gt = (t) => {
  1031. const {
  1032. componentCls: e,
  1033. motionDurationSlow: i
  1034. } = t;
  1035. return {
  1036. [`& ${e}-item`]: {
  1037. [`&:not(${e}-item-active)`]: {
  1038. [`& > ${e}-item-container[role='button']`]: {
  1039. cursor: "pointer",
  1040. [`${e}-item`]: {
  1041. [`&-title, &-subtitle, &-description, &-icon ${e}-icon`]: {
  1042. transition: `color ${i}`
  1043. }
  1044. },
  1045. "&:hover": {
  1046. [`${e}-item`]: {
  1047. "&-title, &-subtitle, &-description": {
  1048. color: t.colorPrimary
  1049. }
  1050. }
  1051. }
  1052. },
  1053. [`&:not(${e}-item-process)`]: {
  1054. [`& > ${e}-item-container[role='button']:hover`]: {
  1055. [`${e}-item`]: {
  1056. "&-icon": {
  1057. borderColor: t.colorPrimary,
  1058. [`${e}-icon`]: {
  1059. color: t.colorPrimary
  1060. }
  1061. }
  1062. }
  1063. }
  1064. }
  1065. }
  1066. },
  1067. [`&${e}-horizontal:not(${e}-label-vertical)`]: {
  1068. [`${e}-item`]: {
  1069. paddingInlineStart: t.padding,
  1070. whiteSpace: "nowrap",
  1071. "&:first-child": {
  1072. paddingInlineStart: 0
  1073. },
  1074. [`&:last-child ${e}-item-title`]: {
  1075. paddingInlineEnd: 0
  1076. },
  1077. "&-tail": {
  1078. display: "none"
  1079. },
  1080. "&-description": {
  1081. maxWidth: t.descriptionWidth,
  1082. whiteSpace: "normal"
  1083. }
  1084. }
  1085. }
  1086. };
  1087. }, Kt = (t) => {
  1088. const {
  1089. componentCls: e
  1090. } = t;
  1091. return {
  1092. [e]: c(c(c(c(c(c(c(c(c(c(c(c(c({}, ut(t)), {
  1093. display: "flex",
  1094. width: "100%",
  1095. fontSize: 0,
  1096. textAlign: "initial"
  1097. }), jt(t)), Gt(t)), Xt(t)), Et(t)), Ot(t)), At(t)), Rt(t)), Nt(t)), Lt(t)), Mt(t)), Ft(t))
  1098. };
  1099. }, Vt = gt("Steps", (t) => {
  1100. const {
  1101. wireframe: e,
  1102. colorTextDisabled: i,
  1103. fontSizeHeading3: n,
  1104. fontSize: o,
  1105. controlHeight: r,
  1106. controlHeightLG: u,
  1107. colorTextLightSolid: d,
  1108. colorText: s,
  1109. colorPrimary: a,
  1110. colorTextLabel: f,
  1111. colorTextDescription: l,
  1112. colorTextQuaternary: I,
  1113. colorFillContent: h,
  1114. controlItemBgActive: y,
  1115. colorError: m,
  1116. colorBgContainer: $,
  1117. colorBorderSecondary: _
  1118. } = t, S = t.controlHeight, v = t.colorSplit, b = ht(t, {
  1119. // Steps variable default.less
  1120. processTailColor: v,
  1121. stepsNavArrowColor: i,
  1122. stepsIconSize: S,
  1123. stepsIconCustomSize: S,
  1124. stepsIconCustomTop: 0,
  1125. stepsIconCustomFontSize: u / 2,
  1126. stepsIconTop: -0.5,
  1127. stepsIconFontSize: o,
  1128. stepsTitleLineHeight: r,
  1129. stepsSmallIconSize: n,
  1130. stepsDotSize: r / 4,
  1131. stepsCurrentDotSize: u / 4,
  1132. stepsNavContentMaxWidth: "auto",
  1133. // Steps component less variable
  1134. processIconColor: d,
  1135. processTitleColor: s,
  1136. processDescriptionColor: s,
  1137. processIconBgColor: a,
  1138. processIconBorderColor: a,
  1139. processDotColor: a,
  1140. waitIconColor: e ? i : f,
  1141. waitTitleColor: l,
  1142. waitDescriptionColor: l,
  1143. waitTailColor: v,
  1144. waitIconBgColor: e ? $ : h,
  1145. waitIconBorderColor: e ? i : "transparent",
  1146. waitDotColor: i,
  1147. finishIconColor: a,
  1148. finishTitleColor: s,
  1149. finishDescriptionColor: l,
  1150. finishTailColor: a,
  1151. finishIconBgColor: e ? $ : y,
  1152. finishIconBorderColor: e ? a : y,
  1153. finishDotColor: a,
  1154. errorIconColor: d,
  1155. errorTitleColor: m,
  1156. errorDescriptionColor: m,
  1157. errorTailColor: v,
  1158. errorIconBgColor: m,
  1159. errorIconBorderColor: m,
  1160. errorDotColor: m,
  1161. stepsNavActiveColor: a,
  1162. stepsProgressSize: u,
  1163. // Steps inline variable
  1164. inlineDotSize: 6,
  1165. inlineTitleColor: I,
  1166. inlineTailColor: _
  1167. });
  1168. return [Kt(b)];
  1169. }, {
  1170. descriptionWidth: 140
  1171. }), Yt = () => ({
  1172. prefixCls: String,
  1173. iconPrefix: String,
  1174. current: Number,
  1175. initial: Number,
  1176. percent: Number,
  1177. responsive: nt(),
  1178. items: It(),
  1179. labelPlacement: X(),
  1180. status: X(),
  1181. size: X(),
  1182. direction: X(),
  1183. progressDot: Ct([Boolean, Function]),
  1184. type: X(),
  1185. onChange: B(),
  1186. "onUpdate:current": B()
  1187. }), k = U({
  1188. compatConfig: {
  1189. MODE: 3
  1190. },
  1191. name: "ASteps",
  1192. inheritAttrs: !1,
  1193. props: ft(Yt(), {
  1194. current: 0,
  1195. responsive: !0,
  1196. labelPlacement: "horizontal"
  1197. }),
  1198. slots: Object,
  1199. // emits: ['update:current', 'change'],
  1200. setup(t, e) {
  1201. let {
  1202. attrs: i,
  1203. slots: n,
  1204. emit: o
  1205. } = e;
  1206. const {
  1207. prefixCls: r,
  1208. direction: u,
  1209. configProvider: d
  1210. } = $t("steps", t), [s, a] = Vt(r), [, f] = St(), l = bt(), I = O(() => t.responsive && l.value.xs ? "vertical" : t.direction), h = O(() => d.getPrefixCls("", t.iconPrefix)), y = (v) => {
  1211. o("update:current", v), o("change", v);
  1212. }, m = O(() => t.type === "inline"), $ = O(() => m.value ? void 0 : t.percent), _ = (v) => {
  1213. let {
  1214. node: b,
  1215. status: C
  1216. } = v;
  1217. if (C === "process" && t.percent !== void 0) {
  1218. const w = t.size === "small" ? f.value.controlHeight : f.value.controlHeightLG;
  1219. return p("div", {
  1220. class: `${r.value}-progress-icon`
  1221. }, [p(zt, {
  1222. type: "circle",
  1223. percent: $.value,
  1224. size: w,
  1225. strokeWidth: 4,
  1226. format: () => null
  1227. }, null), b]);
  1228. }
  1229. return b;
  1230. }, S = O(() => ({
  1231. finish: p(vt, {
  1232. class: `${r.value}-finish-icon`
  1233. }, null),
  1234. error: p(yt, {
  1235. class: `${r.value}-error-icon`
  1236. }, null)
  1237. }));
  1238. return () => {
  1239. const v = Q({
  1240. [`${r.value}-rtl`]: u.value === "rtl",
  1241. [`${r.value}-with-progress`]: $.value !== void 0
  1242. }, i.class, a.value), b = (C, w) => C.description ? p(xt, {
  1243. title: C.description
  1244. }, {
  1245. default: () => [w]
  1246. }) : w;
  1247. return s(p(Pt, z(z(z({
  1248. icons: S.value
  1249. }, i), ot(t, ["percent", "responsive"])), {}, {
  1250. items: t.items,
  1251. direction: I.value,
  1252. prefixCls: r.value,
  1253. iconPrefix: h.value,
  1254. class: v,
  1255. onChange: y,
  1256. isInline: m.value,
  1257. itemRender: m.value ? b : void 0
  1258. }), c({
  1259. stepIcon: _
  1260. }, n)));
  1261. };
  1262. }
  1263. }), Y = U(c(c({
  1264. compatConfig: {
  1265. MODE: 3
  1266. }
  1267. }, st), {
  1268. name: "AStep",
  1269. props: rt()
  1270. })), Qt = c(k, {
  1271. Step: Y,
  1272. install: (t) => (t.component(k.name, k), t.component(Y.name, Y), t)
  1273. }), Ut = {
  1274. name: "SFormLayout",
  1275. components: {},
  1276. data() {
  1277. return {
  1278. layoutHeight: 0,
  1279. footerWitdh: 0,
  1280. form: {},
  1281. stepActive: 0,
  1282. tabsActive: ""
  1283. };
  1284. },
  1285. props: {
  1286. showAnchor: {
  1287. type: Boolean,
  1288. default: !1
  1289. },
  1290. loading: {
  1291. type: Boolean,
  1292. default: !1
  1293. },
  1294. // 页面标题
  1295. title: {
  1296. type: String,
  1297. required: !0
  1298. },
  1299. subTitle: {
  1300. type: String,
  1301. default: ""
  1302. },
  1303. showBtnIcon: {
  1304. type: Boolean,
  1305. default: !0
  1306. },
  1307. steps: {
  1308. type: Array,
  1309. default() {
  1310. return [];
  1311. }
  1312. },
  1313. stepDefaultActive: {
  1314. type: Number,
  1315. default: 0
  1316. },
  1317. stepValid: {
  1318. type: Function,
  1319. default: void 0
  1320. },
  1321. tabs: {
  1322. type: Array,
  1323. default() {
  1324. return [];
  1325. }
  1326. },
  1327. tabKey: {
  1328. type: Object,
  1329. default() {
  1330. return {
  1331. label: "label",
  1332. value: "value"
  1333. };
  1334. }
  1335. },
  1336. formStyle: {
  1337. type: Object,
  1338. default() {
  1339. return {};
  1340. }
  1341. },
  1342. goBack: {
  1343. type: Boolean,
  1344. default: !0
  1345. },
  1346. isShowSave: {
  1347. type: Boolean,
  1348. default: !0
  1349. },
  1350. saveBtnText: {
  1351. type: String,
  1352. default: "保存"
  1353. }
  1354. },
  1355. methods: {
  1356. initStyle() {
  1357. this.$nextTick(() => {
  1358. var r, u, d, s, a, f, l, I, h, y;
  1359. const t = ((u = (r = this.$refs) == null ? void 0 : r.step) == null ? void 0 : u.offsetHeight) || 0, e = ((s = (d = this.$refs) == null ? void 0 : d.tabs) == null ? void 0 : s.offsetHeight) || 0, i = ((f = (a = this.$refs) == null ? void 0 : a.footer) == null ? void 0 : f.offsetHeight) || 0, n = ((I = (l = this.$refs) == null ? void 0 : l.tools) == null ? void 0 : I.offsetHeight) || 0;
  1360. this.layoutHeight = ((h = this.$refs.layout) == null ? void 0 : h.offsetHeight) - i - (t > 0 ? t + 16 : 0) - e - n + "px";
  1361. const o = !this.$slots.collapses || this.$slots.collapses && !this.showAnchor ? 0 : 220;
  1362. this.footerWitdh = ((y = this.$refs.formMain) == null ? void 0 : y.offsetWidth) - o + "px";
  1363. });
  1364. },
  1365. isFunction(t) {
  1366. return this[t] && typeof this[t] == "function" ? !0 : (this.$notification.error({
  1367. key: "only-you",
  1368. message: "未绑定接口Api方法, 无法操作"
  1369. }), !1);
  1370. },
  1371. rollback() {
  1372. this.$emit("footer-callback", "cancel");
  1373. },
  1374. handPrev() {
  1375. this.stepActive--, this.$emit("footer-callback", "prev", this.stepActive);
  1376. },
  1377. handNext() {
  1378. if (!this.$utils.isFunction(this.stepValid)) {
  1379. this.stepActive++, this.$emit("footer-callback", "next", this.stepActive);
  1380. return;
  1381. }
  1382. this.stepValid(this.stepActive).then((t) => {
  1383. t && (this.stepActive++, this.$emit("footer-callback", "next", this.stepActive));
  1384. });
  1385. },
  1386. save() {
  1387. this.$emit("footer-callback", "save");
  1388. },
  1389. handTabChange(t) {
  1390. const e = this.tabs.find((i) => i[this.tabKey.value] === t);
  1391. this.$emit("tabsChange", e);
  1392. }
  1393. },
  1394. created() {
  1395. },
  1396. mounted() {
  1397. this.initStyle(), this.stepActive = this.stepDefaultActive;
  1398. }
  1399. }, qt = {
  1400. class: "form-layout",
  1401. ref: "layout"
  1402. }, Jt = {
  1403. key: 0,
  1404. class: "tools",
  1405. ref: "tools"
  1406. }, Zt = { class: "row" }, kt = { class: "title" }, te = { class: "btns" }, ee = {
  1407. key: 0,
  1408. class: "row sub-title-wrap",
  1409. ref: "subTitle"
  1410. }, ie = { class: "sub-title" }, ne = {
  1411. key: 1,
  1412. class: "step-wrap",
  1413. ref: "step"
  1414. }, oe = {
  1415. key: 2,
  1416. class: "tabs-wrap",
  1417. ref: "tabs"
  1418. }, re = {
  1419. key: 1,
  1420. class: "collapses-content-wrap"
  1421. }, se = {
  1422. key: 0,
  1423. class: "collapses-nav"
  1424. }, le = { class: "modal" };
  1425. function ae(t, e, i, n, o, r) {
  1426. const u = Y, d = Qt, s = Dt, a = Ht, f = j("close-outlined"), l = _t, I = j("arrow-left-outlined"), h = j("arrow-right-outlined"), y = j("save-outlined"), m = Tt;
  1427. return x(), H("div", qt, [
  1428. p(m, { spinning: i.loading }, {
  1429. default: P(() => [
  1430. i.title || i.subTitle || t.$slots.otherBtns ? (x(), H("div", Jt, [
  1431. D("div", Zt, [
  1432. D("div", kt, [
  1433. D("span", null, Z(i.title), 1)
  1434. ]),
  1435. D("div", te, [
  1436. R(t.$slots, "otherBtns", {}, void 0, !0)
  1437. ])
  1438. ]),
  1439. i.subTitle ? (x(), H("div", ee, [
  1440. D("div", ie, Z(i.subTitle), 1)
  1441. ], 512)) : T("", !0)
  1442. ], 512)) : T("", !0),
  1443. i.steps && i.steps.length ? (x(), H("div", ne, [
  1444. p(d, {
  1445. current: o.stepActive,
  1446. type: "navigation",
  1447. size: "small"
  1448. }, {
  1449. default: P(() => [
  1450. (x(!0), H(tt, null, et(i.steps, ($) => (x(), L(u, {
  1451. title: $,
  1452. key: $,
  1453. disabled: ""
  1454. }, null, 8, ["title"]))), 128))
  1455. ]),
  1456. _: 1
  1457. }, 8, ["current"])
  1458. ], 512)) : T("", !0),
  1459. i.tabs && i.tabs.length ? (x(), H("div", oe, [
  1460. p(a, {
  1461. "default-active-key": "1",
  1462. onChange: r.handTabChange
  1463. }, {
  1464. default: P(() => [
  1465. (x(!0), H(tt, null, et(i.tabs, ($) => (x(), L(s, {
  1466. tab: $[i.tabKey.label],
  1467. key: $[i.tabKey.value]
  1468. }, null, 8, ["tab"]))), 128))
  1469. ]),
  1470. _: 1
  1471. }, 8, ["onChange"])
  1472. ], 512)) : T("", !0),
  1473. D("div", {
  1474. class: at(["form-layout-main", { whiteBg: !!t.$slots.form }]),
  1475. id: "form-container",
  1476. ref: "formMain",
  1477. style: G({ height: o.layoutHeight })
  1478. }, [
  1479. t.$slots.form ? (x(), H("div", {
  1480. key: 0,
  1481. class: "form-container-wrap",
  1482. style: G(i.formStyle)
  1483. }, [
  1484. R(t.$slots, "form", {}, void 0, !0)
  1485. ], 4)) : T("", !0),
  1486. t.$slots.collapses ? (x(), H("div", re, [
  1487. D("div", {
  1488. class: "collapese-container",
  1489. style: G({ width: i.showAnchor ? "calc(100% - 220px)" : "100%" })
  1490. }, [
  1491. R(t.$slots, "collapses", {}, void 0, !0)
  1492. ], 4),
  1493. i.showAnchor && t.$slots.anchor ? (x(), H("div", se, [
  1494. R(t.$slots, "anchor", {}, void 0, !0)
  1495. ])) : T("", !0)
  1496. ])) : T("", !0)
  1497. ], 6),
  1498. D("div", le, [
  1499. R(t.$slots, "other", {}, void 0, !0)
  1500. ]),
  1501. D("div", {
  1502. class: "form-fixed-footer",
  1503. ref: "footer",
  1504. style: G({ width: o.footerWitdh })
  1505. }, [
  1506. i.goBack ? (x(), L(l, {
  1507. key: 0,
  1508. onClick: r.rollback,
  1509. class: "btn"
  1510. }, {
  1511. default: P(() => [
  1512. p(f),
  1513. e[0] || (e[0] = K("取消 "))
  1514. ]),
  1515. _: 1
  1516. }, 8, ["onClick"])) : T("", !0),
  1517. i.steps.length ? (x(), L(l, {
  1518. key: 1,
  1519. class: "btn",
  1520. disabled: o.stepActive === this.stepDefaultActive,
  1521. onClick: r.handPrev
  1522. }, {
  1523. default: P(() => [
  1524. p(I),
  1525. e[1] || (e[1] = K("上一步 "))
  1526. ]),
  1527. _: 1
  1528. }, 8, ["disabled", "onClick"])) : T("", !0),
  1529. i.steps.length ? (x(), L(l, {
  1530. key: 2,
  1531. class: "btn",
  1532. type: "primary",
  1533. disabled: o.stepActive === this.steps.length - 1,
  1534. onClick: r.handNext
  1535. }, {
  1536. default: P(() => [
  1537. p(h),
  1538. e[2] || (e[2] = K("下一步 "))
  1539. ]),
  1540. _: 1
  1541. }, 8, ["disabled", "onClick"])) : T("", !0),
  1542. i.isShowSave ? (x(), L(l, {
  1543. key: 3,
  1544. style: { "margin-right": "8px" },
  1545. type: "primary",
  1546. onClick: r.save
  1547. }, {
  1548. default: P(() => [
  1549. p(y),
  1550. K(" " + Z(i.saveBtnText), 1)
  1551. ]),
  1552. _: 1
  1553. }, 8, ["onClick"])) : T("", !0),
  1554. R(t.$slots, "footer", {}, void 0, !0)
  1555. ], 4)
  1556. ]),
  1557. _: 3
  1558. }, 8, ["spinning"])
  1559. ], 512);
  1560. }
  1561. const he = /* @__PURE__ */ wt(Ut, [["render", ae], ["__scopeId", "data-v-a58915bf"]]);
  1562. export {
  1563. he as default
  1564. };