@lazycatcloud/lzc-toolkit 0.0.47 → 0.0.48
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 +30 -32
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { unref as _, getCurrentScope as Ce, onScopeDispose as Be, getCurrentInstance as Pe, onMounted as te, nextTick as ne, ref as g, watch as $, shallowRef as Re, computed as f, onUnmounted as ve, inject as
|
|
1
|
+
import { unref as _, getCurrentScope as Ce, onScopeDispose as Be, getCurrentInstance as Pe, onMounted as te, nextTick as ne, ref as g, watch as $, shallowRef as Re, computed as f, onUnmounted as ve, inject as T, provide as x, defineComponent as F, openBlock as I, createBlock as fe, Transition as pe, withCtx as he, createElementBlock as B, createElementVNode as H, withModifiers as $e, normalizeClass as Fe, renderSlot as oe, createCommentVNode as Ae, render as J, h as R, normalizeStyle as K, useSlots as Le, withDirectives as De, vShow as ke, pushScopeId as Me, popScopeId as We, toRef as Ve, mergeProps as je, normalizeProps as le, guardReactiveProps as se, Fragment as ze, renderList as Ke, toDisplayString as Ne } from "vue";
|
|
2
2
|
var re;
|
|
3
3
|
const A = typeof window < "u";
|
|
4
4
|
A && ((re = window?.navigator) == null ? void 0 : re.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
|
|
@@ -134,12 +134,12 @@ function ut(t, e) {
|
|
|
134
134
|
let p;
|
|
135
135
|
const v = Re(t), h = g(0), i = g({ start: 0, end: 10 });
|
|
136
136
|
let u = 0;
|
|
137
|
-
const
|
|
137
|
+
const E = g([]), b = f(() => {
|
|
138
138
|
let { sum: a, height: c } = { sum: 0, height: 0 };
|
|
139
139
|
return v.value.map((S, y) => (typeof o == "number" ? c = o : c = o(y), a += c, { height: c, sum: a }));
|
|
140
140
|
}), N = f(() => V(i.value.start)), C = f(() => typeof o == "number" ? b.value.length * o : b.value[b.value.length - 1]?.sum || 0), L = f(() => {
|
|
141
|
-
let a =
|
|
142
|
-
return
|
|
141
|
+
let a = E.value.length - s, c = Math.max(a - u, 0);
|
|
142
|
+
return E.value.slice(c, a);
|
|
143
143
|
});
|
|
144
144
|
te(() => {
|
|
145
145
|
}), ve(() => cancelAnimationFrame(p)), $(
|
|
@@ -164,7 +164,7 @@ function ut(t, e) {
|
|
|
164
164
|
if (r.value) {
|
|
165
165
|
h.value = r.value.scrollTop, u = P();
|
|
166
166
|
let a = W(h.value), c = a + u + s;
|
|
167
|
-
a = a - s, a = a < 0 ? 0 : a, c = c > v.value.length ? v.value.length : c, i.value = { start: a, end: c },
|
|
167
|
+
a = a - s, a = a < 0 ? 0 : a, c = c > v.value.length ? v.value.length : c, i.value = { start: a, end: c }, E.value = v.value.slice(a, c).map((S, y) => ({
|
|
168
168
|
data: S,
|
|
169
169
|
index: y + a
|
|
170
170
|
}));
|
|
@@ -218,7 +218,7 @@ function ut(t, e) {
|
|
|
218
218
|
overflowY: "auto"
|
|
219
219
|
};
|
|
220
220
|
return {
|
|
221
|
-
list:
|
|
221
|
+
list: E,
|
|
222
222
|
visiableList: L,
|
|
223
223
|
getItemHeightData: j,
|
|
224
224
|
getoffsetTopIndex: W,
|
|
@@ -246,7 +246,7 @@ function xt() {
|
|
|
246
246
|
boolFn: (u) => !1,
|
|
247
247
|
boolRef: f(() => !1),
|
|
248
248
|
arrayRef: f(() => [])
|
|
249
|
-
}, s =
|
|
249
|
+
}, s = T(we, o), r = T(ye, e), l = T(Ee, n), d = T(_e, t), m = T(be, t), p = T(Se, t), v = T(Oe, t), h = T(xe, t), i = T(Te, t);
|
|
250
250
|
return {
|
|
251
251
|
selected: s,
|
|
252
252
|
isSelected: r,
|
|
@@ -321,7 +321,7 @@ const ct = Symbol(), dt = /* @__PURE__ */ F({
|
|
|
321
321
|
onClick: o,
|
|
322
322
|
class: "modal absolute inset-0 bottom-0 flex bg-stone-900 bg-opacity-50 z-[999]"
|
|
323
323
|
}, [
|
|
324
|
-
|
|
324
|
+
H("div", {
|
|
325
325
|
onClick: r[0] || (r[0] = $e(() => {
|
|
326
326
|
}, ["stop"])),
|
|
327
327
|
class: Fe(["dialog m-auto flex flex-col", t.dialogClass])
|
|
@@ -380,7 +380,7 @@ const vt = ["xlink:href", "fill", "color"], Ht = /* @__PURE__ */ F({
|
|
|
380
380
|
"aria-hidden": "",
|
|
381
381
|
style: K(_(o))
|
|
382
382
|
}, [
|
|
383
|
-
|
|
383
|
+
H("use", {
|
|
384
384
|
"xlink:href": _(n),
|
|
385
385
|
fill: t.color,
|
|
386
386
|
color: t.color
|
|
@@ -402,9 +402,9 @@ function ft(t) {
|
|
|
402
402
|
scrollTop: 0,
|
|
403
403
|
scrollHeight: 0,
|
|
404
404
|
clientHeight: 0
|
|
405
|
-
}),
|
|
405
|
+
}), E = g({
|
|
406
406
|
clientHeight: 0
|
|
407
|
-
}), b = f(() => !!h.value), N = f(() => u.value.scrollHeight > u.value.clientHeight), C = f(() => u.value.clientHeight -
|
|
407
|
+
}), b = f(() => !!h.value), N = f(() => u.value.scrollHeight > u.value.clientHeight), C = f(() => u.value.clientHeight - E.value.clientHeight), L = f(() => u.value.scrollHeight - u.value.clientHeight), D = f(() => Math.max(
|
|
408
408
|
u.value.clientHeight / u.value.scrollHeight,
|
|
409
409
|
0.05
|
|
410
410
|
)), Q = f(() => D.value > r ? 0 : D.value * u.value.clientHeight), k = f(() => ({
|
|
@@ -455,7 +455,7 @@ function ft(t) {
|
|
|
455
455
|
}
|
|
456
456
|
function c() {
|
|
457
457
|
P(), setTimeout(() => {
|
|
458
|
-
|
|
458
|
+
E.value.clientHeight = n.value?.clientHeight ?? 0, V();
|
|
459
459
|
}, 150);
|
|
460
460
|
}
|
|
461
461
|
function S() {
|
|
@@ -491,7 +491,7 @@ function ft(t) {
|
|
|
491
491
|
modifySliderEventListener: z
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
|
-
const pt = (t) => (Me("data-v-edec7292"), t = t(), We(), t), ht = /* @__PURE__ */ pt(() => /* @__PURE__ */
|
|
494
|
+
const pt = (t) => (Me("data-v-edec7292"), t = t(), We(), t), ht = /* @__PURE__ */ pt(() => /* @__PURE__ */ H("div", { class: "default-slider" }, null, -1)), mt = /* @__PURE__ */ F({
|
|
495
495
|
__name: "ScrollBar",
|
|
496
496
|
props: {
|
|
497
497
|
containerEl: null,
|
|
@@ -519,9 +519,9 @@ const pt = (t) => (Me("data-v-edec7292"), t = t(), We(), t), ht = /* @__PURE__ *
|
|
|
519
519
|
function u() {
|
|
520
520
|
v.value = !1;
|
|
521
521
|
}
|
|
522
|
-
return e({ uScrollBarReturn: l }), (
|
|
522
|
+
return e({ uScrollBarReturn: l }), (E, b) => (I(), fe(pe, null, {
|
|
523
523
|
default: he(() => [
|
|
524
|
-
De(
|
|
524
|
+
De(H("div", {
|
|
525
525
|
ref_key: "sliderRef",
|
|
526
526
|
ref: s,
|
|
527
527
|
class: "slider-wrapper",
|
|
@@ -529,7 +529,7 @@ const pt = (t) => (Me("data-v-edec7292"), t = t(), We(), t), ht = /* @__PURE__ *
|
|
|
529
529
|
onMouseleave: u,
|
|
530
530
|
style: K(_(p))
|
|
531
531
|
}, [
|
|
532
|
-
oe(
|
|
532
|
+
oe(E.$slots, "default", {}, () => [
|
|
533
533
|
ht
|
|
534
534
|
], !0)
|
|
535
535
|
], 36), [
|
|
@@ -567,13 +567,13 @@ const He = (t, e) => {
|
|
|
567
567
|
return e({
|
|
568
568
|
vListReturn: s
|
|
569
569
|
}), (v, h) => (I(), B("div", gt, [
|
|
570
|
-
|
|
570
|
+
H("div", je({
|
|
571
571
|
onScrollPassive: h[0] || (h[0] = (...i) => _(l).onScroll && _(l).onScroll(...i)),
|
|
572
572
|
ref: _(l).ref,
|
|
573
573
|
class: "virtualList"
|
|
574
574
|
}, v.$attrs), [
|
|
575
|
-
|
|
576
|
-
|
|
575
|
+
H("div", le(se(_(d))), [
|
|
576
|
+
H("div", le(se(_(m))), [
|
|
577
577
|
(I(!0), B(ze, null, Ke(_(r), ({ index: i, data: u }) => (I(), B("div", {
|
|
578
578
|
key: i,
|
|
579
579
|
style: K({
|
|
@@ -615,19 +615,17 @@ const Ct = /* @__PURE__ */ He(_t, [["__scopeId", "data-v-4ba97cce"]]), yt = { cl
|
|
|
615
615
|
}));
|
|
616
616
|
return ne(() => {
|
|
617
617
|
o.value = n.value.offsetWidth / 2, s.value = n.value.offsetHeight / 2;
|
|
618
|
-
}), (d, m) => (I(), B("div",
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
], 4)
|
|
630
|
-
]));
|
|
618
|
+
}), (d, m) => (I(), B("div", {
|
|
619
|
+
id: "toastWrapper",
|
|
620
|
+
ref_key: "toastWrapper",
|
|
621
|
+
ref: n,
|
|
622
|
+
class: "absolute rounded-[8px] bg-black px-[14px] py-[12px] opacity-[0.79]",
|
|
623
|
+
style: K([_(l), { zIndex: 9999 }])
|
|
624
|
+
}, [
|
|
625
|
+
H("div", yt, [
|
|
626
|
+
H("span", wt, Ne(t.message), 1)
|
|
627
|
+
])
|
|
628
|
+
], 4));
|
|
631
629
|
}
|
|
632
630
|
}), de = {
|
|
633
631
|
message: "\u61D2\u732B\u4E91 Yes!!!",
|
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 Z;const T=typeof window<"u";T&&((Z=window?.navigator)==null?void 0:Z.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function $(n){return typeof n=="function"?n():e.unref(n)}function ue(n,t){function o(...l){n(()=>t.apply(this,l),{fn:t,thisArg:this,args:l})}return o}function de(n,t={}){let o,l;return s=>{const r=$(n),f=$(t.maxWait);if(o&&clearTimeout(o),r<=0||f!==void 0&&f<=0)return l&&(clearTimeout(l),l=null),s();f&&!l&&(l=setTimeout(()=>{o&&clearTimeout(o),l=null,s()},f)),o=setTimeout(()=>{l&&clearTimeout(l),l=null,s()},r)}}function fe(n){return n}function pe(n){return e.getCurrentScope()?(e.onScopeDispose(n),!0):!1}function ee(n,t=200,o={}){return ue(de(t,o),n)}function he(n,t=!0){e.getCurrentInstance()?e.onMounted(n):t?n():e.nextTick(n)}function te(n){var t;const o=$(n);return(t=o?.$el)!=null?t:o}const me=T?window:void 0;T&&window.document,T&&window.navigator,T&&window.location;function ge(n,t=!1){const o=e.ref(),l=()=>o.value=Boolean(n());return l(),he(l,t),o}const F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},L="__vueuse_ssr_handlers__";F[L]=F[L]||{},F[L];var ne=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,be=(n,t)=>{var o={};for(var l in n)ye.call(n,l)&&t.indexOf(l)<0&&(o[l]=n[l]);if(n!=null&&ne)for(var l of ne(n))t.indexOf(l)<0&&ve.call(n,l)&&(o[l]=n[l]);return o};function _e(n,t,o={}){const l=o,{window:i=me}=l,s=be(l,["window"]);let r;const f=ge(()=>i&&"ResizeObserver"in i),y=()=>{r&&(r.disconnect(),r=void 0)},m=e.watch(()=>te(n),g=>{y(),f.value&&i&&g&&(r=new ResizeObserver(t),r.observe(g,s))},{immediate:!0,flush:"post"}),p=()=>{y(),m()};return pe(p),{isSupported:f,stop:p}}function Se(n,t={width:0,height:0},o={}){const{box:l="content-box"}=o,i=e.ref(t.width),s=e.ref(t.height);return _e(n,([r])=>{const f=l==="border-box"?r.borderBoxSize:l==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;f?(i.value=f.reduce((y,{inlineSize:m})=>y+m,0),s.value=f.reduce((y,{blockSize:m})=>y+m,0)):(i.value=r.contentRect.width,s.value=r.contentRect.height)},o),e.watch(()=>te(n),r=>{i.value=r?t.width:0,s.value=r?t.height:0}),{width:i,height:s}}var oe;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(oe||(oe={}));var we=Object.defineProperty,le=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,re=(n,t,o)=>t in n?we(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,Te=(n,t)=>{for(var o in t||(t={}))Ee.call(t,o)&&re(n,o,t[o]);if(le)for(var o of le(t))Oe.call(t,o)&&re(n,o,t[o]);return n};Te({linear:fe},{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 ie(n,t){const{scrollEndHook:o,itemHeight:l,overscan:i=5}=t,s=e.ref(null),r=Se(s),f=e.ref(!0),y=ee(q,100);let m;const p=e.shallowRef(n),g=e.ref(0),c=e.ref({start:0,end:10});let u=0;const E=e.ref([]),v=e.computed(()=>{let{sum:a,height:d}={sum:0,height:0};return p.value.map((S,b)=>(typeof l=="number"?d=l:d=l(b),a+=d,{height:d,sum:a}))}),U=e.computed(()=>R(c.value.start)),O=e.computed(()=>typeof l=="number"?v.value.length*l:v.value[v.value.length-1]?.sum||0),x=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)&&I()},{deep:!0}),e.watch(g,()=>{H(),y()});function H(){f.value=!1}function q(){f.value=!0,o?.()}function I(){cancelAnimationFrame(m),m=requestAnimationFrame(C)}function C(){if(s.value){g.value=s.value.scrollTop,u=B();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,b)=>({data:S,index:b+a}))}}function P(a){let d=0,S=v.value.length-1,b=-1;for(;d<=S;){const _=Math.floor((d+S)/2);v.value[_].sum>=a?(b=_,S=_-1):d=_+1}return Math.max(0,b)}function B(){let a=0,d=0,S=Y();for(let b=S;b<v.value.length&&(a++,d+=v.value[b].height,!(d>=r.height.value));b++);return a}function R(a){if(typeof l=="number")return a*l;let d=v.value[a];return d?d.sum-d.height:0}function k(a){return v.value[a]||{sum:0,height:0}}function Y(){let a=c.value.start;return a>=i&&(a+=i),a}function G(a){if(s.value){const d=k(a);s.value.scrollTop=d.sum-d.height,C()}}const J=e.computed(()=>({style:{width:"100%",height:`${O.value}px`,pointerEvents:f.value?void 0:"none"}})),A=e.computed(()=>({style:{transform:`translate3d(0, ${U.value}px, 0)`,"will-change":"transform"}})),X={overflowY:"auto"};return{list:E,visiableList:x,getItemHeightData:k,getoffsetTopIndex:P,totalHeight:O,clientHeight:r.height,scrollTo:G,scrollTop:g,isScrollEnd:f,containerProps:{ref:s,onScroll:()=>{I()},style:X},wrapperProps:J,innerProps:A}}const V=Symbol(),D=Symbol(),j=Symbol(),K=Symbol(),M=Symbol(),N=Symbol(),z=Symbol(),W=Symbol(),Q=Symbol();function Be(){const{voidFn:n,boolFn:t,boolRef:o,arrayRef:l}={voidFn:u=>{},boolFn:u=>!1,boolRef:e.computed(()=>!1),arrayRef:e.computed(()=>[])},i=e.inject(K,l),s=e.inject(j,t),r=e.inject(W,o),f=e.inject(D,n),y=e.inject(V,n),m=e.inject(M,n),p=e.inject(N,n),g=e.inject(z,n),c=e.inject(Q,n);return{selected:i,isSelected:s,isAllSelected:r,toggle:f,toggleAll:y,select:m,selectAll:p,unselect:g,unselectAll:c}}function xe(n,t){const o=e.ref({}),l=e.computed(()=>n.value.filter(c=>o.value[c[t]])),i=e.computed(()=>l.value.length!=0&&Object.keys(o.value).length==n.value.length);function s(){n.value.forEach(c=>{o.value[c[t]]=!0})}function r(){o.value={}}function f(c){c.forEach(u=>{o.value[u[t]]||(o.value[u[t]]=!0)})}function y(c){c.forEach(u=>{o.value[u[t]]&&delete o.value[u[t]]})}function m(c){return!!o.value[c[t]]}function p(c){c.forEach(u=>{m(u)?delete o.value[u[t]]:o.value[u[t]]=!0})}function g(){i.value?r():s()}return e.provide(V,g),e.provide(D,p),e.provide(j,m),e.provide(K,l),e.provide(M,f),e.provide(N,s),e.provide(z,y),e.provide(W,i),e.provide(Q,r),{selected:l,select:f,selectAll:s,unselect:y,unselectAll:r,toggle:p,toggleAll:g,isSelected:m,isAllSelected:i}}const se=Symbol(),He=e.defineComponent({__name:"Dialog",props:{visiable:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},dialogClass:{default:""}},emits:["update:visiable"],setup(n,{emit:t}){const o=n,l=()=>{o.closeOnClickOverlay&&t("update:visiable",!1)};return e.provide(se,()=>t("update:visiable",!1)),(i,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[n.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:l,class:"modal absolute inset-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",n.dialogClass])},[e.renderSlot(i.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function Ie(n){function t(o,l){const i=document.createElement("div"),s={setup(){return()=>e.h(He,{visiable:!0,"onUpdate:visiable":()=>{i?.remove()},...n},{default:()=>e.h(o,l)})}};return document.body.appendChild(i),e.render(e.h(s),i),{close:()=>i?.remove()}}return{create:t}}const Ce=["xlink:href","fill","color"],Pe=e.defineComponent({__name:"SvgIcon",props:{name:null,prefix:{default:"icon"},color:{default:"#FFF"},width:null,height:null},setup(n){const t=n,o=e.computed(()=>`#${t.prefix}-${t.name}`),l=e.computed(()=>({width:`${t.width??t.height}px`,height:`${t.height??t.width}px`,aspectRatio:t.width&&t.height?void 0:"1/1"}));return(i,s)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(l))},[e.createElementVNode("use",{"xlink:href":e.unref(o),fill:n.color,color:n.color},null,8,Ce)],4))}});function Re(n){const{containerEl:t,sliderEl:o,autoHeight:l,performance:i={},maxHeightRatio:s=.9}=n,r=e.ref(!0),f=ee(R,100);let y,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}),v=e.computed(()=>!!g.value),U=e.computed(()=>u.value.scrollHeight>u.value.clientHeight),O=e.computed(()=>u.value.clientHeight-E.value.clientHeight),x=e.computed(()=>u.value.scrollHeight-u.value.clientHeight),H=e.computed(()=>Math.max(u.value.clientHeight/u.value.scrollHeight,.05)),q=e.computed(()=>H.value>s?0:H.value*u.value.clientHeight),I=e.computed(()=>({willChange:"transform",transform:`translate3d(0,${c.value}px,0)`,height:l?`${q.value}px`:void 0}));function C(_){B(),g.value=_.clientY-o.value.getBoundingClientRect().top||1,m=getComputedStyle(t.value).scrollBehavior,m==="smooth"&&(t.value.style.scrollBehavior="unset")}function P(){t.value.style.scrollBehavior=m,g.value=0,f()}function B(){r.value=!1}function R(){v.value||(r.value=!0)}function k(_){if(!v.value)return;let w=_.clientY-u.value.top-g.value;w<0?c.value=0:w>=O.value?c.value=O.value:c.value=w,t.value.scrollTo({top:c.value/O.value*x.value})}function Y(){v.value||G()}function G(){cancelAnimationFrame(y),y=requestAnimationFrame(J)}function J(){t.value&&(p.value=i.scrollTop?.value??t.value.scrollTop,c.value=p.value/x.value*O.value)}function A(_){let w="addEventListener";_==="add"?w="addEventListener":w="removeEventListener",o.value?.[w]("pointerdown",C,{passive:!0}),window[w]("pointermove",k,{passive:!0}),window[w]("pointerup",P,{passive:!0})}const X=new MutationObserver(_=>{_.map(ze=>ze.oldValue).join().includes("height")&&a()});function a(){u.value.top=t.value?.getBoundingClientRect().top??0,u.value.scrollHeight=t.value?.scrollHeight??0,u.value.clientHeight=t.value?.clientHeight??0}function d(){B(),setTimeout(()=>{E.value.clientHeight=o.value?.clientHeight??0,R()},150)}function S(){document.styleSheets[0].insertRule(".hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }",0),document.styleSheets[0].insertRule(".hide-scrollbar::-webkit-scrollbar{ display: none }",0),t.value?.classList.add("hide-scrollbar")}function b(){t.value&&o.value?(S(),t.value.addEventListener("scroll",Y,{passive:!0}),A("add"),X.observe(t.value,{subtree:!0,attributeOldValue:!0,attributeFilter:["style"]}),setTimeout(()=>{a()},100),d()):console.error("useScrollBar:","\u521D\u59CB\u5316\u5931\u8D25!",{containerEl:t,sliderEl:o})}return e.watch(p,()=>{B(),f()}),{isScrollEnd:r,isDragSlider:v,offsetTop:c,scrollTop:p,scrollable:U,sliderPos:I,init:b,modifySliderEventListener:A}}const ke=(n=>(e.pushScopeId("data-v-edec7292"),n=n(),e.popScopeId(),n))(()=>e.createElementVNode("div",{class:"default-slider"},null,-1)),Ae=e.defineComponent({__name:"ScrollBar",props:{containerEl:null,autoHide:{type:Boolean},autoHeight:{type:Boolean},performance:null},setup(n,{expose:t}){const o=n,l=!!e.useSlots().default,i=e.ref(null),s=e.computed(()=>o.containerEl),r=Re({containerEl:s,sliderEl:i,autoHeight:l?o.autoHeight:!0,performance:o.performance}),{scrollable:f,isScrollEnd:y,sliderPos:m}=r,p=e.ref(!1),g=o.autoHide?e.computed(()=>p.value||!y.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 t({uScrollBarReturn:r}),(E,v)=>(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}))}}),Ue="",ae=(n,t)=>{const o=n.__vccOpts||n;for(const[l,i]of t)o[l]=i;return o},$e=ae(Ae,[["__scopeId","data-v-edec7292"]]),Fe={class:"virtualListWrapper"},Le={inheritAttrs:!1},Ve=e.defineComponent({...Le,__name:"VirtualList",props:{data:null,itemHeight:null,overscan:{default:10}},emits:["scrollEnd"],setup(n,{expose:t,emit:o}){const l=n,i=ie(e.toRef(l,"data"),{itemHeight:p=>l.itemHeight(l.data[p]),overscan:l.overscan,scrollEndHook:()=>{o("scrollEnd")}}),{list:s,containerProps:r,wrapperProps:f,innerProps:y,getItemHeightData:m}=i;return t({vListReturn:i}),(p,g)=>(e.openBlock(),e.createElementBlock("div",Fe,[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(y))),[(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)]))}}),qe="",De=ae(Ve,[["__scopeId","data-v-4ba97cce"]]),je={class:"flex w-full max-w-[700px] items-center justify-center"},Ke={class:"text-[14px] text-white"},Me=e.defineComponent({__name:"Toast",props:{message:null,position:null},setup(n){const t=n,o=e.ref(),l=e.ref(),i=e.ref(),s=e.computed(()=>{switch(t.position){case"top":return 10;case"middle":return 50;case"bottom":return 85}}),r=e.computed(()=>({top:`calc(${s.value}% - ${i.value}px)`,left:`calc(50% - ${l.value}px)`,backgroundColor:"black"}));return e.nextTick(()=>{l.value=o.value.offsetWidth/2,i.value=o.value.offsetHeight/2}),(f,y)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{id:"toastWrapper",ref_key:"toastWrapper",ref:o,class:"absolute rounded-[8px] bg-black px-[14px] py-[12px] opacity-[0.79]",style:e.normalizeStyle([e.unref(r),{zIndex:9999}])},[e.createElementVNode("div",je,[e.createElementVNode("span",Ke,e.toDisplayString(n.message),1)])],4)]))}}),ce={message:"\u61D2\u732B\u4E91 Yes!!!",position:"middle",duration:1500};class Ne{options;container;constructor(t){this.options=t,this.container=document.createElement("div")}present(){const t=e.h(e.h(Me),{...ce,...this.options});e.render(t,this.container),document.body.insertBefore(this.container,document.body.firstChild);const o=this.options.duration||ce.duration;setTimeout(()=>{this.dismiss()},o)}dismiss(){this.container&&(this.container.querySelector("#toastWrapper")?.classList.add("animate-toastAnimation"),setTimeout(()=>{this.container&&(e.render(null,this.container),document.body.removeChild(this.container))},500))}}h.ScrollBar=$e,h.SvgIcon=Pe,h.ToastCreator=Ne,h.VirtualList=De,h.allSelectedKey=K,h.closeDialogKey=se,h.dialogController=Ie,h.isAllSelectedKey=W,h.isSelectedKey=j,h.selectAllKey=N,h.selectKey=M,h.toggleAllKey=V,h.toggleKey=D,h.unselectAllKey=Q,h.unselectKey=z,h.useSelectable=xe,h.useSelectableInjectors=Be,h.useVirtualList=ie,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
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 Z;const T=typeof window<"u";T&&((Z=window?.navigator)==null?void 0:Z.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function $(n){return typeof n=="function"?n():e.unref(n)}function ue(n,t){function o(...l){n(()=>t.apply(this,l),{fn:t,thisArg:this,args:l})}return o}function de(n,t={}){let o,l;return s=>{const r=$(n),f=$(t.maxWait);if(o&&clearTimeout(o),r<=0||f!==void 0&&f<=0)return l&&(clearTimeout(l),l=null),s();f&&!l&&(l=setTimeout(()=>{o&&clearTimeout(o),l=null,s()},f)),o=setTimeout(()=>{l&&clearTimeout(l),l=null,s()},r)}}function fe(n){return n}function pe(n){return e.getCurrentScope()?(e.onScopeDispose(n),!0):!1}function ee(n,t=200,o={}){return ue(de(t,o),n)}function he(n,t=!0){e.getCurrentInstance()?e.onMounted(n):t?n():e.nextTick(n)}function te(n){var t;const o=$(n);return(t=o?.$el)!=null?t:o}const me=T?window:void 0;T&&window.document,T&&window.navigator,T&&window.location;function ge(n,t=!1){const o=e.ref(),l=()=>o.value=Boolean(n());return l(),he(l,t),o}const F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},L="__vueuse_ssr_handlers__";F[L]=F[L]||{},F[L];var ne=Object.getOwnPropertySymbols,ye=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,be=(n,t)=>{var o={};for(var l in n)ye.call(n,l)&&t.indexOf(l)<0&&(o[l]=n[l]);if(n!=null&&ne)for(var l of ne(n))t.indexOf(l)<0&&ve.call(n,l)&&(o[l]=n[l]);return o};function _e(n,t,o={}){const l=o,{window:i=me}=l,s=be(l,["window"]);let r;const f=ge(()=>i&&"ResizeObserver"in i),y=()=>{r&&(r.disconnect(),r=void 0)},m=e.watch(()=>te(n),g=>{y(),f.value&&i&&g&&(r=new ResizeObserver(t),r.observe(g,s))},{immediate:!0,flush:"post"}),p=()=>{y(),m()};return pe(p),{isSupported:f,stop:p}}function Se(n,t={width:0,height:0},o={}){const{box:l="content-box"}=o,i=e.ref(t.width),s=e.ref(t.height);return _e(n,([r])=>{const f=l==="border-box"?r.borderBoxSize:l==="content-box"?r.contentBoxSize:r.devicePixelContentBoxSize;f?(i.value=f.reduce((y,{inlineSize:m})=>y+m,0),s.value=f.reduce((y,{blockSize:m})=>y+m,0)):(i.value=r.contentRect.width,s.value=r.contentRect.height)},o),e.watch(()=>te(n),r=>{i.value=r?t.width:0,s.value=r?t.height:0}),{width:i,height:s}}var oe;(function(n){n.UP="UP",n.RIGHT="RIGHT",n.DOWN="DOWN",n.LEFT="LEFT",n.NONE="NONE"})(oe||(oe={}));var we=Object.defineProperty,le=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,re=(n,t,o)=>t in n?we(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o,Te=(n,t)=>{for(var o in t||(t={}))Ee.call(t,o)&&re(n,o,t[o]);if(le)for(var o of le(t))Oe.call(t,o)&&re(n,o,t[o]);return n};Te({linear:fe},{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 ie(n,t){const{scrollEndHook:o,itemHeight:l,overscan:i=5}=t,s=e.ref(null),r=Se(s),f=e.ref(!0),y=ee(q,100);let m;const p=e.shallowRef(n),g=e.ref(0),c=e.ref({start:0,end:10});let u=0;const E=e.ref([]),v=e.computed(()=>{let{sum:a,height:d}={sum:0,height:0};return p.value.map((S,b)=>(typeof l=="number"?d=l:d=l(b),a+=d,{height:d,sum:a}))}),U=e.computed(()=>R(c.value.start)),O=e.computed(()=>typeof l=="number"?v.value.length*l:v.value[v.value.length-1]?.sum||0),x=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)&&I()},{deep:!0}),e.watch(g,()=>{H(),y()});function H(){f.value=!1}function q(){f.value=!0,o?.()}function I(){cancelAnimationFrame(m),m=requestAnimationFrame(C)}function C(){if(s.value){g.value=s.value.scrollTop,u=B();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,b)=>({data:S,index:b+a}))}}function P(a){let d=0,S=v.value.length-1,b=-1;for(;d<=S;){const _=Math.floor((d+S)/2);v.value[_].sum>=a?(b=_,S=_-1):d=_+1}return Math.max(0,b)}function B(){let a=0,d=0,S=Y();for(let b=S;b<v.value.length&&(a++,d+=v.value[b].height,!(d>=r.height.value));b++);return a}function R(a){if(typeof l=="number")return a*l;let d=v.value[a];return d?d.sum-d.height:0}function k(a){return v.value[a]||{sum:0,height:0}}function Y(){let a=c.value.start;return a>=i&&(a+=i),a}function G(a){if(s.value){const d=k(a);s.value.scrollTop=d.sum-d.height,C()}}const J=e.computed(()=>({style:{width:"100%",height:`${O.value}px`,pointerEvents:f.value?void 0:"none"}})),A=e.computed(()=>({style:{transform:`translate3d(0, ${U.value}px, 0)`,"will-change":"transform"}})),X={overflowY:"auto"};return{list:E,visiableList:x,getItemHeightData:k,getoffsetTopIndex:P,totalHeight:O,clientHeight:r.height,scrollTo:G,scrollTop:g,isScrollEnd:f,containerProps:{ref:s,onScroll:()=>{I()},style:X},wrapperProps:J,innerProps:A}}const D=Symbol(),V=Symbol(),j=Symbol(),K=Symbol(),M=Symbol(),N=Symbol(),z=Symbol(),W=Symbol(),Q=Symbol();function Be(){const{voidFn:n,boolFn:t,boolRef:o,arrayRef:l}={voidFn:u=>{},boolFn:u=>!1,boolRef:e.computed(()=>!1),arrayRef:e.computed(()=>[])},i=e.inject(K,l),s=e.inject(j,t),r=e.inject(W,o),f=e.inject(V,n),y=e.inject(D,n),m=e.inject(M,n),p=e.inject(N,n),g=e.inject(z,n),c=e.inject(Q,n);return{selected:i,isSelected:s,isAllSelected:r,toggle:f,toggleAll:y,select:m,selectAll:p,unselect:g,unselectAll:c}}function xe(n,t){const o=e.ref({}),l=e.computed(()=>n.value.filter(c=>o.value[c[t]])),i=e.computed(()=>l.value.length!=0&&Object.keys(o.value).length==n.value.length);function s(){n.value.forEach(c=>{o.value[c[t]]=!0})}function r(){o.value={}}function f(c){c.forEach(u=>{o.value[u[t]]||(o.value[u[t]]=!0)})}function y(c){c.forEach(u=>{o.value[u[t]]&&delete o.value[u[t]]})}function m(c){return!!o.value[c[t]]}function p(c){c.forEach(u=>{m(u)?delete o.value[u[t]]:o.value[u[t]]=!0})}function g(){i.value?r():s()}return e.provide(D,g),e.provide(V,p),e.provide(j,m),e.provide(K,l),e.provide(M,f),e.provide(N,s),e.provide(z,y),e.provide(W,i),e.provide(Q,r),{selected:l,select:f,selectAll:s,unselect:y,unselectAll:r,toggle:p,toggleAll:g,isSelected:m,isAllSelected:i}}const se=Symbol(),He=e.defineComponent({__name:"Dialog",props:{visiable:{type:Boolean,default:!1},closeOnClickOverlay:{type:Boolean,default:!0},dialogClass:{default:""}},emits:["update:visiable"],setup(n,{emit:t}){const o=n,l=()=>{o.closeOnClickOverlay&&t("update:visiable",!1)};return e.provide(se,()=>t("update:visiable",!1)),(i,s)=>(e.openBlock(),e.createBlock(e.Transition,{name:"modal"},{default:e.withCtx(()=>[n.visiable?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:l,class:"modal absolute inset-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",n.dialogClass])},[e.renderSlot(i.$slots,"default")],2)])):e.createCommentVNode("",!0)]),_:3}))}});function Ie(n){function t(o,l){const i=document.createElement("div"),s={setup(){return()=>e.h(He,{visiable:!0,"onUpdate:visiable":()=>{i?.remove()},...n},{default:()=>e.h(o,l)})}};return document.body.appendChild(i),e.render(e.h(s),i),{close:()=>i?.remove()}}return{create:t}}const Ce=["xlink:href","fill","color"],Pe=e.defineComponent({__name:"SvgIcon",props:{name:null,prefix:{default:"icon"},color:{default:"#FFF"},width:null,height:null},setup(n){const t=n,o=e.computed(()=>`#${t.prefix}-${t.name}`),l=e.computed(()=>({width:`${t.width??t.height}px`,height:`${t.height??t.width}px`,aspectRatio:t.width&&t.height?void 0:"1/1"}));return(i,s)=>(e.openBlock(),e.createElementBlock("svg",{"aria-hidden":"",style:e.normalizeStyle(e.unref(l))},[e.createElementVNode("use",{"xlink:href":e.unref(o),fill:n.color,color:n.color},null,8,Ce)],4))}});function Re(n){const{containerEl:t,sliderEl:o,autoHeight:l,performance:i={},maxHeightRatio:s=.9}=n,r=e.ref(!0),f=ee(R,100);let y,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}),v=e.computed(()=>!!g.value),U=e.computed(()=>u.value.scrollHeight>u.value.clientHeight),O=e.computed(()=>u.value.clientHeight-E.value.clientHeight),x=e.computed(()=>u.value.scrollHeight-u.value.clientHeight),H=e.computed(()=>Math.max(u.value.clientHeight/u.value.scrollHeight,.05)),q=e.computed(()=>H.value>s?0:H.value*u.value.clientHeight),I=e.computed(()=>({willChange:"transform",transform:`translate3d(0,${c.value}px,0)`,height:l?`${q.value}px`:void 0}));function C(_){B(),g.value=_.clientY-o.value.getBoundingClientRect().top||1,m=getComputedStyle(t.value).scrollBehavior,m==="smooth"&&(t.value.style.scrollBehavior="unset")}function P(){t.value.style.scrollBehavior=m,g.value=0,f()}function B(){r.value=!1}function R(){v.value||(r.value=!0)}function k(_){if(!v.value)return;let w=_.clientY-u.value.top-g.value;w<0?c.value=0:w>=O.value?c.value=O.value:c.value=w,t.value.scrollTo({top:c.value/O.value*x.value})}function Y(){v.value||G()}function G(){cancelAnimationFrame(y),y=requestAnimationFrame(J)}function J(){t.value&&(p.value=i.scrollTop?.value??t.value.scrollTop,c.value=p.value/x.value*O.value)}function A(_){let w="addEventListener";_==="add"?w="addEventListener":w="removeEventListener",o.value?.[w]("pointerdown",C,{passive:!0}),window[w]("pointermove",k,{passive:!0}),window[w]("pointerup",P,{passive:!0})}const X=new MutationObserver(_=>{_.map(ze=>ze.oldValue).join().includes("height")&&a()});function a(){u.value.top=t.value?.getBoundingClientRect().top??0,u.value.scrollHeight=t.value?.scrollHeight??0,u.value.clientHeight=t.value?.clientHeight??0}function d(){B(),setTimeout(()=>{E.value.clientHeight=o.value?.clientHeight??0,R()},150)}function S(){document.styleSheets[0].insertRule(".hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }",0),document.styleSheets[0].insertRule(".hide-scrollbar::-webkit-scrollbar{ display: none }",0),t.value?.classList.add("hide-scrollbar")}function b(){t.value&&o.value?(S(),t.value.addEventListener("scroll",Y,{passive:!0}),A("add"),X.observe(t.value,{subtree:!0,attributeOldValue:!0,attributeFilter:["style"]}),setTimeout(()=>{a()},100),d()):console.error("useScrollBar:","\u521D\u59CB\u5316\u5931\u8D25!",{containerEl:t,sliderEl:o})}return e.watch(p,()=>{B(),f()}),{isScrollEnd:r,isDragSlider:v,offsetTop:c,scrollTop:p,scrollable:U,sliderPos:I,init:b,modifySliderEventListener:A}}const ke=(n=>(e.pushScopeId("data-v-edec7292"),n=n(),e.popScopeId(),n))(()=>e.createElementVNode("div",{class:"default-slider"},null,-1)),Ae=e.defineComponent({__name:"ScrollBar",props:{containerEl:null,autoHide:{type:Boolean},autoHeight:{type:Boolean},performance:null},setup(n,{expose:t}){const o=n,l=!!e.useSlots().default,i=e.ref(null),s=e.computed(()=>o.containerEl),r=Re({containerEl:s,sliderEl:i,autoHeight:l?o.autoHeight:!0,performance:o.performance}),{scrollable:f,isScrollEnd:y,sliderPos:m}=r,p=e.ref(!1),g=o.autoHide?e.computed(()=>p.value||!y.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 t({uScrollBarReturn:r}),(E,v)=>(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}))}}),Ue="",ae=(n,t)=>{const o=n.__vccOpts||n;for(const[l,i]of t)o[l]=i;return o},$e=ae(Ae,[["__scopeId","data-v-edec7292"]]),Fe={class:"virtualListWrapper"},Le={inheritAttrs:!1},De=e.defineComponent({...Le,__name:"VirtualList",props:{data:null,itemHeight:null,overscan:{default:10}},emits:["scrollEnd"],setup(n,{expose:t,emit:o}){const l=n,i=ie(e.toRef(l,"data"),{itemHeight:p=>l.itemHeight(l.data[p]),overscan:l.overscan,scrollEndHook:()=>{o("scrollEnd")}}),{list:s,containerProps:r,wrapperProps:f,innerProps:y,getItemHeightData:m}=i;return t({vListReturn:i}),(p,g)=>(e.openBlock(),e.createElementBlock("div",Fe,[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(y))),[(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)]))}}),qe="",Ve=ae(De,[["__scopeId","data-v-4ba97cce"]]),je={class:"flex w-full max-w-[700px] items-center justify-center"},Ke={class:"text-[14px] text-white"},Me=e.defineComponent({__name:"Toast",props:{message:null,position:null},setup(n){const t=n,o=e.ref(),l=e.ref(),i=e.ref(),s=e.computed(()=>{switch(t.position){case"top":return 10;case"middle":return 50;case"bottom":return 85}}),r=e.computed(()=>({top:`calc(${s.value}% - ${i.value}px)`,left:`calc(50% - ${l.value}px)`,backgroundColor:"black"}));return e.nextTick(()=>{l.value=o.value.offsetWidth/2,i.value=o.value.offsetHeight/2}),(f,y)=>(e.openBlock(),e.createElementBlock("div",{id:"toastWrapper",ref_key:"toastWrapper",ref:o,class:"absolute rounded-[8px] bg-black px-[14px] py-[12px] opacity-[0.79]",style:e.normalizeStyle([e.unref(r),{zIndex:9999}])},[e.createElementVNode("div",je,[e.createElementVNode("span",Ke,e.toDisplayString(n.message),1)])],4))}}),ce={message:"\u61D2\u732B\u4E91 Yes!!!",position:"middle",duration:1500};class Ne{options;container;constructor(t){this.options=t,this.container=document.createElement("div")}present(){const t=e.h(e.h(Me),{...ce,...this.options});e.render(t,this.container),document.body.insertBefore(this.container,document.body.firstChild);const o=this.options.duration||ce.duration;setTimeout(()=>{this.dismiss()},o)}dismiss(){this.container&&(this.container.querySelector("#toastWrapper")?.classList.add("animate-toastAnimation"),setTimeout(()=>{this.container&&(e.render(null,this.container),document.body.removeChild(this.container))},500))}}h.ScrollBar=$e,h.SvgIcon=Pe,h.ToastCreator=Ne,h.VirtualList=Ve,h.allSelectedKey=K,h.closeDialogKey=se,h.dialogController=Ie,h.isAllSelectedKey=W,h.isSelectedKey=j,h.selectAllKey=N,h.selectKey=M,h.toggleAllKey=D,h.toggleKey=V,h.unselectAllKey=Q,h.unselectKey=z,h.useSelectable=xe,h.useSelectableInjectors=Be,h.useVirtualList=ie,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|