@wikicasa-dev/components 2.5.3-alpha.12 → 2.5.3-alpha.14
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/Swiper/Autoplay/index.js +1 -1
- package/dist/Swiper/Controller/index.js +1 -1
- package/dist/Swiper/Keyboard/index.js +1 -1
- package/dist/Swiper/Thumbs/index.js +1 -1
- package/dist/packages/components/lib/components/carousel/Primitive/SwiperRootPrimitive.vue.js +50 -36
- package/package.json +1 -1
- /package/dist/assets/{swiper-keyboard.css → swiper-autoplay.css} +0 -0
package/dist/packages/components/lib/components/carousel/Primitive/SwiperRootPrimitive.vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createSwiper as
|
|
3
|
-
import { AutoplayModule as
|
|
4
|
-
import { KeyboardModule as
|
|
5
|
-
import { ZoomModule as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as S, useAttrs as O, shallowRef as p, useTemplateRef as k, onMounted as L, provide as v, createElementBlock as B, openBlock as D, Fragment as M, withDirectives as U, renderSlot as f, createCommentVNode as b, createElementVNode as V, mergeProps as x, unref as z, vShow as A, nextTick as G } from "vue";
|
|
2
|
+
import { createSwiper as N } from "../../../../../../Swiper/factory.js";
|
|
3
|
+
import { AutoplayModule as C } from "../../../../../../Swiper/Autoplay/factory.js";
|
|
4
|
+
import { KeyboardModule as K } from "../../../../../../Swiper/Keyboard/factory.js";
|
|
5
|
+
import { ZoomModule as R } from "../../../../../../Swiper/Zoom/factory.js";
|
|
6
|
+
const $ = /* @__PURE__ */ Symbol(), q = /* @__PURE__ */ Symbol(), W = /* @__PURE__ */ S({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "SwiperRootPrimitive",
|
|
9
9
|
props: {
|
|
@@ -11,9 +11,9 @@ const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), W = /* @__PURE
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["moved", "click", "init"],
|
|
13
13
|
setup(s, { expose: y, emit: w }) {
|
|
14
|
-
const
|
|
14
|
+
const n = w, g = O(), a = p(null), c = k("root"), l = p(!1), T = !!s.swiperOptions?.keyboard, E = !!s.swiperOptions?.autoplay, u = [];
|
|
15
15
|
let d = !1;
|
|
16
|
-
const
|
|
16
|
+
const I = (e) => {
|
|
17
17
|
const t = [
|
|
18
18
|
...e?.querySelectorAll("img[data-src]") ?? []
|
|
19
19
|
];
|
|
@@ -25,71 +25,85 @@ const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), W = /* @__PURE
|
|
|
25
25
|
if (!d) return o;
|
|
26
26
|
const r = e.params.lazyPreloadPrevNext ?? 0;
|
|
27
27
|
for (let i = t - r; i <= t + r; i++)
|
|
28
|
-
o.push(...
|
|
28
|
+
o.push(...I(e.slides[i]));
|
|
29
29
|
return o;
|
|
30
|
-
},
|
|
31
|
-
a.value = await
|
|
30
|
+
}, P = async (e) => {
|
|
31
|
+
a.value = await N(
|
|
32
32
|
e,
|
|
33
33
|
{
|
|
34
34
|
on: {
|
|
35
35
|
init: (t) => {
|
|
36
|
-
|
|
36
|
+
G(async () => {
|
|
37
37
|
const o = m(t, t.activeIndex);
|
|
38
|
-
if (!o.length) {
|
|
39
|
-
|
|
38
|
+
if (console.log("DEBUG:imagesToLoad", o), !o.length) {
|
|
39
|
+
l.value = !0, n("init");
|
|
40
40
|
return;
|
|
41
41
|
}
|
|
42
42
|
await Promise.race([
|
|
43
43
|
Promise.all(
|
|
44
|
-
o.map(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
o.map((r) => r.complete ? (console.log("DEBUG:img.complete", r), Promise.resolve()) : new Promise((i) => {
|
|
45
|
+
r.addEventListener(
|
|
46
|
+
"load",
|
|
47
|
+
() => {
|
|
48
|
+
console.log("DEBUG:img.load", r), i("");
|
|
49
|
+
},
|
|
50
|
+
{ once: !0 }
|
|
51
|
+
), r.addEventListener(
|
|
52
|
+
"error",
|
|
53
|
+
() => {
|
|
54
|
+
console.log("DEBUG:img.error", r), i("");
|
|
55
|
+
},
|
|
56
|
+
{ once: !0 }
|
|
57
|
+
);
|
|
58
|
+
}))
|
|
49
59
|
),
|
|
50
|
-
new Promise(
|
|
51
|
-
|
|
60
|
+
new Promise(
|
|
61
|
+
(r) => setTimeout(() => {
|
|
62
|
+
console.log("DEBUG:not all images have loaded => TIMEOUT!"), r("");
|
|
63
|
+
}, 3e3)
|
|
64
|
+
)
|
|
65
|
+
]), l.value = !0, n("init");
|
|
52
66
|
});
|
|
53
67
|
},
|
|
54
68
|
slideChange: (t) => {
|
|
55
|
-
|
|
69
|
+
n("moved", { activeIndex: t.activeIndex }), m(t, t.activeIndex);
|
|
56
70
|
}
|
|
57
71
|
},
|
|
58
72
|
...s.swiperOptions
|
|
59
73
|
},
|
|
60
74
|
[
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
R(s.swiperOptions?.zoom),
|
|
76
|
+
T ? K(s.swiperOptions?.keyboard) : void 0,
|
|
77
|
+
E ? C(s.swiperOptions.autoplay) : void 0,
|
|
64
78
|
...u
|
|
65
79
|
].filter(Boolean)
|
|
66
80
|
);
|
|
67
81
|
};
|
|
68
82
|
L(() => {
|
|
69
|
-
c.value && setTimeout(() =>
|
|
83
|
+
c.value && setTimeout(() => P(c.value));
|
|
70
84
|
});
|
|
71
|
-
const
|
|
85
|
+
const h = (e) => {
|
|
72
86
|
!a.value || a.value.params.slidesPerView === e || (a.value.params.slidesPerView = e, a.value.update());
|
|
73
87
|
};
|
|
74
|
-
return v(
|
|
88
|
+
return v(q, (e) => {
|
|
75
89
|
e && u.push(e);
|
|
76
|
-
}), v(
|
|
90
|
+
}), v($, (e) => {
|
|
77
91
|
e !== d && (d = e);
|
|
78
92
|
}), y({
|
|
79
93
|
swiper: a,
|
|
80
|
-
updateSlidesPerView:
|
|
81
|
-
}), (e, t) => (
|
|
82
|
-
|
|
94
|
+
updateSlidesPerView: h
|
|
95
|
+
}), (e, t) => (D(), B(M, null, [
|
|
96
|
+
U(V("div", x({ ref: "root" }, z(g), { class: "swiper uikit-carousel" }), [
|
|
83
97
|
f(e.$slots, "default")
|
|
84
98
|
], 16), [
|
|
85
|
-
[
|
|
99
|
+
[A, l.value]
|
|
86
100
|
]),
|
|
87
|
-
|
|
101
|
+
l.value ? b("", !0) : f(e.$slots, "placeholder", { key: 0 })
|
|
88
102
|
], 64));
|
|
89
103
|
}
|
|
90
104
|
});
|
|
91
105
|
export {
|
|
92
|
-
|
|
106
|
+
q as addModuleDescriptorKey,
|
|
93
107
|
W as default,
|
|
94
|
-
|
|
108
|
+
$ as setLazyImagesLoaderKey
|
|
95
109
|
};
|
package/package.json
CHANGED
|
File without changes
|