1 |
- !function(){function e(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,o,a,l=[],u=!0,f=!1;try{if(o=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;u=!1}else for(;!(u=(n=o.call(t)).done)&&(l.push(n.value),l.length!==r);u=!0);}catch(c){f=!0,i=c}finally{try{if(!u&&null!=t.return&&(a=t.return(),Object(a)!==a))return}finally{if(f)throw i}}return l}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}System.register(["./index-legacy-8cd36de5.js","./use-tab-status-legacy-3387bdc2.js"],(function(r,t){"use strict";var n,i,o,a,l,u,f,c,d,s,v,g,h,b,p,y,m,x,S;return{setters:[function(e){n=e.c,i=e.b,o=e.m,a=e.t,l=e.d,u=e.r,f=e.aS,c=e.w,d=e.bK,s=e.y,v=e.X,g=e.Y,h=e.a,b=e.z,p=e.Z,y=e.ba,m=e.L,x=e.k},function(e){S=e.u}],execute:function(){var t=e(n("list"),3),j=t[0],w=t[1],T=t[2],A={error:Boolean,offset:i(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:o("down"),loadingText:String,finishedText:String,immediateCheck:a},k=l({name:j,props:A,emits:["load","update:error","update:loading"],setup:function(e,r){var t=r.emit,n=r.slots,i=u(e.loading),o=u(),a=u(),l=S(),x=f(o),j=function(){b((function(){if(!(i.value||e.finished||e.disabled||e.error||!1===(null==l?void 0:l.value))){var r=e.direction,n=+e.offset,u=p(x);if(u.height&&!y(o)){var f=p(a);("up"===r?u.top-f.top<=n:f.bottom-u.bottom<=n)&&(i.value=!0,t("update:loading",!0),t("load"))}}}))},A=function(){if(e.finished){var r=n.finished?n.finished():e.finishedText;if(r)return h("div",{class:w("finished-text")},[r])}},k=function(){t("update:error",!1),j()},B=function(){if(e.error){var r=n.error?n.error():e.errorText;if(r)return h("div",{role:"button",class:w("error-text"),tabindex:0,onClick:k},[r])}},C=function(){if(i.value&&!e.finished&&!e.disabled)return h("div",{class:w("loading")},[n.loading?n.loading():h(m,{class:w("loading-icon")},{default:function(){return[e.loadingText||T("loading")]}})])};return c((function(){return[e.loading,e.finished,e.error]}),j),l&&c(l,(function(e){e&&j()})),d((function(){i.value=e.loading})),s((function(){e.immediateCheck&&j()})),v({check:j}),g("scroll",j,{target:x,passive:!0}),function(){var r,t=null==(r=n.default)?void 0:r.call(n),l=h("div",{ref:a,class:w("placeholder")},null);return h("div",{ref:o,role:"feed",class:w(),"aria-busy":i.value},["down"===e.direction?t:l,C(),A(),B(),"up"===e.direction?t:l])}}});r("L",x(k))}}}))}();
|