@wikicasa-dev/components 2.5.3-alpha.11 → 2.5.3-alpha.13

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-controller.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-controller.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-controller.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-controller.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
  };
@@ -10,6 +10,7 @@ export interface SwiperSlideImagePrimitiveProps {
10
10
  decoding?: "auto" | "sync" | "async";
11
11
  crossorigin?: "anonymous" | "use-credentials";
12
12
  fetchpriority?: "auto" | "high" | "low";
13
+ loading?: "lazy" | "eager";
13
14
  lazy?: boolean;
14
15
  }
15
16
  declare const _default: import('vue').DefineComponent<SwiperSlideImagePrimitiveProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<SwiperSlideImagePrimitiveProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
@@ -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 S } from "./packages/components/lib/UIKit/Accordion/BaseAccordion.vue.js";
2
2
  import { default as g } from "./packages/components/lib/UIKit/Accordion/BaseAccordionItem.vue.js";
3
- 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/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 C } from "./packages/components/lib/UIKit/Accordion/AccordionItemPrimitive.vue.js";
5
5
  import { default as I } from "./packages/components/lib/UIKit/Accordion/AccordionHeaderPrimitive.vue.js";
6
6
  import { default as A } from "./packages/components/lib/UIKit/Accordion/AccordionTriggerPrimitive.vue.js";
@@ -1,77 +1,102 @@
1
- import { defineComponent as I, useAttrs as O, shallowRef as m, useTemplateRef as V, onMounted as b, provide as p, createElementBlock as x, openBlock as z, Fragment as A, withDirectives as M, renderSlot as f, createCommentVNode as C, createElementVNode as E, mergeProps as B, unref as D, vShow as K, nextTick as L } from "vue";
2
- import { createSwiper as N } from "../../../../../../Swiper/factory.js";
3
- import { AutoplayModule as R } from "../../../../../../Swiper/Autoplay/factory.js";
4
- import { KeyboardModule as T } from "../../../../../../Swiper/Keyboard/factory.js";
1
+ import { defineComponent as O, useAttrs as k, shallowRef as v, useTemplateRef as L, onMounted as b, provide as f, createElementBlock as M, openBlock as z, Fragment as V, withDirectives as x, renderSlot as y, createCommentVNode as A, createElementVNode as B, mergeProps as D, unref as U, vShow as N, nextTick as C } from "vue";
2
+ import { createSwiper as G } from "../../../../../../Swiper/factory.js";
3
+ import { AutoplayModule as K } from "../../../../../../Swiper/Autoplay/factory.js";
4
+ import { KeyboardModule as R } from "../../../../../../Swiper/Keyboard/factory.js";
5
5
  import { ZoomModule as $ } from "../../../../../../Swiper/Zoom/factory.js";
