SFormLayout.js 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562
  1. import { defineComponent as Y, createVNode as p, computed as O, resolveComponent as j, openBlock as x, createElementBlock as H, 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, normalizeStyle as G, 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 "./index6.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: I,
  64. status: h,
  65. iconPrefix: y,
  66. icons: m,
  67. progressDot: $ = i.progressDot,
  68. stepIcon: _ = i.stepIcon
  69. } = t;
  70. let S;
  71. const v = U(`${l}-icon`, `${y}icon`, {
  72. [`${y}icon-${s}`]: s && it(s),
  73. [`${y}icon-check`]: !s && h === "finish" && (m && !m.finish || !m),
  74. [`${y}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: I - 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: v
  97. }, null) : S = p("span", {
  98. class: `${l}-icon`
  99. }, [I]), _ && (S = _({
  100. index: I - 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: I,
  112. active: h,
  113. status: y = "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: v = (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: C = (f = i.icon) === null || f === void 0 ? void 0 : f.call(i),
  121. onClick: w,
  122. onStepClick: W
  123. } = t, A = y || "wait", Q = U(`${l}-item`, `${l}-item-${A}`, {
  124. [`${l}-item-custom`]: C,
  125. [`${l}-item-active`]: h,
  126. [`${l}-item-disabled`]: _ === !0
  127. }), N = {};
  128. I && (N.width = I), $ && (N.marginRight = $);
  129. const M = {
  130. onClick: w || Dt
  131. };
  132. W && !_ && (M.role = "button", M.tabindex = 0, M.onClick = r);
  133. const F = 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: C,
  144. title: S,
  145. description: v
  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])]), v && p("div", {
  154. class: `${l}-item-description`
  155. }, [v])])])]);
  156. return t.itemRender ? t.itemRender(F) : F;
  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: I,
  208. current: h,
  209. initial: y,
  210. icons: m,
  211. stepIcon: $ = i.stepIcon,
  212. isInline: _,
  213. itemRender: S,
  214. progressDot: v = i.progressDot
  215. } = t, b = _ || v, C = c(c({}, d), {
  216. class: ""
  217. }), w = y + 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 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), {}, {
  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: I,
  241. status: h,
  242. size: y,
  243. current: m,
  244. progressDot: $ = i.progressDot,
  245. initial: _,
  246. icons: S,
  247. items: v,
  248. isInline: b,
  249. itemRender: C
  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 : y, M = A ? "vertical" : l, F = 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: F
  259. }, 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)]);
  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: I,
  1111. colorFillContent: h,
  1112. controlItemBgActive: y,
  1113. colorError: m,
  1114. colorBgContainer: $,
  1115. colorBorderSecondary: _
  1116. } = t, S = t.controlHeight, v = t.colorSplit, b = ht(t, {
  1117. // Steps variable default.less
  1118. processTailColor: v,
  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: v,
  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 ? $ : y,
  1150. finishIconBorderColor: e ? a : y,
  1151. finishDotColor: a,
  1152. errorIconColor: d,
  1153. errorTitleColor: m,
  1154. errorDescriptionColor: m,
  1155. errorTailColor: v,
  1156. errorIconBgColor: m,
  1157. errorIconBorderColor: m,
  1158. errorDotColor: m,
  1159. stepsNavActiveColor: a,
  1160. stepsProgressSize: u,
  1161. // Steps inline variable
  1162. inlineDotSize: 6,
  1163. inlineTitleColor: I,
  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(), I = O(() => t.responsive && l.value.xs ? "vertical" : t.direction), h = O(() => d.getPrefixCls("", t.iconPrefix)), y = (v) => {
  1209. o("update:current", v), o("change", v);
  1210. }, m = O(() => t.type === "inline"), $ = O(() => m.value ? void 0 : t.percent), _ = (v) => {
  1211. let {
  1212. node: b,
  1213. status: C
  1214. } = v;
  1215. if (C === "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 v = U({
  1238. [`${r.value}-rtl`]: u.value === "rtl",
  1239. [`${r.value}-with-progress`]: $.value !== void 0
  1240. }, i.class, a.value), b = (C, w) => C.description ? p(xt, {
  1241. title: C.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: I.value,
  1250. prefixCls: r.value,
  1251. iconPrefix: h.value,
  1252. class: v,
  1253. onChange: y,
  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. layoutHeight: 0,
  1277. footerWitdh: 0,
  1278. form: {},
  1279. stepActive: 0,
  1280. tabsActive: ""
  1281. };
  1282. },
  1283. props: {
  1284. showAnchor: {
  1285. type: Boolean,
  1286. default: !1
  1287. },
  1288. loading: {
  1289. type: Boolean,
  1290. default: !1
  1291. },
  1292. // 页面标题
  1293. title: {
  1294. type: String,
  1295. required: !0
  1296. },
  1297. subTitle: {
  1298. type: String,
  1299. default: ""
  1300. },
  1301. showBtnIcon: {
  1302. type: Boolean,
  1303. default: !0
  1304. },
  1305. steps: {
  1306. type: Array,
  1307. default() {
  1308. return [];
  1309. }
  1310. },
  1311. stepDefaultActive: {
  1312. type: Number,
  1313. default: 0
  1314. },
  1315. stepValid: {
  1316. type: Function,
  1317. default: void 0
  1318. },
  1319. tabs: {
  1320. type: Array,
  1321. default() {
  1322. return [];
  1323. }
  1324. },
  1325. tabKey: {
  1326. type: Object,
  1327. default() {
  1328. return {
  1329. label: "label",
  1330. value: "value"
  1331. };
  1332. }
  1333. },
  1334. formStyle: {
  1335. type: Object,
  1336. default() {
  1337. return {};
  1338. }
  1339. },
  1340. goBack: {
  1341. type: Boolean,
  1342. default: !0
  1343. },
  1344. isShowSave: {
  1345. type: Boolean,
  1346. default: !0
  1347. },
  1348. saveBtnText: {
  1349. type: String,
  1350. default: "保存"
  1351. }
  1352. },
  1353. methods: {
  1354. initStyle() {
  1355. this.$nextTick(() => {
  1356. var r, u, d, s, a, f, l, I, h, y;
  1357. 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;
  1358. this.layoutHeight = ((h = this.$refs.layout) == null ? void 0 : h.offsetHeight) - i - (t > 0 ? t + 16 : 0) - e - n + "px";
  1359. const o = !this.$slots.collapses || this.$slots.collapses && !this.showAnchor ? 0 : 220;
  1360. this.footerWitdh = ((y = this.$refs.formMain) == null ? void 0 : y.offsetWidth) - o + "px";
  1361. });
  1362. },
  1363. isFunction(t) {
  1364. return this[t] && typeof this[t] == "function" ? !0 : (this.$notification.error({
  1365. key: "only-you",
  1366. message: "未绑定接口Api方法, 无法操作"
  1367. }), !1);
  1368. },
  1369. rollback() {
  1370. this.$emit("footer-callback", "cancel");
  1371. },
  1372. handPrev() {
  1373. this.stepActive--, this.$emit("footer-callback", "prev", this.stepActive);
  1374. },
  1375. handNext() {
  1376. if (!this.$utils.isFunction(this.stepValid)) {
  1377. this.stepActive++, this.$emit("footer-callback", "next", this.stepActive);
  1378. return;
  1379. }
  1380. this.stepValid(this.stepActive).then((t) => {
  1381. t && (this.stepActive++, this.$emit("footer-callback", "next", this.stepActive));
  1382. });
  1383. },
  1384. save() {
  1385. this.$emit("footer-callback", "save");
  1386. },
  1387. handTabChange(t) {
  1388. const e = this.tabs.find((i) => i[this.tabKey.value] === t);
  1389. this.$emit("tabsChange", e);
  1390. }
  1391. },
  1392. created() {
  1393. },
  1394. mounted() {
  1395. this.initStyle(), this.stepActive = this.stepDefaultActive;
  1396. }
  1397. }, Qt = {
  1398. class: "form-layout",
  1399. ref: "layout"
  1400. }, Jt = {
  1401. key: 0,
  1402. class: "tools",
  1403. ref: "tools"
  1404. }, Zt = { class: "row" }, kt = { class: "title" }, te = { class: "btns" }, ee = {
  1405. key: 0,
  1406. class: "row sub-title-wrap",
  1407. ref: "subTitle"
  1408. }, ie = { class: "sub-title" }, ne = {
  1409. key: 1,
  1410. class: "step-wrap",
  1411. ref: "step"
  1412. }, oe = {
  1413. key: 2,
  1414. class: "tabs-wrap",
  1415. ref: "tabs"
  1416. }, re = {
  1417. key: 1,
  1418. class: "collapses-content-wrap"
  1419. }, se = {
  1420. key: 0,
  1421. class: "collapses-nav"
  1422. }, le = { class: "modal" };
  1423. function ae(t, e, i, n, o, r) {
  1424. const u = q, d = Ut, s = _t, a = Tt, f = j("close-outlined"), l = zt, I = j("arrow-left-outlined"), h = j("arrow-right-outlined"), y = j("save-outlined"), m = Ht;
  1425. return x(), H("div", Qt, [
  1426. p(m, { spinning: i.loading }, {
  1427. default: P(() => [
  1428. i.title || i.subTitle || t.$slots.otherBtns ? (x(), H("div", Jt, [
  1429. B("div", Zt, [
  1430. B("div", kt, [
  1431. B("span", null, Z(i.title), 1)
  1432. ]),
  1433. B("div", te, [
  1434. R(t.$slots, "otherBtns", {}, void 0, !0)
  1435. ])
  1436. ]),
  1437. i.subTitle ? (x(), H("div", ee, [
  1438. B("div", ie, Z(i.subTitle), 1)
  1439. ], 512)) : T("", !0)
  1440. ], 512)) : T("", !0),
  1441. i.steps && i.steps.length ? (x(), H("div", ne, [
  1442. p(d, {
  1443. current: o.stepActive,
  1444. type: "navigation",
  1445. size: "small"
  1446. }, {
  1447. default: P(() => [
  1448. (x(!0), H(tt, null, et(i.steps, ($) => (x(), L(u, {
  1449. title: $,
  1450. key: $,
  1451. disabled: ""
  1452. }, null, 8, ["title"]))), 128))
  1453. ]),
  1454. _: 1
  1455. }, 8, ["current"])
  1456. ], 512)) : T("", !0),
  1457. i.tabs && i.tabs.length ? (x(), H("div", oe, [
  1458. p(a, {
  1459. "default-active-key": "1",
  1460. onChange: r.handTabChange
  1461. }, {
  1462. default: P(() => [
  1463. (x(!0), H(tt, null, et(i.tabs, ($) => (x(), L(s, {
  1464. tab: $[i.tabKey.label],
  1465. key: $[i.tabKey.value]
  1466. }, null, 8, ["tab"]))), 128))
  1467. ]),
  1468. _: 1
  1469. }, 8, ["onChange"])
  1470. ], 512)) : T("", !0),
  1471. B("div", {
  1472. class: at(["form-layout-main", { whiteBg: !!t.$slots.form }]),
  1473. id: "form-container",
  1474. ref: "formMain",
  1475. style: G({ height: o.layoutHeight })
  1476. }, [
  1477. t.$slots.form ? (x(), H("div", {
  1478. key: 0,
  1479. class: "form-container-wrap",
  1480. style: G(i.formStyle)
  1481. }, [
  1482. R(t.$slots, "form", {}, void 0, !0)
  1483. ], 4)) : T("", !0),
  1484. t.$slots.collapses ? (x(), H("div", re, [
  1485. B("div", {
  1486. class: "collapese-container",
  1487. style: G({ width: i.showAnchor ? "calc(100% - 220px)" : "100%" })
  1488. }, [
  1489. R(t.$slots, "collapses", {}, void 0, !0)
  1490. ], 4),
  1491. i.showAnchor && t.$slots.anchor ? (x(), H("div", se, [
  1492. R(t.$slots, "anchor", {}, void 0, !0)
  1493. ])) : T("", !0)
  1494. ])) : T("", !0)
  1495. ], 6),
  1496. B("div", le, [
  1497. R(t.$slots, "other", {}, void 0, !0)
  1498. ]),
  1499. B("div", {
  1500. class: "form-fixed-footer",
  1501. ref: "footer",
  1502. style: G({ width: o.footerWitdh })
  1503. }, [
  1504. i.goBack ? (x(), L(l, {
  1505. key: 0,
  1506. onClick: r.rollback,
  1507. class: "btn"
  1508. }, {
  1509. default: P(() => [
  1510. p(f),
  1511. e[0] || (e[0] = K("取消 "))
  1512. ]),
  1513. _: 1
  1514. }, 8, ["onClick"])) : T("", !0),
  1515. i.steps.length ? (x(), L(l, {
  1516. key: 1,
  1517. class: "btn",
  1518. disabled: o.stepActive === this.stepDefaultActive,
  1519. onClick: r.handPrev
  1520. }, {
  1521. default: P(() => [
  1522. p(I),
  1523. e[1] || (e[1] = K("上一步 "))
  1524. ]),
  1525. _: 1
  1526. }, 8, ["disabled", "onClick"])) : T("", !0),
  1527. i.steps.length ? (x(), L(l, {
  1528. key: 2,
  1529. class: "btn",
  1530. type: "primary",
  1531. disabled: o.stepActive === this.steps.length - 1,
  1532. onClick: r.handNext
  1533. }, {
  1534. default: P(() => [
  1535. p(h),
  1536. e[2] || (e[2] = K("下一步 "))
  1537. ]),
  1538. _: 1
  1539. }, 8, ["disabled", "onClick"])) : T("", !0),
  1540. i.isShowSave ? (x(), L(l, {
  1541. key: 3,
  1542. style: { "margin-right": "8px" },
  1543. type: "primary",
  1544. onClick: r.save
  1545. }, {
  1546. default: P(() => [
  1547. p(y),
  1548. K(" " + Z(i.saveBtnText), 1)
  1549. ]),
  1550. _: 1
  1551. }, 8, ["onClick"])) : T("", !0),
  1552. R(t.$slots, "footer", {}, void 0, !0)
  1553. ], 4)
  1554. ]),
  1555. _: 3
  1556. }, 8, ["spinning"])
  1557. ], 512);
  1558. }
  1559. const me = /* @__PURE__ */ wt(Yt, [["render", ae], ["__scopeId", "data-v-a58915bf"]]);
  1560. export {
  1561. me as default
  1562. };