adverich-kun-ui 0.1.114 → 0.1.115

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,24 +1,29 @@
1
- import { getCurrentInstance as z, computed as y, useSlots as A, createElementBlock as r, openBlock as s, createCommentVNode as o, createElementVNode as b, normalizeClass as a, toDisplayString as i, mergeProps as M, unref as l, renderSlot as v, withModifiers as N } from "vue";
2
- import T from "../composables/KunTextFieldProps.js";
3
- import U from "../composables/useKunTextFieldComposable.js";
4
- const H = { class: "w-full flex flex-col relative" }, q = {
1
+ import { getCurrentInstance as M, computed as d, useSlots as U, ref as H, createElementBlock as s, openBlock as o, createCommentVNode as r, createElementVNode as b, normalizeClass as a, toDisplayString as i, mergeProps as q, unref as t, renderSlot as c, withModifiers as G, createVNode as J } from "vue";
2
+ import { icons as F } from "../../../../icons/index.js";
3
+ import L from "../composables/KunTextFieldProps.js";
4
+ import Q from "../composables/useKunTextFieldComposable.js";
5
+ import R from "../../../KunIcon/src/components/KunIcon.vue.js";
6
+ const W = { class: "w-full flex flex-col relative" }, X = {
5
7
  key: 0,
6
8
  class: "mr-2"
7
- }, G = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "aria-invalid", "aria-describedby"], J = ["disabled"], L = {
8
- key: 4,
9
+ }, Y = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "aria-invalid", "aria-describedby"], Z = ["disabled"], _ = {
10
+ key: 3,
11
+ class: "flex items-center justify-center min-w-[32px] h-full px-1"
12
+ }, ee = {
13
+ key: 5,
9
14
  class: "ml-2"
10
- }, O = {
15
+ }, te = {
11
16
  key: 0,
12
17
  class: "h-[1.25rem]"
13
- }, Q = ["id"], R = {
18
+ }, le = ["id"], ne = {
14
19
  key: 1,
15
20
  class: "text-xs text-center"
16
- }, W = {
21
+ }, se = {
17
22
  key: 2,
18
23
  class: "text-xs text-right"
19
- }, _ = {
24
+ }, ue = {
20
25
  __name: "KunTextField",
21
- props: { ...T },
26
+ props: { ...L },
22
27
  emits: [
23
28
  "update:modelValue",
24
29
  "focusInput",
@@ -27,101 +32,111 @@ const H = { class: "w-full flex flex-col relative" }, q = {
27
32
  "keyDown",
28
33
  "keyUp"
29
34
  ],
30
- setup(x, { expose: F, emit: V }) {
31
- const h = x, d = V, {
35
+ setup(P, { expose: V, emit: j }) {
36
+ const u = P, p = j, {
32
37
  inputField: k,
33
- inputValue: u,
34
- inputFocused: m,
38
+ inputValue: f,
39
+ inputFocused: h,
35
40
  validationError: B,
36
- hasError: p,
37
- handleInput: g,
38
- handleBlur: c,
41
+ hasError: m,
42
+ handleInput: w,
43
+ handleBlur: g,
39
44
  focusInput: C,
40
45
  validate: D,
41
46
  reset: E,
42
47
  resetValidation: K,
43
- clearInput: w
44
- } = U(h, d);
45
- F({
48
+ clearInput: I
49
+ } = Q(u, p);
50
+ V({
46
51
  validate: D,
47
52
  reset: E,
48
53
  resetValidation: K,
49
54
  inputField: k
50
55
  });
51
- const f = `input-${z().uid}`, j = y(() => m.value || !!u.value || h.dirty), I = A(), P = y(() => !!I["prepend-inner"]), S = y(() => !!I["append-inner"]);
52
- return (e, t) => {
56
+ const y = `input-${M().uid}`, S = d(() => h.value || !!f.value || u.dirty), x = U(), T = d(() => !!x["prepend-inner"]), N = d(() => !!x["append-inner"]), v = H(!1), O = d(() => v.value ? F.eyeOffOutline : F.eyeOutline);
57
+ function z() {
58
+ v.value = !v.value;
59
+ }
60
+ const A = d(() => u.type === "password" ? v.value ? "text" : "password" : u.type);
61
+ return (e, l) => {
53
62
  var $;
54
- return s(), r("div", H, [
55
- e.label ? (s(), r("label", {
63
+ return o(), s("div", W, [
64
+ e.label ? (o(), s("label", {
56
65
  key: 0,
57
- for: f,
66
+ for: y,
58
67
  class: a([
59
68
  e.labelColor,
60
69
  "absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10",
61
- j.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
70
+ S.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
62
71
  ])
63
- }, i(e.label), 3)) : o("", !0),
64
- b("div", M({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
72
+ }, i(e.label), 3)) : r("", !0),
73
+ b("div", q({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
65
74
  b("div", {
66
75
  class: a(["flex flex-row items-center w-full h-full border", [
67
76
  e.bgInput,
68
77
  e.rounded,
69
- l(m) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
78
+ t(h) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
70
79
  e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-text",
71
- l(p) ? "bg-red-200 : dark:bg-red-900" : ""
80
+ t(m) ? "bg-red-200 dark:bg-red-900" : ""
72
81
  ]])
73
82
  }, [
74
- e.prefix ? (s(), r("div", q, i(e.prefix), 1)) : o("", !0),
75
- P.value ? (s(), r("div", {
83
+ e.prefix ? (o(), s("div", X, i(e.prefix), 1)) : r("", !0),
84
+ T.value ? (o(), s("div", {
76
85
  key: 1,
77
86
  class: a([e.prependInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
78
87
  }, [
79
- v(e.$slots, "prepend-inner")
80
- ], 2)) : o("", !0),
88
+ c(e.$slots, "prepend-inner")
89
+ ], 2)) : r("", !0),
81
90
  b("input", {
82
91
  ref_key: "inputField",
83
92
  ref: k,
84
- type: e.type,
85
- value: l(u),
86
- id: f,
93
+ type: A.value,
94
+ value: t(f),
95
+ id: y,
87
96
  placeholder: e.placeholder,
88
97
  disabled: e.disabled,
89
98
  readonly: e.readonly,
90
99
  maxlength: e.maxlength,
91
100
  autocomplete: "off",
92
101
  class: a(["w-full h-full bg-transparent rounded focus:outline-none p-3", [e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
93
- "aria-invalid": l(p) ? "true" : "false",
94
- "aria-describedby": l(p) ? `error-${f}` : null,
95
- onInput: t[0] || (t[0] = (...n) => l(g) && l(g)(...n)),
96
- onBlur: t[1] || (t[1] = (...n) => l(c) && l(c)(...n)),
97
- onFocus: t[2] || (t[2] = (...n) => l(C) && l(C)(...n)),
98
- onClick: t[3] || (t[3] = N((n) => d("handleClick"), ["stop"])),
99
- onKeydown: t[4] || (t[4] = (n) => d("keyDown", n)),
100
- onKeyup: t[5] || (t[5] = (n) => d("keyUp", n))
101
- }, null, 42, G),
102
- e.clearable && l(u) ? (s(), r("button", {
102
+ "aria-invalid": t(m) ? "true" : "false",
103
+ "aria-describedby": t(m) ? `error-${y}` : null,
104
+ onInput: l[0] || (l[0] = (...n) => t(w) && t(w)(...n)),
105
+ onBlur: l[1] || (l[1] = (...n) => t(g) && t(g)(...n)),
106
+ onFocus: l[2] || (l[2] = (...n) => t(C) && t(C)(...n)),
107
+ onClick: l[3] || (l[3] = G((n) => p("handleClick"), ["stop"])),
108
+ onKeydown: l[4] || (l[4] = (n) => p("keyDown", n)),
109
+ onKeyup: l[5] || (l[5] = (n) => p("keyUp", n))
110
+ }, null, 42, Y),
111
+ e.clearable && t(f) ? (o(), s("button", {
103
112
  key: 2,
104
113
  type: "button",
105
- onClick: t[6] || (t[6] = (...n) => l(w) && l(w)(...n)),
114
+ onClick: l[6] || (l[6] = (...n) => t(I) && t(I)(...n)),
106
115
  class: a(["ml-2", e.textColor]),
107
116
  disabled: e.disabled || e.readonly
108
- }, " × ", 10, J)) : o("", !0),
109
- v(e.$slots, "default"),
110
- S.value ? (s(), r("div", {
111
- key: 3,
117
+ }, " × ", 10, Z)) : r("", !0),
118
+ c(e.$slots, "default"),
119
+ e.type === "password" || e.showPasswordToggle ? (o(), s("div", _, [
120
+ J(R, {
121
+ icon: O.value,
122
+ onClick: z
123
+ }, null, 8, ["icon"])
124
+ ])) : r("", !0),
125
+ N.value ? (o(), s("div", {
126
+ key: 4,
112
127
  class: a([e.appendInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
113
128
  }, [
114
- v(e.$slots, "append-inner")
115
- ], 2)) : o("", !0),
116
- e.suffix ? (s(), r("div", L, i(e.suffix), 1)) : o("", !0)
129
+ c(e.$slots, "append-inner")
130
+ ], 2)) : r("", !0),
131
+ e.suffix ? (o(), s("div", ee, i(e.suffix), 1)) : r("", !0)
117
132
  ], 2),
118
- e.hideDetails ? o("", !0) : (s(), r("div", O, [
119
- l(p) ? (s(), r("div", {
133
+ e.hideDetails ? r("", !0) : (o(), s("div", te, [
134
+ t(m) ? (o(), s("div", {
120
135
  key: 0,
121
- id: `error-${f}`,
136
+ id: `error-${y}`,
122
137
  class: "text-red-500 text-sm text-center"
123
- }, i(l(B) || e.errorMessage), 9, Q)) : e.hint && (e.persistentHint || l(m)) ? (s(), r("div", R, i(e.hint), 1)) : o("", !0),
124
- e.counter && e.maxlength ? (s(), r("div", W, i((($ = l(u)) == null ? void 0 : $.length) || 0) + " / " + i(e.maxlength), 1)) : o("", !0)
138
+ }, i(t(B) || e.errorMessage), 9, le)) : e.hint && (e.persistentHint || t(h)) ? (o(), s("div", ne, i(e.hint), 1)) : r("", !0),
139
+ e.counter && e.maxlength ? (o(), s("div", se, i((($ = t(f)) == null ? void 0 : $.length) || 0) + " / " + i(e.maxlength), 1)) : r("", !0)
125
140
  ]))
126
141
  ], 16)
127
142
  ]);
@@ -129,5 +144,5 @@ const H = { class: "w-full flex flex-col relative" }, q = {
129
144
  }
130
145
  };
131
146
  export {
132
- _ as default
147
+ ue as default
133
148
  };
@@ -27,7 +27,8 @@ const e = {
27
27
  labelColor: { type: String, default: "text-black/80 dark:text-white/80" },
28
28
  placeholderColor: { type: String, default: "placeholder-black/60 dark:placeholder-white/60" },
29
29
  bgInput: { type: String, default: "bg-slate-200 dark:bg-slate-800" },
30
- textCenter: { type: Boolean, default: !1 }
30
+ textCenter: { type: Boolean, default: !1 },
31
+ showPasswordToggle: { type: Boolean, default: !0 }
31
32
  };
32
33
  export {
33
34
  e as default
@@ -0,0 +1,20 @@
1
+ import { createElementBlock as t, openBlock as c, createElementVNode as o } from "vue";
2
+ import r from "../_virtual/_plugin-vue_export-helper.js";
3
+ const n = {}, l = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "24",
6
+ height: "24",
7
+ viewBox: "0 0 24 24"
8
+ };
9
+ function s(f, e) {
10
+ return c(), t("svg", l, e[0] || (e[0] = [
11
+ o("path", {
12
+ fill: "currentColor",
13
+ d: "M2 5.27L3.28 4L20 20.72L18.73 22l-3.08-3.08c-1.15.38-2.37.58-3.65.58c-5 0-9.27-3.11-11-7.5c.69-1.76 1.79-3.31 3.19-4.54zM12 9a3 3 0 0 1 3 3a3 3 0 0 1-.17 1L11 9.17A3 3 0 0 1 12 9m0-4.5c5 0 9.27 3.11 11 7.5a11.8 11.8 0 0 1-4 5.19l-1.42-1.43A9.86 9.86 0 0 0 20.82 12A9.82 9.82 0 0 0 12 6.5c-1.09 0-2.16.18-3.16.5L7.3 5.47c1.44-.62 3.03-.97 4.7-.97M3.18 12A9.82 9.82 0 0 0 12 17.5c.69 0 1.37-.07 2-.21L11.72 15A3.064 3.064 0 0 1 9 12.28L5.6 8.87c-.99.85-1.82 1.91-2.42 3.13"
14
+ }, null, -1)
15
+ ]));
16
+ }
17
+ const a = /* @__PURE__ */ r(n, [["render", s]]);
18
+ export {
19
+ a as default
20
+ };
@@ -0,0 +1,20 @@
1
+ import { createElementBlock as t, openBlock as o, createElementVNode as r } from "vue";
2
+ import n from "../_virtual/_plugin-vue_export-helper.js";
3
+ const c = {}, l = {
4
+ xmlns: "http://www.w3.org/2000/svg",
5
+ width: "24",
6
+ height: "24",
7
+ viewBox: "0 0 24 24"
8
+ };
9
+ function a(s, e) {
10
+ return o(), t("svg", l, e[0] || (e[0] = [
11
+ r("path", {
12
+ fill: "currentColor",
13
+ d: "M12 9a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3m0-4.5c5 0 9.27 3.11 11 7.5c-1.73 4.39-6 7.5-11 7.5S2.73 16.39 1 12c1.73-4.39 6-7.5 11-7.5M3.18 12a9.821 9.821 0 0 0 17.64 0a9.821 9.821 0 0 0-17.64 0"
14
+ }, null, -1)
15
+ ]));
16
+ }
17
+ const f = /* @__PURE__ */ n(c, [["render", a]]);
18
+ export {
19
+ f as default
20
+ };
@@ -1,23 +1,27 @@
1
1
  import o from "./IconAsterisk.vue.js";
2
- import r from "./IconCheck.vue.js";
3
- import e from "./IconClose.vue.js";
2
+ import e from "./IconCheck.vue.js";
3
+ import r from "./IconClose.vue.js";
4
4
  import t from "./IconDelete.vue.js";
5
5
  import n from "./IconEdit.vue.js";
6
- import m from "./IconMenuDownOutline.vue.js";
7
- import i from "./IconMenuUpOutline.vue.js";
6
+ import i from "./IconMenuDownOutline.vue.js";
7
+ import m from "./IconMenuUpOutline.vue.js";
8
8
  import c from "./IconSearch.vue.js";
9
- import p from "./IconStar.vue.js";
10
- const d = {
9
+ import f from "./IconStar.vue.js";
10
+ import p from "./IconEyeOutline.vue.js";
11
+ import l from "./IconEyeOffOutline.vue.js";
12
+ const w = {
11
13
  asterisk: o,
12
- check: r,
13
- close: e,
14
+ check: e,
15
+ close: r,
14
16
  delete: t,
15
17
  edit: n,
16
- menuDownOutline: m,
17
- menuUpOutline: i,
18
+ menuDownOutline: i,
19
+ menuUpOutline: m,
18
20
  search: c,
19
- star: p
21
+ star: f,
22
+ eyeOutline: p,
23
+ eyeOffOutline: l
20
24
  };
21
25
  export {
22
- d as icons
26
+ w as icons
23
27
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.114",
3
+ "version": "0.1.115",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",