@kernel4632/kima 0.9.7 → 0.9.9

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 (24) hide show
  1. package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_1b1702a6_lang.css +1 -0
  2. package/dist/components/display/timeline.ce.vue_vue_type_style_index_0_scoped_3cffd2b4_lang.css +1 -0
  3. package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_0b8ec686_lang.css +1 -0
  4. package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_de9894bd_lang.css +1 -0
  5. package/dist/kima-elements-core.js +71 -50
  6. package/dist/kima-elements.js +13659 -13606
  7. package/dist/style.css +5 -5
  8. package/dist/styles/_tokens.css +1 -1
  9. package/dist/styles/list.css +1 -1
  10. package/dist/styles/multi-select.css +1 -1
  11. package/dist/styles/tag-group.css +1 -1
  12. package/dist/styles/timeline.css +1 -1
  13. package/dist/vue/components/display/list.ce.js +12 -26
  14. package/dist/vue/components/display/timeline.ce.js +28 -35
  15. package/dist/vue/components/interaction/multi-select.ce.js +96 -94
  16. package/dist/vue/components/utility/tag-group.ce.js +46 -53
  17. package/dist/vue/utils/collection.js +15 -0
  18. package/dist/vue/utils/content-motion.js +80 -48
  19. package/dist/vue/utils/motion.js +137 -106
  20. package/package.json +1 -1
  21. package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_df3ec98f_lang.css +0 -1
  22. package/dist/components/display/timeline.ce.vue_vue_type_style_index_0_scoped_72323605_lang.css +0 -1
  23. package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_cf70a212_lang.css +0 -1
  24. package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_b575c982_lang.css +0 -1
@@ -1,43 +1,43 @@
1
1
  import e from "../../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "../core/button.ce.js";
3
3
  import n from "../core/icon.ce.js";
4
- import { freezeLeaveLayout as r, presenceTransition as i } from "../../utils/motion.js";
5
- import { dismissInteraction as ee, useChoiceCursor as te, useInteractionModel as a, useInteractionReset as ne, useInteractionRoot as re, usePlacement as ie } from "../../utils/interaction.js";
6
- import ae from "../core/icon-button.ce.js";
7
- import { useContentMotion as o } from "../../utils/content-motion.js";
4
+ import { presenceTransition as r } from "../../utils/motion.js";
5
+ import { dismissInteraction as i, useChoiceCursor as ee, useInteractionModel as a, useInteractionReset as te, useInteractionRoot as ne, usePlacement as re } from "../../utils/interaction.js";
6
+ import ie from "../core/icon-button.ce.js";
7
+ import { useCollectionMotion as ae } from "../../utils/content-motion.js";
8
8
  import oe from "./chip.ce.js";
9
9
  /* empty css */
10
- import { Fragment as s, Transition as c, TransitionGroup as se, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, mergeProps as g, nextTick as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, useId as ce, vModelText as le, watch as ue, withCtx as C, withDirectives as de, withKeys as fe, withModifiers as w } from "vue";
11
- import { PopoverContent as pe, PopoverRoot as me, PopoverTrigger as he } from "reka-ui";
12
- import { Cancel01Icon as ge, Tick01Icon as _e } from "@hugeicons/core-free-icons";
10
+ import { Fragment as o, Transition as s, TransitionGroup as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, mergeProps as g, nextTick as _, openBlock as v, ref as y, renderList as b, toDisplayString as x, unref as S, useId as se, vModelText as ce, watch as le, withCtx as C, withDirectives as ue, withKeys as de, withModifiers as w } from "vue";
11
+ import { PopoverContent as fe, PopoverRoot as pe, PopoverTrigger as me } from "reka-ui";
12
+ import { Cancel01Icon as he, Tick01Icon as ge } from "@hugeicons/core-free-icons";
13
13
  // src/components/interaction/multi-select.ce.vue
