index-legacy.57721991.js 2.9 KB

1
  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)return;var t,i,o=[],a=!0,l=!1;try{for(r=r.call(e);!(a=(t=r.next()).done)&&(o.push(t.value),!n||o.length!==n);a=!0);}catch(u){l=!0,i=u}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}(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.47bc1690.js","./use-tab-status-legacy.7bf91b8c.js"],(function(n){"use strict";var r,t,i,o,a,l,u,f,d,c,s,v,g,h,p,b,y,m,x;return{setters:[function(e){r=e.t,t=e.w,i=e.u,o=e.v,a=e.d,l=e.R,u=e.ap,f=e.Z,d=e.az,c=e.$,s=e.W,v=e.a0,g=e.c,h=e._,p=e.an,b=e.aA,y=e.L,m=e.D},function(e){x=e.u}],execute:function(){var S=e(r("list"),3),w=S[0],A=S[1],T=S[2],j={error:Boolean,offset:t(300),loading:Boolean,disabled:Boolean,finished:Boolean,errorText:String,direction:i("down"),loadingText:String,finishedText:String,immediateCheck:o},k=a({name:w,props:j,emits:["load","update:error","update:loading"],setup:function(e,n){var r=n.emit,t=n.slots,i=l(e.loading),o=l(),a=l(),m=x(),S=u(o),w=function(){h((function(){if(!(i.value||e.finished||e.disabled||e.error||!1===(null==m?void 0:m.value))){var n=e.offset,t=e.direction,l=p(S);if(l.height&&!b(o)){var u=p(a);("up"===t?l.top-u.top<=n:u.bottom-l.bottom<=n)&&(i.value=!0,r("update:loading",!0),r("load"))}}}))},j=function(){if(e.finished){var n=t.finished?t.finished():e.finishedText;if(n)return g("div",{class:A("finished-text")},[n])}},k=function(){r("update:error",!1),w()},B=function(){if(e.error){var n=t.error?t.error():e.errorText;if(n)return g("div",{role:"button",class:A("error-text"),tabindex:0,onClick:k},[n])}},C=function(){if(i.value&&!e.finished&&!e.disabled)return g("div",{class:A("loading")},[t.loading?t.loading():g(y,{class:A("loading-icon")},{default:function(){return[e.loadingText||T("loading")]}})])};return f((function(){return[e.loading,e.finished,e.error]}),w),m&&f(m,(function(e){e&&w()})),d((function(){i.value=e.loading})),c((function(){e.immediateCheck&&w()})),s({check:w}),v("scroll",w,{target:S,passive:!0}),function(){var n,r=null==(n=t.default)?void 0:n.call(t),l=g("div",{ref:a,class:A("placeholder")},null);return g("div",{ref:o,role:"feed",class:A(),"aria-busy":i.value},["down"===e.direction?r:l,C(),j(),B(),"up"===e.direction?r:l])}}});n("L",m(k))}}}))}();