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