adverich-kun-ui 0.1.76 → 0.1.77

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.
Files changed (35) hide show
  1. package/dist/adverich-kun-ui.css +1 -1
  2. package/dist/components/KunAlert/src/components/KunAlert.vue.js +193 -33
  3. package/dist/components/KunAppbar/src/components/KunAppbar.vue.js +69 -41
  4. package/dist/components/KunAppbarTitle/src/components/KunAppbarTitle.vue.js +9 -5
  5. package/dist/components/KunAutocomplete/src/components/KunAutocomplete.vue.js +51 -52
  6. package/dist/components/KunAutocomplete/src/composables/useAutocomplete.js +1 -1
  7. package/dist/components/KunBtn/src/components/KunBtn.vue.js +86 -77
  8. package/dist/components/KunCard/src/components/KunCard.vue.js +38 -32
  9. package/dist/components/KunCard/src/composables/kunCardProps.js +4 -8
  10. package/dist/components/KunCardActions/src/components/KunCardActions.vue.js +18 -16
  11. package/dist/components/KunCardActions/src/composables/kunCardActionsProps.js +0 -8
  12. package/dist/components/KunCardItem/src/components/KunCardItem.vue.js +17 -16
  13. package/dist/components/KunCardItem/src/composables/kunCardItemProps.js +0 -8
  14. package/dist/components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js +16 -17
  15. package/dist/components/KunCardSubtitle/src/composables/kunCardSubtitleProps.js +1 -9
  16. package/dist/components/KunCardText/src/components/KunCardText.vue.js +16 -17
  17. package/dist/components/KunCardText/src/composables/kunCardTextProps.js +1 -9
  18. package/dist/components/KunCardTitle/src/components/KunCardTitle.vue.js +57 -45
  19. package/dist/components/KunCardTitle/src/composables/kunCardTitleProps.js +5 -25
  20. package/dist/components/KunChip/src/components/KunChip.vue.js +63 -47
  21. package/dist/components/KunChip/src/composables/kunChipProps.js +7 -17
  22. package/dist/components/KunChip/src/composables/useChip.js +10 -19
  23. package/dist/components/KunList/src/components/KunList.vue.js +10 -10
  24. package/dist/components/kunMenu/src/components/kunMenu.vue.js +48 -48
  25. package/dist/components/kunMenu/src/composables/kunMenuProps.js +0 -4
  26. package/dist/components/kunMenu/src/composables/useKunMenuStyles.js +31 -14
  27. package/dist/icons/IconMenuRounded.vue.js +17 -0
  28. package/dist/index.js +12 -12
  29. package/package.json +1 -1
  30. package/dist/components/KunCard/src/composables/useCard.js +0 -17
  31. package/dist/components/KunCardActions/src/composables/useCardActions.js +0 -19
  32. package/dist/components/KunCardItem/src/composables/useCardItem.js +0 -17
  33. package/dist/components/KunCardSubtitle/src/composables/useCardSubtitle.js +0 -15
  34. package/dist/components/KunCardText/src/composables/useCardText.js +0 -15
  35. package/dist/components/KunCardTitle/src/composables/useCardTitle.js +0 -25
@@ -1,74 +1,74 @@
1
- import { onMounted as M, onUnmounted as C, watch as S, createBlock as b, createCommentVNode as K, openBlock as P, Teleport as T, createVNode as V, Transition as B, withCtx as D, withDirectives as I, createElementVNode as L, mergeProps as N, unref as n, withKeys as m, withModifiers as d, renderSlot as W, vShow as z } from "vue";
2
- import { useKunMenu as A } from "../composables/useKunMenu.js";
3
- import { kunMenuProps as F } from "../composables/kunMenuProps.js";
4
- import { useKunMenuStyles as U } from "../composables/useKunMenuStyles.js";
1
+ import { onMounted as S, onUnmounted as K, watch as L, createBlock as T, createCommentVNode as V, openBlock as b, Teleport as z, createVNode as B, Transition as D, withCtx as I, withDirectives as N, createElementVNode as W, mergeProps as A, unref as o, withKeys as m, withModifiers as p, renderSlot as F, vShow as U } from "vue";
2
+ import { useKunMenu as Y } from "../composables/useKunMenu.js";
3
+ import { kunMenuProps as $ } from "../composables/kunMenuProps.js";
4
+ import { useKunMenuStyles as j } from "../composables/useKunMenuStyles.js";
5
5
  /* empty css */
