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