@wikicasa-dev/components 2.1.15 → 2.1.17
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/assets/packages/components/lib/components/carousel/SwiperCarousel2.css +1 -1
- package/dist/components/carousel/SwiperCarousel.d.ts +4 -2
- package/dist/components/carousel/SwiperCarousel.js +2 -2
- package/dist/packages/components/lib/components/carousel/SwiperCarousel.vue.js +34 -34
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.no-transition[data-v-
|
|
1
|
+
.no-transition[data-v-e559a169]{transition-duration:0ms!important}.disable-select[data-v-e559a169]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-e559a169]{pointer-events:auto!important}
|
|
@@ -28,7 +28,7 @@ declare function __VLS_template(): {
|
|
|
28
28
|
};
|
|
29
29
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
30
30
|
declare const __VLS_component: import('vue').DefineComponent<SwiperCarouselProps, {
|
|
31
|
-
swiper: {
|
|
31
|
+
swiper: import('vue').ComputedRef<{
|
|
32
32
|
params: {
|
|
33
33
|
modules?: import('swiper/types').SwiperModule[] | undefined;
|
|
34
34
|
injectStyles?: string[] | undefined;
|
|
@@ -2312,7 +2312,7 @@ declare const __VLS_component: import('vue').DefineComponent<SwiperCarouselProps
|
|
|
2312
2312
|
addSlide: (index: number, slides: HTMLElement | string | string[] | HTMLElement[]) => void;
|
|
2313
2313
|
removeSlide: (slideIndex: number | number[]) => void;
|
|
2314
2314
|
removeAllSlides: () => void;
|
|
2315
|
-
} | null
|
|
2315
|
+
} | null>;
|
|
2316
2316
|
moveTo(index: number, speed?: number, runCallbacks?: boolean): void;
|
|
2317
2317
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
2318
2318
|
click: () => any;
|
|
@@ -2320,12 +2320,14 @@ declare const __VLS_component: import('vue').DefineComponent<SwiperCarouselProps
|
|
|
2320
2320
|
activeIndex: number;
|
|
2321
2321
|
}) => any;
|
|
2322
2322
|
firstSlideLoaded: () => any;
|
|
2323
|
+
init: () => any;
|
|
2323
2324
|
}, string, import('vue').PublicProps, Readonly<SwiperCarouselProps> & Readonly<{
|
|
2324
2325
|
onClick?: (() => any) | undefined;
|
|
2325
2326
|
onMoved?: ((args_0: {
|
|
2326
2327
|
activeIndex: number;
|
|
2327
2328
|
}) => any) | undefined;
|
|
2328
2329
|
onFirstSlideLoaded?: (() => any) | undefined;
|
|
2330
|
+
onInit?: (() => any) | undefined;
|
|
2329
2331
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
2330
2332
|
root: HTMLDivElement;
|
|
2331
2333
|
swiperWrapper: HTMLDivElement;
|
|
@@ -2,7 +2,7 @@ import o from "../../packages/components/lib/components/carousel/SwiperCarousel.
|
|
|
2
2
|
import '../../assets/packages/components/lib/components/carousel/SwiperCarousel2.css';import '../../assets/packages/components/lib/components/carousel/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-e559a169"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
m as default
|
|
8
8
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Q, reactive as U, ref as k, useId as X, computed as f, onMounted as Y, watch as x, nextTick as M, createElementBlock as l, openBlock as p, normalizeClass as u, createElementVNode as v, createCommentVNode as $, renderSlot as E, Fragment as P, renderList as F, mergeProps as T, withModifiers as O } from "vue";
|
|
2
2
|
import { Swiper as B } from "swiper";
|
|
3
|
-
import
|
|
3
|
+
import _ from "../../../../../node_modules/.pnpm/swiper@11.2.6/node_modules/swiper/modules/zoom.js";
|
|
4
4
|
import '../../../../../assets/node_modules/.pnpm/swiper@11.2.6/node_modules/swiper/modules/zoom.css';import '../../../../../assets/node_modules/.pnpm/swiper@11.2.6/node_modules/swiper/swiper.css';/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "../../../../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.js";
|
|
7
|
-
import { shallowCopyObjectTo as
|
|
7
|
+
import { shallowCopyObjectTo as ee } from "../../../../../node_modules/.pnpm/@wikicasa-dev_utilities@1.1.21/node_modules/@wikicasa-dev/utilities/dist/utils/ObjectUtils.js";
|
|
8
8
|
import "../../../../../_virtual/polyline.js";
|
|
9
|
-
const
|
|
9
|
+
const te = ["id"], se = ["id", "data-cy"], ie = ["data-idx", "alt", "width", "height", "onLoad"], ae = ["id"], re = ["alt"], me = /* @__PURE__ */ Q({
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "SwiperCarousel",
|
|
12
12
|
props: {
|
|
@@ -19,16 +19,16 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
19
19
|
artDirection: {},
|
|
20
20
|
shiftFirstImage: { type: Boolean, default: !1 }
|
|
21
21
|
},
|
|
22
|
-
emits: ["moved", "click", "firstSlideLoaded"],
|
|
22
|
+
emits: ["moved", "click", "firstSlideLoaded", "init"],
|
|
23
23
|
setup(s, { expose: D, emit: j }) {
|
|
24
|
-
const
|
|
25
|
-
swiperParams: { modules: [
|
|
24
|
+
const y = j, r = U({
|
|
25
|
+
swiperParams: { modules: [_] },
|
|
26
26
|
swiper: null,
|
|
27
27
|
initCarousel: !1
|
|
28
|
-
}), S = k(), A = k(!1), N =
|
|
28
|
+
}), S = k(), A = k(!1), N = X(), d = f(() => s.id ?? N), V = f(() => r.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(
|
|
29
29
|
() => s.swiperOptions?.effect || "slider"
|
|
30
|
-
),
|
|
31
|
-
s.swiperOptions &&
|
|
30
|
+
), R = () => {
|
|
31
|
+
s.swiperOptions && ee(s.swiperOptions, r.swiperParams);
|
|
32
32
|
}, z = (e, i = -1, t = !1) => {
|
|
33
33
|
if (!e.images)
|
|
34
34
|
return { src: e.src || "" };
|
|
@@ -46,8 +46,8 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
46
46
|
let n = e.images;
|
|
47
47
|
e.images.length > 3 ? n = e.images.slice(2, 5) : s.shiftFirstImage && (n[0] = n[1]), o = n.reduce((c, w, m) => (m === 0 && (a = `${w.storagePath}`), m > 0 && (c += ", "), `${c}${w.storagePath} ${m + 1}x`), "");
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
return typeof g.value == "number" && i > g.value ? (a = "", o = "", { sizes: b, "data-src":
|
|
49
|
+
const H = a, J = o;
|
|
50
|
+
return typeof g.value == "number" && i > g.value ? (a = "", o = "", { sizes: b, "data-src": H, "data-srcset": J }) : t ? {
|
|
51
51
|
src: a,
|
|
52
52
|
srcset: o,
|
|
53
53
|
sizes: b,
|
|
@@ -60,7 +60,7 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
60
60
|
loading: s.lazyLoadImages || i >= g.value ? "lazy" : void 0,
|
|
61
61
|
fetchpriority: !s.lazyLoadImages && i === 0 ? "high" : "low"
|
|
62
62
|
};
|
|
63
|
-
}, h = [],
|
|
63
|
+
}, h = [], Z = (e) => {
|
|
64
64
|
if (typeof g.value == "string") return;
|
|
65
65
|
const i = h[e];
|
|
66
66
|
if (i && !i.src && (i.src = i.dataset.src || "", i.srcset = i.dataset.srcset || ""), e < g.value || e + 1 >= (s.images ?? []).length)
|
|
@@ -69,18 +69,18 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
69
69
|
t && !t.src && (t.src = t?.dataset.src || "", t.srcset = t?.dataset.srcset || "");
|
|
70
70
|
};
|
|
71
71
|
D({
|
|
72
|
-
swiper:
|
|
72
|
+
swiper: V,
|
|
73
73
|
moveTo(e, i = 0, t = !0) {
|
|
74
74
|
r.swiper?.slideTo(e, i, t);
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
|
-
const L = k(null),
|
|
77
|
+
const L = k(null), G = (e) => {
|
|
78
78
|
e === 0 && h && h[e] && M(() => {
|
|
79
|
-
L.value?.setAttribute("data-first-slide-loaded", "true"),
|
|
79
|
+
L.value?.setAttribute("data-first-slide-loaded", "true"), y("firstSlideLoaded");
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
|
-
return
|
|
83
|
-
if (
|
|
82
|
+
return Y(async () => {
|
|
83
|
+
if (R(), W.value) {
|
|
84
84
|
const { Keyboard: t } = await import("../../../lazyModules/Swiper/keyboard.js");
|
|
85
85
|
r.swiperParams.modules?.push(t), r.swiperParams.keyboard = s.swiperOptions.keyboard;
|
|
86
86
|
}
|
|
@@ -112,7 +112,7 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
112
112
|
...a
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
|
-
if (
|
|
115
|
+
if (q.value) {
|
|
116
116
|
const { Autoplay: t } = await import("../../../lazyModules/Swiper/autoplay.js");
|
|
117
117
|
r.swiperParams.modules?.push(t), r.swiperParams.autoplay = s.swiperOptions.autoplay;
|
|
118
118
|
}
|
|
@@ -120,10 +120,10 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
120
120
|
...r.swiperParams,
|
|
121
121
|
on: {
|
|
122
122
|
init: () => {
|
|
123
|
-
A.value = !0;
|
|
123
|
+
A.value = !0, y("init");
|
|
124
124
|
},
|
|
125
125
|
slideChange: (t) => {
|
|
126
|
-
|
|
126
|
+
Z(t.activeIndex), y("moved", { activeIndex: t.activeIndex });
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
};
|
|
@@ -142,7 +142,7 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
144
|
e.lazyPreloadPrevNext = 1, r.swiper = new B(`#${d.value}`, e), S.value?.classList.remove("uikit-hidden");
|
|
145
|
-
}),
|
|
145
|
+
}), x(
|
|
146
146
|
() => s.images,
|
|
147
147
|
() => {
|
|
148
148
|
M(() => {
|
|
@@ -165,9 +165,9 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
165
165
|
ref: S,
|
|
166
166
|
class: u(["swiper-wrapper", [
|
|
167
167
|
e.$attrs["swiper-wrapper-classes"],
|
|
168
|
-
|
|
168
|
+
K.value === "none" && "no-transition"
|
|
169
169
|
]]),
|
|
170
|
-
onClick: i[0] || (i[0] = (t) =>
|
|
170
|
+
onClick: i[0] || (i[0] = (t) => y("click"))
|
|
171
171
|
}, [
|
|
172
172
|
E(e.$slots, "default", {}, () => [
|
|
173
173
|
(p(!0), l(P, null, F(e.images, (t, a) => (p(), l("div", {
|
|
@@ -177,7 +177,7 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
177
177
|
v("div", {
|
|
178
178
|
class: u(["swiper-zoom-container", e.$attrs["swiper-zoom-container-classes"]])
|
|
179
179
|
}, [
|
|
180
|
-
e.backgroundImage ?
|
|
180
|
+
e.backgroundImage ? $("", !0) : (p(), l("img", T({
|
|
181
181
|
key: 0,
|
|
182
182
|
ref_for: !0,
|
|
183
183
|
ref: (o) => {
|
|
@@ -190,8 +190,8 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
190
190
|
itemprop: "image",
|
|
191
191
|
width: t.width,
|
|
192
192
|
height: t.height,
|
|
193
|
-
onLoad: (o) =>
|
|
194
|
-
}), null, 16,
|
|
193
|
+
onLoad: (o) => G(a)
|
|
194
|
+
}), null, 16, ie))
|
|
195
195
|
], 2)
|
|
196
196
|
], 2))), 128)),
|
|
197
197
|
E(e.$slots, "last_slide", {}, void 0, !0)
|
|
@@ -202,7 +202,7 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
202
202
|
class: u([e.$attrs["swiper-pagination-classes"], "swiper-pagination [&.swiper-pagination-fraction]:uikit-flex [&.swiper-pagination-fraction]:uikit-justify-center"]),
|
|
203
203
|
onClick: i[1] || (i[1] = O(() => {
|
|
204
204
|
}, ["stop"]))
|
|
205
|
-
}, null, 2)) :
|
|
205
|
+
}, null, 2)) : $("", !0),
|
|
206
206
|
C.value ? (p(), l(P, { key: 1 }, [
|
|
207
207
|
v("div", {
|
|
208
208
|
class: "swiper-button-prev",
|
|
@@ -216,8 +216,8 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
216
216
|
onClick: i[3] || (i[3] = O(() => {
|
|
217
217
|
}, ["stop"]))
|
|
218
218
|
})
|
|
219
|
-
], 64)) :
|
|
220
|
-
], 10,
|
|
219
|
+
], 64)) : $("", !0)
|
|
220
|
+
], 10, se),
|
|
221
221
|
e.thumbSwiperOptions ? (p(), l("div", {
|
|
222
222
|
key: 0,
|
|
223
223
|
id: `thumb_${d.value}`,
|
|
@@ -236,13 +236,13 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
|
|
|
236
236
|
ref_for: !0
|
|
237
237
|
}, z(t, -1, !1), {
|
|
238
238
|
alt: t.alt
|
|
239
|
-
}), null, 16,
|
|
239
|
+
}), null, 16, re)
|
|
240
240
|
], 2))), 128))
|
|
241
241
|
], 2)
|
|
242
|
-
], 10,
|
|
243
|
-
], 10,
|
|
242
|
+
], 10, ae)) : $("", !0)
|
|
243
|
+
], 10, te));
|
|
244
244
|
}
|
|
245
245
|
});
|
|
246
246
|
export {
|
|
247
|
-
|
|
247
|
+
me as default
|
|
248
248
|
};
|