@wikicasa-dev/components 2.6.7-alpha.3 → 2.6.7-alpha.5
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/SwiperRootPrimitive2.css +1 -1
- package/dist/components/carousel/Primitive/SwiperRootPrimitive.d.ts +2 -2
- package/dist/components/carousel/Primitive/SwiperRootPrimitive.js +5 -5
- package/dist/components/carousel/Primitive/SwiperRootPrimitive.vue.js +42 -46
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.swiper.uikit-carousel[data-v-
|
|
1
|
+
.swiper.uikit-carousel[data-v-269210e3]{opacity:0}.swiper.uikit-carousel.is-initialized[data-v-269210e3]{opacity:1}
|
|
@@ -16,7 +16,7 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
|
|
|
16
16
|
updateSlidesPerView: (value: number) => void;
|
|
17
17
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
18
|
click: () => any;
|
|
19
|
-
init: () => any;
|
|
19
|
+
init: (args_0: Swiper) => any;
|
|
20
20
|
moved: (args_0: {
|
|
21
21
|
activeIndex: number;
|
|
22
22
|
}) => any;
|
|
@@ -25,7 +25,7 @@ declare const __VLS_export: __VLS_WithSlots<import('vue').DefineComponent<{
|
|
|
25
25
|
swiperOptions?: SwiperRootPrimitiveProps;
|
|
26
26
|
}> & Readonly<{
|
|
27
27
|
onClick?: (() => any) | undefined;
|
|
28
|
-
onInit?: (() => any) | undefined;
|
|
28
|
+
onInit?: ((args_0: Swiper) => any) | undefined;
|
|
29
29
|
onMoved?: ((args_0: {
|
|
30
30
|
activeIndex: number;
|
|
31
31
|
}) => any) | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import o from "./SwiperRootPrimitive.vue.js";
|
|
2
|
-
import { addModuleDescriptorKey as d, setLazyImagesLoaderKey as
|
|
2
|
+
import { addModuleDescriptorKey as d, setLazyImagesLoaderKey as f } from "./SwiperRootPrimitive.vue.js";
|
|
3
3
|
import '../../../assets/SwiperRootPrimitive2.css';import '../../../assets/SwiperRootPrimitive.css';/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
6
|
+
const p = /* @__PURE__ */ e(o, [["__scopeId", "data-v-269210e3"]]);
|
|
7
7
|
export {
|
|
8
8
|
d as addModuleDescriptorKey,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
p as default,
|
|
10
|
+
f as setLazyImagesLoaderKey
|
|
11
11
|
};
|
|
@@ -1,25 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { createSwiper as
|
|
3
|
-
import { AutoplayModule as
|
|
4
|
-
import { KeyboardModule as
|
|
5
|
-
import { ZoomModule as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as A, shallowRef as y, useTemplateRef as N, onMounted as g, provide as I, openBlock as w, createElementBlock as P, createElementVNode as q, normalizeClass as x, renderSlot as k, createCommentVNode as B } from "vue";
|
|
2
|
+
import { createSwiper as D } from "../../../lazyModules/Swiper/factory.js";
|
|
3
|
+
import { AutoplayModule as K } from "../../../lazyModules/Swiper/Autoplay/factory.js";
|
|
4
|
+
import { KeyboardModule as R } from "../../../lazyModules/Swiper/Keyboard/factory.js";
|
|
5
|
+
import { ZoomModule as U } from "../../../lazyModules/Swiper/Zoom/factory.js";
|
|
6
|
+
const $ = { class: "uikit-relative" }, F = {
|
|
7
7
|
key: 0,
|
|
8
|
-
ref: "placeholder",
|
|
9
8
|
class: "uikit-absolute uikit-inset-0"
|
|
10
|
-
},
|
|
9
|
+
}, Z = /* @__PURE__ */ Symbol(), j = /* @__PURE__ */ Symbol(), Y = /* @__PURE__ */ A({
|
|
11
10
|
__name: "SwiperRootPrimitive",
|
|
12
11
|
props: {
|
|
13
12
|
rootClasses: {},
|
|
14
13
|
swiperOptions: {}
|
|
15
14
|
},
|
|
16
15
|
emits: ["moved", "click", "init"],
|
|
17
|
-
setup(a, { expose:
|
|
18
|
-
const
|
|
16
|
+
setup(a, { expose: b, emit: h }) {
|
|
17
|
+
const c = h, i = y(null), u = N("root"), n = y(!1), S = !!a.swiperOptions?.keyboard, T = !!a.swiperOptions?.autoplay, m = [];
|
|
19
18
|
let p = !1;
|
|
20
|
-
const
|
|
19
|
+
const E = (e) => {
|
|
21
20
|
"requestIdleCallback" in window ? requestIdleCallback(e) : setTimeout(e, 200);
|
|
22
|
-
}, v = (e, t = "img") => Array.from(e?.querySelectorAll(t) ?? []),
|
|
21
|
+
}, v = (e, t = "img") => Array.from(e?.querySelectorAll(t) ?? []), d = (e) => {
|
|
23
22
|
e.src || (e.src = e.dataset.src || "", e.srcset = e.dataset.srcset || "", e.dataset.src = "", e.dataset.srcset = "", e.removeAttribute("lazy"));
|
|
24
23
|
}, f = (e, t) => {
|
|
25
24
|
const o = e.params.lazyPreloadPrevNext ?? 0, r = v(e.slides[t]), l = [];
|
|
@@ -28,21 +27,18 @@ const U = { class: "uikit-relative" }, Z = {
|
|
|
28
27
|
...v(e.slides[s], "img[data-src]")
|
|
29
28
|
));
|
|
30
29
|
return { visibleImages: r, preloadImages: l };
|
|
31
|
-
},
|
|
30
|
+
}, C = async (e) => {
|
|
32
31
|
const t = e.complete && e.src ? Promise.resolve() : new Promise((o) => {
|
|
33
32
|
e.addEventListener("load", () => o(), { once: !0 }), e.addEventListener("error", () => o(), {
|
|
34
33
|
once: !0
|
|
35
34
|
});
|
|
36
35
|
});
|
|
37
|
-
|
|
36
|
+
d(e), await t, await e.decode?.().catch(() => {
|
|
38
37
|
});
|
|
39
|
-
}, O = (
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
n.value = !0, d("init");
|
|
44
|
-
}, M = async (e) => {
|
|
45
|
-
O(e), i.value = await R(
|
|
38
|
+
}, O = () => {
|
|
39
|
+
n.value = !0, c("init", i.value);
|
|
40
|
+
}, z = async (e) => {
|
|
41
|
+
i.value = await D(
|
|
46
42
|
e,
|
|
47
43
|
{
|
|
48
44
|
on: {
|
|
@@ -53,65 +49,65 @@ const U = { class: "uikit-relative" }, Z = {
|
|
|
53
49
|
);
|
|
54
50
|
let l;
|
|
55
51
|
const s = new Promise(
|
|
56
|
-
(
|
|
57
|
-
),
|
|
58
|
-
o.map(
|
|
52
|
+
(V) => l = setTimeout(V, 6e3)
|
|
53
|
+
), M = Promise.all(
|
|
54
|
+
o.map(C)
|
|
59
55
|
).finally(() => {
|
|
60
56
|
clearTimeout(l);
|
|
61
57
|
});
|
|
62
|
-
await Promise.race([
|
|
63
|
-
r.forEach(
|
|
64
|
-
}),
|
|
58
|
+
await Promise.race([M, s]), E(() => {
|
|
59
|
+
r.forEach(d);
|
|
60
|
+
}), O();
|
|
65
61
|
},
|
|
66
62
|
slideChange: (t) => {
|
|
67
|
-
|
|
63
|
+
c("moved", { activeIndex: t.activeIndex });
|
|
68
64
|
const { visibleImages: o, preloadImages: r } = f(
|
|
69
65
|
t,
|
|
70
66
|
t.activeIndex
|
|
71
67
|
);
|
|
72
68
|
[...o, ...r].forEach(
|
|
73
|
-
|
|
69
|
+
d
|
|
74
70
|
);
|
|
75
71
|
}
|
|
76
72
|
},
|
|
77
73
|
...a.swiperOptions
|
|
78
74
|
},
|
|
79
75
|
[
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
U(a.swiperOptions?.zoom),
|
|
77
|
+
S ? R(a.swiperOptions?.keyboard) : void 0,
|
|
78
|
+
T ? K(a.swiperOptions.autoplay) : void 0,
|
|
83
79
|
...m
|
|
84
80
|
].filter(Boolean)
|
|
85
81
|
);
|
|
86
82
|
};
|
|
87
|
-
|
|
88
|
-
u.value && setTimeout(() =>
|
|
83
|
+
g(() => {
|
|
84
|
+
u.value && setTimeout(() => z(u.value));
|
|
89
85
|
});
|
|
90
|
-
const
|
|
86
|
+
const L = (e) => {
|
|
91
87
|
!i.value || i.value.params.slidesPerView === e || (i.value.params.slidesPerView = e, i.value.update());
|
|
92
88
|
};
|
|
93
|
-
return
|
|
89
|
+
return I(j, (e) => {
|
|
94
90
|
e && m.push(e);
|
|
95
|
-
}),
|
|
91
|
+
}), I(Z, (e) => {
|
|
96
92
|
e !== p && (p = e);
|
|
97
|
-
}),
|
|
93
|
+
}), b({
|
|
98
94
|
swiper: i,
|
|
99
|
-
updateSlidesPerView:
|
|
100
|
-
}), (e, t) => (w(), P("div",
|
|
95
|
+
updateSlidesPerView: L
|
|
96
|
+
}), (e, t) => (w(), P("div", $, [
|
|
101
97
|
q("div", {
|
|
102
98
|
ref: "root",
|
|
103
|
-
class:
|
|
99
|
+
class: x(["swiper uikit-carousel", [{ "is-initialized": n.value }, a.rootClasses]])
|
|
104
100
|
}, [
|
|
105
101
|
k(e.$slots, "default", {}, void 0, !0)
|
|
106
102
|
], 2),
|
|
107
|
-
n.value ?
|
|
103
|
+
n.value ? B("", !0) : (w(), P("div", F, [
|
|
108
104
|
k(e.$slots, "placeholder", {}, void 0, !0)
|
|
109
|
-
]
|
|
105
|
+
]))
|
|
110
106
|
]));
|
|
111
107
|
}
|
|
112
108
|
});
|
|
113
109
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
110
|
+
j as addModuleDescriptorKey,
|
|
111
|
+
Y as default,
|
|
112
|
+
Z as setLazyImagesLoaderKey
|
|
117
113
|
};
|