@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,19 +2,20 @@ 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 { register as i, unregister as a } from "../../utils/popup-manager.js";
6
- import { dismissInteraction as o } from "../../utils/interaction.js";
5
+ import { useModelState as i } from "../../utils/model.js";
6
+ import { register as a, unregister as o } from "../../utils/popup-manager.js";
7
+ import { dismissInteraction as s } from "../../utils/interaction.js";
7
8
  /* empty css */
8
- import { Fragment as s, TransitionGroup as c, computed as l, createElementBlock as u, createElementVNode as d, createVNode as f, mergeModels as p, mergeProps as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, useId as w, useModel as T, watch as E, withCtx as D } from "vue";
9
- import { Add01Icon as O, Cancel01Icon as k } from "@hugeicons/core-free-icons";
9
+ import { Fragment as c, TransitionGroup as l, computed as u, createElementBlock as d, createElementVNode as f, createVNode as p, mergeProps as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as _, onMounted as v, openBlock as y, ref as b, renderList as x, toDisplayString as S, unref as C, useId as w, watch as T, withCtx as E } from "vue";
10
+ import { Add01Icon as D, Cancel01Icon as O } from "@hugeicons/core-free-icons";
10
11
  // src/components/core/fab-menu.ce.vue
11
- var A = ["disabled", "onClick"], j = [
12
+ var k = ["disabled", "onClick"], A = [
12
13
  "aria-expanded",
13
14
  "aria-label",
14
15
  "disabled"
15
- ], M = /*#__PURE__*/ t({
16
+ ], j = /*#__PURE__*/ t({
16
17
  __name: "fab-menu.ce",
17
- props: /*@__PURE__*/ p({
18
+ props: {
18
19
  variant: {
19
20
  type: String,
20
21
  default: "primary"
@@ -31,82 +32,73 @@ var A = ["disabled", "onClick"], j = [
31
32
  radius: {
32
33
  type: [String, Number],
33
34
  default: null
34
- }
35
- }, {
36
- open: {
37
- type: Boolean,
38
- default: !1
39
35
  },
40
- openModifiers: {}
41
- }),
42
- emits: /*@__PURE__*/ p(["select"], ["update:open"]),
43
- setup(t, { emit: p }) {
44
- let M = t, N = p, P = T(t, "open"), F = b(null), I = b(null), { radiusAttrs: L, radiusStyle: R } = e(I, () => M.radius);
45
- r(F);
46
- let z = l(() => [
36
+ open: Boolean
37
+ },
38
+ emits: ["update:open", "select"],
39
+ setup(t, { emit: j }) {
40
+ let M = t, N = j, [P, F] = i(M, "open", N), I = b(null), L = b(null), { radiusAttrs: R, radiusStyle: z } = e(L, () => M.radius);
41
+ r(I);
42
+ let B = u(() => [
47
43
  "primary",
48
44
  "secondary",
49
45
  "tertiary"
50
46
  ].includes(M.variant) ? M.variant : "primary");
51
- function B() {
52
- M.disabled || (P.value = !P.value);
53
- }
54
- function V(e) {
55
- e.disabled || (P.value = !1, N("select", e.value));
47
+ function V() {
48
+ M.disabled || F(!P.value);
56
49
  }
57
50
  function H(e) {
58
- P.value && e.key === "Escape" && o(e, () => {
59
- P.value = !1;
60
- });
51
+ e.disabled || (F(!1), N("select", e.value));
52
+ }
53
+ function U(e) {
54
+ P.value && e.key === "Escape" && s(e, () => F(!1));
61
55
  }
62
- let U = `kima-fab-menu-${w()}`, W = !1, G = (e) => e.includes(F.value);
63
- function K(e) {
64
- W && (e ? i(U, {
65
- close: () => {
66
- P.value = !1;
67
- },
68
- isInside: G
69
- }) : a(U));
56
+ let W = `kima-fab-menu-${w()}`, G = !1, K = (e) => e.includes(I.value);
57
+ function q(e) {
58
+ G && (e ? a(W, {
59
+ close: () => F(!1),
60
+ isInside: K
61
+ }) : o(W));
70
62
  }
71
- return E(P, K), v(() => {
72
- W = !0, K(P.value), window.addEventListener("keydown", H, !0);
63
+ return T(P, q), v(() => {
64
+ G = !0, q(P.value), window.addEventListener("keydown", U, !0);
73
65
  }), _(() => {
74
- W = !1, a(U), window.removeEventListener("keydown", H, !0);
75
- }), E(() => M.disabled, (e) => {
76
- e && (P.value = !1);
77
- }), (e, r) => (y(), u("div", {
66
+ G = !1, o(W), window.removeEventListener("keydown", U, !0);
67
+ }), T(() => M.disabled, (e) => {
68
+ e && F(!1);
69
+ }), (e, r) => (y(), d("div", {
78
70
  ref_key: "root",
79
- ref: F,
80
- class: h(["kima-fab-menu", [`kima-fab-menu--${z.value}`, { "kima-fab-menu--open": P.value }]])
81
- }, [f(c, {
71
+ ref: I,
72
+ class: h(["kima-fab-menu", [`kima-fab-menu--${B.value}`, { "kima-fab-menu--open": C(P) }]])
73
+ }, [p(l, {
82
74
  name: "kima-fab-menu-item",
83
75
  tag: "div",
84
76
  class: "kima-fab-menu__items"
85
77
  }, {
86
- default: D(() => [(y(!0), u(s, null, x(P.value ? t.items : [], (e, t) => (y(), u("button", {
78
+ default: E(() => [(y(!0), d(c, null, x(C(P) ? t.items : [], (e, t) => (y(), d("button", {
87
79
  key: e.value,
88
80
  class: h(["kima-fab-menu__item", { "kima-fab-menu__item--disabled": e.disabled }]),
89
81
  style: g({ "--kima-fab-menu-item-delay": `${t * 40}ms` }),
90
82
  role: "menuitem",
91
83
  disabled: e.disabled,
92
- onClick: (t) => V(e)
93
- }, [d("span", null, S(e.label), 1)], 14, A))), 128))]),
84
+ onClick: (t) => H(e)
85
+ }, [f("span", null, S(e.label), 1)], 14, k))), 128))]),
94
86
  _: 1
95
- }), d("button", m({
87
+ }), f("button", m({
96
88
  ref_key: "trigger",
97
- ref: I
98
- }, C(L), {
99
- style: C(R),
89
+ ref: L
90
+ }, C(R), {
91
+ style: C(z),
100
92
  class: "kima-fab-menu__trigger",
101
- "aria-expanded": P.value,
93
+ "aria-expanded": C(P),
102
94
  "aria-haspopup": "menu",
103
- "aria-label": P.value ? `关闭${t.label}菜单` : `打开${t.label}菜单`,
95
+ "aria-label": C(P) ? `关闭${t.label}菜单` : `打开${t.label}菜单`,
104
96
  disabled: t.disabled,
105
- onClick: B
106
- }), [f(n, {
107
- icon: P.value ? C(k) : C(O),
97
+ onClick: V
98
+ }), [p(n, {
99
+ icon: C(P) ? C(O) : C(D),
108
100
  size: 24
109
- }, null, 8, ["icon"])], 16, j)], 2));
101
+ }, null, 8, ["icon"])], 16, A)], 2));
110
102
  }
111
- }, [["__scopeId", "data-v-7c25d968"]]);
112
- export { M as default };
103
+ }, [["__scopeId", "data-v-eff6cc0c"]]);
104
+ export { j as default };
@@ -2,27 +2,27 @@ 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 { register as i, unregister as a } from "../../utils/popup-manager.js";
6
- import { cancelPopupLeave as o, playPopupLeave as ee } from "../../utils/popup-motion.js";
7
- import { dismissInteraction as te, flattenChoices as ne, useInteractionRoot as re, usePlacement as s } from "../../utils/interaction.js";
8
- import c from "../../internal/menu-items.js";
9
- import { useMenuChecks as l, useShellModel as u } from "../../utils/shell.js";
5
+ import { register as ee, unregister as i } from "../../utils/popup-manager.js";
6
+ import { cancelPopupLeave as te, playPopupLeave as ne } from "../../utils/popup-motion.js";
7
+ import { dismissInteraction as re, flattenChoices as ie, useInteractionRoot as ae, usePlacement as a } from "../../utils/interaction.js";
8
+ import o from "../../internal/menu-items.js";
9
+ import { useMenuChecks as s, useShellModel as c } from "../../utils/shell.js";
10
10
  /* empty css */
11
- import { computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createVNode as g, mergeProps as _, nextTick as v, onBeforeUnmount as y, onMounted as b, openBlock as x, ref as S, renderSlot as ie, toDisplayString as ae, unref as C, useId as oe, vModelText as se, watch as w, withCtx as T, withDirectives as ce, withModifiers as E } from "vue";
12
- import { ArrowDown01Icon as le, MoreHorizontalIcon as ue, Search01Icon as de } from "@hugeicons/core-free-icons";
13
- import { DropdownMenuContent as fe, DropdownMenuRoot as pe, DropdownMenuTrigger as me } from "reka-ui";
11
+ import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as oe, createVNode as m, guardReactiveProps as h, mergeProps as g, nextTick as _, normalizeProps as v, onBeforeUnmount as se, onMounted as ce, openBlock as y, ref as b, renderSlot as x, toDisplayString as le, unref as S, useId as ue, vModelText as de, watch as C, withCtx as w, withDirectives as fe, withModifiers as T } from "vue";
12
+ import { ArrowDown01Icon as pe, MoreHorizontalIcon as me, Search01Icon as he } from "@hugeicons/core-free-icons";
13
+ import { DropdownMenuContent as ge, DropdownMenuRoot as E, DropdownMenuTrigger as D } from "reka-ui";
14
14
  // src/components/core/menu.ce.vue
15
- var D = [
15
+ var O = [
16
16
  "disabled",
17
17
  "aria-label",
18
18
  "title"
19
- ], O = { key: 1 }, k = ["aria-label"], A = {
19
+ ], k = { key: 1 }, A = ["aria-label"], j = {
20
20
  key: 0,
21
21
  class: "kima-menu__search-wrap"
22
- }, j = {
22
+ }, M = {
23
23
  key: 1,
24
24
  role: "status"
25
- }, M = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
25
+ }, N = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
26
26
  __name: "menu.ce",
27
27
  props: {
28
28
  open: Boolean,
@@ -80,13 +80,13 @@ var D = [
80
80
  "update:checked",
81
81
  "check"
82
82
  ],
83
- setup(t, { emit: M }) {
84
- let N = t, P = M, { root: F, forwardedAttrs: I } = re(), [L, R] = u(N, "open", P), [z, he] = u(N, "modelValue", P), { checked: ge, check: _e } = l(N, P), B = S(null), V = S(null), H = S(""), U = S(null), { radiusAttrs: ve, radiusStyle: ye } = e(U, () => N.radius);
83
+ setup(t, { emit: N }) {
84
+ let P = t, F = N, { root: I, forwardedAttrs: L } = ae(), [R, _e] = c(P, "open", F), [z, ve] = c(P, "modelValue", F), { checked: ye, check: be } = s(P, F), B = b(null), V = b(null), H = b(""), U = b(null), { radiusAttrs: xe, radiusStyle: Se } = e(U, () => P.radius);
85
85
  r(B);
86
- let W = `kima-menu-${oe()}`, be = s(N), xe = d(() => ({
87
- ...be.value,
86
+ let W = `kima-menu-${ue()}`, Ce = a(P), we = l(() => ({
87
+ ...Ce.value,
88
88
  sideOffset: 4
89
- })), G = d(() => ne(N.items).find((e) => Object.is(e.value, z.value)) || null), K = d(() => N.iconOnly || N.variant === "icon"), Se = d(() => N.icon || ue), Ce = d(() => ["small", "default"].includes(N.size) ? N.size : "default");
89
+ })), G = l(() => ie(P.items).find((e) => Object.is(e.value, z.value)) || null), K = l(() => P.iconOnly || P.variant === "icon"), Te = l(() => P.icon || me), Ee = l(() => ["small", "default"].includes(P.size) ? P.size : "default");
90
90
  function q(e, t) {
91
91
  return e.flatMap((e) => {
92
92
  let n = e.children ? q(e.children, t) : [];
@@ -96,14 +96,14 @@ var D = [
96
96
  }] : [];
97
97
  });
98
98
  }
99
- let J = d(() => q(N.items, H.value.trim().toLocaleLowerCase()));
99
+ let J = l(() => q(P.items, H.value.trim().toLocaleLowerCase()));
100
100
  function Y(e) {
101
- e && N.disabled || (e && (H.value = ""), R(e));
101
+ e && P.disabled || (e && (H.value = ""), _e(e));
102
102
  }
103
- function we(e) {
104
- N.disabled || e.disabled || (Object.is(z.value, e.value) || (he(e.value), P("change", e.value)), P("select", e.value, e), Y(!1));
103
+ function De(e) {
104
+ P.disabled || e.disabled || (Object.is(z.value, e.value) || (ve(e.value), F("change", e.value)), F("select", e.value, e), Y(!1));
105
105
  }
106
- function Te(e) {
106
+ function Oe(e) {
107
107
  if (e.key === "Escape") e.preventDefault(), Y(!1), B.value?.focus();
108
108
  else if (e.key === "Tab") Y(!1);
109
109
  else if ([
@@ -112,56 +112,56 @@ var D = [
112
112
  "Enter"
113
113
  ].includes(e.key)) {
114
114
  e.preventDefault();
115
- let t = F.value.querySelectorAll("[role^=\"menuitem\"]:not([data-disabled])"), n = e.key === "ArrowUp" ? t[t.length - 1] : t[0];
115
+ let t = I.value.querySelectorAll("[role^=\"menuitem\"]:not([data-disabled])"), n = e.key === "ArrowUp" ? t[t.length - 1] : t[0];
116
116
  e.key === "Enter" ? n?.click() : n?.focus();
117
117
  }
118
118
  }
119
- w(() => N.disabled, (e) => {
119
+ C(() => P.disabled, (e) => {
120
120
  e && Y(!1);
121
- }), w(L, (e) => {
122
- e && N.searchable && v(() => V.value?.focus());
121
+ }), C(R, (e) => {
122
+ e && P.searchable && _(() => V.value?.focus());
123
123
  });
124
124
  let X = !1;
125
- function Ee(e) {
126
- return e.includes(F.value);
125
+ function ke(e) {
126
+ return e.includes(I.value);
127
127
  }
128
128
  function Z(e) {
129
- X && (e ? i(W, {
129
+ X && (e ? ee(W, {
130
130
  close: () => Y(!1),
131
- isInside: Ee
132
- }) : a(W));
131
+ isInside: ke
132
+ }) : i(W));
133
133
  }
134
- w(L, Z), b(() => {
135
- X = !0, Z(L.value);
136
- }), y(() => {
137
- X = !1, a(W);
134
+ C(R, Z), ce(() => {
135
+ X = !0, Z(R.value);
136
+ }), se(() => {
137
+ X = !1, i(W);
138
138
  });
139
- let Q = S(!1), $ = 0;
140
- return w(L, (e) => {
139
+ let Q = b(!1), $ = 0;
140
+ return C(R, (e) => {
141
141
  if (e) {
142
- $ += 1, Q.value = !1, o(F.value?.querySelector(".kima-menu__popup"));
142
+ $ += 1, Q.value = !1, te(I.value?.querySelector(".kima-menu__popup"));
143
143
  return;
144
144
  }
145
- if (!F.value?.querySelector(".kima-menu__popup")) return;
145
+ if (!I.value?.querySelector(".kima-menu__popup")) return;
146
146
  Q.value = !0;
147
- let t = F.value?.querySelector(".kima-menu__popup"), n = ++$;
148
- ee(t, () => {
147
+ let t = I.value?.querySelector(".kima-menu__popup"), n = ++$;
148
+ ne(t, () => {
149
149
  n === $ && (Q.value = !1);
150
150
  });
151
- }), (e, r) => (x(), m("div", _({
151
+ }), (e, r) => (y(), f("div", g({
152
152
  ref_key: "root",
153
- ref: F
154
- }, C(I), { class: ["kima-menu", {
155
- "kima-menu--open": C(L),
153
+ ref: I
154
+ }, S(L), { class: ["kima-menu", {
155
+ "kima-menu--open": S(R),
156
156
  "kima-menu--icon": K.value,
157
- [`kima-menu--${Ce.value}`]: !0
158
- }] }), [g(C(pe), {
159
- open: C(L) && !t.disabled,
157
+ [`kima-menu--${Ee.value}`]: !0
158
+ }] }), [m(S(E), {
159
+ open: S(R) && !t.disabled,
160
160
  modal: !1,
161
161
  "onUpdate:open": Y
162
162
  }, {
163
- default: T(() => [g(C(me), { "as-child": "" }, {
164
- default: T(() => [h("button", {
163
+ default: w(() => [m(S(D), { "as-child": "" }, {
164
+ default: w(() => [p("button", {
165
165
  ref_key: "trigger",
166
166
  ref: B,
167
167
  type: "button",
@@ -169,44 +169,44 @@ var D = [
169
169
  disabled: t.disabled,
170
170
  "aria-label": K.value ? t.label : void 0,
171
171
  title: K.value ? t.label : void 0
172
- }, [ie(e.$slots, "trigger", {
173
- open: C(L),
172
+ }, [x(e.$slots, "trigger", {
173
+ open: S(R),
174
174
  selectedItem: G.value,
175
- value: C(z)
176
- }, () => [K.value ? (x(), f(n, {
175
+ value: S(z)
176
+ }, () => [K.value ? (y(), u(n, {
177
177
  key: 0,
178
- icon: Se.value,
178
+ icon: Te.value,
179
179
  size: 20,
180
180
  "aria-hidden": "true"
181
- }, null, 8, ["icon"])) : (x(), m("span", O, ae(G.value?.label || t.label), 1))], !0), K.value ? p("", !0) : (x(), f(n, {
181
+ }, null, 8, ["icon"])) : (y(), f("span", k, le(G.value?.label || t.label), 1))], !0), K.value ? d("", !0) : (y(), u(n, {
182
182
  key: 0,
183
- icon: C(le),
183
+ icon: S(pe),
184
184
  size: 20,
185
185
  "aria-hidden": "true"
186
- }, null, 8, ["icon"]))], 8, D)]),
186
+ }, null, 8, ["icon"]))], 8, O)]),
187
187
  _: 3
188
- }), C(L) && !t.disabled || Q.value ? (x(), f(C(fe), _({
188
+ }), S(R) && !t.disabled || Q.value ? (y(), u(S(ge), g({
189
189
  key: 0,
190
190
  id: W,
191
191
  "force-mount": ""
192
- }, xe.value, { "as-child": "" }), {
193
- default: T(() => [h("div", _({
192
+ }, we.value, { "as-child": "" }), {
193
+ default: w(() => [p("div", g({
194
194
  ref_key: "popup",
195
195
  ref: U
196
- }, C(ve), {
197
- style: C(ye),
196
+ }, S(xe), {
197
+ style: S(Se),
198
198
  class: "kima-menu__popup",
199
199
  "aria-label": t.label,
200
- onEscapeKeyDown: r[3] ||= (e) => C(te)(e, () => Y(!1)),
200
+ onEscapeKeyDown: r[3] ||= (e) => S(re)(e, () => Y(!1)),
201
201
  onOpenAutoFocus: r[4] ||= (e) => {
202
- t.searchable && (e.preventDefault(), v(() => V.value?.focus()));
202
+ t.searchable && (e.preventDefault(), _(() => V.value?.focus()));
203
203
  }
204
204
  }), [
205
- t.searchable ? (x(), m("div", A, [g(n, {
206
- icon: C(de),
205
+ t.searchable ? (y(), f("div", j, [m(n, {
206
+ icon: S(he),
207
207
  size: 18,
208
208
  "aria-hidden": "true"
209
- }, null, 8, ["icon"]), ce(h("input", {
209
+ }, null, 8, ["icon"]), fe(p("input", {
210
210
  ref_key: "searchInput",
211
211
  ref: V,
212
212
  "onUpdate:modelValue": r[0] ||= (e) => H.value = e,
@@ -214,31 +214,35 @@ var D = [
214
214
  class: "kima-menu__search",
215
215
  role: "searchbox",
216
216
  "aria-label": "搜索菜单项",
217
- onInput: r[1] ||= E(() => {}, ["stop"]),
218
- onChange: r[2] ||= E(() => {}, ["stop"]),
219
- onKeydown: E(Te, ["stop"])
220
- }, null, 544), [[se, H.value]])])) : p("", !0),
221
- g(c, {
217
+ onInput: r[1] ||= T(() => {}, ["stop"]),
218
+ onChange: r[2] ||= T(() => {}, ["stop"]),
219
+ onKeydown: T(Oe, ["stop"])
220
+ }, null, 544), [[de, H.value]])])) : d("", !0),
221
+ m(o, {
222
222
  items: J.value,
223
- checked: C(ge),
224
- "model-value": C(z),
223
+ checked: S(ye),
224
+ "model-value": S(z),
225
225
  selection: "",
226
226
  disabled: t.disabled,
227
- onSelect: we,
228
- onCheck: C(_e)
229
- }, null, 8, [
227
+ onSelect: De,
228
+ onCheck: S(be)
229
+ }, oe({ _: 2 }, [e.$slots.item ? {
230
+ name: "item",
231
+ fn: w((t) => [x(e.$slots, "item", v(h(t)), void 0, !0)]),
232
+ key: "0"
233
+ } : void 0]), 1032, [
230
234
  "items",
231
235
  "checked",
232
236
  "model-value",
233
237
  "disabled",
234
238
  "onCheck"
235
239
  ]),
236
- J.value.length ? p("", !0) : (x(), m("div", j, "没有匹配项目"))
237
- ], 16, k)]),
238
- _: 1
239
- }, 16)) : p("", !0)]),
240
+ J.value.length ? d("", !0) : (y(), f("div", M, "没有匹配项目"))
241
+ ], 16, A)]),
242
+ _: 3
243
+ }, 16)) : d("", !0)]),
240
244
  _: 3
241
245
  }, 8, ["open"])], 16));
242
246
  }
243
- }), [["__scopeId", "data-v-16ed5f4d"]]);
244
- export { M as default };
247
+ }), [["__scopeId", "data-v-6cc90694"]]);
248
+ export { N as default };
@@ -53,40 +53,39 @@ var y = ["disabled", "aria-expanded"], b = {
53
53
  emits: [
54
54
  "update:modelValue",
55
55
  "update:open",
56
+ "change",
56
57
  "submit",
57
58
  "focus",
58
59
  "blur"
59
60
  ],
60
61
  setup(t, { emit: v }) {
61
- let w = t, T = v, { root: E, forwardedAttrs: D, hasNativeSlot: O } = i(), { radiusAttrs: k, radiusStyle: A } = e(E, () => w.radius), [j, M] = r(w, "open", T), N = p(!1), P = a(() => w.open !== null && w.open !== void 0), F = a(() => P.value ? j.value : N.value), I = a(() => typeof w.width == "number" || /^\d+(\.\d+)?$/.test(String(w.width).trim()) ? `${Math.max(0, Number(w.width))}px` : w.width), L = p(null), R = p(w.modelValue), z = !1;
62
+ let w = t, T = v, { root: E, forwardedAttrs: D, hasNativeSlot: O } = i(), { radiusAttrs: k, radiusStyle: A } = e(E, () => w.radius), [j, M] = r(w, "open", T, { claim: (e, t) => t && e != null }), N = a(() => typeof w.width == "number" || /^\d+(\.\d+)?$/.test(String(w.width).trim()) ? `${Math.max(0, Number(w.width))}px` : w.width), P = p(null), F = p(w.modelValue), I = !1;
62
63
  g(() => w.modelValue, (e) => {
63
- e !== R.value && (R.value = e);
64
+ e !== F.value && (F.value = e);
64
65
  });
65
- function B(e) {
66
- P.value ? M(e) : (N.value = e, T("update:open", e));
66
+ let L = M;
67
+ function R() {
68
+ w.disabled || j.value || (L(!0), d(() => P.value?.focus()));
67
69
  }
68
- function V() {
69
- w.disabled || F.value || (B(!0), d(() => L.value?.focus()));
70
+ function z() {
71
+ j.value && (L(!1), P.value?.blur());
70
72
  }
71
- function H() {
72
- F.value && (B(!1), L.value?.blur());
73
+ function B() {
74
+ j.value ? z() : R();
73
75
  }
74
- function U() {
75
- F.value ? H() : V();
76
- }
77
- g(F, (e) => {
78
- e || L.value?.blur();
76
+ g(j, (e) => {
77
+ e || P.value?.blur();
79
78
  });
80
- function W(e) {
81
- z || e.isComposing || e.target.value === R.value || (R.value = e.target.value, T("update:modelValue", R.value));
79
+ function V(e) {
80
+ I || e.isComposing || e.target.value === F.value || (F.value = e.target.value, T("update:modelValue", F.value));
82
81
  }
83
- function G(e) {
84
- e.key === "Escape" ? (e.preventDefault(), H()) : e.key === "Enter" ? T("submit", R.value) : e.stopPropagation();
82
+ function H(e) {
83
+ e.key === "Escape" ? (e.preventDefault(), z()) : e.key === "Enter" ? T("submit", F.value) : e.stopPropagation();
85
84
  }
86
- function K(e) {
85
+ function U(e) {
87
86
  T("focus", e);
88
87
  }
89
- function q(e) {
88
+ function W(e) {
90
89
  T("blur", e);
91
90
  }
92
91
  return (e, r) => (f(), o("button", u({
@@ -97,11 +96,11 @@ var y = ["disabled", "aria-expanded"], b = {
97
96
  ...h(k)
98
97
  }, {
99
98
  type: "button",
100
- class: ["kima-morph-field", { "kima-morph-field--active": F.value }],
101
- style: [{ "--kima-morph-field-open": I.value }, h(A)],
99
+ class: ["kima-morph-field", { "kima-morph-field--active": h(j) }],
100
+ style: [{ "--kima-morph-field-open": N.value }, h(A)],
102
101
  disabled: t.disabled,
103
- "aria-expanded": F.value ? "true" : "false",
104
- onClick: U
102
+ "aria-expanded": h(j) ? "true" : "false",
103
+ onClick: B
105
104
  }), [
106
105
  s("span", b, [c(n, {
107
106
  icon: t.icon,
@@ -109,31 +108,31 @@ var y = ["disabled", "aria-expanded"], b = {
109
108
  }, null, 8, ["icon"])]),
110
109
  s("span", x, [s("input", {
111
110
  ref_key: "input",
112
- ref: L,
111
+ ref: P,
113
112
  type: "text",
114
- value: R.value,
113
+ value: F.value,
115
114
  placeholder: t.placeholder,
116
- tabindex: F.value ? 0 : -1,
115
+ tabindex: h(j) ? 0 : -1,
117
116
  "aria-label": t.label || t.placeholder || void 0,
118
117
  onClick: r[0] ||= _(() => {}, ["stop"]),
119
- onInput: _(W, ["stop"]),
120
- onCompositionstart: r[1] ||= (e) => l(z) ? z.value = !0 : z = !0,
118
+ onInput: _(V, ["stop"]),
119
+ onCompositionstart: r[1] ||= (e) => l(I) ? I.value = !0 : I = !0,
121
120
  onCompositionend: r[2] ||= (e) => {
122
- l(z) ? z.value = !1 : z = !1, W(e);
121
+ l(I) ? I.value = !1 : I = !1, V(e);
123
122
  },
124
- onKeydown: G,
125
- onFocus: K,
126
- onBlur: q
123
+ onKeydown: H,
124
+ onFocus: U,
125
+ onBlur: W
127
126
  }, null, 40, S)]),
128
- e.$slots.action || h(O)("action") ? (f(), o("span", C, [m(e.$slots, "action", { close: H }, void 0, !0)])) : (f(), o("span", {
127
+ e.$slots.action || h(O)("action") ? (f(), o("span", C, [m(e.$slots, "action", { close: z }, void 0, !0)])) : (f(), o("span", {
129
128
  key: 1,
130
129
  class: "kima-morph-field__action kima-morph-field__cancel",
131
130
  role: "button",
132
131
  tabindex: "-1",
133
132
  "aria-hidden": "true",
134
- onClick: _(H, ["stop"])
133
+ onClick: _(z, ["stop"])
135
134
  }, "取消"))
136
135
  ], 16, y));
137
136
  }
138
- }), [["__scopeId", "data-v-ac757a01"]]);
137
+ }), [["__scopeId", "data-v-d8ed6708"]]);
139
138
  export { w as default };