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