@lazycatcloud/lzc-toolkit 0.0.213 → 0.0.214
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(L,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(L=typeof globalThis<"u"?globalThis:L||self,e(L.ui={},L.Vue))})(this,function(L,e){"use strict";const xe={created(t,n){let o,l,a;function s(u){u.button==0&&(o=Date.now(),l=u.clientX,a=u.clientY,n.modifiers?.stop&&u.stopPropagation())}function i(u){if(u.button!=0||l===void 0)return;const c=u.clientX,f=u.clientY,M=Math.abs(c-l),d=Math.abs(f-a);M>5||d>5||Date.now()-o>300||n.value?.(u)}t._down__=s,t._up__=i,t.addEventListener("pointerdown",s),t.addEventListener("pointerup",i)},unmounted(t){t.removeEventListener("pointerdown",t._down__),t.removeEventListener("pointerup",t._up__)}},qe={created(t,n){const{fn:o,ms:l=1500}=n.value;let a=null;function s(i){a||(o(i),a=setTimeout(()=>{a=null},l))}t.addEventListener("click",s)}},ye={beforeMount(t,n){n.value()}};function Je(t,n){var o;const l=e.shallowRef();return e.watchEffect(()=>{l.value=t()},{...n,flush:(o=n?.flush)!=null?o:"sync"}),e.readonly(l)}function et(t,n){let o,l,a;const s=e.ref(!0),i=()=>{s.value=!0,a()};e.watch(t,i,{flush:"sync"});const u=typeof n=="function"?n:n.get,c=typeof n=="function"?void 0:n.set,f=e.customRef((M,d)=>(l=M,a=d,{get(){return s.value&&(o=u(),s.value=!1),l(),o},set(m){c?.(m)}}));return Object.isExtensible(f)&&(f.trigger=i),f}function De(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function W(t){return typeof t=="function"?t():e.unref(t)}const be=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const tt=Object.prototype.toString,nt=t=>tt.call(t)==="[object Object]",J=()=>{};function Oe(t,n){function o(...l){return new Promise((a,s)=>{Promise.resolve(t(()=>n.apply(this,l),{fn:n,thisArg:this,args:l})).then(a).catch(s)})}return o}function ot(t,n={}){let o,l,a=J;const s=u=>{clearTimeout(u),a(),a=J};return u=>{const c=W(t),f=W(n.maxWait);return o&&s(o),c<=0||f!==void 0&&f<=0?(l&&(s(l),l=null),Promise.resolve(u())):new Promise((M,d)=>{a=n.rejectOnCancel?d:M,f&&!l&&(l=setTimeout(()=>{o&&s(o),l=null,M(u())},f)),o=setTimeout(()=>{l&&s(l),l=null,M(u())},c)})}}function lt(...t){let n=0,o,l=!0,a=J,s,i,u,c,f;!e.isRef(t[0])&&typeof t[0]=="object"?{delay:i,trailing:u=!0,leading:c=!0,rejectOnCancel:f=!1}=t[0]:[i,u=!0,c=!0,f=!1]=t;const M=()=>{o&&(clearTimeout(o),o=void 0,a(),a=J)};return m=>{const g=W(i),r=Date.now()-n,y=()=>s=m();return M(),g<=0?(n=Date.now(),y()):(r>g&&(c||!l)?(n=Date.now(),y()):u&&(s=new Promise((N,w)=>{a=f?w:N,o=setTimeout(()=>{n=Date.now(),l=!0,N(y()),M()},Math.max(0,g-r))})),!c&&!o&&(o=setTimeout(()=>l=!0,g)),l=!1,s)}}function at(t){return t||e.getCurrentInstance()}function oe(t,n=200,o={}){return Oe(ot(n,o),t)}function Te(t,n=200,o=!1,l=!0,a=!1){return Oe(lt(n,o,l,a),t)}function Ne(t,n=!0,o){at()?e.onMounted(t,o):n?t():e.nextTick(t)}function Z(t){var n;const o=W(t);return(n=o?.$el)!=null?n:o}const le=be?window:void 0,st=be?window.document:void 0;function ae(...t){let n,o,l,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([o,l,a]=t,n=le):[n,o,l,a]=t,!n)return J;Array.isArray(o)||(o=[o]),Array.isArray(l)||(l=[l]);const s=[],i=()=>{s.forEach(M=>M()),s.length=0},u=(M,d,m,g)=>(M.addEventListener(d,m,g),()=>M.removeEventListener(d,m,g)),c=e.watch(()=>[Z(n),W(a)],([M,d])=>{if(i(),!M)return;const m=nt(d)?{...d}:d;s.push(...o.flatMap(g=>l.map(r=>u(M,g,r,m))))},{immediate:!0,flush:"post"}),f=()=>{c(),i()};return De(f),f}function it(){const t=e.ref(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function rt(t){const n=it();return e.computed(()=>(n.value,Boolean(t())))}function ct(t){const n=e.getCurrentInstance(),o=et(()=>null,()=>t?Z(t):n.proxy.$el);return e.onUpdated(o.trigger),e.onMounted(o.trigger),o}function we(t,n,o={}){const{window:l=le,...a}=o;let s;const i=rt(()=>l&&"ResizeObserver"in l),u=()=>{s&&(s.disconnect(),s=void 0)},c=e.computed(()=>Array.isArray(t)?t.map(d=>Z(d)):[Z(t)]),f=e.watch(c,d=>{if(u(),i.value&&l){s=new ResizeObserver(n);for(const m of d)m&&s.observe(m,a)}},{immediate:!0,flush:"post"}),M=()=>{u(),f()};return De(M),{isSupported:i,stop:M}}function ut(t,n={width:0,height:0},o={}){const{window:l=le,box:a="content-box"}=o,s=e.computed(()=>{var d,m;return(m=(d=Z(t))==null?void 0:d.namespaceURI)==null?void 0:m.includes("svg")}),i=e.ref(n.width),u=e.ref(n.height),{stop:c}=we(t,([d])=>{const m=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(l&&s.value){const g=Z(t);if(g){const r=l.getComputedStyle(g);i.value=Number.parseFloat(r.width),u.value=Number.parseFloat(r.height)}}else if(m){const g=Array.isArray(m)?m:[m];i.value=g.reduce((r,{inlineSize:y})=>r+y,0),u.value=g.reduce((r,{blockSize:y})=>r+y,0)}else i.value=d.contentRect.width,u.value=d.contentRect.height},o);Ne(()=>{const d=Z(t);d&&(i.value="offsetWidth"in d?d.offsetWidth:n.width,u.value="offsetHeight"in d?d.offsetHeight:n.height)});const f=e.watch(()=>Z(t),d=>{i.value=d?n.width:0,u.value=d?n.height:0});function M(){c(),f()}return{width:i,height:u,stop:M}}const _e=1;function dt(t,n={}){const{throttle:o=0,idle:l=200,onStop:a=J,onScroll:s=J,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:u={capture:!1,passive:!0},behavior:c="auto",window:f=le,onError:M=D=>{console.error(D)}}=n,d=e.ref(0),m=e.ref(0),g=e.computed({get(){return d.value},set(D){y(D,void 0)}}),r=e.computed({get(){return m.value},set(D){y(void 0,D)}});function y(D,C){var B,$,T;if(!f)return;const z=W(t);!z||(T=z instanceof Document?f.document.body:z)==null||T.scrollTo({top:(B=W(C))!=null?B:r.value,left:($=W(D))!=null?$:g.value,behavior:W(c)})}const N=e.ref(!1),w=e.reactive({left:!0,right:!1,top:!0,bottom:!1}),I=e.reactive({left:!1,right:!1,top:!1,bottom:!1}),S=D=>{!N.value||(N.value=!1,I.left=!1,I.right=!1,I.top=!1,I.bottom=!1,a(D))},h=oe(S,o+l),p=D=>{var C;if(!f)return;const B=((C=D?.document)==null?void 0:C.documentElement)||D?.documentElement||Z(D),{display:$,flexDirection:T}=getComputedStyle(B),z=B.scrollLeft;I.left=z<d.value,I.right=z>d.value;const b=Math.abs(z)<=(i.left||0),k=Math.abs(z)+B.clientWidth>=B.scrollWidth-(i.right||0)-_e;$==="flex"&&T==="row-reverse"?(w.left=k,w.right=b):(w.left=b,w.right=k),d.value=z;let _=B.scrollTop;D===f.document&&!_&&(_=f.document.body.scrollTop),I.top=_<m.value,I.bottom=_>m.value;const A=Math.abs(_)<=(i.top||0),E=Math.abs(_)+B.clientHeight>=B.scrollHeight-(i.bottom||0)-_e;$==="flex"&&T==="column-reverse"?(w.top=E,w.bottom=A):(w.top=A,w.bottom=E),m.value=_},v=D=>{var C;if(!f)return;const B=(C=D.target.documentElement)!=null?C:D.target;p(B),N.value=!0,h(D),s(D)};return ae(t,"scroll",o?Te(v,o,!0,!1):v,u),Ne(()=>{try{const D=W(t);if(!D)return;p(D)}catch(D){M(D)}}),ae(t,"scrollend",S,u),{x:g,y:r,isScrolling:N,arrivedState:w,directions:I,measure(){const D=W(t);f&&D&&p(D)}}}let ft=0;function ve(t,n={}){const o=e.ref(!1),{document:l=st,immediate:a=!0,manual:s=!1,id:i=`vueuse_styletag_${++ft}`}=n,u=e.ref(t);let c=()=>{};const f=()=>{if(!l)return;const d=l.getElementById(i)||l.createElement("style");d.isConnected||(d.id=i,n.media&&(d.media=n.media),l.head.appendChild(d)),!o.value&&(c=e.watch(u,m=>{d.textContent=m},{immediate:!0}),o.value=!0)},M=()=>{!l||!o.value||(c(),l.head.removeChild(l.getElementById(i)),o.value=!1)};return a&&!s&&Ne(f),s||De(M),{id:i,css:u,unload:M,load:f,isLoaded:e.readonly(o)}}function Mt(t,n,o){const l=t.style[n];return l!=o&&(t.style[n]=o),{reset(){l!=o&&(t.style[n]=l)}}}function ke(t,n){const{scrollEndHook:o,itemHeight:l,overscan:a=5}=n,s=e.ref(null),i=ut(s),u=e.ref(!0),c=oe(p,100);let f;const M=e.shallowRef(t),d=e.ref(0),m=e.ref({start:0,end:10}),g=e.ref({start:0,end:a});let r=0;const y=e.ref([]),N=e.computed(()=>{let{sum:A,height:E}={sum:0,height:0};return M.value.map((Q,Y)=>(typeof l=="number"?E=l:E=l(Y),A+=E,{height:E,sum:A}))}),w=e.computed(()=>$(m.value.start)),I=e.computed(()=>typeof l=="number"?N.value.length*l:N.value[N.value.length-1]?.sum||0),S=e.computed(()=>{const{start:A,end:E}=g.value;return y.value.slice(A,E)});e.onMounted(()=>{}),e.onUnmounted(()=>cancelAnimationFrame(f)),e.watch(M,()=>{(i.width.value||i.height.value)&&v()},{deep:!0}),e.watch([i.width,i.height],([A,E])=>{(A||E)&&v()},{deep:!0}),e.watch(d,()=>{h(),c()});function h(){u.value=!1}function p(){u.value=!0,o?.()}function v(){cancelAnimationFrame(f),f=requestAnimationFrame(D)}function D(){if(s.value){d.value=s.value.scrollTop;let A=C(d.value);r=B(A);let E=Math.max(0,A-a),Q=Math.min(A+r+a,M.value.length);m.value={start:E,end:Q},y.value=M.value.slice(E,Q).map((Y,O)=>({data:Y,index:O+E})),g.value.start=A-E,g.value.end=g.value.start+r}}function C(A){let E=0,Q=N.value.length-1,Y=-1;for(;E<=Q;){const O=Math.floor((E+Q)/2);N.value[O].sum>=A?(Y=O,Q=O-1):E=O+1}return Math.max(0,Y)}function B(A){let E=0,Q=0;for(let Y=A;Y<N.value.length&&(E++,Q+=N.value[Y].height,!(Q>=i.height.value));Y++);return E}function $(A){if(typeof l=="number")return A*l;let E=N.value[A];return E?E.sum-E.height:0}function T(A){return N.value[A]||{sum:0,height:0}}function z(A,E="smooth"){if(s.value){const{reset:Q}=Mt(s.value,"scrollBehavior",E),Y=T(A);s.value.scrollTop=Y.sum-Y.height,D(),Q()}if(s.value){const Q=T(A);s.value.scrollTop=Q.sum-Q.height,D()}}const b=e.computed(()=>({style:{width:"100%",height:`${I.value}px`,pointerEvents:u.value?void 0:"none"}})),k=e.computed(()=>({style:{transform:`translate3d(0, ${w.value}px, 0)`,"will-change":"transform"}})),_={overflowY:"auto"};return{list:y,visiableList:S,getItemHeightData:T,getoffsetTopIndex:C,totalHeight:I,clientHeight:i.height,scrollTo:z,scrollTop:d,isScrollEnd:u,containerProps:{ref:s,onScroll:()=>{v()},style:_},wrapperProps:b,innerProps:k}}const Ee=Symbol(),se=Symbol(),ie=Symbol(),re=Symbol(),ce=Symbol(),ue=Symbol(),de=Symbol(),fe=Symbol(),Me=Symbol(),ee=Symbol(),ge=Symbol();function gt(){const{voidFn:t,boolFn:n,boolRef:o,numberRef:l,arrayRef:a}={voidFn:N=>{},boolFn:N=>!1,boolRef:e.computed(()=>!1),numberRef:e.computed(()=>0),arrayRef:e.computed(()=>[])},s=e.inject(Ee,"id"),i=e.inject(ce,a),u=e.inject(re,n),c=e.inject(Me,o),f=e.inject(ie,t),M=e.inject(se,t),d=e.inject(ue,t),m=e.inject(de,t),g=e.inject(fe,t),r=e.inject(ee,t),y=e.inject(ge,l);return{itemKey:s,selected:i,isSelected:u,isAllSelected:c,toggle:f,toggleAll:M,select:d,selectAll:m,unselect:g,unselectAll:r,selectedCount:y}}function mt(t,n,o={deep:!0,useAllFlagOptimizatiofn:!0}){const l=e.ref(!1),a=e.ref(new Set),s=e.reactive(new Map);e.watch(t,h=>{i(h)},{deep:o.deep,immediate:!0}),e.watch(()=>t.value.length,()=>{i(t.value)}),e.onScopeDispose(()=>{l.value=!1,a.value.clear(),s.clear()});function i(h){s.clear(),h.forEach(p=>{s.has(p[n])||s.set(p[n],p)}),S()}const u=e.computed(()=>{let h=[];if(l.value!=null)l.value&&(h=Array.from(s.values()));else if(a.value.size){let p;a.value.forEach(v=>{p=s.get(v),p&&h.push(p)})}return h}),c=e.computed(()=>{let h=0;return l.value!=null?l.value&&(h=s.size):h=a.value.size,h}),f=e.computed(()=>{let h;if(l.value!=null)h=l.value;else{const p=a.value.size,v=s.size;h=p==v}return h});function M(){l.value=!0}function d(){l.value=!1}function m(h){s.has(h)&&a.value.add(h)}function g(h){N(()=>{h.forEach(p=>{m(p[n])})})}function r(h){N(()=>{h.forEach(p=>{a.value.delete(p[n])})})}function y(h){return l.value!=null?l.value:a.value.has(h[n])}function N(h){l.value!=null&&(l.value?a.value=new Set(Array.from(s.keys())):a.value=new Set),h(),o.useAllFlagOptimizatiofn?a.value.size==0?l.value=!1:a.value.size==s.size?l.value=!0:l.value=null:l.value=null}function w(h){N(()=>{h.forEach(p=>{y(p)?a.value.delete(p[n]):m(p[n])})})}function I(){const{value:h}=f;h?d():M()}function S(){const h=[];a.value.forEach(p=>{s.get(p)||h.push(p)}),h.forEach(p=>a.value.delete(p))}return e.provide(Ee,n),e.provide(se,I),e.provide(ie,w),e.provide(re,y),e.provide(ce,u),e.provide(ue,g),e.provide(de,M),e.provide(fe,r),e.provide(Me,f),e.provide(ee,d),e.provide(ee,d),e.provide(ge,c),{selected:u,select:g,selectAll:M,unselect:r,unselectAll:d,toggle:w,toggleAll:I,isSelected:y,isAllSelected:f,selectedCount:c}}function ht(t){const n=e.ref(!1),o=e.ref(new Set),l=e.computed(()=>{let r=[];return n.value!=null?n.value&&(r=t.value):o.value.size&&(r=Array.from(o.value.values())),r}),a=e.computed(()=>{let r=0;return n.value!=null?n.value&&(r=t.value.length):r=o.value.size,r}),s=e.computed(()=>{let r;if(n.value!=null)r=n.value;else{const y=o.value.size,N=t.value.length;r=y==N}return r});function i(){n.value=!0}function u(){n.value=!1}function c(r){d(()=>{r.forEach(y=>{o.value.add(y)})})}function f(r){d(()=>{r.forEach(y=>{o.value.delete(y)})})}function M(r){return n.value!=null?n.value:o.value.has(r)}function d(r){n.value!=null&&(n.value?o.value=new Set(Array.from(t.value)):o.value=new Set),r(),o.value.size==0?n.value=!1:o.value.size==t.value.length?n.value=!0:n.value=null}function m(r){d(()=>{r.forEach(y=>{M(y)?o.value.delete(y):o.value.add(y)})})}function g(){const{value:r}=s;r?u():i()}return e.provide(se,g),e.provide(ie,m),e.provide(re,M),e.provide(ce,l),e.provide(ue,c),e.provide(de,i),e.provide(fe,f),e.provide(Me,s),e.provide(ee,u),e.provide(ee,u),e.provide(ge,a),{selected:l,select:c,selectAll:i,unselect:f,unselectAll:u,toggle:m,toggleAll:g,isSelected:M,isAllSelected:s,selectedCount:a}}function pt(t,n){return t>n?"horizontal":n>t?"vertical":""}function yt(){const t=e.ref(0),n=e.ref(0),o=e.ref(0),l=e.ref(0),a=e.ref(0),s=e.ref(0),i=e.ref(""),u=()=>i.value==="vertical",c=()=>i.value==="horizontal",f=()=>{o.value=0,l.value=0,a.value=0,s.value=0,i.value=""};return{move:(m,g)=>{o.value=(m<0?0:m)-t.value,l.value=g-n.value,a.value=Math.abs(o.value),s.value=Math.abs(l.value);const r=10;(!i.value||a.value<r&&s.value<r)&&(i.value=pt(a.value,s.value))},start:(m,g)=>{f(),t.value=m,n.value=g},reset:f,startX:t,startY:n,deltaX:o,deltaY:l,offsetX:a,offsetY:s,direction:i,isVertical:u,isHorizontal:c}}function Ie(t){return()=>{console.debug(`\u9ED8\u8BA4${t}\u65B9\u6CD5,\u9700\u8981\u81EA\u5B9A\u4E49\u751F\u6548`)}}function ze({key:t,customAttributeValue:n,attribute:o,selectWay:l="colum",scrollOptions:a={},getSelectMap:s=()=>({})}){const{select:i=Ie("\u9009\u62E9"),unselect:u=Ie("\u53D6\u6D88\u9009\u62E9"),unselectAll:c=Ie("\u53D6\u6D88\u5168\u9009"),selected:f=e.computed(()=>[])}=s();let M={};const d=e.computed(()=>Te(l==="colum"?Wn:Xn,50)),m=e.computed(()=>t??o),g=(()=>n?x=>n(x):x=>x)(),r=new Set;let y=new Set;const N=e.ref(!0),w=e.ref(),I=e.ref(!1),S=e.ref({x:0,y:0}),h=e.ref({x:0,y:0,scrollTop:0}),p=e.ref({}),v=e.ref({top:0,height:0,sync(x=!1){v.value.top=w.value?.scrollTop||0,x&&(v.value.height=w.value?.scrollHeight||0)}}),D=e.computed(()=>I.value?{left:Math.min(S.value.x,h.value.x)-p.value.left,top:Math.min(S.value.y,h.value.y)-p.value.top,width:Math.abs(S.value.x-h.value.x),height:Math.abs(S.value.y-h.value.y)}:{left:0,top:0,width:0,height:0}),C=e.ref(!1),{margin:B=50,startSpeed:$=30,maxSpeed:T=30}=a;let z;const b=B,k=$,_=T,A=x=>x**1;let E=0;function Q(x){if(cancelAnimationFrame(z),E=Y(x),E=Math.max(Math.min(E,_),-_),E!==0){const j=w.value;if(!j||!I.value)return;const P=v.value.height-p.value.height;let R=v.value.top+Number(E);R=Math.min(Math.max(0,R),P),j.scrollTop=R,U(),z=requestAnimationFrame(()=>Q(x))}}function Y(x){if(w.value){const P=p.value,R=P.bottom-x;if(R<b)return k*A(1-R/b);const F=x-P.top;if(F<b)return-k*A(1-F/b)}return 0}function O(x){const j={...D.value,right:0,bottom:0};return j.left+=p.value.left,j.top+=p.value.top-v.value.top,j.right=j.width+j.left,j.bottom=j.height+j.top,j.left<x.right&&j.right>x.left&&j.top<x.bottom&&j.bottom>x.top}function U(){v.value.sync();const{top:x,height:j}=v.value;h.value.y=Math.min(j+p.value.top,h.value.y+x-h.value.scrollTop),h.value.scrollTop=x}function V(x,j,P="dynamic-styles"){let R=document.getElementById(P);R||(R=document.createElement("style"),R.id=P,document.head.appendChild(R));const F=R.sheet.cssRules,K=F.length,pe=`${x} { ${j} }`;for(let te=0;te<K;te++){const je=F[te];if(je.selectorText===x&&je.style.cssText===j)return}R.sheet.insertRule(pe,K)}function H(x,j){N.value=!0,I.value=!0,v.value.sync(!0);const P=j+v.value.top;S.value.x=x,S.value.y=P,h.value.x=x,h.value.y=P,w.value?.classList.add("disable-scroll-behavior"),r.clear();const R=f.value;y=new Set(R.map(F=>F[m.value])),Ge()}function q(x,j,P){!I.value||(N.value&&l==="colum"&&!he()&&(C.value||c(),N.value=!1),P?.(),Q(j),h.value.x=Math.max(x,p.value.left),h.value.y=Math.min(j+v.value.top,v.value.height+p.value.top),h.value.scrollTop=v.value.top,d.value())}function Hn(){I.value=!1,w.value?.classList.remove("disable-scroll-behavior")}function Fn(){!I.value||(E||U(),d.value())}function he(){if(!I.value)return!1;const{width:x,height:j}=D.value;return!(Math.max(x,j)>5)}function Vn(){he()&&c()}function Wn(){he()||w.value?.querySelectorAll(`[${o}]`).forEach(x=>{const j=g(x.getAttribute(`${o}`));M[m.value]=j;const P=y.has(j),R=r.has(j);O(x.getBoundingClientRect())?R||(P?u([M]):i([M]),r.add(j)):R&&(P?i([M]):u([M]),r.delete(j))})}function Xn(){const x=[];let j=null,P=0;w.value?.querySelectorAll(`[${o}]`).forEach((R,F)=>{const K=g(R.getAttribute(`${o}`));x.push(K),O(R.getBoundingClientRect())&&(j===null&&(j=F),j=Math.min(j,F),P=Math.max(P,F))}),w.value?.querySelectorAll(`[${o}]`).forEach((R,F)=>{const K=x[F],pe=y.has(K),te=r.has(K);j!==null&&F>=j&&F<=P?te||(M[m.value]=K,pe?u([M]):i([M]),r.add(K)):te&&(M[m.value]=K,pe?i([M]):u([M]),r.delete(K))})}function Ge(){!w.value||(p.value=w.value.getBoundingClientRect())}function Kn(x){return!x?.value||(w.value=x.value,!w?.value)?!1:(Ge(),V(".disable-scroll-behavior","scroll-behavior: unset !important;"),!0)}return{init:Kn,dragStart:H,dragMove:q,dragEnd:Hn,onScroll:Fn,isSingleClick:he,cancelSelectAllBySingleClick:Vn,selectFn:d,getAttributeValue:g,incrementalSelect:C,selectRange:D,isPressing:I,containerEl:w}}function Dt(t,n=!1){const o=ze(t),{selectRange:l}=o,{onScroll:a,dragStart:s,dragMove:i,dragEnd:u,cancelSelectAllBySingleClick:c}=o,f=e.computed(()=>({left:`${l.value.left}px`,top:`${l.value.top}px`,width:`${l.value.width}px`,height:`${l.value.height}px`})),{load:M}=ve(`.drag-select-box {
|
|
1
|
+
(function(L,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(L=typeof globalThis<"u"?globalThis:L||self,e(L.ui={},L.Vue))})(this,function(L,e){"use strict";const xe={created(t,n){let o,l,a;function s(u){u.button==0&&(o=Date.now(),l=u.clientX,a=u.clientY,n.modifiers?.stop&&u.stopPropagation())}function i(u){if(u.button!=0||l===void 0)return;const c=u.clientX,f=u.clientY,M=Math.abs(c-l),d=Math.abs(f-a);M>5||d>5||Date.now()-o>300||n.value?.(u)}t._down__=s,t._up__=i,t.addEventListener("pointerdown",s),t.addEventListener("pointerup",i)},unmounted(t){t.removeEventListener("pointerdown",t._down__),t.removeEventListener("pointerup",t._up__)}},qe={created(t,n){const{fn:o,ms:l=1500}=n.value;let a=null;function s(i){a||(o(i),a=setTimeout(()=>{a=null},l))}t.addEventListener("click",s)}},ye={beforeMount(t,n){n.value()}};function Je(t,n){var o;const l=e.shallowRef();return e.watchEffect(()=>{l.value=t()},{...n,flush:(o=n?.flush)!=null?o:"sync"}),e.readonly(l)}function et(t,n){let o,l,a;const s=e.ref(!0),i=()=>{s.value=!0,a()};e.watch(t,i,{flush:"sync"});const u=typeof n=="function"?n:n.get,c=typeof n=="function"?void 0:n.set,f=e.customRef((M,d)=>(l=M,a=d,{get(){return s.value&&(o=u(),s.value=!1),l(),o},set(m){c?.(m)}}));return Object.isExtensible(f)&&(f.trigger=i),f}function De(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function W(t){return typeof t=="function"?t():e.unref(t)}const be=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const tt=Object.prototype.toString,nt=t=>tt.call(t)==="[object Object]",J=()=>{};function Oe(t,n){function o(...l){return new Promise((a,s)=>{Promise.resolve(t(()=>n.apply(this,l),{fn:n,thisArg:this,args:l})).then(a).catch(s)})}return o}function ot(t,n={}){let o,l,a=J;const s=u=>{clearTimeout(u),a(),a=J};return u=>{const c=W(t),f=W(n.maxWait);return o&&s(o),c<=0||f!==void 0&&f<=0?(l&&(s(l),l=null),Promise.resolve(u())):new Promise((M,d)=>{a=n.rejectOnCancel?d:M,f&&!l&&(l=setTimeout(()=>{o&&s(o),l=null,M(u())},f)),o=setTimeout(()=>{l&&s(l),l=null,M(u())},c)})}}function lt(...t){let n=0,o,l=!0,a=J,s,i,u,c,f;!e.isRef(t[0])&&typeof t[0]=="object"?{delay:i,trailing:u=!0,leading:c=!0,rejectOnCancel:f=!1}=t[0]:[i,u=!0,c=!0,f=!1]=t;const M=()=>{o&&(clearTimeout(o),o=void 0,a(),a=J)};return m=>{const g=W(i),r=Date.now()-n,y=()=>s=m();return M(),g<=0?(n=Date.now(),y()):(r>g&&(c||!l)?(n=Date.now(),y()):u&&(s=new Promise((N,w)=>{a=f?w:N,o=setTimeout(()=>{n=Date.now(),l=!0,N(y()),M()},Math.max(0,g-r))})),!c&&!o&&(o=setTimeout(()=>l=!0,g)),l=!1,s)}}function at(t){return t||e.getCurrentInstance()}function oe(t,n=200,o={}){return Oe(ot(n,o),t)}function Te(t,n=200,o=!1,l=!0,a=!1){return Oe(lt(n,o,l,a),t)}function Ne(t,n=!0,o){at()?e.onMounted(t,o):n?t():e.nextTick(t)}function Z(t){var n;const o=W(t);return(n=o?.$el)!=null?n:o}const le=be?window:void 0,st=be?window.document:void 0;function ae(...t){let n,o,l,a;if(typeof t[0]=="string"||Array.isArray(t[0])?([o,l,a]=t,n=le):[n,o,l,a]=t,!n)return J;Array.isArray(o)||(o=[o]),Array.isArray(l)||(l=[l]);const s=[],i=()=>{s.forEach(M=>M()),s.length=0},u=(M,d,m,g)=>(M.addEventListener(d,m,g),()=>M.removeEventListener(d,m,g)),c=e.watch(()=>[Z(n),W(a)],([M,d])=>{if(i(),!M)return;const m=nt(d)?{...d}:d;s.push(...o.flatMap(g=>l.map(r=>u(M,g,r,m))))},{immediate:!0,flush:"post"}),f=()=>{c(),i()};return De(f),f}function it(){const t=e.ref(!1),n=e.getCurrentInstance();return n&&e.onMounted(()=>{t.value=!0},n),t}function rt(t){const n=it();return e.computed(()=>(n.value,Boolean(t())))}function ct(t){const n=e.getCurrentInstance(),o=et(()=>null,()=>t?Z(t):n.proxy.$el);return e.onUpdated(o.trigger),e.onMounted(o.trigger),o}function we(t,n,o={}){const{window:l=le,...a}=o;let s;const i=rt(()=>l&&"ResizeObserver"in l),u=()=>{s&&(s.disconnect(),s=void 0)},c=e.computed(()=>Array.isArray(t)?t.map(d=>Z(d)):[Z(t)]),f=e.watch(c,d=>{if(u(),i.value&&l){s=new ResizeObserver(n);for(const m of d)m&&s.observe(m,a)}},{immediate:!0,flush:"post"}),M=()=>{u(),f()};return De(M),{isSupported:i,stop:M}}function ut(t,n={width:0,height:0},o={}){const{window:l=le,box:a="content-box"}=o,s=e.computed(()=>{var d,m;return(m=(d=Z(t))==null?void 0:d.namespaceURI)==null?void 0:m.includes("svg")}),i=e.ref(n.width),u=e.ref(n.height),{stop:c}=we(t,([d])=>{const m=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(l&&s.value){const g=Z(t);if(g){const r=l.getComputedStyle(g);i.value=Number.parseFloat(r.width),u.value=Number.parseFloat(r.height)}}else if(m){const g=Array.isArray(m)?m:[m];i.value=g.reduce((r,{inlineSize:y})=>r+y,0),u.value=g.reduce((r,{blockSize:y})=>r+y,0)}else i.value=d.contentRect.width,u.value=d.contentRect.height},o);Ne(()=>{const d=Z(t);d&&(i.value="offsetWidth"in d?d.offsetWidth:n.width,u.value="offsetHeight"in d?d.offsetHeight:n.height)});const f=e.watch(()=>Z(t),d=>{i.value=d?n.width:0,u.value=d?n.height:0});function M(){c(),f()}return{width:i,height:u,stop:M}}const _e=1;function dt(t,n={}){const{throttle:o=0,idle:l=200,onStop:a=J,onScroll:s=J,offset:i={left:0,right:0,top:0,bottom:0},eventListenerOptions:u={capture:!1,passive:!0},behavior:c="auto",window:f=le,onError:M=D=>{console.error(D)}}=n,d=e.ref(0),m=e.ref(0),g=e.computed({get(){return d.value},set(D){y(D,void 0)}}),r=e.computed({get(){return m.value},set(D){y(void 0,D)}});function y(D,C){var B,$,T;if(!f)return;const z=W(t);!z||(T=z instanceof Document?f.document.body:z)==null||T.scrollTo({top:(B=W(C))!=null?B:r.value,left:($=W(D))!=null?$:g.value,behavior:W(c)})}const N=e.ref(!1),w=e.reactive({left:!0,right:!1,top:!0,bottom:!1}),I=e.reactive({left:!1,right:!1,top:!1,bottom:!1}),S=D=>{!N.value||(N.value=!1,I.left=!1,I.right=!1,I.top=!1,I.bottom=!1,a(D))},h=oe(S,o+l),p=D=>{var C;if(!f)return;const B=((C=D?.document)==null?void 0:C.documentElement)||D?.documentElement||Z(D),{display:$,flexDirection:T}=getComputedStyle(B),z=B.scrollLeft;I.left=z<d.value,I.right=z>d.value;const b=Math.abs(z)<=(i.left||0),k=Math.abs(z)+B.clientWidth>=B.scrollWidth-(i.right||0)-_e;$==="flex"&&T==="row-reverse"?(w.left=k,w.right=b):(w.left=b,w.right=k),d.value=z;let _=B.scrollTop;D===f.document&&!_&&(_=f.document.body.scrollTop),I.top=_<m.value,I.bottom=_>m.value;const A=Math.abs(_)<=(i.top||0),E=Math.abs(_)+B.clientHeight>=B.scrollHeight-(i.bottom||0)-_e;$==="flex"&&T==="column-reverse"?(w.top=E,w.bottom=A):(w.top=A,w.bottom=E),m.value=_},v=D=>{var C;if(!f)return;const B=(C=D.target.documentElement)!=null?C:D.target;p(B),N.value=!0,h(D),s(D)};return ae(t,"scroll",o?Te(v,o,!0,!1):v,u),Ne(()=>{try{const D=W(t);if(!D)return;p(D)}catch(D){M(D)}}),ae(t,"scrollend",S,u),{x:g,y:r,isScrolling:N,arrivedState:w,directions:I,measure(){const D=W(t);f&&D&&p(D)}}}let ft=0;function ve(t,n={}){const o=e.ref(!1),{document:l=st,immediate:a=!0,manual:s=!1,id:i=`vueuse_styletag_${++ft}`}=n,u=e.ref(t);let c=()=>{};const f=()=>{if(!l)return;const d=l.getElementById(i)||l.createElement("style");d.isConnected||(d.id=i,n.media&&(d.media=n.media),l.head.appendChild(d)),!o.value&&(c=e.watch(u,m=>{d.textContent=m},{immediate:!0}),o.value=!0)},M=()=>{!l||!o.value||(c(),l.head.removeChild(l.getElementById(i)),o.value=!1)};return a&&!s&&Ne(f),s||De(M),{id:i,css:u,unload:M,load:f,isLoaded:e.readonly(o)}}function Mt(t,n,o){const l=t.style[n];return l!=o&&(t.style[n]=o),{reset(){l!=o&&(t.style[n]=l)}}}function ke(t,n){const{scrollEndHook:o,itemHeight:l,overscan:a=5}=n,s=e.ref(null),i=ut(s),u=e.ref(!0),c=oe(p,100);let f;const M=e.shallowRef(t),d=e.ref(0),m=e.ref({start:0,end:10}),g=e.ref({start:0,end:a});let r=0;const y=e.ref([]),N=e.computed(()=>{let{sum:A,height:E}={sum:0,height:0};return M.value.map((Q,Y)=>(typeof l=="number"?E=l:E=l(Y),A+=E,{height:E,sum:A}))}),w=e.computed(()=>$(m.value.start)),I=e.computed(()=>typeof l=="number"?N.value.length*l:N.value[N.value.length-1]?.sum||0),S=e.computed(()=>{const{start:A,end:E}=g.value;return y.value.slice(A,E)});e.onMounted(()=>{}),e.onUnmounted(()=>cancelAnimationFrame(f)),e.watch(M,()=>{(i.width.value||i.height.value)&&v()},{deep:!0}),e.watch([i.width,i.height],([A,E])=>{(A||E)&&v()},{deep:!0}),e.watch(d,()=>{h(),c()});function h(){u.value=!1}function p(){u.value=!0,o?.()}function v(){cancelAnimationFrame(f),f=requestAnimationFrame(D)}function D(){if(s.value){d.value=s.value.scrollTop;let A=C(d.value);r=B(A);let E=Math.max(0,A-a),Q=Math.min(A+r+a,M.value.length);m.value={start:E,end:Q},y.value=M.value.slice(E,Q).map((Y,O)=>({data:Y,index:O+E})),g.value.start=A-E,g.value.end=g.value.start+r}}function C(A){let E=0,Q=N.value.length-1,Y=-1;for(;E<=Q;){const O=Math.floor((E+Q)/2);N.value[O].sum>=A?(Y=O,Q=O-1):E=O+1}return Math.max(0,Y)}function B(A){let E=0,Q=0;for(let Y=A;Y<N.value.length&&(E++,Q+=N.value[Y].height,!(Q>=i.height.value));Y++);return E}function $(A){if(typeof l=="number")return A*l;let E=N.value[A];return E?E.sum-E.height:0}function T(A){return N.value[A]||{sum:0,height:0}}function z(A,E="smooth"){if(s.value){const{reset:Q}=Mt(s.value,"scrollBehavior",E),Y=T(A);s.value.scrollTop=Y.sum-Y.height,D(),Q()}if(s.value){const Q=T(A);s.value.scrollTop=Q.sum-Q.height,D()}}const b=e.computed(()=>({style:{width:"100%",height:`${I.value}px`,pointerEvents:u.value?void 0:"none"}})),k=e.computed(()=>({style:{transform:`translate3d(0, ${w.value}px, 0)`,"will-change":"transform"}})),_={overflowY:"auto"};return{list:y,visiableList:S,getItemHeightData:T,getoffsetTopIndex:C,totalHeight:I,clientHeight:i.height,scrollTo:z,scrollTop:d,isScrollEnd:u,containerProps:{ref:s,onScroll:()=>{v()},style:_},wrapperProps:b,innerProps:k}}const Ee=Symbol(),se=Symbol(),ie=Symbol(),re=Symbol(),ce=Symbol(),ue=Symbol(),de=Symbol(),fe=Symbol(),Me=Symbol(),ee=Symbol(),ge=Symbol();function gt(){const{voidFn:t,boolFn:n,boolRef:o,numberRef:l,arrayRef:a}={voidFn:N=>{},boolFn:N=>!1,boolRef:e.computed(()=>!1),numberRef:e.computed(()=>0),arrayRef:e.computed(()=>[])},s=e.inject(Ee,"id"),i=e.inject(ce,a),u=e.inject(re,n),c=e.inject(Me,o),f=e.inject(ie,t),M=e.inject(se,t),d=e.inject(ue,t),m=e.inject(de,t),g=e.inject(fe,t),r=e.inject(ee,t),y=e.inject(ge,l);return{itemKey:s,selected:i,isSelected:u,isAllSelected:c,toggle:f,toggleAll:M,select:d,selectAll:m,unselect:g,unselectAll:r,selectedCount:y}}function mt(t,n,o={deep:!0,useAllFlagOptimizatiofn:!0}){const l=e.ref(!1),a=e.ref(new Set),s=e.reactive(new Map);e.watch(t,h=>{i(h)},{deep:o.deep,immediate:!0}),e.watch(()=>t.value.length,()=>{i(t.value)}),e.onScopeDispose(()=>{l.value=!1,a.value.clear(),s.clear()});function i(h){s.clear(),h.forEach(p=>{s.has(p[n])||s.set(p[n],p)}),S()}const u=e.computed(()=>{let h=[];if(l.value!=null)l.value&&(h=Array.from(s.values()));else if(a.value.size){let p;a.value.forEach(v=>{p=s.get(v),p&&h.push(p)})}return h}),c=e.computed(()=>{let h=0;return l.value!=null?l.value&&(h=s.size):h=a.value.size,h}),f=e.computed(()=>{let h;if(l.value!=null)h=l.value;else{const p=a.value.size,v=s.size;h=p==v}return h});function M(){l.value=!0}function d(){l.value=!1}function m(h){s.has(h)&&a.value.add(h)}function g(h){N(()=>{h.forEach(p=>{m(p[n])})})}function r(h){N(()=>{h.forEach(p=>{a.value.delete(p[n])})})}function y(h){return l.value!=null?l.value:a.value.has(h[n])}function N(h){l.value!=null&&(l.value?a.value=new Set(Array.from(s.keys())):a.value=new Set),h(),o.useAllFlagOptimizatiofn?a.value.size==0?l.value=!1:a.value.size==s.size?l.value=!0:l.value=null:l.value=null}function w(h){N(()=>{h.forEach(p=>{y(p)?a.value.delete(p[n]):m(p[n])})})}function I(){const{value:h}=f;h?d():M()}function S(){const h=[];a.value.forEach(p=>{s.get(p)||h.push(p)}),h.forEach(p=>a.value.delete(p))}return e.provide(Ee,n),e.provide(se,I),e.provide(ie,w),e.provide(re,y),e.provide(ce,u),e.provide(ue,g),e.provide(de,M),e.provide(fe,r),e.provide(Me,f),e.provide(ee,d),e.provide(ee,d),e.provide(ge,c),{selected:u,select:g,selectAll:M,unselect:r,unselectAll:d,toggle:w,toggleAll:I,isSelected:y,isAllSelected:f,selectedCount:c}}function ht(t){const n=e.ref(!1),o=e.ref(new Set),l=e.computed(()=>{let r=[];return n.value!=null?n.value&&(r=t.value):o.value.size&&(r=Array.from(o.value.values())),r}),a=e.computed(()=>{let r=0;return n.value!=null?n.value&&(r=t.value.length):r=o.value.size,r}),s=e.computed(()=>{let r;if(n.value!=null)r=n.value;else{const y=o.value.size,N=t.value.length;r=y==N}return r});function i(){n.value=!0}function u(){n.value=!1}function c(r){d(()=>{r.forEach(y=>{o.value.add(y)})})}function f(r){d(()=>{r.forEach(y=>{o.value.delete(y)})})}function M(r){return n.value!=null?n.value:o.value.has(r)}function d(r){n.value!=null&&(n.value?o.value=new Set(Array.from(t.value)):o.value=new Set),r(),o.value.size==0?n.value=!1:o.value.size==t.value.length?n.value=!0:n.value=null}function m(r){d(()=>{r.forEach(y=>{M(y)?o.value.delete(y):o.value.add(y)})})}function g(){const{value:r}=s;r?u():i()}return e.provide(se,g),e.provide(ie,m),e.provide(re,M),e.provide(ce,l),e.provide(ue,c),e.provide(de,i),e.provide(fe,f),e.provide(Me,s),e.provide(ee,u),e.provide(ee,u),e.provide(ge,a),{selected:l,select:c,selectAll:i,unselect:f,unselectAll:u,toggle:m,toggleAll:g,isSelected:M,isAllSelected:s,selectedCount:a}}function pt(t,n){return t>n?"horizontal":n>t?"vertical":""}function yt(){const t=e.ref(0),n=e.ref(0),o=e.ref(0),l=e.ref(0),a=e.ref(0),s=e.ref(0),i=e.ref(""),u=()=>i.value==="vertical",c=()=>i.value==="horizontal",f=()=>{o.value=0,l.value=0,a.value=0,s.value=0,i.value=""};return{move:(m,g)=>{o.value=(m<0?0:m)-t.value,l.value=g-n.value,a.value=Math.abs(o.value),s.value=Math.abs(l.value);const r=10;(!i.value||a.value<r&&s.value<r)&&(i.value=pt(a.value,s.value))},start:(m,g)=>{f(),t.value=m,n.value=g},reset:f,startX:t,startY:n,deltaX:o,deltaY:l,offsetX:a,offsetY:s,direction:i,isVertical:u,isHorizontal:c}}function Ie(t){return()=>{console.debug(`\u9ED8\u8BA4${t}\u65B9\u6CD5,\u9700\u8981\u81EA\u5B9A\u4E49\u751F\u6548`)}}function ze({key:t,customAttributeValue:n,attribute:o,selectWay:l="colum",scrollOptions:a={},getSelectMap:s=()=>({})}){const{select:i=Ie("\u9009\u62E9"),unselect:u=Ie("\u53D6\u6D88\u9009\u62E9"),unselectAll:c=Ie("\u53D6\u6D88\u5168\u9009"),selected:f=e.computed(()=>[])}=s();let M={};const d=e.computed(()=>Te(l==="colum"?Wn:Xn,50)),m=e.computed(()=>t??o),g=(()=>n?x=>n(x):x=>x)(),r=new Set;let y=new Set;const N=e.ref(!0),w=e.ref(),I=e.ref(!1),S=e.ref({x:0,y:0}),h=e.ref({x:0,y:0,scrollTop:0}),p=e.ref({}),v=e.ref({top:0,height:0,sync(x=!1){v.value.top=w.value?.scrollTop||0,x&&(v.value.height=w.value?.scrollHeight||0)}}),D=e.computed(()=>I.value?{left:Math.min(S.value.x,h.value.x)-p.value.left,top:Math.min(S.value.y,h.value.y)-p.value.top,width:Math.abs(S.value.x-h.value.x),height:Math.abs(S.value.y-h.value.y)}:{left:0,top:0,width:0,height:0}),C=e.ref(!1),{margin:B=50,startSpeed:$=30,maxSpeed:T=30}=a;let z;const b=B,k=$,_=T,A=x=>x**1;let E=0;function Q(x){if(cancelAnimationFrame(z),E=Y(x),E=Math.max(Math.min(E,_),-_),E!==0){const j=w.value;if(!j||!I.value)return;const P=v.value.height-p.value.height;let R=v.value.top+Number(E);R=Math.min(Math.max(0,R),P),j.scrollTop=R,U(),z=requestAnimationFrame(()=>Q(x))}}function Y(x){if(w.value){const P=p.value,R=P.bottom-x;if(R<b)return k*A(1-R/b);const F=x-P.top;if(F<b)return-k*A(1-F/b)}return 0}function O(x){const j={...D.value,right:0,bottom:0};return j.left+=p.value.left,j.top+=p.value.top-v.value.top,j.right=j.width+j.left,j.bottom=j.height+j.top,j.left<x.right&&j.right>x.left&&j.top<x.bottom&&j.bottom>x.top}function U(){v.value.sync();const{top:x,height:j}=v.value;h.value.y=Math.min(j+p.value.top,h.value.y+x-h.value.scrollTop),h.value.scrollTop=x}function V(x,j,P="dynamic-styles"){let R=document.getElementById(P);R||(R=document.createElement("style"),R.id=P,document.head.appendChild(R));const F=R.sheet.cssRules,K=F.length,pe=`${x} { ${j} }`;for(let te=0;te<K;te++){const je=F[te];if(je.selectorText===x&&je.style.cssText===j)return}R.sheet.insertRule(pe,K)}function H(x,j){N.value=!0,I.value=!0,v.value.sync(!0);const P=j+v.value.top;S.value.x=x,S.value.y=P,h.value.x=x,h.value.y=P,w.value?.classList.add("disable-scroll-behavior"),r.clear();const R=f.value;y=new Set(R.map(F=>F[m.value])),Ge()}function q(x,j,P){!I.value||(N.value&&(N.value=!1,l==="colum"&&!C.value&&!he()&&c()),P?.(),Q(j),h.value.x=Math.max(x,p.value.left),h.value.y=Math.min(j+v.value.top,v.value.height+p.value.top),h.value.scrollTop=v.value.top,d.value())}function Hn(){I.value=!1,w.value?.classList.remove("disable-scroll-behavior")}function Fn(){!I.value||(E||U(),d.value())}function he(){if(!I.value)return!1;const{width:x,height:j}=D.value;return!(Math.max(x,j)>5)}function Vn(){he()&&c()}function Wn(){he()||w.value?.querySelectorAll(`[${o}]`).forEach(x=>{const j=g(x.getAttribute(`${o}`));M[m.value]=j;const P=y.has(j),R=r.has(j);O(x.getBoundingClientRect())?R||(P?u([M]):i([M]),r.add(j)):R&&(P?i([M]):u([M]),r.delete(j))})}function Xn(){const x=[];let j=null,P=0;w.value?.querySelectorAll(`[${o}]`).forEach((R,F)=>{const K=g(R.getAttribute(`${o}`));x.push(K),O(R.getBoundingClientRect())&&(j===null&&(j=F),j=Math.min(j,F),P=Math.max(P,F))}),w.value?.querySelectorAll(`[${o}]`).forEach((R,F)=>{const K=x[F],pe=y.has(K),te=r.has(K);j!==null&&F>=j&&F<=P?te||(M[m.value]=K,pe?u([M]):i([M]),r.add(K)):te&&(M[m.value]=K,pe?i([M]):u([M]),r.delete(K))})}function Ge(){!w.value||(p.value=w.value.getBoundingClientRect())}function Kn(x){return!x?.value||(w.value=x.value,!w?.value)?!1:(Ge(),V(".disable-scroll-behavior","scroll-behavior: unset !important;"),!0)}return{init:Kn,dragStart:H,dragMove:q,dragEnd:Hn,onScroll:Fn,isSingleClick:he,cancelSelectAllBySingleClick:Vn,selectFn:d,getAttributeValue:g,incrementalSelect:C,selectRange:D,isPressing:I,containerEl:w}}function Dt(t,n=!1){const o=ze(t),{selectRange:l}=o,{onScroll:a,dragStart:s,dragMove:i,dragEnd:u,cancelSelectAllBySingleClick:c}=o,f=e.computed(()=>({left:`${l.value.left}px`,top:`${l.value.top}px`,width:`${l.value.width}px`,height:`${l.value.height}px`})),{load:M}=ve(`.drag-select-box {
|
|
2
2
|
position: absolute;
|
|
3
3
|
z-index: 99999;
|
|
4
4
|
background-color: rgb(191 219 254);
|