@wikicasa-dev/components 2.5.3-alpha.23 → 2.5.3-alpha.26

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-autoplay.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.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-autoplay.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.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-autoplay.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.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-autoplay.css';/* empty css */
1
+ import '../../assets/swiper-keyboard.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 +1 @@
1
- .swiper.uikit-carousel[data-v-a28a8566]{opacity:0}.swiper.uikit-carousel.is-initialized[data-v-a28a8566]{opacity:1}
1
+ .swiper.uikit-carousel[data-v-f7d0c8cf]{opacity:0}.swiper.uikit-carousel.is-initialized[data-v-f7d0c8cf]{opacity:1}
@@ -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,11 +1,11 @@
1
1
  import o from "../../../packages/components/lib/components/carousel/Primitive/SwiperRootPrimitive.vue.js";
2
- import { addModuleDescriptorKey as d, setLazyImagesLoaderKey as f } from "../../../packages/components/lib/components/carousel/Primitive/SwiperRootPrimitive.vue.js";
2
+ import { addModuleDescriptorKey as f, setLazyImagesLoaderKey as s } from "../../../packages/components/lib/components/carousel/Primitive/SwiperRootPrimitive.vue.js";
3
3
  import '../../../assets/SwiperRootPrimitive2.css';import '../../../assets/SwiperRootPrimitive.css';/* empty css */
4
4
  /* empty css */
5
5
  import r from "../../../_virtual/_plugin-vue_export-helper.js";
6
- const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a28a8566"]]);
6
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-f7d0c8cf"]]);
7
7
  export {
8
- d as addModuleDescriptorKey,
9
- m as default,
10
- f as setLazyImagesLoaderKey
8
+ f as addModuleDescriptorKey,
9
+ p as default,
10
+ s as setLazyImagesLoaderKey
11
11
  };
