@wikicasa-dev/components 2.5.3-alpha.10 → 2.5.3-alpha.12

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.
@@ -1,4 +1,4 @@
1
- import '../../assets/swiper-thumbs.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.css';/* empty css */
2
2
  import { Autoplay as p } from "swiper/modules";
3
3
  export {
4
4
  p as default
@@ -1,4 +1,4 @@
1
- import '../../assets/swiper-thumbs.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.css';/* empty css */
2
2
  import { Controller as e } from "swiper/modules";
3
3
  export {
4
4
  e as default
@@ -1,4 +1,4 @@
1
- import '../../assets/swiper-thumbs.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.css';/* empty css */
2
2
  import { Keyboard as e } from "swiper/modules";
3
3
  export {
4
4
  e as default
@@ -1,4 +1,4 @@
1
- import '../../assets/swiper-thumbs.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.css';/* empty css */
2
2
  import { Thumbs as t } from "swiper/modules";
3
3
  export {
4
4
  t as default
@@ -10,7 +10,8 @@ export interface SwiperSlideImagePrimitiveProps {
10
10
  decoding?: "auto" | "sync" | "async";
11
11
  crossorigin?: "anonymous" | "use-credentials";
12
12
  fetchpriority?: "auto" | "high" | "low";
13
+ loading?: "lazy" | "eager";
13
14
  lazy?: boolean;
14
15
  }
15
- declare const _default: import('vue').DefineComponent<SwiperSlideImagePrimitiveProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SwiperSlideImagePrimitiveProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: import('vue').DefineComponent<SwiperSlideImagePrimitiveProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SwiperSlideImagePrimitiveProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
16
17
  export default _default;
@@ -1,77 +1,95 @@
1
- import { defineComponent as I, useAttrs as O, shallowRef as m, useTemplateRef as V, onMounted as b, provide as p, createElementBlock as x, openBlock as z, Fragment as A, withDirectives as M, renderSlot as f, createCommentVNode as C, createElementVNode as E, mergeProps as B, unref as D, vShow as K, nextTick as L } from "vue";
2
- import { createSwiper as N } from "../../../../../../Swiper/factory.js";
1
+ import { defineComponent as k, useAttrs as O, shallowRef as p, useTemplateRef as E, onMounted as L, provide as v, createElementBlock as b, openBlock as M, Fragment as V, withDirectives as x, renderSlot as f, createCommentVNode as z, createElementVNode as A, mergeProps as N, unref as C, vShow as B, nextTick as D } from "vue";
2
+ import { createSwiper as K } from "../../../../../../Swiper/factory.js";
3
3
  import { AutoplayModule as R } from "../../../../../../Swiper/Autoplay/factory.js";
4
- import { KeyboardModule as T } from "../../../../../../Swiper/Keyboard/factory.js";
4
+ import { KeyboardModule as U } from "../../../../../../Swiper/Keyboard/factory.js";
5
5
  import { ZoomModule as $ } from "../../../../../../Swiper/Zoom/factory.js";
6
- const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), Q = /* @__PURE__ */ I({
6
+ const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), W = /* @__PURE__ */ k({
7
7
  inheritAttrs: !1,
8
8
  __name: "SwiperRootPrimitive",
9
9
  props: {
10
10
  swiperOptions: {}
11
11
  },
12
12
  emits: ["moved", "click", "init"],
13
- setup(r, { expose: v, emit: y }) {
14
- const n = y, w = O(), i = m(null), d = V("root"), s = m(!1), S = !!r.swiperOptions?.keyboard, h = !!r.swiperOptions?.autoplay, c = [];
15
- let a = !1;
16
- const k = (e) => {
17
- e?.querySelectorAll("img[data-src]").forEach((t) => {
18
- const o = t;
19
- o.src = o.dataset.src || "", o.srcset = o.dataset.srcset || "";
20
- });
21
- }, u = (e, t) => {
22
- if (!a) return;
23
- const o = e.params.lazyPreloadPrevNext ?? 0;
24
- for (let l = t - o; l <= t + o; l++)
25
- k(e.slides[l]);
26
- }, P = async (e) => {
27
- i.value = await N(
13
+ setup(s, { expose: y, emit: w }) {
14
+ const l = w, P = O(), a = p(null), c = E("root"), n = p(!1), I = !!s.swiperOptions?.keyboard, T = !!s.swiperOptions?.autoplay, u = [];
15
+ let d = !1;
16
+ const S = (e) => {
17
+ const t = [
18
+ ...e?.querySelectorAll("img[data-src]") ?? []
19
+ ];
20
+ return t.forEach((o) => {
21
+ o.src = o.dataset.src || "", o.srcset = o.dataset.srcset || "", o.dataset.src = "", o.dataset.srcset = "", o.removeAttribute("lazy");
22
+ }), t;
23
+ }, m = (e, t) => {
24
+ const o = [];
25
+ if (!d) return o;
26
+ const r = e.params.lazyPreloadPrevNext ?? 0;
27
+ for (let i = t - r; i <= t + r; i++)
28
+ o.push(...S(e.slides[i]));
29
+ return o;
30
+ }, h = async (e) => {
31
+ a.value = await K(
28
32
  e,
29
33
  {
30
34
  on: {
31
35
  init: (t) => {
32
- L(() => {
33
- s.value = !0, u(t, t.activeIndex), n("init");
36
+ D(async () => {
37
+ const o = m(t, t.activeIndex);
38
+ if (!o.length) {
39
+ n.value = !0, l("init");
40
+ return;
41
+ }
42
+ await Promise.race([
43
+ Promise.all(
44
+ o.map(
45
+ (r) => r.complete ? Promise.resolve() : new Promise((i) => {
46
+ r.addEventListener("load", i, { once: !0 }), r.addEventListener("error", i, { once: !0 });
47
+ })
48
+ )
49
+ ),
50
+ new Promise((r) => setTimeout(r, 3e3))
51
+ ]), n.value = !0, l("init");
34
52
  });
35
53
  },
36
54
  slideChange: (t) => {
37
- n("moved", { activeIndex: t.activeIndex }), u(t, t.activeIndex);
55
+ l("moved", { activeIndex: t.activeIndex }), m(t, t.activeIndex);
38
56
  }
39
57
  },
40
- ...r.swiperOptions
58
+ ...s.swiperOptions
41
59
  },
42
60
  [
43
- $(r.swiperOptions?.zoom),
44
- S ? T(r.swiperOptions?.keyboard) : void 0,
45
- h ? R(r.swiperOptions.autoplay) : void 0,
46
- ...c
61
+ $(s.swiperOptions?.zoom),
62
+ I ? U(s.swiperOptions?.keyboard) : void 0,
63
+ T ? R(s.swiperOptions.autoplay) : void 0,
64
+ ...u
47
65
  ].filter(Boolean)
48
66
  );
49
67
  };
50
- b(() => {
51
- d.value && setTimeout(() => P(d.value));
68
+ L(() => {
69
+ c.value && setTimeout(() => h(c.value));
52
70
  });
53
71
  const g = (e) => {
54
- !i.value || i.value.params.slidesPerView === e || (i.value.params.slidesPerView = e, i.value.update());
72
+ !a.value || a.value.params.slidesPerView === e || (a.value.params.slidesPerView = e, a.value.update());
55
73
  };
56
- return p(F, (e) => {
57
- e && c.push(e);
58
- }), p(q, (e) => {
59
- e !== a && (a = e);
60
- }), v({
61
- swiper: i,
74
+ return v(F, (e) => {
75
+ e && u.push(e);
76
+ }), v(q, (e) => {
77
+ e !== d && (d = e);
78
+ }), y({
79
+ swiper: a,
62
80
  updateSlidesPerView: g
63
- }), (e, t) => (z(), x(A, null, [
64
- M(E("div", B({ ref: "root" }, D(w), { class: "swiper uikit-carousel" }), [
81
+ }), (e, t) => (M(), b(V, null, [
82
+ x(A("div", N({ ref: "root" }, C(P), { class: "swiper uikit-carousel" }), [
65
83
  f(e.$slots, "default")
66
84
  ], 16), [
67
- [K, s.value]
85
+ [B, n.value]
68
86
  ]),
69
- s.value ? C("", !0) : f(e.$slots, "placeholder", { key: 0 })
87
+ n.value ? z("", !0) : f(e.$slots, "placeholder", { key: 0 })
70
88
  ], 64));
71
89
  }
72
90
  });
73
91
  export {
74
92
  F as addModuleDescriptorKey,
75
- Q as default,
93
+ W as default,
76
94
  q as setLazyImagesLoaderKey
77
95
  };
@@ -1,5 +1,6 @@
1
- import { defineComponent as i, createPropsRestProxy as l, shallowRef as r, inject as n, resolveComponent as d, createBlock as m, openBlock as u, withCtx as g, createElementVNode as y, mergeProps as f } from "vue";
2
- import { setLazyImagesLoaderKey as v } from "./SwiperRootPrimitive.vue.js";
1
+ import { defineComponent as i, createPropsRestProxy as o, shallowRef as r, inject as l, createBlock as d, openBlock as n, withCtx as m, createElementVNode as g, mergeProps as u } from "vue";
2
+ import f from "../../../../../../components/carousel/SwiperSlide.js";
3
+ import { setLazyImagesLoaderKey as y } from "./SwiperRootPrimitive.vue.js";
3
4
  import '../../../../../../assets/SwiperRootPrimitive.css';/* empty css */
4
5
  const h = ["src", "srcset", "data-src", "data-srcset"], x = /* @__PURE__ */ i({
5
6
  __name: "SwiperSlideImagePrimitive",
@@ -14,25 +15,23 @@ const h = ["src", "srcset", "data-src", "data-srcset"], x = /* @__PURE__ */ i({
14
15
  decoding: {},
15
16
  crossorigin: {},
16
17
  fetchpriority: {},
18
+ loading: {},
17
19
  lazy: { type: Boolean }
18
20
  },
19
21
  setup(e) {
20
- const s = l(e, ["src", "srcset", "imgClasses"]), t = r(), a = r(), c = n(v, void 0);
21
- return s.lazy && (t.value = e.src, a.value = e.srcset, c?.(!0)), (S, z) => {
22
- const o = d("SwiperSlide");
23
- return u(), m(o, null, {
24
- default: g(() => [
25
- y("img", f(s, {
26
- class: e.imgClasses,
27
- src: e.lazy ? void 0 : e.src,
28
- srcset: e.lazy ? void 0 : e.srcset,
29
- "data-src": t.value,
30
- "data-srcset": a.value
31
- }), null, 16, h)
32
- ]),
33
- _: 1
34
- });
35
- };
22
+ const s = o(e, ["src", "srcset", "imgClasses"]), t = r(), a = r(), c = l(y, void 0);
23
+ return s.lazy && (t.value = e.src, a.value = e.srcset, c?.(!0)), (v, z) => (n(), d(f, null, {
24
+ default: m(() => [
25
+ g("img", u(s, {
26
+ class: e.imgClasses,
27
+ src: e.lazy ? void 0 : e.src,
28
+ srcset: e.lazy ? void 0 : e.srcset,
29
+ "data-src": t.value,
30
+ "data-srcset": a.value
31
+ }), null, 16, h)
32
+ ]),
33
+ _: 1
34
+ }));
36
35
  }
37
36
  });
38
37
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.5.3-alpha.10",
3
+ "version": "2.5.3-alpha.12",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",