14
- var ve = { class: "kima-multi-select__control" }, T = ["aria-activedescendant"], E = [
14
+ var _e = ["data-kima-flip-key"], ve = { class: "kima-multi-select__control" }, T = ["aria-activedescendant"], ye = [
15
15
  "aria-label",
16
16
  "tabindex",
17
17
  "aria-activedescendant"
18
- ], D = [
18
+ ], E = [
19
19
  "id",
20
20
  "aria-selected",
21
21
  "aria-disabled",
22
22
  "data-active",
23
23
  "onPointermove",
24
24
  "onClick"
25
- ], O = { key: 0 }, k = {
25
+ ], D = { key: 0 }, O = {
26
26
  key: 1,
27
27
  role: "status"
28
- }, A = {
28
+ }, k = {
29
29
  key: 0,
30
30
  class: "kima-multi-select__clear"
31
- }, j = [
31
+ }, A = [
32
32
  "name",
33
33
  "required",
34
34
  "disabled"
35
- ], M = [
35
+ ], j = [
36
36
  "value",
37
37
  "data-index",
38
38
  "disabled",
39
39
  "selected"
40
- ], N = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
40
+ ], M = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
41
41
  __name: "multi-select.ce",
42
42
  props: {
43
43
  modelValue: {
@@ -78,64 +78,66 @@ var ve = { class: "kima-multi-select__control" }, T = ["aria-activedescendant"],
78
78
  "update:open",
79
79
  "change"
80
80
  ],
81
- setup(e, { emit: N }) {
82
- let P = e, F = N, { root: I, attrs: ye, forwardedAttrs: be } = re(), [L, R] = a(P, "modelValue", F), [z, xe] = a(P, "open", F), Se = ie(P), B = y(""), V = y(null), H = y(null), U = `kima-multi-select-${ce()}`, W = l(() => Array.isArray(L.value) ? L.value : []), G = l(() => P.items.filter((e) => W.value.includes(e.value))), K = l(() => P.items.filter((e) => `${e.label} ${e.description || ""}`.toLocaleLowerCase().includes(B.value.trim().toLocaleLowerCase())));
83
- y(null), o(I, () => G.value);
84
- function q(e) {
85
- P.disabled || (R(e), F("change", [...e]));
86
- }
81
+ setup(e, { emit: M }) {
82
+ let N = e, P = M, { root: F, attrs: be, forwardedAttrs: xe } = ne(), [I, L] = a(N, "modelValue", P), [R, Se] = a(N, "open", P), Ce = re(N), z = y(""), B = y(null), V = y(null), H = `kima-multi-select-${se()}`, U = l(() => Array.isArray(I.value) ? I.value : []), W = l(() => N.items.filter((e) => U.value.includes(e.value))), G = l(() => N.items.filter((e) => `${e.label} ${e.description || ""}`.toLocaleLowerCase().includes(z.value.trim().toLocaleLowerCase()))), K = y(null), q = y(null), we = ae(K, () => W.value, q);
87
83
  function J(e) {
88
- P.disabled || e.disabled || q(W.value.includes(e.value) ? W.value.filter((t) => !Object.is(t, e.value)) : [...W.value, e.value]);
84
+ N.disabled || (L(e), P("change", [...e]));
85
+ }
86
+ function Y(e) {
87
+ N.disabled || e.disabled || J(U.value.includes(e.value) ? U.value.filter((t) => !Object.is(t, e.value)) : [...U.value, e.value]);
89
88
  }
90
- function Ce(e) {
91
- e.disabled || q(W.value.filter((t) => !Object.is(t, e.value)));
89
+ function Te(e) {
90
+ e.disabled || J(U.value.filter((t) => !Object.is(t, e.value)));
92
91
  }
93
- function we() {
94
- q(P.items.filter((e) => e.disabled && W.value.includes(e.value)).map((e) => e.value));
92
+ function Ee() {
93
+ J(N.items.filter((e) => e.disabled && U.value.includes(e.value)).map((e) => e.value));
95
94
  }
96
- function Y(e) {
97
- e && P.disabled || (e && !z.value && (B.value = ""), xe(e));
95
+ function X(e) {
96
+ e && N.disabled || (e && !R.value && (z.value = ""), Se(e));
98
97
  }
99
- let { active: X, activeId: Z, highlight: Q, keydown: Te } = te(K, J, `${U}-option`);
98
+ let { active: Z, activeId: Q, highlight: De, keydown: Oe } = ee(G, Y, `${H}-option`);
100
99
  function $(e) {
101
100
  if (!e.isComposing) {
102
- if (e.key === " " && !P.searchable) {
101
+ if (e.key === " " && !N.searchable) {
103
102
  e.preventDefault();
104
- let t = K.value[X.value];
105
- t && J(t);
106
- } else Te(e);
103
+ let t = G.value[Z.value];
104
+ t && Y(t);
105
+ } else Oe(e);
107
106
  }
108
107
  }
109
- function Ee(e) {
108
+ function ke(e) {
110
109
  e.preventDefault(), _(() => {
111
- z.value && !P.disabled && (P.searchable ? V.value : H.value)?.focus();
110
+ R.value && !N.disabled && (N.searchable ? B.value : V.value)?.focus();
112
111
  });
113
112
  }
114
- function De(e) {
115
- q([...e.target.selectedOptions].map((e) => P.items[Number(e.dataset.index)].value));
113
+ function Ae(e) {
114
+ J([...e.target.selectedOptions].map((e) => N.items[Number(e.dataset.index)].value));
116
115
  }
117
- return ne(I, L, R, () => Y(!1)), ue(() => P.disabled, (e) => {
118
- e && Y(!1);
119
- }), (te, a) => (v(), f("div", g({
116
+ return te(F, I, L, () => X(!1)), le(() => N.disabled, (e) => {
117
+ e && X(!1);
118
+ }), (ee, a) => (v(), f("div", g({
120
119
  ref_key: "root",
121
- ref: I
122
- }, S(be), { class: "kima-multi-select" }), [
123
- h(se, g({
124
- tag: "div",
125
- name: "kima-list"
126
- }, {
127
- ...S(i),
128
- onBeforeLeave: S(r)
129
- }, { class: "kima-multi-select__chips" }), {
130
- default: C(() => [(v(!0), f(s, null, b(G.value, (t) => (v(), f("span", {
120
+ ref: F
121
+ }, S(xe), { class: "kima-multi-select" }), [
122
+ p("div", {
123
+ ref_key: "chipArea",
124
+ ref: K,
125
+ class: "kima-multi-select__chip-area"
126
+ }, [h(c, g({
127
+ ref_key: "chips",
128
+ ref: q,
129
+ tag: "div"
130
+ }, S(we), { class: ["kima-multi-select__chips", { "kima-multi-select__chips--populated": W.value.length }] }), {
131
+ default: C(() => [(v(!0), f(o, null, b(W.value, (t) => (v(), f("span", {
131
132
  key: t.value,
133
+ "data-kima-flip-key": t.value,
132
134
  class: "kima-multi-select__chip"
133
135
  }, [h(oe, {
134
136
  removable: "",
135
137
  label: t.label,
136
138
  disabled: e.disabled || t.disabled,
137
139
  value: t.value,
138
- onRemove: (e) => Ce(t)
140
+ onRemove: (e) => Te(t)
139
141
  }, {
140
142
  default: C(() => [m(x(t.label), 1)]),
141
143
  _: 2
@@ -144,23 +146,23 @@ var ve = { class: "kima-multi-select__control" }, T = ["aria-activedescendant"],
144
146
  "disabled",
145
147
  "value",
146
148
  "onRemove"
147
- ])]))), 128))]),
149
+ ])], 8, _e))), 128))]),
148
150
  _: 1
149
- }, 16),
150
- p("div", ve, [h(S(me), {
151
- open: S(z) && !e.disabled,
151
+ }, 16, ["class"])], 512),
152
+ p("div", ve, [h(S(pe), {
153
+ open: S(R) && !e.disabled,
152
154
  modal: !1,
153
- "onUpdate:open": Y
155
+ "onUpdate:open": X
154
156
  }, {
155
- default: C(() => [h(S(he), { "as-child": "" }, {
157
+ default: C(() => [h(S(me), { "as-child": "" }, {
156
158
  default: C(() => [h(t, {
157
159
  variant: "tonal",
158
160
  disabled: e.disabled,
159
- "aria-label": S(ye)["aria-label"] || e.label,
161
+ "aria-label": S(be)["aria-label"] || e.label,
160
162
  "aria-required": e.required || void 0,
161
- onKeydown: a[0] ||= fe(w((e) => Y(!0), ["prevent"]), ["down"])
163
+ onKeydown: a[0] ||= de(w((e) => X(!0), ["prevent"]), ["down"])
162
164
  }, {
163
- default: C(() => [m(x(G.value.length ? `已选择 ${G.value.length} 项` : e.placeholder), 1)]),
165
+ default: C(() => [m(x(W.value.length ? `已选择 ${W.value.length} 项` : e.placeholder), 1)]),
164
166
  _: 1
165
167
  }, 8, [
166
168
  "disabled",
@@ -168,77 +170,77 @@ var ve = { class: "kima-multi-select__control" }, T = ["aria-activedescendant"],
168
170
  "aria-required"
169
171
  ])]),
170
172
  _: 1
171
- }), h(c, g({ name: "kima-popup" }, S(i)), {
172
- default: C(() => [S(z) && !e.disabled ? (v(), u(S(pe), g({
173
+ }), h(s, g({ name: "kima-popup" }, S(r)), {
174
+ default: C(() => [S(R) && !e.disabled ? (v(), u(S(fe), g({
173
175
  key: 0,
174
176
  "force-mount": ""
175
- }, S(Se), {
177
+ }, S(Ce), {
176
178
  class: "kima-multi-select__popup",
177
179
  "aria-label": e.label,
178
- onOpenAutoFocus: Ee,
179
- onEscapeKeyDown: a[5] ||= (e) => S(ee)(e, () => Y(!1))
180
+ onOpenAutoFocus: ke,
181
+ onEscapeKeyDown: a[5] ||= (e) => S(i)(e, () => X(!1))
180
182
  }), {
181
183
  default: C(() => [
182
- e.searchable ? de((v(), f("input", {
184
+ e.searchable ? ue((v(), f("input", {
183
185
  key: 0,
184
186
  ref_key: "search",
185
- ref: V,
186
- "onUpdate:modelValue": a[1] ||= (e) => B.value = e,
187
+ ref: B,
188
+ "onUpdate:modelValue": a[1] ||= (e) => z.value = e,
187
189
  class: "kima-multi-select__search",
188
190
  type: "search",
189
191
  role: "combobox",
190
192
  "aria-expanded": "true",
191
193
  "aria-autocomplete": "list",
192
194
  "aria-label": "搜索选项",
193
- "aria-controls": U,
194
- "aria-activedescendant": S(Z),
195
+ "aria-controls": H,
196
+ "aria-activedescendant": S(Q),
195
197
  onKeydown: $,
196
198
  onInput: a[2] ||= w(() => {}, ["stop"]),
197
199
  onChange: a[3] ||= w(() => {}, ["stop"])
198
- }, null, 40, T)), [[le, B.value]]) : d("", !0),
200
+ }, null, 40, T)), [[ce, z.value]]) : d("", !0),
199
201
  p("div", {
200
- id: U,
202
+ id: H,
201
203
  ref_key: "panel",
202
- ref: H,
204
+ ref: V,
203
205
  class: "kima-multi-select__list",
204
206
  role: "listbox",
205
207
  "aria-multiselectable": "true",
206
208
  "aria-label": e.label,
207
209
  tabindex: e.searchable ? -1 : 0,
208
- "aria-activedescendant": e.searchable ? void 0 : S(Z),
210
+ "aria-activedescendant": e.searchable ? void 0 : S(Q),
209
211
  onKeydown: $
210
- }, [(v(!0), f(s, null, b(K.value, (e, t) => (v(), f("div", {
211
- id: `${U}-option-${t}`,
212
+ }, [(v(!0), f(o, null, b(G.value, (e, t) => (v(), f("div", {
213
+ id: `${H}-option-${t}`,
212
214
  key: e.value,
213
215
  class: "kima-multi-select__item",
214
216
  role: "option",
215
- "aria-selected": W.value.includes(e.value),
217
+ "aria-selected": U.value.includes(e.value),
216
218
  "aria-disabled": e.disabled || void 0,
217
- "data-active": S(X) === t,
219
+ "data-active": S(Z) === t,
218
220
  onPointerdown: a[4] ||= w(() => {}, ["prevent"]),
219
- onPointermove: (n) => !e.disabled && S(Q)(t),
220
- onClick: (t) => J(e)
221
- }, [p("span", null, [m(x(e.label), 1), e.description ? (v(), f("small", O, x(e.description), 1)) : d("", !0)]), W.value.includes(e.value) ? (v(), u(n, {
221
+ onPointermove: (n) => !e.disabled && S(De)(t),
222
+ onClick: (t) => Y(e)
223
+ }, [p("span", null, [m(x(e.label), 1), e.description ? (v(), f("small", D, x(e.description), 1)) : d("", !0)]), U.value.includes(e.value) ? (v(), u(n, {
222
224
  key: 0,
223
- icon: S(_e),
225
+ icon: S(ge),
224
226
  size: 20,
225
227
  "aria-hidden": "true"
226
- }, null, 8, ["icon"])) : d("", !0)], 40, D))), 128))], 40, E),
227
- K.value.length ? d("", !0) : (v(), f("p", k, "没有匹配选项"))
228
+ }, null, 8, ["icon"])) : d("", !0)], 40, E))), 128))], 40, ye),
229
+ G.value.length ? d("", !0) : (v(), f("p", O, "没有匹配选项"))
228
230
  ]),
229
231
  _: 1
230
232
  }, 16, ["aria-label"])) : d("", !0)]),
231
233
  _: 1
232
234
  }, 16)]),
233
235
  _: 1
234
- }, 8, ["open"]), h(c, g({ name: "kima-content" }, S(i)), {
235
- default: C(() => [e.clearable && G.value.length ? (v(), f("span", A, [h(ae, {
236
+ }, 8, ["open"]), h(s, g({ name: "kima-content" }, S(r)), {
237
+ default: C(() => [e.clearable && W.value.length ? (v(), f("span", k, [h(ie, {
236
238
  label: "清除选择",
237
239
  disabled: e.disabled,
238
- onClick: we
240
+ onClick: Ee
239
241
  }, {
240
242
  default: C(() => [h(n, {
241
- icon: S(ge),
243
+ icon: S(he),
242
244
  size: 20
243
245
  }, null, 8, ["icon"])]),
244
246
  _: 1
@@ -254,16 +256,16 @@ var ve = { class: "kima-multi-select__control" }, T = ["aria-activedescendant"],
254
256
  tabindex: "-1",
255
257
  "aria-hidden": "true",
256
258
  onInput: a[6] ||= w(() => {}, ["stop"]),
257
- onChange: w(De, ["stop"]),
258
- onInvalid: a[7] ||= w((e) => S(I)?.querySelector("button")?.focus(), ["prevent"])
259
- }, [(v(!0), f(s, null, b(e.items, (e, t) => (v(), f("option", {
259
+ onChange: w(Ae, ["stop"]),
260
+ onInvalid: a[7] ||= w((e) => S(F)?.querySelector("button")?.focus(), ["prevent"])
261
+ }, [(v(!0), f(o, null, b(e.items, (e, t) => (v(), f("option", {
260
262
  key: e.value,
261
263
  value: String(e.value),
262
264
  "data-index": t,
263
265
  disabled: e.disabled,
264
- selected: W.value.includes(e.value)
265
- }, x(e.label), 9, M))), 128))], 40, j)
266
+ selected: U.value.includes(e.value)
267
+ }, x(e.label), 9, j))), 128))], 40, A)
266
268
  ], 16));
267
269
  }
268
- }), [["__scopeId", "data-v-cf70a212"]]);
269
- export { N as default };
270
+ }), [["__scopeId", "data-v-0b8ec686"]]);
271
+ export { M as default };
@@ -1,16 +1,15 @@
1
1
  import e from "../../_virtual/_plugin-vue_export-helper.js";
2
- import { freezeLeaveLayout as t, presenceTransition as n, useLayoutFlip as r } from "../../utils/motion.js";
3
- import { useInteractionModel as i, useInteractionReset as a, useInteractionRoot as o } from "../../utils/interaction.js";
4
- import { useContentMotion as s } from "../../utils/content-motion.js";
5
- import c from "../interaction/chip.ce.js";
2
+ import { useInteractionModel as t, useInteractionReset as n, useInteractionRoot as r } from "../../utils/interaction.js";
3
+ import { useCollectionMotion as i } from "../../utils/content-motion.js";
4
+ import a from "../interaction/chip.ce.js";
6
5
  /* empty css */
7
- import { Fragment as l, TransitionGroup as u, computed as d, createBlock as f, createElementBlock as p, createVNode as m, mergeProps as h, nextTick as g, onMounted as _, openBlock as v, ref as y, renderList as b, unref as x, watch as S, withCtx as C } from "vue";
6
+ import { Fragment as o, TransitionGroup as s, computed as c, createBlock as l, createElementBlock as u, createVNode as d, mergeProps as f, nextTick as p, onMounted as m, openBlock as h, ref as g, renderList as _, unref as v, watch as y, withCtx as b } from "vue";
8
7
  // src/components/utility/tag-group.ce.vue
9
- var w = ["aria-label"], T = [
8
+ var x = ["aria-label"], S = [
10
9
  "name",
11
10
  "value",
12
11
  "disabled"
13
- ], E = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
12
+ ], C = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
14
13
  __name: "tag-group.ce",
15
14
  props: {
16
15
  items: {
@@ -36,68 +35,62 @@ var w = ["aria-label"], T = [
36
35
  "change",
37
36
  "remove"
38
37
  ],
39
- setup(e, { emit: E }) {
40
- let D = e, O = E, { root: k, forwardedAttrs: A } = o(), [j, M] = i(D, "items", O), [N, P] = i(D, "modelValue", O), F = y(0), I = d(() => j.value.map((e) => typeof e == "object" ? e : {
38
+ setup(e, { emit: C }) {
39
+ let w = e, T = C, { root: E, forwardedAttrs: D } = r(), [O, k] = t(w, "items", T), [A, j] = t(w, "modelValue", T), M = g(0), N = c(() => O.value.map((e) => typeof e == "object" ? e : {
41
40
  value: e,
42
41
  label: String(e)
43
- }));
44
- s(k, () => I.value);
45
- let L = y(null), R = r(L, "[data-kima-flip-key]"), z = (e) => N.value.includes(e.value);
46
- function B(e) {
47
- D.disabled || e.disabled || (P(z(e) ? N.value.filter((t) => t !== e.value) : [...N.value, e.value]), O("change", N.value));
42
+ })), P = g(null), F = i(E, () => N.value, P), I = (e) => A.value.includes(e.value);
43
+ function L(e) {
44
+ w.disabled || e.disabled || (j(I(e) ? A.value.filter((t) => t !== e.value) : [...A.value, e.value]), T("change", A.value));
48
45
  }
49
- function V() {
50
- return [...k.value?.querySelectorAll("button:not(:disabled)") || []].filter((e) => !e.closest("[inert]"));
46
+ function R() {
47
+ return [...E.value?.querySelectorAll("button:not(:disabled)") || []].filter((e) => !e.closest("[inert]"));
51
48
  }
52
- async function H(e = !1) {
53
- await g();
54
- let t = V();
55
- F.value = Math.max(0, Math.min(F.value, t.length - 1)), t.forEach((e, t) => {
56
- e.tabIndex = t === F.value ? 0 : -1;
57
- }), e && t[F.value]?.focus();
49
+ async function z(e = !1) {
50
+ await p();
51
+ let t = R();
52
+ M.value = Math.max(0, Math.min(M.value, t.length - 1)), t.forEach((e, t) => {
53
+ e.tabIndex = t === M.value ? 0 : -1;
54
+ }), e && t[M.value]?.focus();
58
55
  }
59
- function U(e) {
60
- D.disabled || e.disabled || (R.capture(), M(j.value.filter((t) => (typeof t == "object" ? t.value : t) !== e.value)), P(N.value.filter((t) => t !== e.value)), O("remove", e), R.play(), H(!0));
56
+ function B(e) {
57
+ w.disabled || e.disabled || (k(O.value.filter((t) => (typeof t == "object" ? t.value : t) !== e.value)), j(A.value.filter((t) => t !== e.value)), T("remove", e), z(!0));
61
58
  }
62
- function W(e) {
63
- let t = V(), n = t.indexOf(e.target);
59
+ function V(e) {
60
+ let t = R(), n = t.indexOf(e.target);
64
61
  if (!(n < 0) && ([
65
62
  "ArrowRight",
66
63
  "ArrowLeft",
67
64
  "Home",
68
65
  "End"
69
- ].includes(e.key) && (e.preventDefault(), F.value = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowLeft" ? -1 : 1) + t.length) % t.length, H(!0)), ["Delete", "Backspace"].includes(e.key) && D.removable)) {
66
+ ].includes(e.key) && (e.preventDefault(), M.value = e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowLeft" ? -1 : 1) + t.length) % t.length, z(!0)), ["Delete", "Backspace"].includes(e.key) && w.removable)) {
70
67
  let t = e.target.closest("[data-tag-index]")?.dataset.tagIndex;
71
- t != null && (e.preventDefault(), U(I.value[Number(t)]));
68
+ t != null && (e.preventDefault(), B(N.value[Number(t)]));
72
69
  }
73
70
  }
74
- return S([
75
- I,
76
- () => D.disabled,
77
- () => D.selectable,
78
- () => D.removable
79
- ], () => H(), {
71
+ return y([
72
+ N,
73
+ () => w.disabled,
74
+ () => w.selectable,
75
+ () => w.removable
76
+ ], () => z(), {
80
77
  immediate: !0,
81
78
  flush: "post"
82
- }), _(() => H()), a(k, N, P), a(k, j, M), (r, i) => (v(), p("div", h({
79
+ }), m(() => z()), n(E, A, j), n(E, O, k), (t, n) => (h(), u("div", f({
83
80
  ref_key: "root",
84
- ref: k
85
- }, x(A), {
81
+ ref: E
82
+ }, v(D), {
86
83
  class: "kima-tag-group",
87
84
  role: "group",
88
85
  "aria-label": e.label,
89
- onKeydown: W
90
- }), [m(u, h({
86
+ onKeydown: V
87
+ }), [d(s, f({
91
88
  ref_key: "flipRoot",
92
- ref: L,
93
- name: "kima-list",
89
+ ref: P,
94
90
  tag: "div",
95
91
  class: "kima-tag-group__items"
96
- }, {
97
- ...x(n),
98
- onBeforeLeave: x(t)
99
- }), {
100
- default: C(() => [(v(!0), p(l, null, b(I.value, (t, n) => (v(), f(c, {
92
+ }, v(F)), {
93
+ default: b(() => [(h(!0), u(o, null, _(N.value, (t, n) => (h(), l(a, {
101
94
  key: t.value,
102
95
  "data-kima-flip-key": t.value,
103
96
  "data-tag-index": n,
@@ -106,9 +99,9 @@ var w = ["aria-label"], T = [
106
99
  selectable: e.selectable,
107
100
  removable: e.removable,
108
101
  disabled: e.disabled || t.disabled,
109
- "model-value": z(t),
110
- onChange: (e) => B(t),
111
- onRemove: (e) => U(t)
102
+ "model-value": I(t),
103
+ onChange: (e) => L(t),
104
+ onRemove: (e) => B(t)
112
105
  }, null, 8, [
113
106
  "data-kima-flip-key",
114
107
  "data-tag-index",
@@ -122,13 +115,13 @@ var w = ["aria-label"], T = [
122
115
  "onRemove"
123
116
  ]))), 128))]),
124
117
  _: 1
125
- }, 16), (v(!0), p(l, null, b(x(N), (t) => (v(), p("input", {
118
+ }, 16), (h(!0), u(o, null, _(v(A), (t) => (h(), u("input", {
126
119
  key: t,
127
120
  type: "hidden",
128
121
  name: e.name,
129
122
  value: t,
130
123
  disabled: e.disabled
131
- }, null, 8, T))), 128))], 16, w));
124
+ }, null, 8, S))), 128))], 16, x));
132
125
  }
133
- }), [["__scopeId", "data-v-b575c982"]]);
134
- export { E as default };
126
+ }), [["__scopeId", "data-v-de9894bd"]]);
127
+ export { C as default };
@@ -0,0 +1,15 @@
1
+ import { toRaw as e } from "vue";
2
+ // src/utils/collection.js
3
+ function t(t) {
4
+ let n = /* @__PURE__ */ new WeakMap(), r = 0;
5
+ return function(i, a) {
6
+ let o;
7
+ if (typeof i == "object" && i) {
8
+ let t = e(i);
9
+ t.id == null ? (n.has(t) || n.set(t, ++r), o = `object:${n.get(t)}`) : o = `id:${typeof t.id}:${t.id}`;
10
+ } else o = `value:${typeof i}:${i}`;
11
+ let s = t().slice(0, a).filter((t) => Object.is(e(t), e(i))).length;
12
+ return `${o}:${s}`;
13
+ };
14
+ }
15
+ export { t as createCollectionKey };