1 |
- !function(){function e(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var t,i,o,a,l=[],u=!0,f=!1;try{if(o=(r=r.call(e)).next,0===n){if(Object(r)!==r)return;u=!1}else for(;!(u=(t=o.call(r)).done)&&(l.push(t.value),l.length!==n);u=!0);}catch(d){f=!0,i=d}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(f)throw i}}return l}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return n(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return n(e,r)}(e,r)||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 n(e,n){(null==n||n>e.length)&&(n=e.length);for(var r=0,t=new Array(n);r<n;r++)t[r]=e[r];return t}System.register(["./index-legacy-9572cf39.js","./use-tab-status-legacy-9b408efd.js"],(function(n,r){"use strict";var t,i,o,a,l,u,f,d,c,s,v,g,h,p,y,m,b,x,S;return{setters:[function(e){t=e.j,i=e.am,o=e.n,a=e.v,l=e.d,u=e.i,f=e.aK,d=e.w,c=e._,s=e.o,v=e.ai,g=e.g,h=e.y,p=e.Y,y=e.aT,m=e.a9,b=e.an,x=e.D},function(e){S=e.u}],execute:function(){var r=e(t("list"),3),j=r[0],T=r[1],w=r[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,n){var r=n.emit,t=n.slots,i=u(e.loading),o=u(),a=u(),l=S(),x=f(o),j=function(){h((function(){if(!(i.value||e.finished||e.disabled||e.error||!1===(null==l?void 0:l.value))){var n=e.direction,t=+e.offset,u=p(x);if(u.height&&!y(o)){var f=p(a);("up"===n?u.top-f.top<=t:f.bottom-u.bottom<=t)&&(i.value=!0,r("update:loading",!0),r("load"))}}}))},A=function(){if(e.finished){var n=t.finished?t.finished():e.finishedText;if(n)return g("div",{class:T("finished-text")},[n])}},k=function(){r("update:error",!1),j()},B=function(){if(e.error){var n=t.error?t.error():e.errorText;if(n)return g("div",{role:"button",class:T("error-text"),tabindex:0,onClick:k},[n])}},C=function(){if(i.value&&!e.finished&&!e.disabled)return g("div",{class:T("loading")},[t.loading?t.loading():g(m,{class:T("loading-icon")},{default:function(){return[e.loadingText||w("loading")]}})])};return d((function(){return[e.loading,e.finished,e.error]}),j),l&&d(l,(function(e){e&&j()})),c((function(){i.value=e.loading})),s((function(){e.immediateCheck&&j()})),b({check:j}),v("scroll",j,{target:x,passive:!0}),function(){var n,r=null==(n=t.default)?void 0:n.call(t),l=g("div",{ref:a,class:T("placeholder")},null);return g("div",{ref:o,role:"feed",class:T(),"aria-busy":i.value},["down"===e.direction?r:l,C(),A(),B(),"up"===e.direction?r:l])}}});n("L",x(k))}}}))}();
|