adverich-kun-ui 0.1.74 → 0.1.76

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,5 +1,5 @@
1
- import { ref as c, provide as p, createElementBlock as v, openBlock as k, normalizeClass as h, renderSlot as x } from "vue";
2
- import { useKunList as A } from "../composables/useKunList.js";
1
+ import { ref as c, provide as v, createElementBlock as b, openBlock as h, normalizeClass as k, renderSlot as A } from "vue";
2
+ import { useKunList as B } from "../composables/useKunList.js";
3
3
  const K = {
4
4
  __name: "KunList",
5
5
  props: {
@@ -9,68 +9,64 @@ const K = {
9
9
  selectable: {
10
10
  type: [Boolean, String],
11
11
  default: !1,
12
- validator: (r) => ["single", "multiple", !0, !1].includes(r)
13
- },
14
- selectedClass: {
15
- type: String,
16
- default: "bg-blue-100 text-blue-600 dark:bg-blue-900 dark:text-blue-300"
12
+ validator: (o) => ["single", "multiple", !0, !1].includes(o)
17
13
  },
18
14
  bgList: {
19
15
  type: String,
20
- default: "bg-gray-100 dark:bg-gray-800"
16
+ default: "bg-transparent"
21
17
  }
22
18
  },
23
19
  emits: ["keyDown"],
24
- setup(r, { expose: d, emit: g }) {
25
- const b = r, m = g;
26
- A(b);
27
- const u = c(null), o = c([]);
20
+ setup(o, { expose: d, emit: m }) {
21
+ const g = o, w = m;
22
+ B(g);
23
+ const u = c(null), l = c([]);
28
24
  d({
29
25
  focusWithKey: (e) => {
30
- var n, l;
31
- const t = o.value.filter(Boolean);
32
- t.length !== 0 && (e === "ArrowDown" ? (n = t[0]) == null || n.focus() : e === "ArrowUp" && ((l = t[t.length - 1]) == null || l.focus()));
26
+ var t, r;
27
+ const n = l.value.filter(Boolean);
28
+ n.length !== 0 && (e === "ArrowDown" ? (t = n[0]) == null || t.focus() : e === "ArrowUp" && ((r = n[n.length - 1]) == null || r.focus()));
33
29
  },
34
30
  focus: () => {
35
- var e, t;
36
- (t = (e = u.value) == null ? void 0 : e.focus) == null || t.call(e);
31
+ var e, n;
32
+ (n = (e = u.value) == null ? void 0 : e.focus) == null || n.call(e);
37
33
  }
38
- }), p("registerListItemRef", (e) => {
39
- e ? o.value.includes(e) || o.value.push(e) : o.value = o.value.filter((t) => t !== e);
34
+ }), v("registerListItemRef", (e) => {
35
+ e ? l.value.includes(e) || l.value.push(e) : l.value = l.value.filter((n) => n !== e);
40
36
  });
41
- function y(e) {
42
- var a, i, f;
43
- const t = e.key;
44
- if (m("keyDown", e), !["ArrowDown", "ArrowUp"].includes(t)) return;
37
+ function p(e) {
38
+ var i, a, f;
39
+ const n = e.key;
40
+ if (w("keyDown", e), !["ArrowDown", "ArrowUp"].includes(n)) return;
45
41
  e.preventDefault();
46
- const n = o.value.filter(Boolean);
47
- if (n.length === 0) return;
48
- const l = n.findIndex((w) => w === document.activeElement);
49
- if (l === -1) {
50
- t === "ArrowDown" ? (a = n[0]) == null || a.focus() : t === "ArrowUp" && ((i = n[n.length - 1]) == null || i.focus());
42
+ const t = l.value.filter(Boolean);
43
+ if (t.length === 0) return;
44
+ const r = t.findIndex((y) => y === document.activeElement);
45
+ if (r === -1) {
46
+ n === "ArrowDown" ? (i = t[0]) == null || i.focus() : n === "ArrowUp" && ((a = t[t.length - 1]) == null || a.focus());
51
47
  return;
52
48
  }
53
- let s = l;
54
- t === "ArrowDown" ? s = (l + 1) % n.length : t === "ArrowUp" && (s = (l - 1 + n.length) % n.length), (f = n[s]) == null || f.focus();
49
+ let s = r;
50
+ n === "ArrowDown" ? s = (r + 1) % t.length : n === "ArrowUp" && (s = (r - 1 + t.length) % t.length), (f = t[s]) == null || f.focus();
55
51
  }
56
- return (e, t) => (k(), v("ul", {
52
+ return (e, n) => (h(), b("ul", {
57
53
  role: "list",
58
- class: h(["w-full bg-gray-500", [
54
+ class: k(["w-full bg-gray-500", [
59
55
  "kun-list",
60
- r.bgList,
56
+ o.bgList,
61
57
  {
62
- "space-y-1": !r.dense,
63
- "space-y-0.5": r.dense,
64
- "pl-4 border-l-2 border-gray-200 dark:border-gray-700": r.sub,
65
- "bg-gray-100 dark:bg-gray-800 p-2 rounded-md": r.nav
58
+ "space-y-1": !o.dense,
59
+ "space-y-0.5": o.dense,
60
+ "pl-4 border-l-2 border-gray-300 dark:border-gray-700": o.sub,
61
+ "p-2 rounded-md": o.nav
66
62
  }
67
63
  ]]),
68
64
  ref_key: "ulRef",
69
65
  ref: u,
70
66
  tabindex: "-1",
71
- onKeydown: y
67
+ onKeydown: p
72
68
  }, [
73
- x(e.$slots, "default")
69
+ A(e.$slots, "default")
74
70
  ], 34));
75
71
  }
76
72
  };
@@ -1,4 +1,4 @@
1
- import { ref as i, inject as o, onMounted as d, onBeforeUnmount as f, watch as g, computed as b, createElementBlock as v, openBlock as m, normalizeClass as k, renderSlot as y } from "vue";
1
+ import { ref as i, inject as o, onMounted as f, onBeforeUnmount as d, watch as g, computed as v, createElementBlock as b, openBlock as m, normalizeClass as k, renderSlot as y } from "vue";
2
2
  const S = {
3
3
  __name: "KunListItem",
4
4
  props: {
@@ -15,43 +15,48 @@ const S = {
15
15
  },
16
16
  bgItems: {
17
17
  type: String,
18
- default: "bg-gray-200 dark:bg-gray-700"
18
+ default: "bg-transparent"
19
19
  },
20
20
  hoverBg: {
21
21
  type: String,
22
22
  default: "hover:bg-gray-100 dark:hover:bg-gray-600"
23
+ },
24
+ noGutters: {
25
+ type: Boolean,
26
+ default: !1
23
27
  }
24
28
  },
25
- setup(l) {
26
- const t = l, n = i(null), r = o("registerListItemRef", null), e = o("kun-list", null);
27
- d(() => {
28
- r && n.value && r(n.value);
29
- }), f(() => {
30
- r && r(null);
29
+ setup(e) {
30
+ const l = e, r = i(null), n = o("registerListItemRef", null), t = o("kun-list", null);
31
+ f(() => {
32
+ n && r.value && n(r.value);
33
+ }), d(() => {
34
+ n && n(null);
31
35
  });
32
- const u = i(t.active);
33
- g(() => t.active, (a) => {
36
+ const u = i(l.active);
37
+ g(() => l.active, (a) => {
34
38
  u.value = a;
35
39
  });
36
- const s = b(() => {
40
+ const s = v(() => {
37
41
  var a;
38
- return ((a = e == null ? void 0 : e.isSelected) == null ? void 0 : a.call(e, t.value)) ?? !1;
42
+ return ((a = t == null ? void 0 : t.isSelected) == null ? void 0 : a.call(t, l.value)) ?? !1;
39
43
  });
40
44
  function c() {
41
- t.disabled || e && t.value !== null && e.toggleItem(t.value);
45
+ l.disabled || t && l.value !== null && t.toggleItem(l.value);
42
46
  }
43
- return (a, B) => (m(), v("li", {
47
+ return (a, B) => (m(), b("li", {
44
48
  ref_key: "liRef",
45
- ref: n,
49
+ ref: r,
46
50
  role: "listitem",
47
51
  tabindex: "-1",
48
52
  class: k(["w-full flex flex-col items-start", [
49
53
  "kun-list-item",
50
- l.bgItems,
54
+ e.bgItems,
51
55
  {
52
- "cursor-not-allowed": l.disabled,
53
- [`px-4 py-2 cursor-pointer ${l.hoverBg}`]: !l.disabled,
54
- [l.activeClass]: s.value || u.value
56
+ "cursor-not-allowed": e.disabled,
57
+ [`cursor-pointer ${e.hoverBg}`]: !e.disabled,
58
+ [e.activeClass]: s.value || u.value,
59
+ "px-4 py-2": !e.noGutters
55
60
  }
56
61
  ]]),
57
62
  onClick: c
@@ -1,5 +1,5 @@
1
- import { createElementBlock as n, openBlock as r, normalizeClass as a, renderSlot as o, createTextVNode as s, toDisplayString as i } from "vue";
2
- const p = {
1
+ import { createElementBlock as l, openBlock as r, normalizeClass as a, renderSlot as o, createTextVNode as s, toDisplayString as i } from "vue";
2
+ const u = {
3
3
  __name: "KunListItemTitle",
4
4
  props: {
5
5
  title: {
@@ -16,12 +16,12 @@ const p = {
16
16
  },
17
17
  class: {
18
18
  type: [String, Object, Array],
19
- default: null
19
+ default: "font-semibold uppercase"
20
20
  }
21
21
  },
22
22
  setup(e) {
23
23
  const t = e;
24
- return (l, u) => (r(), n("span", {
24
+ return (n, p) => (r(), l("span", {
25
25
  class: a([
26
26
  "truncate",
27
27
  t.fontSize,
@@ -29,12 +29,12 @@ const p = {
29
29
  t.class
30
30
  ])
31
31
  }, [
32
- o(l.$slots, "default", {}, () => [
32
+ o(n.$slots, "default", {}, () => [
33
33
  s(i(t.title), 1)
34
34
  ])
35
35
  ], 2));
36
36
  }
37
37
  };
38
38
  export {
39
- p as default
39
+ u as default
40
40
  };
package/dist/index.js CHANGED
@@ -1,121 +1,124 @@
1
1
  /* empty css */
2
2
  import r from "./components/KunAlert/src/components/KunAlert.vue.js";
3
- import o from "./components/KunAppbar/src/components/KunAppbar.vue.js";
4
- import t from "./components/KunAppbarTitle/src/components/KunAppbarTitle.vue.js";
3
+ import t from "./components/KunAppbar/src/components/KunAppbar.vue.js";
4
+ import o from "./components/KunAppbarTitle/src/components/KunAppbarTitle.vue.js";
5
5
  import a from "./components/KunAutocomplete/src/components/KunAutocomplete.vue.js";
6
6
  import s from "./components/KunBtn/src/components/KunBtn.vue.js";
7
7
  import u from "./components/KunBudge/src/components/KunBudge.vue.js";
8
8
  import f from "./components/KunCard/src/components/KunCard.vue.js";
9
9
  import K from "./components/KunCardActions/src/components/KunCardActions.vue.js";
10
10
  import _ from "./components/KunCardItem/src/components/KunCardItem.vue.js";
11
- import p from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
12
- import c from "./components/KunCardText/src/components/KunCardText.vue.js";
13
- import e from "./components/KunCardTitle/src/components/KunCardTitle.vue.js";
11
+ import e from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
12
+ import p from "./components/KunCardText/src/components/KunCardText.vue.js";
13
+ import c from "./components/KunCardTitle/src/components/KunCardTitle.vue.js";
14
14
  import $ from "./components/KunChip/src/components/KunChip.vue.js";
15
15
  import l from "./components/KunCol/src/components/KunCol.vue.js";
16
16
  import d from "./components/KunContainer/src/components/KunContainer.vue.js";
17
17
  import C from "./components/KunCurrency/src/components/KunCurrency.vue.js";
18
18
  import L from "./components/KunDivider/src/components/KunDivider.vue.js";
19
19
  import I from "./components/KunForm/src/components/KunForm.vue.js";
20
- import A from "./components/KunIcon/src/components/KunIcon.vue.js";
21
- import T from "./components/KunList/src/components/KunList.vue.js";
20
+ import T from "./components/KunIcon/src/components/KunIcon.vue.js";
21
+ import A from "./components/KunList/src/components/KunList.vue.js";
22
22
  import b from "./components/KunListGroup/src/components/KunListGroup.vue.js";
23
23
  import S from "./components/KunListImg/src/components/KunListImg.vue.js";
24
24
  import x from "./components/KunListItem/src/components/KunListItem.vue.js";
25
25
  import h from "./components/KunListItemAction/src/components/KunListItemAction.vue.js";
26
26
  import g from "./components/KunListItemAvatar/src/components/KunListItemAvatar.vue.js";
27
27
  import v from "./components/KunListItemSubtitle/src/components/KunListItemSubtitle.vue.js";
28
- import w from "./components/KunListItemText/src/components/KunListItemText.vue.js";
29
- import B from "./components/KunListSubheader/src/components/KunListSubheader.vue.js";
30
- import F from "./components/kunMenu/src/components/kunMenu.vue.js";
31
- import y from "./components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
32
- import D from "./components/KunRow/src/components/KunRow.vue.js";
33
- import G from "./components/KunSlider/src/components/KunSlider.vue.js";
34
- import R from "./components/KunSpacer/src/components/KunSpacer.vue.js";
35
- import j from "./components/KunSwitch/src/components/KunSwitch.vue.js";
36
- import k from "./components/KunTextField/src/components/KunTextField.vue.js";
37
- import q from "./components/KunToolbar/src/components/KunToolbar.vue.js";
28
+ import w from "./components/KunListItemTitle/src/components/KunListItemTitle.vue.js";
29
+ import B from "./components/KunListItemText/src/components/KunListItemText.vue.js";
30
+ import F from "./components/KunListSubheader/src/components/KunListSubheader.vue.js";
31
+ import y from "./components/kunMenu/src/components/kunMenu.vue.js";
32
+ import D from "./components/KunLoaderCircular/src/components/KunLoaderCircular.vue.js";
33
+ import G from "./components/KunRow/src/components/KunRow.vue.js";
34
+ import R from "./components/KunSlider/src/components/KunSlider.vue.js";
35
+ import j from "./components/KunSpacer/src/components/KunSpacer.vue.js";
36
+ import k from "./components/KunSwitch/src/components/KunSwitch.vue.js";
37
+ import q from "./components/KunTextField/src/components/KunTextField.vue.js";
38
+ import z from "./components/KunToolbar/src/components/KunToolbar.vue.js";
38
39
  import M from "./components/KunTooltip/src/components/KunTooltip.vue.js";
39
- const m = {
40
+ const n = {
40
41
  KunAlert: r,
41
- KunAppbar: o,
42
- KunAppbarTitle: t,
42
+ KunAppbar: t,
43
+ KunAppbarTitle: o,
43
44
  KunAutocomplete: a,
44
45
  KunBtn: s,
45
46
  KunBudge: u,
46
47
  KunCard: f,
47
48
  KunCardActions: K,
48
49
  KunCardItem: _,
49
- KunCardSubtitle: p,
50
- KunCardText: c,
51
- KunCardTitle: e,
50
+ KunCardSubtitle: e,
51
+ KunListItemTitle: w,
52
+ KunCardText: p,
53
+ KunCardTitle: c,
52
54
  KunChip: $,
53
55
  KunCol: l,
54
56
  KunContainer: d,
55
57
  KunCurrency: C,
56
58
  KunDivider: L,
57
59
  KunForm: I,
58
- KunIcon: A,
59
- KunList: T,
60
+ KunIcon: T,
61
+ KunList: A,
60
62
  KunListGroup: b,
61
63
  KunListImg: S,
62
64
  KunListItem: x,
63
65
  KunListItemAction: h,
64
66
  KunListItemAvatar: g,
65
67
  KunListItemSubtitle: v,
66
- KunListItemText: w,
67
- KunListSubheader: B,
68
- KunMenu: F,
69
- KunLoaderCircular: y,
70
- KunRow: D,
71
- KunSlider: G,
72
- KunSpacer: R,
73
- KunSwitch: j,
74
- KunTextField: k,
75
- KunToolbar: q,
68
+ KunListItemText: B,
69
+ KunListSubheader: F,
70
+ KunMenu: y,
71
+ KunLoaderCircular: D,
72
+ KunRow: G,
73
+ KunSlider: R,
74
+ KunSpacer: j,
75
+ KunSwitch: k,
76
+ KunTextField: q,
77
+ KunToolbar: z,
76
78
  KunTooltip: M
77
79
  };
78
- function xn(i) {
79
- for (const n in m)
80
- i.component(n, m[n]);
80
+ function hm(i) {
81
+ for (const m in n)
82
+ i.component(m, n[m]);
81
83
  }
82
84
  export {
83
85
  r as KunAlert,
84
- o as KunAppbar,
85
- t as KunAppbarTitle,
86
+ t as KunAppbar,
87
+ o as KunAppbarTitle,
86
88
  a as KunAutocomplete,
87
89
  s as KunBtn,
88
90
  u as KunBudge,
89
91
  f as KunCard,
90
92
  K as KunCardActions,
91
93
  _ as KunCardItem,
92
- p as KunCardSubtitle,
93
- c as KunCardText,
94
- e as KunCardTitle,
94
+ e as KunCardSubtitle,
95
+ p as KunCardText,
96
+ c as KunCardTitle,
95
97
  $ as KunChip,
96
98
  l as KunCol,
97
99
  d as KunContainer,
98
100
  C as KunCurrency,
99
101
  L as KunDivider,
100
102
  I as KunForm,
101
- A as KunIcon,
102
- T as KunList,
103
+ T as KunIcon,
104
+ A as KunList,
103
105
  b as KunListGroup,
104
106
  S as KunListImg,
105
107
  x as KunListItem,
106
108
  h as KunListItemAction,
107
109
  g as KunListItemAvatar,
108
110
  v as KunListItemSubtitle,
109
- w as KunListItemText,
110
- B as KunListSubheader,
111
- y as KunLoaderCircular,
112
- F as KunMenu,
113
- D as KunRow,
114
- G as KunSlider,
115
- R as KunSpacer,
116
- j as KunSwitch,
117
- k as KunTextField,
118
- q as KunToolbar,
111
+ B as KunListItemText,
112
+ w as KunListItemTitle,
113
+ F as KunListSubheader,
114
+ D as KunLoaderCircular,
115
+ y as KunMenu,
116
+ G as KunRow,
117
+ R as KunSlider,
118
+ j as KunSpacer,
119
+ k as KunSwitch,
120
+ q as KunTextField,
121
+ z as KunToolbar,
119
122
  M as KunTooltip,
120
- xn as install
123
+ hm as install
121
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.74",
3
+ "version": "0.1.76",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",