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