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

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-controller.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-controller.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-controller.css';/* empty css */
2
2
  import { Keyboard as e } from "swiper/modules";
3
3
  export {
4
4
  e as default
@@ -1,9 +1,9 @@
1
- const e = (o) => ({
2
- loader: () => import("./index.js").then((t) => t.default),
3
- options: {
4
- thumbs: o
5
- }
1
+ const o = (t) => ({
2
+ loader: () => import("./index.js").then((e) => e.default),
3
+ ...t ? {
4
+ options: { thumbs: t }
5
+ } : {}
6
6
  });
7
7
  export {
8
- e as ThumbsModule
8
+ o as ThumbsModule
9
9
  };
@@ -1,4 +1,4 @@
1
- import '../../assets/swiper-keyboard.css';/* empty css */
1
+ import '../../assets/swiper-controller.css';/* empty css */
2
2
  import { Thumbs as t } from "swiper/modules";
3
3
  export {
4
4
  t as default
@@ -1,34 +1,15 @@
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([
1
+ const a = async (o, r, s) => {
2
+ const i = s.map((e) => e.loader()), [{ Swiper: n }, ...p] = await Promise.all([
19
3
  import("./index.js"),
20
- ...o
21
- ]), l = n.reduce(
22
- (c, f) => s(c, f.options),
23
- {
24
- ...e,
25
- modules: i
26
- }
4
+ ...i
5
+ ]), t = s.reduce(
6
+ (e, c) => Object.assign(e, c.options),
7
+ { ...r, modules: p }
27
8
  );
28
9
  return console.log("DEBUG:createSwiper", {
29
- container: t,
30
- options: l
31
- }), new r(t, l);
10
+ container: o,
11
+ options: t
12
+ }), new n(o, t);
32
13
  };
33
14
  export {
34
15
  a as createSwiper
@@ -1 +1 @@
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}
1
+ .no-transition[data-v-6fb3d4e8]{transition-duration:0ms!important}.disable-select[data-v-6fb3d4e8]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-6fb3d4e8]{pointer-events:auto!important}
@@ -20,8 +20,7 @@ declare function __VLS_template(): {
20
20
  last_slide?(_: {}): any;
21
21
  };
22
22
  refs: {
23
- rootRef: HTMLDivElement;
24
- swiperWrapperRef: HTMLDivElement;
23
+ swiperRef: HTMLDivElement;
25
24
  thumbsRef: HTMLDivElement;
26
25
  };
27
26
  rootEl: any;
@@ -46,8 +45,7 @@ declare const __VLS_component: import('vue').DefineComponent<SwiperCarouselProps
46
45
  }) => any) | undefined;
47
46
  onFirstSlideLoaded?: (() => any) | undefined;
48
47
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
49
- rootRef: HTMLDivElement;
50
- swiperWrapperRef: HTMLDivElement;
48
+ swiperRef: HTMLDivElement;
51
49
  thumbsRef: HTMLDivElement;
52
50
  }, any>;
53
51
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
@@ -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 m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9ee6d9a5"]]);
5
+ const a = /* @__PURE__ */ r(o, [["__scopeId", "data-v-6fb3d4e8"]]);
6
6
  export {
7
- m as default
7
+ a as default
8
8
  };
