@wikicasa-dev/components 2.6.5 → 2.6.7-alpha.0

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-e1b586ab]{opacity:0}.swiper.uikit-carousel.is-initialized[data-v-e1b586ab]{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 d, setLazyImagesLoaderKey as f } from "./SwiperRootPrimitive.vue.js";
3
3
  import '../../../assets/SwiperRootPrimitive2.css';import '../../../assets/SwiperRootPrimitive.css';/* empty css */
4
4
  /* empty css */
5
- import r from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-30c86ccb"]]);
5
+ import e from "../../../_virtual/_plugin-vue_export-helper.js";
6
+ const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-e1b586ab"]]);
7
7
  export {
8
- s as addModuleDescriptorKey,
9
- p as default,
10
- d as setLazyImagesLoaderKey
8
+ d as addModuleDescriptorKey,
9
+ m as default,
10
+ f as setLazyImagesLoaderKey
11
11
  };
@@ -1,121 +1,112 @@
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 g, shallowRef as I, useTemplateRef as A, onMounted as N, provide as y, 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__ */ g({
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 = I(null), u = A("root"), n = I(!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 = (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
+ return d(e), t;
37
+ }, O = () => {
38
+ n.value = !0, c("init");
39
+ }, z = async (e) => {
40
+ i.value = await D(
34
41
  e,
35
42
  {
36
43
  on: {
37
44
  init: async (t) => {
38
- if (!d) return y();
39
- const { visibleImages: a, preloadImages: l } = I(
45
+ const { visibleImages: o, preloadImages: r } = f(
40
46
  t,
41
47
  t.activeIndex
42
48
  );
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
- })
49
+ let l;
50
+ const s = new Promise(
51
+ (V) => l = setTimeout(V, 6e3)
52
+ ), M = Promise.all(
53
+ o.map(C)
63
54
  ).finally(() => {
64
- clearTimeout(n);
55
+ clearTimeout(l);
65
56
  });
66
- await Promise.race([L, o]), z(() => {
67
- l.forEach(u);
68
- }), y();
57
+ await Promise.race([M, s]), E(() => {
58
+ r.forEach(d);
59
+ }), O();
69
60
  },
70
61
  slideChange: (t) => {
71
- m("moved", { activeIndex: t.activeIndex });
72
- const { visibleImages: a, preloadImages: l } = I(
62
+ c("moved", { activeIndex: t.activeIndex });
63
+ const { visibleImages: o, preloadImages: r } = f(
73
64
  t,
74
65
  t.activeIndex
75
66
  );
76
- [...a, ...l].forEach(
77
- u
67
+ [...o, ...r].forEach(
68
+ d
78
69
  );
79
70
  }
80
71
  },
81
- ...s.swiperOptions
72
+ ...a.swiperOptions
82
73
  },
83
74
  [
84
- $(s.swiperOptions?.zoom),
85
- C ? U(s.swiperOptions?.keyboard) : void 0,
86
- O ? D(s.swiperOptions.autoplay) : void 0,
87
- ...v
75
+ U(a.swiperOptions?.zoom),
76
+ S ? R(a.swiperOptions?.keyboard) : void 0,
77
+ T ? K(a.swiperOptions.autoplay) : void 0,
78
+ ...m
88
79
  ].filter(Boolean)
89
80
  );
90
81
  };
91
- q(() => {
92
- p.value && setTimeout(() => M(p.value));
82
+ N(() => {
83
+ u.value && setTimeout(() => z(u.value));
93
84
  });
94
- const V = (e) => {
95
- !r.value || r.value.params.slidesPerView === e || (r.value.params.slidesPerView = e, r.value.update());
85
+ const L = (e) => {
86
+ !i.value || i.value.params.slidesPerView === e || (i.value.params.slidesPerView = e, i.value.update());
96
87
  };
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", {
88
+ return y(j, (e) => {
89
+ e && m.push(e);
90
+ }), y(Z, (e) => {
91
+ e !== p && (p = e);
92
+ }), b({
93
+ swiper: i,
94
+ updateSlidesPerView: L
95
+ }), (e, t) => (w(), P("div", $, [
96
+ q("div", {
106
97
  ref: "root",
107
- class: B(["swiper uikit-carousel", [{ "is-initialized": c.value }, s.rootClasses]])
98
+ class: x(["swiper uikit-carousel", [{ "is-initialized": n.value }, a.rootClasses]])
108
99
  }, [
109
- S(e.$slots, "default", {}, void 0, !0)
100
+ k(e.$slots, "default", {}, void 0, !0)
110
101
  ], 2),
111
- c.value ? K("", !0) : (b(), h("div", j, [
112
- S(e.$slots, "placeholder", {}, void 0, !0)
102
+ n.value ? B("", !0) : (w(), P("div", F, [
103
+ k(e.$slots, "placeholder", {}, void 0, !0)
113
104
  ]))
114
105
  ]));
115
106
  }
116
107
  });
117
108
  export {
118
- G as addModuleDescriptorKey,
119
- _ as default,
120
- F as setLazyImagesLoaderKey
109
+ j as addModuleDescriptorKey,
110
+ Y as default,
111
+ Z as setLazyImagesLoaderKey
121
112
  };
@@ -1,4 +1,4 @@
1
- import '../../../assets/swiper-controller.css';/* empty css */
1
+ import '../../../assets/swiper-keyboard.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-controller.css';/* empty css */
1
+ import '../../../assets/swiper-keyboard.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-controller.css';/* empty css */
1
+ import '../../../assets/swiper-keyboard.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-controller.css';/* empty css */
1
+ import '../../../assets/swiper-keyboard.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.5",
3
+ "version": "2.6.7-alpha.0",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,7 +44,7 @@
44
44
  "peerDependencies": {
45
45
  "@wikicasa-dev/svg-icons": "1.3.6",
46
46
  "@wikicasa-dev/types": "2.5.8",
47
- "@wikicasa-dev/utilities": "1.2.4",
47
+ "@wikicasa-dev/utilities": "1.2.5",
48
48
  "@wikicasa-dev/vue-composables": "0.1.6",
49
49
  "date-fns": "^4.0.0",
50
50
  "vue": "^3.5.0"
@@ -65,7 +65,7 @@
65
65
  "@wikicasa-dev/svg-icons": "^1.3.6",
66
66
  "@wikicasa-dev/tailwind-plugins": "^0.0.6",
67
67
  "@wikicasa-dev/types": "^2.5.8",
68
- "@wikicasa-dev/utilities": "^1.2.4",
68
+ "@wikicasa-dev/utilities": "^1.2.5",
69
69
  "@wikicasa-dev/vue-composables": "^0.1.6",
70
70
  "autoprefixer": "^10.5.0",
71
71
  "date-fns": "4.4.0",