6
- const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), Q = /* @__PURE__ */ I({
6
+ const q = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), X = /* @__PURE__ */ O({
7
7
  inheritAttrs: !1,
8
8
  __name: "SwiperRootPrimitive",
9
9
  props: {
10
10
  swiperOptions: {}
11
11
  },
12
12
  emits: ["moved", "click", "init"],
13
- setup(r, { expose: v, emit: y }) {
14
- const n = y, w = O(), i = m(null), d = V("root"), s = m(!1), S = !!r.swiperOptions?.keyboard, h = !!r.swiperOptions?.autoplay, c = [];
15
- let a = !1;
16
- const k = (e) => {
17
- e?.querySelectorAll("img[data-src]").forEach((t) => {
18
- const o = t;
19
- o.src = o.dataset.src || "", o.srcset = o.dataset.srcset || "";
20
- });
21
- }, u = (e, t) => {
22
- if (!a) return;
23
- const o = e.params.lazyPreloadPrevNext ?? 0;
24
- for (let l = t - o; l <= t + o; l++)
25
- k(e.slides[l]);
26
- }, P = async (e) => {
27
- i.value = await N(
13
+ setup(s, { expose: w, emit: T }) {
14
+ const n = T, g = k(), a = v(null), c = L("root"), l = v(!1), I = !!s.swiperOptions?.keyboard, P = !!s.swiperOptions?.autoplay, u = [];
15
+ let d = !1;
16
+ const h = (e) => {
17
+ const o = [
18
+ ...e?.querySelectorAll("img[data-src]") ?? []
19
+ ];
20
+ return o.forEach((t) => {
21
+ t.src = t.dataset.src || "", t.srcset = t.dataset.srcset || "", t.dataset.src = "", t.dataset.srcset = "", t.removeAttribute("lazy");
22
+ }), o;
23
+ }, m = (e, o) => {
24
+ const t = [];
25
+ if (!d) return t;
26
+ const i = e.params.lazyPreloadPrevNext ?? 0;
27
+ for (let r = o - i; r <= o + i; r++)
28
+ t.push(...h(e.slides[r]));
29
+ return t;
30
+ }, E = async (e) => {
31
+ a.value = await G(
28
32
  e,
29
33
  {
30
34
  on: {
31
- init: (t) => {
32
- L(() => {
33
- s.value = !0, u(t, t.activeIndex), n("init");
35
+ init: (o) => {
36
+ C(async () => {
37
+ const t = m(o, o.activeIndex);
38
+ if (console.log("DEBUG:imagesToLoad", t), !t.length) {
39
+ l.value = !0, n("init");
40
+ return;
41
+ }
42
+ await Promise.race([
43
+ async () => {
44
+ const i = await Promise.all(
45
+ t.map(
46
+ (r) => r.complete ? Promise.resolve() : new Promise((p) => {
47
+ r.addEventListener("load", p, { once: !0 }), r.addEventListener("error", p, { once: !0 });
48
+ })
49
+ )
50
+ );
51
+ return console.log("DEBUG:all visible lazy images loaded"), i;
52
+ },
53
+ new Promise(
54
+ (i) => setTimeout(() => {
55
+ console.log("DEBUG:not all images have loaded => TIMEOUT!"), i("");
56
+ }, 3e3)
57
+ )
58
+ ]), l.value = !0, n("init");
34
59
  });
35
60
  },
36
- slideChange: (t) => {
37
- n("moved", { activeIndex: t.activeIndex }), u(t, t.activeIndex);
61
+ slideChange: (o) => {
62
+ n("moved", { activeIndex: o.activeIndex }), m(o, o.activeIndex);
38
63
  }
39
64
  },
40
- ...r.swiperOptions
65
+ ...s.swiperOptions
41
66
  },
42
67
  [
43
- $(r.swiperOptions?.zoom),
44
- S ? T(r.swiperOptions?.keyboard) : void 0,
45
- h ? R(r.swiperOptions.autoplay) : void 0,
46
- ...c
68
+ $(s.swiperOptions?.zoom),
69
+ I ? R(s.swiperOptions?.keyboard) : void 0,
70
+ P ? K(s.swiperOptions.autoplay) : void 0,
71
+ ...u
47
72
  ].filter(Boolean)
48
73
  );
49
74
  };
50
75
  b(() => {
51
- d.value && setTimeout(() => P(d.value));
76
+ c.value && setTimeout(() => E(c.value));
52
77
  });
53
- const g = (e) => {
54
- !i.value || i.value.params.slidesPerView === e || (i.value.params.slidesPerView = e, i.value.update());
78
+ const S = (e) => {
79
+ !a.value || a.value.params.slidesPerView === e || (a.value.params.slidesPerView = e, a.value.update());
55
80
  };
56
- return p(F, (e) => {
57
- e && c.push(e);
58
- }), p(q, (e) => {
59
- e !== a && (a = e);
60
- }), v({
61
- swiper: i,
62
- updateSlidesPerView: g
63
- }), (e, t) => (z(), x(A, null, [
64
- M(E("div", B({ ref: "root" }, D(w), { class: "swiper uikit-carousel" }), [
65
- f(e.$slots, "default")
81
+ return f(F, (e) => {
82
+ e && u.push(e);
83
+ }), f(q, (e) => {
84
+ e !== d && (d = e);
85
+ }), w({
86
+ swiper: a,
87
+ updateSlidesPerView: S
88
+ }), (e, o) => (z(), M(V, null, [
89
+ x(B("div", D({ ref: "root" }, U(g), { class: "swiper uikit-carousel" }), [
90
+ y(e.$slots, "default")
66
91
  ], 16), [
67
- [K, s.value]
92
+ [N, l.value]
68
93
  ]),
69
- s.value ? C("", !0) : f(e.$slots, "placeholder", { key: 0 })
94
+ l.value ? A("", !0) : y(e.$slots, "placeholder", { key: 0 })
70
95
  ], 64));
71
96
  }
72
97
  });
73
98
  export {
74
99
  F as addModuleDescriptorKey,
75
- Q as default,
100
+ X as default,
76
101
  q as setLazyImagesLoaderKey
77
102
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as i, createPropsRestProxy as o, shallowRef as r, inject as l, createBlock as d, openBlock as n, withCtx as m, createElementVNode as u, mergeProps as g } from "vue";
1
+ import { defineComponent as i, createPropsRestProxy as o, shallowRef as r, inject as l, createBlock as d, openBlock as n, withCtx as m, createElementVNode as g, mergeProps as u } from "vue";
2
2
  import f from "../../../../../../components/carousel/SwiperSlide.js";
3
3
  import { setLazyImagesLoaderKey as y } from "./SwiperRootPrimitive.vue.js";
4
4
  import '../../../../../../assets/SwiperRootPrimitive.css';/* empty css */
@@ -15,13 +15,14 @@ const h = ["src", "srcset", "data-src", "data-srcset"], x = /* @__PURE__ */ i({
15
15
  decoding: {},
16
16
  crossorigin: {},
17
17
  fetchpriority: {},
18
+ loading: {},
18
19
  lazy: { type: Boolean }
19
20
  },
20
21
  setup(e) {
21
22
  const s = o(e, ["src", "srcset", "imgClasses"]), t = r(), a = r(), c = l(y, void 0);
22
23
  return s.lazy && (t.value = e.src, a.value = e.srcset, c?.(!0)), (v, z) => (n(), d(f, null, {
23
24
  default: m(() => [
24
- u("img", g(s, {
25
+ g("img", u(s, {
25
26
  class: e.imgClasses,
26
27
  src: e.lazy ? void 0 : e.src,
27
28
  srcset: e.lazy ? void 0 : e.srcset,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.5.3-alpha.11",
3
+ "version": "2.5.3-alpha.13",
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}