@wikicasa-dev/components 2.4.1 → 2.4.2-alpha.1
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/factory.js +9 -0
- package/dist/Swiper/Autoplay/index.js +5 -0
- package/dist/Swiper/Controller/factory.js +9 -0
- package/dist/Swiper/Controller/index.js +5 -0
- package/dist/Swiper/FreeMode/factory.js +9 -0
- package/dist/Swiper/FreeMode/index.js +5 -0
- package/dist/Swiper/Keyboard/factory.js +9 -0
- package/dist/Swiper/Keyboard/index.js +5 -0
- package/dist/Swiper/Navigation/factory.js +17 -0
- package/dist/Swiper/Navigation/index.js +5 -0
- package/dist/Swiper/Pagination/factory.js +17 -0
- package/dist/Swiper/Pagination/index.js +5 -0
- package/dist/Swiper/Thumbs/factory.js +9 -0
- package/dist/Swiper/Thumbs/index.js +5 -0
- package/dist/Swiper/Zoom/factory.js +9 -0
- package/dist/Swiper/Zoom/index.js +5 -0
- package/dist/Swiper/factory.js +13 -0
- package/dist/Swiper/index.js +5 -0
- package/dist/Swiper/types.js +1 -0
- package/dist/assets/SwiperCarousel.css +1 -1
- package/dist/assets/SwiperCarousel2.css +1 -1
- package/dist/assets/tailwind.css +1 -1
- package/dist/components/carousel/SwiperCarousel.d.ts +11 -2329
- package/dist/components/carousel/SwiperCarousel.js +2 -2
- package/dist/packages/components/lib/components/carousel/SwiperCarousel.vue.js +125 -164
- package/package.json +1 -1
- package/dist/Swiper/autoplay.js +0 -5
- package/dist/Swiper/controller.js +0 -5
- package/dist/Swiper/free-mode.js +0 -5
- package/dist/Swiper/keyboard.js +0 -5
- package/dist/Swiper/navigation.js +0 -5
- package/dist/Swiper/pagination.js +0 -5
- package/dist/Swiper/thumbs.js +0 -5
- /package/dist/assets/{swiper-thumbs.css → swiper-keyboard.css} +0 -0
|
@@ -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 a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9fbc502e"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { defineComponent as U, shallowRef as z, useTemplateRef as M, useId as X, computed as Y, onMounted as x, watch as _, nextTick as C, createElementBlock as n, openBlock as l, normalizeClass as d, 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 T } from "../../../../../Swiper/factory.js";
|
|
3
|
+
import { AutoplayModule as te } from "../../../../../Swiper/Autoplay/factory.js";
|
|
4
|
+
import { ControllerModule as se } from "../../../../../Swiper/Controller/factory.js";
|
|
5
|
+
import { FreemodeModule as ie } from "../../../../../Swiper/FreeMode/factory.js";
|
|
6
|
+
import { KeyboardModule as re } from "../../../../../Swiper/Keyboard/factory.js";
|
|
7
|
+
import { NavigationModule as ae } from "../../../../../Swiper/Navigation/factory.js";
|
|
8
|
+
import { PaginationModule as oe } from "../../../../../Swiper/Pagination/factory.js";
|
|
9
|
+
import { ThumbsModule as ne } from "../../../../../Swiper/Thumbs/factory.js";
|
|
10
|
+
import { ZoomModule as le } from "../../../../../Swiper/Zoom/factory.js";
|
|
11
|
+
const de = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], ce = ["alt"], ke = /* @__PURE__ */ U({
|
|
8
12
|
inheritAttrs: !1,
|
|
9
13
|
__name: "SwiperCarousel",
|
|
10
14
|
props: {
|
|
@@ -18,229 +22,186 @@ const te = ["id"], se = ["id", "data-cy"], ie = ["data-idx", "alt", "width", "he
|
|
|
18
22
|
shiftFirstImage: { type: Boolean, default: !1 }
|
|
19
23
|
},
|
|
20
24
|
emits: ["moved", "click", "firstSlideLoaded", "init"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
swiperParams: { modules: [_] },
|
|
24
|
-
swiper: null,
|
|
25
|
-
initCarousel: !1
|
|
26
|
-
}), S = k(), j = k(!1), A = X(), p = f(() => s.id ?? A), N = f(() => a.swiper), g = f(() => s.swiperOptions?.slidesPerView || 1), W = f(() => !!s.swiperOptions?.keyboard), C = f(() => !!s.swiperOptions.navigation), I = f(() => !!s.swiperOptions.pagination), q = f(() => !!s.swiperOptions.autoplay), K = f(
|
|
27
|
-
() => s.swiperOptions?.effect || "slider"
|
|
28
|
-
), R = () => {
|
|
29
|
-
s.swiperOptions && ee(s.swiperOptions, a.swiperParams);
|
|
30
|
-
}, z = (e, i = -1, t = !1) => {
|
|
25
|
+
setup(t, { expose: B, emit: D }) {
|
|
26
|
+
const g = D, u = z(null), y = M("rootRef"), A = M("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, E = t.swiperOptions?.effect || "slider", P = (e, s = -1, i = !1) => {
|
|
31
27
|
if (!e.images)
|
|
32
28
|
return { src: e.src || "" };
|
|
33
|
-
let r = "", o = "",
|
|
34
|
-
if (
|
|
35
|
-
for (const
|
|
36
|
-
const { mq:
|
|
37
|
-
|
|
29
|
+
let r = "", o = "", v = "";
|
|
30
|
+
if (t.artDirection) {
|
|
31
|
+
for (const a in t.artDirection) {
|
|
32
|
+
const { mq: c, width: f } = t.artDirection[a];
|
|
33
|
+
f && (v += v ? `,${c} ${parseInt(f)}px` : `${c} ${parseInt(f)}px`);
|
|
38
34
|
}
|
|
39
|
-
o = e.images.reduce((
|
|
40
|
-
const m = Object.values(
|
|
41
|
-
return !m || !m.width || (
|
|
35
|
+
o = e.images.reduce((a, c, f) => {
|
|
36
|
+
const m = Object.values(t.artDirection)[f];
|
|
37
|
+
return !m || !m.width || (a += a ? `, ${c.storagePath} ${m.width}` : `${c.storagePath} ${m.width}`), a;
|
|
42
38
|
}, ""), r = e.images[0].storagePath;
|
|
43
39
|
} else {
|
|
44
|
-
let
|
|
45
|
-
e.images.length > 3 ?
|
|
40
|
+
let a = e.images;
|
|
41
|
+
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`), "");
|
|
46
42
|
}
|
|
47
|
-
const
|
|
48
|
-
return typeof
|
|
43
|
+
const J = r, Q = o;
|
|
44
|
+
return typeof w == "number" && s > w ? (r = "", o = "", { sizes: v, "data-src": J, "data-srcset": Q }) : i ? {
|
|
49
45
|
src: r,
|
|
50
46
|
srcset: o,
|
|
51
|
-
sizes:
|
|
47
|
+
sizes: v,
|
|
52
48
|
loading: "lazy",
|
|
53
49
|
fetchpriority: "low"
|
|
54
50
|
} : {
|
|
55
51
|
src: r,
|
|
56
52
|
srcset: o,
|
|
57
|
-
sizes:
|
|
58
|
-
loading:
|
|
59
|
-
fetchpriority: !
|
|
53
|
+
sizes: v,
|
|
54
|
+
loading: t.lazyLoadImages || s >= w ? "lazy" : void 0,
|
|
55
|
+
fetchpriority: !t.lazyLoadImages && s === 0 ? "high" : "low"
|
|
60
56
|
};
|
|
61
|
-
}, h = [],
|
|
62
|
-
if (typeof
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
57
|
+
}, h = [], K = (e) => {
|
|
58
|
+
if (typeof w == "string") return;
|
|
59
|
+
const s = h[e];
|
|
60
|
+
if (s && !s.src && (s.src = s.dataset.src || "", s.srcset = s.dataset.srcset || ""), e < w || e + 1 >= (t.images ?? []).length)
|
|
65
61
|
return;
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
e
|
|
70
|
-
|
|
62
|
+
const i = h[e + 1];
|
|
63
|
+
i && !i.src && (i.src = i?.dataset.src || "", i.srcset = i?.dataset.srcset || "");
|
|
64
|
+
}, W = (e) => {
|
|
65
|
+
e || !h?.[e] || C(() => {
|
|
66
|
+
y.value?.setAttribute("data-first-slide-loaded", "true"), g("firstSlideLoaded");
|
|
71
67
|
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
</div>`,
|
|
87
|
-
...typeof a.swiperParams.pagination == "boolean" ? {} : a.swiperParams.pagination
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
if (C.value) {
|
|
91
|
-
const { Navigation: t } = await import("../../../../../Swiper/navigation.js");
|
|
92
|
-
a.swiperParams.modules?.push(t);
|
|
93
|
-
const r = {
|
|
94
|
-
...s.swiperOptions.navigation.nextEl ?? {
|
|
95
|
-
nextEl: ".swiper-button-next"
|
|
96
|
-
},
|
|
97
|
-
...s.swiperOptions.navigation.prevEl ?? {
|
|
98
|
-
prevEl: ".swiper-button-prev"
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
a.swiperParams.navigation = {
|
|
102
|
-
...typeof s.swiperOptions.navigation == "object" ? s.swiperOptions.navigation : {},
|
|
103
|
-
...r
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
if (q.value) {
|
|
107
|
-
const { Autoplay: t } = await import("../../../../../Swiper/autoplay.js");
|
|
108
|
-
a.swiperParams.modules?.push(t), a.swiperParams.autoplay = s.swiperOptions.autoplay;
|
|
109
|
-
}
|
|
110
|
-
const e = {
|
|
111
|
-
...a.swiperParams,
|
|
112
|
-
on: {
|
|
113
|
-
init: () => {
|
|
114
|
-
j.value = !0, y("init");
|
|
68
|
+
}, Z = (e) => t.thumbSwiperOptions ? T(e, t.thumbSwiperOptions, [
|
|
69
|
+
ie(t.thumbSwiperOptions.freeMode)
|
|
70
|
+
]) : null, G = async (e, s) => {
|
|
71
|
+
const i = s ? await Z(s) : null;
|
|
72
|
+
u.value = await T(
|
|
73
|
+
e,
|
|
74
|
+
{
|
|
75
|
+
on: {
|
|
76
|
+
init: () => {
|
|
77
|
+
F.value = !0, g("init");
|
|
78
|
+
},
|
|
79
|
+
slideChange: (r) => {
|
|
80
|
+
K(r.activeIndex), g("moved", { activeIndex: r.activeIndex });
|
|
81
|
+
}
|
|
115
82
|
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
83
|
+
...i ? { thumbs: { swiper: i } } : {},
|
|
84
|
+
...t.swiperOptions
|
|
85
|
+
},
|
|
86
|
+
[
|
|
87
|
+
le(t.swiperOptions.zoom),
|
|
88
|
+
j ? re(t.swiperOptions.keyboard) : void 0,
|
|
89
|
+
I ? oe(t.swiperOptions.pagination) : void 0,
|
|
90
|
+
S ? ae(t.swiperOptions.navigation) : void 0,
|
|
91
|
+
q ? te(t.swiperOptions.autoplay) : void 0,
|
|
92
|
+
//Thumbs specific modules
|
|
93
|
+
i ? ne(t.swiperOptions.thumbs) : void 0,
|
|
94
|
+
i ? se(t.swiperOptions.controller) : void 0
|
|
95
|
+
].filter(Boolean)
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
x(() => {
|
|
99
|
+
y.value && setTimeout(() => G(y.value, A.value));
|
|
100
|
+
});
|
|
101
|
+
const H = (e) => {
|
|
102
|
+
!u.value || u.value.params.slidesPerView === e || (u.value.params.slidesPerView = e, u.value.update());
|
|
103
|
+
};
|
|
104
|
+
return _(
|
|
105
|
+
() => t.images,
|
|
138
106
|
() => {
|
|
139
|
-
|
|
140
|
-
|
|
107
|
+
C(() => {
|
|
108
|
+
u.value?.update();
|
|
141
109
|
});
|
|
142
110
|
}
|
|
143
111
|
), B({
|
|
144
|
-
swiper:
|
|
145
|
-
moveTo(e,
|
|
146
|
-
|
|
112
|
+
swiper: u,
|
|
113
|
+
moveTo(e, s = 0, i = !0) {
|
|
114
|
+
u.value?.slideTo(e, s, i);
|
|
147
115
|
},
|
|
148
|
-
updateSlidesPerView:
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
}), (e, i) => (u(), l("div", {
|
|
152
|
-
id: `root-${p.value}`,
|
|
153
|
-
ref_key: "root",
|
|
154
|
-
ref: L,
|
|
116
|
+
updateSlidesPerView: H
|
|
117
|
+
}), (e, s) => (l(), n("div", {
|
|
155
118
|
class: d(["swiper-carousel-root", e.$attrs["root-classes"]])
|
|
156
119
|
}, [
|
|
157
|
-
|
|
158
|
-
|
|
120
|
+
p("div", {
|
|
121
|
+
ref: "rootRef",
|
|
159
122
|
"data-cy": e.$attrs["data-cy"],
|
|
160
|
-
class: d(["swiper", e.$attrs["swiper-classes"]])
|
|
123
|
+
class: d(["swiper uikit-carousel", e.$attrs["swiper-classes"]])
|
|
161
124
|
}, [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
ref: S,
|
|
125
|
+
p("div", {
|
|
126
|
+
ref: "swiperWrapperRef",
|
|
165
127
|
class: d(["swiper-wrapper", [
|
|
166
128
|
e.$attrs["swiper-wrapper-classes"],
|
|
167
|
-
|
|
129
|
+
ee(E) === "none" && "no-transition"
|
|
168
130
|
]]),
|
|
169
|
-
onClick:
|
|
131
|
+
onClick: s[0] || (s[0] = (i) => g("click"))
|
|
170
132
|
}, [
|
|
171
|
-
|
|
172
|
-
(
|
|
173
|
-
key: `swiper_${
|
|
133
|
+
L(e.$slots, "default", {}, () => [
|
|
134
|
+
(l(!0), n(k, null, V(t.images, (i, r) => (l(), n("div", {
|
|
135
|
+
key: `swiper_${$.value}_${r}`,
|
|
174
136
|
class: d(["swiper-slide", e.$attrs["swiper-slide-classes"]])
|
|
175
137
|
}, [
|
|
176
|
-
|
|
138
|
+
p("div", {
|
|
177
139
|
class: d(["swiper-zoom-container", e.$attrs["swiper-zoom-container-classes"]])
|
|
178
140
|
}, [
|
|
179
|
-
|
|
141
|
+
t.backgroundImage ? b("", !0) : (l(), n("img", R({
|
|
180
142
|
key: 0,
|
|
181
143
|
ref_for: !0,
|
|
182
144
|
ref: (o) => {
|
|
183
145
|
h.push(o);
|
|
184
146
|
},
|
|
185
|
-
class: ["disable-select", [e.$attrs["slide-img-classes"] ||
|
|
186
|
-
"data-idx": `${
|
|
187
|
-
}, { ref_for: !0 },
|
|
188
|
-
alt:
|
|
147
|
+
class: ["disable-select", [e.$attrs["slide-img-classes"] || i.classes]],
|
|
148
|
+
"data-idx": `${$.value}-slide-img-${r}`
|
|
149
|
+
}, { ref_for: !0 }, P(i, r), {
|
|
150
|
+
alt: i.alt,
|
|
189
151
|
itemprop: "image",
|
|
190
|
-
width:
|
|
191
|
-
height:
|
|
192
|
-
onLoad: (o) =>
|
|
193
|
-
}), null, 16,
|
|
152
|
+
width: i.width,
|
|
153
|
+
height: i.height,
|
|
154
|
+
onLoad: (o) => W(r)
|
|
155
|
+
}), null, 16, ue))
|
|
194
156
|
], 2)
|
|
195
157
|
], 2))), 128)),
|
|
196
|
-
|
|
158
|
+
L(e.$slots, "last_slide", {}, void 0, !0)
|
|
197
159
|
], !0)
|
|
198
160
|
], 2),
|
|
199
|
-
I
|
|
161
|
+
I ? (l(), n("div", {
|
|
200
162
|
key: 0,
|
|
201
163
|
class: d([e.$attrs["swiper-pagination-classes"], "swiper-pagination [&.swiper-pagination-fraction]:uikit-flex [&.swiper-pagination-fraction]:uikit-justify-center"]),
|
|
202
|
-
onClick:
|
|
164
|
+
onClick: s[1] || (s[1] = O(() => {
|
|
203
165
|
}, ["stop"]))
|
|
204
|
-
}, null, 2)) :
|
|
205
|
-
|
|
206
|
-
|
|
166
|
+
}, null, 2)) : b("", !0),
|
|
167
|
+
S ? (l(), n(k, { key: 1 }, [
|
|
168
|
+
p("div", {
|
|
207
169
|
class: "swiper-button-prev",
|
|
208
170
|
"data-cy": "swiper-button-prev",
|
|
209
|
-
onClick:
|
|
171
|
+
onClick: s[2] || (s[2] = O(() => {
|
|
210
172
|
}, ["stop"]))
|
|
211
173
|
}),
|
|
212
|
-
|
|
174
|
+
p("div", {
|
|
213
175
|
class: "swiper-button-next",
|
|
214
176
|
"data-cy": "swiper-button-next",
|
|
215
|
-
onClick:
|
|
177
|
+
onClick: s[3] || (s[3] = O(() => {
|
|
216
178
|
}, ["stop"]))
|
|
217
179
|
})
|
|
218
|
-
], 64)) :
|
|
219
|
-
], 10,
|
|
220
|
-
|
|
180
|
+
], 64)) : b("", !0)
|
|
181
|
+
], 10, de),
|
|
182
|
+
t.thumbSwiperOptions ? (l(), n("div", {
|
|
221
183
|
key: 0,
|
|
222
|
-
|
|
223
|
-
thumbsSlider: "",
|
|
184
|
+
ref: "thumbsRef",
|
|
224
185
|
class: d(["swiper", e.$attrs["thumb-swiper-classes"]])
|
|
225
186
|
}, [
|
|
226
|
-
|
|
187
|
+
p("div", {
|
|
227
188
|
class: d(["swiper-wrapper", e.$attrs["thumb-swiper-wrapper-classes"]])
|
|
228
189
|
}, [
|
|
229
|
-
(
|
|
230
|
-
key: `thumb_${
|
|
190
|
+
(l(!0), n(k, null, V(t.images, (i, r) => (l(), n("div", {
|
|
191
|
+
key: `thumb_${$.value}_${r}`,
|
|
231
192
|
class: d(["swiper-slide", e.$attrs["thumb-img-wrapper-classes"]])
|
|
232
193
|
}, [
|
|
233
|
-
|
|
194
|
+
p("img", R({
|
|
234
195
|
class: e.$attrs["thumb-img-classes"]
|
|
235
|
-
}, { ref_for: !0 },
|
|
236
|
-
alt:
|
|
237
|
-
}), null, 16,
|
|
196
|
+
}, { ref_for: !0 }, P(i, -1, !1), {
|
|
197
|
+
alt: i.alt
|
|
198
|
+
}), null, 16, ce)
|
|
238
199
|
], 2))), 128))
|
|
239
200
|
], 2)
|
|
240
|
-
],
|
|
241
|
-
],
|
|
201
|
+
], 2)) : b("", !0)
|
|
202
|
+
], 2));
|
|
242
203
|
}
|
|
243
204
|
});
|
|
244
205
|
export {
|
|
245
|
-
|
|
206
|
+
ke as default
|
|
246
207
|
};
|
package/package.json
CHANGED
package/dist/Swiper/autoplay.js
DELETED
package/dist/Swiper/free-mode.js
DELETED
package/dist/Swiper/keyboard.js
DELETED
package/dist/Swiper/thumbs.js
DELETED
|
File without changes
|