@wikicasa-dev/components 2.4.2-alpha.4 → 2.4.2-alpha.6

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,12 +1,34 @@
1
- const a = async (o, r, s) => {
2
- const t = s.map((e) => e.loader()), [{ Swiper: i }, ...c] = await Promise.all([
1
+ function s(t, e) {
2
+ if (t == null)
3
+ return e == null ? {} : { ...e };
4
+ if (e == null)
5
+ return { ...t };
6
+ const n = { ...t };
7
+ for (const o in e)
8
+ if (Object.prototype.hasOwnProperty.call(e, o)) {
9
+ const r = e[o], i = n[o];
10
+ p(r) && p(i) ? n[o] = s(i, r) : n[o] = r;
11
+ }
12
+ return n;
13
+ }
14
+ function p(t) {
15
+ return t !== null && typeof t == "object" && !Array.isArray(t) && typeof t != "function" && Object.prototype.toString.call(t) === "[object Object]";
16
+ }
17
+ const a = async (t, e, n) => {
18
+ const o = n.map((c) => c.loader()), [{ Swiper: r }, ...i] = await Promise.all([
3
19
  import("./index.js"),
4
- ...t
5
- ]), n = s.reduce(
6
- (e, p) => Object.assign(e, p.options),
7
- { ...r, modules: c }
20
+ ...o
21
+ ]), l = n.reduce(
22
+ (c, f) => s(c, f.options),
23
+ {
24
+ ...e,
25
+ modules: i
26
+ }
8
27
  );
9
- return console.log("DEBUG:createSwiper", o), new i(o, n);
28
+ return console.log("DEBUG:createSwiper", {
29
+ container: t,
30
+ options: l
31
+ }), new r(t, l);
10
32
  };
11
33
  export {
12
34
  a as createSwiper
@@ -1 +1 @@
1
- .no-transition[data-v-867894fe]{transition-duration:0ms!important}.disable-select[data-v-867894fe]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-867894fe]{pointer-events:auto!important}
1
+ .no-transition[data-v-9ee6d9a5]{transition-duration:0ms!important}.disable-select[data-v-9ee6d9a5]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-9ee6d9a5]{pointer-events:auto!important}
@@ -2,7 +2,7 @@ import o from "../../packages/components/lib/components/carousel/SwiperCarousel.
2
2
  import '../../assets/SwiperCarousel2.css';import '../../assets/SwiperCarousel.css';/* empty css */
3
3
  /* empty css */
4
4
  import r from "../../_virtual/_plugin-vue_export-helper.js";
5
- const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-867894fe"]]);
5
+ const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9ee6d9a5"]]);
6
6
  export {
7
- a as default
7
+ m as default
8
8
  };
@@ -1,5 +1,5 @@
1
- import { defineComponent as U, shallowRef as z, useTemplateRef as M, useId as X, computed as Y, onMounted as x, watch as _, nextTick as C, createElementBlock as n, openBlock as l, normalizeClass as u, createElementVNode as p, createCommentVNode as b, unref as ee, renderSlot as L, Fragment as k, renderList as V, mergeProps as R, withModifiers as O } from "vue";
2
- import { createSwiper as T } from "../../../../../Swiper/factory.js";
1
+ import { defineComponent as Q, shallowRef as z, useTemplateRef as C, useId as X, computed as Y, onMounted as x, watch as _, nextTick as M, createElementBlock as n, openBlock as l, normalizeClass as u, createElementVNode as p, createCommentVNode as b, unref as ee, renderSlot as L, Fragment as k, renderList as V, mergeProps as R, withModifiers as O } from "vue";
2
+ import { createSwiper as B } from "../../../../../Swiper/factory.js";
3
3
  import { AutoplayModule as te } from "../../../../../Swiper/Autoplay/factory.js";
4
4
  import { FreemodeModule as se } from "../../../../../Swiper/FreeMode/factory.js";
5
5
  import { KeyboardModule as ie } from "../../../../../Swiper/Keyboard/factory.js";
@@ -7,7 +7,7 @@ import { NavigationModule as re } from "../../../../../Swiper/Navigation/factory
7
7
  import { PaginationModule as ae } from "../../../../../Swiper/Pagination/factory.js";
8
8
  import { ThumbsModule as oe } from "../../../../../Swiper/Thumbs/factory.js";
9
9
  import { ZoomModule as ne } from "../../../../../Swiper/Zoom/factory.js";
10
- const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], de = ["alt"], ye = /* @__PURE__ */ U({
10
+ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], de = ["alt"], ye = /* @__PURE__ */ Q({
11
11
  inheritAttrs: !1,
12
12
  __name: "SwiperCarousel",
13
13
  props: {
@@ -21,8 +21,8 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
21
21
  shiftFirstImage: { type: Boolean, default: !1 }
22
22
  },
23
23
  emits: ["moved", "click", "firstSlideLoaded", "init"],
24
- setup(t, { expose: B, emit: D }) {
25
- const g = D, d = z(null), y = M("rootRef"), A = M("thumbsRef"), F = z(!1), N = X(), $ = Y(() => t.id ?? N), w = t.swiperOptions?.slidesPerView || 1, j = !!t.swiperOptions?.keyboard, S = !!t.swiperOptions.navigation, I = !!t.swiperOptions.pagination, q = !!t.swiperOptions.autoplay, E = t.swiperOptions?.effect || "slider", P = (e, s = -1, i = !1) => {
24
+ setup(t, { expose: T, emit: D }) {
25
+ const g = D, d = z(null), y = C("rootRef"), A = C("thumbsRef"), F = z(!1), N = X(), $ = Y(() => t.id ?? N), w = t.swiperOptions?.slidesPerView || 1, j = !!t.swiperOptions?.keyboard, S = !!t.swiperOptions.navigation, I = !!t.swiperOptions.pagination, q = !!t.swiperOptions.autoplay, G = t.swiperOptions?.effect || "slider", P = (e, s = -1, i = !1) => {
26
26
  if (!e.images)
27
27
  return { src: e.src || "" };
28
28
  let r = "", o = "", v = "";
@@ -39,8 +39,8 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
39
39
  let a = e.images;
40
40
  e.images.length > 3 ? a = e.images.slice(2, 5) : t.shiftFirstImage && (a[0] = a[1]), o = a.reduce((c, f, m) => (m === 0 && (r = `${f.storagePath}`), m > 0 && (c += ", "), `${c}${f.storagePath} ${m + 1}x`), "");
41
41
  }
42
- const J = r, Q = o;
43
- return typeof w == "number" && s > w ? (r = "", o = "", { sizes: v, "data-src": J, "data-srcset": Q }) : i ? {
42
+ const H = r, J = o;
43
+ return typeof w == "number" && s > w ? (r = "", o = "", { sizes: v, "data-src": H, "data-srcset": J }) : i ? {
44
44
  src: r,
45
45
  srcset: o,
46
46
  sizes: v,
@@ -60,15 +60,19 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
60
60
  return;
61
61
  const i = h[e + 1];
62
62
  i && !i.src && (i.src = i?.dataset.src || "", i.srcset = i?.dataset.srcset || "");
63
- }, W = (e) => {
64
- e || !h?.[e] || C(() => {
63
+ }, U = (e) => {
64
+ e || !h?.[e] || M(() => {
65
65
  y.value?.setAttribute("data-first-slide-loaded", "true"), g("firstSlideLoaded");
66
66
  });
67
- }, Z = (e) => t.thumbSwiperOptions ? T(e, t.thumbSwiperOptions, [
67
+ }, W = (e) => t.thumbSwiperOptions ? B(e, t.thumbSwiperOptions, [
68
68
  se(t.thumbSwiperOptions.freeMode)
69
- ]) : null, G = async (e, s) => {
70
- const i = s ? await Z(s) : null;
71
- d.value = await T(
69
+ ]) : null, Z = async (e, s) => {
70
+ console.log("DEBUG:SwiperCarousel", {
71
+ rootEl: e,
72
+ thumbEl: s
73
+ });
74
+ const i = s ? await W(s) : null;
75
+ d.value = await B(
72
76
  e,
73
77
  {
74
78
  on: {
@@ -94,24 +98,24 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
94
98
  );
95
99
  };
96
100
  x(() => {
97
- y.value && setTimeout(() => G(y.value, A.value));
101
+ y.value && setTimeout(() => Z(y.value, A.value));
98
102
  });
99
- const H = (e) => {
103
+ const E = (e) => {
100
104
  !d.value || d.value.params.slidesPerView === e || (d.value.params.slidesPerView = e, d.value.update());
101
105
  };
102
106
  return _(
103
107
  () => t.images,
104
108
  () => {
105
- C(() => {
109
+ M(() => {
106
110
  d.value?.update();
107
111
  });
108
112
  }
109
- ), B({
113
+ ), T({
110
114
  swiper: d,
111
115
  moveTo(e, s = 0, i = !0) {
112
116
  d.value?.slideTo(e, s, i);
113
117
  },
114
- updateSlidesPerView: H
118
+ updateSlidesPerView: E
115
119
  }), (e, s) => (l(), n("div", {
116
120
  class: u(["swiper-carousel-root", e.$attrs["root-classes"]])
117
121
  }, [
@@ -124,7 +128,7 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
124
128
  ref: "swiperWrapperRef",
125
129
  class: u(["swiper-wrapper", [
126
130
  e.$attrs["swiper-wrapper-classes"],
127
- ee(E) === "none" && "no-transition"
131
+ ee(G) === "none" && "no-transition"
128
132
  ]]),
129
133
  onClick: s[0] || (s[0] = (i) => g("click"))
130
134
  }, [
@@ -149,7 +153,7 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
149
153
  itemprop: "image",
150
154
  width: i.width,
151
155
  height: i.height,
152
- onLoad: (o) => W(r)
156
+ onLoad: (o) => U(r)
153
157
  }), null, 16, ue))
154
158
  ], 2)
155
159
  ], 2))), 128)),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.4.2-alpha.4",
3
+ "version": "2.4.2-alpha.6",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",