adverich-kun-ui 0.1.265 → 0.1.267

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,11 +1,8 @@
1
- import { getCurrentInstance as z, useSlots as E, computed as P, createElementBlock as l, openBlock as s, createCommentVNode as n, createElementVNode as i, normalizeClass as p, unref as o, toDisplayString as u, mergeProps as R, createBlock as C, renderSlot as I, Fragment as V, renderList as U } from "vue";
2
- import { KunNumberFieldProps as H } from "../composables/KunNumberFieldProps.js";
3
- import { useKunNumberField as L } from "../composables/useKunNumberFieldComposable.js";
4
- import j from "../../../KunIcon/src/components/KunIcon.vue.js";
5
- const q = {
6
- class: "w-full flex flex-col relative",
7
- ref: "rootRef"
8
- }, G = {
1
+ import { getCurrentInstance as E, useSlots as P, computed as R, createElementBlock as l, openBlock as s, createCommentVNode as n, createElementVNode as i, normalizeClass as p, unref as o, toDisplayString as u, mergeProps as U, createBlock as I, renderSlot as V, Fragment as j, renderList as H } from "vue";
2
+ import { KunNumberFieldProps as L } from "../composables/KunNumberFieldProps.js";
3
+ import { useKunNumberField as q } from "../composables/useKunNumberFieldComposable.js";
4
+ import x from "../../../KunIcon/src/components/KunIcon.vue.js";
5
+ const G = {
9
6
  key: 0,
10
7
  class: "h-full"
11
8
  }, J = ["disabled"], O = {
@@ -38,9 +35,9 @@ const q = {
38
35
  }, de = { key: 0 }, ae = { key: 1 }, ue = {
39
36
  key: 1,
40
37
  class: "text-xs text-center"
41
- }, fe = {
38
+ }, ce = {
42
39
  __name: "KunNumberField",
43
- props: H,
40
+ props: L,
44
41
  emits: [
45
42
  "update:modelValue",
46
43
  "focusInput",
@@ -49,41 +46,50 @@ const q = {
49
46
  "keyDown",
50
47
  "keyUp"
51
48
  ],
52
- setup(x, { expose: A, emit: D }) {
53
- const b = x, y = D, c = `number-input-${z().uid}`, f = E(), F = !!f["prepend-icon"], K = !!f["append-icon"], {
54
- inputValue: k,
55
- numberInput: m,
56
- inputKey: B,
57
- updateValue: M,
49
+ setup(A, { expose: D, emit: F }) {
50
+ const b = A, y = F, c = `number-input-${E().uid}`, k = P(), K = !!k["prepend-icon"], B = !!k["append-icon"], {
51
+ inputValue: m,
52
+ numberInput: f,
53
+ rootRef: h,
54
+ inputKey: M,
55
+ updateValue: N,
58
56
  onIncrement: d,
59
57
  onDecrement: a,
60
- onClear: h,
61
- focus: v,
62
- handleFocus: w,
63
- isActive: N,
64
- handleBlur: g
65
- } = L(b, y);
66
- A({
67
- numberInput: m,
68
- rootRef
58
+ onClear: v,
59
+ focus: w,
60
+ handleFocus: g,
61
+ isActive: S,
62
+ handleBlur: C
63
+ } = q(b, y);
64
+ D({
65
+ numberInput: f,
66
+ rootRef: h,
67
+ focus: () => {
68
+ var e;
69
+ return (e = f.value) == null ? void 0 : e.focus();
70
+ }
69
71
  });
70
- const S = P(() => b.density === "compact" ? "p-1" : b.density === "comfortable" ? "p-2" : "p-3");
71
- return (e, r) => (s(), l("div", q, [
72
+ const $ = R(() => b.density === "compact" ? "p-1" : b.density === "comfortable" ? "p-2" : "p-3");
73
+ return (e, r) => (s(), l("div", {
74
+ class: "w-full flex flex-col relative",
75
+ ref_key: "rootRef",
76
+ ref: h
77
+ }, [
72
78
  e.label ? (s(), l("label", {
73
79
  key: 0,
74
80
  for: c,
75
81
  class: p([
76
82
  e.labelColor,
77
83
  "absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10",
78
- o(N) || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
84
+ o(S) || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
79
85
  ])
80
86
  }, u(e.label), 3)) : n("", !0),
81
- i("div", R({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
87
+ i("div", U({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
82
88
  i("div", {
83
89
  class: p(["flex items-center w-full h-full border", [
84
90
  e.bgInput,
85
91
  e.rounded,
86
- o(v) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
92
+ o(w) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
87
93
  e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-text",
88
94
  e.error ? "bg-red-200 dark:bg-red-900" : ""
89
95
  ]])
@@ -97,40 +103,40 @@ const q = {
97
103
  }, "−", 8, J)
98
104
  ])) : n("", !0),
99
105
  e.prefix ? (s(), l("div", O, u(e.prefix), 1)) : n("", !0),
100
- e.prependIcon || F ? (s(), l("div", Q, [
101
- e.prependIcon ? (s(), C(j, {
106
+ e.prependIcon || K ? (s(), l("div", Q, [
107
+ e.prependIcon ? (s(), I(x, {
102
108
  key: 0,
103
109
  icon: e.prependIcon
104
- }, null, 8, ["icon"])) : I(e.$slots, "prepend-icon", { key: 1 })
110
+ }, null, 8, ["icon"])) : V(e.$slots, "prepend-icon", { key: 1 })
105
111
  ])) : n("", !0),
106
112
  (s(), l("input", {
107
113
  id: c,
108
114
  ref_key: "numberInput",
109
- ref: m,
110
- key: o(B),
115
+ ref: f,
116
+ key: o(M),
111
117
  type: "text",
112
- value: o(k),
118
+ value: o(m),
113
119
  placeholder: e.placeholder,
114
120
  readonly: e.readonly,
115
121
  disabled: e.disabled,
116
122
  maxlength: e.maxlength,
117
123
  autocomplete: "off",
118
- class: p(["w-full h-full bg-transparent rounded focus:outline-none", [S.value, e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
124
+ class: p(["w-full h-full bg-transparent rounded focus:outline-none", [$.value, e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
119
125
  "aria-invalid": e.error ? "true" : "false",
120
- onInput: r[1] || (r[1] = (t) => o(M)(t.target.value)),
121
- onBlur: r[2] || (r[2] = (...t) => o(g) && o(g)(...t)),
122
- onFocus: r[3] || (r[3] = (...t) => o(w) && o(w)(...t)),
126
+ onInput: r[1] || (r[1] = (t) => o(N)(t.target.value)),
127
+ onBlur: r[2] || (r[2] = (...t) => o(C) && o(C)(...t)),
128
+ onFocus: r[3] || (r[3] = (...t) => o(g) && o(g)(...t)),
123
129
  onKeydown: r[4] || (r[4] = (t) => y("keyDown", t)),
124
130
  onKeyup: r[5] || (r[5] = (t) => y("keyUp", t))
125
131
  }, null, 42, T)),
126
- e.clearable && o(k) != null ? (s(), l("button", {
132
+ e.clearable && o(m) != null ? (s(), l("button", {
127
133
  key: 3,
128
134
  type: "button",
129
- onClick: r[6] || (r[6] = (...t) => o(h) && o(h)(...t)),
135
+ onClick: r[6] || (r[6] = (...t) => o(v) && o(v)(...t)),
130
136
  class: p(["ml-2", e.textColor]),
131
137
  disabled: e.disabled || e.readonly
132
138
  }, " × ", 10, W)) : n("", !0),
133
- e.noArrows ? n("", !0) : (s(), l(V, { key: 4 }, [
139
+ e.noArrows ? n("", !0) : (s(), l(j, { key: 4 }, [
134
140
  e.controlVariant === "default" ? (s(), l("div", X, [
135
141
  i("button", {
136
142
  type: "button",
@@ -168,11 +174,11 @@ const q = {
168
174
  ])
169
175
  ])) : n("", !0)
170
176
  ], 64)),
171
- e.appendIcon || K ? (s(), l("div", oe, [
172
- e.appendIcon ? (s(), C(j, {
177
+ e.appendIcon || B ? (s(), l("div", oe, [
178
+ e.appendIcon ? (s(), I(x, {
173
179
  key: 0,
174
180
  icon: e.appendIcon
175
- }, null, 8, ["icon"])) : I(e.$slots, "append-icon", { key: 1 })
181
+ }, null, 8, ["icon"])) : V(e.$slots, "append-icon", { key: 1 })
176
182
  ])) : n("", !0),
177
183
  !e.noArrows && e.controlVariant === "split" ? (s(), l("div", re, [
178
184
  i("button", {
@@ -187,14 +193,14 @@ const q = {
187
193
  e.hideDetails ? n("", !0) : (s(), l("div", ne, [
188
194
  e.error || e.errorMessages ? (s(), l("div", ie, [
189
195
  Array.isArray(e.errorMessages) ? (s(), l("div", de, [
190
- (s(!0), l(V, null, U(e.errorMessages, (t, $) => (s(), l("div", { key: $ }, u(t), 1))), 128))
196
+ (s(!0), l(j, null, H(e.errorMessages, (t, z) => (s(), l("div", { key: z }, u(t), 1))), 128))
191
197
  ])) : typeof e.errorMessages == "string" ? (s(), l("div", ae, u(e.errorMessages), 1)) : n("", !0)
192
- ])) : e.hint && (e.persistentHint || o(v)) ? (s(), l("div", ue, u(e.hint), 1)) : n("", !0)
198
+ ])) : e.hint && (e.persistentHint || o(w)) ? (s(), l("div", ue, u(e.hint), 1)) : n("", !0)
193
199
  ]))
194
200
  ], 16)
195
201
  ], 512));
196
202
  }
197
203
  };
198
204
  export {
199
- fe as default
205
+ ce as default
200
206
  };
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance as U, computed as d, useSlots as H, ref as q, createElementBlock as s, openBlock as o, createCommentVNode as r, createElementVNode as b, normalizeClass as u, toDisplayString as i, mergeProps as G, unref as t, renderSlot as h, withModifiers as J, createVNode as L } from "vue";
1
+ import { getCurrentInstance as U, computed as d, useSlots as H, ref as q, createElementBlock as s, openBlock as o, createCommentVNode as r, createElementVNode as h, normalizeClass as u, toDisplayString as i, mergeProps as G, unref as t, renderSlot as k, withModifiers as J, createVNode as L } from "vue";
2
2
  import { icons as P } from "../../../../icons/index.js";
3
3
  import Q from "../composables/KunTextFieldProps.js";
4
4
  import W from "../composables/useKunTextFieldComposable.js";
@@ -34,10 +34,10 @@ const Y = {
34
34
  ],
35
35
  setup(V, { expose: D, emit: j }) {
36
36
  const a = V, p = j, {
37
- inputField: k,
37
+ inputField: c,
38
38
  inputValue: f,
39
39
  rootRef: w,
40
- inputFocused: c,
40
+ inputFocused: b,
41
41
  validationError: B,
42
42
  hasError: y,
43
43
  handleInput: g,
@@ -52,10 +52,14 @@ const Y = {
52
52
  validate: E,
53
53
  reset: K,
54
54
  resetValidation: S,
55
- inputField: k,
56
- rootRef: w
55
+ inputField: c,
56
+ rootRef: w,
57
+ focus: () => {
58
+ var e;
59
+ return (e = c.value) == null ? void 0 : e.focus();
60
+ }
57
61
  });
58
- const m = `input-${U().uid}`, T = d(() => c.value || !!f.value || a.dirty), x = H(), N = d(() => !!x["prepend-inner"]), O = d(() => !!x["append-inner"]), v = q(!1), z = d(() => v.value ? P.eyeOffOutline : P.eyeOutline);
62
+ const m = `input-${U().uid}`, T = d(() => b.value || !!f.value || a.dirty), x = H(), N = d(() => !!x["prepend-inner"]), O = d(() => !!x["append-inner"]), v = q(!1), z = d(() => v.value ? P.eyeOffOutline : P.eyeOutline);
59
63
  function A() {
60
64
  v.value = !v.value;
61
65
  }
@@ -76,12 +80,12 @@ const Y = {
76
80
  T.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
77
81
  ])
78
82
  }, i(e.label), 3)) : r("", !0),
79
- b("div", G({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
80
- b("div", {
83
+ h("div", G({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
84
+ h("div", {
81
85
  class: u(["flex flex-row items-center w-full h-full border", [
82
86
  e.bgInput,
83
87
  e.rounded,
84
- t(c) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
88
+ t(b) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
85
89
  e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-text",
86
90
  t(y) ? "bg-red-200 dark:bg-red-900" : ""
87
91
  ]])
@@ -91,11 +95,11 @@ const Y = {
91
95
  key: 1,
92
96
  class: u([e.prependInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
93
97
  }, [
94
- h(e.$slots, "prepend-inner")
98
+ k(e.$slots, "prepend-inner")
95
99
  ], 2)) : r("", !0),
96
- b("input", {
100
+ h("input", {
97
101
  ref_key: "inputField",
98
- ref: k,
102
+ ref: c,
99
103
  type: M.value,
100
104
  value: t(f),
101
105
  id: m,
@@ -121,7 +125,7 @@ const Y = {
121
125
  class: u(["ml-2", e.textColor]),
122
126
  disabled: e.disabled || e.readonly
123
127
  }, " × ", 10, _)) : r("", !0),
124
- h(e.$slots, "default"),
128
+ k(e.$slots, "default"),
125
129
  e.type === "password" && e.showPasswordToggle ? (o(), s("div", ee, [
126
130
  L(X, {
127
131
  icon: z.value,
@@ -132,7 +136,7 @@ const Y = {
132
136
  key: 4,
133
137
  class: u([e.appendInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
134
138
  }, [
135
- h(e.$slots, "append-inner")
139
+ k(e.$slots, "append-inner")
136
140
  ], 2)) : r("", !0),
137
141
  e.suffix ? (o(), s("div", te, i(e.suffix), 1)) : r("", !0)
138
142
  ], 2),
@@ -141,7 +145,7 @@ const Y = {
141
145
  key: 0,
142
146
  id: `error-${m}`,
143
147
  class: "text-red-500 text-sm text-center"
144
- }, i(t(B) || e.errorMessage), 9, ne)) : e.hint && (e.persistentHint || t(c)) ? (o(), s("div", se, i(e.hint), 1)) : r("", !0),
148
+ }, i(t(B) || e.errorMessage), 9, ne)) : e.hint && (e.persistentHint || t(b)) ? (o(), s("div", se, i(e.hint), 1)) : r("", !0),
145
149
  e.counter && e.maxlength ? (o(), s("div", oe, i(((F = t(f)) == null ? void 0 : F.length) || 0) + " / " + i(e.maxlength), 1)) : r("", !0)
146
150
  ]))
147
151
  ], 16)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.265",
3
+ "version": "0.1.267",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",