adverich-kun-ui 0.1.120 → 0.1.122

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