ss-component-new 1.3.494 → 1.3.496
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/ss-component.cjs +2 -2
- package/dist/ss-component.js +94 -100
- package/package.json +1 -1
package/dist/ss-component.cjs
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
.vue3-seamless-horizontal-wrapper[data-v-530d6df5] {
|
|
7
7
|
height: 100%;
|
|
8
8
|
}
|
|
9
|
-
`;xe(Ae);Ee.render=Le;Ee.__scopeId="data-v-530d6df5";Ee.__file="packages/HorizontalScroll.vue";var
|
|
9
|
+
`;xe(Ae);Ee.render=Le;Ee.__scopeId="data-v-530d6df5";Ee.__file="packages/HorizontalScroll.vue";var ne=t.defineComponent({name:"Vue3SeamlessScroll",emits:["offset","count"],inheritAttrs:!1,props:{modelValue:{type:Boolean,default:!0},list:{type:Array,required:!0},hover:{type:Boolean,default:!1},singleWaitTime:{type:Number,default:1e3},wheel:{type:Boolean,default:!1},singleLine:{type:Boolean,default:!1},step:{type:Number,default:.5},visibleCount:{type:Number},ease:{type:String,default:"cubic-bezier(0.03, 0.76, 1, 0.16)"},direction:{type:String,default:"up"},delay:{type:Number,default:0}},setup(e,{expose:E,emit:S}){const f=t.ref(null),h=t.ref(null),v=t.ref(null),o=t.ref([]),H=t.ref(0),B=t.ref(!1),y=t.ref(e.direction),C=t.computed(()=>e.hover?!B.value&&e.modelValue:e.modelValue),r=t.ref([]),s=t.ref(e.visibleCount===void 0?0:e.visibleCount),c=ee(e.list);let I=0,q=0,w=0,U=[],x=0,u=0,g=-1,T=0,z=null,F=!1,A=0,V=0,_=!1;const J=t.computed(()=>y.value==="up"||y.value==="down"?`translateY(-${H.value}px)`:`translateX(-${H.value}px)`),M=()=>{cancelAnimationFrame(z),z=null},L=()=>{const n=g+u;if(n>=c.length){const i=n-c.length,p=["splice",[0,u],[g],[0,i]];o.value=p,i>c.length?g=c.length:g=i}else{const i=["splice",[0,u],[g,n]];o.value=i,g=n}},R=()=>{const n=Array.from(h.value.children);U=(y.value==="up"||y.value==="left"?n.slice(0,u):n.slice($.value.length-u,$.value.length)).map(p=>y.value==="left"||y.value==="right"?p.offsetWidth:p.offsetHeight),x=U.reduce((p,m)=>p+m,0)},j=()=>{y.value==="up"||y.value==="left"?H.value=0:H.value=X()-T},D=(n,i)=>{if(M(),!_)return;const p=()=>{const m=U[0];let k=!1;A>=m&&(k=!0),k&&(U.shift(),A=0,q+=1),q===I&&(w+=1,S("count",w),q=0),e.singleLine&&k?(F=!0,setTimeout(()=>{F=!1,n||D(!1,e.step)},e.singleWaitTime)):n||D(!1,e.step)};(C.value&&!F||n)&&(z=requestAnimationFrame(()=>{V+=i,A+=i,y.value==="up"||y.value==="left"?H.value+=i:H.value-=i,V>x?(S("offset",u,c),L(),t.nextTick(()=>{j(),V=0,R(),p()})):p()}))},Y=()=>{B.value=!0},b=()=>{B.value=!1,e.hover&&D(!1,e.step)},O=ge(30,n=>{D(!0,10)}),P=n=>{e.hover&&e.wheel&&(O(n),n.preventDefault(),n.stopPropagation())},$=t.computed(()=>{let n=[];return o.value.length===0?n=c.slice(0,s.value):o.value[0]==="splice"?(n=y.value==="up"||y.value==="left"?$.value:$.value.reverse(),n.splice(...o.value[1]),o.value.slice(2).forEach(i=>{n.push(...c.slice(...i))})):o.value.slice(1).forEach(i=>{n.push(...c.slice(...i))}),y.value==="up"||y.value==="left"||n.reverse(),pe(n)}),W=()=>{if(g=s.value+u,g>=c.length){const n=g-c.length,i=["slice",[0,g],[0,n]];return n>c.length?g=c.length:g=n,i}else return["slice",[0,g]]},X=()=>Array.from(h.value.children).map(i=>y.value==="left"||y.value==="right"?i.offsetWidth:i.offsetHeight).reduce((i,p)=>i+p,0),le=n=>{e.visibleCount===void 0?(r.value=ee([e.list[0]]),t.nextTick(()=>{y.value==="left"||y.value==="right"?s.value=Math.ceil(T/v.value.offsetWidth)+2:s.value=Math.ceil(T/v.value.offsetHeight)+2,r.value=c.slice(0,s.value),t.nextTick(()=>{n()})})):(r.value=c.slice(0,s.value),t.nextTick(()=>{n()}))};t.onMounted(()=>{h.value&&(h.value.parentElement.addEventListener("mouseenter",Y),h.value.parentElement.addEventListener("mouseleave",b),h.value.parentElement.addEventListener("wheel",P),T=h.value.parentElement.offsetHeight,(y.value==="left"||y.value==="right")&&(T=h.value.parentElement.offsetWidth),le(()=>{let n=v.value.offsetHeight>T;(y.value==="left"||y.value==="right")&&(n=v.value.offsetWidth>T),n?(u=te(),o.value=W(),t.nextTick(()=>{j(),R(),_=!0,setTimeout(()=>{D(!1,e.step)},e.delay)})):K(),r.value=[]})),I=c.length});const K=()=>{q=0,w=0,_=!1,u=0,o.value=[],t.nextTick(()=>{j(),V=0,A=0})},te=()=>{let n=c.length-s.value;return n=Math.max(1,n),n=Math.min(5,n),n};return E({add:(n,i,p)=>{if(i&&i.length>0){n>c.length&&(n=c.length),n<0&&(n=0);const m=[];i.length===1&&$.value.forEach((N,Z)=>{N.index===n&&m.push(Z)});const k=[];i.forEach(N=>{k.push({id:G(),data:N})}),c.splice(n,0,...k),c.forEach((N,Z)=>{N.index=Z});const Q=te();if(_)n<g&&(g+=1,g>c.length&&(g=0)),i.length===1&&m.length>0&&m.forEach(N=>{$[N]=k[0]}),Q!==u&&(u=Q);else{const N=()=>{let Z=v.value.offsetHeight>T;(y.value==="left"||y.value==="right")&&(Z=v.value.offsetWidth>T),Z?(u=Q,o.value=W(),t.nextTick(()=>{j(),V=0,A=0,R(),_=!0,D(!1,e.step)})):(e.visibleCount===void 0&&(s.value=0),K()),r.value=[]};s.value===0&&e.visibleCount===void 0?le(()=>{N()}):(r.value=c.slice(0,s.value),t.nextTick(()=>{N()}))}}p&&typeof p=="function"&&p(c),I=c.length},remove:(n,i=1,p)=>{n>=0&&n<c.length&&(c.splice(n,i),_?(r.value=c.slice(0,s.value),t.nextTick(()=>{let m=v.value.offsetHeight>T;if((y.value==="left"||y.value==="right")&&(m=v.value.offsetWidth>T),m){const k=te();k!==u&&(u=k),o.value=W()}else K();r.value=[]})):K()),p&&typeof p=="function"&&p(c),I=c.length},update:(n,i,p)=>{if(n>=0&&n<c.length){const m=[];$.value.forEach((Q,N)=>{Q.index===n&&m.push(N)});const k={id:G(),index:n,data:i};c[n]=k,m.length>0&&m.forEach(Q=>{$[Q]=k})}p&&typeof p=="function"&&p(c)},reset:()=>{t.nextTick(()=>{r.value=c.slice(0,s.value),t.nextTick(()=>{let n=v.value.offsetHeight>T;(y.value==="left"||y.value==="right")&&(n=v.value.offsetWidth>T),n?o.value[0]==="splice"?(L(),t.nextTick(()=>{R()})):(o.value=W(),t.nextTick(()=>{R()})):K()})})}}),t.watch(()=>e.modelValue,n=>{n&&D(!1,e.step)}),t.onUnmounted(()=>{cancelAnimationFrame(z),h.value&&(h.value.parentElement.removeEventListener("mouseenter",Y),h.value.parentElement.removeEventListener("mouseleave",b),h.value.parentElement.removeEventListener("wheel",P))}),{realBoxRef:f,realWrapperRef:h,visibleItems:$,offset:H,testList:r,realWrapperHiddenRef:v,transform:J}}});function We(e,E,S,f,h,v){return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",t.mergeProps({class:"vue3-seamless-wrapper",ref:"realWrapperRef",style:{transition:`transform ${e.ease}`,transform:e.transform}},e.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visibleItems,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index})),128))],16),t.createElementVNode("div",t.mergeProps({style:{position:"absolute !important",left:"-999999px !important"},ref:"realWrapperHiddenRef"},e.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.testList,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index})),128))],16)],64)}var He=`
|
|
10
10
|
.vue3-seamless-wrapper[data-v-b156a416] {\r
|
|
11
11
|
width: 100%;\r
|
|
12
12
|
height: 100%;
|
|
13
13
|
}\r
|
|
14
|
-
`;xe(He);
|
|
14
|
+
`;xe(He);ne.render=We;ne.__scopeId="data-v-b156a416";ne.__file="packages/Vue3SeamlessScroll.vue";const me=Te.useMenuState(),Fe=[se,re,oe,ue,fe,ce,ve,de,he],$e=e=>{Fe.forEach(E=>{e.use(E)}),e.use(ie),e.component("vue3-seamless-scroll",ne),e.config.globalProperties.$router=ie},Ie=e=>{switch(e){case"browser":return ae.browserThemeConfig;case"client":return ae.clientThemeConfig;case"three":return ae.threeThemeConfig}},we=e=>{const E=document.documentElement;e==null||e.forEach(S=>{E.style.setProperty(S.name,S.value)})},Me=e=>{me.setPlatform(e);const E=Ie(e);we(E)},qe={getPlatform:me.getPlatform,setPlatform:me.setPlatform,initPlatform:Me};exports.SvgIcon=Ce.SvgIcon;exports.router=ie;exports.default=$e;exports.platformApi=qe;
|
package/dist/ss-component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineAsyncComponent as Q, defineComponent as We, ref as b, computed as ae, onMounted as Ve, watch as He, onUnmounted as Le, nextTick as g, createElementBlock as G, openBlock as J, Fragment as K, createElementVNode as ie, normalizeStyle as ze, renderList as ue, renderSlot as
|
|
1
|
+
import { defineAsyncComponent as Q, defineComponent as We, ref as b, computed as ae, onMounted as Ve, watch as He, onUnmounted as Le, nextTick as g, createElementBlock as G, openBlock as J, Fragment as K, createElementVNode as ie, normalizeStyle as ze, renderList as ue, renderSlot as re, mergeProps as ve } from "vue";
|
|
2
2
|
import "./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-DFyt9sBY.js";
|
|
3
|
-
import { S as
|
|
3
|
+
import { S as ft } from "./index-BHtNKL1L.js";
|
|
4
4
|
import { u as Me } from "./index-CwJwXVns.js";
|
|
5
5
|
import "./index-CI4RP047.js";
|
|
6
6
|
import "./request-XJsZ4h2T.js";
|
|
@@ -45,9 +45,9 @@ be.install = (e) => {
|
|
|
45
45
|
};
|
|
46
46
|
function Ie(e, S) {
|
|
47
47
|
let C = 0;
|
|
48
|
-
return function(...
|
|
48
|
+
return function(...o) {
|
|
49
49
|
const d = Date.now();
|
|
50
|
-
d - C >= e && (C = d, S.apply(this,
|
|
50
|
+
d - C >= e && (C = d, S.apply(this, o));
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
function Pe() {
|
|
@@ -59,13 +59,13 @@ function Pe() {
|
|
|
59
59
|
const ee = () => Pe().replaceAll("-", "");
|
|
60
60
|
function $e(e) {
|
|
61
61
|
const S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set();
|
|
62
|
-
return e.forEach((
|
|
63
|
-
S.has(
|
|
64
|
-
}), C.size > 0 && e.forEach((
|
|
65
|
-
|
|
62
|
+
return e.forEach((o) => {
|
|
63
|
+
S.has(o.id) ? C.add(o) : S.add(o.id);
|
|
64
|
+
}), C.size > 0 && e.forEach((o) => {
|
|
65
|
+
o.id = ee();
|
|
66
66
|
}), e;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function oe(e) {
|
|
69
69
|
return e.map((S, C) => ({
|
|
70
70
|
id: ee(),
|
|
71
71
|
index: C,
|
|
@@ -127,26 +127,26 @@ var we = We({
|
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
129
|
setup(e, { expose: S, emit: C }) {
|
|
130
|
-
const
|
|
131
|
-
let f = 0, z = 0, R = 0, M = [], X = 0, E = 0,
|
|
130
|
+
const o = b(null), d = b(null), c = b([]), u = b(0), F = b(!1), L = b(e.direction), y = ae(() => e.hover ? !F.value && e.modelValue : e.modelValue), x = b([]), i = oe(e.list), s = b(e.visibleCount === void 0 ? 0 : e.visibleCount);
|
|
131
|
+
let f = 0, z = 0, R = 0, M = [], X = 0, E = 0, r = -1, m = 0, W = null, k = !1, B = 0, w = 0, I = !1;
|
|
132
132
|
const Y = () => {
|
|
133
133
|
cancelAnimationFrame(W), W = null;
|
|
134
134
|
}, te = () => {
|
|
135
|
-
const t =
|
|
135
|
+
const t = r + E;
|
|
136
136
|
if (t >= i.length) {
|
|
137
137
|
const n = t - i.length, v = [
|
|
138
138
|
"splice",
|
|
139
139
|
[0, E],
|
|
140
|
-
[
|
|
140
|
+
[r],
|
|
141
141
|
[0, n]
|
|
142
142
|
];
|
|
143
|
-
c.value = v, n > i.length ?
|
|
143
|
+
c.value = v, n > i.length ? r = i.length : r = n;
|
|
144
144
|
} else {
|
|
145
|
-
const n = ["splice", [0, E], [
|
|
146
|
-
c.value = n,
|
|
145
|
+
const n = ["splice", [0, E], [r, t]];
|
|
146
|
+
c.value = n, r = t;
|
|
147
147
|
}
|
|
148
148
|
}, N = () => {
|
|
149
|
-
const t = Array.from(
|
|
149
|
+
const t = Array.from(o.value.children);
|
|
150
150
|
M = (L.value === "up" ? t.slice(0, E) : t.slice(H.value.length - E, H.value.length)).map((v) => v.offsetHeight), X = M.reduce((v, l) => v + l, 0);
|
|
151
151
|
}, $ = (t, n) => {
|
|
152
152
|
if (Y(), !I)
|
|
@@ -179,13 +179,13 @@ var we = We({
|
|
|
179
179
|
t.push(...i.slice(...n));
|
|
180
180
|
}), L.value !== "up" && t.reverse(), $e(t);
|
|
181
181
|
}), U = () => {
|
|
182
|
-
if (
|
|
183
|
-
const t =
|
|
184
|
-
return t > i.length ?
|
|
182
|
+
if (r = s.value + E, r >= i.length) {
|
|
183
|
+
const t = r - i.length, n = ["slice", [0, r], [0, t]];
|
|
184
|
+
return t > i.length ? r = i.length : r = t, n;
|
|
185
185
|
} else
|
|
186
|
-
return ["slice", [0,
|
|
187
|
-
}, P = () => Array.from(
|
|
188
|
-
e.visibleCount === void 0 ? (x.value =
|
|
186
|
+
return ["slice", [0, r]];
|
|
187
|
+
}, P = () => Array.from(o.value.children).map((t) => t.offsetHeight).reduce((t, n) => t + n, 0), T = (t) => {
|
|
188
|
+
e.visibleCount === void 0 ? (x.value = oe([e.list[0]]), g(() => {
|
|
189
189
|
s.value = Math.ceil(m / d.value.offsetHeight) + 2, x.value = i.slice(0, s.value), g(() => {
|
|
190
190
|
t();
|
|
191
191
|
});
|
|
@@ -194,7 +194,7 @@ var we = We({
|
|
|
194
194
|
}));
|
|
195
195
|
};
|
|
196
196
|
Ve(() => {
|
|
197
|
-
|
|
197
|
+
o.value && (o.value.parentElement.addEventListener("mouseenter", D), o.value.parentElement.addEventListener("mouseleave", j), o.value.parentElement.addEventListener("wheel", Z), m = o.value.parentElement.offsetHeight, e.list.length > 0 && T(() => {
|
|
198
198
|
d.value.offsetHeight > m ? (E = _(), c.value = U(), g(() => {
|
|
199
199
|
u.value = L.value === "up" ? 0 : P() - m, N(), I = !0, setTimeout(() => {
|
|
200
200
|
$(!1, e.step);
|
|
@@ -228,7 +228,7 @@ var we = We({
|
|
|
228
228
|
});
|
|
229
229
|
const p = _();
|
|
230
230
|
if (I)
|
|
231
|
-
t <
|
|
231
|
+
t < r && (r += 1, r > i.length && (r = 0)), n.length === 1 && l.length > 0 && l.forEach((h) => {
|
|
232
232
|
H.value[h] = a[0];
|
|
233
233
|
}), p !== E && (E = p);
|
|
234
234
|
else {
|
|
@@ -283,9 +283,9 @@ var we = We({
|
|
|
283
283
|
} }), He(() => e.modelValue, (t) => {
|
|
284
284
|
t && $(!1, e.step);
|
|
285
285
|
}), Le(() => {
|
|
286
|
-
cancelAnimationFrame(W),
|
|
286
|
+
cancelAnimationFrame(W), o.value && (o.value.parentElement.removeEventListener("mouseenter", D), o.value.parentElement.removeEventListener("mouseleave", j), o.value.parentElement.removeEventListener("wheel", Z));
|
|
287
287
|
}), {
|
|
288
|
-
realWrapperRef:
|
|
288
|
+
realWrapperRef: o,
|
|
289
289
|
visibleItems: H,
|
|
290
290
|
offset: u,
|
|
291
291
|
testList: x,
|
|
@@ -297,7 +297,7 @@ const qe = {
|
|
|
297
297
|
style: { position: "absolute !important", top: "-999999px !important" },
|
|
298
298
|
ref: "realWrapperHiddenRef"
|
|
299
299
|
};
|
|
300
|
-
function De(e, S, C,
|
|
300
|
+
function De(e, S, C, o, d, c) {
|
|
301
301
|
return J(), G(
|
|
302
302
|
K,
|
|
303
303
|
null,
|
|
@@ -313,7 +313,7 @@ function De(e, S, C, r, d, c) {
|
|
|
313
313
|
(J(!0), G(
|
|
314
314
|
K,
|
|
315
315
|
null,
|
|
316
|
-
ue(e.visibleItems, (u) =>
|
|
316
|
+
ue(e.visibleItems, (u) => re(e.$slots, "default", {
|
|
317
317
|
key: u.id,
|
|
318
318
|
data: u.data,
|
|
319
319
|
index: u.index
|
|
@@ -332,7 +332,7 @@ function De(e, S, C, r, d, c) {
|
|
|
332
332
|
(J(!0), G(
|
|
333
333
|
K,
|
|
334
334
|
null,
|
|
335
|
-
ue(e.testList, (u) =>
|
|
335
|
+
ue(e.testList, (u) => re(e.$slots, "default", {
|
|
336
336
|
key: u.id,
|
|
337
337
|
data: u.data,
|
|
338
338
|
index: u.index
|
|
@@ -353,8 +353,8 @@ function Ae(e, S) {
|
|
|
353
353
|
S === void 0 && (S = {});
|
|
354
354
|
var C = S.insertAt;
|
|
355
355
|
if (!(!e || typeof document > "u")) {
|
|
356
|
-
var
|
|
357
|
-
d.type = "text/css", C === "top" &&
|
|
356
|
+
var o = document.head || document.getElementsByTagName("head")[0], d = document.createElement("style");
|
|
357
|
+
d.type = "text/css", C === "top" && o.firstChild ? o.insertBefore(d, o.firstChild) : o.appendChild(d), d.styleSheet ? d.styleSheet.cssText = e : d.appendChild(document.createTextNode(e));
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
var Oe = `
|
|
@@ -421,26 +421,26 @@ var Fe = We({
|
|
|
421
421
|
}
|
|
422
422
|
},
|
|
423
423
|
setup(e, { emit: S, expose: C }) {
|
|
424
|
-
const
|
|
425
|
-
let f = 0, z = 0, R = 0, M = [], X = 0, E = 0,
|
|
424
|
+
const o = b(null), d = b(null), c = b([]), u = b(0), F = b(!1), L = b(e.direction), y = ae(() => e.hover ? !F.value && e.modelValue : e.modelValue), x = b([]), i = b(e.visibleCount === void 0 ? 0 : e.visibleCount), s = oe(e.list);
|
|
425
|
+
let f = 0, z = 0, R = 0, M = [], X = 0, E = 0, r = -1, m = 0, W = null, k = !1, B = 0, w = 0, I = !1;
|
|
426
426
|
const Y = () => {
|
|
427
427
|
cancelAnimationFrame(W), W = null;
|
|
428
428
|
}, te = () => {
|
|
429
|
-
const t =
|
|
429
|
+
const t = r + E;
|
|
430
430
|
if (t >= s.length) {
|
|
431
431
|
const n = t - s.length, v = [
|
|
432
432
|
"splice",
|
|
433
433
|
[0, E],
|
|
434
|
-
[
|
|
434
|
+
[r],
|
|
435
435
|
[0, n]
|
|
436
436
|
];
|
|
437
|
-
c.value = v, n > s.length ?
|
|
437
|
+
c.value = v, n > s.length ? r = s.length : r = n;
|
|
438
438
|
} else {
|
|
439
|
-
const n = ["splice", [0, E], [
|
|
440
|
-
c.value = n,
|
|
439
|
+
const n = ["splice", [0, E], [r, t]];
|
|
440
|
+
c.value = n, r = t;
|
|
441
441
|
}
|
|
442
442
|
}, N = () => {
|
|
443
|
-
const t = Array.from(
|
|
443
|
+
const t = Array.from(o.value.children);
|
|
444
444
|
M = (L.value === "left" ? t.slice(0, E) : t.slice(H.value.length - E, H.value.length)).map((v) => v.offsetWidth), X = M.reduce((v, l) => v + l, 0);
|
|
445
445
|
}, $ = (t, n) => {
|
|
446
446
|
if (Y(), !I)
|
|
@@ -473,13 +473,13 @@ var Fe = We({
|
|
|
473
473
|
t.push(...s.slice(...n));
|
|
474
474
|
}), L.value !== "left" && t.reverse(), $e(t);
|
|
475
475
|
}), U = () => {
|
|
476
|
-
if (
|
|
477
|
-
const t =
|
|
478
|
-
return t > s.length ?
|
|
476
|
+
if (r = i.value + E, r >= s.length) {
|
|
477
|
+
const t = r - s.length, n = ["slice", [0, r], [0, t]];
|
|
478
|
+
return t > s.length ? r = s.length : r = t, n;
|
|
479
479
|
} else
|
|
480
|
-
return ["slice", [0,
|
|
481
|
-
}, P = () => Array.from(
|
|
482
|
-
e.visibleCount === void 0 ? (x.value =
|
|
480
|
+
return ["slice", [0, r]];
|
|
481
|
+
}, P = () => Array.from(o.value.children).map((t) => t.offsetWidth).reduce((t, n) => t + n, 0), T = (t) => {
|
|
482
|
+
e.visibleCount === void 0 ? (x.value = oe([e.list[0]]), g(() => {
|
|
483
483
|
i.value = Math.ceil(m / d.value.offsetWidth) + 2, x.value = s.slice(0, i.value), g(() => {
|
|
484
484
|
t();
|
|
485
485
|
});
|
|
@@ -488,7 +488,7 @@ var Fe = We({
|
|
|
488
488
|
}));
|
|
489
489
|
};
|
|
490
490
|
Ve(() => {
|
|
491
|
-
|
|
491
|
+
o.value && (o.value.parentElement.addEventListener("mouseenter", D), o.value.parentElement.addEventListener("mouseleave", j), o.value.parentElement.addEventListener("wheel", Z), m = o.value.parentElement.offsetWidth, e.list.length > 0 && T(() => {
|
|
492
492
|
d.value.offsetWidth > m ? (E = _(), c.value = U(), g(() => {
|
|
493
493
|
u.value = L.value === "left" ? 0 : P() - m, N(), I = !0, setTimeout(() => {
|
|
494
494
|
$(!1, e.step);
|
|
@@ -522,7 +522,7 @@ var Fe = We({
|
|
|
522
522
|
});
|
|
523
523
|
const p = _();
|
|
524
524
|
if (I)
|
|
525
|
-
t <
|
|
525
|
+
t < r && (r += 1, r > s.length && (r = 0)), n.length === 1 && l.forEach((h) => {
|
|
526
526
|
H.value[h] = a[0];
|
|
527
527
|
}), p !== E && (E = p);
|
|
528
528
|
else {
|
|
@@ -577,24 +577,24 @@ var Fe = We({
|
|
|
577
577
|
} }), He(() => e.modelValue, (t) => {
|
|
578
578
|
t && $(!1, e.step);
|
|
579
579
|
}), Le(() => {
|
|
580
|
-
cancelAnimationFrame(W),
|
|
580
|
+
cancelAnimationFrame(W), o.value && (o.value.parentElement.removeEventListener("mouseenter", D), o.value.parentElement.removeEventListener("mouseleave", j), o.value.parentElement.removeEventListener("wheel", Z));
|
|
581
581
|
}), {
|
|
582
582
|
visibleItems: H,
|
|
583
583
|
offset: u,
|
|
584
584
|
testList: x,
|
|
585
|
-
realWrapperRef:
|
|
585
|
+
realWrapperRef: o,
|
|
586
586
|
realWrapperHiddenRef: d
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
589
|
});
|
|
590
|
-
function Ue(e, S, C,
|
|
590
|
+
function Ue(e, S, C, o, d, c) {
|
|
591
591
|
return J(), G(
|
|
592
592
|
K,
|
|
593
593
|
null,
|
|
594
594
|
[
|
|
595
595
|
ie(
|
|
596
596
|
"div",
|
|
597
|
-
|
|
597
|
+
ve({
|
|
598
598
|
class: "vue3-seamless-horizontal-wrapper",
|
|
599
599
|
ref: "realWrapperRef",
|
|
600
600
|
style: { transition: `transform ${e.ease}`, transform: `translateX(-${e.offset}px)` }
|
|
@@ -603,7 +603,7 @@ function Ue(e, S, C, r, d, c) {
|
|
|
603
603
|
(J(!0), G(
|
|
604
604
|
K,
|
|
605
605
|
null,
|
|
606
|
-
ue(e.visibleItems, (u) =>
|
|
606
|
+
ue(e.visibleItems, (u) => re(e.$slots, "default", {
|
|
607
607
|
key: u.id,
|
|
608
608
|
data: u.data,
|
|
609
609
|
index: u.index,
|
|
@@ -618,7 +618,7 @@ function Ue(e, S, C, r, d, c) {
|
|
|
618
618
|
),
|
|
619
619
|
ie(
|
|
620
620
|
"div",
|
|
621
|
-
|
|
621
|
+
ve({
|
|
622
622
|
style: { position: "absolute !important", top: "-999999px !important" },
|
|
623
623
|
ref: "realWrapperHiddenRef"
|
|
624
624
|
}, e.$attrs),
|
|
@@ -626,7 +626,7 @@ function Ue(e, S, C, r, d, c) {
|
|
|
626
626
|
(J(!0), G(
|
|
627
627
|
K,
|
|
628
628
|
null,
|
|
629
|
-
ue(e.testList, (u) =>
|
|
629
|
+
ue(e.testList, (u) => re(e.$slots, "default", {
|
|
630
630
|
key: u.id,
|
|
631
631
|
data: u.data,
|
|
632
632
|
index: u.index
|
|
@@ -652,7 +652,7 @@ Ae(Xe);
|
|
|
652
652
|
Fe.render = Ue;
|
|
653
653
|
Fe.__scopeId = "data-v-530d6df5";
|
|
654
654
|
Fe.__file = "packages/HorizontalScroll.vue";
|
|
655
|
-
var
|
|
655
|
+
var de = We({
|
|
656
656
|
name: "Vue3SeamlessScroll",
|
|
657
657
|
emits: ["offset", "count"],
|
|
658
658
|
inheritAttrs: !1,
|
|
@@ -708,27 +708,27 @@ var ce = We({
|
|
|
708
708
|
}
|
|
709
709
|
},
|
|
710
710
|
setup(e, { expose: S, emit: C }) {
|
|
711
|
-
const
|
|
712
|
-
let z = 0, R = 0, M = 0, X = [], E = 0,
|
|
711
|
+
const o = b(null), d = b(null), c = b(null), u = b([]), F = b(0), L = b(!1), y = b(e.direction), x = ae(() => e.hover ? !L.value && e.modelValue : e.modelValue), i = b([]), s = b(e.visibleCount === void 0 ? 0 : e.visibleCount), f = oe(e.list);
|
|
712
|
+
let z = 0, R = 0, M = 0, X = [], E = 0, r = 0, m = -1, W = 0, k = null, B = !1, w = 0, I = 0, Y = !1;
|
|
713
713
|
const te = ae(() => y.value === "up" || y.value === "down" ? `translateY(-${F.value}px)` : `translateX(-${F.value}px)`), N = () => {
|
|
714
714
|
cancelAnimationFrame(k), k = null;
|
|
715
715
|
}, $ = () => {
|
|
716
|
-
const l = m +
|
|
716
|
+
const l = m + r;
|
|
717
717
|
if (l >= f.length) {
|
|
718
718
|
const a = l - f.length, p = [
|
|
719
719
|
"splice",
|
|
720
|
-
[0,
|
|
720
|
+
[0, r],
|
|
721
721
|
[m],
|
|
722
722
|
[0, a]
|
|
723
723
|
];
|
|
724
724
|
u.value = p, a > f.length ? m = f.length : m = a;
|
|
725
725
|
} else {
|
|
726
|
-
const a = ["splice", [0,
|
|
726
|
+
const a = ["splice", [0, r], [m, l]];
|
|
727
727
|
u.value = a, m = l;
|
|
728
728
|
}
|
|
729
729
|
}, D = () => {
|
|
730
730
|
const l = Array.from(d.value.children);
|
|
731
|
-
X = (y.value === "up" || y.value === "left" ? l.slice(0,
|
|
731
|
+
X = (y.value === "up" || y.value === "left" ? l.slice(0, r) : l.slice(T.value.length - r, T.value.length)).map((p) => y.value === "left" || y.value === "right" ? p.offsetWidth : p.offsetHeight), E = X.reduce((p, h) => p + h, 0);
|
|
732
732
|
}, j = () => {
|
|
733
733
|
y.value === "up" || y.value === "left" ? F.value = 0 : F.value = _() - W;
|
|
734
734
|
}, O = (l, a) => {
|
|
@@ -742,7 +742,7 @@ var ce = We({
|
|
|
742
742
|
}, e.singleWaitTime)) : l || O(!1, e.step);
|
|
743
743
|
};
|
|
744
744
|
(x.value && !B || l) && (k = requestAnimationFrame(() => {
|
|
745
|
-
I += a, w += a, y.value === "up" || y.value === "left" ? F.value += a : F.value -= a, I > E ? (C("offset",
|
|
745
|
+
I += a, w += a, y.value === "up" || y.value === "left" ? F.value += a : F.value -= a, I > E ? (C("offset", r, f), $(), g(() => {
|
|
746
746
|
j(), I = 0, D(), p();
|
|
747
747
|
})) : p();
|
|
748
748
|
}));
|
|
@@ -762,13 +762,13 @@ var ce = We({
|
|
|
762
762
|
l.push(...f.slice(...a));
|
|
763
763
|
}), y.value === "up" || y.value === "left" || l.reverse(), $e(l);
|
|
764
764
|
}), A = () => {
|
|
765
|
-
if (m = s.value +
|
|
765
|
+
if (m = s.value + r, m >= f.length) {
|
|
766
766
|
const l = m - f.length, a = ["slice", [0, m], [0, l]];
|
|
767
767
|
return l > f.length ? m = f.length : m = l, a;
|
|
768
768
|
} else
|
|
769
769
|
return ["slice", [0, m]];
|
|
770
|
-
}, _ = () => Array.from(d.value.children).map((a) => y.value === "left" || y.value === "right" ? a.offsetWidth : a.offsetHeight).reduce((a, p) => a + p, 0),
|
|
771
|
-
e.visibleCount === void 0 ? (i.value =
|
|
770
|
+
}, _ = () => Array.from(d.value.children).map((a) => y.value === "left" || y.value === "right" ? a.offsetWidth : a.offsetHeight).reduce((a, p) => a + p, 0), ce = (l) => {
|
|
771
|
+
e.visibleCount === void 0 ? (i.value = oe([e.list[0]]), g(() => {
|
|
772
772
|
y.value === "left" || y.value === "right" ? s.value = Math.ceil(W / c.value.offsetWidth) + 2 : s.value = Math.ceil(W / c.value.offsetHeight) + 2, i.value = f.slice(0, s.value), g(() => {
|
|
773
773
|
l();
|
|
774
774
|
});
|
|
@@ -777,9 +777,9 @@ var ce = We({
|
|
|
777
777
|
}));
|
|
778
778
|
};
|
|
779
779
|
Ve(() => {
|
|
780
|
-
d.value && (d.value.parentElement.addEventListener("mouseenter", Z), d.value.parentElement.addEventListener("mouseleave", H), d.value.parentElement.addEventListener("wheel", P), W = d.value.parentElement.offsetHeight, (y.value === "left" || y.value === "right") && (W = d.value.parentElement.offsetWidth),
|
|
780
|
+
d.value && (d.value.parentElement.addEventListener("mouseenter", Z), d.value.parentElement.addEventListener("mouseleave", H), d.value.parentElement.addEventListener("wheel", P), W = d.value.parentElement.offsetHeight, (y.value === "left" || y.value === "right") && (W = d.value.parentElement.offsetWidth), ce(() => {
|
|
781
781
|
let l = c.value.offsetHeight > W;
|
|
782
|
-
(y.value === "left" || y.value === "right") && (l = c.value.offsetWidth > W), l ? (
|
|
782
|
+
(y.value === "left" || y.value === "right") && (l = c.value.offsetWidth > W), l ? (r = fe(), u.value = A(), g(() => {
|
|
783
783
|
j(), D(), Y = !0, setTimeout(() => {
|
|
784
784
|
O(!1, e.step);
|
|
785
785
|
}, e.delay);
|
|
@@ -787,7 +787,7 @@ var ce = We({
|
|
|
787
787
|
})), z = f.length;
|
|
788
788
|
});
|
|
789
789
|
const le = () => {
|
|
790
|
-
R = 0, M = 0, Y = !1,
|
|
790
|
+
R = 0, M = 0, Y = !1, r = 0, u.value = [], g(() => {
|
|
791
791
|
j(), I = 0, w = 0;
|
|
792
792
|
});
|
|
793
793
|
}, fe = () => {
|
|
@@ -814,15 +814,15 @@ var ce = We({
|
|
|
814
814
|
if (Y)
|
|
815
815
|
l < m && (m += 1, m > f.length && (m = 0)), a.length === 1 && h.length > 0 && h.forEach((q) => {
|
|
816
816
|
T[q] = V[0];
|
|
817
|
-
}), ne !==
|
|
817
|
+
}), ne !== r && (r = ne);
|
|
818
818
|
else {
|
|
819
819
|
const q = () => {
|
|
820
820
|
let se = c.value.offsetHeight > W;
|
|
821
|
-
(y.value === "left" || y.value === "right") && (se = c.value.offsetWidth > W), se ? (
|
|
821
|
+
(y.value === "left" || y.value === "right") && (se = c.value.offsetWidth > W), se ? (r = ne, u.value = A(), g(() => {
|
|
822
822
|
j(), I = 0, w = 0, D(), Y = !0, O(!1, e.step);
|
|
823
823
|
})) : (e.visibleCount === void 0 && (s.value = 0), le()), i.value = [];
|
|
824
824
|
};
|
|
825
|
-
s.value === 0 && e.visibleCount === void 0 ?
|
|
825
|
+
s.value === 0 && e.visibleCount === void 0 ? ce(() => {
|
|
826
826
|
q();
|
|
827
827
|
}) : (i.value = f.slice(0, s.value), g(() => {
|
|
828
828
|
q();
|
|
@@ -835,7 +835,7 @@ var ce = We({
|
|
|
835
835
|
let h = c.value.offsetHeight > W;
|
|
836
836
|
if ((y.value === "left" || y.value === "right") && (h = c.value.offsetWidth > W), h) {
|
|
837
837
|
const V = fe();
|
|
838
|
-
V !==
|
|
838
|
+
V !== r && (r = V), u.value = A();
|
|
839
839
|
} else
|
|
840
840
|
le();
|
|
841
841
|
i.value = [];
|
|
@@ -872,7 +872,7 @@ var ce = We({
|
|
|
872
872
|
}), Le(() => {
|
|
873
873
|
cancelAnimationFrame(k), d.value && (d.value.parentElement.removeEventListener("mouseenter", Z), d.value.parentElement.removeEventListener("mouseleave", H), d.value.parentElement.removeEventListener("wheel", P));
|
|
874
874
|
}), {
|
|
875
|
-
realBoxRef:
|
|
875
|
+
realBoxRef: o,
|
|
876
876
|
realWrapperRef: d,
|
|
877
877
|
visibleItems: T,
|
|
878
878
|
offset: F,
|
|
@@ -882,14 +882,14 @@ var ce = We({
|
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
});
|
|
885
|
-
function Ye(e, S, C,
|
|
885
|
+
function Ye(e, S, C, o, d, c) {
|
|
886
886
|
return J(), G(
|
|
887
887
|
K,
|
|
888
888
|
null,
|
|
889
889
|
[
|
|
890
890
|
ie(
|
|
891
891
|
"div",
|
|
892
|
-
|
|
892
|
+
ve({
|
|
893
893
|
class: "vue3-seamless-wrapper",
|
|
894
894
|
ref: "realWrapperRef",
|
|
895
895
|
style: { transition: `transform ${e.ease}`, transform: e.transform }
|
|
@@ -898,7 +898,7 @@ function Ye(e, S, C, r, d, c) {
|
|
|
898
898
|
(J(!0), G(
|
|
899
899
|
K,
|
|
900
900
|
null,
|
|
901
|
-
ue(e.visibleItems, (u) =>
|
|
901
|
+
ue(e.visibleItems, (u) => re(e.$slots, "default", {
|
|
902
902
|
key: u.id,
|
|
903
903
|
data: u.data,
|
|
904
904
|
index: u.index
|
|
@@ -912,7 +912,7 @@ function Ye(e, S, C, r, d, c) {
|
|
|
912
912
|
),
|
|
913
913
|
ie(
|
|
914
914
|
"div",
|
|
915
|
-
|
|
915
|
+
ve({
|
|
916
916
|
style: { position: "absolute !important", left: "-999999px !important" },
|
|
917
917
|
ref: "realWrapperHiddenRef"
|
|
918
918
|
}, e.$attrs),
|
|
@@ -920,7 +920,7 @@ function Ye(e, S, C, r, d, c) {
|
|
|
920
920
|
(J(!0), G(
|
|
921
921
|
K,
|
|
922
922
|
null,
|
|
923
|
-
ue(e.testList, (u) =>
|
|
923
|
+
ue(e.testList, (u) => re(e.$slots, "default", {
|
|
924
924
|
key: u.id,
|
|
925
925
|
data: u.data,
|
|
926
926
|
index: u.index
|
|
@@ -944,20 +944,14 @@ var je = `
|
|
|
944
944
|
}\r
|
|
945
945
|
`;
|
|
946
946
|
Ae(je);
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
const
|
|
951
|
-
|
|
952
|
-
};
|
|
953
|
-
function Ge(e) {
|
|
954
|
-
e.use(_e);
|
|
955
|
-
}
|
|
956
|
-
const xe = Me(), Je = [he, me, pe, ge, ye, Ee, Se, Ce, be], ot = (e) => {
|
|
957
|
-
Je.forEach((S) => {
|
|
947
|
+
de.render = Ye;
|
|
948
|
+
de.__scopeId = "data-v-b156a416";
|
|
949
|
+
de.__file = "packages/Vue3SeamlessScroll.vue";
|
|
950
|
+
const xe = Me(), _e = [he, me, pe, ge, ye, Ee, Se, Ce, be], it = (e) => {
|
|
951
|
+
_e.forEach((S) => {
|
|
958
952
|
e.use(S);
|
|
959
|
-
}), e.use(Te), e.
|
|
960
|
-
},
|
|
953
|
+
}), e.use(Te), e.component("vue3-seamless-scroll", de), e.config.globalProperties.$router = Te;
|
|
954
|
+
}, Ge = (e) => {
|
|
961
955
|
switch (e) {
|
|
962
956
|
case "browser":
|
|
963
957
|
return ke;
|
|
@@ -966,19 +960,19 @@ const xe = Me(), Je = [he, me, pe, ge, ye, Ee, Se, Ce, be], ot = (e) => {
|
|
|
966
960
|
case "three":
|
|
967
961
|
return Ne;
|
|
968
962
|
}
|
|
969
|
-
},
|
|
963
|
+
}, Je = (e) => {
|
|
970
964
|
const S = document.documentElement;
|
|
971
965
|
e == null || e.forEach((C) => {
|
|
972
966
|
S.style.setProperty(C.name, C.value);
|
|
973
967
|
});
|
|
974
|
-
},
|
|
968
|
+
}, Ke = (e) => {
|
|
975
969
|
xe.setPlatform(e);
|
|
976
|
-
const S =
|
|
977
|
-
|
|
978
|
-
},
|
|
970
|
+
const S = Ge(e);
|
|
971
|
+
Je(S);
|
|
972
|
+
}, ut = { getPlatform: xe.getPlatform, setPlatform: xe.setPlatform, initPlatform: Ke };
|
|
979
973
|
export {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
974
|
+
ft as SvgIcon,
|
|
975
|
+
it as default,
|
|
976
|
+
ut as platformApi,
|
|
983
977
|
Te as router
|
|
984
978
|
};
|