mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
9.9 KiB
JavaScript
2 lines
9.9 KiB
JavaScript
/*! For license information please see 1970.61dbb69a.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["1970"],{41550:function(e,t,n){"use strict";n.r(t);var r=n("57918");n("35520");let a=r.Z;t.default=a},57918:function(e,t,n){"use strict";var r=n("80681"),a=n("11848"),o=n("57122"),u=n("73115"),l=n("96528"),i=n("54369");t.Z=(0,r.aZ)({__name:"index",setup(e){var t=(0,i.q)({"zh-CN":{title2:"\u7B80\u5355\u6A21\u5F0F",title3:"\u663E\u793A\u7701\u7565\u53F7",title4:"\u81EA\u5B9A\u4E49\u6309\u94AE",prevText:"\u4E0A\u4E00\u9875",nextText:"\u4E0B\u4E00\u9875"},"en-US":{title2:"Simple Mode",title3:"Show ellipses",title4:"Custom Button",prevText:"Prev",nextText:"Next"}}),n=(0,a.iH)(1),c=(0,a.iH)(1),s=(0,a.iH)(1),m=(0,a.iH)(1);return(e,i)=>{var d=(0,r.up)("demo-block");return(0,r.wg)(),(0,r.iD)(r.HY,null,[(0,r.Wm)(d,{title:(0,a.SU)(t)("basicUsage")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:n.value,"onUpdate:modelValue":i[0]||(i[0]=e=>n.value=e),"total-items":24,"items-per-page":5,"prev-text":(0,a.SU)(t)("prevText"),"next-text":(0,a.SU)(t)("nextText")},null,8,["modelValue","prev-text","next-text"])]),_:1},8,["title"]),(0,r.Wm)(d,{title:(0,a.SU)(t)("title2")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:c.value,"onUpdate:modelValue":i[1]||(i[1]=e=>c.value=e),"page-count":12,"prev-text":(0,a.SU)(t)("prevText"),"next-text":(0,a.SU)(t)("nextText"),mode:"simple",size:"small"},null,8,["modelValue","prev-text","next-text"])]),_:1},8,["title"]),(0,r.Wm)(d,{title:(0,a.SU)(t)("title3")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:s.value,"onUpdate:modelValue":i[2]||(i[2]=e=>s.value=e),"force-ellipses":"","total-items":125,"show-page-size":3,"prev-text":(0,a.SU)(t)("prevText"),"next-text":(0,a.SU)(t)("nextText")},null,8,["modelValue","prev-text","next-text"])]),_:1},8,["title"]),(0,r.Wm)(d,{title:(0,a.SU)(t)("title4")},{default:(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(u.ZP),{modelValue:m.value,"onUpdate:modelValue":i[3]||(i[3]=e=>m.value=e),"total-items":125,"show-page-size":5},{"prev-text":(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(l.ZP),{name:"arrow-left"})]),"next-text":(0,r.w5)(()=>[(0,r.Wm)((0,a.SU)(l.ZP),{name:"arrow"})]),page:(0,r.w5)(e=>{var{text:t}=e;return[(0,r.Uk)((0,o.zw)(t),1)]}),_:1},8,["modelValue"])]),_:1},8,["title"])],64)}}})},72555:function(e,t,n){"use strict";n.d(t,{Ct:function(){return o}});var r=n("63112"),a=n("63022"),o=(0,r.n)(a.Z);t.ZP=o},14517:function(e,t,n){"use strict";n.d(t,{H:function(){return o},t:function(){return a}});var r=2e3,a=()=>++r,o=e=>{r=e}},96528:function(e,t,n){"use strict";n.d(t,{JO:function(){return o}});var r=n("63112"),a=n("28779"),o=(0,r.n)(a.Z);t.ZP=o},73115:function(e,t,n){"use strict";var r=n("63112"),a=n("11337"),o=(0,r.n)(a.Z);t.ZP=o},8051:function(e,t,n){"use strict";n.d(t,{Cp:function(){return v},T5:function(){return r},WN:function(){return d},_K:function(){return i},a8:function(){return o},dt:function(){return u},e9:function(){return m},k7:function(){return a},mH:function(){return f},pj:function(){return s},r5:function(){return c},xe:function(){return l}}),n("86795");var r="van-hairline",a="".concat(r,"--top"),o="".concat(r,"--left"),u="".concat(r,"--right"),l="".concat(r,"--bottom"),i="".concat(r,"--surround"),c="".concat(r,"--top-bottom"),s="".concat(r,"-unset--top-bottom"),m="van-haptics-feedback",d=Symbol("van-form"),v=500,f=5},78335:function(e,t,n){"use strict";n.d(t,{Ce:function(){return l},J5:function(){return o},Or:function(){return a},SI:function(){return c},SQ:function(){return s},Vg:function(){return r},ir:function(){return u},qM:function(){return i}});var r=null,a=[Number,String],o={type:Boolean,default:!0},u=e=>({type:e,required:!0}),l=()=>({type:Array,default:()=>[]}),i=e=>({type:Number,default:e}),c=e=>({type:a,default:e}),s=e=>({type:String,default:e})},63112:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n("20358");function a(e){return e.install=t=>{var{name:n}=e;n&&(t.component(n,e),t.component((0,r._A)("-".concat(n)),e))},e}},63022:function(e,t,n){"use strict";n("82116"),n("17989"),n("56115"),n("59644"),n("89176");var r=n("80681"),a=n("62568"),o=n("78335"),u=n("12308"),l=n("20358"),[i,c]=(0,a.do)("badge"),s={dot:Boolean,max:o.Or,tag:(0,o.SQ)("div"),color:String,offset:Array,content:o.Or,showZero:o.J5,position:(0,o.SQ)("top-right")};t.Z=(0,r.aZ)({name:i,props:s,setup(e,t){var{slots:n}=t,a=()=>{if(n.content)return!0;var{content:t,showZero:r}=e;return(0,u.Xq)(t)&&""!==t&&(r||0!==t&&"0"!==t)},o=()=>{var{dot:t,max:r,content:o}=e;if(!t&&a())return n.content?n.content():(0,u.Xq)(r)&&(0,u.kE)(o)&&+o>+r?"".concat(r,"+"):o},i=e=>e.startsWith("-")?e.replace("-",""):"-".concat(e),s=(0,r.Fl)(()=>{var t={background:e.color};if(e.offset){var[r,a]=e.offset,{position:o}=e,[u,c]=o.split("-");n.default?("number"==typeof a?t[u]=(0,l.Nn)("top"===u?a:-a):t[u]="top"===u?(0,l.Nn)(a):i(a),"number"==typeof r?t[c]=(0,l.Nn)("left"===c?r:-r):t[c]="left"===c?(0,l.Nn)(r):i(r)):(t.marginTop=(0,l.Nn)(a),t.marginLeft=(0,l.Nn)(r))}return t}),m=()=>{if(a()||e.dot)return(0,r.Wm)("div",{class:c([e.position,{dot:e.dot,fixed:!!n.default}]),style:s.value},[o()])};return()=>{if(n.default){var{tag:t}=e;return(0,r.Wm)(t,{class:c("wrapper")},{default:()=>[n.default(),m()]})}return m()}}})},53419:function(e,t,n){"use strict";n.d(t,{q9:function(){return m}}),n("82116"),n("17989"),n("86795"),n("56115"),n("59644"),n("31564"),n("8649"),n("70629");var r=n("80681"),a=n("62568"),o=n("78335"),u=n("20358"),l=n("12308"),i=n("14517"),[c,s]=(0,a.do)("config-provider"),m=Symbol(c),d={tag:(0,o.SQ)("div"),theme:(0,o.SQ)("light"),zIndex:Number,themeVars:Object,themeVarsDark:Object,themeVarsLight:Object,themeVarsScope:(0,o.SQ)("local"),iconPrefix:String};function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object.keys(e).forEach(n=>{e[n]!==t[n]&&document.documentElement.style.setProperty(n,e[n])}),Object.keys(t).forEach(t=>{!e[t]&&document.documentElement.style.removeProperty(t)})}t.ZP=(0,r.aZ)({name:c,props:d,setup(e,t){var{slots:n}=t,a=(0,r.Fl)(()=>{var t,n;return t=(0,l.l7)({},e.themeVars,"dark"===e.theme?e.themeVarsDark:e.themeVarsLight),n={},Object.keys(t).forEach(e=>{var r=(0,u.GL)(e).replace(/([a-zA-Z])(\d)/g,"$1-$2");n["--van-".concat(r)]=t[e]}),n});if(l._f){var o=()=>{document.documentElement.classList.add("van-theme-".concat(e.theme))},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.theme;document.documentElement.classList.remove("van-theme-".concat(t))};(0,r.YP)(()=>e.theme,(e,t)=>{t&&c(t),o()},{immediate:!0}),(0,r.dl)(o),(0,r.se)(c),(0,r.Jd)(c),(0,r.YP)(a,(t,n)=>{"global"===e.themeVarsScope&&v(t,n)}),(0,r.YP)(()=>e.themeVarsScope,(e,t)=>{"global"===t&&v({},a.value),"global"===e&&v(a.value,{})}),"global"===e.themeVarsScope&&v(a.value,{})}return(0,r.JJ)(m,e),(0,r.m0)(()=>{void 0!==e.zIndex&&(0,i.H)(e.zIndex)}),()=>(0,r.Wm)(e.tag,{class:s(),style:"local"===e.themeVarsScope?a.value:void 0},{default:()=>{var e;return[null===(e=n.default)||void 0===e?void 0:e.call(n)]}})}})},28779:function(e,t,n){"use strict";n("82116"),n("17989"),n("24660");var r=n("80681"),a=n("62568"),o=n("78335"),u=n("20358"),l=n("72555"),i=n("53419"),[c,s]=(0,a.do)("icon"),m=e=>null==e?void 0:e.includes("/"),d={dot:Boolean,tag:(0,o.SQ)("i"),name:String,size:o.Or,badge:o.Or,color:String,badgeProps:Object,classPrefix:String};t.Z=(0,r.aZ)({name:c,props:d,setup(e,t){var{slots:n}=t,a=(0,r.f3)(i.q9,null),o=(0,r.Fl)(()=>e.classPrefix||(null==a?void 0:a.iconPrefix)||s());return()=>{var{tag:t,dot:a,name:i,size:c,badge:d,color:v}=e,f=m(i);return(0,r.Wm)(l.Ct,(0,r.dG)({dot:a,tag:t,class:[o.value,f?"":"".concat(o.value,"-").concat(i)],style:{color:v,fontSize:(0,u.Nn)(c)},content:d},e.badgeProps),{default:()=>{var e;return[null===(e=n.default)||void 0===e?void 0:e.call(n),f&&(0,r.Wm)("img",{class:s("image"),src:i},null)]}})}}})},11337:function(e,t,n){"use strict";n("82116"),n("17989"),n("61557"),n("51185"),n("66786"),n("14529");var r=n("80681"),a=n("62568"),o=n("78335"),u=n("20358"),l=n("8051"),[i,c,s]=(0,a.do)("pagination"),m=(e,t,n)=>({number:e,text:t,active:n}),d={mode:(0,o.SQ)("multi"),prevText:String,nextText:String,pageCount:(0,o.SI)(0),modelValue:(0,o.qM)(0),totalItems:(0,o.SI)(0),showPageSize:(0,o.SI)(5),itemsPerPage:(0,o.SI)(10),forceEllipses:Boolean,showPrevButton:o.J5,showNextButton:o.J5};t.Z=(0,r.aZ)({name:i,props:d,emits:["change","update:modelValue"],setup(e,t){var{emit:n,slots:a}=t,o=(0,r.Fl)(()=>{var{pageCount:t,totalItems:n,itemsPerPage:r}=e;return Math.max(1,+t||Math.ceil(+n/+r))}),i=(0,r.Fl)(()=>{var t=[],n=o.value,r=+e.showPageSize,{modelValue:a,forceEllipses:u}=e,l=1,i=n,c=r<n;c&&(i=(l=Math.max(a-Math.floor(r/2),1))+r-1)>n&&(l=(i=n)-r+1);for(var s=l;s<=i;s++){var d=m(s,s,s===a);t.push(d)}if(c&&r>0&&u){if(l>1){var v=m(l-1,"...");t.unshift(v)}if(i<n){var f=m(i+1,"...");t.push(f)}}return t}),d=(t,r)=>{t=(0,u.uZ)(t,1,o.value),e.modelValue!==t&&(n("update:modelValue",t),r&&n("change",t))};(0,r.m0)(()=>d(e.modelValue));var v=()=>(0,r.Wm)("li",{class:c("page-desc")},[a.pageDesc?a.pageDesc():"".concat(e.modelValue,"/").concat(o.value)]),f=()=>{var{mode:t,modelValue:n,showPrevButton:o}=e;if(o){var u=a["prev-text"],i=1===n;return(0,r.Wm)("li",{class:[c("item",{disabled:i,border:"simple"===t,prev:!0}),l._K]},[(0,r.Wm)("button",{type:"button",disabled:i,onClick:()=>d(n-1,!0)},[u?u():e.prevText||s("prev")])])}},p=()=>{var{mode:t,modelValue:n,showNextButton:u}=e;if(u){var i=a["next-text"],m=n===o.value;return(0,r.Wm)("li",{class:[c("item",{disabled:m,border:"simple"===t,next:!0}),l._K]},[(0,r.Wm)("button",{type:"button",disabled:m,onClick:()=>d(n+1,!0)},[i?i():e.nextText||s("next")])])}},x=()=>i.value.map(e=>(0,r.Wm)("li",{class:[c("item",{active:e.active,page:!0}),l._K]},[(0,r.Wm)("button",{type:"button","aria-current":e.active||void 0,onClick:()=>d(e.number,!0)},[a.page?a.page(e):e.text])]));return()=>(0,r.Wm)("nav",{role:"navigation",class:c()},[(0,r.Wm)("ul",{class:c("items")},[f(),"simple"===e.mode?v():x(),p()])])}})},35520:function(e,t,n){"use strict";n.r(e.exports={})},35393:function(e,t,n){"use strict";n.r(e.exports={})}}]); |