@wikicasa-dev/components 2.1.2-alpha.3 → 2.1.2-alpha.4

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
- .no-transition[data-v-1d5b4507]{transition-duration:0ms!important}.disable-select[data-v-1d5b4507]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-1d5b4507]{pointer-events:auto!important}
1
+ .no-transition[data-v-d9606d10]{transition-duration:0ms!important}.disable-select[data-v-d9606d10]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-d9606d10]{pointer-events:auto!important}
@@ -2,7 +2,7 @@ import o from "../../packages/components/lib/components/carousel/SwiperCarousel.
2
2
  import '../../assets/packages/components/lib/components/carousel/SwiperCarousel2.css';import '../../assets/packages/components/lib/components/carousel/SwiperCarousel.css';/* empty css */
3
3
  /* empty css */
4
4
  import r from "../../_virtual/_plugin-vue_export-helper.js";
5
- const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1d5b4507"]]);
5
+ const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-d9606d10"]]);
6
6
  export {
7
7
  e as default
8
8
  };
@@ -1,12 +1,12 @@
1
- import { defineComponent as J, reactive as Q, ref as $, useId as U, computed as f, onMounted as X, watch as Y, nextTick as L, createElementBlock as l, openBlock as u, normalizeClass as d, createElementVNode as v, createCommentVNode as b, renderSlot as M, Fragment as k, renderList as E, mergeProps as F, withModifiers as P } from "vue";
2
- import { Swiper as T } from "swiper";
1
+ import { defineComponent as J, reactive as Q, ref as k, useId as U, computed as f, onMounted as X, watch as Y, nextTick as M, createElementBlock as l, openBlock as u, normalizeClass as p, createElementVNode as v, createCommentVNode as y, renderSlot as E, Fragment as P, renderList as F, mergeProps as T, withModifiers as O } from "vue";
2
+ import { Swiper as B } from "swiper";
3
3
  import x from "../../../../../node_modules/.pnpm/swiper@11.2.6/node_modules/swiper/modules/zoom.js";
4
4
  import '../../../../../assets/node_modules/.pnpm/swiper@11.2.6/node_modules/swiper/modules/zoom.css';import '../../../../../assets/node_modules/.pnpm/swiper@11.2.6/node_modules/swiper/swiper.css';/* empty css */
5
5
  /* empty css */
6
6
  import "../../../../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.js";
7
7
  import { shallowCopyObjectTo as _ } from "../../../../../node_modules/.pnpm/@wikicasa-dev_utilities@1.1.21/node_modules/@wikicasa-dev/utilities/dist/utils/ObjectUtils.js";
8
8
  import "../../../../../_virtual/polyline.js";