@@ -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/SwiperSlideImagePrimitive.css';import './assets/SwiperCarousel.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/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,105 +1,118 @@
1
- import { defineComponent as V, shallowRef as w, useTemplateRef as g, onMounted as x, provide as I, createElementBlock as P, openBlock as k, createElementVNode as N, createCommentVNode as A, normalizeClass as B, renderSlot as S } from "vue";
2
- import { createSwiper as D } 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
- import { ZoomModule as U } from "../../../../../../Swiper/Zoom/factory.js";
6
- const $ = { class: "uikit-relative" }, q = {
1
+ import { defineComponent as L, shallowRef as w, useTemplateRef as D, onMounted as N, provide as b, createElementBlock as P, openBlock as h, createElementVNode as U, createCommentVNode as A, normalizeClass as q, renderSlot as k } from "vue";
2
+ import { createSwiper as x } from "../../../../../../Swiper/factory.js";
3
+ import { AutoplayModule as G } 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 $ = { class: "uikit-relative" }, Z = {
7
7
  key: 0,
8
8
  class: "uikit-absolute uikit-inset-0"
9
- }, G = /* @__PURE__ */ Symbol(), Z = /* @__PURE__ */ Symbol(), X = /* @__PURE__ */ V({
9
+ }, j = /* @__PURE__ */ Symbol(), F = /* @__PURE__ */ Symbol(), _ = /* @__PURE__ */ L({
10
10
  __name: "SwiperRootPrimitive",
11
11
  props: {
12
12
  rootClasses: {},
13
13
  swiperOptions: {}
14
14
  },
15
15
  emits: ["moved", "click", "init"],
16
- setup(o, { expose: T, emit: h }) {
17
- const d = h, r = w(null), u = g("root"), l = w(!1), E = !!o.swiperOptions?.keyboard, O = !!o.swiperOptions?.autoplay, m = [];
16
+ setup(i, { expose: E, emit: S }) {
17
+ const m = S, l = w(null), p = D("root"), d = w(!1), T = !!i.swiperOptions?.keyboard, C = !!i.swiperOptions?.autoplay, v = [];
18
18
  let c = !1;
19
- const b = (e) => [
19
+ const O = (e) => {
20
+ "requestIdleCallback" in window ? requestIdleCallback(e) : setTimeout(e, 200);
21
+ }, f = (e) => [
20
22
  ...e?.querySelectorAll("img[data-src]") ?? []
21
- ], p = (e) => {
23
+ ], u = (e) => {
22
24
  e.src = e.dataset.src || "", e.srcset = e.dataset.srcset || "", e.dataset.src = "", e.dataset.srcset = "", e.removeAttribute("lazy");
23
- }, v = (e, t) => {
24
- if (!c) return [];
25
- const i = e.params.lazyPreloadPrevNext ?? 0, a = [];
26
- for (let n = t - i; n <= t + i; n++)
27
- a.push(...b(e.slides[n]));
28
- return a;
29
- }, f = () => {
30
- console.log("DEBUG:triggering init event"), l.value = !0, d("init");
25
+ }, I = (e, o) => {
26
+ if (!c) return { visibleImages: [], preloadImages: [] };
27
+ const t = e.params.lazyPreloadPrevNext ?? 0, r = f(e.slides[o]), n = [];
28
+ for (let s = o - t; s <= o + t; s++)
29
+ s !== o && (!e.params.loop && (s < 0 || s >= e.slides.length) || n.push(...f(e.slides[s])));
30
+ return { visibleImages: r, preloadImages: n };
31
+ }, y = () => {
32
+ console.log("DEBUG:triggering init event"), d.value = !0, m("init");
31
33
  }, z = async (e) => {
32
- r.value = await D(
34
+ l.value = await x(
33
35
  e,
34
36
  {
35
37
  on: {
36
- init: async (t) => {
37
- const i = v(t, t.activeIndex);
38
- if (!i.length) {
39
- f();
38
+ init: async (o) => {
39
+ const { visibleImages: t, preloadImages: r } = I(
40
+ o,
41
+ o.activeIndex
42
+ );
43
+ if (!t.length) {
44
+ y();
40
45
  return;
41
46
  }
42
- let a;
43
- const n = new Promise(
44
- (s) => a = setTimeout(s, 6e3)
45
- ), L = Promise.all(
46
- i.map((s) => {
47
- const M = s.complete && s.src ? Promise.resolve() : new Promise((y) => {
48
- s.addEventListener("load", () => y(), { once: !0 }), s.addEventListener("error", () => y(), {
47
+ let n;
48
+ const s = new Promise(
49
+ (a) => n = setTimeout(a, 6e3)
50
+ ), V = Promise.all(
51
+ t.map((a) => {
52
+ const B = a.complete && a.src ? Promise.resolve() : new Promise((g) => {
53
+ a.addEventListener("load", () => g(), { once: !0 }), a.addEventListener("error", () => g(), {
49
54
  once: !0
50
55
  });
51
56
  });
52
- return p(s), M;
57
+ return u(a), B;
53
58
  })
54
59
  ).finally(() => {
55
- clearTimeout(a);
60
+ clearTimeout(n);
56
61
  });
57
- await Promise.race([L, n]), f();
62
+ await Promise.race([V, s]), O(() => {
63
+ console.log("DEBUG:preloading neighbours", r), r.forEach(u);
64
+ }), y();
58
65
  },
59
- slideChange: (t) => {
60
- d("moved", { activeIndex: t.activeIndex }), v(t, t.activeIndex).forEach(
61
- p
66
+ slideChange: (o) => {
67
+ m("moved", { activeIndex: o.activeIndex });
68
+ const { visibleImages: t, preloadImages: r } = I(
69
+ o,
70
+ o.activeIndex
62
71
  );
72
+ console.log("DEBUG:preloading neighbours", [
73
+ ...t,
74
+ ...r
75
+ ]), [...t, ...r].forEach(u);
63
76
  }
64
77
  },
65
- ...o.swiperOptions
78
+ ...i.swiperOptions
66
79
  },
67
80
  [
68
- U(o.swiperOptions?.zoom),
69
- E ? R(o.swiperOptions?.keyboard) : void 0,
70
- O ? K(o.swiperOptions.autoplay) : void 0,
71
- ...m
81
+ R(i.swiperOptions?.zoom),
82
+ T ? K(i.swiperOptions?.keyboard) : void 0,
83
+ C ? G(i.swiperOptions.autoplay) : void 0,
84
+ ...v
72
85
  ].filter(Boolean)
73
86
  );
74
87
  };
75
- x(() => {
76
- u.value && setTimeout(() => z(u.value));
88
+ N(() => {
89
+ p.value && setTimeout(() => z(p.value));
77
90
  });
78
- const C = (e) => {
79
- !r.value || r.value.params.slidesPerView === e || (r.value.params.slidesPerView = e, r.value.update());
91
+ const M = (e) => {
92
+ !l.value || l.value.params.slidesPerView === e || (l.value.params.slidesPerView = e, l.value.update());
80
93
  };
81
- return I(Z, (e) => {
82
- e && m.push(e);
83
- }), I(G, (e) => {
94
+ return b(F, (e) => {
95
+ e && v.push(e);
96
+ }), b(j, (e) => {
84
97
  e !== c && (c = e);
85
- }), T({
86
- swiper: r,
87
- updateSlidesPerView: C
88
- }), (e, t) => (k(), P("div", $, [
89
- N("div", {
98
+ }), E({
99
+ swiper: l,
100
+ updateSlidesPerView: M
101
+ }), (e, o) => (h(), P("div", $, [
102
+ U("div", {
90
103
  ref: "root",
91
- class: B(["swiper uikit-carousel", [{ "is-initialized": l.value }, o.rootClasses]])
104
+ class: q(["swiper uikit-carousel", [{ "is-initialized": d.value }, i.rootClasses]])
92
105
  }, [
93
- S(e.$slots, "default", {}, void 0, !0)
106
+ k(e.$slots, "default", {}, void 0, !0)
94
107
  ], 2),
95
- l.value ? A("", !0) : (k(), P("div", q, [
96
- S(e.$slots, "placeholder", {}, void 0, !0)
108
+ d.value ? A("", !0) : (h(), P("div", Z, [
109
+ k(e.$slots, "placeholder", {}, void 0, !0)
97
110
  ]))
98
111
  ]));
99
112
  }
100
113
  });
101
114
  export {
102
- Z as addModuleDescriptorKey,
103
- X as default,
104
- G as setLazyImagesLoaderKey
115
+ F as addModuleDescriptorKey,
116
+ _ as default,
117
+ j as setLazyImagesLoaderKey
105
118
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wikicasa-dev/components",
3
- "version": "2.5.3-alpha.23",
3
+ "version": "2.5.3-alpha.26",
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}