adverich-kun-ui 0.1.126 → 0.1.128

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 (22) hide show
  1. package/dist/adverich-kun-ui.css +1 -1
  2. package/dist/components/KunDialog/src/components/KunDialog.vue.js +102 -0
  3. package/dist/components/KunDialog/src/components/KunDialog.vue2.js +4 -0
  4. package/dist/components/KunDialog/src/components/KunDialogContent.vue.js +23 -0
  5. package/dist/components/KunDialog/src/components/KunDialogContent.vue2.js +4 -0
  6. package/dist/components/KunDialog/src/components/KunDialogOverlay.vue.js +20 -0
  7. package/dist/components/KunDialog/src/components/KunDialogOverlay.vue2.js +4 -0
  8. package/dist/components/KunTable/src/components/KunTable.vue.js +150 -0
  9. package/dist/components/KunTable/src/components/KunTableFilter.vue.js +108 -0
  10. package/dist/components/KunTable/src/components/KunTableFooter.vue.js +53 -0
  11. package/dist/components/KunTable/src/components/KunTableHeaders.vue.js +86 -0
  12. package/dist/components/KunTable/src/components/KunTableRow.vue.js +88 -0
  13. package/dist/components/KunTable/src/components/KunTableRows.vue.js +77 -0
  14. package/dist/components/KunTable/src/composables/KunTableProps.js +84 -0
  15. package/dist/components/KunTable/src/composables/useExpand.js +21 -0
  16. package/dist/components/KunTable/src/composables/useFilter.js +43 -0
  17. package/dist/components/KunTable/src/composables/useOptions.js +29 -0
  18. package/dist/components/KunTable/src/composables/useSelect.js +30 -0
  19. package/dist/components/KunTooltip/src/components/KunTooltip.vue.js +100 -81
  20. package/dist/index.js +26 -23
  21. package/package.json +1 -1
  22. package/dist/components/KunTooltip/src/composables/useTooltip.js +0 -93
