@lazycatcloud/lzc-toolkit 0.0.45 → 0.0.46
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 +618 -369
- package/dist/index.umd.js +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/useDragSelect/index.d.ts +44 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h.ui={},h.Vue))})(this,function(h,e){"use strict";var le;const B=typeof window<"u";B&&((le=window?.navigator)==null?void 0:le.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function j(t){return typeof t=="function"?t():e.unref(t)}function me(t,l){function n(...o){t(()=>l.apply(this,o),{fn:l,thisArg:this,args:o})}return n}function ge(t,l={}){let n,o;return s=>{const r=j(t),f=j(l.maxWait);if(n&&clearTimeout(n),r<=0||f!==void 0&&f<=0)return o&&(clearTimeout(o),o=null),s();f&&!o&&(o=setTimeout(()=>{n&&clearTimeout(n),o=null,s()},f)),n=setTimeout(()=>{o&&clearTimeout(o),o=null,s()},r)}}function ve(t){return t}function ye(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function ne(t,l=200,n={}){return me(ge(l,n),t)}function be(t,l=!0){e.getCurrentInstance()?e.onMounted(t):l?t():e.nextTick(t)}function oe(t){var l;const n=j(t);return(l=n?.$el)!=null?l:n}const _e=B?window:void 0;B&&window.document,B&&window.navigator,B&&window.location;function we(t,l=!1){const n=e.ref(),o=()=>n.value=Boolean(t());return o(),be(o,l),n}const K=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},V="__vueuse_ssr_handlers__";K[V]=K[V]||{},K[V];var re=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Ee=Object.prototype.propertyIsEnumerable,Oe=(t,l)=>{var n={};for(var o in t)Se.call(t,o)&&l.indexOf(o)<0&&(n[o]=t[o]);if(t!=null&&re)for(var o of re(t))l.indexOf(o)<0&&Ee.call(t,o)&&(n[o]=t[o]);return n};function Te(t,l,n={}){const o=n,{window:i=_e}=o,s=Oe(o,["window"]);let r;const f=we(()=>i&&"ResizeObserver"in i),v=()=>{r&&(r.disconnect(),r=void 0)},m=e.watch(()=>oe(t),g=>{v(),f.value&&i&&g&&(r=new ResizeObserver(l),r.observe(g,s))},{immediate:!0,flush:"post"}),p=()=>{v(),m()};return ye(p),{isSupported:f,stop:p}}function Be(t,l={width:0,height:0},n={}){const{box:o="content-box"}=n,i=e.ref(l.width),s=e.ref(l.height);return Te(t,([r])=>{const f=o==="border-box"?r.borderBoxSize:o==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;f?(i.value=f.reduce((v,{inlineSize:m})=>v+m,0),s.value=f.reduce((v,{blockSize:m})=>v+m,0)):(i.value=r.contentRect.width,s.value=r.contentRect.height)},n),e.watch(()=>oe(t),r=>{i.value=r?l.width:0,s.value=r?l.height:0}),{width:i,height:s}}var ie;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(ie||(ie={}));var He=Object.defineProperty,ae=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,se=(t,l,n)=>l in t?He(t,l,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[l]=n,Re=(t,l)=>{for(var n in l||(l={}))Ie.call(l,n)&&se(t,n,l[n]);if(ae)for(var n of ae(l))Ce.call(l,n)&&se(t,n,l[n]);return t};Re({linear:ve},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function ce(t,l){const{scrollEndHook:n,itemHeight:o,overscan:i=5}=l,s=e.ref(null),r=Be(s),f=e.ref(!0),v=ne(G,100);let m;const p=e.shallowRef(t),g=e.ref(0),c=e.ref({start:0,end:10});let u=0;const E=e.ref([]),y=e.computed(()=>{let{sum:a,height:d}={sum:0,height:0};return p.value.map((S,w)=>(typeof o=="number"?d=o:d=o(w),a+=d,{height:d,sum:a}))}),Y=e.computed(()=>A(c.value.start)),O=e.computed(()=>typeof o=="number"?y.value.length*o:y.value[y.value.length-1]?.sum||0),I=e.computed(()=>{let a=E.value.length-i,d=Math.max(a-u,0);return E.value.slice(d,a)});e.onMounted(()=>{}),e.onUnmounted(()=>cancelAnimationFrame(m)),e.watch([r.width,r.height,p],([a,d])=>{(a||d)&&R()},{deep:!0}),e.watch(g,()=>{C(),v()});function C(){f.value=!1}function G(){f.value=!0,n?.()}function R(){cancelAnimationFrame(m),m=requestAnimationFrame(x)}function x(){if(s.value){g.value=s.value.scrollTop,u=H();let a=P(g.value),d=a+u+i;a=a-i,a=a<0?0:a,d=d>p.value.length?p.value.length:d,c.value={start:a,end:d},E.value=p.value.slice(a,d).map((S,w)=>({data:S,index:w+a}))}}function P(a){let d=0,S=y.value.length-1,w=-1;for(;d<=S;){const b=Math.floor((d+S)/2);y.value[b].sum>=a?(w=b,S=b-1):d=b+1}return Math.max(0,w)}function H(){let a=0,d=0,S=J();for(let w=S;w<y.value.length&&(a++,d+=y.value[w].height,!(d>=r.height.value));w++);return a}function A(a){if(typeof o=="number")return a*o;let d=y.value[a];return d?d.sum-d.height:0}function $(a){return y.value[a]||{sum:0,height:0}}function J(){let a=c.value.start;return a>=i&&(a+=i),a}function X(a){if(s.value){const d=$(a);s.value.scrollTop=d.sum-d.height,x()}}const Z=e.computed(()=>({style:{width:"100%",height:`${O.value}px`,pointerEvents:f.value?void 0:"none"}})),k=e.computed(()=>({style:{transform:`translate3d(0, ${Y.value}px, 0)`,"will-change":"transform"}})),ee={overflowY:"auto"};return{list:E,visiableList:I,getItemHeightData:$,getoffsetTopIndex:P,totalHeight:O,clientHeight:r.height,scrollTo:X,scrollTop:g,isScrollEnd:f,containerProps:{ref:s,onScroll:()=>{R()},style:ee},wrapperProps:Z,innerProps:k}}const F=Symbol(),D=Symbol(),M=Symbol(),N=Symbol(),z=Symbol(),Q=Symbol(),U=Symbol(),W=Symbol(),q=Symbol();function xe(){const{voidFn:t,boolFn:l,boolRef:n,arrayRef:o}={voidFn:u=>{},boolFn:u=>!1,boolRef:e.computed(()=>!1),arrayRef:e.computed(()=>[])},i=e.inject(N,o),s=e.inject(M,l),r=e.inject(W,n),f=e.inject(D,t),v=e.inject(F,t),m=e.inject(z,t),p=e.inject(Q,t),g=e.inject(U,t),c=e.inject(q,t);return{selected:i,isSelected:s,isAllSelected:r,toggle:f,toggleAll:v,select:m,selectAll:p,unselect:g,unselectAll:c}}function Pe(t,l){const n=e.ref({}),o=e.computed(()=>t.value.filter(c=>n.value[c[l]])),i=e.computed(()=>o.value.length!=0&&Object.keys(n.value).length==t.value.length);function s(){t.value.forEach(c=>{n.value[c[l]]=!0})}function r(){n.value={}}function f(c){c.forEach(u=>{n.value[u[l]]||(n.value[u[l]]=!0)})}function v(c){c.forEach(u=>{n.value[u[l]]&&delete n.value[u[l]]})}function m(c){return!!n.value[c[l]]}function p(c){c.forEach(u=>{m(u)?delete n.value[u[l]]:n.value[u[l]]=!0})}function g(){i.value?r():s()}return e.provide(F,g),e.provide(D,p),e.provide(M,m),e.provide(N,o),e.provide(z,f),e.provide(Q,s),e.provide(U,v),e.provide(W,i),e.provide(q,r),{selected:o,select:f,selectAll:s,unselect:v,unselectAll:r,toggle:p,toggleAll:g,isSelected:m,isAllSelected:i}}const ue=Symbol(),Ae=e.defineComponent({__name:"Dialog",props:{visiable:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},dialogClass:{default:""}},emits:["update:visiable"],setup(t,{emit:l}){const n=t,o=()=>{n.closeOnClickOverlay&&l("update:visiable",!1)};return e.provide(ue,()=>l("update:visiable",!1)),(i,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:o,class:"modal absolute left-0 right-0 top-0 bottom-0 flex bg-stone-900 bg-opacity-50 z-[999]"},[e.createElementVNode("div",{onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"])),class:e.normalizeClass(["dialog m-auto flex flex-col",t.dialogClass])},[e.renderSlot(i.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function $e(t){function l(n,o){const i=document.createElement("div"),s={setup(){return()=>e.h(Ae,{visiable:!0,"onUpdate:visiable":()=>{i?.remove()},...t},{default:()=>e.h(n,o)})}};return document.body.appendChild(i),e.render(e.h(s),i),{close:()=>i?.remove()}}return{create:l}}const ke=["xlink:href","fill","color"],Le=e.defineComponent({__name:"SvgIcon",props:{name:null,prefix:{default:"icon"},color:{default:"#FFF"},width:null,height:null},setup(t){const l=t,n=e.computed(()=>`#${l.prefix}-${l.name}`),o=e.computed(()=>({width:`${l.width??l.height}px`,height:`${l.height??l.width}px`,aspectRatio:l.width&&l.height?void 0:"1/1"}));return(i,s)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(o))},[e.createElementVNode("use",{"xlink:href":e.unref(n),fill:t.color,color:t.color},null,8,ke)],4))}});function je(t){const{containerEl:l,sliderEl:n,autoHeight:o,performance:i={},maxHeightRatio:s=.9}=t,r=e.ref(!0),f=ne(A,100);let v,m="";const p=e.ref(0),g=e.ref(0),c=e.ref(0),u=e.ref({top:0,scrollTop:0,scrollHeight:0,clientHeight:0}),E=e.ref({clientHeight:0}),y=e.computed(()=>!!g.value),Y=e.computed(()=>u.value.scrollHeight>u.value.clientHeight),O=e.computed(()=>u.value.clientHeight-E.value.clientHeight),I=e.computed(()=>u.value.scrollHeight-u.value.clientHeight),C=e.computed(()=>Math.max(u.value.clientHeight/u.value.scrollHeight,.05)),G=e.computed(()=>C.value>s?0:C.value*u.value.clientHeight),R=e.computed(()=>({willChange:"transform",transform:`translate3d(0,${c.value}px,0)`,height:o?`${G.value}px`:void 0}));function x(b){H(),g.value=b.clientY-n.value.getBoundingClientRect().top||1,m=getComputedStyle(l.value).scrollBehavior,m==="smooth"&&(l.value.style.scrollBehavior="unset")}function P(){l.value.style.scrollBehavior=m,g.value=0,f()}function H(){r.value=!1}function A(){y.value||(r.value=!0)}function $(b){if(!y.value)return;let _=b.clientY-u.value.top-g.value;_<0?c.value=0:_>=O.value?c.value=O.value:c.value=_,l.value.scrollTo({top:c.value/O.value*I.value})}function J(){y.value||X()}function X(){cancelAnimationFrame(v),v=requestAnimationFrame(Z)}function Z(){l.value&&(p.value=i.scrollTop?.value??l.value.scrollTop,c.value=p.value/I.value*O.value)}function k(b){let _="addEventListener";b==="add"?_="addEventListener":_="removeEventListener",n.value?.[_]("pointerdown",x,{passive:!0}),window[_]("pointermove",$,{passive:!0}),window[_]("pointerup",P,{passive:!0})}const ee=new MutationObserver(b=>{b.map(L=>L.oldValue).join().includes("height")&&a()});function a(){u.value.top=l.value?.getBoundingClientRect().top??0,u.value.scrollHeight=l.value?.scrollHeight??0,u.value.clientHeight=l.value?.clientHeight??0}function d(){H(),setTimeout(()=>{E.value.clientHeight=n.value?.clientHeight??0,A()},150)}function S(b,_,L="dynamic-styles"){let T=document.getElementById(L);T||(T=document.createElement("style"),T.id=L,document.head.appendChild(T));const fe=T.sheet.cssRules,pe=fe.length,Qe=`${b} { ${_} }`;for(let te=0;te<pe;te++){const he=fe[te];if(he.selectorText===b&&he.style.cssText===_)return}T.sheet.insertRule(Qe,pe)}function w(){l.value&&n.value?(S(".hide-scrollbar","scrollbar-width: none; -ms-overflow-style: none;"),S(".hide-scrollbar::-webkit-scrollbar","display: none"),l.value.addEventListener("scroll",J,{passive:!0}),k("add"),ee.observe(l.value,{subtree:!0,attributeOldValue:!0,attributeFilter:["style"]}),setTimeout(()=>{a()},100),d()):console.error("useScrollBar:","\u521D\u59CB\u5316\u5931\u8D25!",{containerEl:l,sliderEl:n})}return e.watch(p,()=>{H(),f()}),{isScrollEnd:r,isDragSlider:y,offsetTop:c,scrollTop:p,scrollable:Y,sliderPos:R,init:w,modifySliderEventListener:k}}const Ke=(t=>(e.pushScopeId("data-v-edec7292"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("div",{class:"default-slider"},null,-1)),Ve=e.defineComponent({__name:"ScrollBar",props:{containerEl:null,autoHide:{type:Boolean},autoHeight:{type:Boolean},performance:null},setup(t,{expose:l}){const n=t,o=!!e.useSlots().default,i=e.ref(null),s=e.computed(()=>n.containerEl),r=je({containerEl:s,sliderEl:i,autoHeight:o?n.autoHeight:!0,performance:n.performance}),{scrollable:f,isScrollEnd:v,sliderPos:m}=r,p=e.ref(!1),g=n.autoHide?e.computed(()=>p.value||!v.value):e.computed(()=>f.value);e.onMounted(()=>{e.nextTick(()=>{r.init()})}),e.onUnmounted(()=>{r.modifySliderEventListener("remove")});function c(){p.value=!0}function u(){p.value=!1}return l({uScrollBarReturn:r}),(E,y)=>(e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"sliderRef",ref:i,class:"slider-wrapper",onMouseenter:c,onMouseleave:u,style:e.normalizeStyle(e.unref(m))},[e.renderSlot(E.$slots,"default",{},()=>[Ke],!0)],36),[[e.vShow,e.unref(g)]])]),_:3}))}}),qe="",de=(t,l)=>{const n=t.__vccOpts||t;for(const[o,i]of l)n[o]=i;return n},Fe=de(Ve,[["__scopeId","data-v-edec7292"]]),De={class:"virtualListWrapper"},Me={inheritAttrs:!1},Ne=e.defineComponent({...Me,__name:"VirtualList",props:{data:null,itemHeight:null,overscan:{default:10}},emits:["scrollEnd"],setup(t,{expose:l,emit:n}){const o=t,i=ce(e.toRef(o,"data"),{itemHeight:p=>o.itemHeight(o.data[p]),overscan:o.overscan,scrollEndHook:()=>{n("scrollEnd")}}),{list:s,containerProps:r,wrapperProps:f,innerProps:v,getItemHeightData:m}=i;return l({vListReturn:i}),(p,g)=>(e.openBlock(),e.createElementBlock("div",De,[e.createElementVNode("div",e.mergeProps({onScrollPassive:g[0]||(g[0]=(...c)=>e.unref(r).onScroll&&e.unref(r).onScroll(...c)),ref:e.unref(r).ref,class:"virtualList"},p.$attrs),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(f))),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(v))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),({index:c,data:u})=>(e.openBlock(),e.createElementBlock("div",{key:c,style:e.normalizeStyle({height:`${e.unref(m)(c).height}px`,display:"flex"})},[e.renderSlot(p.$slots,"default",{data:u,index:c},void 0,!0)],4))),128))],16)],16)],16)]))}}),Ye="",ze=de(Ne,[["__scopeId","data-v-4ba97cce"]]);h.ScrollBar=Fe,h.SvgIcon=Le,h.VirtualList=ze,h.allSelectedKey=N,h.closeDialogKey=ue,h.dialogController=$e,h.isAllSelectedKey=W,h.isSelectedKey=M,h.selectAllKey=Q,h.selectKey=z,h.toggleAllKey=F,h.toggleKey=D,h.unselectAllKey=q,h.unselectKey=U,h.useSelectable=Pe,h.useSelectableInjectors=xe,h.useVirtualList=ce,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(w,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(w=typeof globalThis<"u"?globalThis:w||self,e(w.ui={},w.Vue))})(this,function(w,e){"use strict";var de;const fe=typeof window<"u";fe&&((de=window?.navigator)==null?void 0:de.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function W(t){return typeof t=="function"?t():e.unref(t)}function he(t,n){function o(...l){t(()=>n.apply(this,l),{fn:n,thisArg:this,args:l})}return o}function xe(t,n={}){let o,l;return i=>{const a=W(t),d=W(n.maxWait);if(o&&clearTimeout(o),a<=0||d!==void 0&&d<=0)return l&&(clearTimeout(l),l=null),i();d&&!l&&(l=setTimeout(()=>{o&&clearTimeout(o),l=null,i()},d)),o=setTimeout(()=>{l&&clearTimeout(l),l=null,i()},a)}}function Be(t,n=!0,o=!0){let l=0,r,i=!0;const a=()=>{r&&(clearTimeout(r),r=void 0)};return y=>{const v=W(t),h=Date.now()-l;if(a(),v<=0)return l=Date.now(),y();h>v&&(o||!i)?(l=Date.now(),y()):n&&(r=setTimeout(()=>{l=Date.now(),i=!0,a(),y()},v)),!o&&!r&&(r=setTimeout(()=>i=!0,v)),i=!1}}function Oe(t){return t}function Re(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function pe(t,n=200,o={}){return he(xe(n,o),t)}function me(t,n=200,o=!1,l=!0){return he(Be(n,o,l),t)}function Ce(t,n=!0){e.getCurrentInstance()?e.onMounted(t):n?t():e.nextTick(t)}function ve(t){var n;const o=W(t);return(n=o?.$el)!=null?n:o}const De=fe?window:void 0;function Ie(t,n=!1){const o=e.ref(),l=()=>o.value=Boolean(t());return l(),Ce(l,n),o}const X=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},J="__vueuse_ssr_handlers__";X[J]=X[J]||{},X[J];var ge=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable,Ae=(t,n)=>{var o={};for(var l in t)Le.call(t,l)&&n.indexOf(l)<0&&(o[l]=t[l]);if(t!=null&&ge)for(var l of ge(t))n.indexOf(l)<0&&He.call(t,l)&&(o[l]=t[l]);return o};function Me(t,n,o={}){const l=o,{window:r=De}=l,i=Ae(l,["window"]);let a;const d=Ie(()=>r&&"ResizeObserver"in r),y=()=>{a&&(a.disconnect(),a=void 0)},v=e.watch(()=>ve(t),u=>{y(),d.value&&r&&u&&(a=new ResizeObserver(n),a.observe(u,i))},{immediate:!0,flush:"post"}),h=()=>{y(),v()};return Re(h),{isSupported:d,stop:h}}function Pe(t,n={width:0,height:0},o={}){const{box:l="content-box"}=o,r=e.ref(n.width),i=e.ref(n.height);return Me(t,([a])=>{const d=l==="border-box"?a.borderBoxSize:l==="content-box"?a.contentBoxSize:a.devicePixelContentBoxSize;d?(r.value=d.reduce((y,{inlineSize:v})=>y+v,0),i.value=d.reduce((y,{blockSize:v})=>y+v,0)):(r.value=a.contentRect.width,i.value=a.contentRect.height)},o),e.watch(()=>ve(t),a=>{r.value=a?n.width:0,i.value=a?n.height:0}),{width:r,height:i}}var ye;(function(t){t.UP="UP",t.RIGHT="RIGHT",t.DOWN="DOWN",t.LEFT="LEFT",t.NONE="NONE"})(ye||(ye={}));var $e=Object.defineProperty,Se=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable,be=(t,n,o)=>n in t?$e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,je=(t,n)=>{for(var o in n||(n={}))Fe.call(n,o)&&be(t,o,n[o]);if(Se)for(var o of Se(n))ke.call(n,o)&&be(t,o,n[o]);return t};je({linear:Oe},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});function Ee(t,n){const{scrollEndHook:o,itemHeight:l,overscan:r=5}=n,i=e.ref(null),a=Pe(i),d=e.ref(!0),y=pe(U,100);let v;const h=e.shallowRef(t),u=e.ref(0),s=e.ref({start:0,end:10});let c=0;const b=e.ref([]),_=e.computed(()=>{let{sum:p,height:S}={sum:0,height:0};return h.value.map((D,C)=>(typeof l=="number"?S=l:S=l(C),p+=S,{height:S,sum:p}))}),E=e.computed(()=>F(s.value.start)),g=e.computed(()=>typeof l=="number"?_.value.length*l:_.value[_.value.length-1]?.sum||0),O=e.computed(()=>{let p=b.value.length-r,S=Math.max(p-c,0);return b.value.slice(S,p)});e.onMounted(()=>{}),e.onUnmounted(()=>cancelAnimationFrame(v)),e.watch([a.width,a.height,h],([p,S])=>{(p||S)&&K()},{deep:!0}),e.watch(u,()=>{I(),y()});function I(){d.value=!1}function U(){d.value=!0,o?.()}function K(){cancelAnimationFrame(v),v=requestAnimationFrame($)}function $(){if(i.value){u.value=i.value.scrollTop,c=M();let p=H(u.value),S=p+c+r;p=p-r,p=p<0?0:p,S=S>h.value.length?h.value.length:S,s.value={start:p,end:S},b.value=h.value.slice(p,S).map((D,C)=>({data:D,index:C+p}))}}function H(p){let S=0,D=_.value.length-1,C=-1;for(;S<=D;){const B=Math.floor((S+D)/2);_.value[B].sum>=p?(C=B,D=B-1):S=B+1}return Math.max(0,C)}function M(){let p=0,S=0,D=L();for(let C=D;C<_.value.length&&(p++,S+=_.value[C].height,!(S>=a.height.value));C++);return p}function F(p){if(typeof l=="number")return p*l;let S=_.value[p];return S?S.sum-S.height:0}function k(p){return _.value[p]||{sum:0,height:0}}function L(){let p=s.value.start;return p>=r&&(p+=r),p}function V(p){if(i.value){const S=k(p);i.value.scrollTop=S.sum-S.height,$()}}const q=e.computed(()=>({style:{width:"100%",height:`${g.value}px`,pointerEvents:d.value?void 0:"none"}})),j=e.computed(()=>({style:{transform:`translate3d(0, ${E.value}px, 0)`,"will-change":"transform"}})),N={overflowY:"auto"};return{list:b,visiableList:O,getItemHeightData:k,getoffsetTopIndex:H,totalHeight:g,clientHeight:a.height,scrollTo:V,scrollTop:u,isScrollEnd:d,containerProps:{ref:i,onScroll:()=>{K()},style:N},wrapperProps:q,innerProps:j}}const Z=Symbol(),ee=Symbol(),te=Symbol(),ne=Symbol(),le=Symbol(),oe=Symbol(),re=Symbol(),ae=Symbol(),ie=Symbol();function Ke(){const{voidFn:t,boolFn:n,boolRef:o,arrayRef:l}={voidFn:c=>{},boolFn:c=>!1,boolRef:e.computed(()=>!1),arrayRef:e.computed(()=>[])},r=e.inject(ne,l),i=e.inject(te,n),a=e.inject(ae,o),d=e.inject(ee,t),y=e.inject(Z,t),v=e.inject(le,t),h=e.inject(oe,t),u=e.inject(re,t),s=e.inject(ie,t);return{selected:r,isSelected:i,isAllSelected:a,toggle:d,toggleAll:y,select:v,selectAll:h,unselect:u,unselectAll:s}}function Ve(t,n){const o=e.ref({}),l=e.computed(()=>t.value.filter(s=>o.value[s[n]])),r=e.computed(()=>l.value.length!=0&&Object.keys(o.value).length==t.value.length);function i(){t.value.forEach(s=>{o.value[s[n]]=!0})}function a(){o.value={}}function d(s){s.forEach(c=>{o.value[c[n]]||(o.value[c[n]]=!0)})}function y(s){s.forEach(c=>{o.value[c[n]]&&delete o.value[c[n]]})}function v(s){return!!o.value[s[n]]}function h(s){s.forEach(c=>{v(c)?delete o.value[c[n]]:o.value[c[n]]=!0})}function u(){r.value?a():i()}return e.provide(Z,u),e.provide(ee,h),e.provide(te,v),e.provide(ne,l),e.provide(le,d),e.provide(oe,i),e.provide(re,y),e.provide(ae,r),e.provide(ie,a),{selected:l,select:d,selectAll:i,unselect:y,unselectAll:a,toggle:h,toggleAll:u,isSelected:v,isAllSelected:r}}function se(t){return()=>{console.debug(`\u9ED8\u8BA4${t}\u65B9\u6CD5,\u9700\u8981\u81EA\u5B9A\u4E49\u751F\u6548`)}}function ce({attribute:t,selectWay:n="colum",scrollOptions:o={},getSelectMap:l=()=>({})}){const{select:r=se("\u9009\u62E9"),unselect:i=se("\u53D6\u6D88\u9009\u62E9"),unselectAll:a=se("\u53D6\u6D88\u5168\u9009")}=l();let d={};const y=e.computed(()=>me(n==="colum"?P:Y,50)),v=new Set,h=e.ref(!0),u=e.ref(),s=e.ref(!1),c=e.ref({x:0,y:0}),b=e.ref({x:0,y:0,scrollTop:0}),_=new ResizeObserver(f=>E.value=f[0].target.getBoundingClientRect()),E=e.ref({}),g=e.ref({top:0,height:0,sync(f=!1){g.value.top=u.value?.scrollTop||0,f&&(g.value.height=u.value?.scrollHeight||0)}}),O=e.computed(()=>s.value?{left:Math.min(c.value.x,b.value.x)-E.value.left,top:Math.min(c.value.y,b.value.y)-E.value.top,width:Math.abs(c.value.x-b.value.x),height:Math.abs(c.value.y-b.value.y)}:{left:0,top:0,width:0,height:0}),{margin:I=50,startSpeed:U=30,maxSpeed:K=30}=o;let $;const H=I,M=U,F=K,k=f=>f**1;let L=0;function V(f){if(cancelAnimationFrame($),L=q(f),L=Math.max(Math.min(L,F),-F),L!==0){const m=u.value;if(!m||!s.value)return;const R=g.value.height-E.value.height;let T=g.value.top+Number(L);T=Math.min(Math.max(0,T),R),m.scrollTop=T,N(),$=requestAnimationFrame(()=>V(f))}}function q(f){if(u.value){const R=E.value,T=R.bottom-f;if(T<H)return M*k(1-T/H);const A=f-R.top;if(A<H)return-M*k(1-A/H)}return 0}function j(f){const m={...O.value,right:0,bottom:0};return m.left+=E.value.left,m.top+=E.value.top-g.value.top,m.right=m.width+m.left,m.bottom=m.height+m.top,m.left<f.right&&m.right>f.left&&m.top<f.bottom&&m.bottom>f.top}function N(){g.value.sync();const{top:f,height:m}=g.value;b.value.y=Math.min(m+E.value.top,b.value.y+f-b.value.scrollTop),b.value.scrollTop=f}function p(f,m,R="dynamic-styles"){let T=document.getElementById(R);T||(T=document.createElement("style"),T.id=R,document.head.appendChild(T));const A=T.sheet.cssRules,Q=A.length,lt=`${f} { ${m} }`;for(let ue=0;ue<Q;ue++){const Te=A[ue];if(Te.selectorText===f&&Te.style.cssText===m)return}T.sheet.insertRule(lt,Q)}function S(f,m){h.value=!0,s.value=!0,g.value.height?g.value.sync():g.value.sync(!0),c.value.x=f,c.value.y=m+g.value.top,b.value.x=c.value.x,b.value.y=c.value.y,u.value?.classList.add("disable-scroll-behavior"),v.clear()}function D(f,m,R){!s.value||(h.value&&n==="colum"&&!x()&&(a(),h.value=!1),R?.(),V(m),b.value.x=Math.max(f,E.value.left),b.value.y=Math.min(m+g.value.top,g.value.height+E.value.top),b.value.scrollTop=g.value.top,y.value())}function C(){s.value=!1,u.value?.classList.remove("disable-scroll-behavior")}function B(){!s.value||(L||N(),y.value())}function x(){if(!s.value)return!1;const{width:f,height:m}=O.value;return!(Math.max(f,m)>5)}function z(){x()&&a()}function P(){x()||u.value?.querySelectorAll(`[${t}]`).forEach(f=>{d[`${t}`]=f.getAttribute(`${t}`),j(f.getBoundingClientRect())?r([d]):i([d])})}function Y(){const f=[];let m=null,R=0;u.value?.querySelectorAll(`[${t}]`).forEach((T,A)=>{const Q=T.getAttribute(`${t}`);f.push(Q),j(T.getBoundingClientRect())?(m===null&&(m=A),m=Math.min(m,A),R=Math.max(R,A)):(d[`${t}`]=Q,v.has(Q)&&i([d]))});for(let T=m;T<R+1;T++)d[`${t}`]=f[T],r([d]),v.add(f[T])}function G(f){return!f?.value||(u.value=f.value,!u?.value)?!1:(_.observe(u.value),p(".disable-scroll-behavior","scroll-behavior: unset !important;"),!0)}return{init:G,dragStart:S,dragMove:D,dragEnd:C,onScroll:B,isSingleClick:x,cancelSelectAllBySingleClick:z,selectFn:y,selectRange:O,isPressing:s,containerEl:u,observer:_}}function Ne(t){const n=ce(t),{observer:o,selectRange:l}=n,{onScroll:r,dragStart:i,dragMove:a,dragEnd:d,cancelSelectAllBySingleClick:y}=n,v=e.computed(()=>({left:`${l.value.left}px`,top:`${l.value.top}px`,width:`${l.value.width}px`,height:`${l.value.height}px`})),h=e.defineComponent({render(){return e.h("div",{id:"selectBoxEl",class:"absolute z-50 bg-blue-200 opacity-50",style:v.value})}});function u(E){E.button===0&&i(E.x,E.y)}function s(E){a(E.x,E.y)}function c(E){E.composedPath().some(O=>O?.getAttribute?.(t.attribute))||y(),d()}function b(E){try{if(!n.init(E))throw"\u521D\u59CB\u5316\u5931\u8D25,Ref\u5143\u7D20\u4E0D\u6B63\u786E";if(!n.containerEl?.value)return!1;e.render(e.h(h),n.containerEl.value),n.containerEl.value?.addEventListener("scroll",r),n.containerEl.value?.addEventListener("mousedown",u),window.addEventListener("mousemove",s),window.addEventListener("mouseup",c)}catch(g){console.error("\u62D6\u9009\u529F\u80FD\u521D\u59CB\u5316\u5931\u8D25",g)}}function _(){o.disconnect(),n.containerEl.value?.removeEventListener("scroll",r),n.containerEl.value?.removeEventListener("mousedown",u),window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",c)}return{init:b,unMount:_}}function ze(t,n,o=600){const l=ce({...t,selectWay:"row",scrollOptions:{startSpeed:5,maxSpeed:5}}),{observer:r}=l,{onScroll:i,dragStart:a,dragMove:d,dragEnd:y,selectFn:v}=l;let h;function u(){clearTimeout(h)}function s(g){u(),h=setTimeout(()=>{const{clientX:O,clientY:I}=g.targetTouches[0];a(O,I),n?.(),v.value(),g.preventDefault()},o)}function c(g){u();const{clientX:O,clientY:I}=g.targetTouches[0];d(O,I,()=>g.preventDefault())}function b(){u(),y()}function _(g){try{if(!l.init(g))throw"\u521D\u59CB\u5316\u5931\u8D25,Ref\u5143\u7D20\u4E0D\u6B63\u786E";if(!l.containerEl?.value)return!1;l.containerEl.value?.addEventListener("scroll",i),l.containerEl.value?.addEventListener("touchstart",s),l.containerEl.value?.addEventListener("touchmove",c),window.addEventListener("touchcancel",b),window.addEventListener("touchend",b)}catch(O){console.error("\u62D6\u9009\u529F\u80FD\u521D\u59CB\u5316\u5931\u8D25",O)}}function E(){r.disconnect(),l.containerEl.value?.removeEventListener("scroll",i),l.containerEl.value?.removeEventListener("touchstart",s),l.containerEl.value?.removeEventListener("touchmove",c),window.removeEventListener("touchcancel",b),window.removeEventListener("touchEnd",b)}return{init:_,unMount:E}}const we=Symbol(),Qe=e.defineComponent({__name:"Dialog",props:{visiable:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},dialogClass:{default:""}},emits:["update:visiable"],setup(t,{emit:n}){const o=t,l=()=>{o.closeOnClickOverlay&&n("update:visiable",!1)};return e.provide(we,()=>n("update:visiable",!1)),(r,i)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:l,class:"modal absolute left-0 right-0 top-0 bottom-0 flex bg-stone-900 bg-opacity-50 z-[999]"},[e.createElementVNode("div",{onClick:i[0]||(i[0]=e.withModifiers(()=>{},["stop"])),class:e.normalizeClass(["dialog m-auto flex flex-col",t.dialogClass])},[e.renderSlot(r.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function Ue(t){function n(o,l){const r=document.createElement("div"),i={setup(){return()=>e.h(Qe,{visiable:!0,"onUpdate:visiable":()=>{r?.remove()},...t},{default:()=>e.h(o,l)})}};return document.body.appendChild(r),e.render(e.h(i),r),{close:()=>r?.remove()}}return{create:n}}const qe=["xlink:href","fill","color"],We=e.defineComponent({__name:"SvgIcon",props:{name:null,prefix:{default:"icon"},color:{default:"#FFF"},width:null,height:null},setup(t){const n=t,o=e.computed(()=>`#${n.prefix}-${n.name}`),l=e.computed(()=>({width:`${n.width??n.height}px`,height:`${n.height??n.width}px`,aspectRatio:n.width&&n.height?void 0:"1/1"}));return(r,i)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(l))},[e.createElementVNode("use",{"xlink:href":e.unref(o),fill:t.color,color:t.color},null,8,qe)],4))}});function Ye(t){const{containerEl:n,sliderEl:o,autoHeight:l,performance:r={},maxHeightRatio:i=.9}=t,a=e.ref(!0),d=pe(F,100);let y,v="";const h=e.ref(0),u=e.ref(0),s=e.ref(0),c=e.ref({top:0,scrollTop:0,scrollHeight:0,clientHeight:0}),b=e.ref({clientHeight:0}),_=e.computed(()=>!!u.value),E=e.computed(()=>c.value.scrollHeight>c.value.clientHeight),g=e.computed(()=>c.value.clientHeight-b.value.clientHeight),O=e.computed(()=>c.value.scrollHeight-c.value.clientHeight),I=e.computed(()=>Math.max(c.value.clientHeight/c.value.scrollHeight,.05)),U=e.computed(()=>I.value>i?0:I.value*c.value.clientHeight),K=e.computed(()=>({willChange:"transform",transform:`translate3d(0,${s.value}px,0)`,height:l?`${U.value}px`:void 0}));function $(B){M(),u.value=B.clientY-o.value.getBoundingClientRect().top||1,v=getComputedStyle(n.value).scrollBehavior,v==="smooth"&&(n.value.style.scrollBehavior="unset")}function H(){n.value.style.scrollBehavior=v,u.value=0,d()}function M(){a.value=!1}function F(){_.value||(a.value=!0)}function k(B){if(!_.value)return;let x=B.clientY-c.value.top-u.value;x<0?s.value=0:x>=g.value?s.value=g.value:s.value=x,n.value.scrollTo({top:s.value/g.value*O.value})}function L(){_.value||V()}function V(){cancelAnimationFrame(y),y=requestAnimationFrame(q)}function q(){n.value&&(h.value=r.scrollTop?.value??n.value.scrollTop,s.value=h.value/O.value*g.value)}function j(B){let x="addEventListener";B==="add"?x="addEventListener":x="removeEventListener",o.value?.[x]("pointerdown",$,{passive:!0}),window[x]("pointermove",k,{passive:!0}),window[x]("pointerup",H,{passive:!0})}const N=new MutationObserver(B=>{B.map(z=>z.oldValue).join().includes("height")&&p()});function p(){c.value.top=n.value?.getBoundingClientRect().top??0,c.value.scrollHeight=n.value?.scrollHeight??0,c.value.clientHeight=n.value?.clientHeight??0}function S(){M(),setTimeout(()=>{b.value.clientHeight=o.value?.clientHeight??0,F()},150)}function D(B,x,z="dynamic-styles"){let P=document.getElementById(z);P||(P=document.createElement("style"),P.id=z,document.head.appendChild(P));const Y=P.sheet.cssRules,G=Y.length,f=`${B} { ${x} }`;for(let m=0;m<G;m++){const R=Y[m];if(R.selectorText===B&&R.style.cssText===x)return}P.sheet.insertRule(f,G)}function C(){n.value&&o.value?(D(".hide-scrollbar","scrollbar-width: none; -ms-overflow-style: none;"),D(".hide-scrollbar::-webkit-scrollbar","display: none"),n.value.addEventListener("scroll",L,{passive:!0}),j("add"),N.observe(n.value,{subtree:!0,attributeOldValue:!0,attributeFilter:["style"]}),setTimeout(()=>{p()},100),S()):console.error("useScrollBar:","\u521D\u59CB\u5316\u5931\u8D25!",{containerEl:n,sliderEl:o})}return e.watch(h,()=>{M(),d()}),{isScrollEnd:a,isDragSlider:_,offsetTop:s,scrollTop:h,scrollable:E,sliderPos:K,init:C,modifySliderEventListener:j}}const Ge=(t=>(e.pushScopeId("data-v-edec7292"),t=t(),e.popScopeId(),t))(()=>e.createElementVNode("div",{class:"default-slider"},null,-1)),Xe=e.defineComponent({__name:"ScrollBar",props:{containerEl:null,autoHide:{type:Boolean},autoHeight:{type:Boolean},performance:null},setup(t,{expose:n}){const o=t,l=!!e.useSlots().default,r=e.ref(null),i=e.computed(()=>o.containerEl),a=Ye({containerEl:i,sliderEl:r,autoHeight:l?o.autoHeight:!0,performance:o.performance}),{scrollable:d,isScrollEnd:y,sliderPos:v}=a,h=e.ref(!1),u=o.autoHide?e.computed(()=>h.value||!y.value):e.computed(()=>d.value);e.onMounted(()=>{e.nextTick(()=>{a.init()})}),e.onUnmounted(()=>{a.modifySliderEventListener("remove")});function s(){h.value=!0}function c(){h.value=!1}return n({uScrollBarReturn:a}),(b,_)=>(e.openBlock(),e.createBlock(e.Transition,null,{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{ref_key:"sliderRef",ref:r,class:"slider-wrapper",onMouseenter:s,onMouseleave:c,style:e.normalizeStyle(e.unref(v))},[e.renderSlot(b.$slots,"default",{},()=>[Ge],!0)],36),[[e.vShow,e.unref(u)]])]),_:3}))}}),at="",_e=(t,n)=>{const o=t.__vccOpts||t;for(const[l,r]of n)o[l]=r;return o},Je=_e(Xe,[["__scopeId","data-v-edec7292"]]),Ze={class:"virtualListWrapper"},et={inheritAttrs:!1},tt=e.defineComponent({...et,__name:"VirtualList",props:{data:null,itemHeight:null,overscan:{default:10}},emits:["scrollEnd"],setup(t,{expose:n,emit:o}){const l=t,r=Ee(e.toRef(l,"data"),{itemHeight:h=>l.itemHeight(l.data[h]),overscan:l.overscan,scrollEndHook:()=>{o("scrollEnd")}}),{list:i,containerProps:a,wrapperProps:d,innerProps:y,getItemHeightData:v}=r;return n({vListReturn:r}),(h,u)=>(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("div",e.mergeProps({onScrollPassive:u[0]||(u[0]=(...s)=>e.unref(a).onScroll&&e.unref(a).onScroll(...s)),ref:e.unref(a).ref,class:"virtualList"},h.$attrs),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(d))),[e.createElementVNode("div",e.normalizeProps(e.guardReactiveProps(e.unref(y))),[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),({index:s,data:c})=>(e.openBlock(),e.createElementBlock("div",{key:s,style:e.normalizeStyle({height:`${e.unref(v)(s).height}px`,display:"flex"})},[e.renderSlot(h.$slots,"default",{data:c,index:s},void 0,!0)],4))),128))],16)],16)],16)]))}}),it="",nt=_e(tt,[["__scopeId","data-v-4ba97cce"]]);w.ScrollBar=Je,w.SvgIcon=We,w.VirtualList=nt,w.allSelectedKey=ne,w.closeDialogKey=we,w.dialogController=Ue,w.isAllSelectedKey=ae,w.isSelectedKey=te,w.selectAllKey=oe,w.selectKey=le,w.toggleAllKey=Z,w.toggleKey=ee,w.unselectAllKey=ie,w.unselectKey=re,w.useDragSelect=ce,w.useDragSelectByMobile=ze,w.useDragSelectByPc=Ne,w.useSelectable=Ve,w.useSelectableInjectors=Ke,w.useVirtualList=Ee,Object.defineProperties(w,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type Ref } from "vue";
|
|
2
|
+
interface DragOptions {
|
|
3
|
+
attribute: string;
|
|
4
|
+
selectWay?: "row" | "colum";
|
|
5
|
+
scrollOptions?: {
|
|
6
|
+
margin?: number;
|
|
7
|
+
startSpeed?: number;
|
|
8
|
+
maxSpeed?: number;
|
|
9
|
+
};
|
|
10
|
+
getSelectMap?: () => {
|
|
11
|
+
select?: (_: any[]) => void;
|
|
12
|
+
unselect?: (_: any[]) => void;
|
|
13
|
+
unselectAll?: () => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare type ContainsRefType = Ref<HTMLElement | null | undefined>;
|
|
17
|
+
export declare function useDragSelect({ attribute, selectWay, scrollOptions, getSelectMap, }: DragOptions): {
|
|
18
|
+
init: (_containerEl: ContainsRefType) => boolean;
|
|
19
|
+
dragStart: (x: number, y: number) => void;
|
|
20
|
+
dragMove: (x: number, y: number, hook?: Function) => void;
|
|
21
|
+
dragEnd: () => void;
|
|
22
|
+
onScroll: () => void;
|
|
23
|
+
isSingleClick: () => boolean;
|
|
24
|
+
cancelSelectAllBySingleClick: () => void;
|
|
25
|
+
selectFn: import("vue").ComputedRef<() => void>;
|
|
26
|
+
selectRange: import("vue").ComputedRef<{
|
|
27
|
+
left: number;
|
|
28
|
+
top: number;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}>;
|
|
32
|
+
isPressing: Ref<boolean>;
|
|
33
|
+
containerEl: ContainsRefType;
|
|
34
|
+
observer: ResizeObserver;
|
|
35
|
+
};
|
|
36
|
+
export declare function useDragSelectByPc(options: DragOptions): {
|
|
37
|
+
init: (_containerEl: ContainsRefType) => false | undefined;
|
|
38
|
+
unMount: () => void;
|
|
39
|
+
};
|
|
40
|
+
export declare function useDragSelectByMobile(options: DragOptions, joinSelectMode?: Function, pressTime?: number): {
|
|
41
|
+
init: (_containerEl: ContainsRefType) => false | undefined;
|
|
42
|
+
unMount: () => void;
|
|
43
|
+
};
|
|
44
|
+
export {};
|