@wikicasa-dev/components 2.6.6 → 2.6.7-alpha.1

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