9
- const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "height", "onLoad"], ie = ["id"], ae = ["loading", "alt"], me = /* @__PURE__ */ J({
9
+ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "height", "onLoad"], ie = ["id"], ae = ["alt"], me = /* @__PURE__ */ J({
10
10
  inheritAttrs: !1,
11
11
  __name: "SwiperCarousel",
12
12
  props: {
@@ -20,37 +20,43 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
20
20
  shiftFirstImage: { type: Boolean, default: !1 }
21
21
  },
22
22
  emits: ["moved", "click", "firstSlideLoaded"],
23
- setup(s, { expose: V, emit: B }) {
24
- const y = B, r = Q({
23
+ setup(s, { expose: D, emit: j }) {
24
+ const $ = j, r = Q({
25
25
  swiperParams: { modules: [x] },
26
26
  swiper: null,
27
27
  initCarousel: !1
28
- }), O = $(), D = $(!1), j = U(), p = f(() => s.id ?? j), g = f(() => s.swiperOptions?.slidesPerView || 1), A = f(() => s.thumbSwiperOptions?.slidesPerView || 1), N = f(() => !!s.swiperOptions?.keyboard), S = f(() => !!s.swiperOptions.navigation), C = f(() => !!s.swiperOptions.pagination), W = f(() => !!s.swiperOptions.autoplay), q = f(
28
+ }), S = k(), A = k(!1), N = U(), d = f(() => s.id ?? N), g = f(() => s.swiperOptions?.slidesPerView || 1), V = f(() => !!s.swiperOptions?.keyboard), C = f(() => !!s.swiperOptions.navigation), I = f(() => !!s.swiperOptions.pagination), W = f(() => !!s.swiperOptions.autoplay), q = f(
29
29
  () => s.swiperOptions?.effect || "slider"
30
30
  ), K = () => {
31
31
  s.swiperOptions && _(s.swiperOptions, r.swiperParams);
32
- }, I = (e, i = -1) => {
32
+ }, z = (e, i = -1, t = !1) => {
33
33
  if (!e.images)
34
34
  return { src: e.src || "" };
35
- let t = "", a = "", o = "";
35
+ let a = "", o = "", b = "";
36
36
  if (s.artDirection) {
37
37
  for (const n in s.artDirection) {
38
38
  const { mq: c, width: m } = s.artDirection[n];
39
- m && (o += o ? `,${c} ${parseInt(m)}px` : `${c} ${parseInt(m)}px`);
39
+ m && (b += b ? `,${c} ${parseInt(m)}px` : `${c} ${parseInt(m)}px`);
40
40
  }
41
- a = e.images.reduce((n, c, m) => {
41
+ o = e.images.reduce((n, c, m) => {
42
42
  const w = Object.values(s.artDirection)[m];
43
43
  return !w || !w.width || (n += n ? `, ${c.storagePath} ${w.width}` : `${c.storagePath} ${w.width}`), n;
44
- }, ""), t = e.images[0].storagePath;
44
+ }, ""), a = e.images[0].storagePath;
45
45
  } else {
46
46
  let n = e.images;
47
- e.images.length > 3 ? n = e.images.slice(2, 5) : s.shiftFirstImage && (n[0] = n[1]), a = n.reduce((c, m, w) => (w === 0 && (t = `${m.storagePath}`), w > 0 && (c += ", "), `${c}${m.storagePath} ${w + 1}x`), "");
47
+ e.images.length > 3 ? n = e.images.slice(2, 5) : s.shiftFirstImage && (n[0] = n[1]), o = n.reduce((c, m, w) => (w === 0 && (a = `${m.storagePath}`), w > 0 && (c += ", "), `${c}${m.storagePath} ${w + 1}x`), "");
48
48
  }
49
- const G = t, H = a;
50
- return typeof g.value == "number" && i > g.value ? (t = "", a = "", { sizes: o, "data-src": G, "data-srcset": H }) : {
51
- src: t,
52
- srcset: a,
53
- sizes: o,
49
+ const G = a, H = o;
50
+ return typeof g.value == "number" && i > g.value ? (a = "", o = "", { sizes: b, "data-src": G, "data-srcset": H }) : t ? {
51
+ src: a,
52
+ srcset: o,
53
+ sizes: b,
54
+ loading: "lazy",
55
+ fetchpriority: "low"
56
+ } : {
57
+ src: a,
58
+ srcset: o,
59
+ sizes: b,
54
60
  loading: s.lazyLoadImages || i >= g.value ? "lazy" : void 0,
55
61
  fetchpriority: !s.lazyLoadImages && i === 0 ? "high" : "low"
56
62
  };
@@ -62,22 +68,22 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
62
68
  const t = h[e + 1];
63
69
  t && !t.src && (t.src = t?.dataset.src || "", t.srcset = t?.dataset.srcset || "");
64
70
  };
65
- V({
71
+ D({
66
72
  moveTo(e, i = 0, t = !0) {
67
73
  r.swiper?.slideTo(e, i, t);
68
74
  }
69
75
  });
70
- const z = $(null), Z = (e) => {
71
- e === 0 && h && h[e] && L(() => {
72
- z.value?.setAttribute("data-first-slide-loaded", "true"), y("firstSlideLoaded");
76
+ const L = k(null), Z = (e) => {
77
+ e === 0 && h && h[e] && M(() => {
78
+ L.value?.setAttribute("data-first-slide-loaded", "true"), $("firstSlideLoaded");
73
79
  });
74
80
  };
75
81
  return X(async () => {
76
- if (K(), N.value) {
82
+ if (K(), V.value) {
77
83
  const { Keyboard: t } = await import("../../../lazyModules/Swiper/keyboard.js");
78
84
  r.swiperParams.modules?.push(t), r.swiperParams.keyboard = s.swiperOptions.keyboard;
79
85
  }
80
- if (C.value) {
86
+ if (I.value) {
81
87
  const { Pagination: t } = await import("../../../lazyModules/Swiper/pagination.js");
82
88
  r.swiperParams.modules?.push(t), r.swiperParams.pagination = {
83
89
  el: ".swiper-pagination",
@@ -89,7 +95,7 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
89
95
  ...typeof r.swiperParams.pagination == "boolean" ? {} : r.swiperParams.pagination
90
96
  };
91
97
  }
92
- if (S.value) {
98
+ if (C.value) {
93
99
  const { Navigation: t } = await import("../../../lazyModules/Swiper/navigation.js");
94
100
  r.swiperParams.modules?.push(t);
95
101
  const a = {
@@ -113,10 +119,10 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
113
119
  ...r.swiperParams,
114
120
  on: {
115
121
  init: () => {
116
- D.value = !0;
122
+ A.value = !0;
117
123
  },
118
124
  slideChange: (t) => {
119
- R(t.activeIndex), y("moved", { activeIndex: t.activeIndex });
125
+ R(t.activeIndex), $("moved", { activeIndex: t.activeIndex });
120
126
  }
121
127
  }
122
128
  };
@@ -127,58 +133,58 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
127
133
  import("../../../lazyModules/Swiper/free-mode.js"),
128
134
  import("../../../lazyModules/Swiper/controller.js")
129
135
  ]);
130
- r.swiperParams.modules?.push(t.Thumbs), r.swiperParams.modules?.push(o.Controller), i = new T(`#thumb_${p.value}`, {
136
+ r.swiperParams.modules?.push(t.Thumbs), r.swiperParams.modules?.push(o.Controller), i = new B(`#thumb_${d.value}`, {
131
137
  ...s.thumbSwiperOptions,
132
138
  modules: [a.FreeMode]
133
139
  }), e.thumbs = {
134
140
  swiper: i
135
141
  };
136
142
  }
137
- e.lazyPreloadPrevNext = 1, r.swiper = new T(`#${p.value}`, e), O.value?.classList.remove("uikit-hidden");
143
+ e.lazyPreloadPrevNext = 1, r.swiper = new B(`#${d.value}`, e), S.value?.classList.remove("uikit-hidden");
138
144
  }), Y(
139
145
  () => s.images,
140
146
  () => {
141
- L(() => {
147
+ M(() => {
142
148
  r.swiper?.update();
143
149
  });
144
150
  }
145
151
  ), (e, i) => (u(), l("div", {
146
- id: `root-${p.value}`,
152
+ id: `root-${d.value}`,
147
153
  ref_key: "root",
148
- ref: z,
149
- class: d(["swiper-carousel-root", e.$attrs["root-classes"]])
154
+ ref: L,
155
+ class: p(["swiper-carousel-root", e.$attrs["root-classes"]])
150
156
  }, [
151
157
  v("div", {
152
- id: p.value,
158
+ id: d.value,
153
159
  "data-cy": e.$attrs["data-cy"],
154
- class: d(["swiper", e.$attrs["swiper-classes"]])
160
+ class: p(["swiper", e.$attrs["swiper-classes"]])
155
161
  }, [
156
162
  v("div", {
157
163
  ref_key: "swiperWrapper",
158
- ref: O,
159
- class: d(["swiper-wrapper", [
164
+ ref: S,
165
+ class: p(["swiper-wrapper", [
160
166
  e.$attrs["swiper-wrapper-classes"],
161
167
  q.value === "none" && "no-transition"
162
168
  ]]),
163
- onClick: i[0] || (i[0] = (t) => y("click"))
169
+ onClick: i[0] || (i[0] = (t) => $("click"))
164
170
  }, [
165
- M(e.$slots, "default", {}, () => [
166
- (u(!0), l(k, null, E(e.images, (t, a) => (u(), l("div", {
167
- key: `swiper_${p.value}_${a}`,
168
- class: d(["swiper-slide", e.$attrs["swiper-slide-classes"]])
171
+ E(e.$slots, "default", {}, () => [
172
+ (u(!0), l(P, null, F(e.images, (t, a) => (u(), l("div", {
173
+ key: `swiper_${d.value}_${a}`,
174
+ class: p(["swiper-slide", e.$attrs["swiper-slide-classes"]])
169
175
  }, [
170
176
  v("div", {
171
- class: d(["swiper-zoom-container", e.$attrs["swiper-zoom-container-classes"]])
177
+ class: p(["swiper-zoom-container", e.$attrs["swiper-zoom-container-classes"]])
172
178
  }, [
173
- e.backgroundImage ? b("", !0) : (u(), l("img", F({
179
+ e.backgroundImage ? y("", !0) : (u(), l("img", T({
174
180
  key: 0,
175
181
  ref_for: !0,
176
182
  ref: (o) => {
177
183
  h.push(o);
178
184
  },
179
185
  class: ["disable-select", [e.$attrs["slide-img-classes"] || t.classes]],
180
- "data-idx": `${p.value}-slide-img-${a}`
181
- }, I(t, a), {
186
+ "data-idx": `${d.value}-slide-img-${a}`
187
+ }, z(t, a), {
182
188
  alt: t.alt,
183
189
  itemprop: "image",
184
190
  width: t.width,
@@ -187,53 +193,52 @@ const ee = ["id"], te = ["id", "data-cy"], se = ["data-idx", "alt", "width", "he
187
193
  }), null, 16, se))
188
194
  ], 2)
189
195
  ], 2))), 128)),
190
- M(e.$slots, "last_slide", {}, void 0, !0)
196
+ E(e.$slots, "last_slide", {}, void 0, !0)
191
197
  ], !0)
192
198
  ], 2),
193
- C.value ? (u(), l("div", {
199
+ I.value ? (u(), l("div", {
194
200
  key: 0,
195
- class: d([e.$attrs["swiper-pagination-classes"], "swiper-pagination [&.swiper-pagination-fraction]:uikit-flex [&.swiper-pagination-fraction]:uikit-justify-center"]),
196
- onClick: i[1] || (i[1] = P(() => {
201
+ class: p([e.$attrs["swiper-pagination-classes"], "swiper-pagination [&.swiper-pagination-fraction]:uikit-flex [&.swiper-pagination-fraction]:uikit-justify-center"]),
202
+ onClick: i[1] || (i[1] = O(() => {
197
203
  }, ["stop"]))
198
- }, null, 2)) : b("", !0),
199
- S.value ? (u(), l(k, { key: 1 }, [
204
+ }, null, 2)) : y("", !0),
205
+ C.value ? (u(), l(P, { key: 1 }, [
200
206
  v("div", {
201
207
  class: "swiper-button-prev",
202
208
  "data-cy": "swiper-button-prev",
203
- onClick: i[2] || (i[2] = P(() => {
209
+ onClick: i[2] || (i[2] = O(() => {
204
210
  }, ["stop"]))
205
211
  }),
206
212
  v("div", {
207
213
  class: "swiper-button-next",
208
214
  "data-cy": "swiper-button-next",
209
- onClick: i[3] || (i[3] = P(() => {
215
+ onClick: i[3] || (i[3] = O(() => {
210
216
  }, ["stop"]))
211
217
  })
212
- ], 64)) : b("", !0)
218
+ ], 64)) : y("", !0)
213
219
  ], 10, te),
214
220
  e.thumbSwiperOptions ? (u(), l("div", {
215
221
  key: 0,
216
- id: `thumb_${p.value}`,
222
+ id: `thumb_${d.value}`,
217
223
  thumbsSlider: "",
218
- class: d(["swiper", e.$attrs["thumb-swiper-classes"]])
224
+ class: p(["swiper", e.$attrs["thumb-swiper-classes"]])
219
225
  }, [
220
226
  v("div", {
221
- class: d(["swiper-wrapper", e.$attrs["thumb-swiper-wrapper-classes"]])
227
+ class: p(["swiper-wrapper", e.$attrs["thumb-swiper-wrapper-classes"]])
222
228
  }, [
223
- (u(!0), l(k, null, E(e.images, (t, a) => (u(), l("div", {
224
- key: `thumb_${p.value}_${a}`,
225
- class: d(["swiper-slide", e.$attrs["thumb-img-wrapper-classes"]])
229
+ (u(!0), l(P, null, F(e.images, (t, a) => (u(), l("div", {
230
+ key: `thumb_${d.value}_${a}`,
231
+ class: p(["swiper-slide", e.$attrs["thumb-img-wrapper-classes"]])
226
232
  }, [
227
- v("img", F({
233
+ v("img", T({
228
234
  class: e.$attrs["thumb-img-classes"],
229
235
  ref_for: !0
230
- }, I(t), {
231
- loading: a >= A.value ? "lazy" : void 0,
236
+ }, z(t, -1, !1), {
232
237
  alt: t.alt
233
238
  }), null, 16, ae)
234
239
  ], 2))), 128))
235
240
  ], 2)
236
- ], 10, ie)) : b("", !0)
241
+ ], 10, ie)) : y("", !0)
237
242
  ], 10, ee));
238
243
  }
239
244
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.1.2-alpha.3",
3
+ "version": "2.1.2-alpha.4",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",