index-legacy-1553265e.js 2.6 KB

1
  1. System.register(["./index-legacy-c44d5eaa.js"],(function(e,t){"use strict";var o,i,r,n,a,l,s,d,c,u,v,f,g,p,h,b,x,k,m,C,S,T;return{setters:[e=>{o=e.b9,i=e.c1,r=e.bg,n=e.bf,a=e.d,l=e.l,s=e.c2,d=e.c3,c=e.w,u=e.c4,v=e.c,f=e.c5,g=e.c6,p=e.f,h=e.aF,b=e.c7,x=e.c8,k=e.c9,m=e.bk,C=e.e,S=e.be,T=e.bb}],execute:function(){const[t,y,w]=o("list"),B={error:Boolean,offset:i(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:r("down"),loadingText:String,finishedText:String,immediateCheck:n};var P=a({name:t,props:B,emits:["load","update:error","update:loading"],setup(e,{emit:t,slots:o}){const i=l(e.loading),r=l(),n=l(),a=s(),m=d(r),C=()=>{h((()=>{if(i.value||e.finished||e.disabled||e.error||!1===(null==a?void 0:a.value))return;const{direction:o}=e,l=+e.offset,s=b(m);if(!s.height||x(r))return;let d=!1;const c=b(n);d="up"===o?s.top-c.top<=l:c.bottom-s.bottom<=l,d&&(i.value=!0,t("update:loading",!0),t("load"))}))},S=()=>{if(e.finished){const t=o.finished?o.finished():e.finishedText;if(t)return p("div",{class:y("finished-text")},[t])}},T=()=>{t("update:error",!1),C()},B=()=>{if(e.error){const t=o.error?o.error():e.errorText;if(t)return p("div",{role:"button",class:y("error-text"),tabindex:0,onClick:T},[t])}},P=()=>{if(i.value&&!e.finished&&!e.disabled)return p("div",{class:y("loading")},[o.loading?o.loading():p(k,{class:y("loading-icon")},{default:()=>[e.loadingText||w("loading")]})])};return c((()=>[e.loading,e.finished,e.error]),C),a&&c(a,(e=>{e&&C()})),u((()=>{i.value=e.loading})),v((()=>{e.immediateCheck&&C()})),f({check:C}),g("scroll",C,{target:m,passive:!0}),()=>{var t;const a=null==(t=o.default)?void 0:t.call(o),l=p("div",{ref:n,class:y("placeholder")},null);return p("div",{ref:r,role:"feed",class:y(),"aria-busy":i.value},["down"===e.direction?a:l,P(),S(),B(),"up"===e.direction?a:l])}}});e("L",m(P));const[$,W]=o("progress"),j={color:String,inactive:Boolean,pivotText:String,textColor:String,showPivot:n,pivotColor:String,trackColor:String,strokeWidth:S,percentage:{type:S,default:0,validator:e=>+e>=0&&+e<=100}};var F=a({name:$,props:j,setup(e){const t=C((()=>e.inactive?void 0:e.color)),o=()=>{const{textColor:o,pivotText:i,pivotColor:r,percentage:n}=e,a=null!=i?i:`${n}%`;if(e.showPivot&&a){const i={color:o,left:+n+"%",transform:`translate(-${+n}%,-50%)`,background:r||t.value};return p("span",{style:i,class:W("pivot",{inactive:e.inactive})},[a])}};return()=>{const{trackColor:i,percentage:r,strokeWidth:n}=e,a={background:i,height:T(n)},l={width:`${r}%`,background:t.value};return p("div",{class:W(),style:a},[p("span",{class:W("portion",{inactive:e.inactive}),style:l},null),o()])}}});e("P",m(F))}}}));