adverich-kun-ui 0.1.45 → 0.1.46

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,19 +1,23 @@
1
- import { computed as a, createBlock as y, openBlock as o, resolveDynamicComponent as m, mergeProps as b, withCtx as x, renderSlot as s, createElementBlock as i, createCommentVNode as l, createElementVNode as h, createTextVNode as $, toDisplayString as v } from "vue";
2
- import { RouterLink as S } from "../../../../node_modules/.pnpm/vue-router@4.5.1_vue@3.5.13/node_modules/vue-router/dist/vue-router.js";
3
- const w = {
1
+ import { computed as a, createBlock as x, openBlock as o, resolveDynamicComponent as y, mergeProps as m, withCtx as b, renderSlot as l, createElementBlock as s, createCommentVNode as i, createElementVNode as h, createTextVNode as v, toDisplayString as $ } from "vue";
2
+ import { RouterLink as S } from "vue-router";
3
+ const k = {
4
4
  key: 1,
5
5
  class: "mr-2 flex items-center"
6
- }, k = {
6
+ }, w = {
7
7
  key: 2,
8
8
  class: "truncate"
9
- }, C = {
9
+ }, B = {
10
10
  key: 3,
11
11
  class: "ml-2 flex items-center"
12
12
  }, z = {
13
13
  __name: "KunBtn",
14
14
  props: {
15
15
  text: { type: String, default: null },
16
- size: { type: String, default: "md" },
16
+ size: {
17
+ type: String,
18
+ default: "md",
19
+ validator: (t) => ["xxs", "xs", "sm", "md", "lg", "xl", "xxl"].includes(t)
20
+ },
17
21
  minWidth: { type: String, default: "min-w-[6rem]" },
18
22
  fontWeight: { type: String, default: "font-medium" },
19
23
  rounded: { type: String, default: "rounded-lg" },
@@ -28,12 +32,15 @@ const w = {
28
32
  bgColor: { type: String, default: "bg-indigo-600" },
29
33
  textColor: { type: String, default: "text-white" },
30
34
  to: [String, Object],
31
- href: String
35
+ href: String,
36
+ replace: { type: Boolean, default: !1 },
37
+ target: { type: String, default: null }
32
38
  },
33
39
  setup(t) {
34
40
  const e = t, d = a(() => !!e.to || !!e.href), u = a(() => !d.value), c = a(() => e.href ? "a" : e.to ? S : "button"), f = a(() => e.href ? {
35
41
  href: e.href,
36
- target: e.target ?? "_self"
42
+ target: e.target ?? "_self",
43
+ rel: e.target === "_blank" ? "noopener noreferrer" : null
37
44
  } : e.to ? {
38
45
  to: e.to,
39
46
  replace: e.replace
@@ -74,7 +81,7 @@ const w = {
74
81
  return `${n} ${r}`;
75
82
  }
76
83
  });
77
- return (n, r) => (o(), y(m(c.value), b(f.value, {
84
+ return (n, r) => (o(), x(y(c.value), m(f.value, {
78
85
  class: ["flex items-center justify-center break-keep transition-all", [
79
86
  t.minWidth,
80
87
  g(t.size),
@@ -87,20 +94,20 @@ const w = {
87
94
  ]],
88
95
  disabled: u.value && (t.loading || t.disabled)
89
96
  }), {
90
- default: x(() => [
91
- t.loading ? s(n.$slots, "loader", { key: 0 }, () => [
97
+ default: b(() => [
98
+ t.loading ? l(n.$slots, "loader", { key: 0 }, () => [
92
99
  r[0] || (r[0] = h("span", { class: "mr-2 h-5 w-5 border-[3px] border-current opacity-100 border-opacity-100 border-t-transparent rounded-full animate-spin" }, null, -1))
93
- ]) : n.$slots.prepend ? (o(), i("span", w, [
94
- s(n.$slots, "prepend")
95
- ])) : l("", !0),
96
- !t.loading && (n.$slots.default || t.text) ? (o(), i("span", k, [
97
- s(n.$slots, "default", {}, () => [
98
- $(v(t.text), 1)
100
+ ]) : n.$slots.prepend ? (o(), s("span", k, [
101
+ l(n.$slots, "prepend")
102
+ ])) : i("", !0),
103
+ !t.loading && (n.$slots.default || t.text) ? (o(), s("span", w, [
104
+ l(n.$slots, "default", {}, () => [
105
+ v($(t.text), 1)
99
106
  ])
100
- ])) : l("", !0),
101
- !t.loading && n.$slots.append ? (o(), i("span", C, [
102
- s(n.$slots, "append")
103
- ])) : l("", !0)
107
+ ])) : i("", !0),
108
+ !t.loading && n.$slots.append ? (o(), s("span", B, [
109
+ l(n.$slots, "append")
110
+ ])) : i("", !0)
104
111
  ]),
105
112
  _: 3
106
113
  }, 16, ["class", "disabled"]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.45",
3
+ "version": "0.1.46",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",
@@ -23,7 +23,8 @@
23
23
  },
24
24
  "peerDependencies": {
25
25
  "tailwindcss": "^4.1.6",
26
- "vue": "^3.5.13"
26
+ "vue": "^3.5.13",
27
+ "vue-router": "^4.0.0"
27
28
  },
28
29
  "keywords": [
29
30
  "vue",
@@ -1,187 +0,0 @@
1
- import { defineComponent as R, reactive as D, inject as g, computed as a, h as L, unref as f, getCurrentInstance as I, watchEffect as P } from "vue";
2
- /*!
3
- * vue-router v4.5.1
4
- * (c) 2025 Eduardo San Martin Morote
5
- * @license MIT
6
- */
7
- const K = typeof document < "u", j = () => {
8
- }, v = Array.isArray;
9
- function E(t) {
10
- const e = Array.from(arguments).slice(1);
11
- console.warn.apply(console, ["[Vue Router warn]: " + t].concat(e));
12
- }
13
- function k(t, e) {
14
- return (t.aliasOf || t) === (e.aliasOf || e);
15
- }
16
- function B(t, e) {
17
- if (Object.keys(t).length !== Object.keys(e).length)
18
- return !1;
19
- for (const n in t)
20
- if (!T(t[n], e[n]))
21
- return !1;
22
- return !0;
23
- }
24
- function T(t, e) {
25
- return v(t) ? A(t, e) : v(e) ? A(e, t) : t === e;
26
- }
27
- function A(t, e) {
28
- return v(e) ? t.length === e.length && t.every((n, o) => n === e[o]) : t.length === 1 && t[0] === e;
29
- }
30
- var _;
31
- (function(t) {
32
- t.pop = "pop", t.push = "push";
33
- })(_ || (_ = {}));
34
- var O;
35
- (function(t) {
36
- t.back = "back", t.forward = "forward", t.unknown = "";
37
- })(O || (O = {}));
38
- function V(t) {
39
- return typeof t == "string" || t && typeof t == "object";
40
- }
41
- Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
42
- var w;
43
- (function(t) {
44
- t[t.aborted = 4] = "aborted", t[t.cancelled = 8] = "cancelled", t[t.duplicated = 16] = "duplicated";
45
- })(w || (w = {}));
46
- Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
47
- Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
48
- const C = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), M = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
49
- Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
50
- function x(t) {
51
- const e = g(C), n = g(M);
52
- let o = !1, c = null;
53
- const u = a(() => {
54
- const r = f(t.to);
55
- return process.env.NODE_ENV !== "production" && (!o || r !== c) && (V(r) || (o ? E(`Invalid value for prop "to" in useLink()
56
- - to:`, r, `
57
- - previous to:`, c, `
58
- - props:`, t) : E(`Invalid value for prop "to" in useLink()
59
- - to:`, r, `
60
- - props:`, t)), c = r, o = !0), e.resolve(r);
61
- }), s = a(() => {
62
- const { matched: r } = u.value, { length: i } = r, h = r[i - 1], l = n.matched;
63
- if (!h || !l.length)
64
- return -1;
65
- const m = l.findIndex(k.bind(null, h));
66
- if (m > -1)
67
- return m;
68
- const y = b(r[i - 2]);
69
- return (
70
- // we are dealing with nested routes
71
- i > 1 && // if the parent and matched route have the same path, this link is
72
- // referring to the empty child. Or we currently are on a different
73
- // child of the same parent
74
- b(h) === y && // avoid comparing the child with its parent
75
- l[l.length - 1].path !== y ? l.findIndex(k.bind(null, r[i - 2])) : m
76
- );
77
- }), d = a(() => s.value > -1 && H(n.params, u.value.params)), p = a(() => s.value > -1 && s.value === n.matched.length - 1 && B(n.params, u.value.params));
78
- function N(r = {}) {
79
- if (G(r)) {
80
- const i = e[f(t.replace) ? "replace" : "push"](
81
- f(t.to)
82
- // avoid uncaught errors are they are logged anyway
83
- ).catch(j);
84
- return t.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => i), i;
85
- }
86
- return Promise.resolve();
87
- }
88
- if (process.env.NODE_ENV !== "production" && K) {
89
- const r = I();
90
- if (r) {
91
- const i = {
92
- route: u.value,
93
- isActive: d.value,
94
- isExactActive: p.value,
95
- error: null
96
- };
97
- r.__vrl_devtools = r.__vrl_devtools || [], r.__vrl_devtools.push(i), P(() => {
98
- i.route = u.value, i.isActive = d.value, i.isExactActive = p.value, i.error = V(f(t.to)) ? null : 'Invalid "to" value';
99
- }, { flush: "post" });
100
- }
101
- }
102
- return {
103
- route: u,
104
- href: a(() => u.value.href),
105
- isActive: d,
106
- isExactActive: p,
107
- navigate: N
108
- };
109
- }
110
- function q(t) {
111
- return t.length === 1 ? t[0] : t;
112
- }
113
- const z = /* @__PURE__ */ R({
114
- name: "RouterLink",
115
- compatConfig: { MODE: 3 },
116
- props: {
117
- to: {
118
- type: [String, Object],
119
- required: !0
120
- },
121
- replace: Boolean,
122
- activeClass: String,
123
- // inactiveClass: String,
124
- exactActiveClass: String,
125
- custom: Boolean,
126
- ariaCurrentValue: {
127
- type: String,
128
- default: "page"
129
- },
130
- viewTransition: Boolean
131
- },
132
- useLink: x,
133
- setup(t, { slots: e }) {
134
- const n = D(x(t)), { options: o } = g(C), c = a(() => ({
135
- [S(t.activeClass, o.linkActiveClass, "router-link-active")]: n.isActive,
136
- // [getLinkClass(
137
- // props.inactiveClass,
138
- // options.linkInactiveClass,
139
- // 'router-link-inactive'
140
- // )]: !link.isExactActive,
141
- [S(t.exactActiveClass, o.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
142
- }));
143
- return () => {
144
- const u = e.default && q(e.default(n));
145
- return t.custom ? u : L("a", {
146
- "aria-current": n.isExactActive ? t.ariaCurrentValue : null,
147
- href: n.href,
148
- // this would override user added attrs but Vue will still add
149
- // the listener, so we end up triggering both
150
- onClick: n.navigate,
151
- class: c.value
152
- }, u);
153
- };
154
- }
155
- }), Q = z;
156
- function G(t) {
157
- if (!(t.metaKey || t.altKey || t.ctrlKey || t.shiftKey) && !t.defaultPrevented && !(t.button !== void 0 && t.button !== 0)) {
158
- if (t.currentTarget && t.currentTarget.getAttribute) {
159
- const e = t.currentTarget.getAttribute("target");
160
- if (/\b_blank\b/i.test(e))
161
- return;
162
- }
163
- return t.preventDefault && t.preventDefault(), !0;
164
- }
165
- }
166
- function H(t, e) {
167
- for (const n in e) {
168
- const o = e[n], c = t[n];
169
- if (typeof o == "string") {
170
- if (o !== c)
171
- return !1;
172
- } else if (!v(c) || c.length !== o.length || o.some((u, s) => u !== c[s]))
173
- return !1;
174
- }
175
- return !0;
176
- }
177
- function b(t) {
178
- return t ? t.aliasOf ? t.aliasOf.path : t.path : "";
179
- }
180
- const S = (t, e, n) => t ?? e ?? n;
181
- export {
182
- w as NavigationFailureType,
183
- Q as RouterLink,
184
- M as routeLocationKey,
185
- C as routerKey,
186
- x as useLink
187
- };