index-legacy-c0bad110.js 1.8 KB

1
  1. System.register(["./index-legacy-9a26e0fa.js","./index-legacy-7035c0d5.js"],(function(e,i){"use strict";var r,t,o,n,d,l,a,s,c,u,f,g,h,v,x,p,b,m,T;return{setters:[e=>{r=e.c,t=e.o,o=e.q,n=e.t,d=e.d,l=e.r,a=e.bx,s=e.x,c=e.by,u=e.M,f=e.g,g=e.h,h=e.j,v=e.A,x=e.bz,p=e.bA,b=e.L,m=e.C},e=>{T=e.u}],execute:function(){const[i,y,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 C=d({name:i,props:B,emits:["load","update:error","update:loading"],setup(e,{emit:i,slots:r}){const t=l(e.loading),o=l(),n=l(),d=T(),m=a(o),B=()=>{v((()=>{if(t.value||e.finished||e.disabled||e.error||!1===(null==d?void 0:d.value))return;const{direction:r}=e,l=+e.offset,a=x(m);if(!a.height||p(o))return;let s=!1;const c=x(n);s="up"===r?a.top-c.top<=l:c.bottom-a.bottom<=l,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 h("div",{class:y("finished-text")},[i])}},S=()=>{i("update:error",!1),B()},j=()=>{if(e.error){const i=r.error?r.error():e.errorText;if(i)return h("div",{role:"button",class:y("error-text"),tabindex:0,onClick:S},[i])}},w=()=>{if(t.value&&!e.finished&&!e.disabled)return h("div",{class:y("loading")},[r.loading?r.loading():h(b,{class:y("loading-icon")},{default:()=>[e.loadingText||k("loading")]})])};return s((()=>[e.loading,e.finished,e.error]),B),d&&s(d,(e=>{e&&B()})),c((()=>{t.value=e.loading})),u((()=>{e.immediateCheck&&B()})),f({check:B}),g("scroll",B,{target:m,passive:!0}),()=>{var i;const d=null==(i=r.default)?void 0:i.call(r),l=h("div",{ref:n,class:y("placeholder")},null);return h("div",{ref:o,role:"feed",class:y(),"aria-busy":t.value},["down"===e.direction?d:l,w(),C(),j(),"up"===e.direction?d:l])}}});e("L",m(C))}}}));