@kernel4632/kima 0.8.5 → 0.8.7
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/advanced-input/editable.ce.vue_vue_type_style_index_0_scoped_82c96de0_lang.css +1 -0
- package/dist/components/core/{text-field.ce.vue_vue_type_style_index_0_scoped_7334ab60_lang.css → text-field.ce.vue_vue_type_style_index_0_scoped_f22e5c02_lang.css} +1 -1
- package/dist/components/data/table.ce.vue_vue_type_style_index_0_scoped_c1ac8a33_lang.css +1 -0
- package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_df3ec98f_lang.css +1 -0
- package/dist/components/display/skeleton.ce.vue_vue_type_style_index_0_scoped_92807af5_lang.css +1 -0
- package/dist/components/display/timeline.ce.vue_vue_type_style_index_0_scoped_72323605_lang.css +1 -0
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_6a5bc26a_lang.css +1 -0
- package/dist/components/form-completion/upload-manager.ce.vue_vue_type_style_index_0_scoped_fe810c3a_lang.css +1 -0
- package/dist/components/input/field.ce.vue_vue_type_style_index_0_scoped_a01eded5_lang.css +1 -0
- package/dist/components/input/{file-upload.ce.vue_vue_type_style_index_0_scoped_1568bdab_lang.css → file-upload.ce.vue_vue_type_style_index_0_scoped_8fd77a68_lang.css} +1 -1
- package/dist/components/input/tags-input.ce.vue_vue_type_style_index_0_scoped_b46618b2_lang.css +1 -0
- package/dist/components/input/textarea.ce.vue_vue_type_style_index_0_scoped_60d0751b_lang.css +1 -0
- package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_cf70a212_lang.css +1 -0
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_03e729d7_lang.css +1 -0
- package/dist/components/utility/progress-group.ce.vue_vue_type_style_index_0_scoped_d4453504_lang.css +1 -0
- package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_892954ad_lang.css +1 -0
- package/dist/kima-elements-core.js +9739 -9684
- package/dist/kima-elements.js +11180 -11079
- package/dist/style.css +16 -16
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/core.css +5 -5
- package/dist/styles/dynamic-input.css +1 -1
- package/dist/styles/editable.css +1 -1
- package/dist/styles/field.css +1 -1
- package/dist/styles/file-upload.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/multi-select.css +1 -1
- package/dist/styles/progress-group.css +1 -1
- package/dist/styles/skeleton.css +1 -1
- package/dist/styles/table.css +1 -1
- package/dist/styles/tag-group.css +1 -1
- package/dist/styles/tags-input.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/textarea.css +1 -1
- package/dist/styles/timeline.css +1 -1
- package/dist/styles/upload-manager.css +2 -2
- package/dist/vue/components/advanced-input/editable.ce.js +70 -69
- package/dist/vue/components/core/text-field.ce.js +66 -65
- package/dist/vue/components/data/table.ce.js +230 -232
- package/dist/vue/components/display/list.ce.js +28 -22
- package/dist/vue/components/display/skeleton.ce.js +27 -20
- package/dist/vue/components/display/timeline.ce.js +33 -25
- package/dist/vue/components/form-completion/dynamic-input.ce.js +75 -68
- package/dist/vue/components/form-completion/upload-manager.ce.js +91 -82
- package/dist/vue/components/input/field.ce.js +25 -23
- package/dist/vue/components/input/file-upload.ce.js +70 -64
- package/dist/vue/components/input/tags-input.ce.js +62 -56
- package/dist/vue/components/input/textarea.ce.js +36 -35
- package/dist/vue/components/interaction/multi-select.ce.js +95 -90
- package/dist/vue/components/navigation/carousel.ce.js +1 -1
- package/dist/vue/components/utility/progress-group.ce.js +26 -22
- package/dist/vue/components/utility/tag-group.ce.js +51 -45
- package/dist/vue/utils/content-motion.js +63 -28
- package/dist/vue/utils/motion.js +32 -17
- package/package.json +1 -1
- package/dist/components/advanced-input/editable.ce.vue_vue_type_style_index_0_scoped_91cd5b33_lang.css +0 -1
- package/dist/components/data/table.ce.vue_vue_type_style_index_0_scoped_44836eb1_lang.css +0 -1
- package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_1c170b37_lang.css +0 -1
- package/dist/components/display/skeleton.ce.vue_vue_type_style_index_0_scoped_d9a7d212_lang.css +0 -1
- package/dist/components/display/timeline.ce.vue_vue_type_style_index_0_scoped_ff6a1726_lang.css +0 -1
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_5913d05a_lang.css +0 -1
- package/dist/components/form-completion/upload-manager.ce.vue_vue_type_style_index_0_scoped_5d214e0f_lang.css +0 -1
- package/dist/components/input/field.ce.vue_vue_type_style_index_0_scoped_f2ce3fc2_lang.css +0 -1
- package/dist/components/input/tags-input.ce.vue_vue_type_style_index_0_scoped_7a178bc6_lang.css +0 -1
- package/dist/components/input/textarea.ce.vue_vue_type_style_index_0_scoped_c0cc3612_lang.css +0 -1
- package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_b5be8e98_lang.css +0 -1
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_6a7ca57f_lang.css +0 -1
- package/dist/components/utility/progress-group.ce.vue_vue_type_style_index_0_scoped_681cf67d_lang.css +0 -1
- package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_3d44ac1c_lang.css +0 -1
package/dist/styles/timeline.css
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
@import "_tokens.css";
|
|
2
2
|
@import "../components/core/icon.ce.vue_vue_type_style_index_0_scoped_5c94f2ca_lang.css";
|
|
3
|
-
@import "../components/display/timeline.ce.
|
|
3
|
+
@import "../components/display/timeline.ce.vue_vue_type_style_index_0_scoped_72323605_lang.css";
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
@import "../components/core/icon.ce.vue_vue_type_style_index_0_scoped_5c94f2ca_lang.css";
|
|
4
4
|
@import "../components/core/icon-button.ce.vue_vue_type_style_index_0_scoped_a18b4478_lang.css";
|
|
5
5
|
@import "../components/core/tooltip.ce.vue_vue_type_style_index_0_scoped_2c931a6a_lang.css";
|
|
6
|
-
@import "../components/input/file-upload.ce.
|
|
7
|
-
@import "../components/form-completion/upload-manager.ce.
|
|
6
|
+
@import "../components/input/file-upload.ce.vue_vue_type_style_index_0_scoped_8fd77a68_lang.css";
|
|
7
|
+
@import "../components/form-completion/upload-manager.ce.vue_vue_type_style_index_0_scoped_fe810c3a_lang.css";
|
|
@@ -3,22 +3,23 @@ import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
|
3
3
|
import n from "../core/button.ce.js";
|
|
4
4
|
import { presenceTransition as r } from "../../utils/motion.js";
|
|
5
5
|
import { useInputState as i } from "../../utils/input-state.js";
|
|
6
|
+
import { useContentMotion as a } from "../../utils/content-motion.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { Transition as
|
|
8
|
+
import { Transition as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, mergeProps as p, nextTick as m, onBeforeUnmount as h, openBlock as g, ref as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, vShow as x, watch as S, withCtx as C, withDirectives as w } from "vue";
|
|
8
9
|
// src/components/advanced-input/editable.ce.vue
|
|
9
|
-
var
|
|
10
|
+
var T = ["aria-busy"], E = [
|
|
10
11
|
"disabled",
|
|
11
12
|
"aria-readonly",
|
|
12
13
|
"aria-label",
|
|
13
14
|
"inert"
|
|
14
|
-
],
|
|
15
|
+
], D = ["inert", "aria-hidden"], O = { class: "kima-editable__actions" }, k = {
|
|
15
16
|
key: 0,
|
|
16
17
|
role: "alert"
|
|
17
|
-
},
|
|
18
|
+
}, A = [
|
|
18
19
|
"name",
|
|
19
20
|
"value",
|
|
20
21
|
"disabled"
|
|
21
|
-
],
|
|
22
|
+
], j = /*#__PURE__*/ t({
|
|
22
23
|
__name: "editable.ce",
|
|
23
24
|
props: {
|
|
24
25
|
modelValue: {
|
|
@@ -45,83 +46,83 @@ var w = ["aria-busy"], T = [
|
|
|
45
46
|
"error",
|
|
46
47
|
"update:editing"
|
|
47
48
|
],
|
|
48
|
-
setup(t, { expose:
|
|
49
|
-
let
|
|
50
|
-
|
|
49
|
+
setup(t, { expose: j, emit: M }) {
|
|
50
|
+
let N = t, P = M, F = _(null), I = _(null), L = _(null), R = _(!1), z = _(N.modelValue), B = _(!1), V = _(""), H = 0, { local: U, update: W } = i(N, P, F, (e) => String(e || ""), (e) => {
|
|
51
|
+
H += 1, B.value = !1, R.value = !1, z.value = e, V.value = "";
|
|
51
52
|
});
|
|
52
|
-
e(
|
|
53
|
-
|
|
53
|
+
e(F), a(F, () => R.value), S(() => N.modelValue, (e) => {
|
|
54
|
+
R.value || (z.value = e || "");
|
|
54
55
|
});
|
|
55
|
-
async function W() {
|
|
56
|
-
M.disabled || M.readonly || z.value || (R.value = H.value, B.value = "", L.value = !0, N("update:editing", !0), await p(), L.value && (I.value?.focus(), I.value?.select?.()));
|
|
57
|
-
}
|
|
58
56
|
async function G() {
|
|
59
|
-
await
|
|
57
|
+
N.disabled || N.readonly || B.value || (z.value = U.value, V.value = "", R.value = !0, P("update:editing", !0), await m(), R.value && (L.value?.focus(), L.value?.select?.()));
|
|
60
58
|
}
|
|
61
59
|
async function K() {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
await m(), R.value || I.value?.focus();
|
|
61
|
+
}
|
|
62
|
+
async function q() {
|
|
63
|
+
if (B.value || N.disabled || N.readonly || !L.value?.reportValidity()) return;
|
|
64
|
+
let e = ++H, t = z.value;
|
|
65
|
+
B.value = !0, V.value = "";
|
|
65
66
|
try {
|
|
66
|
-
if (
|
|
67
|
-
|
|
67
|
+
if (N.saveHandler && await N.saveHandler(t), e !== H) return;
|
|
68
|
+
W(t), P("save", t), R.value = !1, P("update:editing", !1), K();
|
|
68
69
|
} catch (t) {
|
|
69
|
-
if (e !==
|
|
70
|
-
|
|
70
|
+
if (e !== H) return;
|
|
71
|
+
V.value = t?.message || String(t), P("error", t), await m(), L.value?.focus();
|
|
71
72
|
} finally {
|
|
72
|
-
e ===
|
|
73
|
+
e === H && (B.value = !1);
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
-
|
|
76
|
+
function J() {
|
|
77
|
+
B.value || (H += 1, z.value = U.value, V.value = "", R.value = !1, P("cancel"), P("update:editing", !1), K());
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
e.isComposing || e.keyCode === 229 || (e.key === "Escape" ? (e.preventDefault(),
|
|
79
|
+
function Y(e) {
|
|
80
|
+
e.isComposing || e.keyCode === 229 || (e.key === "Escape" ? (e.preventDefault(), J()) : e.key === "Enter" && (!N.multiline || e.ctrlKey || e.metaKey) && (e.preventDefault(), q()));
|
|
80
81
|
}
|
|
81
|
-
return
|
|
82
|
-
|
|
83
|
-
}),
|
|
84
|
-
edit:
|
|
85
|
-
save:
|
|
86
|
-
cancel:
|
|
87
|
-
focus: () =>
|
|
88
|
-
}), (e, i) => (
|
|
82
|
+
return h(() => {
|
|
83
|
+
H += 1;
|
|
84
|
+
}), j({
|
|
85
|
+
edit: G,
|
|
86
|
+
save: q,
|
|
87
|
+
cancel: J,
|
|
88
|
+
focus: () => I.value?.focus()
|
|
89
|
+
}), (e, i) => (g(), l("div", {
|
|
89
90
|
ref_key: "root",
|
|
90
|
-
ref:
|
|
91
|
+
ref: F,
|
|
91
92
|
class: "kima-editable",
|
|
92
|
-
"aria-busy":
|
|
93
|
+
"aria-busy": B.value || void 0
|
|
93
94
|
}, [
|
|
94
|
-
|
|
95
|
-
default:
|
|
95
|
+
f(o, p({ name: "kima-fade" }, b(r)), {
|
|
96
|
+
default: C(() => [w(u("button", {
|
|
96
97
|
ref_key: "display",
|
|
97
|
-
ref:
|
|
98
|
+
ref: I,
|
|
98
99
|
class: "kima-editable__display",
|
|
99
100
|
type: "button",
|
|
100
101
|
disabled: t.disabled,
|
|
101
102
|
"aria-readonly": t.readonly || void 0,
|
|
102
|
-
"aria-label": `${t.label}: ${
|
|
103
|
-
inert:
|
|
104
|
-
onClick:
|
|
105
|
-
},
|
|
103
|
+
"aria-label": `${t.label}: ${b(U) || t.placeholder || ""}`,
|
|
104
|
+
inert: R.value,
|
|
105
|
+
onClick: G
|
|
106
|
+
}, y(b(U) || t.placeholder || "编辑"), 9, E), [[x, !R.value]])]),
|
|
106
107
|
_: 1
|
|
107
108
|
}, 16),
|
|
108
|
-
|
|
109
|
-
default:
|
|
109
|
+
f(o, p({ name: "kima-content" }, b(r)), {
|
|
110
|
+
default: C(() => [w(u("div", {
|
|
110
111
|
class: "kima-editable__editor",
|
|
111
|
-
inert: !
|
|
112
|
-
"aria-hidden": !
|
|
112
|
+
inert: !R.value,
|
|
113
|
+
"aria-hidden": !R.value || void 0
|
|
113
114
|
}, [
|
|
114
|
-
(
|
|
115
|
+
(g(), s(v(t.multiline ? "textarea" : "input"), {
|
|
115
116
|
ref_key: "editor",
|
|
116
|
-
ref:
|
|
117
|
-
value:
|
|
117
|
+
ref: L,
|
|
118
|
+
value: z.value,
|
|
118
119
|
class: "kima-editable__input",
|
|
119
120
|
"aria-label": t.label,
|
|
120
121
|
required: t.required,
|
|
121
|
-
readonly:
|
|
122
|
+
readonly: B.value,
|
|
122
123
|
disabled: t.disabled,
|
|
123
|
-
onInput: i[0] ||= (e) =>
|
|
124
|
-
onKeydown:
|
|
124
|
+
onInput: i[0] ||= (e) => z.value = e.target.value,
|
|
125
|
+
onKeydown: Y
|
|
125
126
|
}, null, 40, [
|
|
126
127
|
"value",
|
|
127
128
|
"aria-label",
|
|
@@ -129,32 +130,32 @@ var w = ["aria-busy"], T = [
|
|
|
129
130
|
"readonly",
|
|
130
131
|
"disabled"
|
|
131
132
|
])),
|
|
132
|
-
|
|
133
|
-
loading:
|
|
133
|
+
u("div", O, [f(n, {
|
|
134
|
+
loading: B.value,
|
|
134
135
|
disabled: t.disabled,
|
|
135
|
-
onClick:
|
|
136
|
+
onClick: q
|
|
136
137
|
}, {
|
|
137
|
-
default:
|
|
138
|
+
default: C(() => [...i[1] ||= [d("保存", -1)]]),
|
|
138
139
|
_: 1
|
|
139
|
-
}, 8, ["loading", "disabled"]),
|
|
140
|
+
}, 8, ["loading", "disabled"]), f(n, {
|
|
140
141
|
variant: "text",
|
|
141
|
-
disabled:
|
|
142
|
-
onClick:
|
|
142
|
+
disabled: B.value || t.disabled,
|
|
143
|
+
onClick: J
|
|
143
144
|
}, {
|
|
144
|
-
default:
|
|
145
|
+
default: C(() => [...i[2] ||= [d("取消", -1)]]),
|
|
145
146
|
_: 1
|
|
146
147
|
}, 8, ["disabled"])]),
|
|
147
|
-
|
|
148
|
-
], 8,
|
|
148
|
+
V.value ? (g(), l("p", k, y(V.value), 1)) : c("", !0)
|
|
149
|
+
], 8, D), [[x, R.value]])]),
|
|
149
150
|
_: 1
|
|
150
151
|
}, 16),
|
|
151
|
-
|
|
152
|
+
u("input", {
|
|
152
153
|
type: "hidden",
|
|
153
154
|
name: t.name,
|
|
154
|
-
value:
|
|
155
|
+
value: b(U),
|
|
155
156
|
disabled: t.disabled
|
|
156
|
-
}, null, 8,
|
|
157
|
-
], 8,
|
|
157
|
+
}, null, 8, A)
|
|
158
|
+
], 8, T));
|
|
158
159
|
}
|
|
159
|
-
}, [["__scopeId", "data-v-
|
|
160
|
-
export {
|
|
160
|
+
}, [["__scopeId", "data-v-82c96de0"]]);
|
|
161
|
+
export { j as default };
|
|
@@ -2,11 +2,12 @@ import { useRipple as e } from "../../utils/ripple.js";
|
|
|
2
2
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import n from "./icon.ce.js";
|
|
4
4
|
import { collapseTransition as r, presenceTransition as i } from "../../utils/motion.js";
|
|
5
|
+
import { useContentMotion as a } from "../../utils/content-motion.js";
|
|
5
6
|
/* empty css */
|
|
6
|
-
import { Transition as
|
|
7
|
-
import { Cancel01Icon as
|
|
7
|
+
import { Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, isRef as p, mergeProps as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, openBlock as b, ref as x, toDisplayString as S, unref as C, useAttrs as ee, useId as te, vShow as w, watch as T, withCtx as E, withDirectives as D, withModifiers as O } from "vue";
|
|
8
|
+
import { Cancel01Icon as k, ViewIcon as A, ViewOffIcon as j } from "@hugeicons/core-free-icons";
|
|
8
9
|
// src/components/core/text-field.ce.vue
|
|
9
|
-
var
|
|
10
|
+
var M = ["aria-disabled"], ne = [
|
|
10
11
|
"name",
|
|
11
12
|
"type",
|
|
12
13
|
"value",
|
|
@@ -18,10 +19,10 @@ var ne = ["aria-disabled"], re = [
|
|
|
18
19
|
"aria-describedby",
|
|
19
20
|
"aria-invalid",
|
|
20
21
|
"aria-required"
|
|
21
|
-
],
|
|
22
|
+
], re = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "kima-text-field__actions"
|
|
24
|
-
},
|
|
25
|
+
}, ie = ["aria-label", "disabled"], ae = ["disabled"], oe = ["disabled"], se = ["inert", "aria-hidden"], ce = ["id", "role"], N = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
25
26
|
__name: "text-field.ce",
|
|
26
27
|
props: {
|
|
27
28
|
label: {
|
|
@@ -56,37 +57,37 @@ var ne = ["aria-disabled"], re = [
|
|
|
56
57
|
},
|
|
57
58
|
emits: ["update:modelValue", "change"],
|
|
58
59
|
setup(t, { expose: N, emit: P }) {
|
|
59
|
-
let F = t, I = P, L =
|
|
60
|
+
let F = t, I = P, L = ee(), R = te(), z = x(null), B = x(null);
|
|
60
61
|
e(B);
|
|
61
|
-
let V =
|
|
62
|
-
function
|
|
62
|
+
let V = x(!1), H = x(F.modelValue), U = !1, W, G, K = `kima-text-field-${R}-hint`, q = `kima-text-field-${R}-error`, J = s(() => F.error.length > 0), Y = s(() => F.clearable && H.value.length > 0 && !F.readonly), le = s(() => F.type === "password" && V.value ? "text" : F.type);
|
|
63
|
+
function ue() {
|
|
63
64
|
let e = [];
|
|
64
65
|
return F.error ? e.push(q) : F.hint && e.push(K), L["aria-describedby"] && e.push(L["aria-describedby"]), e.length > 0 ? e.join(" ") : void 0;
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
+
function de() {
|
|
67
68
|
return L["aria-label"] || L.ariaLabel || F.label || F.placeholder || void 0;
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function fe() {
|
|
70
71
|
let e = { ...L };
|
|
71
72
|
return delete e.id, delete e.class, delete e.style, delete e["aria-describedby"], delete e["aria-label"], delete e.ariaLabel, e;
|
|
72
73
|
}
|
|
73
|
-
|
|
74
|
+
T(() => F.modelValue, (e) => {
|
|
74
75
|
e !== H.value && (H.value = e);
|
|
75
76
|
});
|
|
76
77
|
function X(e) {
|
|
77
78
|
U || e.isComposing || e.target.value === H.value || (H.value = e.target.value, I("update:modelValue", H.value));
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function pe() {
|
|
80
81
|
I("change", H.value);
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
F.disabled || F.readonly || !H.value || (H.value = "", I("update:modelValue", H.value), I("change", H.value),
|
|
83
|
+
function Z() {
|
|
84
|
+
F.disabled || F.readonly || !H.value || (H.value = "", I("update:modelValue", H.value), I("change", H.value), h(() => z.value?.focus()));
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function me() {
|
|
86
87
|
z.value?.focus();
|
|
87
88
|
}
|
|
88
|
-
N({ focus:
|
|
89
|
-
function
|
|
89
|
+
N({ focus: me });
|
|
90
|
+
function Q(e) {
|
|
90
91
|
e.target === z.value.form && queueMicrotask(() => {
|
|
91
92
|
if (e.defaultPrevented || !z.value) return;
|
|
92
93
|
U = !1;
|
|
@@ -94,101 +95,101 @@ var ne = ["aria-disabled"], re = [
|
|
|
94
95
|
H.value = W, z.value.value = W, t && I("update:modelValue", W);
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
let $ = x(null);
|
|
99
|
+
return a($, () => [F.error || F.hint, !!F.error]), y(() => {
|
|
100
|
+
W = H.value, z.value.defaultValue = W, G = z.value.ownerDocument, G.addEventListener("reset", Q, !0);
|
|
101
|
+
}), v(() => G.removeEventListener("reset", Q, !0)), (e, a) => (b(), u("div", {
|
|
102
|
+
class: g(["kima-text-field", [{
|
|
101
103
|
"kima-text-field--error": J.value,
|
|
102
104
|
"kima-text-field--disabled": t.disabled,
|
|
103
105
|
"kima-text-field--readonly": t.readonly
|
|
104
|
-
},
|
|
105
|
-
style:
|
|
106
|
-
}, [
|
|
106
|
+
}, C(L).class]]),
|
|
107
|
+
style: _(C(L).style)
|
|
108
|
+
}, [d("div", {
|
|
107
109
|
ref_key: "control",
|
|
108
110
|
ref: B,
|
|
109
111
|
class: "kima-text-field__control",
|
|
110
112
|
"aria-disabled": t.disabled || void 0
|
|
111
|
-
}, [
|
|
113
|
+
}, [d("input", m({
|
|
112
114
|
ref_key: "input",
|
|
113
115
|
ref: z
|
|
114
|
-
},
|
|
116
|
+
}, fe(), {
|
|
115
117
|
name: t.name,
|
|
116
|
-
type:
|
|
118
|
+
type: le.value,
|
|
117
119
|
value: H.value,
|
|
118
120
|
required: t.required,
|
|
119
121
|
disabled: t.disabled,
|
|
120
122
|
readonly: t.readonly,
|
|
121
123
|
placeholder: t.placeholder,
|
|
122
|
-
"aria-label":
|
|
123
|
-
"aria-describedby":
|
|
124
|
+
"aria-label": de(),
|
|
125
|
+
"aria-describedby": ue(),
|
|
124
126
|
"aria-invalid": J.value || void 0,
|
|
125
127
|
"aria-required": t.required || void 0,
|
|
126
|
-
onInput:
|
|
127
|
-
onCompositionstart:
|
|
128
|
-
onCompositionend:
|
|
129
|
-
|
|
128
|
+
onInput: O(X, ["stop"]),
|
|
129
|
+
onCompositionstart: a[0] ||= (e) => p(U) ? U.value = !0 : U = !0,
|
|
130
|
+
onCompositionend: a[1] ||= (e) => {
|
|
131
|
+
p(U) ? U.value = !1 : U = !1, X(e);
|
|
130
132
|
},
|
|
131
|
-
onChange:
|
|
132
|
-
}), null, 16,
|
|
133
|
+
onChange: O(pe, ["stop"])
|
|
134
|
+
}), null, 16, ne), t.type === "password" ? (b(), u("div", re, [d("button", {
|
|
133
135
|
class: "kima-text-field__action",
|
|
134
136
|
type: "button",
|
|
135
137
|
"aria-label": V.value ? "隐藏密码" : "显示密码",
|
|
136
138
|
disabled: t.disabled,
|
|
137
|
-
onClick:
|
|
138
|
-
}, [
|
|
139
|
-
icon: V.value ?
|
|
139
|
+
onClick: a[2] ||= (e) => V.value = !V.value
|
|
140
|
+
}, [f(n, {
|
|
141
|
+
icon: V.value ? C(j) : C(A),
|
|
140
142
|
size: 18,
|
|
141
143
|
color: "currentColor"
|
|
142
|
-
}, null, 8, ["icon"])], 8,
|
|
143
|
-
default:
|
|
144
|
+
}, null, 8, ["icon"])], 8, ie), f(o, m({ name: "kima-fade" }, C(i)), {
|
|
145
|
+
default: E(() => [Y.value ? (b(), u("button", {
|
|
144
146
|
key: 0,
|
|
145
147
|
class: "kima-text-field__action",
|
|
146
148
|
type: "button",
|
|
147
149
|
"aria-label": "清除内容",
|
|
148
150
|
disabled: t.disabled,
|
|
149
|
-
onClick:
|
|
150
|
-
}, [
|
|
151
|
-
icon:
|
|
151
|
+
onClick: Z
|
|
152
|
+
}, [f(n, {
|
|
153
|
+
icon: C(k),
|
|
152
154
|
size: 18,
|
|
153
155
|
color: "currentColor"
|
|
154
|
-
}, null, 8, ["icon"])], 8,
|
|
156
|
+
}, null, 8, ["icon"])], 8, ae)) : l("", !0)]),
|
|
155
157
|
_: 1
|
|
156
|
-
}, 16)])) : (
|
|
158
|
+
}, 16)])) : (b(), c(o, m({
|
|
157
159
|
key: 1,
|
|
158
160
|
name: "kima-fade"
|
|
159
|
-
},
|
|
160
|
-
default:
|
|
161
|
+
}, C(i)), {
|
|
162
|
+
default: E(() => [Y.value ? (b(), u("button", {
|
|
161
163
|
key: 0,
|
|
162
164
|
class: "kima-text-field__action kima-text-field__action--clear",
|
|
163
165
|
type: "button",
|
|
164
166
|
"aria-label": "清除内容",
|
|
165
167
|
disabled: t.disabled,
|
|
166
|
-
onClick:
|
|
167
|
-
}, [
|
|
168
|
-
icon:
|
|
168
|
+
onClick: Z
|
|
169
|
+
}, [f(n, {
|
|
170
|
+
icon: C(k),
|
|
169
171
|
size: 18,
|
|
170
172
|
color: "currentColor"
|
|
171
|
-
}, null, 8, ["icon"])], 8,
|
|
173
|
+
}, null, 8, ["icon"])], 8, oe)) : l("", !0)]),
|
|
172
174
|
_: 1
|
|
173
|
-
}, 16))], 8,
|
|
174
|
-
...
|
|
175
|
-
...
|
|
175
|
+
}, 16))], 8, M), f(o, m({ css: !1 }, {
|
|
176
|
+
...C(r),
|
|
177
|
+
...C(i)
|
|
176
178
|
}), {
|
|
177
|
-
default:
|
|
179
|
+
default: E(() => [D(d("div", {
|
|
180
|
+
ref_key: "messageWrap",
|
|
181
|
+
ref: $,
|
|
178
182
|
class: "kima-text-field__message-wrap",
|
|
179
183
|
inert: !(t.error || t.hint),
|
|
180
184
|
"aria-hidden": !(t.error || t.hint) || void 0
|
|
181
|
-
}, [
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}, x(t.error || t.hint), 11, M)) : c("", !0)]),
|
|
188
|
-
_: 1
|
|
189
|
-
}, 16)], 8, j), [[T, t.error || t.hint]])]),
|
|
185
|
+
}, [t.error || t.hint ? (b(), u("p", {
|
|
186
|
+
key: `${t.error ? "error" : "hint"}:${t.error || t.hint}`,
|
|
187
|
+
class: g(["kima-text-field__message", { "kima-text-field__message--error": !!t.error }]),
|
|
188
|
+
id: t.error ? q : K,
|
|
189
|
+
role: t.error ? "alert" : void 0
|
|
190
|
+
}, S(t.error || t.hint), 11, ce)) : l("", !0)], 8, se), [[w, t.error || t.hint]])]),
|
|
190
191
|
_: 1
|
|
191
192
|
}, 16)], 6));
|
|
192
193
|
}
|
|
193
|
-
}), [["__scopeId", "data-v-
|
|
194
|
+
}), [["__scopeId", "data-v-f22e5c02"]]);
|
|
194
195
|
export { N as default };
|