1 |
- System.register(["./index-legacy-e6be1dcb.js","./use-tab-status-legacy-5a183110.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,y;return{setters:[e=>{r=e.c,t=e.b,o=e.m,n=e.t,a=e.d,d=e.r,l=e.by,s=e.w,u=e.bz,c=e.y,f=e.Z,g=e._,v=e.a,h=e.z,b=e.$,p=e.bA,m=e.L,x=e.k},e=>{y=e.u}],execute:function(){const[i,T,k]=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 S=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=y(),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"))}))},S=()=>{if(e.finished){const i=r.finished?r.finished():e.finishedText;if(i)return v("div",{class:T("finished-text")},[i])}},j=()=>{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:T("error-text"),tabindex:0,onClick:j},[i])}},C=()=>{if(t.value&&!e.finished&&!e.disabled)return v("div",{class:T("loading")},[r.loading?r.loading():v(m,{class:T("loading-icon")},{default:()=>[e.loadingText||k("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:T("placeholder")},null);return v("div",{ref:o,role:"feed",class:T(),"aria-busy":t.value},["down"===e.direction?a:d,C(),S(),w(),"up"===e.direction?a:d])}}});e("L",x(S))}}}));
|