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