adverich-kun-ui 0.1.113 → 0.1.115
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/KunTextField/src/components/KunTextField.vue.js +77 -62
- package/dist/components/KunTextField/src/composables/KunTextFieldProps.js +2 -1
- package/dist/icons/IconEyeOffOutline.vue.js +20 -0
- package/dist/icons/IconEyeOutline.vue.js +20 -0
- package/dist/icons/index.js +16 -12
- package/package.json +1 -1
|
@@ -1,24 +1,29 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { getCurrentInstance as M, computed as d, useSlots as U, ref as H, createElementBlock as s, openBlock as o, createCommentVNode as r, createElementVNode as b, normalizeClass as a, toDisplayString as i, mergeProps as q, unref as t, renderSlot as c, withModifiers as G, createVNode as J } from "vue";
|
|
2
|
+
import { icons as F } from "../../../../icons/index.js";
|
|
3
|
+
import L from "../composables/KunTextFieldProps.js";
|
|
4
|
+
import Q from "../composables/useKunTextFieldComposable.js";
|
|
5
|
+
import R from "../../../KunIcon/src/components/KunIcon.vue.js";
|
|
6
|
+
const W = { class: "w-full flex flex-col relative" }, X = {
|
|
5
7
|
key: 0,
|
|
6
8
|
class: "mr-2"
|
|
7
|
-
},
|
|
8
|
-
key:
|
|
9
|
+
}, Y = ["type", "value", "placeholder", "disabled", "readonly", "maxlength", "aria-invalid", "aria-describedby"], Z = ["disabled"], _ = {
|
|
10
|
+
key: 3,
|
|
11
|
+
class: "flex items-center justify-center min-w-[32px] h-full px-1"
|
|
12
|
+
}, ee = {
|
|
13
|
+
key: 5,
|
|
9
14
|
class: "ml-2"
|
|
10
|
-
},
|
|
15
|
+
}, te = {
|
|
11
16
|
key: 0,
|
|
12
17
|
class: "h-[1.25rem]"
|
|
13
|
-
},
|
|
18
|
+
}, le = ["id"], ne = {
|
|
14
19
|
key: 1,
|
|
15
20
|
class: "text-xs text-center"
|
|
16
|
-
},
|
|
21
|
+
}, se = {
|
|
17
22
|
key: 2,
|
|
18
23
|
class: "text-xs text-right"
|
|
19
|
-
},
|
|
24
|
+
}, ue = {
|
|
20
25
|
__name: "KunTextField",
|
|
21
|
-
props: { ...
|
|
26
|
+
props: { ...L },
|
|
22
27
|
emits: [
|
|
23
28
|
"update:modelValue",
|
|
24
29
|
"focusInput",
|
|
@@ -27,101 +32,111 @@ const H = { class: "w-full flex flex-col relative" }, q = {
|
|
|
27
32
|
"keyDown",
|
|
28
33
|
"keyUp"
|
|
29
34
|
],
|
|
30
|
-
setup(
|
|
31
|
-
const
|
|
35
|
+
setup(P, { expose: V, emit: j }) {
|
|
36
|
+
const u = P, p = j, {
|
|
32
37
|
inputField: k,
|
|
33
|
-
inputValue:
|
|
34
|
-
inputFocused:
|
|
38
|
+
inputValue: f,
|
|
39
|
+
inputFocused: h,
|
|
35
40
|
validationError: B,
|
|
36
|
-
hasError:
|
|
37
|
-
handleInput:
|
|
41
|
+
hasError: m,
|
|
42
|
+
handleInput: w,
|
|
38
43
|
handleBlur: g,
|
|
39
44
|
focusInput: C,
|
|
40
45
|
validate: D,
|
|
41
46
|
reset: E,
|
|
42
47
|
resetValidation: K,
|
|
43
|
-
clearInput:
|
|
44
|
-
} =
|
|
45
|
-
|
|
48
|
+
clearInput: I
|
|
49
|
+
} = Q(u, p);
|
|
50
|
+
V({
|
|
46
51
|
validate: D,
|
|
47
52
|
reset: E,
|
|
48
53
|
resetValidation: K,
|
|
49
54
|
inputField: k
|
|
50
55
|
});
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
const y = `input-${M().uid}`, S = d(() => h.value || !!f.value || u.dirty), x = U(), T = d(() => !!x["prepend-inner"]), N = d(() => !!x["append-inner"]), v = H(!1), O = d(() => v.value ? F.eyeOffOutline : F.eyeOutline);
|
|
57
|
+
function z() {
|
|
58
|
+
v.value = !v.value;
|
|
59
|
+
}
|
|
60
|
+
const A = d(() => u.type === "password" ? v.value ? "text" : "password" : u.type);
|
|
61
|
+
return (e, l) => {
|
|
62
|
+
var $;
|
|
63
|
+
return o(), s("div", W, [
|
|
64
|
+
e.label ? (o(), s("label", {
|
|
56
65
|
key: 0,
|
|
57
|
-
for:
|
|
66
|
+
for: y,
|
|
58
67
|
class: a([
|
|
59
68
|
e.labelColor,
|
|
60
69
|
"absolute left-2 transition-all duration-200 ease-in-out pointer-events-none select-none z-10",
|
|
61
|
-
|
|
70
|
+
S.value || e.placeholder ? "-top-2.25 text-xs opacity-80" : "top-3 text-sm opacity-80"
|
|
62
71
|
])
|
|
63
|
-
}, i(e.label), 3)) :
|
|
64
|
-
b("div",
|
|
72
|
+
}, i(e.label), 3)) : r("", !0),
|
|
73
|
+
b("div", q({ class: "w-full flex flex-col justify-center relative" }, e.$attrs), [
|
|
65
74
|
b("div", {
|
|
66
75
|
class: a(["flex flex-row items-center w-full h-full border", [
|
|
67
76
|
e.bgInput,
|
|
68
77
|
e.rounded,
|
|
69
|
-
|
|
78
|
+
t(h) ? "border-blue-600 shadow-[0_0_0_1px_rgba(59,130,246,0.5)]" : e.borderColor,
|
|
70
79
|
e.disabled ? "opacity-60 cursor-not-allowed" : "cursor-text",
|
|
71
|
-
|
|
80
|
+
t(m) ? "bg-red-200 dark:bg-red-900" : ""
|
|
72
81
|
]])
|
|
73
82
|
}, [
|
|
74
|
-
e.prefix ? (
|
|
75
|
-
|
|
83
|
+
e.prefix ? (o(), s("div", X, i(e.prefix), 1)) : r("", !0),
|
|
84
|
+
T.value ? (o(), s("div", {
|
|
76
85
|
key: 1,
|
|
77
86
|
class: a([e.prependInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
|
|
78
87
|
}, [
|
|
79
|
-
|
|
80
|
-
], 2)) :
|
|
88
|
+
c(e.$slots, "prepend-inner")
|
|
89
|
+
], 2)) : r("", !0),
|
|
81
90
|
b("input", {
|
|
82
91
|
ref_key: "inputField",
|
|
83
92
|
ref: k,
|
|
84
|
-
type:
|
|
85
|
-
value:
|
|
86
|
-
id:
|
|
93
|
+
type: A.value,
|
|
94
|
+
value: t(f),
|
|
95
|
+
id: y,
|
|
87
96
|
placeholder: e.placeholder,
|
|
88
97
|
disabled: e.disabled,
|
|
89
98
|
readonly: e.readonly,
|
|
90
99
|
maxlength: e.maxlength,
|
|
91
100
|
autocomplete: "off",
|
|
92
101
|
class: a(["w-full h-full bg-transparent rounded focus:outline-none p-3", [e.textColor, e.placeholderColor, e.textCenter ? "text-center" : ""]]),
|
|
93
|
-
"aria-invalid":
|
|
94
|
-
"aria-describedby":
|
|
95
|
-
onInput:
|
|
96
|
-
onBlur:
|
|
97
|
-
onFocus:
|
|
98
|
-
onClick:
|
|
99
|
-
onKeydown:
|
|
100
|
-
onKeyup:
|
|
101
|
-
}, null, 42,
|
|
102
|
-
e.clearable &&
|
|
102
|
+
"aria-invalid": t(m) ? "true" : "false",
|
|
103
|
+
"aria-describedby": t(m) ? `error-${y}` : null,
|
|
104
|
+
onInput: l[0] || (l[0] = (...n) => t(w) && t(w)(...n)),
|
|
105
|
+
onBlur: l[1] || (l[1] = (...n) => t(g) && t(g)(...n)),
|
|
106
|
+
onFocus: l[2] || (l[2] = (...n) => t(C) && t(C)(...n)),
|
|
107
|
+
onClick: l[3] || (l[3] = G((n) => p("handleClick"), ["stop"])),
|
|
108
|
+
onKeydown: l[4] || (l[4] = (n) => p("keyDown", n)),
|
|
109
|
+
onKeyup: l[5] || (l[5] = (n) => p("keyUp", n))
|
|
110
|
+
}, null, 42, Y),
|
|
111
|
+
e.clearable && t(f) ? (o(), s("button", {
|
|
103
112
|
key: 2,
|
|
104
113
|
type: "button",
|
|
105
|
-
onClick:
|
|
114
|
+
onClick: l[6] || (l[6] = (...n) => t(I) && t(I)(...n)),
|
|
106
115
|
class: a(["ml-2", e.textColor]),
|
|
107
116
|
disabled: e.disabled || e.readonly
|
|
108
|
-
}, " × ", 10,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
117
|
+
}, " × ", 10, Z)) : r("", !0),
|
|
118
|
+
c(e.$slots, "default"),
|
|
119
|
+
e.type === "password" || e.showPasswordToggle ? (o(), s("div", _, [
|
|
120
|
+
J(R, {
|
|
121
|
+
icon: O.value,
|
|
122
|
+
onClick: z
|
|
123
|
+
}, null, 8, ["icon"])
|
|
124
|
+
])) : r("", !0),
|
|
125
|
+
N.value ? (o(), s("div", {
|
|
126
|
+
key: 4,
|
|
112
127
|
class: a([e.appendInnerClass, "flex items-center justify-center min-w-[32px] h-full px-1"])
|
|
113
128
|
}, [
|
|
114
|
-
|
|
115
|
-
], 2)) :
|
|
116
|
-
e.suffix ? (
|
|
129
|
+
c(e.$slots, "append-inner")
|
|
130
|
+
], 2)) : r("", !0),
|
|
131
|
+
e.suffix ? (o(), s("div", ee, i(e.suffix), 1)) : r("", !0)
|
|
117
132
|
], 2),
|
|
118
|
-
e.hideDetails ?
|
|
119
|
-
|
|
133
|
+
e.hideDetails ? r("", !0) : (o(), s("div", te, [
|
|
134
|
+
t(m) ? (o(), s("div", {
|
|
120
135
|
key: 0,
|
|
121
|
-
id: `error-${
|
|
136
|
+
id: `error-${y}`,
|
|
122
137
|
class: "text-red-500 text-sm text-center"
|
|
123
|
-
}, i(
|
|
124
|
-
e.counter && e.maxlength ? (
|
|
138
|
+
}, i(t(B) || e.errorMessage), 9, le)) : e.hint && (e.persistentHint || t(h)) ? (o(), s("div", ne, i(e.hint), 1)) : r("", !0),
|
|
139
|
+
e.counter && e.maxlength ? (o(), s("div", se, i((($ = t(f)) == null ? void 0 : $.length) || 0) + " / " + i(e.maxlength), 1)) : r("", !0)
|
|
125
140
|
]))
|
|
126
141
|
], 16)
|
|
127
142
|
]);
|
|
@@ -129,5 +144,5 @@ const H = { class: "w-full flex flex-col relative" }, q = {
|
|
|
129
144
|
}
|
|
130
145
|
};
|
|
131
146
|
export {
|
|
132
|
-
|
|
147
|
+
ue as default
|
|
133
148
|
};
|
|
@@ -27,7 +27,8 @@ const e = {
|
|
|
27
27
|
labelColor: { type: String, default: "text-black/80 dark:text-white/80" },
|
|
28
28
|
placeholderColor: { type: String, default: "placeholder-black/60 dark:placeholder-white/60" },
|
|
29
29
|
bgInput: { type: String, default: "bg-slate-200 dark:bg-slate-800" },
|
|
30
|
-
textCenter: { type: Boolean, default: !1 }
|
|
30
|
+
textCenter: { type: Boolean, default: !1 },
|
|
31
|
+
showPasswordToggle: { type: Boolean, default: !0 }
|
|
31
32
|
};
|
|
32
33
|
export {
|
|
33
34
|
e as default
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createElementBlock as t, openBlock as c, createElementVNode as o } from "vue";
|
|
2
|
+
import r from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const n = {}, l = {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "24",
|
|
6
|
+
height: "24",
|
|
7
|
+
viewBox: "0 0 24 24"
|
|
8
|
+
};
|
|
9
|
+
function s(f, e) {
|
|
10
|
+
return c(), t("svg", l, e[0] || (e[0] = [
|
|
11
|
+
o("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M2 5.27L3.28 4L20 20.72L18.73 22l-3.08-3.08c-1.15.38-2.37.58-3.65.58c-5 0-9.27-3.11-11-7.5c.69-1.76 1.79-3.31 3.19-4.54zM12 9a3 3 0 0 1 3 3a3 3 0 0 1-.17 1L11 9.17A3 3 0 0 1 12 9m0-4.5c5 0 9.27 3.11 11 7.5a11.8 11.8 0 0 1-4 5.19l-1.42-1.43A9.86 9.86 0 0 0 20.82 12A9.82 9.82 0 0 0 12 6.5c-1.09 0-2.16.18-3.16.5L7.3 5.47c1.44-.62 3.03-.97 4.7-.97M3.18 12A9.82 9.82 0 0 0 12 17.5c.69 0 1.37-.07 2-.21L11.72 15A3.064 3.064 0 0 1 9 12.28L5.6 8.87c-.99.85-1.82 1.91-2.42 3.13"
|
|
14
|
+
}, null, -1)
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
const a = /* @__PURE__ */ r(n, [["render", s]]);
|
|
18
|
+
export {
|
|
19
|
+
a as default
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createElementBlock as t, openBlock as o, createElementVNode as r } from "vue";
|
|
2
|
+
import n from "../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
const c = {}, l = {
|
|
4
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
5
|
+
width: "24",
|
|
6
|
+
height: "24",
|
|
7
|
+
viewBox: "0 0 24 24"
|
|
8
|
+
};
|
|
9
|
+
function a(s, e) {
|
|
10
|
+
return o(), t("svg", l, e[0] || (e[0] = [
|
|
11
|
+
r("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M12 9a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3m0-4.5c5 0 9.27 3.11 11 7.5c-1.73 4.39-6 7.5-11 7.5S2.73 16.39 1 12c1.73-4.39 6-7.5 11-7.5M3.18 12a9.821 9.821 0 0 0 17.64 0a9.821 9.821 0 0 0-17.64 0"
|
|
14
|
+
}, null, -1)
|
|
15
|
+
]));
|
|
16
|
+
}
|
|
17
|
+
const f = /* @__PURE__ */ n(c, [["render", a]]);
|
|
18
|
+
export {
|
|
19
|
+
f as default
|
|
20
|
+
};
|
package/dist/icons/index.js
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import o from "./IconAsterisk.vue.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import e from "./IconCheck.vue.js";
|
|
3
|
+
import r from "./IconClose.vue.js";
|
|
4
4
|
import t from "./IconDelete.vue.js";
|
|
5
5
|
import n from "./IconEdit.vue.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import i from "./IconMenuDownOutline.vue.js";
|
|
7
|
+
import m from "./IconMenuUpOutline.vue.js";
|
|
8
8
|
import c from "./IconSearch.vue.js";
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import f from "./IconStar.vue.js";
|
|
10
|
+
import p from "./IconEyeOutline.vue.js";
|
|
11
|
+
import l from "./IconEyeOffOutline.vue.js";
|
|
12
|
+
const w = {
|
|
11
13
|
asterisk: o,
|
|
12
|
-
check:
|
|
13
|
-
close:
|
|
14
|
+
check: e,
|
|
15
|
+
close: r,
|
|
14
16
|
delete: t,
|
|
15
17
|
edit: n,
|
|
16
|
-
menuDownOutline:
|
|
17
|
-
menuUpOutline:
|
|
18
|
+
menuDownOutline: i,
|
|
19
|
+
menuUpOutline: m,
|
|
18
20
|
search: c,
|
|
19
|
-
star:
|
|
21
|
+
star: f,
|
|
22
|
+
eyeOutline: p,
|
|
23
|
+
eyeOffOutline: l
|
|
20
24
|
};
|
|
21
25
|
export {
|
|
22
|
-
|
|
26
|
+
w as icons
|
|
23
27
|
};
|