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

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-keyboard.css';/* empty css */
1
+ import '../../assets/swiper-autoplay.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-keyboard.css';/* empty css */
1
+ import '../../assets/swiper-autoplay.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-keyboard.css';/* empty css */
1
+ import '../../assets/swiper-autoplay.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-keyboard.css';/* empty css */
1
+ import '../../assets/swiper-autoplay.css';/* empty css */
2
2
  import { Thumbs as t } from "swiper/modules";
3
3
  export {
4
4
  t as default
@@ -1,9 +1,9 @@
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
- import { AutoplayModule as R } from "../../../../../../Swiper/Autoplay/factory.js";
4
- import { KeyboardModule as U } from "../../../../../../Swiper/Keyboard/factory.js";
5
- import { ZoomModule as $ } from "../../../../../../Swiper/Zoom/factory.js";
6
- const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), W = /* @__PURE__ */ k({
1
+ import { defineComponent as S, useAttrs as O, shallowRef as p, useTemplateRef as k, onMounted as L, provide as v, createElementBlock as B, openBlock as D, Fragment as M, withDirectives as U, renderSlot as f, createCommentVNode as b, createElementVNode as V, mergeProps as x, unref as z, vShow as A, nextTick as G } from "vue";
2
+ import { createSwiper as N } from "../../../../../../Swiper/factory.js";
3
+ import { AutoplayModule as C } 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 $ = /* @__PURE__ */ Symbol(), q = /* @__PURE__ */ Symbol(), W = /* @__PURE__ */ S({
7
7
  inheritAttrs: !1,
8
8
  __name: "SwiperRootPrimitive",
9
9
  props: {
@@ -11,9 +11,9 @@ const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), W = /* @__PURE
11
11
  },
12
12
  emits: ["moved", "click", "init"],
13
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 = [];
14
+ const n = w, g = O(), a = p(null), c = k("root"), l = p(!1), T = !!s.swiperOptions?.keyboard, E = !!s.swiperOptions?.autoplay, u = [];
15
15
  let d = !1;
16
- const S = (e) => {
16
+ const I = (e) => {
17
17
  const t = [
18
18
  ...e?.querySelectorAll("img[data-src]") ?? []
19
19
  ];
@@ -25,71 +25,85 @@ const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), W = /* @__PURE
25
25
  if (!d) return o;
26
26
  const r = e.params.lazyPreloadPrevNext ?? 0;
27
27
  for (let i = t - r; i <= t + r; i++)
28
- o.push(...S(e.slides[i]));
28
+ o.push(...I(e.slides[i]));
29
29
  return o;
30
- }, h = async (e) => {
31
- a.value = await K(
30
+ }, P = async (e) => {
31
+ a.value = await N(
32
32
  e,
33
33
  {
34
34
  on: {
35
35
  init: (t) => {
36
- D(async () => {
36
+ G(async () => {
37
37
  const o = m(t, t.activeIndex);
38
- if (!o.length) {
39
- n.value = !0, l("init");
38
+ if (console.log("DEBUG:imagesToLoad", o), !o.length) {
39
+ l.value = !0, n("init");
40
40
  return;
41
41
  }
42
42
  await Promise.race([
43
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
- )
44
+ o.map((r) => r.complete ? (console.log("DEBUG:img.complete", r), Promise.resolve()) : new Promise((i) => {
45
+ r.addEventListener(
46
+ "load",
47
+ () => {
48
+ console.log("DEBUG:img.load", r), i("");
49
+ },
50
+ { once: !0 }
51
+ ), r.addEventListener(
52
+ "error",
53
+ () => {
54
+ console.log("DEBUG:img.error", r), i("");
55
+ },
56
+ { once: !0 }
57
+ );
58
+ }))
49
59
  ),
50
- new Promise((r) => setTimeout(r, 3e3))
51
- ]), n.value = !0, l("init");
60
+ new Promise(
61
+ (r) => setTimeout(() => {
62
+ console.log("DEBUG:not all images have loaded => TIMEOUT!"), r("");
63
+ }, 3e3)
64
+ )
65
+ ]), l.value = !0, n("init");
52
66
  });
53
67
  },
54
68
  slideChange: (t) => {
55
- l("moved", { activeIndex: t.activeIndex }), m(t, t.activeIndex);
69
+ n("moved", { activeIndex: t.activeIndex }), m(t, t.activeIndex);
56
70
  }
57
71
  },
58
72
  ...s.swiperOptions
59
73
  },
60
74
  [
61
- $(s.swiperOptions?.zoom),
62
- I ? U(s.swiperOptions?.keyboard) : void 0,
63
- T ? R(s.swiperOptions.autoplay) : void 0,
75
+ R(s.swiperOptions?.zoom),
76
+ T ? K(s.swiperOptions?.keyboard) : void 0,
77
+ E ? C(s.swiperOptions.autoplay) : void 0,
64
78
  ...u
65
79
  ].filter(Boolean)
66
80
  );
67
81
  };
68
82
  L(() => {
69
- c.value && setTimeout(() => h(c.value));
83
+ c.value && setTimeout(() => P(c.value));
70
84
  });
71
- const g = (e) => {
85
+ const h = (e) => {
72
86
  !a.value || a.value.params.slidesPerView === e || (a.value.params.slidesPerView = e, a.value.update());
73
87
  };
74
- return v(F, (e) => {
88
+ return v(q, (e) => {
75
89
  e && u.push(e);
76
- }), v(q, (e) => {
90
+ }), v($, (e) => {
77
91
  e !== d && (d = e);
78
92
  }), y({
79
93
  swiper: a,
80
- updateSlidesPerView: g
81
- }), (e, t) => (M(), b(V, null, [
82
- x(A("div", N({ ref: "root" }, C(P), { class: "swiper uikit-carousel" }), [
94
+ updateSlidesPerView: h
95
+ }), (e, t) => (D(), B(M, null, [
96
+ U(V("div", x({ ref: "root" }, z(g), { class: "swiper uikit-carousel" }), [
83
97
  f(e.$slots, "default")
84
98
  ], 16), [
85
- [B, n.value]
99
+ [A, l.value]
86
100
  ]),
87
- n.value ? z("", !0) : f(e.$slots, "placeholder", { key: 0 })
101
+ l.value ? b("", !0) : f(e.$slots, "placeholder", { key: 0 })
88
102
  ], 64));
89
103
  }
90
104
  });
91
105
  export {
92
- F as addModuleDescriptorKey,
106
+ q as addModuleDescriptorKey,
93
107
  W as default,
94
- q as setLazyImagesLoaderKey
108
+ $ as setLazyImagesLoaderKey
95
109
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.5.3-alpha.12",
3
+ "version": "2.5.3-alpha.14",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",