vant/v3/assets/index.0cf8618e.js
2024-04-20 08:49:23 +00:00

2 lines
4.2 KiB
JavaScript

import{c as F,b as N,u as z,a as T}from"./use-translate.d2900b8c.js";import{c as R,m as y,w as P}from"./with-install.19a35764.js";import{z as h,e as n,D as g,C as U,r as $,o as K,a as O,w as i,B as t,h as r,t as c,d as v,F as Y}from"./vue-libs.b44bc779.js";import{d as j}from"./constant.80c6de18.js";import{I as S}from"./index.b70c9b40.js";import{V as q}from"./index.8e37fe56.js";import"./use-route.82f2be69.js";import"./index.4e4daaac.js";const[I,D]=F("steps"),G={active:R(0),direction:y("horizontal"),activeIcon:y("checked"),iconPrefix:String,finishIcon:String,activeColor:String,inactiveIcon:String,inactiveColor:String},b=Symbol(I),H=h({name:I,props:G,emits:["click-step"],setup(m,{emit:e,slots:u}){const{linkChildren:f}=N(b);return f({props:m,onClickStep:a=>e("click-step",a)}),()=>{var a;return n("div",{class:D([m.direction])},[n("div",{class:D("items")},[(a=u.default)==null?void 0:a.call(u)])])}}}),J=P(H),C=J,[L,p]=F("step"),M=h({name:L,setup(m,{slots:e}){const{parent:u,index:f}=z(b);if(!u)return;const l=u.props,a=()=>{const o=+l.active;return f.value<o?"finish":f.value===o?"process":"waiting"},d=()=>a()==="process",B=g(()=>({background:a()==="finish"?l.activeColor:l.inactiveColor})),A=g(()=>{if(d())return{color:l.activeColor};if(a()==="waiting")return{color:l.inactiveColor}}),E=()=>u.onClickStep(f.value),V=()=>{const{iconPrefix:o,finishIcon:_,activeIcon:w,activeColor:k,inactiveIcon:x}=l;return d()?e["active-icon"]?e["active-icon"]():n(S,{class:p("icon","active"),name:w,color:k,classPrefix:o},null):a()==="finish"&&(_||e["finish-icon"])?e["finish-icon"]?e["finish-icon"]():n(S,{class:p("icon","finish"),name:_,color:k,classPrefix:o},null):e["inactive-icon"]?e["inactive-icon"]():x?n(S,{class:p("icon"),name:x,classPrefix:o},null):n("i",{class:p("circle"),style:B.value},null)};return()=>{var _;const o=a();return n("div",{class:[j,p([l.direction,{[o]:o}])]},[n("div",{class:p("title",{active:d()}),style:A.value,onClick:E},[(_=e.default)==null?void 0:_.call(e)]),n("div",{class:p("circle-container"),onClick:E},[V()]),n("div",{class:p("line"),style:B.value},null)])}}}),Q=P(M),s=Q,W=v("p",null,"2016-07-12 12:40",-1),X=v("p",null,"2016-07-11 10:00",-1),Z=v("p",null,"2016-07-10 09:30",-1),lt=h({__name:"index",setup(m){const e=T({"zh-CN":{nextStep:"\u4E0B\u4E00\u6B65",step1:"\u4E70\u5BB6\u4E0B\u5355",step2:"\u5546\u5BB6\u63A5\u5355",step3:"\u4E70\u5BB6\u63D0\u8D27",step4:"\u4EA4\u6613\u5B8C\u6210",title2:"\u63CF\u8FF0\u4FE1\u606F",title3:"\u7AD6\u5411\u6B65\u9AA4\u6761",status1:"\u3010\u57CE\u5E02\u3011\u7269\u6D41\u72B6\u60011",status2:"\u3010\u57CE\u5E02\u3011\u7269\u6D41\u72B6\u6001",status3:"\u5FEB\u4EF6\u5DF2\u53D1\u8D27",customStyle:"\u81EA\u5B9A\u4E49\u6837\u5F0F"},"en-US":{nextStep:"Next Step",step1:"Step1",step2:"Step2",step3:"Step3",step4:"Step4",title2:"Description",title3:"Vertical Steps",status1:"\u3010City\u3011Status1",status2:"\u3010City\u3011Status2",status3:"\u3010City\u3011Status3",customStyle:"Custom Style"}}),u=U(1),f=()=>{u.value=++u.value%4};return(l,a)=>{const d=$("demo-block");return K(),O(Y,null,[n(d,{title:t(e)("basicUsage")},{default:i(()=>[n(t(C),{active:u.value},{default:i(()=>[n(t(s),null,{default:i(()=>[r(c(t(e)("step1")),1)]),_:1}),n(t(s),null,{default:i(()=>[r(c(t(e)("step2")),1)]),_:1}),n(t(s),null,{default:i(()=>[r(c(t(e)("step3")),1)]),_:1}),n(t(s),null,{default:i(()=>[r(c(t(e)("step4")),1)]),_:1})]),_:1},8,["active"]),n(t(q),{onClick:f},{default:i(()=>[r(c(t(e)("nextStep")),1)]),_:1})]),_:1},8,["title"]),n(d,{title:t(e)("customStyle")},{default:i(()=>[n(t(C),{active:u.value,"active-icon":"success","inactive-icon":"arrow","active-color":"#38f"},{default:i(()=>[n(t(s),null,{default:i(()=>[r(c(t(e)("step1")),1)]),_:1}),n(t(s),null,{default:i(()=>[r(c(t(e)("step2")),1)]),_:1}),n(t(s),null,{default:i(()=>[r(c(t(e)("step3")),1)]),_:1}),n(t(s),null,{default:i(()=>[r(c(t(e)("step4")),1)]),_:1})]),_:1},8,["active"])]),_:1},8,["title"]),n(d,{title:t(e)("title3")},{default:i(()=>[n(t(C),{active:0,direction:"vertical"},{default:i(()=>[n(t(s),null,{default:i(()=>[v("h3",null,c(t(e)("status1")),1),W]),_:1}),n(t(s),null,{default:i(()=>[v("h3",null,c(t(e)("status2")),1),X]),_:1}),n(t(s),null,{default:i(()=>[v("h3",null,c(t(e)("status3")),1),Z]),_:1})]),_:1})]),_:1},8,["title"])],64)}}});export{lt as default};