6
- import Y from "../../../../_virtual/_plugin-vue_export-helper.js";
7
- const $ = {
6
+ import q from "../../../../_virtual/_plugin-vue_export-helper.js";
7
+ const G = {
8
8
  __name: "kunMenu",
9
- props: F,
9
+ props: $,
10
10
  emits: ["update:modelValue", "click:outside", "handleEscape"],
11
- setup(p, { emit: f }) {
12
- const s = p, h = f, {
13
- menuVisible: l,
14
- activatorEl: c,
15
- contentEl: r,
16
- handleActivatorClick: v,
11
+ setup(c, { emit: f }) {
12
+ const l = c, h = f, {
13
+ menuVisible: a,
14
+ activatorEl: v,
15
+ contentEl: i,
16
+ handleActivatorClick: w,
17
17
  handleHover: g,
18
- handleFocus: w,
19
- focusCurrentItem: a,
20
- handleEscape: u
21
- } = A(s, h), {
18
+ handleFocus: E,
19
+ focusCurrentItem: u,
20
+ handleEscape: d
21
+ } = Y(l, h), {
22
22
  originClass: y,
23
- setMenuPosition: E
24
- } = U(s, r, c, v, g, w);
25
- M(() => {
26
- E();
27
- }), C(() => {
28
- const e = r.value;
29
- e && e.removeEventListener("wheel", i);
30
- }), S(l, (e) => {
31
- const t = r.value;
32
- t && (e ? t.addEventListener("wheel", i, { passive: !1 }) : t.removeEventListener("wheel", i));
23
+ setMenuPosition: M,
24
+ updatePosition: r,
25
+ computedMaxHeight: k,
26
+ menuPositionStyle: H
27
+ } = j(l, i, v, w, g, E);
28
+ S(() => {
29
+ M(), r(), window.addEventListener("resize", r);
30
+ }), K(() => {
31
+ const e = i.value;
32
+ e && e.removeEventListener("wheel", s), window.removeEventListener("resize", r);
33
+ }), L(a, (e) => {
34
+ const t = i.value;
35
+ t && (e ? (r(), t.addEventListener("wheel", s, { passive: !1 })) : t.removeEventListener("wheel", s));
33
36
  });
34
- function i(e) {
35
- const t = r.value;
37
+ function s(e) {
38
+ const t = i.value;
36
39
  if (!t) return;
37
- const o = e.deltaY > 0, H = t.scrollTop + t.clientHeight >= t.scrollHeight, k = t.scrollTop <= 0;
38
- (o && H || !o && k) && e.preventDefault();
40
+ const n = e.deltaY > 0, C = t.scrollTop + t.clientHeight >= t.scrollHeight, P = t.scrollTop <= 0;
41
+ (n && C || !n && P) && e.preventDefault();
39
42
  }
40
- return (e, t) => e.attach !== !0 ? (P(), b(T, {
43
+ return (e, t) => e.attach !== !0 ? (b(), T(z, {
41
44
  key: 0,
42
45
  to: e.attach || "body"
43
46
  }, [
44
- V(B, { name: e.transition }, {
45
- default: D(() => [
46
- I(L("div", N({
47
+ B(D, { name: e.transition }, {
48
+ default: I(() => [
49
+ N(W("div", A({
47
50
  ref_key: "contentEl",
48
- ref: r,
51
+ ref: i,
49
52
  role: "menu",
50
53
  tabindex: "-1",
51
- class: ["bg-gray-100 rounded shadow-lg overflow-y-auto focus:outline-none mt-0.5 z-10", [e.contentClass, n(y), e.width, e.height, e.minWidth, e.maxWidth, e.minHeight, e.maxHeight, e.zIndex]],
52
- style: {
53
- ...e.menuPositionStyle,
54
- maxHeight: typeof e.maxHeight == "number" ? e.maxHeight + "px" : e.maxHeight
55
- }
54
+ class: ["rounded shadow-lg overflow-y-auto focus:outline-none mt-0.5 z-10", [e.contentClass, o(y), e.width, e.height, e.minWidth, e.maxWidth, e.minHeight, e.maxHeight, e.zIndex]],
55
+ style: { ...o(H), computedMaxHeight: o(k) }
56
56
  }, e.contentProps, {
57
57
  onKeydown: [
58
- t[0] || (t[0] = m(d((...o) => n(a) && n(a)(...o), ["stop"]), ["enter"])),
59
- t[1] || (t[1] = m(d((...o) => n(u) && n(u)(...o), ["stop"]), ["escape"]))
58
+ t[0] || (t[0] = m(p((...n) => o(u) && o(u)(...n), ["stop"]), ["enter"])),
59
+ t[1] || (t[1] = m(p((...n) => o(d) && o(d)(...n), ["stop"]), ["escape"]))
60
60
  ]
61
61
  }), [
62
- W(e.$slots, "default", {}, void 0, !0)
62
+ F(e.$slots, "default", {}, void 0, !0)
63
63
  ], 16), [
64
- [z, n(l)]
64
+ [U, o(a)]
65
65
  ])
66
66
  ]),
67
67
  _: 3
68
68
  }, 8, ["name"])
69
- ], 8, ["to"])) : K("", !0);
69
+ ], 8, ["to"])) : V("", !0);
70
70
  }
71
- }, R = /* @__PURE__ */ Y($, [["__scopeId", "data-v-62124f7f"]]);
71
+ }, x = /* @__PURE__ */ q(G, [["__scopeId", "data-v-03a2baed"]]);
72
72
  export {
73
- R as default
73
+ x as default
74
74
  };
@@ -23,10 +23,6 @@ const t = {
23
23
  type: Object,
24
24
  default: () => ({})
25
25
  },
26
- menuPositionStyle: {
27
- type: Object,
28
- default: () => ({})
29
- },
30
26
  disabled: Boolean,
31
27
  eager: Boolean,
32
28
  height: [String, Number],
@@ -1,29 +1,46 @@
1
- import { computed as d } from "vue";
2
- function E(t, c, l, o, i, s) {
3
- const u = {
1
+ import { ref as E, computed as c } from "vue";
2
+ function $(t, r, a, l, s, u) {
3
+ const f = E({}), d = {
4
4
  top: { class: "origin-bottom" },
5
5
  bottom: { class: "origin-top" },
6
6
  left: { class: "origin-right" },
7
7
  right: { class: "origin-left" }
8
- }, f = d(() => {
9
- var n;
10
- return ((n = u[t.location]) == null ? void 0 : n.class) || "origin-top";
8
+ }, m = c(() => {
9
+ var i;
10
+ return ((i = d[t.location]) == null ? void 0 : i.class) || "origin-top";
11
11
  });
12
12
  function v() {
13
- var n, a, r;
13
+ var i, o, n;
14
14
  if (t.activator === "parent") {
15
- const e = (n = c.value) == null ? void 0 : n.parentElement;
16
- e && (e.addEventListener("click", o), e.addEventListener("mouseenter", () => i("enter")), e.addEventListener("mouseleave", () => i("leave")), e.addEventListener("focus", s));
15
+ const e = (i = r.value) == null ? void 0 : i.parentElement;
16
+ e && (e.addEventListener("click", l), e.addEventListener("mouseenter", () => s("enter")), e.addEventListener("mouseleave", () => s("leave")), e.addEventListener("focus", u));
17
17
  } else if (t.activator && typeof t.activator == "object") {
18
- let e = (a = t.activator) == null ? void 0 : a.value;
19
- e && e.$el && (e = e.$el), (r = e == null ? void 0 : e.$refs) != null && r.input && (e = e.$refs.input), e instanceof HTMLElement && (l.value = e, e.addEventListener("click", o), e.addEventListener("mouseenter", () => i("enter")), e.addEventListener("mouseleave", () => i("leave")), e.addEventListener("focus", s));
18
+ let e = (o = t.activator) == null ? void 0 : o.value;
19
+ e && e.$el && (e = e.$el), (n = e == null ? void 0 : e.$refs) != null && n.input && (e = e.$refs.input), e instanceof HTMLElement && (a.value = e, e.addEventListener("click", l), e.addEventListener("mouseenter", () => s("enter")), e.addEventListener("mouseleave", () => s("leave")), e.addEventListener("focus", u));
20
20
  }
21
21
  }
22
+ function g() {
23
+ var o;
24
+ const i = a.value;
25
+ if (i && (o = t.textFieldRef) != null && o.$el) {
26
+ const n = i.getBoundingClientRect();
27
+ let e = n.bottom;
28
+ t.hideDetails || (e = e - 20), f.value = {
29
+ position: "absolute",
30
+ top: `${e}px`,
31
+ left: `${n.left}px`,
32
+ width: `${n.width}px`
33
+ };
34
+ }
35
+ }
36
+ const x = c(() => typeof t.maxHeight == "number" ? t.maxHeight + "px" : void 0);
22
37
  return {
23
- originClass: f,
24
- setMenuPosition: v
38
+ originClass: m,
39
+ setMenuPosition: v,
40
+ updatePosition: g,
41
+ computedMaxHeight: x
25
42
  };
26
43
  }
27
44
  export {
28
- E as useKunMenuStyles
45
+ $ as useKunMenuStyles
29
46
  };
@@ -0,0 +1,17 @@
1
+ import { createElementBlock as o, openBlock as t, mergeProps as n, createElementVNode as m } from "vue";
2
+ import s from "../_virtual/_plugin-vue_export-helper.js";
3
+ const l = {};
4
+ function c(r, e) {
5
+ return t(), o("svg", n({
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ class: "w-[1em] h-[1em]",
8
+ viewBox: "0 0 24 24",
9
+ fill: "currentColor"
10
+ }, r.$attrs), e[0] || (e[0] = [
11
+ m("path", { d: "M3 18h18v-2H3v2Zm0-5h18v-2H3v2Zm0-7v2h18V6H3Z" }, null, -1)
12
+ ]), 16);
13
+ }
14
+ const v = /* @__PURE__ */ s(l, [["render", c]]);
15
+ export {
16
+ v as default
17
+ };
package/dist/index.js CHANGED
@@ -14,8 +14,8 @@ 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
- import C from "./components/KunCurrency/src/components/KunCurrency.vue.js";
18
- import L from "./components/KunDivider/src/components/KunDivider.vue.js";
17
+ import L from "./components/KunCurrency/src/components/KunCurrency.vue.js";
18
+ import C from "./components/KunDivider/src/components/KunDivider.vue.js";
19
19
  import I from "./components/KunForm/src/components/KunForm.vue.js";
20
20
  import T from "./components/KunIcon/src/components/KunIcon.vue.js";
21
21
  import A from "./components/KunList/src/components/KunList.vue.js";
@@ -35,8 +35,8 @@ import R from "./components/KunSlider/src/components/KunSlider.vue.js";
35
35
  import j from "./components/KunSpacer/src/components/KunSpacer.vue.js";
36
36
  import k from "./components/KunSwitch/src/components/KunSwitch.vue.js";
37
37
  import q from "./components/KunTextField/src/components/KunTextField.vue.js";
38
- import z from "./components/KunToolbar/src/components/KunToolbar.vue.js";
39
- import M from "./components/KunTooltip/src/components/KunTooltip.vue.js";
38
+ import M from "./components/KunToolbar/src/components/KunToolbar.vue.js";
39
+ import z from "./components/KunTooltip/src/components/KunTooltip.vue.js";
40
40
  const n = {
41
41
  KunAlert: r,
42
42
  KunAppbar: t,
@@ -54,8 +54,8 @@ const n = {
54
54
  KunChip: $,
55
55
  KunCol: l,
56
56
  KunContainer: d,
57
- KunCurrency: C,
58
- KunDivider: L,
57
+ KunCurrency: L,
58
+ KunDivider: C,
59
59
  KunForm: I,
60
60
  KunIcon: T,
61
61
  KunList: A,
@@ -74,8 +74,8 @@ const n = {
74
74
  KunSpacer: j,
75
75
  KunSwitch: k,
76
76
  KunTextField: q,
77
- KunToolbar: z,
78
- KunTooltip: M
77
+ KunToolbar: M,
78
+ KunTooltip: z
79
79
  };
80
80
  function hm(i) {
81
81
  for (const m in n)
@@ -97,8 +97,8 @@ export {
97
97
  $ as KunChip,
98
98
  l as KunCol,
99
99
  d as KunContainer,
100
- C as KunCurrency,
101
- L as KunDivider,
100
+ L as KunCurrency,
101
+ C as KunDivider,
102
102
  I as KunForm,
103
103
  T as KunIcon,
104
104
  A as KunList,
@@ -118,7 +118,7 @@ export {
118
118
  j as KunSpacer,
119
119
  k as KunSwitch,
120
120
  q as KunTextField,
121
- z as KunToolbar,
122
- M as KunTooltip,
121
+ M as KunToolbar,
122
+ z as KunTooltip,
123
123
  hm as install
124
124
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.76",
3
+ "version": "0.1.77",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",
@@ -1,17 +0,0 @@
1
- import { computed as d } from "vue";
2
- function r(e) {
3
- const n = d(() => [
4
- e.bgColor,
5
- e.flat ? "shadow-none" : "shadow-md",
6
- e.rounded === !0 ? "rounded-lg" : e.rounded ? `rounded-${e.rounded}` : "",
7
- e.outlined ? `border ${e.outlineColor}` : "",
8
- e.class
9
- ].filter(Boolean)), o = d(() => e.style || {});
10
- return {
11
- cardClass: n,
12
- cardStyle: o
13
- };
14
- }
15
- export {
16
- r as useCard
17
- };
@@ -1,19 +0,0 @@
1
- import { computed as n } from "vue";
2
- function r(e) {
3
- const t = n(() => [
4
- "flex",
5
- e.wrap ? "flex-wrap" : "flex-nowrap",
6
- e.justify,
7
- e.align,
8
- e.gap,
9
- e.dense ? "py-1 px-2" : "py-3 px-4",
10
- e.class
11
- ].filter(Boolean)), a = n(() => e.style || {});
12
- return {
13
- containerClass: t,
14
- containerStyle: a
15
- };
16
- }
17
- export {
18
- r as useCardActions
19
- };
@@ -1,17 +0,0 @@
1
- import { computed as t } from "vue";
2
- function o(e) {
3
- const n = t(() => [
4
- "flex",
5
- "flex-col",
6
- e.dense ? "py-1 px-2" : "py-3 px-4",
7
- e.gap,
8
- e.class
9
- ].filter(Boolean)), r = t(() => e.style || {});
10
- return {
11
- containerClass: n,
12
- containerStyle: r
13
- };
14
- }
15
- export {
16
- o as useCardItem
17
- };
@@ -1,15 +0,0 @@
1
- import { computed as e } from "vue";
2
- function r(t) {
3
- const l = e(() => [
4
- t.color,
5
- t.dense ? "text-xs" : "text-sm",
6
- t.class
7
- ].filter(Boolean)), s = e(() => t.style || {});
8
- return {
9
- subtitleClass: l,
10
- subtitleStyle: s
11
- };
12
- }
13
- export {
14
- r as useCardSubtitle
15
- };
@@ -1,15 +0,0 @@
1
- import { computed as e } from "vue";
2
- function s(t) {
3
- const n = e(() => [
4
- t.color,
5
- t.dense ? "text-xs" : "text-sm",
6
- t.class
7
- ].filter(Boolean)), r = e(() => t.style || {});
8
- return {
9
- textClass: n,
10
- textStyle: r
11
- };
12
- }
13
- export {
14
- s as useCardText
15
- };
@@ -1,25 +0,0 @@
1
- import { computed as e } from "vue";
2
- function c(t) {
3
- const d = e(() => !!t.prepend), i = e(() => !!t.append), h = e(() => [
4
- t.dense ? "py-1 px-2 text-sm" : "py-3 px-4 text-base",
5
- t.flat ? "shadow-none" : "shadow",
6
- t.rounded === !0 ? "rounded-md" : t.rounded ? `rounded-${t.rounded}` : "",
7
- t.bgColor,
8
- t.textColor,
9
- t.class
10
- ].filter(Boolean)), u = e(() => {
11
- const n = t.style || {};
12
- return t.height && (n.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.width && (n.width = typeof t.width == "number" ? `${t.width}px` : t.width), n;
13
- }), o = e(() => t.dense ? "font-medium" : "font-semibold"), a = e(() => "text-xs opacity-75 mt-1");
14
- return {
15
- hasPrependIcon: d,
16
- hasAppendIcon: i,
17
- containerClass: h,
18
- containerStyle: u,
19
- titleClass: o,
20
- subtitleClass: a
21
- };
22
- }
23
- export {
24
- c as useCardTitle
25
- };