adverich-kun-ui 0.1.570 → 0.1.571

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,4 +1,4 @@
1
- import { getCurrentInstance as E, useSlots as P, nextTick as R, computed as U, openBlock as s, createElementBlock as l, normalizeClass as c, toDisplayString as u, createCommentVNode as n, createElementVNode as d, mergeProps as H, unref as o, createBlock as x, renderSlot as V, createVNode as j, withCtx as L, Fragment as D, renderList as T } from "vue";
1
+ import { getCurrentInstance as E, useSlots as P, nextTick as R, computed as U, openBlock as s, createElementBlock as l, normalizeClass as y, toDisplayString as p, createCommentVNode as n, createElementVNode as i, mergeProps as H, unref as o, createBlock as x, renderSlot as V, createVNode as j, withCtx as L, Fragment as D, renderList as T } from "vue";
2
2
  import { KunNumberFieldProps as q } from "../composables/KunNumberFieldProps.js";
3
3
  import { useKunNumberField as G } from "../composables/useKunNumberFieldComposable.js";
4
4
  import J from "../../../KunBtn/src/components/KunBtn.vue.js";
@@ -25,10 +25,10 @@ const Q = {
25
25
  }, se = ["disabled"], le = ["disabled"], ne = {
26
26
  key: 5,
27
27
  class: "flex items-center justify-center h-full pr-1"
28
- }, de = {
28
+ }, ie = {
29
29
  key: 6,
30
30
  class: "h-full"
31
- }, ie = ["disabled"], ae = {
31
+ }, de = ["disabled"], ae = {
32
32
  key: 7,
33
33
  class: "ml-2"
34
34
  }, ue = {
@@ -37,7 +37,7 @@ const Q = {
37
37
  }, pe = {
38
38
  key: 0,
39
39
  class: "text-red-500 text-sm text-center"
40
- }, be = { key: 0 }, ye = { key: 1 }, ce = {
40
+ }, be = { key: 0 }, ce = { key: 1 }, ye = {
41
41
  key: 1,
42
42
  class: "text-xs text-center"
43
43
  }, ge = {
@@ -53,31 +53,30 @@ const Q = {
53
53
  "keyUp"
54
54
  ],
55
55
  setup(F, { expose: K, emit: N }) {
56
- const p = F, b = N, k = `number-input-${E().uid}`, m = P(), A = !!m["prepend-icon"], B = !!m["append-icon"], {
56
+ const b = F, c = N, k = `number-input-${E().uid}`, m = P(), A = !!m["prepend-icon"], B = !!m["append-icon"], {
57
57
  inputValue: h,
58
- numberInput: y,
58
+ numberInput: d,
59
59
  rootRef: v,
60
- onIncrement: i,
61
- onDecrement: a,
60
+ onIncrement: a,
61
+ onDecrement: u,
62
62
  onClear: M,
63
63
  validateKey: S,
64
64
  focus: w,
65
65
  handleFocus: g,
66
66
  handleBlur: C,
67
67
  handleInput: I
68
- } = G(p, b);
68
+ } = G(b, c);
69
69
  K({
70
- numberInput: y,
70
+ numberInput: d,
71
71
  rootRef: v,
72
72
  focus: () => {
73
- R(() => {
74
- var e;
75
- (e = y.value) == null || e.focus();
73
+ d.value && d.value.focus(), R(() => {
74
+ d.value && d.value.focus();
76
75
  });
77
76
  }
78
77
  });
79
78
  const $ = U(
80
- () => p.density === "compact" ? "p-1" : p.density === "comfortable" ? "p-2" : "p-3"
79
+ () => b.density === "compact" ? "p-1" : b.density === "comfortable" ? "p-2" : "p-3"
81
80
  );
82
81
  return (e, r) => (s(), l("div", {
83
82
  class: "w-full flex flex-col relative h-fit",
@@ -87,15 +86,15 @@ const Q = {
87
86
  e.label ? (s(), l("label", {
88
87
  key: 0,
89
88
  for: k,
90
- class: c([
89
+ class: y([
91
90
  e.labelColor,
92
91
  "absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10",
93
92
  "-top-2.25 text-xs opacity-80"
94
93
  ])
95
- }, u(e.label), 3)) : n("", !0),
96
- d("div", H({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
97
- d("div", {
98
- class: c(["flex items-center w-full h-full border", [
94
+ }, p(e.label), 3)) : n("", !0),
95
+ i("div", H({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
96
+ i("div", {
97
+ class: y(["flex items-center w-full h-full border", [
99
98
  e.bgInput,
100
99
  e.rounded,
101
100
  o(w) ? "border-slate-400 dark:border-slate-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
@@ -104,24 +103,24 @@ const Q = {
104
103
  ]])
105
104
  }, [
106
105
  !e.noArrows && e.controlVariant === "split" ? (s(), l("div", Q, [
107
- d("button", {
106
+ i("button", {
108
107
  type: "button",
109
108
  class: "p-3 text-lg border-r border-slate-600 text-black dark:text-white disabled:opacity-50 cursor-pointer hover:opacity-80",
110
- onClick: r[0] || (r[0] = (...t) => o(a) && o(a)(...t)),
109
+ onClick: r[0] || (r[0] = (...t) => o(u) && o(u)(...t)),
111
110
  disabled: e.disabled || e.readonly
112
111
  }, "−", 8, W)
113
112
  ])) : n("", !0),
114
- e.prefix ? (s(), l("div", X, u(e.prefix), 1)) : n("", !0),
113
+ e.prefix ? (s(), l("div", X, p(e.prefix), 1)) : n("", !0),
115
114
  e.prependIcon || A ? (s(), l("div", Y, [
116
115
  e.prependIcon ? (s(), x(f, {
117
116
  key: 0,
118
117
  icon: e.prependIcon
119
118
  }, null, 8, ["icon"])) : V(e.$slots, "prepend-icon", { key: 1 })
120
119
  ])) : n("", !0),
121
- d("input", {
120
+ i("input", {
122
121
  id: k,
123
122
  ref_key: "numberInput",
124
- ref: y,
123
+ ref: d,
125
124
  type: "text",
126
125
  value: o(h),
127
126
  placeholder: e.placeholder,
@@ -129,13 +128,13 @@ const Q = {
129
128
  disabled: e.disabled,
130
129
  maxlength: e.maxlength,
131
130
  autocomplete: "off",
132
- class: c(["w-full h-full bg-transparent rounded focus:outline-none", [$.value, e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
131
+ class: y(["w-full h-full bg-transparent rounded focus:outline-none", [$.value, e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
133
132
  "aria-invalid": e.error ? "true" : "false",
134
133
  onBlur: r[1] || (r[1] = (...t) => o(C) && o(C)(...t)),
135
134
  onFocus: r[2] || (r[2] = (...t) => o(g) && o(g)(...t)),
136
135
  onInput: r[3] || (r[3] = (...t) => o(I) && o(I)(...t)),
137
- onKeydown: r[4] || (r[4] = (t) => (o(S)(t), b("keyDown", t))),
138
- onKeyup: r[5] || (r[5] = (t) => b("keyUp", t)),
136
+ onKeydown: r[4] || (r[4] = (t) => (o(S)(t), c("keyDown", t))),
137
+ onKeyup: r[5] || (r[5] = (t) => c("keyUp", t)),
139
138
  inputmode: "decimal",
140
139
  pattern: "[0-9]+([\\.,][0-9]+)?"
141
140
  }, null, 42, Z),
@@ -158,35 +157,35 @@ const Q = {
158
157
  ])) : n("", !0),
159
158
  e.noArrows ? n("", !0) : (s(), l(D, { key: 4 }, [
160
159
  e.controlVariant === "default" ? (s(), l("div", ee, [
161
- d("button", {
160
+ i("button", {
162
161
  type: "button",
163
162
  class: "flex items-center border-l border-slate-600 p-3 justify-center text-black dark:text-white hover:text-black/80 dark:hover:text-white/80 disabled:opacity-50 cursor-pointer hover:opacity-80",
164
- onClick: r[6] || (r[6] = (...t) => o(i) && o(i)(...t)),
163
+ onClick: r[6] || (r[6] = (...t) => o(a) && o(a)(...t)),
165
164
  disabled: e.disabled || e.readonly
166
165
  }, "▲", 8, te),
167
- d("button", {
166
+ i("button", {
168
167
  type: "button",
169
168
  class: "flex items-center border-l border-slate-600 p-3 justify-center text-black dark:text-white hover:text-black/80 dark:hover:text-white/80 disabled:opacity-50 cursor-pointer hover:opacity-80",
170
- onClick: r[7] || (r[7] = (...t) => o(a) && o(a)(...t)),
169
+ onClick: r[7] || (r[7] = (...t) => o(u) && o(u)(...t)),
171
170
  disabled: e.disabled || e.readonly
172
171
  }, "▼", 8, oe)
173
172
  ])) : n("", !0),
174
173
  e.controlVariant === "stacked" ? (s(), l("div", re, [
175
- d("div", {
174
+ i("div", {
176
175
  class: "border-b border-slate-600 pb-1 px-3 flex hover:opacity-80 cursor-pointer",
177
- onClick: r[8] || (r[8] = (...t) => o(i) && o(i)(...t))
176
+ onClick: r[8] || (r[8] = (...t) => o(a) && o(a)(...t))
178
177
  }, [
179
- d("button", {
178
+ i("button", {
180
179
  type: "button",
181
180
  class: "text-xs text-black dark:text-white hover:text-black/80 dark:hover:text-white/80 disabled:opacity-50 cursor-pointer",
182
181
  disabled: e.disabled || e.readonly
183
182
  }, "▲", 8, se)
184
183
  ]),
185
- d("div", {
184
+ i("div", {
186
185
  class: "border-t border-slate-600 pt-1 px-3 flex hover:opacity-80 cursor-pointer",
187
- onClick: r[9] || (r[9] = (...t) => o(a) && o(a)(...t))
186
+ onClick: r[9] || (r[9] = (...t) => o(u) && o(u)(...t))
188
187
  }, [
189
- d("button", {
188
+ i("button", {
190
189
  type: "button",
191
190
  class: "text-xs text-black dark:text-white hover:text-black/80 dark:hover:text-white/80 disabled:opacity-50 cursor-pointer",
192
191
  disabled: e.disabled || e.readonly
@@ -200,22 +199,22 @@ const Q = {
200
199
  icon: e.appendIcon
201
200
  }, null, 8, ["icon"])) : V(e.$slots, "append-icon", { key: 1 })
202
201
  ])) : n("", !0),
203
- !e.noArrows && e.controlVariant === "split" ? (s(), l("div", de, [
204
- d("button", {
202
+ !e.noArrows && e.controlVariant === "split" ? (s(), l("div", ie, [
203
+ i("button", {
205
204
  type: "button",
206
205
  class: "p-3 text-lg border-l border-slate-600 text-black dark:text-white disabled:opacity-50 cursor-pointer hover:opacity-80",
207
- onClick: r[10] || (r[10] = (...t) => o(i) && o(i)(...t)),
206
+ onClick: r[10] || (r[10] = (...t) => o(a) && o(a)(...t)),
208
207
  disabled: e.disabled || e.readonly
209
- }, "+", 8, ie)
208
+ }, "+", 8, de)
210
209
  ])) : n("", !0),
211
- e.suffix ? (s(), l("div", ae, u(e.suffix), 1)) : n("", !0)
210
+ e.suffix ? (s(), l("div", ae, p(e.suffix), 1)) : n("", !0)
212
211
  ], 2),
213
212
  e.hideDetails ? n("", !0) : (s(), l("div", ue, [
214
213
  e.error || e.errorMessages ? (s(), l("div", pe, [
215
214
  Array.isArray(e.errorMessages) ? (s(), l("div", be, [
216
- (s(!0), l(D, null, T(e.errorMessages, (t, z) => (s(), l("div", { key: z }, u(t), 1))), 128))
217
- ])) : typeof e.errorMessages == "string" ? (s(), l("div", ye, u(e.errorMessages), 1)) : n("", !0)
218
- ])) : e.hint && (e.persistentHint || o(w)) ? (s(), l("div", ce, u(e.hint), 1)) : n("", !0)
215
+ (s(!0), l(D, null, T(e.errorMessages, (t, z) => (s(), l("div", { key: z }, p(t), 1))), 128))
216
+ ])) : typeof e.errorMessages == "string" ? (s(), l("div", ce, p(e.errorMessages), 1)) : n("", !0)
217
+ ])) : e.hint && (e.persistentHint || o(w)) ? (s(), l("div", ye, p(e.hint), 1)) : n("", !0)
219
218
  ]))
220
219
  ], 16)
221
220
  ], 512));
@@ -1,4 +1,4 @@
1
- import { nextTick as H, getCurrentInstance as q, computed as d, useSlots as G, ref as J, openBlock as n, createElementBlock as s, normalizeClass as u, toDisplayString as i, createCommentVNode as o, createElementVNode as k, mergeProps as L, unref as t, renderSlot as h, withModifiers as Q, createVNode as W } from "vue";
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
2
  import { icons as F } from "../../../../icons/index.js";
3
3
  import X from "../composables/KunTextFieldProps.js";
4
4
  import Y from "../composables/useKunTextFieldComposable.js";
@@ -15,7 +15,7 @@ const _ = {
15
15
  }, se = {
16
16
  key: 0,
17
17
  class: "h-[1.25rem]"
18
- }, re = ["id"], oe = {
18
+ }, oe = ["id"], re = {
19
19
  key: 1,
20
20
  class: "text-xs text-center"
21
21
  }, ie = {
@@ -36,8 +36,8 @@ const _ = {
36
36
  "enter"
37
37
  ],
38
38
  setup(P, { expose: V, emit: j }) {
39
- const a = P, p = j, {
40
- inputField: f,
39
+ const a = P, f = j, {
40
+ inputField: d,
41
41
  inputValue: y,
42
42
  rootRef: w,
43
43
  inputFocused: b,
@@ -50,26 +50,26 @@ const _ = {
50
50
  reset: S,
51
51
  resetValidation: T,
52
52
  clearInput: $
53
- } = Y(a, p), B = (e) => {
54
- p("keyDown", e), e.key === "Enter" && (e.preventDefault(), p("enter", e));
53
+ } = Y(a, f), B = (e) => {
54
+ f("keyDown", e), e.key === "Enter" && (e.preventDefault(), f("enter", e));
55
55
  };
56
56
  V({
57
57
  validate: K,
58
58
  reset: S,
59
59
  resetValidation: T,
60
- inputField: f,
60
+ inputField: d,
61
61
  rootRef: w,
62
62
  focus: () => {
63
- H(() => {
64
- f.value && f.value.focus();
63
+ d.value && d.value.focus(), H(() => {
64
+ d.value && d.value.focus();
65
65
  });
66
66
  }
67
67
  });
68
- const c = `input-${q().uid}`, O = d(() => b.value || y.value !== "" || a.dirty), x = G(), A = d(() => !!x["prepend-inner"]), N = d(() => !!x["append-inner"]), v = J(!1), z = d(() => v.value ? F.eyeOffOutline : F.eyeOutline);
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
69
  function M() {
70
70
  v.value = !v.value;
71
71
  }
72
- const R = d(() => a.type === "password" ? v.value ? "text" : "password" : a.type), U = d(() => a.density === "compact" ? "p-1" : a.density === "comfortable" ? "p-2" : "p-3");
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
73
  return (e, l) => {
74
74
  var D;
75
75
  return n(), s("div", {
@@ -80,15 +80,15 @@ const _ = {
80
80
  e.label ? (n(), s("label", {
81
81
  key: 0,
82
82
  for: c,
83
- class: u([
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
86
  O.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
87
87
  ])
88
- }, i(e.label), 3)) : o("", !0),
88
+ }, i(e.label), 3)) : r("", !0),
89
89
  k("div", L({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
90
90
  k("div", {
91
- class: u(["flex flex-row items-center w-full h-full border", [
91
+ class: p(["flex flex-row items-center w-full h-full border", [
92
92
  e.bgInput,
93
93
  e.rounded,
94
94
  t(b) ? "border-slate-400 dark:border-slate-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
@@ -96,17 +96,17 @@ const _ = {
96
96
  t(m) ? "bg-red-200 dark:bg-red-900" : ""
97
97
  ]])
98
98
  }, [
99
- e.prefix ? (n(), s("div", _, i(e.prefix), 1)) : o("", !0),
99
+ e.prefix ? (n(), s("div", _, i(e.prefix), 1)) : r("", !0),
100
100
  A.value ? (n(), s("div", {
101
101
  key: 1,
102
- class: u([e.prependInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
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
- ], 2)) : o("", !0),
105
+ ], 2)) : r("", !0),
106
106
  h(e.$slots, "prepend-input-content"),
107
107
  k("input", {
108
108
  ref_key: "inputField",
109
- ref: f,
109
+ ref: d,
110
110
  type: R.value,
111
111
  value: t(y),
112
112
  id: c,
@@ -115,45 +115,45 @@ const _ = {
115
115
  readonly: e.readonly,
116
116
  maxlength: e.maxlength,
117
117
  autocomplete: "off",
118
- class: u(["w-full h-full bg-transparent focus:outline-none", [U.value, e.textColor, e.placeholderColor, e.rounded, e.textCenter ? "text-center" : "", e.inputStyle]]),
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
119
  "aria-invalid": t(m) ? "true" : "false",
120
120
  "aria-describedby": t(m) ? `error-${c}` : null,
121
- onInput: l[0] || (l[0] = (...r) => t(g) && t(g)(...r)),
122
- onBlur: l[1] || (l[1] = (...r) => t(C) && t(C)(...r)),
123
- onFocus: l[2] || (l[2] = (...r) => t(I) && t(I)(...r)),
124
- onClick: l[3] || (l[3] = Q((r) => p("handleClick"), ["stop"])),
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
125
  onKeydown: B,
126
- onKeyup: l[4] || (l[4] = (r) => p("keyUp", r))
126
+ onKeyup: l[4] || (l[4] = (o) => f("keyUp", o))
127
127
  }, null, 42, ee),
128
128
  e.clearable && t(y) ? (n(), s("button", {
129
129
  key: 2,
130
130
  type: "button",
131
- onClick: l[5] || (l[5] = (...r) => t($) && t($)(...r)),
132
- class: u(["ml-2", e.textColor]),
131
+ onClick: l[5] || (l[5] = (...o) => t($) && t($)(...o)),
132
+ class: p(["ml-2", e.textColor]),
133
133
  disabled: e.disabled || e.readonly
134
- }, " × ", 10, te)) : o("", !0),
134
+ }, " × ", 10, te)) : r("", !0),
135
135
  h(e.$slots, "default"),
136
136
  e.type === "password" && e.showPasswordToggle ? (n(), s("div", le, [
137
137
  W(Z, {
138
138
  icon: z.value,
139
139
  onClick: M
140
140
  }, null, 8, ["icon"])
141
- ])) : o("", !0),
141
+ ])) : r("", !0),
142
142
  N.value ? (n(), s("div", {
143
143
  key: 4,
144
- class: u([e.appendInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
144
+ class: p([e.appendInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
145
145
  }, [
146
146
  h(e.$slots, "append-inner")
147
- ], 2)) : o("", !0),
148
- e.suffix ? (n(), s("div", ne, i(e.suffix), 1)) : o("", !0)
147
+ ], 2)) : r("", !0),
148
+ e.suffix ? (n(), s("div", ne, i(e.suffix), 1)) : r("", !0)
149
149
  ], 2),
150
- e.hideDetails ? o("", !0) : (n(), s("div", se, [
150
+ e.hideDetails ? r("", !0) : (n(), s("div", se, [
151
151
  t(m) ? (n(), s("div", {
152
152
  key: 0,
153
153
  id: `error-${c}`,
154
154
  class: "text-red-500 text-sm text-center"
155
- }, i(t(E) || e.errorMessage), 9, re)) : e.hint && (e.persistentHint || t(b)) ? (n(), s("div", oe, i(e.hint), 1)) : o("", !0),
156
- e.counter && e.maxlength ? (n(), s("div", ie, i(((D = t(y)) == null ? void 0 : D.length) || 0) + " / " + i(e.maxlength), 1)) : o("", !0)
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
157
  ]))
158
158
  ], 16)
159
159
  ], 512);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.570",
3
+ "version": "0.1.571",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",