mirror of
https://github.com/silenty4ng/k5web
synced 2025-01-15 16:22:44 +00:00
33 lines
7.7 KiB
JavaScript
33 lines
7.7 KiB
JavaScript
import{y as k,_ as X,u as J,c as N,f as K,E as Z,F as q,G as Q,H as ee}from"./index.3c6542a6.js";import{f as h,o as z,bs as te,d as ae,t as ne,c as O,w as A,aI as re,bB as le,g as ue}from"./arco.f43727df.js";import{G as oe,x as ie,B as ve,y as se,t as fe,a7 as L,Z as de}from"./index.28b8c38d.js";import{o as ce}from"./dep-281dbb92.b7bdc3eb.js";import{n as be,l as he,d as ge}from"./index.c6a389a9.js";import{b as me,e as pe}from"./dep-f6f516d9.c729faf9.js";/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var ye={delay:{type:Number},destroyOnClose:{type:Boolean,default:!0},duration:{type:Number},placement:{type:String,default:"top"},showArrow:{type:Boolean,default:!0},theme:{type:String,default:"default",validator:function(e){return e?["default","primary","success","danger","warning","light"].includes(e):!0}}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Se=function(){var e=h(0),t=h(0),n=function(f){e.value=f.clientX,t.value=f.clientY};return k||(z(function(){window.addEventListener("mousemove",n,{passive:!0})}),te(function(){window.removeEventListener("mousemove",n)})),{x:e,y:t}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function B(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable})),t.push.apply(t,n)}return t}function _(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(n){N(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}var we=ae({name:"TTooltip",props:_(_({},be),ye),setup:function(e,t){var n=h(null),s=h(null),f=ne(e),b=f.visible,m=f.modelValue,c=me(b,m,e.defaultVisible,e.onVisibleChange,"visible"),p=X(c,2),R=p[0],y=p[1],d=ue(),g=h(e.visible||e.defaultVisible),j=J(),x=ie(),V=ve(),C=Se(),P=C.x,T=h(P.value);z(function(){e.duration&&g.value&&(n.value=setTimeout(function(){y(!1,{}),clearTimeout(n.value),n.value=null},e.duration))});var E=function(u,i){n.value&&(i==null?void 0:i.trigger)!=="document"||(u&&(T.value=P.value),y(u,i))},$=O(function(){return["".concat(j.value,"-tooltip"),N({},"".concat(j.value,"-tooltip--").concat(e.theme),e.theme),e.overlayClassName]}),o=O(function(){return _(_({},(d==null?void 0:d.vnode.props)||{}),{},{placement:e.placement==="mouse"?"bottom-left":e.placement,showArrow:e.placement==="mouse"?!1:e.showArrow,overlayClassName:$.value,onVisibleChange:E,disabled:e.disabled})}),r=O(function(){if(e.placement!=="mouse"||T.value===0)return e.overlayInnerStyle;var l=function(i){return{transform:"translateX(".concat(T.value-i.getBoundingClientRect().left,"px)")}};return e.overlayInnerStyle?function(u,i){return _(_({},l(u)),oe(e.overlayInnerStyle)?e.overlayInnerStyle(u,i):e.overlayInnerStyle)}:l});A(function(){return g.value},function(){n.value&&!g.value&&(clearTimeout(n.value),n.value=null)});var v=function(){var u,i;(u=s.value)===null||u===void 0||(i=u.update)===null||i===void 0||i.call(u)};return t.expose({updatePopper:v}),function(){var l=x("content");return!l&&!e.content?V("default","triggerElement"):re(he,le(ce(o.value,["content","default"]),{ref:s,overlayInnerStyle:r.value,visible:R.value}),{default:function(){return[V("default","triggerElement")]},content:function(){return l}})}}});/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var tt=se(we);/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function F(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable})),t.push.apply(t,n)}return t}function _e(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?F(Object(t),!0).forEach(function(n){N(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):F(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function at(a,e){for(var t=_e({},a),n=0;n<e.length;n++){var s=e[n];delete t[s]}return t}/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var Oe=ge,xe=fe,Te="Expected a function";function Ie(a,e,t){var n=!0,s=!0;if(typeof a!="function")throw new TypeError(Te);return xe(t)&&(n="leading"in t?!!t.leading:n,s="trailing"in t?!!t.trailing:s),Oe(a,e,{leading:n,maxWait:e,trailing:s})}var Re=Ie;/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/var je=de;function Ve(a,e,t){for(var n=-1,s=a.length;++n<s;){var f=a[n],b=e(f);if(b!=null&&(m===void 0?b===b&&!je(b):t(b,m)))var m=b,c=f}return c}var U=Ve;function Pe(a,e){return a>e}var Ee=Pe,Ce=U,$e=Ee,Me=L;function De(a){return a&&a.length?Ce(a,Me,$e):void 0}var He=De;function Ae(a,e){return a<e}var Ne=Ae,Le=U,Be=Ne,Fe=L;function Xe(a){return a&&a.length?Le(a,Fe,Be):void 0}var ze=Xe;function Ue(a,e){for(var t,n=-1,s=a.length;++n<s;){var f=e(a[n]);f!==void 0&&(t=t===void 0?f:t+f)}return t}var Ye=Ue,Ge=Ye,We=L;function ke(a){return a&&a.length?Ge(a,We):0}var H=ke,nt=function(e,t){var n,s,f=h([]),b=h((((n=t.value.data)===null||n===void 0?void 0:n.length)||0)*(((s=t.value.scroll)===null||s===void 0?void 0:s.rowHeight)||50)),m=h(0),c=[],p=h(0),R=h(0),y=h([0,15]),d=O(function(){var o,r=t.value.scroll;return r?{bufferSize:r.bufferSize||10,isFixedRowHeight:(o=r.isFixedRowHeight)!==null&&o!==void 0?o:!1,rowHeight:r.rowHeight||47,threshold:r.threshold||100,type:r.type}:{}}),g=O(function(){var o=t.value.data;return d.value.type==="virtual"&&d.value.threshold<o.length});function j(){for(var o,r,v=(o=(r=e.value)===null||r===void 0?void 0:r.scrollTop)!==null&&o!==void 0?o:0,l=[],u=0,i=-1,S=-1,I=0,w=0,Y=t.value.data.length;w<Y;w++){var M,D=(M=c[w])!==null&&M!==void 0?M:d.value.rowHeight;if(I=I+D,I>v&&i===-1&&(i=w,i-d.value.bufferSize>0&&(u=I-D-H(l))),i===-1&&(l.push(D),l.length>d.value.bufferSize&&l.shift()),S===-1&&(I>p.value+v||w===t.value.data.length-1)&&(S=w),i!==-1&&S!==-1)break}var G=He([i-d.value.bufferSize,0]),W=ze([S+d.value.bufferSize,t.value.data.length]);return{startIndex:G,endIndex:W,translateY:u}}var x=Re(function(){var o=j(),r=o.startIndex,v=o.endIndex,l=o.translateY;y.value.join()!==[r,v].join()&&r>=0&&(b.value=l,f.value=t.value.data.slice(r,v),y.value=[r,v])},100),V=function(r){var v;if(!(!g.value||!r||d.value.isFixedRowHeight||!e.value)){var l=(v=r.ref.value)===null||v===void 0?void 0:v.getBoundingClientRect().height,u=r.data.VIRTUAL_SCROLL_INDEX;if(c[u]!==l){var i=l-c[u];c[u]=l,m.value=m.value+i}}},C=function(){!g.value||x()},P=function(r){var v=X(r,1),l=v[0].contentRect,u=16;Math.abs(l.width-R.value)>u&&(e.value.scrollTop=0,b.value=0),R.value=l.width,p.value=l.height},T=function(r){r.forEach(function(v,l){v.VIRTUAL_SCROLL_INDEX=l})},E=function(r){var v=r.index,l=r.top,u=l===void 0?0:l,i=r.behavior,S=H(c.slice(0,v))-u;e.value.scrollTo({top:S,behavior:i||"auto"})},$=function(r){if(E(r),!d.value.isFixedRowHeight)var v,l=(v=r.time)!==null&&v!==void 0?v:60,u=setTimeout(function(){E(r),clearTimeout(u)},l)};return pe(O(function(){return g.value?e.value:void 0}),P),A(function(){return[K(t.value.data),d.value,g.value,e.value]},function(){if(!(!g.value||!e.value)){var o=t.value.data;if(T(o),p.value=e.value.getBoundingClientRect().height,c.length!==t.value.data.length){var r=Array.from(c);r.length=t.value.data.length,r.fill(d.value.rowHeight||47),c=r}m.value=H(c),y.value=[0,0],x()}},{immediate:!0}),A(function(){return p.value},function(){x()}),{visibleData:f,translateY:b,scrollHeight:m,isVirtualScroll:g,handleScroll:C,handleRowMounted:V,scrollToElement:$}};/**
|
|
* tdesign v1.9.4
|
|
* (c) 2024 tdesign
|
|
* @license MIT
|
|
*/function rt(a){return Z(a)||q(a)||Q(a)||ee()}export{tt as T,rt as _,at as o,Re as t,nt as u};
|