@kernel4632/kima 0.8.5 → 0.8.6

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