mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
/*! For license information please see 4875.a8f0e019.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["4875"],{84661:function(t,e,n){"use strict";n.r(e);var r=n("16036");n("52010");let o=r.Z;e.default=o},16036:function(t,e,n){"use strict";var r=n("80681"),o=n("11848"),i=n("17075"),a=n("99497"),l=n("54369"),c={style:{"margin-top":"15px"}};e.Z=(0,r.aZ)({__name:"index",setup(t){var e=(0,l.q)({"zh-CN":{title2:"\u7F6E\u7070",title3:"\u6837\u5F0F\u5B9A\u5236",strokeWidth:"\u7EBF\u6761\u7C97\u7EC6",transition:"\u8FC7\u6E21\u6548\u679C"},"en-US":{title2:"Inactive",title3:"Custom Style",strokeWidth:"Stroke Width",transition:"Transition"}}),n=(0,o.iH)(50),u=t=>Math.min(Math.max(t,0),100),s=()=>{n.value=u(n.value+20)},d=()=>{n.value=u(n.value-20)};return(t,l)=>{var u=(0,r.up)("demo-block");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(u,{title:(0,o.SU)(e)("basicUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(i.ZP),{percentage:50})]),_:1},8,["title"]),(0,r.Wm)(u,{title:(0,o.SU)(e)("strokeWidth")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(i.ZP),{percentage:50,"stroke-width":"8"})]),_:1},8,["title"]),(0,r.Wm)(u,{title:(0,o.SU)(e)("title2")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(i.ZP),{inactive:"",percentage:50})]),_:1},8,["title"]),(0,r.Wm)(u,{title:(0,o.SU)(e)("title3")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(i.ZP),{color:"#f2826a",percentage:25,"pivot-text":(0,o.SU)(e)("orange")},null,8,["pivot-text"]),(0,r.Wm)((0,o.SU)(i.ZP),{color:"#ee0a24",percentage:50,"pivot-text":(0,o.SU)(e)("red")},null,8,["pivot-text"]),(0,r.Wm)((0,o.SU)(i.ZP),{percentage:75,"pivot-text":(0,o.SU)(e)("purple"),"pivot-color":"#7232dd",color:"linear-gradient(to right, #be99ff, #7232dd)"},null,8,["pivot-text"])]),_:1},8,["title"]),(0,r.Wm)(u,{title:(0,o.SU)(e)("transition")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,o.SU)(i.ZP),{percentage:n.value},null,8,["percentage"]),(0,r._)("div",c,[(0,r.Wm)((0,o.SU)(a.ZP),{text:(0,o.SU)(e)("add"),type:"primary",size:"small",onClick:s},null,8,["text"]),(0,r.Wm)((0,o.SU)(a.ZP),{text:(0,o.SU)(e)("decrease"),type:"danger",size:"small",onClick:d},null,8,["text"])])]),_:1},8,["title"])],64)}}})},72555:function(t,e,n){"use strict";n.d(e,{Ct:function(){return i}});var r=n("63112"),o=n("63022"),i=(0,r.n)(o.Z);e.ZP=i},99497:function(t,e,n){"use strict";n.d(e,{zx:function(){return i}});var r=n("63112"),o=n("14314"),i=(0,r.n)(o.Z);e.ZP=i},14517:function(t,e,n){"use strict";n.d(e,{H:function(){return i},t:function(){return o}});var r=2e3,o=()=>++r,i=t=>{r=t}},6149:function(t,e,n){"use strict";n.d(e,{BC:function(){return i},g2:function(){return o},yj:function(){return a}}),n("56115"),n("59644");var r=n("80681"),o={to:[String,Object],url:String,replace:Boolean};function i(t){var{to:e,url:n,replace:r,$router:o}=t;e&&o?o[r?"replace":"push"](e):n&&(r?location.replace(n):location.href=n)}function a(){var t=(0,r.FN)().proxy;return()=>i(t)}},96528:function(t,e,n){"use strict";n.d(e,{JO:function(){return i}});var r=n("63112"),o=n("28779"),i=(0,r.n)(o.Z);e.ZP=i},95786:function(t,e,n){"use strict";n.d(e,{gb:function(){return i}});var r=n("63112"),o=n("2309"),i=(0,r.n)(o.Z);e.ZP=i},17075:function(t,e,n){"use strict";var r=n("63112"),o=n("12641"),i=(0,r.n)(o.Z);e.ZP=i},8051:function(t,e,n){"use strict";n.d(e,{Cp:function(){return v},T5:function(){return r},WN:function(){return f},_K:function(){return c},a8:function(){return i},dt:function(){return a},e9:function(){return d},k7:function(){return o},mH:function(){return p},pj:function(){return s},r5:function(){return u},xe:function(){return l}}),n("86795");var r="van-hairline",o="".concat(r,"--top"),i="".concat(r,"--left"),a="".concat(r,"--right"),l="".concat(r,"--bottom"),c="".concat(r,"--surround"),u="".concat(r,"--top-bottom"),s="".concat(r,"-unset--top-bottom"),d="van-haptics-feedback",f=Symbol("van-form"),v=500,p=5},78335:function(t,e,n){"use strict";n.d(e,{Ce:function(){return l},J5:function(){return i},Or:function(){return o},SI:function(){return u},SQ:function(){return s},Vg:function(){return r},ir:function(){return a},qM:function(){return c}});var r=null,o=[Number,String],i={type:Boolean,default:!0},a=t=>({type:t,required:!0}),l=()=>({type:Array,default:()=>[]}),c=t=>({type:Number,default:t}),u=t=>({type:o,default:t}),s=t=>({type:String,default:t})},63112:function(t,e,n){"use strict";n.d(e,{n:function(){return o}});var r=n("20358");function o(t){return t.install=e=>{var{name:n}=t;n&&(e.component(n,t),e.component((0,r._A)("-".concat(n)),t))},t}},63022:function(t,e,n){"use strict";n("82116"),n("17989"),n("56115"),n("59644"),n("89176");var r=n("80681"),o=n("62568"),i=n("78335"),a=n("12308"),l=n("20358"),[c,u]=(0,o.do)("badge"),s={dot:Boolean,max:i.Or,tag:(0,i.SQ)("div"),color:String,offset:Array,content:i.Or,showZero:i.J5,position:(0,i.SQ)("top-right")};e.Z=(0,r.aZ)({name:c,props:s,setup(t,e){var{slots:n}=e,o=()=>{if(n.content)return!0;var{content:e,showZero:r}=t;return(0,a.Xq)(e)&&""!==e&&(r||0!==e&&"0"!==e)},i=()=>{var{dot:e,max:r,content:i}=t;if(!e&&o())return n.content?n.content():(0,a.Xq)(r)&&(0,a.kE)(i)&&+i>+r?"".concat(r,"+"):i},c=t=>t.startsWith("-")?t.replace("-",""):"-".concat(t),s=(0,r.Fl)(()=>{var e={background:t.color};if(t.offset){var[r,o]=t.offset,{position:i}=t,[a,u]=i.split("-");n.default?("number"==typeof o?e[a]=(0,l.Nn)("top"===a?o:-o):e[a]="top"===a?(0,l.Nn)(o):c(o),"number"==typeof r?e[u]=(0,l.Nn)("left"===u?r:-r):e[u]="left"===u?(0,l.Nn)(r):c(r)):(e.marginTop=(0,l.Nn)(o),e.marginLeft=(0,l.Nn)(r))}return e}),d=()=>{if(o()||t.dot)return(0,r.Wm)("div",{class:u([t.position,{dot:t.dot,fixed:!!n.default}]),style:s.value},[i()])};return()=>{if(n.default){var{tag:e}=t;return(0,r.Wm)(e,{class:u("wrapper")},{default:()=>[n.default(),d()]})}return d()}}})},14314:function(t,e,n){"use strict";n("82116"),n("17989"),n("24660");var r=n("80681"),o=n("62568"),i=n("12308"),a=n("78335"),l=n("82210"),c=n("8051"),u=n("6149"),s=n("96528"),d=n("95786"),[f,v]=(0,o.do)("button"),p=(0,i.l7)({},u.g2,{tag:(0,a.SQ)("button"),text:String,icon:String,type:(0,a.SQ)("default"),size:(0,a.SQ)("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:(0,a.SQ)("button"),loadingSize:a.Or,loadingText:String,loadingType:String,iconPosition:(0,a.SQ)("left")});e.Z=(0,r.aZ)({name:f,props:p,emits:["click"],setup(t,e){var{emit:n,slots:o}=e,i=(0,u.yj)(),a=()=>o.loading?o.loading():(0,r.Wm)(d.gb,{size:t.loadingSize,type:t.loadingType,class:v("loading")},null),f=()=>t.loading?a():o.icon?(0,r.Wm)("div",{class:v("icon")},[o.icon()]):t.icon?(0,r.Wm)(s.JO,{name:t.icon,class:v("icon"),classPrefix:t.iconPrefix},null):void 0,p=()=>{var e;if(e=t.loading?t.loadingText:o.default?o.default():t.text)return(0,r.Wm)("span",{class:v("text")},[e])},m=()=>{var{color:e,plain:n}=t;if(e){var r={color:n?e:"white"};return!n&&(r.background=e),e.includes("gradient")?r.border=0:r.borderColor=e,r}},g=e=>{t.loading?(0,l.PF)(e):!t.disabled&&(n("click",e),i())};return()=>{var{tag:e,type:n,size:o,block:i,round:a,plain:l,square:u,loading:s,disabled:d,hairline:S,nativeType:h,iconPosition:b}=t,y=[v([n,o,{plain:l,block:i,round:a,square:u,loading:s,disabled:d,hairline:S}]),{[c._K]:S}];return(0,r.Wm)(e,{type:h,class:y,style:m(),disabled:d,onClick:g},{default:()=>[(0,r.Wm)("div",{class:v("content")},["left"===b&&f(),p(),"right"===b&&f()])]})}}})},53419:function(t,e,n){"use strict";n.d(e,{q9:function(){return d}}),n("82116"),n("17989"),n("86795"),n("56115"),n("59644"),n("31564"),n("8649"),n("70629");var r=n("80681"),o=n("62568"),i=n("78335"),a=n("20358"),l=n("12308"),c=n("14517"),[u,s]=(0,o.do)("config-provider"),d=Symbol(u),f={tag:(0,i.SQ)("div"),theme:(0,i.SQ)("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,themeVarsScope:(0,i.SQ)("local"),iconPrefix:String};function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(t).forEach(n=>{t[n]!==e[n]&&document.documentElement.style.setProperty(n,t[n])}),Object.keys(e).forEach(e=>{!t[e]&&document.documentElement.style.removeProperty(e)})}e.ZP=(0,r.aZ)({name:u,props:f,setup(t,e){var{slots:n}=e,o=(0,r.Fl)(()=>{var e,n;return e=(0,l.l7)({},t.themeVars,"dark"===t.theme?t.themeVarsDark:t.themeVarsLight),n={},Object.keys(e).forEach(t=>{var r=(0,a.GL)(t).replace(/([a-zA-Z])(\d)/g,"$1-$2");n["--van-".concat(r)]=e[t]}),n});if(l._f){var i=()=>{document.documentElement.classList.add("van-theme-".concat(t.theme))},u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.theme;document.documentElement.classList.remove("van-theme-".concat(e))};(0,r.YP)(()=>t.theme,(t,e)=>{e&&u(e),i()},{immediate:!0}),(0,r.dl)(i),(0,r.se)(u),(0,r.Jd)(u),(0,r.YP)(o,(e,n)=>{"global"===t.themeVarsScope&&v(e,n)}),(0,r.YP)(()=>t.themeVarsScope,(t,e)=>{"global"===e&&v({},o.value),"global"===t&&v(o.value,{})}),"global"===t.themeVarsScope&&v(o.value,{})}return(0,r.JJ)(d,t),(0,r.m0)(()=>{void 0!==t.zIndex&&(0,c.H)(t.zIndex)}),()=>(0,r.Wm)(t.tag,{class:s(),style:"local"===t.themeVarsScope?o.value:void 0},{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n)]}})}})},28779:function(t,e,n){"use strict";n("82116"),n("17989"),n("24660");var r=n("80681"),o=n("62568"),i=n("78335"),a=n("20358"),l=n("72555"),c=n("53419"),[u,s]=(0,o.do)("icon"),d=t=>null==t?void 0:t.includes("/"),f={dot:Boolean,tag:(0,i.SQ)("i"),name:String,size:i.Or,badge:i.Or,color:String,badgeProps:Object,classPrefix:String};e.Z=(0,r.aZ)({name:u,props:f,setup(t,e){var{slots:n}=e,o=(0,r.f3)(c.q9,null),i=(0,r.Fl)(()=>t.classPrefix||(null==o?void 0:o.iconPrefix)||s());return()=>{var{tag:e,dot:o,name:c,size:u,badge:f,color:v}=t,p=d(c);return(0,r.Wm)(l.Ct,(0,r.dG)({dot:o,tag:e,class:[i.value,p?"":"".concat(i.value,"-").concat(c)],style:{color:v,fontSize:(0,a.Nn)(u)},content:f},t.badgeProps),{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n),p&&(0,r.Wm)("img",{class:s("image"),src:c},null)]}})}}})},2309:function(t,e,n){"use strict";n("82116"),n("17989"),n("66786"),n("14529");var r=n("80681"),o=n("62568"),i=n("78335"),a=n("12308"),l=n("20358"),[c,u]=(0,o.do)("loading"),s=Array(12).fill(null).map((t,e)=>(0,r.Wm)("i",{class:u("line",String(e+1))},null)),d=(0,r.Wm)("svg",{class:u("circular"),viewBox:"25 25 50 50"},[(0,r.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),f={size:i.Or,type:(0,i.SQ)("circular"),color:String,vertical:Boolean,textSize:i.Or,textColor:String};e.Z=(0,r.aZ)({name:c,props:f,setup(t,e){var{slots:n}=e,o=(0,r.Fl)(()=>(0,a.l7)({color:t.color},(0,l.Xn)(t.size))),i=()=>{var e="spinner"===t.type?s:d;return(0,r.Wm)("span",{class:u("spinner",t.type),style:o.value},[n.icon?n.icon():e])},c=()=>{if(n.default){var e;return(0,r.Wm)("span",{class:u("text"),style:{fontSize:(0,l.Nn)(t.textSize),color:null!==(e=t.textColor)&&void 0!==e?e:t.color}},[n.default()])}};return()=>{var{type:e,vertical:n}=t;return(0,r.Wm)("div",{class:u([e,{vertical:n}]),"aria-live":"polite","aria-busy":!0},[i(),c()])}}})},12641:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),o=n("62568"),i=n("78335"),a=n("20358"),[l,c]=(0,o.do)("progress"),u={color:String,inactive:Boolean,pivotText:String,textColor:String,showPivot:i.J5,pivotColor:String,trackColor:String,strokeWidth:i.Or,percentage:{type:i.Or,default:0,validator:t=>+t>=0&&100>=+t}};e.Z=(0,r.aZ)({name:l,props:u,setup(t){var e=(0,r.Fl)(()=>t.inactive?void 0:t.color),n=()=>{var{textColor:n,pivotText:o,pivotColor:i,percentage:a}=t,l=null!=o?o:"".concat(a,"%");if(t.showPivot&&l){var u={color:n,left:"".concat(+a,"%"),transform:"translate(-".concat(+a,"%,-50%)"),background:i||e.value};return(0,r.Wm)("span",{style:u,class:c("pivot",{inactive:t.inactive})},[l])}};return()=>{var{trackColor:o,percentage:i,strokeWidth:l}=t,u={background:o,height:(0,a.Nn)(l)},s={width:"".concat(i,"%"),background:e.value};return(0,r.Wm)("div",{class:c(),style:u},[(0,r.Wm)("span",{class:c("portion",{inactive:t.inactive}),style:s},null),n()])}}})},52010:function(t,e,n){"use strict";n.r(t.exports={})},14882:function(t,e,n){"use strict";n.r(t.exports={})}}]); |