@wikicasa-dev/components 2.5.3-alpha.15 → 2.5.3-alpha.17

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-thumbs.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-thumbs.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-thumbs.css';/* empty css */
2
2
  import { Keyboard 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-thumbs.css';/* empty css */
2
2
  import { Thumbs as t } from "swiper/modules";
3
3
  export {
4
4
  t as default
@@ -1 +1 @@
1
- .swiper-pagination-bullet{--swiper-pagination-color: #ccc}.swiper-pagination-bullet-active{--swiper-pagination-color: #fff}
1
+ .no-transition[data-v-f8f3d52a]{transition-duration:0ms!important}.disable-select[data-v-f8f3d52a]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-f8f3d52a]{pointer-events:auto!important}
@@ -0,0 +1 @@
1
+ .swiper-pagination-bullet{--swiper-pagination-color: #ccc}.swiper-pagination-bullet-active{--swiper-pagination-color: #fff}
@@ -1,5 +1,5 @@
1
1
  import o from "../../../packages/components/lib/components/carousel/Primitive/SwiperPaginationPrimitive.vue.js";
2
- import '../../../assets/SwiperCarousel.css';/* empty css */
2
+ import '../../../assets/SwiperPaginationPrimitive.css';/* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import o from "../../packages/components/lib/components/carousel/SwiperCarousel.vue.js";
2
- import '../../assets/SwiperCarousel2.css';import '../../assets/SwiperCarousel.css';/* empty css */
2
+ import '../../assets/SwiperCarousel.css';import '../../assets/SwiperPaginationPrimitive.css';/* empty css */
3
3
  /* empty css */
4
4
  import r from "../../_virtual/_plugin-vue_export-helper.js";
5
5
  const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f8f3d52a"]]);
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { default as P } from "./packages/components/lib/UIKit/Accordion/BaseAccordion.vue.js";
2
2
  import { default as v } from "./packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js";
3
- import './assets/SwiperSlideImagePrimitive.css';import './assets/SwiperCarousel.css';import './assets/SwiperRootPrimitive.css';import './assets/BaseSnackbar.css';import './assets/BaseModal.css';import './assets/BaseDropDown.css';import './assets/BaseCard.css';import './assets/BaseBadge.css';import './assets/ClearableAutocomplete.css';import './assets/BaseAutocomplete.css';import './assets/BaseAlert.css';import './assets/AccessibleSelect.css';import './assets/RadioButtonItem.css';import './assets/BaseTabsIndicator.css';import './assets/BaseTabs.css';import './assets/CheckboxBtn.css';import './assets/BaseAccordionItem.css';/* empty css */
3
+ import './assets/SwiperSlideImagePrimitive.css';import './assets/SwiperPaginationPrimitive.css';import './assets/SwiperRootPrimitive.css';import './assets/BaseSnackbar.css';import './assets/BaseModal.css';import './assets/BaseDropDown.css';import './assets/BaseCard.css';import './assets/BaseBadge.css';import './assets/ClearableAutocomplete.css';import './assets/BaseAutocomplete.css';import './assets/BaseAlert.css';import './assets/AccessibleSelect.css';import './assets/RadioButtonItem.css';import './assets/BaseTabsIndicator.css';import './assets/BaseTabs.css';import './assets/CheckboxBtn.css';import './assets/BaseAccordionItem.css';/* empty css */
4
4
  import { default as T } from "./packages/components/lib/UIKit/Accordion/AccordionItemPrimitive.vue.js";
5
5
  import { default as h } from "./packages/components/lib/UIKit/Accordion/AccordionHeaderPrimitive.vue.js";
6
6
  import { default as w } from "./packages/components/lib/UIKit/Accordion/AccordionTriggerPrimitive.vue.js";
@@ -1,109 +1,101 @@
1
- import { defineComponent as S, useAttrs as O, shallowRef as p, useTemplateRef as k, onMounted as L, provide as v, createElementBlock as B, openBlock as D, Fragment as M, withDirectives as U, renderSlot as f, createCommentVNode as b, createElementVNode as V, mergeProps as x, unref as z, vShow as A, nextTick as G } from "vue";
2
- import { createSwiper as N } from "../../../../../../Swiper/factory.js";
3
- import { AutoplayModule as C } from "../../../../../../Swiper/Autoplay/factory.js";
4
- import { KeyboardModule as K } from "../../../../../../Swiper/Keyboard/factory.js";
5
- import { ZoomModule as R } from "../../../../../../Swiper/Zoom/factory.js";
6
- const $ = /* @__PURE__ */ Symbol(), q = /* @__PURE__ */ Symbol(), W = /* @__PURE__ */ S({
1
+ import { defineComponent as x, useAttrs as z, shallowRef as w, useTemplateRef as A, onMounted as g, provide as P, createElementBlock as N, openBlock as C, Fragment as B, withDirectives as D, renderSlot as I, createCommentVNode as K, createElementVNode as R, mergeProps as U, unref as $, vShow as q, nextTick as F } from "vue";
2
+ import { createSwiper as Z } from "../../../../../../Swiper/factory.js";
3
+ import { AutoplayModule as j } from "../../../../../../Swiper/Autoplay/factory.js";
4
+ import { KeyboardModule as G } from "../../../../../../Swiper/Keyboard/factory.js";
5
+ import { ZoomModule as H } from "../../../../../../Swiper/Zoom/factory.js";
6
+ const J = /* @__PURE__ */ Symbol(), Q = /* @__PURE__ */ Symbol(), oe = /* @__PURE__ */ x({
7
7
  inheritAttrs: !1,
8
8
  __name: "SwiperRootPrimitive",
9
9
  props: {
10
10
  swiperOptions: {}
11
11
  },
12
12
  emits: ["moved", "click", "init"],
13
- setup(s, { expose: y, emit: w }) {
14
- const n = w, g = O(), a = p(null), c = k("root"), l = p(!1), T = !!s.swiperOptions?.keyboard, E = !!s.swiperOptions?.autoplay, u = [];
15
- let d = !1;
16
- const I = (e) => {
17
- const t = [
18
- ...e?.querySelectorAll("img[data-src]") ?? []
19
- ];
20
- return t.forEach((o) => {
21
- o.src = o.dataset.src || "", o.srcset = o.dataset.srcset || "", o.dataset.src = "", o.dataset.srcset = "", o.removeAttribute("lazy");
22
- }), t;
23
- }, m = (e, t) => {
24
- const o = [];
25
- if (!d) return o;
26
- const r = e.params.lazyPreloadPrevNext ?? 0;
27
- for (let i = t - r; i <= t + r; i++)
28
- o.push(...I(e.slides[i]));
29
- return o;
30
- }, P = async (e) => {
31
- a.value = await N(
13
+ setup(o, { expose: S, emit: T }) {
14
+ const d = T, h = z(), r = w(null), u = A("root"), l = w(!1), k = !!o.swiperOptions?.keyboard, E = !!o.swiperOptions?.autoplay, m = [];
15
+ let c = !1;
16
+ const O = (e) => [
17
+ ...e?.querySelectorAll("img[data-src]") ?? []
18
+ ], p = (e) => {
19
+ e.src = e.dataset.src || "", e.srcset = e.dataset.srcset || "", e.dataset.src = "", e.dataset.srcset = "", e.removeAttribute("lazy");
20
+ }, v = (e, t) => {
21
+ if (!c) return [];
22
+ const a = e.params.lazyPreloadPrevNext ?? 0, i = [];
23
+ for (let n = t - a; n <= t + a; n++)
24
+ i.push(...O(e.slides[n]));
25
+ return i;
26
+ }, f = () => {
27
+ F(() => {
28
+ l.value = !0, d("init");
29
+ });
30
+ }, b = async (e) => {
31
+ r.value = await Z(
32
32
  e,
33
33
  {
34
34
  on: {
35
- init: (t) => {
36
- G(async () => {
37
- const o = m(t, t.activeIndex);
38
- if (console.log("DEBUG:imagesToLoad", o), !o.length) {
39
- l.value = !0, n("init");
40
- return;
41
- }
42
- await Promise.race([
43
- Promise.all(
44
- o.map((r) => r.complete ? (console.log("DEBUG:img.complete", r), Promise.resolve()) : new Promise((i) => {
45
- r.addEventListener(
46
- "load",
47
- () => {
48
- console.log("DEBUG:img.load", r), i("");
49
- },
50
- { once: !0 }
51
- ), r.addEventListener(
52
- "error",
53
- () => {
54
- console.log("DEBUG:img.error", r), i("");
55
- },
56
- { once: !0 }
57
- );
58
- }))
59
- ),
60
- new Promise(
61
- (r) => setTimeout(() => {
62
- console.log("DEBUG:not all images have loaded => TIMEOUT!"), r("");
63
- }, 6e3)
64
- )
65
- ]), l.value = !0, n("init");
35
+ init: async (t) => {
36
+ const a = v(t, t.activeIndex);
37
+ if (!a.length) {
38
+ f();
39
+ return;
40
+ }
41
+ let i;
42
+ const n = new Promise(
43
+ (s) => i = setTimeout(s, 6e3)
44
+ ), M = Promise.all(
45
+ a.map((s) => {
46
+ const V = s.complete ? Promise.resolve() : new Promise((y) => {
47
+ s.addEventListener("load", () => y(), { once: !0 }), s.addEventListener("error", () => y(), {
48
+ once: !0
49
+ });
50
+ });
51
+ return p(s), V;
52
+ })
53
+ ).finally(() => {
54
+ clearTimeout(i);
66
55
  });
56
+ await Promise.race([M, n]), f();
67
57
  },
68
58
  slideChange: (t) => {
69
- n("moved", { activeIndex: t.activeIndex }), m(t, t.activeIndex);
59
+ d("moved", { activeIndex: t.activeIndex }), v(t, t.activeIndex).forEach(
60
+ p
61
+ );
70
62
  }
71
63
  },
72
- ...s.swiperOptions
64
+ ...o.swiperOptions
73
65
  },
74
66
  [
75
- R(s.swiperOptions?.zoom),
76
- T ? K(s.swiperOptions?.keyboard) : void 0,
77
- E ? C(s.swiperOptions.autoplay) : void 0,
78
- ...u
67
+ H(o.swiperOptions?.zoom),
68
+ k ? G(o.swiperOptions?.keyboard) : void 0,
69
+ E ? j(o.swiperOptions.autoplay) : void 0,
70
+ ...m
79
71
  ].filter(Boolean)
80
72
  );
81
73
  };
82
- L(() => {
83
- c.value && setTimeout(() => P(c.value));
74
+ g(() => {
75
+ u.value && setTimeout(() => b(u.value));
84
76
  });
85
- const h = (e) => {
86
- !a.value || a.value.params.slidesPerView === e || (a.value.params.slidesPerView = e, a.value.update());
77
+ const L = (e) => {
78
+ !r.value || r.value.params.slidesPerView === e || (r.value.params.slidesPerView = e, r.value.update());
87
79
  };
88
- return v(q, (e) => {
89
- e && u.push(e);
90
- }), v($, (e) => {
91
- e !== d && (d = e);
92
- }), y({
93
- swiper: a,
94
- updateSlidesPerView: h
95
- }), (e, t) => (D(), B(M, null, [
96
- U(V("div", x({ ref: "root" }, z(g), { class: "swiper uikit-carousel" }), [
97
- f(e.$slots, "default")
80
+ return P(Q, (e) => {
81
+ e && m.push(e);
82
+ }), P(J, (e) => {
83
+ e !== c && (c = e);
84
+ }), S({
85
+ swiper: r,
86
+ updateSlidesPerView: L
87
+ }), (e, t) => (C(), N(B, null, [
88
+ D(R("div", U({ ref: "root" }, $(h), { class: "swiper uikit-carousel" }), [
89
+ I(e.$slots, "default")
98
90
  ], 16), [
99
- [A, l.value]
91
+ [q, l.value]
100
92
  ]),
101
- l.value ? b("", !0) : f(e.$slots, "placeholder", { key: 0 })
93
+ l.value ? K("", !0) : I(e.$slots, "placeholder", { key: 0 })
102
94
  ], 64));
103
95
  }
104
96
  });
105
97
  export {
106
- q as addModuleDescriptorKey,
107
- W as default,
108
- $ as setLazyImagesLoaderKey
98
+ Q as addModuleDescriptorKey,
99
+ oe as default,
100
+ J as setLazyImagesLoaderKey
109
101
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.5.3-alpha.15",
3
+ "version": "2.5.3-alpha.17",
4
4
  "description": "Wikicasa frontend components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1 +0,0 @@
1
- .no-transition[data-v-f8f3d52a]{transition-duration:0ms!important}.disable-select[data-v-f8f3d52a]{-webkit-user-select:none;-moz-user-select:none;user-select:none}.swiper-button-disabled[data-v-f8f3d52a]{pointer-events:auto!important}