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