@@ -1,5 +1,5 @@
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";
1
+ import { defineComponent as W, 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 d, createElementVNode as p, createCommentVNode as $, unref as ee, renderSlot as L, Fragment as k, renderList as V, mergeProps as B, withModifiers as O } from "vue";
2
+ import { createSwiper as R } 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__ */ Q({
10
+ const le = ["id", "data-cy"], de = ["data-idx", "alt", "width", "height", "onLoad"], ue = ["id"], ce = ["alt"], ye = /* @__PURE__ */ W({
11
11
  inheritAttrs: !1,
12
12
  __name: "SwiperCarousel",
13
13
  props: {
@@ -22,68 +22,68 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
22
22
  },
23
23
  emits: ["moved", "click", "firstSlideLoaded", "init"],
24
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) => {
25
+ const h = D, u = z(null), y = C("swiperRef"), A = C("thumbsRef"), F = z(!1), N = X(), w = Y(() => t.id ?? N), v = 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
- let r = "", o = "", v = "";
28
+ let r = "", o = "", g = "";
29
29
  if (t.artDirection) {
30
30
  for (const a in t.artDirection) {
31
- const { mq: c, width: f } = t.artDirection[a];
32
- f && (v += v ? `,${c} ${parseInt(f)}px` : `${c} ${parseInt(f)}px`);
31
+ const { mq: c, width: m } = t.artDirection[a];
32
+ m && (g += g ? `,${c} ${parseInt(m)}px` : `${c} ${parseInt(m)}px`);
33
33
  }
34
- o = e.images.reduce((a, c, f) => {
35
- const m = Object.values(t.artDirection)[f];
36
- return !m || !m.width || (a += a ? `, ${c.storagePath} ${m.width}` : `${c.storagePath} ${m.width}`), a;
34
+ o = e.images.reduce((a, c, m) => {
35
+ const f = Object.values(t.artDirection)[m];
36
+ return !f || !f.width || (a += a ? `, ${c.storagePath} ${f.width}` : `${c.storagePath} ${f.width}`), a;
37
37
  }, ""), r = e.images[0].storagePath;
38
38
  } else {
39
39
  let a = e.images;
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`), "");
40
+ e.images.length > 3 ? a = e.images.slice(2, 5) : t.shiftFirstImage && (a[0] = a[1]), o = a.reduce((c, m, f) => (f === 0 && (r = `${m.storagePath}`), f > 0 && (c += ", "), `${c}${m.storagePath} ${f + 1}x`), "");
41
41
  }
42
- const H = r, J = o;
43
- return typeof w == "number" && s > w ? (r = "", o = "", { sizes: v, "data-src": H, "data-srcset": J }) : i ? {
42
+ const J = r, Q = o;
43
+ return typeof v == "number" && s > v ? (r = "", o = "", { sizes: g, "data-src": J, "data-srcset": Q }) : i ? {
44
44
  src: r,
45
45
  srcset: o,
46
- sizes: v,
46
+ sizes: g,
47
47
  loading: "lazy",
48
48
  fetchpriority: "low"
49
49
  } : {
50
50
  src: r,
51
51
  srcset: o,
52
- sizes: v,
53
- loading: t.lazyLoadImages || s >= w ? "lazy" : void 0,
52
+ sizes: g,
53
+ loading: t.lazyLoadImages || s >= v ? "lazy" : void 0,
54
54
  fetchpriority: !t.lazyLoadImages && s === 0 ? "high" : "low"
55
55
  };
56
- }, h = [], K = (e) => {
57
- if (typeof w == "string") return;
58
- const s = h[e];
59
- if (s && !s.src && (s.src = s.dataset.src || "", s.srcset = s.dataset.srcset || ""), e < w || e + 1 >= (t.images ?? []).length)
56
+ }, b = [], K = (e) => {
57
+ if (typeof v == "string") return;
58
+ const s = b[e];
59
+ if (s && !s.src && (s.src = s.dataset.src || "", s.srcset = s.dataset.srcset || ""), e < v || e + 1 >= (t.images ?? []).length)
60
60
  return;
61
- const i = h[e + 1];
61
+ const i = b[e + 1];
62
62
  i && !i.src && (i.src = i?.dataset.src || "", i.srcset = i?.dataset.srcset || "");
63
63
  }, U = (e) => {
64
- e || !h?.[e] || M(() => {
65
- y.value?.setAttribute("data-first-slide-loaded", "true"), g("firstSlideLoaded");
64
+ e || !b?.[e] || M(() => {
65
+ y.value?.setAttribute("data-first-slide-loaded", "true"), h("firstSlideLoaded");
66
66
  });
67
- }, W = (e) => t.thumbSwiperOptions ? B(e, t.thumbSwiperOptions, [
67
+ }, Z = (e) => t.thumbSwiperOptions ? R(e, t.thumbSwiperOptions, [
68
68
  se(t.thumbSwiperOptions.freeMode)
69
- ]) : null, Z = async (e, s) => {
69
+ ]) : null, E = async (e, s) => {
70
70
  console.log("DEBUG:SwiperCarousel", {
71
71
  rootEl: e,
72
72
  thumbEl: s
73
73
  });
74
- const i = s ? await W(s) : null;
75
- d.value = await B(
74
+ const i = s ? await Z(s) : null;
75
+ u.value = await R(
76
76
  e,
77
77
  {
78
78
  on: {
79
79
  init: () => {
80
- F.value = !0, g("init");
80
+ F.value = !0, h("init");
81
81
  },
82
82
  slideChange: (r) => {
83
- K(r.activeIndex), g("moved", { activeIndex: r.activeIndex });
83
+ K(r.activeIndex), h("moved", { activeIndex: r.activeIndex });
84
84
  }
85
85
  },
86
- ...i ? { thumbs: { swiper: i } } : {},
86
+ ...i ? { thumbs: { ...t.swiperOptions.thumbs, swiper: i } } : {},
87
87
  ...t.swiperOptions
88
88
  },
89
89
  [
@@ -93,68 +93,68 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
93
93
  S ? re(t.swiperOptions.navigation) : void 0,
94
94
  q ? te(t.swiperOptions.autoplay) : void 0,
95
95
  //Thumbs specific modules
96
- i ? oe(t.swiperOptions.thumbs) : void 0
96
+ i ? oe() : void 0
97
97
  ].filter(Boolean)
98
98
  );
99
99
  };
100
100
  x(() => {
101
- y.value && setTimeout(() => Z(y.value, A.value));
101
+ y.value && setTimeout(() => E(y.value, A.value));
102
102
  });
103
- const E = (e) => {
104
- !d.value || d.value.params.slidesPerView === e || (d.value.params.slidesPerView = e, d.value.update());
103
+ const H = (e) => {
104
+ !u.value || u.value.params.slidesPerView === e || (u.value.params.slidesPerView = e, u.value.update());
105
105
  };
106
106
  return _(
107
107
  () => t.images,
108
108
  () => {
109
109
  M(() => {
110
- d.value?.update();
110
+ u.value?.update();
111
111
  });
112
112
  }
113
113
  ), T({
114
- swiper: d,
114
+ swiper: u,
115
115
  moveTo(e, s = 0, i = !0) {
116
- d.value?.slideTo(e, s, i);
116
+ u.value?.slideTo(e, s, i);
117
117
  },
118
- updateSlidesPerView: E
118
+ updateSlidesPerView: H
119
119
  }), (e, s) => (l(), n("div", {
120
- class: u(["swiper-carousel-root", e.$attrs["root-classes"]])
120
+ class: d(["swiper-carousel-root", e.$attrs["root-classes"]])
121
121
  }, [
122
122
  p("div", {
123
- ref: "rootRef",
123
+ ref: "swiperRef",
124
+ id: w.value,
124
125
  "data-cy": e.$attrs["data-cy"],
125
- class: u(["swiper uikit-carousel", e.$attrs["swiper-classes"]])
126
+ class: d(["swiper uikit-carousel", e.$attrs["swiper-classes"]])
126
127
  }, [
127
128
  p("div", {
128
- ref: "swiperWrapperRef",
129
- class: u(["swiper-wrapper", [
129
+ class: d(["swiper-wrapper", [
130
130
  e.$attrs["swiper-wrapper-classes"],
131
131
  ee(G) === "none" && "no-transition"
132
132
  ]]),
133
- onClick: s[0] || (s[0] = (i) => g("click"))
133
+ onClick: s[0] || (s[0] = (i) => h("click"))
134
134
  }, [
135
135
  L(e.$slots, "default", {}, () => [
136
136
  (l(!0), n(k, null, V(t.images, (i, r) => (l(), n("div", {
137
- key: `swiper_${$.value}_${r}`,
138
- class: u(["swiper-slide", e.$attrs["swiper-slide-classes"]])
137
+ key: `swiper_${w.value}_${r}`,
138
+ class: d(["swiper-slide", e.$attrs["swiper-slide-classes"]])
139
139
  }, [
140
140
  p("div", {
141
- class: u(["swiper-zoom-container", e.$attrs["swiper-zoom-container-classes"]])
141
+ class: d(["swiper-zoom-container", e.$attrs["swiper-zoom-container-classes"]])
142
142
  }, [
143
- t.backgroundImage ? b("", !0) : (l(), n("img", R({
143
+ t.backgroundImage ? $("", !0) : (l(), n("img", B({
144
144
  key: 0,
145
145
  ref_for: !0,
146
146
  ref: (o) => {
147
- h.push(o);
147
+ b.push(o);
148
148
  },
149
149
  class: ["disable-select", [e.$attrs["slide-img-classes"] || i.classes]],
150
- "data-idx": `${$.value}-slide-img-${r}`
150
+ "data-idx": `${w.value}-slide-img-${r}`
151
151
  }, { ref_for: !0 }, P(i, r), {
152
152
  alt: i.alt,
153
153
  itemprop: "image",
154
154
  width: i.width,
155
155
  height: i.height,
156
156
  onLoad: (o) => U(r)
157
- }), null, 16, ue))
157
+ }), null, 16, de))
158
158
  ], 2)
159
159
  ], 2))), 128)),
160
160
  L(e.$slots, "last_slide", {}, void 0, !0)
@@ -162,10 +162,10 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
162
162
  ], 2),
163
163
  I ? (l(), n("div", {
164
164
  key: 0,
165
- class: u([e.$attrs["swiper-pagination-classes"], "swiper-pagination [&.swiper-pagination-fraction]:uikit-flex [&.swiper-pagination-fraction]:uikit-justify-center"]),
165
+ class: d([e.$attrs["swiper-pagination-classes"], "swiper-pagination [&.swiper-pagination-fraction]:uikit-flex [&.swiper-pagination-fraction]:uikit-justify-center"]),
166
166
  onClick: s[1] || (s[1] = O(() => {
167
167
  }, ["stop"]))
168
- }, null, 2)) : b("", !0),
168
+ }, null, 2)) : $("", !0),
169
169
  S ? (l(), n(k, { key: 1 }, [
170
170
  p("div", {
171
171
  class: "swiper-button-prev",
@@ -179,29 +179,30 @@ const le = ["data-cy"], ue = ["data-idx", "alt", "width", "height", "onLoad"], d
179
179
  onClick: s[3] || (s[3] = O(() => {
180
180
  }, ["stop"]))
181
181
  })
182
- ], 64)) : b("", !0)
182
+ ], 64)) : $("", !0)
183
183
  ], 10, le),
184
184
  t.thumbSwiperOptions ? (l(), n("div", {
185
185
  key: 0,
186
+ id: `thumb_${w.value}`,
186
187
  ref: "thumbsRef",
187
- class: u(["swiper", e.$attrs["thumb-swiper-classes"]]),
188
+ class: d(["swiper", e.$attrs["thumb-swiper-classes"]]),
188
189
  thumbsSlider: ""
189
190
  }, [
190
191
  p("div", {
191
- class: u(["swiper-wrapper", e.$attrs["thumb-swiper-wrapper-classes"]])
192
+ class: d(["swiper-wrapper", e.$attrs["thumb-swiper-wrapper-classes"]])
192
193
  }, [
193
194
  (l(!0), n(k, null, V(t.images, (i, r) => (l(), n("div", {
194
- key: `thumb_${$.value}_${r}`,
195
- class: u(["swiper-slide", e.$attrs["thumb-img-wrapper-classes"]])
195
+ key: `thumb_${w.value}_${r}`,
196
+ class: d(["swiper-slide", e.$attrs["thumb-img-wrapper-classes"]])
196
197
  }, [
197
- p("img", R({
198
+ p("img", B({
198
199
  class: e.$attrs["thumb-img-classes"]
199
200
  }, { ref_for: !0 }, P(i, -1, !1), {
200
201
  alt: i.alt
201
- }), null, 16, de)
202
+ }), null, 16, ce)
202
203
  ], 2))), 128))
203
204
  ], 2)
204
- ], 2)) : b("", !0)
205
+ ], 10, ue)) : $("", !0)
205
206
  ], 2));
206
207
  }
207
208
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.4.2-alpha.6",
3
+ "version": "2.4.2-alpha.8",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",