mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
/*! For license information please see 5852.718e728c.js.LICENSE.txt */
|
|
(self.webpackChunk=self.webpackChunk||[]).push([["5852"],{44779:function(t,e,r){"use strict";r.r(e);var n=r("62346");r("39569");let a=n.Z;e.default=a},62346:function(t,e,r){"use strict";var n=r("80681"),a=r("11848"),o=r("57122"),i=r("99497"),l=r("91752"),c=r("54369"),u={class:"demo-watermark-wrapper"},s={class:"demo-watermark-wrapper"},d={class:"demo-watermark-wrapper"},m={class:"demo-watermark-wrapper"},f={class:"demo-watermark-wrapper"},p={class:"demo-watermark-wrapper"},g=(0,n._)("div",{style:{background:"linear-gradient(45deg, #000 0, #000 50%, #fff 50%)"}},[(0,n._)("p",{style:{"mix-blend-mode":"difference",color:"#fff"}}," Vant watermark ")],-1);e.Z=(0,n.aZ)({__name:"index",setup(t){var e=(0,c.q)({"zh-CN":{switch:"\u5207\u6362",customOpacity:"\u81EA\u5B9A\u4E49\u900F\u660E\u5EA6",customGap:"\u81EA\u5B9A\u4E49\u95F4\u9694",customImage:"\u81EA\u5B9A\u4E49\u56FE\u7247",customRotate:"\u81EA\u5B9A\u4E49\u503E\u659C\u89D2\u5EA6",displayRange:"\u663E\u793A\u8303\u56F4",htmlWatermark:"HTML \u6C34\u5370",textWatermark:"\u6587\u5B57\u6C34\u5370",imageWatermark:"\u56FE\u7247\u6C34\u5370"},"en-US":{switch:"Switch",customOpacity:"Custom opacity",customGap:"Custom Gap",customRotate:"Custom Rotate",displayRange:"Display Range",htmlWatermark:"HTML Watermark",textWatermark:"Text Watermark",imageWatermark:"Image Watermark"}}),r=(0,a.iH)(!1);return(t,c)=>{var v=(0,n.up)("demo-block");return(0,n.wg)(),(0,n.iD)(n.HY,null,[(0,n.Wm)(v,{title:(0,a.SU)(e)("textWatermark")},{default:(0,n.w5)(()=>[(0,n._)("div",u,[(0,n.Wm)((0,a.SU)(l.ZP),{content:"Vant","full-page":!1})])]),_:1},8,["title"]),(0,n.Wm)(v,{title:(0,a.SU)(e)("imageWatermark")},{default:(0,n.w5)(()=>[(0,n._)("div",s,[(0,n.Wm)((0,a.SU)(l.ZP),{image:"https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png",opacity:"0.2","full-page":!1})])]),_:1},8,["title"]),(0,n.Wm)(v,{title:(0,a.SU)(e)("customGap")},{default:(0,n.w5)(()=>[(0,n._)("div",d,[(0,n.Wm)((0,a.SU)(l.ZP),{image:"https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png","gap-x":30,"gap-y":10,opacity:"0.2","full-page":!1})])]),_:1},8,["title"]),(0,n.Wm)(v,{title:(0,a.SU)(e)("customRotate")},{default:(0,n.w5)(()=>[(0,n._)("div",m,[(0,n.Wm)((0,a.SU)(l.ZP),{image:"https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png",rotate:"22",opacity:"0.2","full-page":!1})])]),_:1},8,["title"]),(0,n.Wm)(v,{title:(0,a.SU)(e)("displayRange")},{default:(0,n.w5)(()=>[(0,n._)("div",f,[(0,n.Wm)((0,a.SU)(i.ZP),{type:"primary",onClick:c[0]||(c[0]=t=>r.value=!r.value)},{default:(0,n.w5)(()=>[(0,n.Uk)((0,o.zw)((0,a.SU)(e)("switch")),1)]),_:1}),(0,n.Wm)((0,a.SU)(l.ZP),{"full-page":r.value,opacity:"0.2",image:"https://fastly.jsdelivr.net/npm/@vant/assets/vant-watermark.png"},null,8,["full-page"])])]),_:1},8,["title"]),(0,n.Wm)(v,{title:(0,a.SU)(e)("htmlWatermark")},{default:(0,n.w5)(()=>[(0,n._)("div",p,[(0,n.Wm)((0,a.SU)(l.ZP),{width:150,"full-page":!1},{content:(0,n.w5)(()=>[g]),_:1})])]),_:1},8,["title"])],64)}}})},72555:function(t,e,r){"use strict";r.d(e,{Ct:function(){return o}});var n=r("63112"),a=r("63022"),o=(0,n.n)(a.Z);e.ZP=o},99497:function(t,e,r){"use strict";r.d(e,{zx:function(){return o}});var n=r("63112"),a=r("14314"),o=(0,n.n)(a.Z);e.ZP=o},14517:function(t,e,r){"use strict";r.d(e,{H:function(){return o},t:function(){return a}});var n=2e3,a=()=>++n,o=t=>{n=t}},6149:function(t,e,r){"use strict";r.d(e,{BC:function(){return o},g2:function(){return a},yj:function(){return i}}),r("56115"),r("59644");var n=r("80681"),a={to:[String,Object],url:String,replace:Boolean};function o(t){var{to:e,url:r,replace:n,$router:a}=t;e&&a?a[n?"replace":"push"](e):r&&(n?location.replace(r):location.href=r)}function i(){var t=(0,n.FN)().proxy;return()=>o(t)}},96528:function(t,e,r){"use strict";r.d(e,{JO:function(){return o}});var n=r("63112"),a=r("28779"),o=(0,n.n)(a.Z);e.ZP=o},95786:function(t,e,r){"use strict";r.d(e,{gb:function(){return o}});var n=r("63112"),a=r("2309"),o=(0,n.n)(a.Z);e.ZP=o},8051:function(t,e,r){"use strict";r.d(e,{Cp:function(){return f},T5:function(){return n},WN:function(){return m},_K:function(){return c},a8:function(){return o},dt:function(){return i},e9:function(){return d},k7:function(){return a},mH:function(){return p},pj:function(){return s},r5:function(){return u},xe:function(){return l}}),r("86795");var n="van-hairline",a="".concat(n,"--top"),o="".concat(n,"--left"),i="".concat(n,"--right"),l="".concat(n,"--bottom"),c="".concat(n,"--surround"),u="".concat(n,"--top-bottom"),s="".concat(n,"-unset--top-bottom"),d="van-haptics-feedback",m=Symbol("van-form"),f=500,p=5},78335:function(t,e,r){"use strict";r.d(e,{Ce:function(){return l},J5:function(){return o},Or:function(){return a},SI:function(){return u},SQ:function(){return s},Vg:function(){return n},ir:function(){return i},qM:function(){return c}});var n=null,a=[Number,String],o={type:Boolean,default:!0},i=t=>({type:t,required:!0}),l=()=>({type:Array,default:()=>[]}),c=t=>({type:Number,default:t}),u=t=>({type:a,default:t}),s=t=>({type:String,default:t})},63112:function(t,e,r){"use strict";r.d(e,{n:function(){return a}});var n=r("20358");function a(t){return t.install=e=>{var{name:r}=t;r&&(e.component(r,t),e.component((0,n._A)("-".concat(r)),t))},t}},91752:function(t,e,r){"use strict";var n=r("63112"),a=r("81846"),o=(0,n.n)(a.Z);e.ZP=o},63022:function(t,e,r){"use strict";r("82116"),r("17989"),r("56115"),r("59644"),r("89176");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("12308"),l=r("20358"),[c,u]=(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")};e.Z=(0,n.aZ)({name:c,props:s,setup(t,e){var{slots:r}=e,a=()=>{if(r.content)return!0;var{content:e,showZero:n}=t;return(0,i.Xq)(e)&&""!==e&&(n||0!==e&&"0"!==e)},o=()=>{var{dot:e,max:n,content:o}=t;if(!e&&a())return r.content?r.content():(0,i.Xq)(n)&&(0,i.kE)(o)&&+o>+n?"".concat(n,"+"):o},c=t=>t.startsWith("-")?t.replace("-",""):"-".concat(t),s=(0,n.Fl)(()=>{var e={background:t.color};if(t.offset){var[n,a]=t.offset,{position:o}=t,[i,u]=o.split("-");r.default?("number"==typeof a?e[i]=(0,l.Nn)("top"===i?a:-a):e[i]="top"===i?(0,l.Nn)(a):c(a),"number"==typeof n?e[u]=(0,l.Nn)("left"===u?n:-n):e[u]="left"===u?(0,l.Nn)(n):c(n)):(e.marginTop=(0,l.Nn)(a),e.marginLeft=(0,l.Nn)(n))}return e}),d=()=>{if(a()||t.dot)return(0,n.Wm)("div",{class:u([t.position,{dot:t.dot,fixed:!!r.default}]),style:s.value},[o()])};return()=>{if(r.default){var{tag:e}=t;return(0,n.Wm)(e,{class:u("wrapper")},{default:()=>[r.default(),d()]})}return d()}}})},14314:function(t,e,r){"use strict";r("82116"),r("17989"),r("24660");var n=r("80681"),a=r("62568"),o=r("12308"),i=r("78335"),l=r("82210"),c=r("8051"),u=r("6149"),s=r("96528"),d=r("95786"),[m,f]=(0,a.do)("button"),p=(0,o.l7)({},u.g2,{tag:(0,i.SQ)("button"),text:String,icon:String,type:(0,i.SQ)("default"),size:(0,i.SQ)("normal"),color:String,block:Boolean,plain:Boolean,round:Boolean,square:Boolean,loading:Boolean,hairline:Boolean,disabled:Boolean,iconPrefix:String,nativeType:(0,i.SQ)("button"),loadingSize:i.Or,loadingText:String,loadingType:String,iconPosition:(0,i.SQ)("left")});e.Z=(0,n.aZ)({name:m,props:p,emits:["click"],setup(t,e){var{emit:r,slots:a}=e,o=(0,u.yj)(),i=()=>a.loading?a.loading():(0,n.Wm)(d.gb,{size:t.loadingSize,type:t.loadingType,class:f("loading")},null),m=()=>t.loading?i():a.icon?(0,n.Wm)("div",{class:f("icon")},[a.icon()]):t.icon?(0,n.Wm)(s.JO,{name:t.icon,class:f("icon"),classPrefix:t.iconPrefix},null):void 0,p=()=>{var e;if(e=t.loading?t.loadingText:a.default?a.default():t.text)return(0,n.Wm)("span",{class:f("text")},[e])},g=()=>{var{color:e,plain:r}=t;if(e){var n={color:r?e:"white"};return!r&&(n.background=e),e.includes("gradient")?n.border=0:n.borderColor=e,n}},v=e=>{t.loading?(0,l.PF)(e):!t.disabled&&(r("click",e),o())};return()=>{var{tag:e,type:r,size:a,block:o,round:i,plain:l,square:u,loading:s,disabled:d,hairline:h,nativeType:y,iconPosition:w}=t,S=[f([r,a,{plain:l,block:o,round:i,square:u,loading:s,disabled:d,hairline:h}]),{[c._K]:h}];return(0,n.Wm)(e,{type:y,class:S,style:g(),disabled:d,onClick:v},{default:()=>[(0,n.Wm)("div",{class:f("content")},["left"===w&&m(),p(),"right"===w&&m()])]})}}})},53419:function(t,e,r){"use strict";r.d(e,{q9:function(){return d}}),r("82116"),r("17989"),r("86795"),r("56115"),r("59644"),r("31564"),r("8649"),r("70629");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("20358"),l=r("12308"),c=r("14517"),[u,s]=(0,a.do)("config-provider"),d=Symbol(u),m={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 f(){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(r=>{t[r]!==e[r]&&document.documentElement.style.setProperty(r,t[r])}),Object.keys(e).forEach(e=>{!t[e]&&document.documentElement.style.removeProperty(e)})}e.ZP=(0,n.aZ)({name:u,props:m,setup(t,e){var{slots:r}=e,a=(0,n.Fl)(()=>{var e,r;return e=(0,l.l7)({},t.themeVars,"dark"===t.theme?t.themeVarsDark:t.themeVarsLight),r={},Object.keys(e).forEach(t=>{var n=(0,i.GL)(t).replace(/([a-zA-Z])(\d)/g,"$1-$2");r["--van-".concat(n)]=e[t]}),r});if(l._f){var o=()=>{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,n.YP)(()=>t.theme,(t,e)=>{e&&u(e),o()},{immediate:!0}),(0,n.dl)(o),(0,n.se)(u),(0,n.Jd)(u),(0,n.YP)(a,(e,r)=>{"global"===t.themeVarsScope&&f(e,r)}),(0,n.YP)(()=>t.themeVarsScope,(t,e)=>{"global"===e&&f({},a.value),"global"===t&&f(a.value,{})}),"global"===t.themeVarsScope&&f(a.value,{})}return(0,n.JJ)(d,t),(0,n.m0)(()=>{void 0!==t.zIndex&&(0,c.H)(t.zIndex)}),()=>(0,n.Wm)(t.tag,{class:s(),style:"local"===t.themeVarsScope?a.value:void 0},{default:()=>{var t;return[null===(t=r.default)||void 0===t?void 0:t.call(r)]}})}})},28779:function(t,e,r){"use strict";r("82116"),r("17989"),r("24660");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("20358"),l=r("72555"),c=r("53419"),[u,s]=(0,a.do)("icon"),d=t=>null==t?void 0:t.includes("/"),m={dot:Boolean,tag:(0,o.SQ)("i"),name:String,size:o.Or,badge:o.Or,color:String,badgeProps:Object,classPrefix:String};e.Z=(0,n.aZ)({name:u,props:m,setup(t,e){var{slots:r}=e,a=(0,n.f3)(c.q9,null),o=(0,n.Fl)(()=>t.classPrefix||(null==a?void 0:a.iconPrefix)||s());return()=>{var{tag:e,dot:a,name:c,size:u,badge:m,color:f}=t,p=d(c);return(0,n.Wm)(l.Ct,(0,n.dG)({dot:a,tag:e,class:[o.value,p?"":"".concat(o.value,"-").concat(c)],style:{color:f,fontSize:(0,i.Nn)(u)},content:m},t.badgeProps),{default:()=>{var t;return[null===(t=r.default)||void 0===t?void 0:t.call(r),p&&(0,n.Wm)("img",{class:s("image"),src:c},null)]}})}}})},2309:function(t,e,r){"use strict";r("82116"),r("17989"),r("66786"),r("14529");var n=r("80681"),a=r("62568"),o=r("78335"),i=r("12308"),l=r("20358"),[c,u]=(0,a.do)("loading"),s=Array(12).fill(null).map((t,e)=>(0,n.Wm)("i",{class:u("line",String(e+1))},null)),d=(0,n.Wm)("svg",{class:u("circular"),viewBox:"25 25 50 50"},[(0,n.Wm)("circle",{cx:"50",cy:"50",r:"20",fill:"none"},null)]),m={size:o.Or,type:(0,o.SQ)("circular"),color:String,vertical:Boolean,textSize:o.Or,textColor:String};e.Z=(0,n.aZ)({name:c,props:m,setup(t,e){var{slots:r}=e,a=(0,n.Fl)(()=>(0,i.l7)({color:t.color},(0,l.Xn)(t.size))),o=()=>{var e="spinner"===t.type?s:d;return(0,n.Wm)("span",{class:u("spinner",t.type),style:a.value},[r.icon?r.icon():e])},c=()=>{if(r.default){var e;return(0,n.Wm)("span",{class:u("text"),style:{fontSize:(0,l.Nn)(t.textSize),color:null!==(e=t.textColor)&&void 0!==e?e:t.color}},[r.default()])}};return()=>{var{type:e,vertical:r}=t;return(0,n.Wm)("div",{class:u([e,{vertical:r}]),"aria-live":"polite","aria-busy":!0},[o(),c()])}}})},81846:function(t,e,r){"use strict";r("82116"),r("17989"),r("61322"),r("30480"),r("95128"),r("31042"),r("13466");var n=r("80681"),a=r("11848"),o=r("62568"),i=r("78335"),l=r("12308"),c=r("20358"),[u,s]=(0,o.do)("watermark"),d={gapX:(0,i.qM)(0),gapY:(0,i.qM)(0),image:String,width:(0,i.qM)(100),height:(0,i.qM)(100),rotate:(0,i.SI)(-22),zIndex:i.Or,content:String,opacity:i.Or,fullPage:i.J5,textColor:(0,i.SQ)("#dcdee0")};e.Z=(0,n.aZ)({name:u,props:d,setup(t,e){var{slots:r}=e,o=(0,a.iH)(),i=(0,a.iH)(""),u=(0,a.iH)(""),d=()=>{var e={transformOrigin:"center",transform:"rotate(".concat(t.rotate,"deg)")},a=t.width+t.gapX,o=t.height+t.gapY;return(0,n.Wm)("svg",{viewBox:"0 0 ".concat(a," ").concat(o),width:a,height:o,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",style:{padding:"0 ".concat(t.gapX,"px ").concat(t.gapY,"px 0"),opacity:t.opacity}},[t.image&&!r.content?(0,n.Wm)("image",{href:u.value,"xlink:href":u.value,x:"0",y:"0",width:t.width,height:t.height,style:e},null):(0,n.Wm)("foreignObject",{x:"0",y:"0",width:t.width,height:t.height},[(0,n.Wm)("div",{xmlns:"http://www.w3.org/1999/xhtml",style:e},[r.content?r.content():(0,n.Wm)("span",{style:{color:t.textColor}},[t.content])])])])},m=t=>{var e=document.createElement("canvas"),r=new Image;r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r.onload=()=>{e.width=r.naturalWidth,e.height=r.naturalHeight;var t=e.getContext("2d");null==t||t.drawImage(r,0,0),u.value=e.toDataURL()},r.src=t},f=t=>{var e=new Blob([t],{type:"image/svg+xml"});return URL.createObjectURL(e)};return(0,n.m0)(()=>{t.image&&m(t.image)}),(0,n.YP)(()=>[u.value,t.content,t.textColor,t.height,t.width,t.rotate,t.gapX,t.gapY],()=>{(0,n.Y3)(()=>{o.value&&(i.value&&URL.revokeObjectURL(i.value),i.value=f(o.value.innerHTML))})},{immediate:!0}),(0,n.Ah)(()=>{i.value&&URL.revokeObjectURL(i.value)}),()=>{var e=(0,l.l7)({backgroundImage:"url(".concat(i.value,")")},(0,c.As)(t.zIndex));return(0,n.Wm)("div",{class:s({full:t.fullPage}),style:e},[(0,n.Wm)("div",{class:s("wrapper"),ref:o},[d()])])}}})},39569:function(t,e,r){"use strict";r.r(t.exports={})},94550:function(t,e,r){"use strict";r.r(t.exports={})}}]); |