deep-clone-legacy-90f8a824.js 2.0 KB

1
  1. System.register(["./index-legacy-1d8f80b3.js"],(function(e,t){"use strict";var o,r,n,a,l,s,i,c,u,f,d,b,g,p,m,y,w,h,v;return{setters:[e=>{o=e.y,r=e.E,n=e.d,a=e.I,l=e.r,s=e.af,i=e.a1,c=e.n,u=e.ab,f=e.j,d=e.at,b=e.az,g=e.a,p=e.U,m=e.a7,y=e.ar,w=e.W,h=e.ag,v=e.w}],execute:function(){const[t,k]=o("notice-bar"),x={text:String,mode:String,color:String,delay:r(1),speed:r(60),leftIcon:String,wrapable:Boolean,background:String,scrollable:{type:Boolean,"default":null}};var S=n({name:t,props:x,emits:["close","replay"],setup(e,{emit:t,slots:o}){let r,n=0,v=0;const x=a(),S=a(),j=l({show:!0,offset:0,duration:0}),I=o=>{"closeable"===e.mode&&(j.show=!1,t("close",o))},A=()=>{if(o["right-icon"])return o["right-icon"]();const t="closeable"===e.mode?"cross":"link"===e.mode?"arrow":void 0;return t?g(p,{name:t,"class":k("right-icon"),onClick:I},null):void 0},T=()=>{j.offset=n,j.duration=0,w((()=>{y((()=>{j.offset=-v,j.duration=(v+n)/+e.speed,t("replay")}))}))},B=()=>{const t=!1===e.scrollable&&!e.wrapable,r={transform:j.offset?`translateX(${j.offset}px)`:"",transitionDuration:`${j.duration}s`};return g("div",{ref:x,role:"marquee","class":k("wrap")},[g("div",{ref:S,style:r,"class":[k("content"),{"van-ellipsis":t}],onTransitionend:T},[o["default"]?o["default"]():e.text])])},E=()=>{const{delay:t,speed:o,scrollable:a}=e,l=h(t)?1e3*+t:0;n=0,v=0,j.offset=0,j.duration=0,clearTimeout(r),r=setTimeout((()=>{if(!x.value||!S.value||!1===a)return;const e=m(x).width,t=m(S).width;(a||t>e)&&y((()=>{n=e,v=t,j.offset=-v,j.duration=v/+o}))}),l)};return s(E),i(E),c("pageshow",E),u({reset:E}),f((()=>[e.text,e.scrollable]),E),()=>{const{color:t,wrapable:r,background:n}=e;return d(g("div",{role:"alert","class":k({wrapable:r}),style:{color:t,background:n}},[o["left-icon"]?o["left-icon"]():e.leftIcon?g(p,{"class":k("left-icon"),name:e.leftIcon},null):void 0,B(),A()]),[[b,j.show]])}}});e("N",v(S));const j=e("d",(e=>{if(null===e)return null;const t=Object.assign({},e);return Object.keys(t).forEach((o=>t[o]="object"==typeof e[o]?j(e[o]):e[o])),Array.isArray(e)?(t.length=e.length,Array.from(t)):t}))}}}));