@kernel4632/kima 0.29.0 → 0.31.0
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/README.md +61 -43
- package/dist/components/containment/morph.ce.vue_vue_type_style_index_0_scoped_10a98d89_lang.css +1 -0
- package/dist/components/core/button.ce.vue_vue_type_style_index_0_scoped_49fea117_lang.css +1 -0
- package/dist/components/core/combobox.ce.vue_vue_type_style_index_0_scoped_82d70c66_lang.css +1 -0
- package/dist/components/core/dialog.ce.vue_vue_type_style_index_0_scoped_638cbfdc_lang.css +1 -0
- package/dist/components/core/{fab-menu.ce.vue_vue_type_style_index_0_scoped_7c25d968_lang.css → fab-menu.ce.vue_vue_type_style_index_0_scoped_eff6cc0c_lang.css} +1 -1
- package/dist/components/core/menu.ce.vue_vue_type_style_index_0_scoped_6cc90694_lang.css +1 -0
- package/dist/components/core/{morph-field.ce.vue_vue_type_style_index_0_scoped_ac757a01_lang.css → morph-field.ce.vue_vue_type_style_index_0_scoped_d8ed6708_lang.css} +1 -1
- package/dist/components/core/{select.ce.vue_vue_type_style_index_0_scoped_bf4d9de4_lang.css → select.ce.vue_vue_type_style_index_0_scoped_8fda1ce2_lang.css} +1 -1
- package/dist/components/core/split-button.ce.vue_vue_type_style_index_0_scoped_b4a612b7_lang.css +1 -0
- package/dist/components/data/table.ce.vue_vue_type_style_index_0_scoped_8300e08d_lang.css +1 -0
- package/dist/components/input/{textarea.ce.vue_vue_type_style_index_0_scoped_f6be6515_lang.css → textarea.ce.vue_vue_type_style_index_0_scoped_db526211_lang.css} +1 -1
- package/dist/kima-elements-core.js +2455 -2389
- package/dist/kima-elements.js +7710 -7270
- package/dist/kima.js +21 -20
- package/dist/style.css +13 -11
- package/dist/styles/_tokens.css +1 -1
- package/dist/styles/button.css +1 -1
- package/dist/styles/collapsible.css +1 -1
- package/dist/styles/combobox.css +1 -1
- package/dist/styles/core.css +10 -10
- package/dist/styles/dialog.css +2 -2
- package/dist/styles/fab-menu.css +1 -1
- package/dist/styles/menu.css +1 -1
- package/dist/styles/morph-field.css +1 -1
- package/dist/styles/morph.css +2 -0
- package/dist/styles/popover.css +1 -1
- package/dist/styles/select.css +1 -1
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/table.css +1 -1
- package/dist/styles/textarea.css +1 -1
- package/dist/vue/components/containment/morph.ce.js +81 -0
- package/dist/vue/components/core/button.ce.js +63 -27
- package/dist/vue/components/core/combobox.ce.js +116 -117
- package/dist/vue/components/core/dialog.ce.js +55 -56
- package/dist/vue/components/core/fab-menu.ce.js +51 -59
- package/dist/vue/components/core/menu.ce.js +88 -84
- package/dist/vue/components/core/morph-field.ce.js +34 -35
- package/dist/vue/components/core/select.ce.js +167 -168
- package/dist/vue/components/core/split-button.ce.js +54 -62
- package/dist/vue/components/data/table.ce.js +3 -2
- package/dist/vue/components/input/textarea.ce.js +2 -5
- package/dist/vue/internal/menu-items.js +107 -63
- package/dist/vue/utils/interaction.js +19 -22
- package/dist/vue/utils/model.js +29 -0
- package/dist/vue/utils/morph.js +306 -0
- package/dist/vue/utils/navigation.js +14 -17
- package/dist/vue/utils/shell.js +12 -20
- package/package.json +2 -1
- package/dist/components/core/button.ce.vue_vue_type_style_index_0_scoped_1c004601_lang.css +0 -1
- package/dist/components/core/combobox.ce.vue_vue_type_style_index_0_scoped_ba7220f2_lang.css +0 -1
- package/dist/components/core/dialog.ce.vue_vue_type_style_index_0_scoped_09f96946_lang.css +0 -1
- package/dist/components/core/menu.ce.vue_vue_type_style_index_0_scoped_16ed5f4d_lang.css +0 -1
- package/dist/components/core/split-button.ce.vue_vue_type_style_index_0_scoped_a8ef75a5_lang.css +0 -1
- package/dist/components/data/table.ce.vue_vue_type_style_index_0_scoped_de17ceaa_lang.css +0 -1
|
@@ -2,48 +2,49 @@ import { useNormalizedRadius as e } from "../../utils/radius.js";
|
|
|
2
2
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import n from "./icon.ce.js";
|
|
4
4
|
import { useRipple as r } from "../../utils/ripple.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { useModelState as ee } from "../../utils/model.js";
|
|
6
|
+
import { useRemoteOptions as te } from "../../utils/remote-options.js";
|
|
7
|
+
import { register as ne, unregister as re } from "../../utils/popup-manager.js";
|
|
8
|
+
import { cancelPopupLeave as ie, playPopupLeave as ae } from "../../utils/popup-motion.js";
|
|
8
9
|
/* empty css */
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { ArrowDown01Icon as
|
|
11
|
-
import { PopoverAnchor as
|
|
10
|
+
import { Fragment as oe, Transition as se, computed as i, createBlock as ce, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as le, createVNode as c, getCurrentInstance as ue, mergeProps as l, nextTick as u, normalizeClass as de, onBeforeUnmount as fe, onMounted as pe, openBlock as d, ref as f, renderList as me, shallowRef as he, toDisplayString as p, unref as m, useAttrs as ge, useHost as _e, useId as ve, vModelSelect as ye, vModelText as be, watch as h, withCtx as g, withDirectives as xe, withModifiers as _ } from "vue";
|
|
11
|
+
import { ArrowDown01Icon as Se, Cancel01Icon as Ce, Search01Icon as we } from "@hugeicons/core-free-icons";
|
|
12
|
+
import { PopoverAnchor as Te, PopoverContent as Ee, PopoverPortal as De, PopoverRoot as Oe } from "reka-ui";
|
|
12
13
|
// src/components/core/select.ce.vue
|
|
13
|
-
var
|
|
14
|
+
var ke = ["aria-disabled"], Ae = [
|
|
14
15
|
"disabled",
|
|
15
16
|
"aria-expanded",
|
|
16
17
|
"aria-label",
|
|
17
18
|
"aria-required",
|
|
18
19
|
"aria-activedescendant"
|
|
19
|
-
],
|
|
20
|
+
], je = ["disabled"], Me = [
|
|
20
21
|
"name",
|
|
21
22
|
"required",
|
|
22
23
|
"disabled"
|
|
23
|
-
],
|
|
24
|
+
], Ne = ["value", "disabled"], Pe = {
|
|
24
25
|
key: 0,
|
|
25
26
|
class: "kima-select__search-wrap"
|
|
26
|
-
},
|
|
27
|
+
}, Fe = ["aria-activedescendant"], Ie = ["aria-busy"], Le = {
|
|
27
28
|
key: 0,
|
|
28
29
|
class: "kima-select__status",
|
|
29
30
|
role: "status"
|
|
30
|
-
},
|
|
31
|
+
}, Re = {
|
|
31
32
|
key: 1,
|
|
32
33
|
class: "kima-select__status kima-select__status--error",
|
|
33
34
|
role: "alert"
|
|
34
|
-
},
|
|
35
|
+
}, ze = [
|
|
35
36
|
"id",
|
|
36
37
|
"aria-selected",
|
|
37
38
|
"aria-disabled",
|
|
38
39
|
"onClick"
|
|
39
|
-
],
|
|
40
|
+
], Be = { class: "kima-select__option-copy" }, Ve = { class: "kima-select__option-label" }, He = {
|
|
40
41
|
key: 0,
|
|
41
42
|
class: "kima-select__option-description"
|
|
42
|
-
},
|
|
43
|
+
}, Ue = {
|
|
43
44
|
key: 1,
|
|
44
45
|
class: "kima-select__empty",
|
|
45
46
|
role: "status"
|
|
46
|
-
},
|
|
47
|
+
}, v = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
47
48
|
__name: "select.ce",
|
|
48
49
|
props: {
|
|
49
50
|
modelValue: {
|
|
@@ -99,72 +100,72 @@ var Ee = ["aria-disabled"], De = [
|
|
|
99
100
|
"options-load",
|
|
100
101
|
"options-error"
|
|
101
102
|
],
|
|
102
|
-
setup(t, { emit:
|
|
103
|
-
let
|
|
104
|
-
function
|
|
105
|
-
|
|
103
|
+
setup(t, { emit: v }) {
|
|
104
|
+
let We = typeof document < "u", y = ge(), Ge = ue().ce ? _e() : null, b = t, x = v, S = f(null), C = f(null), Ke = f(null), w = f(null), { radiusAttrs: qe, radiusStyle: Je } = e(w, () => b.radius);
|
|
105
|
+
function Ye(e) {
|
|
106
|
+
Ke.value = e, w.value = e;
|
|
106
107
|
}
|
|
107
|
-
let
|
|
108
|
-
r(
|
|
109
|
-
let
|
|
110
|
-
let e =
|
|
111
|
-
return typeof
|
|
112
|
-
}),
|
|
113
|
-
get: () =>
|
|
108
|
+
let Xe = f(null);
|
|
109
|
+
r(Xe);
|
|
110
|
+
let T = f(null), E = f(null), Ze = f([]), D = f(""), O = f(-1), k = he(b.modelValue), [Qe, A] = ee(b, "open", x), j = i(() => Qe.value && !b.disabled), M, N, P, F, I = !0, L = ve(), $e = `kima-select-${L}-trigger`, R = `kima-select-${L}-listbox`, et = `kima-select-${L}-native`, z = `kima-select-${L}-popup`, tt = i(() => y["aria-label"] || y.ariaLabel || b.label || void 0), nt = i(() => b.loader), rt = i(() => D.value), { items: it, loading: B, error: V, retry: at } = te(nt, rt, i(() => b.debounce), i(() => b.retry), x), H = i(() => typeof b.loader == "function" ? it.value : b.items), U = i(() => {
|
|
111
|
+
let e = D.value.trim().toLocaleLowerCase();
|
|
112
|
+
return typeof b.loader == "function" || !e ? H.value : H.value.filter((t) => `${t.label} ${t.description || ""}`.toLocaleLowerCase().includes(e));
|
|
113
|
+
}), W = i(() => H.value.find((e) => Object.is(e.value, k.value))), G = i({
|
|
114
|
+
get: () => W.value ? k.value : "",
|
|
114
115
|
set: () => {
|
|
115
|
-
let e =
|
|
116
|
-
|
|
116
|
+
let e = E.value.selectedIndex;
|
|
117
|
+
X(e > 0 ? H.value[e - 1].value : null);
|
|
117
118
|
}
|
|
118
|
-
}),
|
|
119
|
-
function
|
|
120
|
-
|
|
119
|
+
}), K = i(() => U.value.flatMap((e, t) => e.disabled ? [] : [t])), ot = i(() => j.value && O.value >= 0 ? `${R}-option-${O.value}` : void 0);
|
|
120
|
+
function q(e) {
|
|
121
|
+
O.value = e, u(() => Ze.value[e]?.scrollIntoView({ block: "nearest" }));
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
-
let t =
|
|
123
|
+
function st(e) {
|
|
124
|
+
let t = K.value.length;
|
|
124
125
|
if (!t) return;
|
|
125
|
-
let n =
|
|
126
|
-
|
|
126
|
+
let n = K.value.indexOf(O.value), r = n < 0 ? e > 0 ? 0 : t - 1 : (n + e + t) % t;
|
|
127
|
+
q(K.value[r]);
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
129
|
+
function ct() {
|
|
130
|
+
b.disabled || j.value || A(!0);
|
|
130
131
|
}
|
|
131
|
-
function
|
|
132
|
-
j.value && (I = e,
|
|
132
|
+
function J(e = !0) {
|
|
133
|
+
j.value && (I = e, A(!1));
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
-
j.value ?
|
|
135
|
+
function lt() {
|
|
136
|
+
j.value ? J() : ct();
|
|
136
137
|
}
|
|
137
|
-
function
|
|
138
|
-
return e.includes(
|
|
138
|
+
function ut(e) {
|
|
139
|
+
return e.includes(S.value) ? !0 : e.some((e) => e?.dataset?.kimaPopupOwner === z);
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
-
|
|
142
|
-
close: () =>
|
|
143
|
-
isInside:
|
|
144
|
-
}) :
|
|
141
|
+
function dt(e) {
|
|
142
|
+
Y && (e ? ne(z, {
|
|
143
|
+
close: () => J(!1),
|
|
144
|
+
isInside: ut
|
|
145
|
+
}) : re(z));
|
|
145
146
|
}
|
|
146
|
-
let
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
let Y = !1;
|
|
148
|
+
h(j, dt), pe(() => {
|
|
149
|
+
Y = !0, dt(j.value);
|
|
149
150
|
});
|
|
150
|
-
function
|
|
151
|
-
|
|
151
|
+
function X(e) {
|
|
152
|
+
b.disabled || Object.is(e, k.value) || (k.value = e, x("update:modelValue", e), x("change", e));
|
|
152
153
|
}
|
|
153
|
-
function
|
|
154
|
-
|
|
154
|
+
function ft(e) {
|
|
155
|
+
b.disabled || e.disabled || (X(e.value), J());
|
|
155
156
|
}
|
|
156
|
-
function
|
|
157
|
-
|
|
157
|
+
function pt() {
|
|
158
|
+
X(null), J(), u(() => C.value?.focus());
|
|
158
159
|
}
|
|
159
|
-
function
|
|
160
|
+
function mt(e) {
|
|
160
161
|
clearTimeout(F), F = setTimeout(() => {
|
|
161
|
-
e.defaultPrevented || (
|
|
162
|
+
e.defaultPrevented || (k.value = P, E.value.selectedIndex = H.value.findIndex((e) => Object.is(e.value, P)) + 1, J(!1), x("update:modelValue", P));
|
|
162
163
|
}, 0);
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
-
if (!(
|
|
166
|
-
if (e.key === "Tab")
|
|
167
|
-
else if ((e.key !== " " || e.target !==
|
|
165
|
+
function ht(e) {
|
|
166
|
+
if (!(b.disabled || e.isComposing)) {
|
|
167
|
+
if (e.key === "Tab") J(!1);
|
|
168
|
+
else if ((e.key !== " " || e.target !== T.value) && [
|
|
168
169
|
"ArrowDown",
|
|
169
170
|
"ArrowUp",
|
|
170
171
|
"Home",
|
|
@@ -173,143 +174,141 @@ var Ee = ["aria-disabled"], De = [
|
|
|
173
174
|
" ",
|
|
174
175
|
"Escape"
|
|
175
176
|
].includes(e.key)) {
|
|
176
|
-
if (e.preventDefault(), e.stopPropagation(), e.key === "Escape")
|
|
177
|
-
else if (!j.value)
|
|
178
|
-
else if (e.key === "ArrowDown")
|
|
179
|
-
else if (e.key === "ArrowUp")
|
|
180
|
-
else if (e.key === "Home")
|
|
181
|
-
else if (e.key === "End")
|
|
177
|
+
if (e.preventDefault(), e.stopPropagation(), e.key === "Escape") J();
|
|
178
|
+
else if (!j.value) ct(), e.key === "ArrowUp" || e.key === "End" ? u(() => q(K.value.at(-1) ?? -1)) : e.key === "Home" && u(() => q(K.value[0] ?? -1));
|
|
179
|
+
else if (e.key === "ArrowDown") st(1);
|
|
180
|
+
else if (e.key === "ArrowUp") st(-1);
|
|
181
|
+
else if (e.key === "Home") q(K.value[0] ?? -1);
|
|
182
|
+
else if (e.key === "End") q(K.value.at(-1) ?? -1);
|
|
182
183
|
else {
|
|
183
|
-
let e =
|
|
184
|
-
e &&
|
|
184
|
+
let e = U.value[O.value];
|
|
185
|
+
e && ft(e);
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
}
|
|
189
|
-
function
|
|
190
|
+
function gt(e) {
|
|
190
191
|
return e.some((e) => {
|
|
191
192
|
if (!e || typeof e.getAttribute != "function") return !1;
|
|
192
193
|
if (e.getAttribute("aria-haspopup") !== null) return !0;
|
|
193
194
|
let t = e.dataset?.kimaPopupOwner;
|
|
194
|
-
return typeof t == "string" && t !==
|
|
195
|
+
return typeof t == "string" && t !== z;
|
|
195
196
|
});
|
|
196
197
|
}
|
|
197
|
-
function
|
|
198
|
+
function Z(e) {
|
|
198
199
|
let t = e.composedPath(), n = document.querySelector(".kima-select__popup");
|
|
199
|
-
!j.value || t.includes(
|
|
200
|
+
!j.value || t.includes(S.value) || t.includes(n) || gt(t) || J(!1);
|
|
200
201
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}),
|
|
204
|
-
|
|
205
|
-
}),
|
|
206
|
-
e && Y(!1);
|
|
207
|
-
}), g(j, async (e, t) => {
|
|
202
|
+
h(() => b.modelValue, (e) => {
|
|
203
|
+
k.value = e;
|
|
204
|
+
}), h(() => b.disabled, (e) => {
|
|
205
|
+
e && (I = !1, A(!1));
|
|
206
|
+
}), h(j, async (e, t) => {
|
|
208
207
|
if (e) {
|
|
209
|
-
|
|
210
|
-
let e =
|
|
211
|
-
|
|
208
|
+
D.value = "";
|
|
209
|
+
let e = U.value.findIndex((e) => Object.is(e.value, k.value) && !e.disabled);
|
|
210
|
+
q(e >= 0 ? e : K.value[0] ?? -1), await u(), j.value && (b.searchable ? T.value : C.value)?.focus();
|
|
212
211
|
} else t && I && u(() => {
|
|
213
|
-
j.value ||
|
|
212
|
+
j.value || C.value?.focus();
|
|
214
213
|
}), I = !0;
|
|
215
214
|
}, { immediate: !0 });
|
|
216
|
-
let Q =
|
|
217
|
-
return
|
|
218
|
-
e ? ($ += 1, Q.value = !1,
|
|
215
|
+
let Q = f(!1), $ = 0;
|
|
216
|
+
return h(j, (e) => {
|
|
217
|
+
e ? ($ += 1, Q.value = !1, ie(document.querySelector(".kima-select__popup"))) : document.querySelector(".kima-select__popup") && (Q.value = !0, u(() => {
|
|
219
218
|
let e = document.querySelector(".kima-select__popup");
|
|
220
219
|
if (!e || j.value) return;
|
|
221
220
|
let t = ++$;
|
|
222
|
-
|
|
221
|
+
ae(e, () => {
|
|
223
222
|
t === $ && (Q.value = !1);
|
|
224
223
|
});
|
|
225
224
|
}));
|
|
226
|
-
}),
|
|
227
|
-
let e =
|
|
228
|
-
|
|
229
|
-
}),
|
|
230
|
-
P =
|
|
231
|
-
}),
|
|
232
|
-
|
|
233
|
-
}), (e, r) => (
|
|
225
|
+
}), h(U, () => {
|
|
226
|
+
let e = U.value.findIndex((e) => Object.is(e.value, k.value) && !e.disabled);
|
|
227
|
+
q(!D.value && e >= 0 ? e : K.value[0] ?? -1);
|
|
228
|
+
}), pe(() => {
|
|
229
|
+
P = b.modelValue, N = E.value.form, N?.addEventListener("reset", mt), M = S.value.ownerDocument, M.addEventListener("focusin", Z);
|
|
230
|
+
}), fe(() => {
|
|
231
|
+
Y = !1, re(z), clearTimeout(F), N?.removeEventListener("reset", mt), M.removeEventListener("focusin", Z);
|
|
232
|
+
}), (e, r) => (d(), o("div", l({
|
|
234
233
|
ref_key: "root",
|
|
235
|
-
ref:
|
|
234
|
+
ref: S
|
|
236
235
|
}, {
|
|
237
|
-
...
|
|
238
|
-
id:
|
|
236
|
+
...m(y),
|
|
237
|
+
id: m(Ge) ? void 0 : m(y).id
|
|
239
238
|
}, { class: ["kima-select", {
|
|
240
239
|
"kima-select--open": j.value,
|
|
241
240
|
"kima-select--disabled": t.disabled
|
|
242
|
-
}] }), [
|
|
241
|
+
}] }), [c(m(Oe), {
|
|
243
242
|
open: j.value,
|
|
244
243
|
modal: !1
|
|
245
244
|
}, {
|
|
246
|
-
default:
|
|
247
|
-
|
|
248
|
-
default:
|
|
245
|
+
default: g(() => [
|
|
246
|
+
c(m(Te), { "as-child": "" }, {
|
|
247
|
+
default: g(() => [s("div", {
|
|
249
248
|
ref_key: "control",
|
|
250
|
-
ref:
|
|
249
|
+
ref: Xe,
|
|
251
250
|
class: "kima-select__control",
|
|
252
251
|
"aria-disabled": t.disabled || void 0
|
|
253
|
-
}, [
|
|
254
|
-
id:
|
|
252
|
+
}, [s("button", {
|
|
253
|
+
id: $e,
|
|
255
254
|
ref_key: "trigger",
|
|
256
|
-
ref:
|
|
255
|
+
ref: C,
|
|
257
256
|
class: "kima-select__trigger",
|
|
258
257
|
type: "button",
|
|
259
258
|
role: "combobox",
|
|
260
259
|
disabled: t.disabled,
|
|
261
260
|
"aria-expanded": j.value,
|
|
262
|
-
"aria-controls":
|
|
261
|
+
"aria-controls": R,
|
|
263
262
|
"aria-haspopup": "listbox",
|
|
264
|
-
"aria-label":
|
|
263
|
+
"aria-label": tt.value,
|
|
265
264
|
"aria-required": t.required || void 0,
|
|
266
|
-
"aria-activedescendant": t.searchable ? void 0 :
|
|
267
|
-
onClick:
|
|
268
|
-
onKeydown:
|
|
269
|
-
}, [
|
|
265
|
+
"aria-activedescendant": t.searchable ? void 0 : ot.value,
|
|
266
|
+
onClick: lt,
|
|
267
|
+
onKeydown: ht
|
|
268
|
+
}, [s("span", { class: de(["kima-select__trigger-label", { "kima-select__trigger-label--placeholder": !W.value }]) }, p(W.value ? W.value.label : t.placeholder), 3), c(n, {
|
|
270
269
|
class: "kima-select__arrow",
|
|
271
|
-
icon:
|
|
270
|
+
icon: m(Se),
|
|
272
271
|
size: 20,
|
|
273
272
|
"aria-hidden": "true"
|
|
274
|
-
}, null, 8, ["icon"])], 40,
|
|
275
|
-
default:
|
|
273
|
+
}, null, 8, ["icon"])], 40, Ae), c(se, { name: "kima-fade" }, {
|
|
274
|
+
default: g(() => [t.clearable && W.value ? (d(), o("button", {
|
|
276
275
|
key: 0,
|
|
277
276
|
class: "kima-select__clear",
|
|
278
277
|
type: "button",
|
|
279
278
|
"aria-label": "清除选择",
|
|
280
279
|
title: "清除选择",
|
|
281
280
|
disabled: t.disabled,
|
|
282
|
-
onClick:
|
|
283
|
-
}, [
|
|
284
|
-
icon:
|
|
281
|
+
onClick: _(pt, ["stop"])
|
|
282
|
+
}, [c(n, {
|
|
283
|
+
icon: m(Ce),
|
|
285
284
|
size: 18,
|
|
286
285
|
"aria-hidden": "true"
|
|
287
|
-
}, null, 8, ["icon"])], 8,
|
|
286
|
+
}, null, 8, ["icon"])], 8, je)) : a("", !0)]),
|
|
288
287
|
_: 1
|
|
289
|
-
})], 8,
|
|
288
|
+
})], 8, ke)]),
|
|
290
289
|
_: 1
|
|
291
290
|
}),
|
|
292
|
-
|
|
291
|
+
xe(s("select", {
|
|
293
292
|
ref_key: "nativeSelect",
|
|
294
|
-
ref:
|
|
295
|
-
"onUpdate:modelValue": r[0] ||= (e) =>
|
|
296
|
-
id:
|
|
293
|
+
ref: E,
|
|
294
|
+
"onUpdate:modelValue": r[0] ||= (e) => G.value = e,
|
|
295
|
+
id: et,
|
|
297
296
|
class: "kima-select__native",
|
|
298
297
|
name: t.name,
|
|
299
298
|
required: t.required,
|
|
300
299
|
disabled: t.disabled,
|
|
301
300
|
tabindex: "-1",
|
|
302
301
|
"aria-hidden": "true",
|
|
303
|
-
onInput: r[1] ||=
|
|
304
|
-
onChange: r[2] ||=
|
|
305
|
-
onInvalid: r[3] ||=
|
|
306
|
-
}, [r[9] ||=
|
|
302
|
+
onInput: r[1] ||= _(() => {}, ["stop"]),
|
|
303
|
+
onChange: r[2] ||= _(() => {}, ["stop"]),
|
|
304
|
+
onInvalid: r[3] ||= _((e) => C.value?.focus(), ["prevent"])
|
|
305
|
+
}, [r[9] ||= s("option", { value: "" }, null, -1), (d(!0), o(oe, null, me(H.value, (e, t) => (d(), o("option", {
|
|
307
306
|
key: t,
|
|
308
307
|
value: e.value,
|
|
309
308
|
disabled: e.disabled
|
|
310
|
-
},
|
|
311
|
-
|
|
312
|
-
default:
|
|
309
|
+
}, p(e.label), 9, Ne))), 128))], 40, Me), [[ye, G.value]]),
|
|
310
|
+
c(m(De), { disabled: !We }, {
|
|
311
|
+
default: g(() => [j.value || Q.value ? (d(), ce(m(Ee), {
|
|
313
312
|
key: 0,
|
|
314
313
|
"as-child": "",
|
|
315
314
|
"side-offset": 8,
|
|
@@ -319,67 +318,67 @@ var Ee = ["aria-disabled"], De = [
|
|
|
319
318
|
"hide-when-detached": "",
|
|
320
319
|
"force-mount": ""
|
|
321
320
|
}, {
|
|
322
|
-
default:
|
|
323
|
-
style:
|
|
321
|
+
default: g(() => [s("div", l({ ref: Ye }, m(qe), {
|
|
322
|
+
style: m(Je),
|
|
324
323
|
class: "kima-select__popup",
|
|
325
|
-
"data-kima-popup-owner":
|
|
324
|
+
"data-kima-popup-owner": z
|
|
326
325
|
}), [
|
|
327
|
-
t.searchable ? (
|
|
326
|
+
t.searchable ? (d(), o("div", Pe, [c(n, {
|
|
328
327
|
class: "kima-select__search-icon",
|
|
329
|
-
icon:
|
|
328
|
+
icon: m(we),
|
|
330
329
|
size: 18,
|
|
331
330
|
"aria-hidden": "true"
|
|
332
|
-
}, null, 8, ["icon"]),
|
|
331
|
+
}, null, 8, ["icon"]), xe(s("input", {
|
|
333
332
|
ref_key: "searchInput",
|
|
334
|
-
ref:
|
|
335
|
-
"onUpdate:modelValue": r[4] ||= (e) =>
|
|
333
|
+
ref: T,
|
|
334
|
+
"onUpdate:modelValue": r[4] ||= (e) => D.value = e,
|
|
336
335
|
class: "kima-select__search",
|
|
337
336
|
type: "search",
|
|
338
337
|
role: "combobox",
|
|
339
338
|
"aria-label": "搜索选项",
|
|
340
339
|
"aria-expanded": "true",
|
|
341
340
|
"aria-autocomplete": "list",
|
|
342
|
-
"aria-controls":
|
|
343
|
-
"aria-activedescendant":
|
|
344
|
-
onInput: r[5] ||=
|
|
345
|
-
onChange: r[6] ||=
|
|
346
|
-
onKeydown:
|
|
347
|
-
}, null, 40,
|
|
348
|
-
|
|
349
|
-
id:
|
|
341
|
+
"aria-controls": R,
|
|
342
|
+
"aria-activedescendant": ot.value,
|
|
343
|
+
onInput: r[5] ||= _(() => {}, ["stop"]),
|
|
344
|
+
onChange: r[6] ||= _(() => {}, ["stop"]),
|
|
345
|
+
onKeydown: ht
|
|
346
|
+
}, null, 40, Fe), [[be, D.value]])])) : a("", !0),
|
|
347
|
+
s("div", {
|
|
348
|
+
id: R,
|
|
350
349
|
class: "kima-select__options",
|
|
351
350
|
role: "listbox",
|
|
352
|
-
"aria-labelledby":
|
|
353
|
-
"aria-busy":
|
|
354
|
-
}, [
|
|
351
|
+
"aria-labelledby": $e,
|
|
352
|
+
"aria-busy": m(B) || void 0
|
|
353
|
+
}, [m(B) ? (d(), o("div", Le, "加载中…")) : m(V) ? (d(), o("div", Re, [le(p(m(V)) + " ", 1), s("button", {
|
|
355
354
|
type: "button",
|
|
356
|
-
onClick: r[7] ||= (...e) =>
|
|
357
|
-
}, "重试")])) :
|
|
358
|
-
id: `${
|
|
355
|
+
onClick: r[7] ||= (...e) => m(at) && m(at)(...e)
|
|
356
|
+
}, "重试")])) : a("", !0), (d(!0), o(oe, null, me(U.value, (e, t) => (d(), o("div", {
|
|
357
|
+
id: `${R}-option-${t}`,
|
|
359
358
|
key: t,
|
|
360
359
|
ref_for: !0,
|
|
361
360
|
ref: (e) => {
|
|
362
|
-
|
|
361
|
+
Ze.value[t] = e;
|
|
363
362
|
},
|
|
364
|
-
class:
|
|
365
|
-
"kima-select__option--active": t ===
|
|
366
|
-
"kima-select__option--selected": Object.is(e.value,
|
|
363
|
+
class: de(["kima-select__option", {
|
|
364
|
+
"kima-select__option--active": t === O.value,
|
|
365
|
+
"kima-select__option--selected": Object.is(e.value, k.value)
|
|
367
366
|
}]),
|
|
368
367
|
role: "option",
|
|
369
|
-
"aria-selected": Object.is(e.value,
|
|
368
|
+
"aria-selected": Object.is(e.value, k.value),
|
|
370
369
|
"aria-disabled": e.disabled || void 0,
|
|
371
|
-
onPointerdown: r[8] ||=
|
|
372
|
-
onClick: (t) =>
|
|
373
|
-
}, [
|
|
374
|
-
!
|
|
370
|
+
onPointerdown: r[8] ||= _(() => {}, ["prevent"]),
|
|
371
|
+
onClick: (t) => ft(e)
|
|
372
|
+
}, [s("span", Be, [s("span", Ve, p(e.label), 1), e.description ? (d(), o("span", He, p(e.description), 1)) : a("", !0)])], 42, ze))), 128))], 8, Ie),
|
|
373
|
+
!m(B) && !m(V) && U.value.length === 0 ? (d(), o("div", Ue, "没有匹配选项")) : a("", !0)
|
|
375
374
|
], 16)]),
|
|
376
375
|
_: 1
|
|
377
|
-
})) :
|
|
376
|
+
})) : a("", !0)]),
|
|
378
377
|
_: 1
|
|
379
378
|
}, 8, ["disabled"])
|
|
380
379
|
]),
|
|
381
380
|
_: 1
|
|
382
381
|
}, 8, ["open"])], 16));
|
|
383
382
|
}
|
|
384
|
-
}), [["__scopeId", "data-v-
|
|
385
|
-
export {
|
|
383
|
+
}), [["__scopeId", "data-v-8fda1ce2"]]);
|
|
384
|
+
export { v as default };
|