mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
/*! For license information please see 3297.32e95b95.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["3297"],{92520:function(t,e,n){"use strict";n.r(e);let r=n("39221").Z;e.default=r},39221:function(t,e,n){"use strict";n("61557");var r=n("80681"),i=n("11848"),l=n("57122"),a=n("19924"),o=n("44616"),u=n("81173"),c=n("62243"),s=n("99742"),v=n("54369");e.Z=(0,r.aZ)({__name:"index",setup(t){for(var e=(0,v.q)({"zh-CN":{text:"\u6587\u672C",customIndexList:"\u81EA\u5B9A\u4E49\u7D22\u5F15\u5217\u8868"},"en-US":{text:"Text",customIndexList:"Custom Index List"}}),n=(0,i.iH)(0),f=[],d=[1,2,3,4,5,6,8,9,10],m=0;m<26;m++)f.push(String.fromCharCode(65+m));return(t,v)=>((0,r.wg)(),(0,r.j4)((0,i.SU)(a.ZP),{active:n.value,"onUpdate:active":v[0]||(v[0]=t=>n.value=t)},{default:(0,r.w5)(()=>[(0,r.Wm)((0,i.SU)(o.ZP),{title:(0,i.SU)(e)("basicUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,i.SU)(u.ZP),null,{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(f,t=>(0,r._)("div",{key:t},[(0,r.Wm)((0,i.SU)(c.ZP),{index:t},null,8,["index"]),(0,r.Wm)((0,i.SU)(s.ZP),{title:(0,i.SU)(e)("text")},null,8,["title"]),(0,r.Wm)((0,i.SU)(s.ZP),{title:(0,i.SU)(e)("text")},null,8,["title"]),(0,r.Wm)((0,i.SU)(s.ZP),{title:(0,i.SU)(e)("text")},null,8,["title"])])),64))]),_:1})]),_:1},8,["title"]),(0,r.Wm)((0,i.SU)(o.ZP),{title:(0,i.SU)(e)("customIndexList")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,i.SU)(u.ZP),{"index-list":d},{default:(0,r.w5)(()=>[((0,r.wg)(),(0,r.iD)(r.HY,null,(0,r.Ko)(d,t=>(0,r._)("div",{key:t},[(0,r.Wm)((0,i.SU)(c.ZP),{index:t},{default:(0,r.w5)(()=>[(0,r.Uk)((0,l.zw)((0,i.SU)(e)("title")+t),1)]),_:2},1032,["index"]),(0,r.Wm)((0,i.SU)(s.ZP),{title:(0,i.SU)(e)("text")},null,8,["title"]),(0,r.Wm)((0,i.SU)(s.ZP),{title:(0,i.SU)(e)("text")},null,8,["title"]),(0,r.Wm)((0,i.SU)(s.ZP),{title:(0,i.SU)(e)("text")},null,8,["title"])])),64))]),_:1})]),_:1},8,["title"])]),_:1},8,["active"]))}})},72555:function(t,e,n){"use strict";n.d(e,{Ct:function(){return l}});var r=n("63112"),i=n("63022"),l=(0,r.n)(i.Z);e.ZP=l},99742:function(t,e,n){"use strict";n.d(e,{bL:function(){return l}});var r=n("63112"),i=n("54499"),l=(0,r.n)(i.ZP);e.ZP=l},65170:function(t,e,n){"use strict";n.d(e,{S:function(){return i},h:function(){return l}}),n("86795");var r=n("80681"),i=Symbol();function l(t){var e=(0,r.f3)(i,null);e&&(0,r.YP)(e,e=>{e&&t()})}},10023:function(t,e,n){"use strict";n.d(e,{F:function(){return l}});var r=n("80681"),i=n("12308");function l(t){var e=(0,r.FN)();e&&(0,i.l7)(e.proxy,t)}},14517:function(t,e,n){"use strict";n.d(e,{H:function(){return l},t:function(){return i}});var r=2e3,i=()=>++r,l=t=>{r=t}},29609:function(t,e,n){"use strict";n.d(e,{o:function(){return l}});var r=n("11848"),i=n("8051");function l(){var t=(0,r.iH)(0),e=(0,r.iH)(0),n=(0,r.iH)(0),l=(0,r.iH)(0),a=(0,r.iH)(0),o=(0,r.iH)(0),u=(0,r.iH)(""),c=(0,r.iH)(!0),s=()=>{n.value=0,l.value=0,a.value=0,o.value=0,u.value="",c.value=!0};return{move:r=>{var s,v,f=r.touches[0];n.value=(f.clientX<0?0:f.clientX)-t.value,l.value=f.clientY-e.value,a.value=Math.abs(n.value),o.value=Math.abs(l.value);if(!u.value||a.value<10&&o.value<10){;u.value=(s=a.value,s>(v=o.value)?"horizontal":v>s?"vertical":"")}c.value&&(a.value>i.mH||o.value>i.mH)&&(c.value=!1)},start:n=>{s(),t.value=n.touches[0].clientX,e.value=n.touches[0].clientY},reset:s,startX:t,startY:e,deltaX:n,deltaY:l,offsetX:a,offsetY:o,direction:u,isVertical:()=>"vertical"===u.value,isHorizontal:()=>"horizontal"===u.value,isTap:c}}},96528:function(t,e,n){"use strict";n.d(e,{JO:function(){return l}});var r=n("63112"),i=n("28779"),l=(0,r.n)(i.Z);e.ZP=l},62243:function(t,e,n){"use strict";var r=n("63112"),i=n("96422"),l=(0,r.n)(i.Z);e.ZP=l},81173:function(t,e,n){"use strict";var r=n("63112"),i=n("59479"),l=(0,r.n)(i.ZP);e.ZP=l},8051:function(t,e,n){"use strict";n.d(e,{Cp:function(){return d},T5:function(){return r},WN:function(){return f},_K:function(){return u},a8:function(){return l},dt:function(){return a},e9:function(){return v},k7:function(){return i},mH:function(){return m},pj:function(){return s},r5:function(){return c},xe:function(){return o}}),n("86795");var r="van-hairline",i="".concat(r,"--top"),l="".concat(r,"--left"),a="".concat(r,"--right"),o="".concat(r,"--bottom"),u="".concat(r,"--surround"),c="".concat(r,"--top-bottom"),s="".concat(r,"-unset--top-bottom"),v="van-haptics-feedback",f=Symbol("van-form"),d=500,m=5},55987:function(t,e,n){"use strict";n.d(e,{I:function(){return i}});var r=n("12308");function i(t,e){var{args:n=[],done:i,canceled:l,error:a}=e;if(t){var o=t.apply(null,n);(0,r.tI)(o)?o.then(t=>{t?i():l&&l()}).catch(a||r.ZT):o?i():l&&l()}else i()}},78335:function(t,e,n){"use strict";n.d(e,{Ce:function(){return o},J5:function(){return l},Or:function(){return i},SI:function(){return c},SQ:function(){return s},Vg:function(){return r},ir:function(){return a},qM:function(){return u}});var r=null,i=[Number,String],l={type:Boolean,default:!0},a=t=>({type:t,required:!0}),o=()=>({type:Array,default:()=>[]}),u=t=>({type:Number,default:t}),c=t=>({type:i,default:t}),s=t=>({type:String,default:t})},63112:function(t,e,n){"use strict";n.d(e,{n:function(){return i}});var r=n("20358");function i(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"),i=n("62568"),l=n("78335"),a=n("12308"),o=n("20358"),[u,c]=(0,i.do)("badge"),s={dot:Boolean,max:l.Or,tag:(0,l.SQ)("div"),color:String,offset:Array,content:l.Or,showZero:l.J5,position:(0,l.SQ)("top-right")};e.Z=(0,r.aZ)({name:u,props:s,setup(t,e){var{slots:n}=e,i=()=>{if(n.content)return!0;var{content:e,showZero:r}=t;return(0,a.Xq)(e)&&""!==e&&(r||0!==e&&"0"!==e)},l=()=>{var{dot:e,max:r,content:l}=t;if(!e&&i())return n.content?n.content():(0,a.Xq)(r)&&(0,a.kE)(l)&&+l>+r?"".concat(r,"+"):l},u=t=>t.startsWith("-")?t.replace("-",""):"-".concat(t),s=(0,r.Fl)(()=>{var e={background:t.color};if(t.offset){var[r,i]=t.offset,{position:l}=t,[a,c]=l.split("-");n.default?("number"==typeof i?e[a]=(0,o.Nn)("top"===a?i:-i):e[a]="top"===a?(0,o.Nn)(i):u(i),"number"==typeof r?e[c]=(0,o.Nn)("left"===c?r:-r):e[c]="left"===c?(0,o.Nn)(r):u(r)):(e.marginTop=(0,o.Nn)(i),e.marginLeft=(0,o.Nn)(r))}return e}),v=()=>{if(i()||t.dot)return(0,r.Wm)("div",{class:c([t.position,{dot:t.dot,fixed:!!n.default}]),style:s.value},[l()])};return()=>{if(n.default){var{tag:e}=t;return(0,r.Wm)(e,{class:c("wrapper")},{default:()=>[n.default(),v()]})}return v()}}})},54499:function(t,e,n){"use strict";n.d(e,{x_:function(){return v}}),n("82116"),n("17989");var r=n("80681"),i=n("62568"),l=n("78335"),a=n("12308"),o=n("6149"),u=n("96528"),[c,s]=(0,i.do)("cell"),v={tag:(0,l.SQ)("div"),icon:String,size:String,title:l.Or,value:l.Or,label:l.Or,center:Boolean,isLink:Boolean,border:l.J5,iconPrefix:String,valueClass:l.Vg,labelClass:l.Vg,titleClass:l.Vg,titleStyle:null,arrowDirection:String,required:{type:[Boolean,String],default:null},clickable:{type:Boolean,default:null}},f=(0,a.l7)({},v,o.g2);e.ZP=(0,r.aZ)({name:c,props:f,setup(t,e){var{slots:n}=e,i=(0,o.yj)(),l=()=>{if(n.label||(0,a.Xq)(t.label))return(0,r.Wm)("div",{class:[s("label"),t.labelClass]},[n.label?n.label():t.label])},c=()=>{if(n.title||(0,a.Xq)(t.title)){var e,i=null===(e=n.title)||void 0===e?void 0:e.call(n);if(!Array.isArray(i)||0!==i.length)return(0,r.Wm)("div",{class:[s("title"),t.titleClass],style:t.titleStyle},[i||(0,r.Wm)("span",null,[t.title]),l()])}},v=()=>{var e=n.value||n.default;if(e||(0,a.Xq)(t.value))return(0,r.Wm)("div",{class:[s("value"),t.valueClass]},[e?e():(0,r.Wm)("span",null,[t.value])])},f=()=>n.icon?n.icon():t.icon?(0,r.Wm)(u.JO,{name:t.icon,class:s("left-icon"),classPrefix:t.iconPrefix},null):void 0,d=()=>{if(n["right-icon"])return n["right-icon"]();if(t.isLink){var e=t.arrowDirection&&"right"!==t.arrowDirection?"arrow-".concat(t.arrowDirection):"arrow";return(0,r.Wm)(u.JO,{name:e,class:s("right-icon")},null)}};return()=>{var e,{tag:l,size:a,center:o,border:u,isLink:m,required:p}=t,h=null!==(e=t.clickable)&&void 0!==e?e:m,g={center:o,required:!!p,clickable:h,borderless:!u};return a&&(g[a]=!!a),(0,r.Wm)(l,{class:s(g),role:h?"button":void 0,tabindex:h?0:void 0,onClick:i},{default:()=>{var t;return[f(),c(),v(),d(),null===(t=n.extra)||void 0===t?void 0:t.call(n)]}})}}})},53419:function(t,e,n){"use strict";n.d(e,{q9:function(){return v}}),n("82116"),n("17989"),n("86795"),n("56115"),n("59644"),n("31564"),n("8649"),n("70629");var r=n("80681"),i=n("62568"),l=n("78335"),a=n("20358"),o=n("12308"),u=n("14517"),[c,s]=(0,i.do)("config-provider"),v=Symbol(c),f={tag:(0,l.SQ)("div"),theme:(0,l.SQ)("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,themeVarsScope:(0,l.SQ)("local"),iconPrefix:String};function d(){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:c,props:f,setup(t,e){var{slots:n}=e,i=(0,r.Fl)(()=>{var e,n;return e=(0,o.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(o._f){var l=()=>{document.documentElement.classList.add("van-theme-".concat(t.theme))},c=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&&c(e),l()},{immediate:!0}),(0,r.dl)(l),(0,r.se)(c),(0,r.Jd)(c),(0,r.YP)(i,(e,n)=>{"global"===t.themeVarsScope&&d(e,n)}),(0,r.YP)(()=>t.themeVarsScope,(t,e)=>{"global"===e&&d({},i.value),"global"===t&&d(i.value,{})}),"global"===t.themeVarsScope&&d(i.value,{})}return(0,r.JJ)(v,t),(0,r.m0)(()=>{void 0!==t.zIndex&&(0,u.H)(t.zIndex)}),()=>(0,r.Wm)(t.tag,{class:s(),style:"local"===t.themeVarsScope?i.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"),i=n("62568"),l=n("78335"),a=n("20358"),o=n("72555"),u=n("53419"),[c,s]=(0,i.do)("icon"),v=t=>null==t?void 0:t.includes("/"),f={dot:Boolean,tag:(0,l.SQ)("i"),name:String,size:l.Or,badge:l.Or,color:String,badgeProps:Object,classPrefix:String};e.Z=(0,r.aZ)({name:c,props:f,setup(t,e){var{slots:n}=e,i=(0,r.f3)(u.q9,null),l=(0,r.Fl)(()=>t.classPrefix||(null==i?void 0:i.iconPrefix)||s());return()=>{var{tag:e,dot:i,name:u,size:c,badge:f,color:d}=t,m=v(u);return(0,r.Wm)(o.Ct,(0,r.dG)({dot:i,tag:e,class:[l.value,m?"":"".concat(l.value,"-").concat(u)],style:{color:d,fontSize:(0,a.Nn)(c)},content:f},t.badgeProps),{default:()=>{var t;return[null===(t=n.default)||void 0===t?void 0:t.call(n),m&&(0,r.Wm)("img",{class:s("image"),src:u},null)]}})}}})},96422:function(t,e,n){"use strict";n("82116"),n("17989");var r=n("80681"),i=n("11848"),l=n("62568"),a=n("78335"),o=n("12308"),u=n("20358"),c=n("8051"),s=n("59479"),v=n("82210"),f=n("22300"),d=n("10023"),[m,p]=(0,l.do)("index-anchor"),h={index:a.Or};e.Z=(0,r.aZ)({name:m,props:h,setup(t,e){var{slots:n}=e,l=(0,i.qj)({top:0,left:null,rect:{top:0,height:0},width:null,active:!1}),a=(0,i.iH)(),{parent:m}=(0,f.NB)(s.oG);if(m){var h=()=>l.active&&m.props.sticky,g=(0,r.Fl)(()=>{var{zIndex:t,highlightColor:e}=m.props;if(h())return(0,o.l7)((0,u.As)(t),{left:l.left?"".concat(l.left,"px"):void 0,width:l.width?"".concat(l.width,"px"):void 0,transform:l.top?"translate3d(0, ".concat(l.top,"px, 0)"):void 0,color:e})});return(0,d.F)({state:l,getRect:(t,e)=>{var n=(0,f.EL)(a);return l.rect.height=n.height,t===window||t===document.body?l.rect.top=n.top+(0,v.oD)():l.rect.top=n.top+(0,v.cx)(t)-e.top,l.rect}}),()=>{var e=h();return(0,r.Wm)("div",{ref:a,style:{height:e?"".concat(l.rect.height,"px"):void 0}},[(0,r.Wm)("div",{style:g.value,class:[p({sticky:e}),{[c.xe]:e}]},[n.default?n.default():t.index])])}}}})},59479:function(t,e,n){"use strict";n.d(e,{oG:function(){return p}}),n("66786"),n("14529"),n("82116"),n("17989"),n("86795"),n("57856"),n("31053"),n("70629"),n("31564"),n("8649");var r=n("80681"),i=n("11848"),l=n("62568"),a=n("78335"),o=n("12308"),u=n("82210"),c=n("22300"),s=n("29609"),v=n("10023"),[f,d]=(0,l.do)("index-bar"),m={sticky:a.J5,zIndex:a.Or,teleport:[String,Object],highlightColor:String,stickyOffsetTop:(0,a.qM)(0),indexList:{type:Array,default:function(){return Array(26).fill("").map((t,e)=>String.fromCharCode(65+e))}}},p=Symbol(f);e.ZP=(0,r.aZ)({name:f,props:m,emits:["select","change"],setup(t,e){var n,l,{emit:a,slots:f}=e,m=(0,i.iH)(),h=(0,i.iH)(),g=(0,i.iH)(""),S=(0,s.o)(),x=(0,c.eo)(m),{children:b,linkChildren:y}=(0,c.$E)(p);y({props:t});var P=(0,r.Fl)(()=>{if((0,o.Xq)(t.zIndex))return{zIndex:+t.zIndex+1}}),Z=(0,r.Fl)(()=>{if(t.highlightColor)return{color:t.highlightColor}}),k=(e,n)=>{for(var r=b.length-1;r>=0;r--){var i=r>0?n[r-1].height:0;if(e+(t.sticky?i+t.stickyOffsetTop:0)>=n[r].top)return r}return -1},W=t=>b.find(e=>String(e.index)===t),w=()=>{if(!(0,u.xj)(m)){var{sticky:e,indexList:r}=t,i=(0,u.cx)(x.value),l=(0,c.EL)(x),a=b.map(t=>t.getRect(x.value,l)),o=-1;if(n){var s=W(n);s&&(o=k(s.getRect(x.value,l).top,a))}else o=k(i,a);g.value=r[o],e&&b.forEach((e,r)=>{var{state:u,$el:c}=e;if(r===o||r===o-1){var s=c.getBoundingClientRect();u.left=s.left,u.width=s.width}else u.left=null,u.width=null;if(r===o)u.active=!0,u.top=Math.max(t.stickyOffsetTop,a[r].top-i)+l.top;else if(r===o-1&&""===n){var v=a[o].top-i;u.active=v>0,u.top=v+l.top-a[r].height}else u.active=!1}),n=""}},O=()=>{(0,r.Y3)(w)};(0,c.OR)("scroll",w,{target:x,passive:!0}),(0,r.bv)(O),(0,r.YP)(()=>t.indexList,O),(0,r.YP)(g,t=>{t&&a("change",t)});var U=()=>t.indexList.map(t=>{var e=t===g.value;return(0,r.Wm)("span",{class:d("index",{active:e}),style:e?Z.value:void 0,"data-index":t},[t])}),C=e=>{var r=W(n=String(e));if(r){var i=(0,u.cx)(x.value),l=(0,c.EL)(x),{offsetHeight:o}=document.documentElement;if(r.$el.scrollIntoView(),i===o-l.height){w();return}t.sticky&&t.stickyOffsetTop&&(0,u.kn)((0,u.oD)()-t.stickyOffsetTop),a("select",r.index)}},H=t=>{var{index:e}=t.dataset;e&&C(e)},L=t=>{H(t.target)},V=()=>(0,r.Wm)("div",{ref:h,class:d("sidebar"),style:P.value,onClick:L,onTouchstartPassive:S.start},[U()]);return(0,v.F)({scrollTo:C}),(0,c.OR)("touchmove",t=>{if(S.move(t),S.isVertical()){(0,u.PF)(t);var{clientX:e,clientY:n}=t.touches[0],r=document.elementFromPoint(e,n);if(r){var{index:i}=r.dataset;i&&l!==i&&(l=i,H(r))}}},{target:h}),()=>{var e,n,i;return(0,r.Wm)("div",{ref:m,class:d()},[t.teleport?(0,r.Wm)(r.lR,{to:t.teleport},"function"!=typeof(i=n=V())&&("[object Object]"!==Object.prototype.toString.call(i)||(0,r.lA)(i))?{default:()=>[n]}:n):V(),null===(e=f.default)||void 0===e?void 0:e.call(f)])}}})}}]); |