@@ -1,97 +1,116 @@
1
- import { useSlots as h, computed as w, ref as N, onMounted as x, createElementBlock as u, openBlock as d, mergeProps as E, renderSlot as n, createVNode as V, createElementVNode as p, Transition as B, withCtx as L, createCommentVNode as T, unref as a, normalizeStyle as f, normalizeClass as v, createTextVNode as m, toDisplayString as y } from "vue";
2
- import { useTooltip as _ } from "../composables/useTooltip.js";
3
- const O = {
1
+ import { ref as c, computed as $, onMounted as R, onBeforeUnmount as B, createElementBlock as E, openBlock as x, Fragment as O, createElementVNode as b, createBlock as C, mergeProps as z, renderSlot as T, Teleport as L, createVNode as N, Transition as V, withCtx as _, withDirectives as D, normalizeStyle as M, normalizeClass as P, createTextVNode as F, toDisplayString as K, vShow as j, nextTick as A } from "vue";
2
+ /* empty css */
3
+ import I from "../../../../_virtual/_plugin-vue_export-helper.js";
4
+ const U = {
4
5
  __name: "KunTooltip",
5
6
  props: {
6
- text: {
7
- type: String,
8
- default: ""
9
- },
7
+ text: String,
10
8
  location: {
11
9
  type: String,
12
- default: "top",
13
- validator: (e) => ["top", "bottom", "left", "right"].includes(e)
10
+ default: "top"
14
11
  },
15
12
  openOn: {
16
13
  type: String,
17
- default: "hover",
18
- validator: (e) => ["hover", "click"].includes(e)
19
- },
20
- disabled: Boolean,
21
- contentClass: {
22
- type: [String, Object, Array],
23
- default: null
24
- },
25
- delay: {
26
- type: [String, Number],
27
- default: 0,
28
- validator: (e) => !isNaN(parseInt(e))
29
- },
30
- closeOnClick: {
31
- type: Boolean,
32
- default: !1
14
+ default: "hover"
15
+ // 'click' | 'hover' | 'focus'
33
16
  },
34
17
  transition: {
35
18
  type: String,
36
19
  default: "fade"
20
+ },
21
+ contentClass: [String, Array, Object],
22
+ disabled: Boolean,
23
+ delay: {
24
+ type: [Number, String],
25
+ default: 0
26
+ },
27
+ closeDelay: {
28
+ type: [Number, String],
29
+ default: 100
37
30
  }
38
31
  },
39
- setup(e) {
40
- const o = e, r = h(), k = w(() => r.activator ? {
41
- onMouseenter: s,
42
- onMouseleave: i,
43
- onClick: c
44
- } : {}), {
45
- isVisible: g,
46
- arrowClass: S,
47
- positionStyle: b,
48
- arrowStyle: C,
49
- onEnter: s,
50
- onLeave: i,
51
- onClick: c
52
- } = _(o), l = N(null);
53
- return x(() => {
54
- if (!r.activator && l.value) {
55
- const t = l.value;
56
- t.addEventListener("mouseenter", s), t.addEventListener("mouseleave", i), t.addEventListener("click", c);
57
- }
58
- }), (t, $) => (d(), u("div", E({ class: "kun-tooltip relative inline-block" }, t.$attrs), [
59
- n(t.$slots, "activator", { props: k.value }, () => [
60
- p("span", {
61
- ref_key: "activator",
62
- ref: l,
63
- class: "kun-tooltip-activator"
64
- }, [
65
- n(t.$slots, "default")
66
- ], 512)
67
- ]),
68
- V(B, { name: "fade" }, {
69
- default: L(() => [
70
- a(g) ? (d(), u("div", {
71
- key: 0,
72
- ref: "tooltip",
73
- class: v([
74
- "kun-tooltip-content",
75
- "absolute z-50 px-2 py-1 text-sm rounded shadow-lg text-white bg-gray-800 dark:bg-gray-700 whitespace-nowrap",
76
- o.contentClass
77
- ]),
78
- style: f(a(b))
79
- }, [
80
- m(y(o.text) + " ", 1),
81
- n(t.$slots, "default", {}, () => [
82
- m(y(o.text), 1)
83
- ]),
84
- p("div", {
85
- class: v(["kun-tooltip-arrow", a(S)]),
86
- style: f(a(C))
87
- }, null, 6)
88
- ], 6)) : T("", !0)
89
- ]),
90
- _: 3
91
- })
92
- ], 16));
32
+ setup(l) {
33
+ const o = l, i = c(!1), v = c(null), g = c(null), h = c({});
34
+ let u = null, d = null;
35
+ function p() {
36
+ o.disabled || (clearTimeout(d), u = setTimeout(async () => {
37
+ i.value = !0, await A(), y();
38
+ }, +o.delay));
39
+ }
40
+ function f() {
41
+ clearTimeout(u), d = setTimeout(() => {
42
+ i.value = !1;
43
+ }, +o.closeDelay);
44
+ }
45
+ function S() {
46
+ i.value ? f() : p();
47
+ }
48
+ const w = $(() => {
49
+ if (o.disabled) return {};
50
+ const e = {};
51
+ return o.openOn === "hover" && (e.onMouseenter = p, e.onMouseleave = f), o.openOn === "click" && (e.onClick = S), o.openOn === "focus" && (e.onFocus = p, e.onBlur = f), e;
52
+ });
53
+ function y() {
54
+ const e = v.value, m = g.value;
55
+ if (!e || !m) return;
56
+ const t = e.getBoundingClientRect(), n = m.getBoundingClientRect(), a = window.pageYOffset || document.documentElement.scrollTop, s = window.pageXOffset || document.documentElement.scrollLeft, k = {
57
+ top: {
58
+ top: `${t.top + a - n.height - 16}px`,
59
+ left: `${t.left + s + t.width / 2 - n.width / 2}px`
60
+ },
61
+ bottom: {
62
+ top: `${t.bottom + a + 8}px`,
63
+ left: `${t.left + s + t.width / 2 - n.width / 2}px`
64
+ },
65
+ left: {
66
+ top: `${t.top + a + t.height / 2 - n.height / 2}px`,
67
+ left: `${t.left + s - n.width - 8}px`
68
+ },
69
+ right: {
70
+ top: `${t.top + a + t.height / 2 - n.height / 2}px`,
71
+ left: `${t.right + s + 8}px`
72
+ }
73
+ };
74
+ h.value = k[o.location];
75
+ }
76
+ const r = () => {
77
+ i.value && y();
78
+ };
79
+ return R(() => {
80
+ window.addEventListener("scroll", r), window.addEventListener("resize", r);
81
+ }), B(() => {
82
+ clearTimeout(u), clearTimeout(d), window.removeEventListener("scroll", r), window.removeEventListener("resize", r);
83
+ }), (e, m) => (x(), E(O, null, [
84
+ b("span", z({
85
+ ref_key: "activatorRef",
86
+ ref: v
87
+ }, w.value), [
88
+ T(e.$slots, "activator", { props: w.value }, void 0, !0)
89
+ ], 16),
90
+ (x(), C(L, { to: "body" }, [
91
+ N(V, { name: l.transition }, {
92
+ default: _(() => [
93
+ D(b("div", {
94
+ ref_key: "tooltipRef",
95
+ ref: g,
96
+ class: P(["absolute px-3 py-2 text-sm rounded shadow text-black dark:text-white bg-gray-600:75 dark:bg-gray-700/75", l.contentClass]),
97
+ style: M([h.value, { "z-index": "9999" }]),
98
+ role: "tooltip",
99
+ "aria-hidden": "!isVisible"
100
+ }, [
101
+ T(e.$slots, "default", {}, () => [
102
+ F(K(l.text), 1)
103
+ ], !0)
104
+ ], 6), [
105
+ [j, i.value]
106
+ ])
107
+ ]),
108
+ _: 3
109
+ }, 8, ["name"])
110
+ ]))
111
+ ], 64));
93
112
  }
94
- };
113
+ }, G = /* @__PURE__ */ I(U, [["__scopeId", "data-v-b846040c"]]);
95
114
  export {
96
- O as default
115
+ G as default
97
116
  };
package/dist/index.js CHANGED
@@ -8,8 +8,8 @@ import u from "./components/KunBtn/src/components/KunBtn.vue.js";
8
8
  import f from "./components/KunBudge/src/components/KunBudge.vue.js";
9
9
  import K from "./components/KunCard/src/components/KunCard.vue.js";
10
10
  import _ from "./components/KunCardActions/src/components/KunCardActions.vue.js";
11
- import p from "./components/KunCardItem/src/components/KunCardItem.vue.js";
12
- import e from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
11
+ import e from "./components/KunCardItem/src/components/KunCardItem.vue.js";
12
+ import p from "./components/KunCardSubtitle/src/components/KunCardSubtitle.vue.js";
13
13
  import c from "./components/KunCardText/src/components/KunCardText.vue.js";
14
14
  import $ from "./components/KunCardTitle/src/components/KunCardTitle.vue.js";
15
15
  import l from "./components/KunChip/src/components/KunChip.vue.js";
@@ -17,9 +17,9 @@ import d from "./components/KunCol/src/components/KunCol.vue.js";
17
17
  import L from "./components/KunContainer/src/components/KunContainer.vue.js";
18
18
  import C from "./components/KunCurrency/src/components/KunCurrency.vue.js";
19
19
  import I from "./components/KunDivider/src/components/KunDivider.vue.js";
20
- import A from "./components/KunForm/src/components/KunForm.vue.js";
20
+ import b from "./components/KunForm/src/components/KunForm.vue.js";
21
21
  import T from "./components/KunIcon/src/components/KunIcon.vue.js";
22
- import b from "./components/KunList/src/components/KunList.vue.js";
22
+ import A from "./components/KunList/src/components/KunList.vue.js";
23
23
  import S from "./components/KunListGroup/src/components/KunListGroup.vue.js";
24
24
  import x from "./components/KunListImg/src/components/KunListImg.vue.js";
25
25
  import h from "./components/KunListItem/src/components/KunListItem.vue.js";
@@ -36,9 +36,10 @@ import j from "./components/KunRow/src/components/KunRow.vue.js";
36
36
  import k from "./components/KunSlider/src/components/KunSlider.vue.js";
37
37
  import q from "./components/KunSpacer/src/components/KunSpacer.vue.js";
38
38
  import M from "./components/KunSwitch/src/components/KunSwitch.vue.js";
39
- import N from "./components/KunTextField/src/components/KunTextField.vue.js";
40
- import z from "./components/KunToolbar/src/components/KunToolbar.vue.js";
41
- import E from "./components/KunTooltip/src/components/KunTooltip.vue.js";
39
+ import N from "./components/KunTable/src/components/KunTable.vue.js";
40
+ import z from "./components/KunTextField/src/components/KunTextField.vue.js";
41
+ import E from "./components/KunToolbar/src/components/KunToolbar.vue.js";
42
+ import H from "./components/KunTooltip/src/components/KunTooltip.vue.js";
42
43
  const n = {
43
44
  KunAlert: i,
44
45
  KunAppbar: o,
@@ -49,8 +50,8 @@ const n = {
49
50
  KunBudge: f,
50
51
  KunCard: K,
51
52
  KunCardActions: _,
52
- KunCardItem: p,
53
- KunCardSubtitle: e,
53
+ KunCardItem: e,
54
+ KunCardSubtitle: p,
54
55
  KunListItemTitle: F,
55
56
  KunCardText: c,
56
57
  KunCardTitle: $,
@@ -59,9 +60,9 @@ const n = {
59
60
  KunContainer: L,
60
61
  KunCurrency: C,
61
62
  KunDivider: I,
62
- KunForm: A,
63
+ KunForm: b,
63
64
  KunIcon: T,
64
- KunList: b,
65
+ KunList: A,
65
66
  KunListGroup: S,
66
67
  KunListImg: x,
67
68
  KunListItem: h,
@@ -77,11 +78,12 @@ const n = {
77
78
  KunSlider: k,
78
79
  KunSpacer: q,
79
80
  KunSwitch: M,
80
- KunTextField: N,
81
- KunToolbar: z,
82
- KunTooltip: E
81
+ KunTable: N,
82
+ KunTextField: z,
83
+ KunToolbar: E,
84
+ KunTooltip: H
83
85
  };
84
- function Fm(r) {
86
+ function ym(r) {
85
87
  for (const m in n)
86
88
  r.component(m, n[m]);
87
89
  }
@@ -95,8 +97,8 @@ export {
95
97
  f as KunBudge,
96
98
  K as KunCard,
97
99
  _ as KunCardActions,
98
- p as KunCardItem,
99
- e as KunCardSubtitle,
100
+ e as KunCardItem,
101
+ p as KunCardSubtitle,
100
102
  c as KunCardText,
101
103
  $ as KunCardTitle,
102
104
  l as KunChip,
@@ -104,9 +106,9 @@ export {
104
106
  L as KunContainer,
105
107
  C as KunCurrency,
106
108
  I as KunDivider,
107
- A as KunForm,
109
+ b as KunForm,
108
110
  T as KunIcon,
109
- b as KunList,
111
+ A as KunList,
110
112
  S as KunListGroup,
111
113
  x as KunListImg,
112
114
  h as KunListItem,
@@ -122,8 +124,9 @@ export {
122
124
  k as KunSlider,
123
125
  q as KunSpacer,
124
126
  M as KunSwitch,
125
- N as KunTextField,
126
- z as KunToolbar,
127
- E as KunTooltip,
128
- Fm as install
127
+ N as KunTable,
128
+ z as KunTextField,
129
+ E as KunToolbar,
130
+ H as KunTooltip,
131
+ ym as install
129
132
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.126",
3
+ "version": "0.1.128",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",
@@ -1,93 +0,0 @@
1
- import { ref as l, computed as i } from "vue";
2
- function x(e) {
3
- const o = l(!1);
4
- let c = null, s = null;
5
- const w = i(() => {
6
- switch (e.location) {
7
- case "top":
8
- return "mb-2";
9
- case "bottom":
10
- return "mt-2";
11
- case "left":
12
- return "mr-2";
13
- case "right":
14
- return "ml-2";
15
- default:
16
- return "";
17
- }
18
- }), h = i(() => {
19
- switch (e.location) {
20
- case "top":
21
- return "border-b border-l border-gray-800 dark:border-gray-700";
22
- case "bottom":
23
- return "border-t border-l border-gray-800 dark:border-gray-700";
24
- case "left":
25
- return "border-r border-t border-gray-800 dark:border-gray-700";
26
- case "right":
27
- return "border-l border-t border-gray-800 dark:border-gray-700";
28
- default:
29
- return "";
30
- }
31
- }), g = i(() => {
32
- let t = {};
33
- switch (e.location) {
34
- case "top":
35
- case "bottom":
36
- t.left = "50%", t.transform = "translateX(-50%)";
37
- break;
38
- case "left":
39
- case "right":
40
- t.top = "50%", t.transform = "translateY(-50%)";
41
- break;
42
- }
43
- return t;
44
- }), u = l({}), d = () => {
45
- if (!n.value || !a.value) return;
46
- const t = n.value.getBoundingClientRect(), f = a.value.getBoundingClientRect();
47
- let r = {};
48
- switch (e.location) {
49
- case "top":
50
- r.top = `${t.top + window.scrollY - f.height}px`, r.left = `${t.left + window.scrollX + t.width / 2}px`;
51
- break;
52
- case "bottom":
53
- r.top = `${t.bottom + window.scrollY}px`, r.left = `${t.left + window.scrollX + t.width / 2}px`;
54
- break;
55
- case "left":
56
- r.top = `${t.top + window.scrollY + t.height / 2}px`, r.left = `${t.left + window.scrollX - f.width}px`;
57
- break;
58
- case "right":
59
- r.top = `${t.top + window.scrollY + t.height / 2}px`, r.left = `${t.right + window.scrollX}px`;
60
- break;
61
- }
62
- u.value = r;
63
- }, n = l(null), a = l(null), m = () => {
64
- e.disabled || (clearTimeout(s), c = setTimeout(() => {
65
- o.value = !0, d();
66
- }, parseInt(e.delay)));
67
- }, b = () => {
68
- e.disabled || (clearTimeout(c), s = setTimeout(() => {
69
- o.value = !1;
70
- }, 100));
71
- };
72
- return {
73
- isVisible: o,
74
- positionClass: w,
75
- arrowClass: h,
76
- positionStyle: u,
77
- arrowStyle: g,
78
- onEnter: () => {
79
- e.openOn === "hover" && m();
80
- },
81
- onLeave: () => {
82
- e.openOn === "hover" && b();
83
- },
84
- onClick: () => {
85
- e.openOn === "click" && (o.value = !o.value, o.value && d()), e.closeOnClick && b();
86
- },
87
- activator: n,
88
- tooltip: a
89
- };
90
- }
91
- export {
92
- x as useTooltip
93
- };