@wikicasa-dev/components 2.5.3-alpha.11 → 2.5.3-alpha.12
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/components/carousel/Primitive/SwiperSlideImagePrimitive.d.ts +1 -0
- package/dist/packages/components/lib/components/carousel/Primitive/SwiperRootPrimitive.vue.js +59 -41
- package/dist/packages/components/lib/components/carousel/Primitive/SwiperSlideImagePrimitive.vue.js +3 -2
- package/package.json +1 -1
- /package/dist/assets/{swiper-controller.css → swiper-keyboard.css} +0 -0
|
@@ -10,6 +10,7 @@ export interface SwiperSlideImagePrimitiveProps {
|
|
|
10
10
|
decoding?: "auto" | "sync" | "async";
|
|
11
11
|
crossorigin?: "anonymous" | "use-credentials";
|
|
12
12
|
fetchpriority?: "auto" | "high" | "low";
|
|
13
|
+
loading?: "lazy" | "eager";
|
|
13
14
|
lazy?: boolean;
|
|
14
15
|
}
|
|
15
16
|
declare const _default: import('vue').DefineComponent<SwiperSlideImagePrimitiveProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SwiperSlideImagePrimitiveProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
package/dist/packages/components/lib/components/carousel/Primitive/SwiperRootPrimitive.vue.js
CHANGED
|
@@ -1,77 +1,95 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createSwiper as
|
|
1
|
+
import { defineComponent as k, useAttrs as O, shallowRef as p, useTemplateRef as E, onMounted as L, provide as v, createElementBlock as b, openBlock as M, Fragment as V, withDirectives as x, renderSlot as f, createCommentVNode as z, createElementVNode as A, mergeProps as N, unref as C, vShow as B, nextTick as D } from "vue";
|
|
2
|
+
import { createSwiper as K } from "../../../../../../Swiper/factory.js";
|
|
3
3
|
import { AutoplayModule as R } from "../../../../../../Swiper/Autoplay/factory.js";
|
|
4
|
-
import { KeyboardModule as
|
|
4
|
+
import { KeyboardModule as U } from "../../../../../../Swiper/Keyboard/factory.js";
|
|
5
5
|
import { ZoomModule as $ } from "../../../../../../Swiper/Zoom/factory.js";
|
|
6
|
-
const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(),
|
|
6
|
+
const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), W = /* @__PURE__ */ k({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "SwiperRootPrimitive",
|
|
9
9
|
props: {
|
|
10
10
|
swiperOptions: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["moved", "click", "init"],
|
|
13
|
-
setup(
|
|
14
|
-
const
|
|
15
|
-
let
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
i
|
|
13
|
+
setup(s, { expose: y, emit: w }) {
|
|
14
|
+
const l = w, P = O(), a = p(null), c = E("root"), n = p(!1), I = !!s.swiperOptions?.keyboard, T = !!s.swiperOptions?.autoplay, u = [];
|
|
15
|
+
let d = !1;
|
|
16
|
+
const S = (e) => {
|
|
17
|
+
const t = [
|
|
18
|
+
...e?.querySelectorAll("img[data-src]") ?? []
|
|
19
|
+
];
|
|
20
|
+
return t.forEach((o) => {
|
|
21
|
+
o.src = o.dataset.src || "", o.srcset = o.dataset.srcset || "", o.dataset.src = "", o.dataset.srcset = "", o.removeAttribute("lazy");
|
|
22
|
+
}), t;
|
|
23
|
+
}, m = (e, t) => {
|
|
24
|
+
const o = [];
|
|
25
|
+
if (!d) return o;
|
|
26
|
+
const r = e.params.lazyPreloadPrevNext ?? 0;
|
|
27
|
+
for (let i = t - r; i <= t + r; i++)
|
|
28
|
+
o.push(...S(e.slides[i]));
|
|
29
|
+
return o;
|
|
30
|
+
}, h = async (e) => {
|
|
31
|
+
a.value = await K(
|
|
28
32
|
e,
|
|
29
33
|
{
|
|
30
34
|
on: {
|
|
31
35
|
init: (t) => {
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
D(async () => {
|
|
37
|
+
const o = m(t, t.activeIndex);
|
|
38
|
+
if (!o.length) {
|
|
39
|
+
n.value = !0, l("init");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
await Promise.race([
|
|
43
|
+
Promise.all(
|
|
44
|
+
o.map(
|
|
45
|
+
(r) => r.complete ? Promise.resolve() : new Promise((i) => {
|
|
46
|
+
r.addEventListener("load", i, { once: !0 }), r.addEventListener("error", i, { once: !0 });
|
|
47
|
+
})
|
|
48
|
+
)
|
|
49
|
+
),
|
|
50
|
+
new Promise((r) => setTimeout(r, 3e3))
|
|
51
|
+
]), n.value = !0, l("init");
|
|
34
52
|
});
|
|
35
53
|
},
|
|
36
54
|
slideChange: (t) => {
|
|
37
|
-
|
|
55
|
+
l("moved", { activeIndex: t.activeIndex }), m(t, t.activeIndex);
|
|
38
56
|
}
|
|
39
57
|
},
|
|
40
|
-
...
|
|
58
|
+
...s.swiperOptions
|
|
41
59
|
},
|
|
42
60
|
[
|
|
43
|
-
$(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
...
|
|
61
|
+
$(s.swiperOptions?.zoom),
|
|
62
|
+
I ? U(s.swiperOptions?.keyboard) : void 0,
|
|
63
|
+
T ? R(s.swiperOptions.autoplay) : void 0,
|
|
64
|
+
...u
|
|
47
65
|
].filter(Boolean)
|
|
48
66
|
);
|
|
49
67
|
};
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
L(() => {
|
|
69
|
+
c.value && setTimeout(() => h(c.value));
|
|
52
70
|
});
|
|
53
71
|
const g = (e) => {
|
|
54
|
-
!
|
|
72
|
+
!a.value || a.value.params.slidesPerView === e || (a.value.params.slidesPerView = e, a.value.update());
|
|
55
73
|
};
|
|
56
|
-
return
|
|
57
|
-
e &&
|
|
58
|
-
}),
|
|
59
|
-
e !==
|
|
60
|
-
}),
|
|
61
|
-
swiper:
|
|
74
|
+
return v(F, (e) => {
|
|
75
|
+
e && u.push(e);
|
|
76
|
+
}), v(q, (e) => {
|
|
77
|
+
e !== d && (d = e);
|
|
78
|
+
}), y({
|
|
79
|
+
swiper: a,
|
|
62
80
|
updateSlidesPerView: g
|
|
63
|
-
}), (e, t) => (
|
|
64
|
-
|
|
81
|
+
}), (e, t) => (M(), b(V, null, [
|
|
82
|
+
x(A("div", N({ ref: "root" }, C(P), { class: "swiper uikit-carousel" }), [
|
|
65
83
|
f(e.$slots, "default")
|
|
66
84
|
], 16), [
|
|
67
|
-
[
|
|
85
|
+
[B, n.value]
|
|
68
86
|
]),
|
|
69
|
-
|
|
87
|
+
n.value ? z("", !0) : f(e.$slots, "placeholder", { key: 0 })
|
|
70
88
|
], 64));
|
|
71
89
|
}
|
|
72
90
|
});
|
|
73
91
|
export {
|
|
74
92
|
F as addModuleDescriptorKey,
|
|
75
|
-
|
|
93
|
+
W as default,
|
|
76
94
|
q as setLazyImagesLoaderKey
|
|
77
95
|
};
|
package/dist/packages/components/lib/components/carousel/Primitive/SwiperSlideImagePrimitive.vue.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as i, createPropsRestProxy as o, shallowRef as r, inject as l, createBlock as d, openBlock as n, withCtx as m, createElementVNode as
|
|
1
|
+
import { defineComponent as i, createPropsRestProxy as o, shallowRef as r, inject as l, createBlock as d, openBlock as n, withCtx as m, createElementVNode as g, mergeProps as u } from "vue";
|
|
2
2
|
import f from "../../../../../../components/carousel/SwiperSlide.js";
|
|
3
3
|
import { setLazyImagesLoaderKey as y } from "./SwiperRootPrimitive.vue.js";
|
|
4
4
|
import '../../../../../../assets/SwiperRootPrimitive.css';/* empty css */
|
|
@@ -15,13 +15,14 @@ const h = ["src", "srcset", "data-src", "data-srcset"], x = /* @__PURE__ */ i({
|
|
|
15
15
|
decoding: {},
|
|
16
16
|
crossorigin: {},
|
|
17
17
|
fetchpriority: {},
|
|
18
|
+
loading: {},
|
|
18
19
|
lazy: { type: Boolean }
|
|
19
20
|
},
|
|
20
21
|
setup(e) {
|
|
21
22
|
const s = o(e, ["src", "srcset", "imgClasses"]), t = r(), a = r(), c = l(y, void 0);
|
|
22
23
|
return s.lazy && (t.value = e.src, a.value = e.srcset, c?.(!0)), (v, z) => (n(), d(f, null, {
|
|
23
24
|
default: m(() => [
|
|
24
|
-
|
|
25
|
+
g("img", u(s, {
|
|
25
26
|
class: e.imgClasses,
|
|
26
27
|
src: e.lazy ? void 0 : e.src,
|
|
27
28
|
srcset: e.lazy ? void 0 : e.srcset,
|
package/package.json
CHANGED
|
File without changes
|