@wikicasa-dev/components 2.4.2-alpha.4 → 2.4.2-alpha.6
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/factory.js
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
function s(t, e) {
|
|
2
|
+
if (t == null)
|
|
3
|
+
return e == null ? {} : { ...e };
|
|
4
|
+
if (e == null)
|
|
5
|
+
return { ...t };
|
|
6
|
+
const n = { ...t };
|
|
7
|
+
for (const o in e)
|
|
8
|
+
if (Object.prototype.hasOwnProperty.call(e, o)) {
|
|
9
|
+
const r = e[o], i = n[o];
|
|
10
|
+
p(r) && p(i) ? n[o] = s(i, r) : n[o] = r;
|
|
11
|
+
}
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
function p(t) {
|
|
15
|
+
return t !== null && typeof t == "object" && !Array.isArray(t) && typeof t != "function" && Object.prototype.toString.call(t) === "[object Object]";
|
|
16
|
+
}
|
|
17
|
+
const a = async (t, e, n) => {
|
|
18
|
+
const o = n.map((c) => c.loader()), [{ Swiper: r }, ...i] = await Promise.all([
|
|
3
19
|
import("./index.js"),
|
|
4
|
-
...
|
|
5
|
-
]),
|
|
6
|
-
(
|
|
7
|
-
{
|
|
20
|
+
...o
|
|
21
|
+
]), l = n.reduce(
|
|
22
|
+
(c, f) => s(c, f.options),
|
|
23
|
+
{
|
|
24
|
+
...e,
|
|
25
|
+
modules: i
|
|
26
|
+
}
|
|
8
27
|
);
|
|
9
|
-
return console.log("DEBUG:createSwiper",
|
|
28
|
+
return console.log("DEBUG:createSwiper", {
|
|
29
|
+
container: t,
|
|
30
|
+
options: l
|
|
31
|
+
}), new r(t, l);
|
|
10
32
|
};
|
|
11
33
|
export {
|
|
12
34
|
a as createSwiper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.no-transition[data-v-
|
|
1
|
+
.no-transition[data-v-9ee6d9a5]{transition-duration:0ms!important}.disable-select[data-v-9ee6d9a5]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-9ee6d9a5]{pointer-events:auto!important}
|
|
@@ -2,7 +2,7 @@ import o from "../../packages/components/lib/components/carousel/SwiperCarousel.
|
|
|
2
2
|
import '../../assets/SwiperCarousel2.css';import '../../assets/SwiperCarousel.css';/* empty css */
|
|
3
3
|
/* empty css */
|
|
4
4
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const
|
|
5
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9ee6d9a5"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createSwiper as
|
|
1
|
+
import { defineComponent as Q, shallowRef as z, useTemplateRef as C, useId as X, computed as Y, onMounted as x, watch as _, nextTick as M, createElementBlock as n, openBlock as l, normalizeClass as u, createElementVNode as p, createCommentVNode as b, unref as ee, renderSlot as L, Fragment as k, renderList as V, mergeProps as R, withModifiers as O } from "vue";
|
|
2
|
+
import { createSwiper as B } from "../../../../../Swiper/factory.js";
|
|
3
3
|
import { AutoplayModule as te } from "../../../../../Swiper/Autoplay/factory.js";
|
|
4
4
|
import { FreemodeModule as se } from "../../../../../Swiper/FreeMode/factory.js";
|
|
5
5
|
import { KeyboardModule as ie } from "../../../../../Swiper/Keyboard/factory.js";
|
|
@@ -7,7 +7,7 @@ import { NavigationModule as re } from "../../../../../Swiper/Navigation/factory
|
|
|
7
7
|
import { PaginationModule as ae } from "../../../../../Swiper/Pagination/factory.js";
|
|
8
8
|
import { ThumbsModule as oe } from "../../../../../Swiper/Thumbs/factory.js";
|
|
9
9
|
import { ZoomModule as ne } from "../../../../../Swiper/Zoom/factory.js";
|
|
10
|
-
const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], de = ["alt"], ye = /* @__PURE__ */
|
|
10
|
+
const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], de = ["alt"], ye = /* @__PURE__ */ Q({
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
__name: "SwiperCarousel",
|
|
13
13
|
props: {
|
|
@@ -21,8 +21,8 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
21
21
|
shiftFirstImage: { type: Boolean, default: !1 }
|
|
22
22
|
},
|
|
23
23
|
emits: ["moved", "click", "firstSlideLoaded", "init"],
|
|
24
|
-
setup(t, { expose:
|
|
25
|
-
const g = D, d = z(null), y =
|
|
24
|
+
setup(t, { expose: T, emit: D }) {
|
|
25
|
+
const g = D, d = z(null), y = C("rootRef"), A = C("thumbsRef"), F = z(!1), N = X(), $ = Y(() => t.id ?? N), w = t.swiperOptions?.slidesPerView || 1, j = !!t.swiperOptions?.keyboard, S = !!t.swiperOptions.navigation, I = !!t.swiperOptions.pagination, q = !!t.swiperOptions.autoplay, G = t.swiperOptions?.effect || "slider", P = (e, s = -1, i = !1) => {
|
|
26
26
|
if (!e.images)
|
|
27
27
|
return { src: e.src || "" };
|
|
28
28
|
let r = "", o = "", v = "";
|
|
@@ -39,8 +39,8 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
39
39
|
let a = e.images;
|
|
40
40
|
e.images.length > 3 ? a = e.images.slice(2, 5) : t.shiftFirstImage && (a[0] = a[1]), o = a.reduce((c, f, m) => (m === 0 && (r = `${f.storagePath}`), m > 0 && (c += ", "), `${c}${f.storagePath} ${m + 1}x`), "");
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
return typeof w == "number" && s > w ? (r = "", o = "", { sizes: v, "data-src":
|
|
42
|
+
const H = r, J = o;
|
|
43
|
+
return typeof w == "number" && s > w ? (r = "", o = "", { sizes: v, "data-src": H, "data-srcset": J }) : i ? {
|
|
44
44
|
src: r,
|
|
45
45
|
srcset: o,
|
|
46
46
|
sizes: v,
|
|
@@ -60,15 +60,19 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
60
60
|
return;
|
|
61
61
|
const i = h[e + 1];
|
|
62
62
|
i && !i.src && (i.src = i?.dataset.src || "", i.srcset = i?.dataset.srcset || "");
|
|
63
|
-
},
|
|
64
|
-
e || !h?.[e] ||
|
|
63
|
+
}, U = (e) => {
|
|
64
|
+
e || !h?.[e] || M(() => {
|
|
65
65
|
y.value?.setAttribute("data-first-slide-loaded", "true"), g("firstSlideLoaded");
|
|
66
66
|
});
|
|
67
|
-
},
|
|
67
|
+
}, W = (e) => t.thumbSwiperOptions ? B(e, t.thumbSwiperOptions, [
|
|
68
68
|
se(t.thumbSwiperOptions.freeMode)
|
|
69
|
-
]) : null,
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
]) : null, Z = async (e, s) => {
|
|
70
|
+
console.log("DEBUG:SwiperCarousel", {
|
|
71
|
+
rootEl: e,
|
|
72
|
+
thumbEl: s
|
|
73
|
+
});
|
|
74
|
+
const i = s ? await W(s) : null;
|
|
75
|
+
d.value = await B(
|
|
72
76
|
e,
|
|
73
77
|
{
|
|
74
78
|
on: {
|
|
@@ -94,24 +98,24 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
94
98
|
);
|
|
95
99
|
};
|
|
96
100
|
x(() => {
|
|
97
|
-
y.value && setTimeout(() =>
|
|
101
|
+
y.value && setTimeout(() => Z(y.value, A.value));
|
|
98
102
|
});
|
|
99
|
-
const
|
|
103
|
+
const E = (e) => {
|
|
100
104
|
!d.value || d.value.params.slidesPerView === e || (d.value.params.slidesPerView = e, d.value.update());
|
|
101
105
|
};
|
|
102
106
|
return _(
|
|
103
107
|
() => t.images,
|
|
104
108
|
() => {
|
|
105
|
-
|
|
109
|
+
M(() => {
|
|
106
110
|
d.value?.update();
|
|
107
111
|
});
|
|
108
112
|
}
|
|
109
|
-
),
|
|
113
|
+
), T({
|
|
110
114
|
swiper: d,
|
|
111
115
|
moveTo(e, s = 0, i = !0) {
|
|
112
116
|
d.value?.slideTo(e, s, i);
|
|
113
117
|
},
|
|
114
|
-
updateSlidesPerView:
|
|
118
|
+
updateSlidesPerView: E
|
|
115
119
|
}), (e, s) => (l(), n("div", {
|
|
116
120
|
class: u(["swiper-carousel-root", e.$attrs["root-classes"]])
|
|
117
121
|
}, [
|
|
@@ -124,7 +128,7 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
124
128
|
ref: "swiperWrapperRef",
|
|
125
129
|
class: u(["swiper-wrapper", [
|
|
126
130
|
e.$attrs["swiper-wrapper-classes"],
|
|
127
|
-
ee(
|
|
131
|
+
ee(G) === "none" && "no-transition"
|
|
128
132
|
]]),
|
|
129
133
|
onClick: s[0] || (s[0] = (i) => g("click"))
|
|
130
134
|
}, [
|
|
@@ -149,7 +153,7 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
149
153
|
itemprop: "image",
|
|
150
154
|
width: i.width,
|
|
151
155
|
height: i.height,
|
|
152
|
-
onLoad: (o) =>
|
|
156
|
+
onLoad: (o) => U(r)
|
|
153
157
|
}), null, 16, ue))
|
|
154
158
|
], 2)
|
|
155
159
|
], 2))), 128)),
|