adverich-kun-ui 0.1.590 → 0.1.591

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,31 +1,31 @@
1
- import { nextTick as H, getCurrentInstance as q, computed as u, useSlots as G, ref as J, openBlock as n, createElementBlock as s, normalizeClass as p, toDisplayString as i, createCommentVNode as r, createElementVNode as k, mergeProps as L, unref as t, renderSlot as h, withModifiers as Q, createVNode as W } from "vue";
2
- import { icons as F } from "../../../../icons/index.js";
3
- import X from "../composables/KunTextFieldProps.js";
4
- import Y from "../composables/useKunTextFieldComposable.js";
5
- import Z from "../../../KunIcon/src/components/KunIcon.vue.js";
6
- const _ = {
1
+ import { nextTick as q, getCurrentInstance as G, computed as u, useSlots as J, ref as L, openBlock as t, createElementBlock as s, normalizeClass as p, toDisplayString as i, createCommentVNode as r, createElementVNode as b, mergeProps as Q, unref as l, renderSlot as h, withModifiers as W, createBlock as X, createVNode as Y } from "vue";
2
+ import { icons as w } from "../../../../icons/index.js";
3
+ import Z from "../composables/KunTextFieldProps.js";
4
+ import _ from "../composables/useKunTextFieldComposable.js";
5
+ import F from "../../../KunIcon/src/components/KunIcon.vue.js";
6
+ const ee = {
7
7
  key: 0,
8
8
  class: "mr-2"
9
- }, ee = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "aria-invalid", "aria-describedby"], te = ["disabled"], le = {
9
+ }, le = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "aria-invalid", "aria-describedby"], te = {
10
10
  key: 3,
11
11
  class: "flex items-center justify-center min-w-[32px] h-full px-1"
12
- }, ne = {
12
+ }, se = {
13
13
  key: 5,
14
14
  class: "ml-2"
15
- }, se = {
15
+ }, ne = {
16
16
  key: 0,
17
17
  class: "h-[1.25rem]"
18
- }, oe = ["id"], re = {
18
+ }, re = ["id"], oe = {
19
19
  key: 1,
20
20
  class: "text-xs text-center"
21
21
  }, ie = {
22
22
  key: 2,
23
23
  class: "text-xs text-right"
24
- }, ye = /* @__PURE__ */ Object.assign({
24
+ }, ce = /* @__PURE__ */ Object.assign({
25
25
  inheritAttrs: !1
26
26
  }, {
27
27
  __name: "KunTextField",
28
- props: { ...X },
28
+ props: { ...Z },
29
29
  emits: [
30
30
  "update:modelValue",
31
31
  "focus",
@@ -38,122 +38,124 @@ const _ = {
38
38
  setup(P, { expose: V, emit: j }) {
39
39
  const a = P, f = j, {
40
40
  inputField: d,
41
- inputValue: y,
42
- rootRef: w,
43
- inputFocused: b,
44
- validationError: E,
45
- hasError: m,
46
- handleInput: g,
47
- handleBlur: C,
48
- focusInput: I,
49
- validate: K,
50
- reset: S,
51
- resetValidation: T,
52
- clearInput: $
53
- } = Y(a, f), B = (e) => {
41
+ inputValue: c,
42
+ rootRef: g,
43
+ inputFocused: k,
44
+ validationError: B,
45
+ hasError: y,
46
+ handleInput: C,
47
+ handleBlur: I,
48
+ focusInput: $,
49
+ validate: E,
50
+ reset: K,
51
+ resetValidation: S,
52
+ clearInput: T
53
+ } = _(a, f), O = (e) => {
54
54
  f("keyDown", e), e.key === "Enter" && (e.preventDefault(), f("enter", e));
55
55
  };
56
56
  V({
57
- validate: K,
58
- reset: S,
59
- resetValidation: T,
57
+ validate: E,
58
+ reset: K,
59
+ resetValidation: S,
60
60
  inputField: d,
61
- rootRef: w,
61
+ rootRef: g,
62
62
  focus: () => {
63
- d.value && d.value.focus(), H(() => {
63
+ d.value && d.value.focus(), q(() => {
64
64
  d.value && d.value.focus();
65
65
  });
66
66
  }
67
67
  });
68
- const c = `input-${q().uid}`, O = u(() => b.value || y.value !== "" || a.dirty), x = G(), A = u(() => !!x["prepend-inner"]), N = u(() => !!x["append-inner"]), v = J(!1), z = u(() => v.value ? F.eyeOffOutline : F.eyeOutline);
69
- function M() {
68
+ const m = `input-${G().uid}`, z = u(() => k.value || c.value !== "" || a.dirty), x = J(), A = u(() => !!x["prepend-inner"]), N = u(() => !!x["append-inner"]), v = L(!1), M = u(() => v.value ? w.eyeOffOutline : w.eyeOutline);
69
+ function R() {
70
70
  v.value = !v.value;
71
71
  }
72
- const R = u(() => a.type === "password" ? v.value ? "text" : "password" : a.type), U = u(() => a.density === "compact" ? "p-1" : a.density === "comfortable" ? "p-2" : "p-3");
73
- return (e, l) => {
72
+ const U = u(() => a.type === "password" ? v.value ? "text" : "password" : a.type), H = u(() => a.density === "compact" ? "p-1" : a.density === "comfortable" ? "p-2" : "p-3");
73
+ return (e, n) => {
74
74
  var D;
75
- return n(), s("div", {
75
+ return t(), s("div", {
76
76
  class: "w-full flex flex-col relative",
77
77
  ref_key: "rootRef",
78
- ref: w
78
+ ref: g
79
79
  }, [
80
- e.label ? (n(), s("label", {
80
+ e.label ? (t(), s("label", {
81
81
  key: 0,
82
- for: c,
82
+ for: m,
83
83
  class: p([
84
84
  e.labelColor,
85
85
  "absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10",
86
- O.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
86
+ z.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
87
87
  ])
88
88
  }, i(e.label), 3)) : r("", !0),
89
- k("div", L({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
90
- k("div", {
89
+ b("div", Q({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
90
+ b("div", {
91
91
  class: p(["flex flex-row items-center w-full h-full border", [
92
92
  e.bgInput,
93
93
  e.rounded,
94
- t(b) ? "border-slate-400 dark:border-slate-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
94
+ l(k) ? "border-slate-400 dark:border-slate-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
95
95
  e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-text",
96
- t(m) ? "bg-red-200 dark:bg-red-900" : ""
96
+ l(y) ? "bg-red-200 dark:bg-red-900" : ""
97
97
  ]])
98
98
  }, [
99
- e.prefix ? (n(), s("div", _, i(e.prefix), 1)) : r("", !0),
100
- A.value ? (n(), s("div", {
99
+ e.prefix ? (t(), s("div", ee, i(e.prefix), 1)) : r("", !0),
100
+ A.value ? (t(), s("div", {
101
101
  key: 1,
102
102
  class: p([e.prependInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
103
103
  }, [
104
104
  h(e.$slots, "prepend-inner")
105
105
  ], 2)) : r("", !0),
106
106
  h(e.$slots, "prepend-input-content"),
107
- k("input", {
107
+ b("input", {
108
108
  ref_key: "inputField",
109
109
  ref: d,
110
- type: R.value,
111
- value: t(y),
112
- id: c,
110
+ type: U.value,
111
+ value: l(c),
112
+ id: m,
113
113
  placeholder: e.placeholder,
114
114
  disabled: e.disabled,
115
115
  readonly: e.readonly,
116
116
  maxlength: e.maxlength,
117
117
  autocomplete: "off",
118
- class: p(["w-full h-full bg-transparent focus:outline-none", [U.value, e.textColor, e.placeholderColor, e.rounded, e.textCenter ? "text-center" : "", e.inputStyle]]),
119
- "aria-invalid": t(m) ? "true" : "false",
120
- "aria-describedby": t(m) ? `error-${c}` : null,
121
- onInput: l[0] || (l[0] = (...o) => t(g) && t(g)(...o)),
122
- onBlur: l[1] || (l[1] = (...o) => t(C) && t(C)(...o)),
123
- onFocus: l[2] || (l[2] = (...o) => t(I) && t(I)(...o)),
124
- onClick: l[3] || (l[3] = Q((o) => f("handleClick"), ["stop"])),
125
- onKeydown: B,
126
- onKeyup: l[4] || (l[4] = (o) => f("keyUp", o))
127
- }, null, 42, ee),
128
- e.clearable && t(y) ? (n(), s("button", {
118
+ class: p(["w-full h-full bg-transparent focus:outline-none", [H.value, e.textColor, e.placeholderColor, e.rounded, e.textCenter ? "text-center" : "", e.inputStyle]]),
119
+ "aria-invalid": l(y) ? "true" : "false",
120
+ "aria-describedby": l(y) ? `error-${m}` : null,
121
+ onInput: n[0] || (n[0] = (...o) => l(C) && l(C)(...o)),
122
+ onBlur: n[1] || (n[1] = (...o) => l(I) && l(I)(...o)),
123
+ onFocus: n[2] || (n[2] = (...o) => l($) && l($)(...o)),
124
+ onClick: n[3] || (n[3] = W((o) => f("handleClick"), ["stop"])),
125
+ onKeydown: O,
126
+ onKeyup: n[4] || (n[4] = (o) => f("keyUp", o))
127
+ }, null, 42, le),
128
+ e.clearable && l(c) ? (t(), X(F, {
129
129
  key: 2,
130
- type: "button",
131
- onClick: l[5] || (l[5] = (...o) => t($) && t($)(...o)),
132
- class: p(["ml-2", e.textColor]),
130
+ onClick: l(T),
131
+ size: "small",
132
+ color: "error",
133
+ icon: l(w).close,
134
+ class: p(["mr-1 mt-1", e.textColor]),
133
135
  disabled: e.disabled || e.readonly
134
- }, " × ", 10, te)) : r("", !0),
136
+ }, null, 8, ["onClick", "icon", "class", "disabled"])) : r("", !0),
135
137
  h(e.$slots, "default"),
136
- e.type === "password" && e.showPasswordToggle ? (n(), s("div", le, [
137
- W(Z, {
138
- icon: z.value,
139
- onClick: M
138
+ e.type === "password" && e.showPasswordToggle ? (t(), s("div", te, [
139
+ Y(F, {
140
+ icon: M.value,
141
+ onClick: R
140
142
  }, null, 8, ["icon"])
141
143
  ])) : r("", !0),
142
- N.value ? (n(), s("div", {
144
+ N.value ? (t(), s("div", {
143
145
  key: 4,
144
146
  class: p([e.appendInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
145
147
  }, [
146
148
  h(e.$slots, "append-inner")
147
149
  ], 2)) : r("", !0),
148
- e.suffix ? (n(), s("div", ne, i(e.suffix), 1)) : r("", !0)
150
+ e.suffix ? (t(), s("div", se, i(e.suffix), 1)) : r("", !0)
149
151
  ], 2),
150
- e.hideDetails ? r("", !0) : (n(), s("div", se, [
151
- t(m) ? (n(), s("div", {
152
+ e.hideDetails ? r("", !0) : (t(), s("div", ne, [
153
+ l(y) ? (t(), s("div", {
152
154
  key: 0,
153
- id: `error-${c}`,
155
+ id: `error-${m}`,
154
156
  class: "text-red-500 text-sm text-center"
155
- }, i(t(E) || e.errorMessage), 9, oe)) : e.hint && (e.persistentHint || t(b)) ? (n(), s("div", re, i(e.hint), 1)) : r("", !0),
156
- e.counter && e.maxlength ? (n(), s("div", ie, i(((D = t(y)) == null ? void 0 : D.length) || 0) + " / " + i(e.maxlength), 1)) : r("", !0)
157
+ }, i(l(B) || e.errorMessage), 9, re)) : e.hint && (e.persistentHint || l(k)) ? (t(), s("div", oe, i(e.hint), 1)) : r("", !0),
158
+ e.counter && e.maxlength ? (t(), s("div", ie, i(((D = l(c)) == null ? void 0 : D.length) || 0) + " / " + i(e.maxlength), 1)) : r("", !0)
157
159
  ]))
158
160
  ], 16)
159
161
  ], 512);
@@ -161,5 +163,5 @@ const _ = {
161
163
  }
162
164
  });
163
165
  export {
164
- ye as default
166
+ ce as default
165
167
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.590",
3
+ "version": "0.1.591",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",