1 |
- System.register(["./index-legacy-a314c7dd.js","./use-tab-status-legacy-03513754.js"],(function(e,i){"use strict";var r,t,o,n,a,d,l,s,u,c,f,g,v,h,b,p,m,x,T;return{setters:[e=>{r=e.c,t=e.b,o=e.m,n=e.t,a=e.d,d=e.r,l=e.bC,s=e.w,u=e.bD,c=e.y,f=e.Z,g=e._,v=e.a,h=e.z,b=e.$,p=e.bE,m=e.L,x=e.k},e=>{T=e.u}],execute:function(){const[i,k,y]=r("list"),B={error:Boolean,offset:t(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:o("down"),loadingText:String,finishedText:String,immediateCheck:n};var C=a({name:i,props:B,emits:["load","update:error","update:loading"],setup(e,{emit:i,slots:r}){const t=d(e.loading),o=d(),n=d(),a=T(),x=l(o),B=()=>{h((()=>{if(t.value||e.finished||e.disabled||e.error||!1===(null==a?void 0:a.value))return;const{direction:r}=e,d=+e.offset,l=b(x);if(!l.height||p(o))return;let s=!1;const u=b(n);s="up"===r?l.top-u.top<=d:u.bottom-l.bottom<=d,s&&(t.value=!0,i("update:loading",!0),i("load"))}))},C=()=>{if(e.finished){const i=r.finished?r.finished():e.finishedText;if(i)return v("div",{class:k("finished-text")},[i])}},S=()=>{i("update:error",!1),B()},w=()=>{if(e.error){const i=r.error?r.error():e.errorText;if(i)return v("div",{role:"button",class:k("error-text"),tabindex:0,onClick:S},[i])}},j=()=>{if(t.value&&!e.finished&&!e.disabled)return v("div",{class:k("loading")},[r.loading?r.loading():v(m,{class:k("loading-icon")},{default:()=>[e.loadingText||y("loading")]})])};return s((()=>[e.loading,e.finished,e.error]),B),a&&s(a,(e=>{e&&B()})),u((()=>{t.value=e.loading})),c((()=>{e.immediateCheck&&B()})),f({check:B}),g("scroll",B,{target:x,passive:!0}),()=>{var i;const a=null==(i=r.default)?void 0:i.call(r),d=v("div",{ref:n,class:k("placeholder")},null);return v("div",{ref:o,role:"feed",class:k(),"aria-busy":t.value},["down"===e.direction?a:d,j(),C(),w(),"up"===e.direction?a:d])}}});e("L",x(C))}}}));
|