SFormLayout.js 42 KB

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