adverich-kun-ui 0.1.225 → 0.1.227

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,17 +1,17 @@
1
- import { getCurrentInstance as K, useSlots as z, computed as E, createElementBlock as l, openBlock as o, createCommentVNode as n, createElementVNode as i, normalizeClass as p, unref as t, toDisplayString as u, mergeProps as P, createBlock as g, renderSlot as w, Fragment as C, 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 I from "../../../KunIcon/src/components/KunIcon.vue.js";
5
- const G = { class: "w-full flex flex-col relative" }, J = {
1
+ import { getCurrentInstance as x, useSlots as z, computed as E, createElementBlock as l, openBlock as s, createCommentVNode as n, createElementVNode as i, normalizeClass as p, unref as o, toDisplayString as u, mergeProps as P, createBlock as g, renderSlot as C, Fragment as I, 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 V from "../../../KunIcon/src/components/KunIcon.vue.js";
5
+ const q = { class: "w-full flex flex-col relative" }, G = {
6
6
  key: 0,
7
7
  class: "h-full"
8
- }, O = ["disabled"], Q = {
8
+ }, J = ["disabled"], O = {
9
9
  key: 1,
10
10
  class: "mr-2"
11
- }, R = {
11
+ }, Q = {
12
12
  key: 2,
13
13
  class: "flex items-center justify-center h-full pl-1"
14
- }, T = ["value", "placeholder", "readonly", "disabled", "maxlength", "aria-invalid"], U = ["disabled"], W = {
14
+ }, R = ["value", "placeholder", "readonly", "disabled", "maxlength", "aria-invalid"], T = ["disabled"], W = {
15
15
  key: 0,
16
16
  class: "flex items-center h-full"
17
17
  }, X = ["disabled"], Y = ["disabled"], Z = {
@@ -37,30 +37,37 @@ const G = { class: "w-full flex flex-col relative" }, J = {
37
37
  class: "text-xs text-center"
38
38
  }, ce = {
39
39
  __name: "KunNumberField",
40
- props: L,
41
- emits: ["update:modelValue"],
42
- setup(V, { emit: j }) {
43
- const b = V, A = j, y = `number-input-${K().uid}`, c = z(), F = !!c["prepend-icon"], B = !!c["append-icon"], {
40
+ props: H,
41
+ emits: [
42
+ "update:modelValue",
43
+ "focusInput",
44
+ "blurInput",
45
+ "handleClick",
46
+ "keyDown",
47
+ "keyUp"
48
+ ],
49
+ setup(j, { emit: A }) {
50
+ const b = j, y = A, c = `number-input-${x().uid}`, k = z(), D = !!k["prepend-icon"], F = !!k["append-icon"], {
44
51
  inputValue: f,
45
- numberInput: M,
46
- inputKey: N,
47
- updateValue: S,
52
+ numberInput: K,
53
+ inputKey: B,
54
+ updateValue: M,
48
55
  onIncrement: d,
49
56
  onDecrement: a,
50
- onClear: k,
51
- focus: m,
52
- handleFocus: h,
53
- isActive: $,
54
- handleBlur: v
55
- } = q(b, A), x = E(() => b.density === "compact" ? "p-1" : b.density === "comfortable" ? "p-2" : "p-3");
56
- return (e, s) => (o(), l("div", G, [
57
- e.label ? (o(), l("label", {
57
+ onClear: m,
58
+ focus: h,
59
+ handleFocus: v,
60
+ isActive: N,
61
+ handleBlur: w
62
+ } = L(b, y), S = E(() => b.density === "compact" ? "p-1" : b.density === "comfortable" ? "p-2" : "p-3");
63
+ return (e, r) => (s(), l("div", q, [
64
+ e.label ? (s(), l("label", {
58
65
  key: 0,
59
- for: y,
66
+ for: c,
60
67
  class: p([
61
68
  e.labelColor,
62
69
  "absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10",
63
- t($) || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
70
+ o(N) || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
64
71
  ])
65
72
  }, u(e.label), 3)) : n("", !0),
66
73
  i("div", P({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
@@ -68,70 +75,72 @@ const G = { class: "w-full flex flex-col relative" }, J = {
68
75
  class: p(["flex items-center w-full h-full border", [
69
76
  e.bgInput,
70
77
  e.rounded,
71
- t(m) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
78
+ o(h) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
72
79
  e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-text",
73
80
  e.error ? "bg-red-200 dark:bg-red-900" : ""
74
81
  ]])
75
82
  }, [
76
- !e.noArrows && e.controlVariant === "split" ? (o(), l("div", J, [
83
+ !e.noArrows && e.controlVariant === "split" ? (s(), l("div", G, [
77
84
  i("button", {
78
85
  type: "button",
79
86
  class: "p-3 text-lg border-r border-slate-600 text-black dark:text-white disabled:opacity-50 cursor-pointer hover:opacity-80",
80
- onClick: s[0] || (s[0] = (...r) => t(a) && t(a)(...r)),
87
+ onClick: r[0] || (r[0] = (...t) => o(a) && o(a)(...t)),
81
88
  disabled: e.disabled || e.readonly
82
- }, "−", 8, O)
89
+ }, "−", 8, J)
83
90
  ])) : n("", !0),
84
- e.prefix ? (o(), l("div", Q, u(e.prefix), 1)) : n("", !0),
85
- e.prependIcon || F ? (o(), l("div", R, [
86
- e.prependIcon ? (o(), g(I, {
91
+ e.prefix ? (s(), l("div", O, u(e.prefix), 1)) : n("", !0),
92
+ e.prependIcon || D ? (s(), l("div", Q, [
93
+ e.prependIcon ? (s(), g(V, {
87
94
  key: 0,
88
95
  icon: e.prependIcon
89
- }, null, 8, ["icon"])) : w(e.$slots, "prepend-icon", { key: 1 })
96
+ }, null, 8, ["icon"])) : C(e.$slots, "prepend-icon", { key: 1 })
90
97
  ])) : n("", !0),
91
- (o(), l("input", {
92
- id: y,
98
+ (s(), l("input", {
99
+ id: c,
93
100
  ref_key: "numberInput",
94
- ref: M,
95
- key: t(N),
101
+ ref: K,
102
+ key: o(B),
96
103
  type: "text",
97
- value: t(f),
104
+ value: o(f),
98
105
  placeholder: e.placeholder,
99
106
  readonly: e.readonly,
100
107
  disabled: e.disabled,
101
108
  maxlength: e.maxlength,
102
109
  autocomplete: "off",
103
- class: p(["w-full h-full bg-transparent rounded focus:outline-none", [x.value, e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
110
+ class: p(["w-full h-full bg-transparent rounded focus:outline-none", [S.value, e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
104
111
  "aria-invalid": e.error ? "true" : "false",
105
- onInput: s[1] || (s[1] = (r) => t(S)(r.target.value)),
106
- onFocus: s[2] || (s[2] = (...r) => t(h) && t(h)(...r)),
107
- onBlur: s[3] || (s[3] = (...r) => t(v) && t(v)(...r))
108
- }, null, 42, T)),
109
- e.clearable && t(f) != null ? (o(), l("button", {
112
+ onInput: r[1] || (r[1] = (t) => o(M)(t.target.value)),
113
+ onBlur: r[2] || (r[2] = (...t) => o(w) && o(w)(...t)),
114
+ onFocus: r[3] || (r[3] = (...t) => o(v) && o(v)(...t)),
115
+ onKeydown: r[4] || (r[4] = (t) => y("keyDown", t)),
116
+ onKeyup: r[5] || (r[5] = (t) => y("keyUp", t))
117
+ }, null, 42, R)),
118
+ e.clearable && o(f) != null ? (s(), l("button", {
110
119
  key: 3,
111
120
  type: "button",
112
- onClick: s[4] || (s[4] = (...r) => t(k) && t(k)(...r)),
121
+ onClick: r[6] || (r[6] = (...t) => o(m) && o(m)(...t)),
113
122
  class: p(["ml-2", e.textColor]),
114
123
  disabled: e.disabled || e.readonly
115
- }, " × ", 10, U)) : n("", !0),
116
- e.noArrows ? n("", !0) : (o(), l(C, { key: 4 }, [
117
- e.controlVariant === "default" ? (o(), l("div", W, [
124
+ }, " × ", 10, T)) : n("", !0),
125
+ e.noArrows ? n("", !0) : (s(), l(I, { key: 4 }, [
126
+ e.controlVariant === "default" ? (s(), l("div", W, [
118
127
  i("button", {
119
128
  type: "button",
120
129
  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",
121
- onClick: s[5] || (s[5] = (...r) => t(d) && t(d)(...r)),
130
+ onClick: r[7] || (r[7] = (...t) => o(d) && o(d)(...t)),
122
131
  disabled: e.disabled || e.readonly
123
132
  }, " ▲ ", 8, X),
124
133
  i("button", {
125
134
  type: "button",
126
135
  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",
127
- onClick: s[6] || (s[6] = (...r) => t(a) && t(a)(...r)),
136
+ onClick: r[8] || (r[8] = (...t) => o(a) && o(a)(...t)),
128
137
  disabled: e.disabled || e.readonly
129
138
  }, " ▼ ", 8, Y)
130
139
  ])) : n("", !0),
131
- e.controlVariant === "stacked" ? (o(), l("div", Z, [
140
+ e.controlVariant === "stacked" ? (s(), l("div", Z, [
132
141
  i("div", {
133
142
  class: "border-b border-slate-600 pb-1 px-3 flex hover:opacity-80 cursor-pointer",
134
- onClick: s[7] || (s[7] = (...r) => t(d) && t(d)(...r))
143
+ onClick: r[9] || (r[9] = (...t) => o(d) && o(d)(...t))
135
144
  }, [
136
145
  i("button", {
137
146
  type: "button",
@@ -141,7 +150,7 @@ const G = { class: "w-full flex flex-col relative" }, J = {
141
150
  ]),
142
151
  i("div", {
143
152
  class: "border-t border-slate-600 pt-1 px-3 flex hover:opacity-80 cursor-pointer",
144
- onClick: s[8] || (s[8] = (...r) => t(a) && t(a)(...r))
153
+ onClick: r[10] || (r[10] = (...t) => o(a) && o(a)(...t))
145
154
  }, [
146
155
  i("button", {
147
156
  type: "button",
@@ -151,28 +160,28 @@ const G = { class: "w-full flex flex-col relative" }, J = {
151
160
  ])
152
161
  ])) : n("", !0)
153
162
  ], 64)),
154
- e.appendIcon || B ? (o(), l("div", te, [
155
- e.appendIcon ? (o(), g(I, {
163
+ e.appendIcon || F ? (s(), l("div", te, [
164
+ e.appendIcon ? (s(), g(V, {
156
165
  key: 0,
157
166
  icon: e.appendIcon
158
- }, null, 8, ["icon"])) : w(e.$slots, "append-icon", { key: 1 })
167
+ }, null, 8, ["icon"])) : C(e.$slots, "append-icon", { key: 1 })
159
168
  ])) : n("", !0),
160
- !e.noArrows && e.controlVariant === "split" ? (o(), l("div", oe, [
169
+ !e.noArrows && e.controlVariant === "split" ? (s(), l("div", oe, [
161
170
  i("button", {
162
171
  type: "button",
163
172
  class: "p-3 text-lg border-l border-slate-600 text-black dark:text-white disabled:opacity-50 cursor-pointer hover:opacity-80",
164
- onClick: s[9] || (s[9] = (...r) => t(d) && t(d)(...r)),
173
+ onClick: r[11] || (r[11] = (...t) => o(d) && o(d)(...t)),
165
174
  disabled: e.disabled || e.readonly
166
175
  }, "+", 8, re)
167
176
  ])) : n("", !0),
168
- e.suffix ? (o(), l("div", se, u(e.suffix), 1)) : n("", !0)
177
+ e.suffix ? (s(), l("div", se, u(e.suffix), 1)) : n("", !0)
169
178
  ], 2),
170
- e.hideDetails ? n("", !0) : (o(), l("div", le, [
171
- e.error || e.errorMessages ? (o(), l("div", ne, [
172
- Array.isArray(e.errorMessages) ? (o(), l("div", ie, [
173
- (o(!0), l(C, null, H(e.errorMessages, (r, D) => (o(), l("div", { key: D }, u(r), 1))), 128))
174
- ])) : typeof e.errorMessages == "string" ? (o(), l("div", de, u(e.errorMessages), 1)) : n("", !0)
175
- ])) : e.hint && (e.persistentHint || t(m)) ? (o(), l("div", ae, u(e.hint), 1)) : n("", !0)
179
+ e.hideDetails ? n("", !0) : (s(), l("div", le, [
180
+ e.error || e.errorMessages ? (s(), l("div", ne, [
181
+ Array.isArray(e.errorMessages) ? (s(), l("div", ie, [
182
+ (s(!0), l(I, null, U(e.errorMessages, (t, $) => (s(), l("div", { key: $ }, u(t), 1))), 128))
183
+ ])) : typeof e.errorMessages == "string" ? (s(), l("div", de, u(e.errorMessages), 1)) : n("", !0)
184
+ ])) : e.hint && (e.persistentHint || o(h)) ? (s(), l("div", ae, u(e.hint), 1)) : n("", !0)
176
185
  ]))
177
186
  ], 16)
178
187
  ]));
@@ -25,10 +25,10 @@ function F(u, o) {
25
25
  function m() {
26
26
  i((e.value || 0) + u.step);
27
27
  }
28
- function s() {
28
+ function v() {
29
29
  i((e.value || 0) - u.step);
30
30
  }
31
- function v() {
31
+ function s() {
32
32
  e.value = null, o("update:modelValue", null);
33
33
  }
34
34
  const l = a(!1);
@@ -47,8 +47,8 @@ function F(u, o) {
47
47
  inputKey: f,
48
48
  updateValue: i,
49
49
  onIncrement: m,
50
- onDecrement: s,
51
- onClear: v,
50
+ onDecrement: v,
51
+ onClear: s,
52
52
  focus: l,
53
53
  handleFocus: V,
54
54
  isActive: I,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adverich-kun-ui",
3
- "version": "0.1.225",
3
+ "version": "0.1.227",
4
4
  "type": "module",
5
5
  "description": "Una librería de componentes Vue.js con Tailwind CSS",
6
6
  "main": "dist/index.js",