adverich-kun-ui 0.1.552 → 0.1.554
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/adverich-kun-ui.css +1 -1
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue.js +2 -2
- package/dist/components/KunDatePicker/src/components/KunDatePicker.vue2.js +399 -277
- package/dist/components/KunTextField/src/components/KunTextField.vue.js +32 -32
- package/dist/components/KunTextField/src/composables/KunTextFieldProps.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nextTick as H, getCurrentInstance as q, computed as d, useSlots as G, ref as J, createElementBlock as
|
|
1
|
+
import { nextTick as H, getCurrentInstance as q, computed as d, useSlots as G, ref as J, createElementBlock as n, openBlock as s, createCommentVNode as o, createElementVNode as k, normalizeClass as u, toDisplayString as i, 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";
|
|
@@ -6,10 +6,10 @@ import Z from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
|
6
6
|
const _ = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "mr-2"
|
|
9
|
-
}, ee = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "aria-invalid", "aria-describedby"], te = ["disabled"],
|
|
9
|
+
}, ee = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "aria-invalid", "aria-describedby"], te = ["disabled"], le = {
|
|
10
10
|
key: 3,
|
|
11
11
|
class: "flex items-center justify-center min-w-[32px] h-full px-1"
|
|
12
|
-
},
|
|
12
|
+
}, ne = {
|
|
13
13
|
key: 5,
|
|
14
14
|
class: "ml-2"
|
|
15
15
|
}, se = {
|
|
@@ -47,16 +47,16 @@ const _ = {
|
|
|
47
47
|
handleBlur: C,
|
|
48
48
|
focusInput: I,
|
|
49
49
|
validate: K,
|
|
50
|
-
reset:
|
|
51
|
-
resetValidation:
|
|
50
|
+
reset: S,
|
|
51
|
+
resetValidation: T,
|
|
52
52
|
clearInput: $
|
|
53
|
-
} = Y(a, p),
|
|
53
|
+
} = Y(a, p), B = (e) => {
|
|
54
54
|
p("keyDown", e), e.key === "Enter" && (e.preventDefault(), p("enter", e));
|
|
55
55
|
};
|
|
56
56
|
V({
|
|
57
57
|
validate: K,
|
|
58
|
-
reset:
|
|
59
|
-
resetValidation:
|
|
58
|
+
reset: S,
|
|
59
|
+
resetValidation: T,
|
|
60
60
|
inputField: f,
|
|
61
61
|
rootRef: w,
|
|
62
62
|
focus: () => {
|
|
@@ -65,25 +65,25 @@ const _ = {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
-
const c = `input-${q().uid}`,
|
|
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);
|
|
69
69
|
function M() {
|
|
70
70
|
v.value = !v.value;
|
|
71
71
|
}
|
|
72
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");
|
|
73
|
-
return (e,
|
|
73
|
+
return (e, l) => {
|
|
74
74
|
var D;
|
|
75
|
-
return s(),
|
|
75
|
+
return s(), n("div", {
|
|
76
76
|
class: "w-full flex flex-col relative",
|
|
77
77
|
ref_key: "rootRef",
|
|
78
78
|
ref: w
|
|
79
79
|
}, [
|
|
80
|
-
e.label ? (s(),
|
|
80
|
+
e.label ? (s(), n("label", {
|
|
81
81
|
key: 0,
|
|
82
82
|
for: c,
|
|
83
83
|
class: u([
|
|
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
88
|
}, i(e.label), 3)) : o("", !0),
|
|
89
89
|
k("div", L({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
|
|
@@ -92,12 +92,12 @@ const _ = {
|
|
|
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,
|
|
95
|
-
e.disabled ? "opacity-60 cursor-not-allowed" :
|
|
95
|
+
e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-text",
|
|
96
96
|
t(m) ? "bg-red-200 dark:bg-red-900" : ""
|
|
97
97
|
]])
|
|
98
98
|
}, [
|
|
99
|
-
e.prefix ? (s(),
|
|
100
|
-
A.value ? (s(),
|
|
99
|
+
e.prefix ? (s(), n("div", _, i(e.prefix), 1)) : o("", !0),
|
|
100
|
+
A.value ? (s(), n("div", {
|
|
101
101
|
key: 1,
|
|
102
102
|
class: u([e.prependInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
|
|
103
103
|
}, [
|
|
@@ -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" : ""]]),
|
|
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]]),
|
|
119
119
|
"aria-invalid": t(m) ? "true" : "false",
|
|
120
120
|
"aria-describedby": t(m) ? `error-${c}` : null,
|
|
121
|
-
onInput:
|
|
122
|
-
onBlur:
|
|
123
|
-
onFocus:
|
|
124
|
-
onClick:
|
|
125
|
-
onKeydown:
|
|
126
|
-
onKeyup:
|
|
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"])),
|
|
125
|
+
onKeydown: B,
|
|
126
|
+
onKeyup: l[4] || (l[4] = (r) => p("keyUp", r))
|
|
127
127
|
}, null, 42, ee),
|
|
128
|
-
e.clearable && t(y) ? (s(),
|
|
128
|
+
e.clearable && t(y) ? (s(), n("button", {
|
|
129
129
|
key: 2,
|
|
130
130
|
type: "button",
|
|
131
|
-
onClick:
|
|
131
|
+
onClick: l[5] || (l[5] = (...r) => t($) && t($)(...r)),
|
|
132
132
|
class: u(["ml-2", e.textColor]),
|
|
133
133
|
disabled: e.disabled || e.readonly
|
|
134
134
|
}, " × ", 10, te)) : o("", !0),
|
|
135
135
|
h(e.$slots, "default"),
|
|
136
|
-
e.type === "password" && e.showPasswordToggle ? (s(),
|
|
136
|
+
e.type === "password" && e.showPasswordToggle ? (s(), n("div", le, [
|
|
137
137
|
W(Z, {
|
|
138
138
|
icon: z.value,
|
|
139
139
|
onClick: M
|
|
140
140
|
}, null, 8, ["icon"])
|
|
141
141
|
])) : o("", !0),
|
|
142
|
-
N.value ? (s(),
|
|
142
|
+
N.value ? (s(), n("div", {
|
|
143
143
|
key: 4,
|
|
144
144
|
class: u([e.appendInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
|
|
145
145
|
}, [
|
|
146
146
|
h(e.$slots, "append-inner")
|
|
147
147
|
], 2)) : o("", !0),
|
|
148
|
-
e.suffix ? (s(),
|
|
148
|
+
e.suffix ? (s(), n("div", ne, i(e.suffix), 1)) : o("", !0)
|
|
149
149
|
], 2),
|
|
150
|
-
e.hideDetails ? o("", !0) : (s(),
|
|
151
|
-
t(m) ? (s(),
|
|
150
|
+
e.hideDetails ? o("", !0) : (s(), n("div", se, [
|
|
151
|
+
t(m) ? (s(), n("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)) ? (s(),
|
|
156
|
-
e.counter && e.maxlength ? (s(),
|
|
155
|
+
}, i(t(E) || e.errorMessage), 9, re)) : e.hint && (e.persistentHint || t(b)) ? (s(), n("div", oe, i(e.hint), 1)) : o("", !0),
|
|
156
|
+
e.counter && e.maxlength ? (s(), n("div", ie, i(((D = t(y)) == null ? void 0 : D.length) || 0) + " / " + i(e.maxlength), 1)) : o("", !0)
|
|
157
157
|
]))
|
|
158
158
|
], 16)
|
|
159
159
|
], 512);
|
|
@@ -18,6 +18,7 @@ const e = {
|
|
|
18
18
|
labelColor: { type: String, default: "text-black/80 dark:text-white/80" },
|
|
19
19
|
placeholderColor: { type: String, default: "placeholder-black/60 dark:placeholder-white/60" },
|
|
20
20
|
bgInput: { type: String, default: "bg-field-background" },
|
|
21
|
+
inputStyle: { type: String, default: "" },
|
|
21
22
|
textCenter: { type: Boolean, default: !1 },
|
|
22
23
|
density: { type: String, default: "default" },
|
|
23
24
|
// Estado
|