@wikicasa-dev/components 2.5.3-alpha.27 → 2.5.3-alpha.28

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