adverich-kun-ui 0.1.66 → 0.1.67
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/KunAutocomplete/src/composables/KunAutocompleteProps.js +1 -1
- package/dist/components/KunTextField/src/components/KunTextField.vue.js +4 -4
- package/dist/components/KunTextField/src/composables/KunTextFieldProps.js +1 -1
- package/dist/components/KunTextField/src/composables/useKunTextFieldComposable.js +7 -7
- package/package.json +1 -1
|
@@ -9,13 +9,13 @@ const H = { class: "w-full flex flex-col relative" }, q = {
|
|
|
9
9
|
class: "ml-2"
|
|
10
10
|
}, O = {
|
|
11
11
|
key: 0,
|
|
12
|
-
class: "min-h-[1.25rem]
|
|
12
|
+
class: "min-h-[1.25rem]"
|
|
13
13
|
}, Q = ["id"], R = {
|
|
14
14
|
key: 1,
|
|
15
|
-
class: "text-xs
|
|
15
|
+
class: "text-xs text-center"
|
|
16
16
|
}, W = {
|
|
17
17
|
key: 2,
|
|
18
|
-
class: "text-xs
|
|
18
|
+
class: "text-xs text-right"
|
|
19
19
|
}, _ = {
|
|
20
20
|
__name: "KunTextField",
|
|
21
21
|
props: { ...T },
|
|
@@ -118,7 +118,7 @@ const H = { class: "w-full flex flex-col relative" }, q = {
|
|
|
118
118
|
t(u) ? (r(), s("div", {
|
|
119
119
|
key: 0,
|
|
120
120
|
id: `error-${p}`,
|
|
121
|
-
class: "text-red-500 text-sm
|
|
121
|
+
class: "text-red-500 text-sm text-center"
|
|
122
122
|
}, i(t(B) || e.errorMessage), 9, Q)) : e.hint && (e.persistentHint || t(y)) ? (r(), s("div", R, i(e.hint), 1)) : o("", !0),
|
|
123
123
|
e.counter && e.maxlength ? (r(), s("div", W, i(((C = t(d)) == null ? void 0 : C.length) || 0) + " / " + i(e.maxlength), 1)) : o("", !0)
|
|
124
124
|
]))
|
|
@@ -8,7 +8,7 @@ const e = {
|
|
|
8
8
|
suffix: { type: String, default: "" },
|
|
9
9
|
rounded: { type: String, default: "rounded" },
|
|
10
10
|
error: { type: Boolean, default: !1 },
|
|
11
|
-
errorMessage: { type: String, default: "
|
|
11
|
+
errorMessage: { type: String, default: "" },
|
|
12
12
|
rules: { type: Array, default: () => [] },
|
|
13
13
|
disabled: { type: Boolean, default: !1 },
|
|
14
14
|
readonly: { type: Boolean, default: !1 },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as n, inject as V, computed as x, watch as
|
|
1
|
+
import { ref as n, inject as V, computed as x, watch as g, onUnmounted as E } from "vue";
|
|
2
2
|
import { debounce as T } from "../../../../utils/utils.js";
|
|
3
|
-
function
|
|
4
|
-
const t = n(u.modelValue), o = n(!1), l = n(""), a = n(!1),
|
|
3
|
+
function M(u, r) {
|
|
4
|
+
const t = n(u.modelValue), o = n(!1), l = n(""), a = n(!1), F = n(null), s = n(!1), d = V("registerField", null), v = V("unregisterField", null), h = x(() => u.error || !!l.value && a.value || u.errorMessage), c = async () => {
|
|
5
5
|
for (const e of u.rules) {
|
|
6
6
|
const m = await Promise.resolve(e(t.value));
|
|
7
7
|
if (m !== !0) return m;
|
|
@@ -11,9 +11,9 @@ function P(u, r) {
|
|
|
11
11
|
const e = await c();
|
|
12
12
|
l.value = e === !0 ? "" : e;
|
|
13
13
|
}, u.debounce ?? 300);
|
|
14
|
-
|
|
14
|
+
g(() => u.modelValue, (e) => {
|
|
15
15
|
e !== t.value && (s.value = !0, t.value = e);
|
|
16
|
-
}),
|
|
16
|
+
}), g(t, () => {
|
|
17
17
|
if (s.value) {
|
|
18
18
|
s.value = !1;
|
|
19
19
|
return;
|
|
@@ -43,7 +43,7 @@ function P(u, r) {
|
|
|
43
43
|
return d && d({ validate: i }), E(() => {
|
|
44
44
|
v && v({ validate: i });
|
|
45
45
|
}), {
|
|
46
|
-
inputField:
|
|
46
|
+
inputField: F,
|
|
47
47
|
inputValue: t,
|
|
48
48
|
inputFocused: o,
|
|
49
49
|
validationError: l,
|
|
@@ -58,5 +58,5 @@ function P(u, r) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
export {
|
|
61
|
-
|
|
61
|
+
M as default
|
|
62
62
|
};
|