adverich-kun-ui 0.1.532 → 0.1.533

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,74 +1,72 @@
1
- import { ref as h, computed as L, watch as v, nextTick as m } from "vue";
2
- import { useRoute as S, useRouter as $ } from "vue-router";
3
- function k(z) {
1
+ import { ref as h, computed as S, watch as w, nextTick as d } from "vue";
2
+ import { useRoute as V, useRouter as $ } from "vue-router";
3
+ function P(T) {
4
4
  const {
5
5
  modelValue: l,
6
- emit: x,
6
+ emit: g,
7
7
  tabsWrapper: a,
8
- tabsContainer: W,
8
+ tabsContainer: z,
9
9
  multiple: c = !1,
10
- mandatory: b = !1,
11
- centerActive: y = !1,
10
+ mandatory: v = !1,
11
+ centerActive: m = !1,
12
12
  direction: s = "horizontal"
13
- } = z, i = h(c ? [] : null), r = h([]), p = S();
14
- $();
15
- const A = (t) => {
13
+ } = T, i = h(c ? [] : null), r = h([]);
14
+ V(), $();
15
+ const W = (t) => {
16
16
  t && !r.value.includes(t) && r.value.push(t);
17
- }, d = (t) => r.value.findIndex((e) => {
17
+ }, p = (t) => r.value.findIndex((e) => {
18
18
  var o;
19
19
  return ((o = e == null ? void 0 : e.dataset) == null ? void 0 : o.value) == t;
20
- }), B = () => {
20
+ }), A = () => {
21
21
  if (c)
22
- i.value = (Array.isArray(l) ? l : []).map(d).filter((t) => t >= 0);
22
+ i.value = (Array.isArray(l) ? l : []).map(p).filter((t) => t >= 0);
23
23
  else {
24
- const t = d(l);
25
- i.value = t >= 0 ? t : null, y && t >= 0 && w(t);
24
+ const t = p(l);
25
+ i.value = t >= 0 ? t : null, m && t >= 0 && x(t);
26
26
  }
27
- }, w = (t) => m(() => {
27
+ }, x = (t) => d(() => {
28
28
  const e = a.value, o = r.value[t];
29
29
  if (e && o) {
30
30
  const n = s === "horizontal" ? o.offsetLeft + o.offsetWidth / 2 - e.clientWidth / 2 : o.offsetTop + o.offsetHeight / 2 - e.clientHeight / 2;
31
31
  s === "horizontal" ? e.scrollTo({ left: n, behavior: "smooth" }) : e.scrollTo({ top: n, behavior: "smooth" });
32
32
  }
33
- }), H = L(() => {
33
+ }), B = S(() => {
34
34
  if (c || i.value == null) return null;
35
35
  const t = r.value[i.value];
36
36
  return t ? s === "horizontal" ? { left: `${t.offsetLeft}px`, width: `${t.offsetWidth}px` } : { top: `${t.offsetTop}px`, height: `${t.offsetHeight}px`, width: "2px", left: "0" } : null;
37
- }), T = h(!1), g = h(!1), f = () => {
38
- const t = a.value, e = W.value;
39
- !t || !e || (T.value = s === "horizontal" ? t.scrollLeft > 0 : t.scrollTop > 0, g.value = s === "horizontal" ? e.scrollWidth > t.clientWidth + t.scrollLeft : e.scrollHeight > t.clientHeight + t.scrollTop);
40
- }, u = 100, P = () => {
37
+ }), b = h(!1), y = h(!1), f = () => {
38
+ const t = a.value, e = z.value;
39
+ !t || !e || (b.value = s === "horizontal" ? t.scrollLeft > 0 : t.scrollTop > 0, y.value = s === "horizontal" ? e.scrollWidth > t.clientWidth + t.scrollLeft : e.scrollHeight > t.clientHeight + t.scrollTop);
40
+ }, u = 100, H = () => {
41
41
  const t = a.value;
42
42
  t && (s === "horizontal" ? t.scrollBy({ left: -u, behavior: "smooth" }) : t.scrollBy({ top: -u, behavior: "smooth" }), f());
43
- }, V = () => {
43
+ }, I = () => {
44
44
  const t = a.value;
45
45
  t && (s === "horizontal" ? t.scrollBy({ left: u, behavior: "smooth" }) : t.scrollBy({ top: u, behavior: "smooth" }), f());
46
- }, I = (t) => {
46
+ }, L = (t) => {
47
47
  let e;
48
48
  if (c) {
49
49
  const o = Array.isArray(l) ? [...l] : [], n = o.indexOf(t);
50
- n >= 0 ? (b && o.length === 1 || o.splice(n, 1)) && (e = o) : o.push(t) && (e = o);
51
- } else if (e = t === l && b ? l : t, y) {
52
- const o = d(e);
53
- o >= 0 && w(o);
50
+ n >= 0 ? (v && o.length === 1 || o.splice(n, 1)) && (e = o) : o.push(t) && (e = o);
51
+ } else if (e = t === l && v ? l : t, m) {
52
+ const o = p(e);
53
+ o >= 0 && x(o);
54
54
  }
55
- x("update:modelValue", e);
55
+ g("update:modelValue", e);
56
56
  };
57
- return v(() => p.fullPath, () => {
58
- l !== p.fullPath && x("update:modelValue", p.fullPath);
59
- }), v(() => l, () => {
60
- B(), m(f);
61
- }, { immediate: !0 }), v(r, () => m(f), { deep: !0 }), {
57
+ return w(() => l, () => {
58
+ A(), d(f);
59
+ }, { immediate: !0 }), w(r, () => d(f), { deep: !0 }), {
62
60
  activeIndexes: i,
63
- sliderStyle: H,
64
- registerTab: A,
65
- showPrev: T,
66
- showNext: g,
67
- scrollNext: V,
68
- scrollPrev: P,
69
- select: I
61
+ sliderStyle: B,
62
+ registerTab: W,
63
+ showPrev: b,
64
+ showNext: y,
65
+ scrollNext: I,
66
+ scrollPrev: H,
67
+ select: L
70
68
  };
71
69
  }
72
70
  export {
73
- k as useTabsGroup
71
+ P as useTabsGroup
74
72
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.532",
3
+ "version": "0.1.533",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",