@wikicasa-dev/components 2.4.2-alpha.6 → 2.4.2-alpha.8
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/factory.js +6 -6
- package/dist/Swiper/Thumbs/index.js +1 -1
- package/dist/Swiper/factory.js +9 -28
- package/dist/assets/SwiperCarousel2.css +1 -1
- package/dist/components/carousel/SwiperCarousel.d.ts +2 -4
- package/dist/components/carousel/SwiperCarousel.js +2 -2
- package/dist/packages/components/lib/components/carousel/SwiperCarousel.vue.js +62 -61
- package/package.json +1 -1
- /package/dist/assets/{swiper-keyboard.css → swiper-controller.css} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
loader: () => import("./index.js").then((
|
|
3
|
-
|
|
4
|
-
thumbs:
|
|
5
|
-
}
|
|
1
|
+
const o = (t) => ({
|
|
2
|
+
loader: () => import("./index.js").then((e) => e.default),
|
|
3
|
+
...t ? {
|
|
4
|
+
options: { thumbs: t }
|
|
5
|
+
} : {}
|
|
6
6
|
});
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
o as ThumbsModule
|
|
9
9
|
};
|
package/dist/Swiper/factory.js
CHANGED
|
@@ -1,34 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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([
|
|
1
|
+
const a = async (o, r, s) => {
|
|
2
|
+
const i = s.map((e) => e.loader()), [{ Swiper: n }, ...p] = await Promise.all([
|
|
19
3
|
import("./index.js"),
|
|
20
|
-
...
|
|
21
|
-
]),
|
|
22
|
-
(
|
|
23
|
-
{
|
|
24
|
-
...e,
|
|
25
|
-
modules: i
|
|
26
|
-
}
|
|
4
|
+
...i
|
|
5
|
+
]), t = s.reduce(
|
|
6
|
+
(e, c) => Object.assign(e, c.options),
|
|
7
|
+
{ ...r, modules: p }
|
|
27
8
|
);
|
|
28
9
|
return console.log("DEBUG:createSwiper", {
|
|
29
|
-
container:
|
|
30
|
-
options:
|
|
31
|
-
}), new
|
|
10
|
+
container: o,
|
|
11
|
+
options: t
|
|
12
|
+
}), new n(o, t);
|
|
32
13
|
};
|
|
33
14
|
export {
|
|
34
15
|
a as createSwiper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.no-transition[data-v-
|
|
1
|
+
.no-transition[data-v-6fb3d4e8]{transition-duration:0ms!important}.disable-select[data-v-6fb3d4e8]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-6fb3d4e8]{pointer-events:auto!important}
|
|
@@ -20,8 +20,7 @@ declare function __VLS_template(): {
|
|
|
20
20
|
last_slide?(_: {}): any;
|
|
21
21
|
};
|
|
22
22
|
refs: {
|
|
23
|
-
|
|
24
|
-
swiperWrapperRef: HTMLDivElement;
|
|
23
|
+
swiperRef: HTMLDivElement;
|
|
25
24
|
thumbsRef: HTMLDivElement;
|
|
26
25
|
};
|
|
27
26
|
rootEl: any;
|
|
@@ -46,8 +45,7 @@ declare const __VLS_component: import('vue').DefineComponent<SwiperCarouselProps
|
|
|
46
45
|
}) => any) | undefined;
|
|
47
46
|
onFirstSlideLoaded?: (() => any) | undefined;
|
|
48
47
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
49
|
-
|
|
50
|
-
swiperWrapperRef: HTMLDivElement;
|
|
48
|
+
swiperRef: HTMLDivElement;
|
|
51
49
|
thumbsRef: HTMLDivElement;
|
|
52
50
|
}, any>;
|
|
53
51
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -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-6fb3d4e8"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createSwiper as
|
|
1
|
+
import { defineComponent as W, 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 d, createElementVNode as p, createCommentVNode as $, unref as ee, renderSlot as L, Fragment as k, renderList as V, mergeProps as B, withModifiers as O } from "vue";
|
|
2
|
+
import { createSwiper as R } 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"],
|
|
10
|
+
const le = ["id", "data-cy"], de = ["data-idx", "alt", "width", "height", "onLoad"], ue = ["id"], ce = ["alt"], ye = /* @__PURE__ */ W({
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
__name: "SwiperCarousel",
|
|
13
13
|
props: {
|
|
@@ -22,68 +22,68 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
22
22
|
},
|
|
23
23
|
emits: ["moved", "click", "firstSlideLoaded", "init"],
|
|
24
24
|
setup(t, { expose: T, emit: D }) {
|
|
25
|
-
const
|
|
25
|
+
const h = D, u = z(null), y = C("swiperRef"), A = C("thumbsRef"), F = z(!1), N = X(), w = Y(() => t.id ?? N), v = 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
|
-
let r = "", o = "",
|
|
28
|
+
let r = "", o = "", g = "";
|
|
29
29
|
if (t.artDirection) {
|
|
30
30
|
for (const a in t.artDirection) {
|
|
31
|
-
const { mq: c, width:
|
|
32
|
-
|
|
31
|
+
const { mq: c, width: m } = t.artDirection[a];
|
|
32
|
+
m && (g += g ? `,${c} ${parseInt(m)}px` : `${c} ${parseInt(m)}px`);
|
|
33
33
|
}
|
|
34
|
-
o = e.images.reduce((a, c,
|
|
35
|
-
const
|
|
36
|
-
return !
|
|
34
|
+
o = e.images.reduce((a, c, m) => {
|
|
35
|
+
const f = Object.values(t.artDirection)[m];
|
|
36
|
+
return !f || !f.width || (a += a ? `, ${c.storagePath} ${f.width}` : `${c.storagePath} ${f.width}`), a;
|
|
37
37
|
}, ""), r = e.images[0].storagePath;
|
|
38
38
|
} else {
|
|
39
39
|
let a = e.images;
|
|
40
|
-
e.images.length > 3 ? a = e.images.slice(2, 5) : t.shiftFirstImage && (a[0] = a[1]), o = a.reduce((c,
|
|
40
|
+
e.images.length > 3 ? a = e.images.slice(2, 5) : t.shiftFirstImage && (a[0] = a[1]), o = a.reduce((c, m, f) => (f === 0 && (r = `${m.storagePath}`), f > 0 && (c += ", "), `${c}${m.storagePath} ${f + 1}x`), "");
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
return typeof
|
|
42
|
+
const J = r, Q = o;
|
|
43
|
+
return typeof v == "number" && s > v ? (r = "", o = "", { sizes: g, "data-src": J, "data-srcset": Q }) : i ? {
|
|
44
44
|
src: r,
|
|
45
45
|
srcset: o,
|
|
46
|
-
sizes:
|
|
46
|
+
sizes: g,
|
|
47
47
|
loading: "lazy",
|
|
48
48
|
fetchpriority: "low"
|
|
49
49
|
} : {
|
|
50
50
|
src: r,
|
|
51
51
|
srcset: o,
|
|
52
|
-
sizes:
|
|
53
|
-
loading: t.lazyLoadImages || s >=
|
|
52
|
+
sizes: g,
|
|
53
|
+
loading: t.lazyLoadImages || s >= v ? "lazy" : void 0,
|
|
54
54
|
fetchpriority: !t.lazyLoadImages && s === 0 ? "high" : "low"
|
|
55
55
|
};
|
|
56
|
-
},
|
|
57
|
-
if (typeof
|
|
58
|
-
const s =
|
|
59
|
-
if (s && !s.src && (s.src = s.dataset.src || "", s.srcset = s.dataset.srcset || ""), e <
|
|
56
|
+
}, b = [], K = (e) => {
|
|
57
|
+
if (typeof v == "string") return;
|
|
58
|
+
const s = b[e];
|
|
59
|
+
if (s && !s.src && (s.src = s.dataset.src || "", s.srcset = s.dataset.srcset || ""), e < v || e + 1 >= (t.images ?? []).length)
|
|
60
60
|
return;
|
|
61
|
-
const i =
|
|
61
|
+
const i = b[e + 1];
|
|
62
62
|
i && !i.src && (i.src = i?.dataset.src || "", i.srcset = i?.dataset.srcset || "");
|
|
63
63
|
}, U = (e) => {
|
|
64
|
-
e || !
|
|
65
|
-
y.value?.setAttribute("data-first-slide-loaded", "true"),
|
|
64
|
+
e || !b?.[e] || M(() => {
|
|
65
|
+
y.value?.setAttribute("data-first-slide-loaded", "true"), h("firstSlideLoaded");
|
|
66
66
|
});
|
|
67
|
-
},
|
|
67
|
+
}, Z = (e) => t.thumbSwiperOptions ? R(e, t.thumbSwiperOptions, [
|
|
68
68
|
se(t.thumbSwiperOptions.freeMode)
|
|
69
|
-
]) : null,
|
|
69
|
+
]) : null, E = async (e, s) => {
|
|
70
70
|
console.log("DEBUG:SwiperCarousel", {
|
|
71
71
|
rootEl: e,
|
|
72
72
|
thumbEl: s
|
|
73
73
|
});
|
|
74
|
-
const i = s ? await
|
|
75
|
-
|
|
74
|
+
const i = s ? await Z(s) : null;
|
|
75
|
+
u.value = await R(
|
|
76
76
|
e,
|
|
77
77
|
{
|
|
78
78
|
on: {
|
|
79
79
|
init: () => {
|
|
80
|
-
F.value = !0,
|
|
80
|
+
F.value = !0, h("init");
|
|
81
81
|
},
|
|
82
82
|
slideChange: (r) => {
|
|
83
|
-
K(r.activeIndex),
|
|
83
|
+
K(r.activeIndex), h("moved", { activeIndex: r.activeIndex });
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
...i ? { thumbs: { swiper: i } } : {},
|
|
86
|
+
...i ? { thumbs: { ...t.swiperOptions.thumbs, swiper: i } } : {},
|
|
87
87
|
...t.swiperOptions
|
|
88
88
|
},
|
|
89
89
|
[
|
|
@@ -93,68 +93,68 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
93
93
|
S ? re(t.swiperOptions.navigation) : void 0,
|
|
94
94
|
q ? te(t.swiperOptions.autoplay) : void 0,
|
|
95
95
|
//Thumbs specific modules
|
|
96
|
-
i ? oe(
|
|
96
|
+
i ? oe() : void 0
|
|
97
97
|
].filter(Boolean)
|
|
98
98
|
);
|
|
99
99
|
};
|
|
100
100
|
x(() => {
|
|
101
|
-
y.value && setTimeout(() =>
|
|
101
|
+
y.value && setTimeout(() => E(y.value, A.value));
|
|
102
102
|
});
|
|
103
|
-
const
|
|
104
|
-
!
|
|
103
|
+
const H = (e) => {
|
|
104
|
+
!u.value || u.value.params.slidesPerView === e || (u.value.params.slidesPerView = e, u.value.update());
|
|
105
105
|
};
|
|
106
106
|
return _(
|
|
107
107
|
() => t.images,
|
|
108
108
|
() => {
|
|
109
109
|
M(() => {
|
|
110
|
-
|
|
110
|
+
u.value?.update();
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
), T({
|
|
114
|
-
swiper:
|
|
114
|
+
swiper: u,
|
|
115
115
|
moveTo(e, s = 0, i = !0) {
|
|
116
|
-
|
|
116
|
+
u.value?.slideTo(e, s, i);
|
|
117
117
|
},
|
|
118
|
-
updateSlidesPerView:
|
|
118
|
+
updateSlidesPerView: H
|
|
119
119
|
}), (e, s) => (l(), n("div", {
|
|
120
|
-
class:
|
|
120
|
+
class: d(["swiper-carousel-root", e.$attrs["root-classes"]])
|
|
121
121
|
}, [
|
|
122
122
|
p("div", {
|
|
123
|
-
ref: "
|
|
123
|
+
ref: "swiperRef",
|
|
124
|
+
id: w.value,
|
|
124
125
|
"data-cy": e.$attrs["data-cy"],
|
|
125
|
-
class:
|
|
126
|
+
class: d(["swiper uikit-carousel", e.$attrs["swiper-classes"]])
|
|
126
127
|
}, [
|
|
127
128
|
p("div", {
|
|
128
|
-
|
|
129
|
-
class: u(["swiper-wrapper", [
|
|
129
|
+
class: d(["swiper-wrapper", [
|
|
130
130
|
e.$attrs["swiper-wrapper-classes"],
|
|
131
131
|
ee(G) === "none" && "no-transition"
|
|
132
132
|
]]),
|
|
133
|
-
onClick: s[0] || (s[0] = (i) =>
|
|
133
|
+
onClick: s[0] || (s[0] = (i) => h("click"))
|
|
134
134
|
}, [
|
|
135
135
|
L(e.$slots, "default", {}, () => [
|
|
136
136
|
(l(!0), n(k, null, V(t.images, (i, r) => (l(), n("div", {
|
|
137
|
-
key: `swiper_${
|
|
138
|
-
class:
|
|
137
|
+
key: `swiper_${w.value}_${r}`,
|
|
138
|
+
class: d(["swiper-slide", e.$attrs["swiper-slide-classes"]])
|
|
139
139
|
}, [
|
|
140
140
|
p("div", {
|
|
141
|
-
class:
|
|
141
|
+
class: d(["swiper-zoom-container", e.$attrs["swiper-zoom-container-classes"]])
|
|
142
142
|
}, [
|
|
143
|
-
t.backgroundImage ?
|
|
143
|
+
t.backgroundImage ? $("", !0) : (l(), n("img", B({
|
|
144
144
|
key: 0,
|
|
145
145
|
ref_for: !0,
|
|
146
146
|
ref: (o) => {
|
|
147
|
-
|
|
147
|
+
b.push(o);
|
|
148
148
|
},
|
|
149
149
|
class: ["disable-select", [e.$attrs["slide-img-classes"] || i.classes]],
|
|
150
|
-
"data-idx": `${
|
|
150
|
+
"data-idx": `${w.value}-slide-img-${r}`
|
|
151
151
|
}, { ref_for: !0 }, P(i, r), {
|
|
152
152
|
alt: i.alt,
|
|
153
153
|
itemprop: "image",
|
|
154
154
|
width: i.width,
|
|
155
155
|
height: i.height,
|
|
156
156
|
onLoad: (o) => U(r)
|
|
157
|
-
}), null, 16,
|
|
157
|
+
}), null, 16, de))
|
|
158
158
|
], 2)
|
|
159
159
|
], 2))), 128)),
|
|
160
160
|
L(e.$slots, "last_slide", {}, void 0, !0)
|
|
@@ -162,10 +162,10 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
162
162
|
], 2),
|
|
163
163
|
I ? (l(), n("div", {
|
|
164
164
|
key: 0,
|
|
165
|
-
class:
|
|
165
|
+
class: d([e.$attrs["swiper-pagination-classes"], "swiper-pagination [&.swiper-pagination-fraction]:uikit-flex [&.swiper-pagination-fraction]:uikit-justify-center"]),
|
|
166
166
|
onClick: s[1] || (s[1] = O(() => {
|
|
167
167
|
}, ["stop"]))
|
|
168
|
-
}, null, 2)) :
|
|
168
|
+
}, null, 2)) : $("", !0),
|
|
169
169
|
S ? (l(), n(k, { key: 1 }, [
|
|
170
170
|
p("div", {
|
|
171
171
|
class: "swiper-button-prev",
|
|
@@ -179,29 +179,30 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
|
|
|
179
179
|
onClick: s[3] || (s[3] = O(() => {
|
|
180
180
|
}, ["stop"]))
|
|
181
181
|
})
|
|
182
|
-
], 64)) :
|
|
182
|
+
], 64)) : $("", !0)
|
|
183
183
|
], 10, le),
|
|
184
184
|
t.thumbSwiperOptions ? (l(), n("div", {
|
|
185
185
|
key: 0,
|
|
186
|
+
id: `thumb_${w.value}`,
|
|
186
187
|
ref: "thumbsRef",
|
|
187
|
-
class:
|
|
188
|
+
class: d(["swiper", e.$attrs["thumb-swiper-classes"]]),
|
|
188
189
|
thumbsSlider: ""
|
|
189
190
|
}, [
|
|
190
191
|
p("div", {
|
|
191
|
-
class:
|
|
192
|
+
class: d(["swiper-wrapper", e.$attrs["thumb-swiper-wrapper-classes"]])
|
|
192
193
|
}, [
|
|
193
194
|
(l(!0), n(k, null, V(t.images, (i, r) => (l(), n("div", {
|
|
194
|
-
key: `thumb_${
|
|
195
|
-
class:
|
|
195
|
+
key: `thumb_${w.value}_${r}`,
|
|
196
|
+
class: d(["swiper-slide", e.$attrs["thumb-img-wrapper-classes"]])
|
|
196
197
|
}, [
|
|
197
|
-
p("img",
|
|
198
|
+
p("img", B({
|
|
198
199
|
class: e.$attrs["thumb-img-classes"]
|
|
199
200
|
}, { ref_for: !0 }, P(i, -1, !1), {
|
|
200
201
|
alt: i.alt
|
|
201
|
-
}), null, 16,
|
|
202
|
+
}), null, 16, ce)
|
|
202
203
|
], 2))), 128))
|
|
203
204
|
], 2)
|
|
204
|
-
],
|
|
205
|
+
], 10, ue)) : $("", !0)
|
|
205
206
|
], 2));
|
|
206
207
|
}
|
|
207
208
|
});
|
package/package.json
CHANGED
|
File without changes
|