@kernel4632/kima 0.8.4 → 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,85 +1,85 @@
1
1
  import e from "../../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "../core/icon.ce.js";
3
- import { presenceTransition as n } from "../../utils/motion.js";
3
+ import { useContentMotion as n } from "../../utils/content-motion.js";
4
4
  /* empty css */
5
- import { Fragment as r, Transition as i, TransitionGroup as a, computed as o, createBlock as ee, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, getCurrentInstance as f, mergeProps as p, normalizeClass as m, normalizeStyle as h, onBeforeUnmount as te, openBlock as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, unref as x, useAttrs as ne, useHost as re, vModelText as ie, watch as S, withCtx as C, withDirectives as ae, withKeys as w, withModifiers as oe } from "vue";
6
- import { ArrowDown01Icon as se, ArrowRight01Icon as ce, ArrowUp01Icon as le, ArrowUpDownIcon as ue, CheckmarkSquare02Icon as de, MinusSignSquareIcon as fe, SquareIcon as pe } from "@hugeicons/core-free-icons";
5
+ import { Fragment as r, computed as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, getCurrentInstance as u, mergeProps as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as ee, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as te, useHost as ne, vModelText as re, watch as b, withDirectives as ie, withKeys as ae, withModifiers as x } from "vue";
6
+ import { ArrowDown01Icon as oe, ArrowRight01Icon as se, ArrowUp01Icon as ce, ArrowUpDownIcon as le, CheckmarkSquare02Icon as S, MinusSignSquareIcon as ue, SquareIcon as de } from "@hugeicons/core-free-icons";
7
7
  // src/components/data/table.ce.vue
8
- var me = ["aria-label"], he = ["aria-busy"], ge = { key: 0 }, _e = {
8
+ var fe = ["aria-label"], pe = ["aria-busy"], me = { key: 0 }, he = {
9
9
  key: 0,
10
10
  scope: "col",
11
11
  class: "kima-table__expand-column"
12
- }, ve = {
12
+ }, ge = {
13
13
  key: 1,
14
14
  scope: "col",
15
15
  class: "kima-table__select-column"
16
- }, ye = [
16
+ }, _e = [
17
17
  "aria-checked",
18
18
  "aria-label",
19
19
  "title",
20
20
  "disabled"
21
- ], be = ["aria-sort"], xe = [
21
+ ], ve = ["aria-sort"], ye = [
22
22
  "aria-label",
23
23
  "title",
24
24
  "disabled",
25
25
  "onClick"
26
- ], Se = { key: 1 }, Ce = [
26
+ ], be = { key: 1 }, xe = [
27
27
  "aria-label",
28
28
  "aria-valuenow",
29
29
  "aria-valuemin",
30
30
  "aria-valuemax",
31
31
  "onPointerdown",
32
32
  "onKeydown"
33
- ], we = {
33
+ ], Se = {
34
34
  key: 0,
35
35
  class: "kima-table__filter-row"
36
- }, Te = {
36
+ }, Ce = {
37
37
  key: 0,
38
38
  class: "kima-table__expand-column",
39
39
  "aria-hidden": "true"
40
- }, Ee = {
40
+ }, we = {
41
41
  key: 1,
42
42
  class: "kima-table__select-column",
43
43
  "aria-hidden": "true"
44
- }, De = [
44
+ }, Te = [
45
45
  "value",
46
46
  "aria-label",
47
47
  "placeholder",
48
48
  "onInput"
49
- ], Oe = { key: "loading" }, ke = ["colspan"], Ae = { role: "status" }, je = ["onClick", "onKeydown"], Me = {
49
+ ], Ee = { key: "loading" }, De = ["colspan"], Oe = { role: "status" }, ke = { key: "rows" }, Ae = ["onClick", "onKeydown"], je = {
50
50
  key: 0,
51
51
  class: "kima-table__expand-column"
52
- }, Ne = [
52
+ }, Me = [
53
53
  "aria-expanded",
54
54
  "aria-label",
55
55
  "onClick"
56
- ], Pe = {
56
+ ], Ne = {
57
57
  key: 1,
58
58
  class: "kima-table__select-column"
59
- }, Fe = [
59
+ }, Pe = [
60
60
  "aria-checked",
61
61
  "aria-label",
62
62
  "title",
63
63
  "onClick"
64
- ], Ie = ["onDblclick"], Le = [
64
+ ], Fe = ["onDblclick"], Ie = [
65
65
  "aria-label",
66
66
  "onKeydown",
67
67
  "onBlur"
68
- ], Re = {
68
+ ], Le = {
69
69
  key: 0,
70
70
  class: "kima-table__expanded-row"
71
- }, ze = ["colspan"], Be = { key: "empty" }, Ve = ["colspan"], He = { role: "status" }, Ue = {
72
- key: 1,
71
+ }, Re = ["colspan"], ze = { key: "empty" }, Be = ["colspan"], Ve = { role: "status" }, He = {
72
+ key: 4,
73
73
  class: "kima-table__summary"
74
- }, We = {
74
+ }, Ue = {
75
75
  key: 0,
76
76
  class: "kima-table__expand-column",
77
77
  "aria-hidden": "true"
78
- }, Ge = {
78
+ }, We = {
79
79
  key: 1,
80
80
  class: "kima-table__select-column",
81
81
  "aria-hidden": "true"
82
- }, Ke = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
82
+ }, Ge = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
83
83
  __name: "table.ce",
84
84
  props: {
85
85
  columns: {
@@ -142,38 +142,38 @@ var me = ["aria-label"], he = ["aria-busy"], ge = { key: 0 }, _e = {
142
142
  "expand",
143
143
  "cell-edit"
144
144
  ],
145
- setup(e, { emit: Ke }) {
146
- let T = e, E = Ke, D = ne(), qe = f().ce ? re() : null, Je = o(() => qe ? {
147
- ...D,
145
+ setup(e, { emit: Ge }) {
146
+ let C = e, w = Ge, T = te(), Ke = u().ce ? ne() : null, qe = i(() => Ke ? {
147
+ ...T,
148
148
  id: void 0
149
- } : D), O = _(T.modelValue), k = _({ ...T.filterValues }), A = _([...T.expandedRows]), j = _(T.sortKey ?? ""), M = _(T.sortDirection ?? ""), N = _(Object.fromEntries(T.columns.filter((e) => e.width).map((e) => [e.key, e.width]))), P = _(null), F;
150
- S(() => T.modelValue, (e) => {
151
- O.value = e;
152
- }, { deep: !0 }), S(() => T.filterValues, (e) => {
153
- k.value = { ...e };
154
- }, { deep: !0 }), S(() => T.expandedRows, (e) => {
155
- A.value = [...e];
156
- }, { deep: !0 }), S(() => T.sortKey, (e) => {
149
+ } : T), E = h(null), D = h(C.modelValue), O = h({ ...C.filterValues }), k = h([...C.expandedRows]), A = h(C.sortKey ?? ""), j = h(C.sortDirection ?? ""), M = h(Object.fromEntries(C.columns.filter((e) => e.width).map((e) => [e.key, e.width]))), N = h(null), P;
150
+ b(() => C.modelValue, (e) => {
151
+ D.value = e;
152
+ }, { deep: !0 }), b(() => C.filterValues, (e) => {
153
+ O.value = { ...e };
154
+ }, { deep: !0 }), b(() => C.expandedRows, (e) => {
155
+ k.value = [...e];
156
+ }, { deep: !0 }), b(() => C.sortKey, (e) => {
157
+ e !== void 0 && (A.value = e || "");
158
+ }), b(() => C.sortDirection, (e) => {
157
159
  e !== void 0 && (j.value = e || "");
158
- }), S(() => T.sortDirection, (e) => {
159
- e !== void 0 && (M.value = e || "");
160
- }), S(() => T.columns, (e) => {
161
- let t = { ...N.value };
160
+ }), b(() => C.columns, (e) => {
161
+ let t = { ...M.value };
162
162
  e.forEach((e) => {
163
163
  t[e.key] === void 0 && e.width !== void 0 && (t[e.key] = e.width);
164
- }), N.value = t;
164
+ }), M.value = t;
165
165
  }, { deep: !0 });
166
- let Ye = o(() => T.items === void 0 ? T.rows : T.items), I = o(() => T.columns.filter((e) => !e.hidden)), L = o(() => Ye.value.filter((e) => T.columns.every((t) => {
167
- let n = String(k.value[t.key] ?? "").trim().toLowerCase();
166
+ let Je = i(() => C.items === void 0 ? C.rows : C.items), F = i(() => C.columns.filter((e) => !e.hidden)), I = i(() => Je.value.filter((e) => C.columns.every((t) => {
167
+ let n = String(O.value[t.key] ?? "").trim().toLowerCase();
168
168
  return !n || String(e[t.key] ?? "").toLowerCase().includes(n);
169
- }))), R = o(() => T.sortKey !== void 0 || T.sortDirection !== void 0), z = o(() => R.value ? T.sortKey || "" : j.value), B = o(() => {
170
- let e = R.value ? T.sortDirection : M.value;
169
+ }))), L = i(() => C.sortKey !== void 0 || C.sortDirection !== void 0), R = i(() => L.value ? C.sortKey || "" : A.value), z = i(() => {
170
+ let e = L.value ? C.sortDirection : j.value;
171
171
  return ["asc", "desc"].includes(e) ? e : "";
172
- }), V = o(() => {
173
- let e = T.columns.find((e) => e.key === z.value);
174
- if (!e || !B.value) return L.value;
175
- let t = B.value === "asc" ? 1 : -1;
176
- return L.value.map((e, t) => ({
172
+ }), B = i(() => {
173
+ let e = C.columns.find((e) => e.key === R.value);
174
+ if (!e || !z.value) return I.value;
175
+ let t = z.value === "asc" ? 1 : -1;
176
+ return I.value.map((e, t) => ({
177
177
  row: e,
178
178
  index: t
179
179
  })).sort((n, r) => {
@@ -184,69 +184,75 @@ var me = ["aria-label"], he = ["aria-busy"], ge = { key: 0 }, _e = {
184
184
  sensitivity: "base"
185
185
  }) * t;
186
186
  }).map(({ row: e }) => e);
187
- }), H = o(() => new Set(O.value)), U = o(() => V.value.map(Y)), W = o(() => new Set(A.value)), G = o(() => U.value.length > 0 && U.value.every((e) => H.value.has(e))), K = o(() => U.value.some((e) => H.value.has(e))), Xe = o(() => G.value ? "true" : K.value ? "mixed" : "false"), q = o(() => G.value ? "取消选择全部行" : "选择全部行"), Ze = o(() => T.columns.some((e) => e.filterable)), Qe = o(() => T.summary || T.columns.some((e) => typeof e.summary == "function")), J = o(() => Math.max(1, I.value.length + +!!T.selectable + +!!T.expandable));
188
- function Y(e, t) {
189
- return typeof T.rowKey == "function" ? T.rowKey(e) : typeof T.rowKey == "string" ? e[T.rowKey] : e.id ?? e.key ?? `row-${t}`;
187
+ }), V = i(() => new Set(D.value)), H = i(() => B.value.map(J)), U = i(() => new Set(k.value)), W = i(() => H.value.length > 0 && H.value.every((e) => V.value.has(e))), G = i(() => H.value.some((e) => V.value.has(e)));
188
+ n(E, () => [
189
+ C.loading,
190
+ B.value,
191
+ [...U.value]
192
+ ], { opacity: !1 });
193
+ let Ye = i(() => W.value ? "true" : G.value ? "mixed" : "false"), K = i(() => W.value ? "取消选择全部行" : "选择全部行"), Xe = i(() => C.columns.some((e) => e.filterable)), Ze = i(() => C.summary || C.columns.some((e) => typeof e.summary == "function")), q = i(() => Math.max(1, F.value.length + +!!C.selectable + +!!C.expandable));
194
+ function J(e, t) {
195
+ return typeof C.rowKey == "function" ? C.rowKey(e) : typeof C.rowKey == "string" ? e[C.rowKey] : e.id ?? e.key ?? `row-${t}`;
190
196
  }
191
- function X(e, t) {
192
- let n = Y(e, t), r = new Set(H.value);
193
- r.has(n) ? r.delete(n) : r.add(n), O.value = [...r], E("update:modelValue", O.value);
197
+ function Y(e, t) {
198
+ let n = J(e, t), r = new Set(V.value);
199
+ r.has(n) ? r.delete(n) : r.add(n), D.value = [...r], w("update:modelValue", D.value);
194
200
  }
195
- function $e() {
196
- let e = new Set(H.value);
197
- for (let t of U.value) G.value ? e.delete(t) : e.add(t);
198
- O.value = [...e], E("update:modelValue", O.value);
201
+ function Qe() {
202
+ let e = new Set(V.value);
203
+ for (let t of H.value) W.value ? e.delete(t) : e.add(t);
204
+ D.value = [...e], w("update:modelValue", D.value);
199
205
  }
200
- function et(e, t) {
206
+ function $e(e, t) {
201
207
  let n = t.target.closest?.("button, a, input, select, textarea, label, summary, [contenteditable]:not([contenteditable='false']), [role='button'], [role='checkbox'], [tabindex]");
202
- n && n !== t.currentTarget || E("row-click", e, t);
208
+ n && n !== t.currentTarget || w("row-click", e, t);
203
209
  }
204
- function tt(e, t) {
210
+ function et(e, t) {
205
211
  let n = t.target.value;
206
- k.value = {
207
- ...k.value,
212
+ O.value = {
213
+ ...O.value,
208
214
  [e.key]: n
209
- }, E("update:filterValues", k.value), E("filter-change", {
210
- ...k.value,
215
+ }, w("update:filterValues", O.value), w("filter-change", {
216
+ ...O.value,
211
217
  key: e.key,
212
218
  value: n
213
219
  });
214
220
  }
215
- function nt(e, t) {
216
- let n = Y(e, t), r = new Set(A.value);
217
- r.has(n) ? r.delete(n) : r.add(n), A.value = [...r], E("update:expandedRows", A.value), E("expand", {
221
+ function tt(e, t) {
222
+ let n = J(e, t), r = new Set(k.value);
223
+ r.has(n) ? r.delete(n) : r.add(n), k.value = [...r], w("update:expandedRows", k.value), w("expand", {
218
224
  row: e,
219
225
  key: n,
220
226
  expanded: r.has(n)
221
227
  });
222
228
  }
223
- function rt(e, t, n) {
224
- T.editable && n.editable && (P.value = {
225
- rowKey: Y(e, t),
229
+ function nt(e, t, n) {
230
+ C.editable && n.editable && (N.value = {
231
+ rowKey: J(e, t),
226
232
  columnKey: n.key,
227
233
  value: e[n.key] ?? "",
228
234
  oldValue: e[n.key]
229
235
  });
230
236
  }
231
- function it(e, t, n) {
232
- if (!P.value) return;
233
- let r = P.value;
234
- P.value = null, E("cell-edit", {
237
+ function X(e, t, n) {
238
+ if (!N.value) return;
239
+ let r = N.value;
240
+ N.value = null, w("cell-edit", {
235
241
  row: e,
236
- rowKey: Y(e, t),
242
+ rowKey: J(e, t),
237
243
  column: n,
238
244
  key: n.key,
239
245
  value: r.value,
240
246
  oldValue: r.oldValue
241
247
  });
242
248
  }
243
- function at() {
244
- P.value = null;
249
+ function rt() {
250
+ N.value = null;
245
251
  }
246
- function ot(e, t, n) {
247
- return P.value?.rowKey === Y(e, t) && P.value?.columnKey === n.key;
252
+ function it(e, t, n) {
253
+ return N.value?.rowKey === J(e, t) && N.value?.columnKey === n.key;
248
254
  }
249
- function st(e, t, n) {
255
+ function at(e, t, n) {
250
256
  if (n.target !== n.currentTarget || n.repeat || ![
251
257
  "Enter",
252
258
  " ",
@@ -255,63 +261,63 @@ var me = ["aria-label"], he = ["aria-busy"], ge = { key: 0 }, _e = {
255
261
  "Home",
256
262
  "End"
257
263
  ].includes(n.key)) return;
258
- if (n.preventDefault(), n.key === "Enter" || n.key === " " && !T.selectable) {
259
- E("row-click", e, n);
264
+ if (n.preventDefault(), n.key === "Enter" || n.key === " " && !C.selectable) {
265
+ w("row-click", e, n);
260
266
  return;
261
267
  }
262
268
  if (n.key === " ") {
263
- X(e, t);
269
+ Y(e, t);
264
270
  return;
265
271
  }
266
272
  let r = n.currentTarget.parentElement.rows, i = t + (n.key === "ArrowUp" ? -1 : 1);
267
273
  n.key === "Home" && (i = 0), n.key === "End" && (i = r.length - 1), r[Math.max(0, Math.min(r.length - 1, i))].focus();
268
274
  }
269
275
  function Z(e) {
270
- return T.sortable && e.sortable !== !1 || e.sortable === !0;
276
+ return C.sortable && e.sortable !== !1 || e.sortable === !0;
271
277
  }
272
278
  function Q(e) {
273
- return T.resizable && e.resizable !== !1 || e.resizable === !0;
279
+ return C.resizable && e.resizable !== !1 || e.resizable === !0;
274
280
  }
275
281
  function $(e) {
276
- let t = N.value[e.key] ?? e.width;
282
+ let t = M.value[e.key] ?? e.width;
277
283
  return t ? typeof t == "number" ? `${t}px` : t : void 0;
278
284
  }
279
- function ct(e) {
285
+ function ot(e) {
280
286
  if (!Z(e)) return;
281
- let t = z.value !== e.key || B.value !== "asc" ? "asc" : "desc";
282
- R.value || (j.value = e.key, M.value = t), E("sort-change", {
287
+ let t = R.value !== e.key || z.value !== "asc" ? "asc" : "desc";
288
+ L.value || (A.value = e.key, j.value = t), w("sort-change", {
283
289
  key: e.key,
284
290
  direction: t
285
291
  });
286
292
  }
287
- function lt(e) {
288
- let t = z.value === e.key && B.value === "asc";
293
+ function st(e) {
294
+ let t = R.value === e.key && z.value === "asc";
289
295
  return `${e.label}:按${t ? "降" : "升"}序排列`;
290
296
  }
291
- function ut(e, t) {
297
+ function ct(e, t) {
292
298
  let n = Number(e.minWidth) || 72, r = Number(e.maxWidth) || 1200, i = Math.max(n, Math.min(r, Math.round(t)));
293
- N.value = {
294
- ...N.value,
299
+ M.value = {
300
+ ...M.value,
295
301
  [e.key]: i
296
- }, E("column-resize", {
302
+ }, w("column-resize", {
297
303
  key: e.key,
298
304
  width: i
299
305
  });
300
306
  }
301
- function dt(e, t) {
302
- Q(e) && t.button === 0 && (t.preventDefault(), F = {
307
+ function lt(e, t) {
308
+ Q(e) && t.button === 0 && (t.preventDefault(), P = {
303
309
  column: e,
304
310
  startX: t.clientX,
305
- startWidth: Number(N.value[e.key] ?? e.width) || t.currentTarget.parentElement.offsetWidth
306
- }, document.addEventListener("pointermove", ft), document.addEventListener("pointerup", pt, { once: !0 }));
311
+ startWidth: Number(M.value[e.key] ?? e.width) || t.currentTarget.parentElement.offsetWidth
312
+ }, document.addEventListener("pointermove", ut), document.addEventListener("pointerup", dt, { once: !0 }));
307
313
  }
308
- function ft(e) {
309
- F && ut(F.column, F.startWidth + e.clientX - F.startX);
314
+ function ut(e) {
315
+ P && ct(P.column, P.startWidth + e.clientX - P.startX);
310
316
  }
311
- function pt() {
312
- F = null, document.removeEventListener("pointermove", ft);
317
+ function dt() {
318
+ P = null, document.removeEventListener("pointermove", ut);
313
319
  }
314
- function mt(e, t) {
320
+ function ft(e, t) {
315
321
  if (!Q(e) || ![
316
322
  "ArrowLeft",
317
323
  "ArrowRight",
@@ -319,173 +325,165 @@ var me = ["aria-label"], he = ["aria-busy"], ge = { key: 0 }, _e = {
319
325
  "End"
320
326
  ].includes(t.key)) return;
321
327
  t.preventDefault();
322
- let n = Number(N.value[e.key] ?? e.width) || 160, r = Number(e.minWidth) || 72, i = Number(e.maxWidth) || 1200;
323
- ut(e, t.key === "Home" ? r : t.key === "End" ? i : n + (t.key === "ArrowRight" ? 8 : -8));
328
+ let n = Number(M.value[e.key] ?? e.width) || 160, r = Number(e.minWidth) || 72, i = Number(e.maxWidth) || 1200;
329
+ ct(e, t.key === "Home" ? r : t.key === "End" ? i : n + (t.key === "ArrowRight" ? 8 : -8));
324
330
  }
325
- return te(pt), (o, f) => (g(), c("div", { class: m(["kima-table", {
331
+ return ee(dt), (n, i) => (m(), o("div", { class: f(["kima-table", {
326
332
  "kima-table--striped": e.striped,
327
333
  "kima-table--hoverable": e.hoverable
328
- }]) }, [l("div", {
334
+ }]) }, [s("div", {
335
+ ref_key: "scroll",
336
+ ref: E,
329
337
  class: "kima-table__scroll",
330
338
  tabindex: "0",
331
339
  role: "region",
332
- "aria-label": e.caption || x(D)["aria-label"] || "表格区域"
333
- }, [l("table", p(Je.value, { "aria-busy": e.loading }), [
334
- e.caption ? (g(), c("caption", ge, b(e.caption), 1)) : s("", !0),
335
- l("thead", null, [l("tr", null, [
336
- e.expandable ? (g(), c("th", _e, "展开")) : s("", !0),
337
- e.selectable ? (g(), c("th", ve, [l("button", {
340
+ "aria-label": e.caption || y(T)["aria-label"] || "表格区域"
341
+ }, [s("table", d(qe.value, { "aria-busy": e.loading }), [
342
+ e.caption ? (m(), o("caption", me, v(e.caption), 1)) : a("", !0),
343
+ s("thead", null, [s("tr", null, [
344
+ e.expandable ? (m(), o("th", he, "展开")) : a("", !0),
345
+ e.selectable ? (m(), o("th", ge, [s("button", {
338
346
  type: "button",
339
347
  role: "checkbox",
340
348
  class: "kima-table__select-button",
341
- "aria-checked": Xe.value,
342
- "aria-label": q.value,
343
- title: q.value,
344
- disabled: e.loading || !Ye.value.length,
345
- onClick: $e
346
- }, [d(t, {
347
- icon: G.value ? x(de) : K.value ? x(fe) : x(pe),
349
+ "aria-checked": Ye.value,
350
+ "aria-label": K.value,
351
+ title: K.value,
352
+ disabled: e.loading || !Je.value.length,
353
+ onClick: Qe
354
+ }, [l(t, {
355
+ icon: W.value ? y(S) : G.value ? y(ue) : y(de),
348
356
  size: 20,
349
357
  "aria-hidden": "true"
350
- }, null, 8, ["icon"])], 8, ye)])) : s("", !0),
351
- (g(!0), c(r, null, v(I.value, (n) => (g(), c("th", {
358
+ }, null, 8, ["icon"])], 8, _e)])) : a("", !0),
359
+ (m(!0), o(r, null, g(F.value, (n) => (m(), o("th", {
352
360
  key: n.key,
353
361
  scope: "col",
354
- class: m(`kima-table__align--${n.align || "start"}`),
355
- style: h({
362
+ class: f(`kima-table__align--${n.align || "start"}`),
363
+ style: p({
356
364
  width: $(n),
357
365
  minWidth: n.minWidth ? typeof n.minWidth == "number" ? `${n.minWidth}px` : n.minWidth : void 0
358
366
  }),
359
- "aria-sort": Z(n) ? z.value === n.key && B.value ? B.value === "asc" ? "ascending" : "descending" : "none" : void 0
360
- }, [Z(n) ? (g(), c("button", {
367
+ "aria-sort": Z(n) ? R.value === n.key && z.value ? z.value === "asc" ? "ascending" : "descending" : "none" : void 0
368
+ }, [Z(n) ? (m(), o("button", {
361
369
  key: 0,
362
370
  type: "button",
363
371
  class: "kima-table__sort-button",
364
- "aria-label": lt(n),
365
- title: lt(n),
372
+ "aria-label": st(n),
373
+ title: st(n),
366
374
  disabled: e.loading,
367
- onClick: (e) => ct(n)
368
- }, [l("span", null, b(n.label), 1), d(t, {
369
- icon: z.value === n.key && B.value ? B.value === "asc" ? x(le) : x(se) : x(ue),
375
+ onClick: (e) => ot(n)
376
+ }, [s("span", null, v(n.label), 1), l(t, {
377
+ icon: R.value === n.key && z.value ? z.value === "asc" ? y(ce) : y(oe) : y(le),
370
378
  size: 16,
371
379
  "aria-hidden": "true"
372
- }, null, 8, ["icon"])], 8, xe)) : (g(), c("span", Se, b(n.label), 1)), Q(n) ? (g(), c("button", {
380
+ }, null, 8, ["icon"])], 8, ye)) : (m(), o("span", be, v(n.label), 1)), Q(n) ? (m(), o("button", {
373
381
  key: 2,
374
382
  type: "button",
375
383
  class: "kima-table__resize",
376
384
  role: "separator",
377
385
  "aria-label": `调整${n.label}列宽`,
378
- "aria-valuenow": Number(N.value[n.key] ?? n.width) || void 0,
386
+ "aria-valuenow": Number(M.value[n.key] ?? n.width) || void 0,
379
387
  "aria-valuemin": Number(n.minWidth) || 72,
380
388
  "aria-valuemax": Number(n.maxWidth) || 1200,
381
- onPointerdown: (e) => dt(n, e),
382
- onKeydown: (e) => mt(n, e)
383
- }, null, 40, Ce)) : s("", !0)], 14, be))), 128))
384
- ]), Ze.value ? (g(), c("tr", we, [
385
- e.expandable ? (g(), c("th", Te)) : s("", !0),
386
- e.selectable ? (g(), c("th", Ee)) : s("", !0),
387
- (g(!0), c(r, null, v(I.value, (e) => (g(), c("th", {
389
+ onPointerdown: (e) => lt(n, e),
390
+ onKeydown: (e) => ft(n, e)
391
+ }, null, 40, xe)) : a("", !0)], 14, ve))), 128))
392
+ ]), Xe.value ? (m(), o("tr", Se, [
393
+ e.expandable ? (m(), o("th", Ce)) : a("", !0),
394
+ e.selectable ? (m(), o("th", we)) : a("", !0),
395
+ (m(!0), o(r, null, g(F.value, (e) => (m(), o("th", {
388
396
  key: e.key,
389
- class: m(`kima-table__align--${e.align || "start"}`)
390
- }, [e.filterable ? (g(), c("input", {
397
+ class: f(`kima-table__align--${e.align || "start"}`)
398
+ }, [e.filterable ? (m(), o("input", {
391
399
  key: 0,
392
400
  class: "kima-table__filter",
393
401
  type: "search",
394
- value: k.value[e.key] || "",
402
+ value: O.value[e.key] || "",
395
403
  "aria-label": `过滤${e.label}`,
396
404
  placeholder: e.filterPlaceholder || `过滤${e.label}`,
397
- onInput: (t) => tt(e, t)
398
- }, null, 40, De)) : s("", !0)], 2))), 128))
399
- ])) : s("", !0)]),
400
- d(i, p({ name: "kima-fade" }, x(n)), {
401
- default: C(() => [e.loading ? (g(), c("tbody", Oe, [l("tr", null, [l("td", {
402
- class: "kima-table__message",
403
- colspan: J.value
404
- }, [l("div", Ae, [y(o.$slots, "loading", {}, () => [f[1] ||= u("加载中", -1)], !0)])], 8, ke)])])) : V.value.length ? (g(), ee(a, p({
405
- key: "rows",
406
- tag: "tbody",
407
- name: "kima-list"
408
- }, x(n)), {
409
- default: C(() => [(g(!0), c(r, null, v(V.value, (n, i) => (g(), c(r, { key: Y(n, i) }, [l("tr", {
410
- class: m({ "kima-table__row--selected": e.selectable && H.value.has(Y(n, i)) }),
411
- tabindex: "0",
412
- onClick: (e) => et(n, e),
413
- onKeydown: (e) => st(n, i, e)
414
- }, [
415
- e.expandable ? (g(), c("td", Me, [l("button", {
416
- type: "button",
417
- class: "kima-table__expand-button",
418
- "aria-expanded": W.value.has(Y(n, i)),
419
- "aria-label": `${W.value.has(Y(n, i)) ? "收起" : "展开"}第 ${i + 1} 行`,
420
- onClick: oe((e) => nt(n, i), ["stop"])
421
- }, [d(t, {
422
- icon: x(ce),
423
- size: 18,
424
- "aria-hidden": "true"
425
- }, null, 8, ["icon"])], 8, Ne)])) : s("", !0),
426
- e.selectable ? (g(), c("td", Pe, [l("button", {
427
- type: "button",
428
- class: "kima-table__select-button",
429
- role: "checkbox",
430
- "aria-checked": H.value.has(Y(n, i)),
431
- "aria-label": `${H.value.has(Y(n, i)) ? "取消选择" : "选择"}第 ${i + 1} 行`,
432
- title: `${H.value.has(Y(n, i)) ? "取消选择" : "选择"}第 ${i + 1} 行`,
433
- onClick: oe((e) => X(n, i), ["stop"])
434
- }, [d(t, {
435
- icon: H.value.has(Y(n, i)) ? x(de) : x(pe),
436
- size: 20,
437
- "aria-hidden": "true"
438
- }, null, 8, ["icon"])], 8, Fe)])) : s("", !0),
439
- (g(!0), c(r, null, v(I.value, (e) => (g(), c("td", {
440
- key: e.key,
441
- class: m(`kima-table__align--${e.align || "start"}`),
442
- style: h({
443
- width: $(e),
444
- minWidth: e.minWidth ? typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth : void 0
445
- }),
446
- onDblclick: (t) => rt(n, i, e)
447
- }, [ot(n, i, e) ? ae((g(), c("input", {
448
- key: 0,
449
- "onUpdate:modelValue": f[0] ||= (e) => P.value.value = e,
450
- class: "kima-table__edit-input",
451
- "aria-label": `编辑${e.label}`,
452
- onKeydown: [w((t) => it(n, i, e), ["enter"]), w(at, ["esc"])],
453
- onBlur: (t) => it(n, i, e)
454
- }, null, 40, Le)), [[ie, P.value.value]]) : y(o.$slots, `cell-${e.key}`, {
455
- row: n,
456
- value: n[e.key],
457
- column: e
458
- }, () => [u(b(n[e.key]), 1)], !0, 1)], 46, Ie))), 128))
459
- ], 42, je), e.expandable && W.value.has(Y(n, i)) ? (g(), c("tr", Re, [l("td", { colspan: J.value }, [y(o.$slots, "expanded", {
460
- row: n,
461
- index: i
462
- }, () => [u(b(n), 1)], !0)], 8, ze)])) : s("", !0)], 64))), 128))]),
463
- _: 3
464
- }, 16)) : (g(), c("tbody", Be, [l("tr", null, [l("td", {
465
- class: "kima-table__message",
466
- colspan: J.value
467
- }, [l("div", He, [y(o.$slots, "empty", {}, () => [f[2] ||= u("暂无数据", -1)], !0)])], 8, Ve)])]))]),
468
- _: 3
469
- }, 16),
470
- Qe.value ? (g(), c("tfoot", Ue, [l("tr", null, [
471
- e.expandable ? (g(), c("th", We)) : s("", !0),
472
- e.selectable ? (g(), c("th", Ge)) : s("", !0),
473
- (g(!0), c(r, null, v(I.value, (e) => (g(), c("th", {
405
+ onInput: (t) => et(e, t)
406
+ }, null, 40, Te)) : a("", !0)], 2))), 128))
407
+ ])) : a("", !0)]),
408
+ e.loading ? (m(), o("tbody", Ee, [s("tr", null, [s("td", {
409
+ class: "kima-table__message",
410
+ colspan: q.value
411
+ }, [s("div", Oe, [_(n.$slots, "loading", {}, () => [i[1] ||= c("加载中", -1)], !0)])], 8, De)])])) : B.value.length ? (m(), o("tbody", ke, [(m(!0), o(r, null, g(B.value, (u, d) => (m(), o(r, { key: J(u, d) }, [s("tr", {
412
+ class: f({ "kima-table__row--selected": e.selectable && V.value.has(J(u, d)) }),
413
+ tabindex: "0",
414
+ onClick: (e) => $e(u, e),
415
+ onKeydown: (e) => at(u, d, e)
416
+ }, [
417
+ e.expandable ? (m(), o("td", je, [s("button", {
418
+ type: "button",
419
+ class: "kima-table__expand-button",
420
+ "aria-expanded": U.value.has(J(u, d)),
421
+ "aria-label": `${U.value.has(J(u, d)) ? "收起" : "展开"}第 ${d + 1} 行`,
422
+ onClick: x((e) => tt(u, d), ["stop"])
423
+ }, [l(t, {
424
+ icon: y(se),
425
+ size: 18,
426
+ "aria-hidden": "true"
427
+ }, null, 8, ["icon"])], 8, Me)])) : a("", !0),
428
+ e.selectable ? (m(), o("td", Ne, [s("button", {
429
+ type: "button",
430
+ class: "kima-table__select-button",
431
+ role: "checkbox",
432
+ "aria-checked": V.value.has(J(u, d)),
433
+ "aria-label": `${V.value.has(J(u, d)) ? "取消选择" : "选择"}第 ${d + 1} 行`,
434
+ title: `${V.value.has(J(u, d)) ? "取消选择" : "选择"}第 ${d + 1} 行`,
435
+ onClick: x((e) => Y(u, d), ["stop"])
436
+ }, [l(t, {
437
+ icon: V.value.has(J(u, d)) ? y(S) : y(de),
438
+ size: 20,
439
+ "aria-hidden": "true"
440
+ }, null, 8, ["icon"])], 8, Pe)])) : a("", !0),
441
+ (m(!0), o(r, null, g(F.value, (e) => (m(), o("td", {
442
+ key: e.key,
443
+ class: f(`kima-table__align--${e.align || "start"}`),
444
+ style: p({
445
+ width: $(e),
446
+ minWidth: e.minWidth ? typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth : void 0
447
+ }),
448
+ onDblclick: (t) => nt(u, d, e)
449
+ }, [it(u, d, e) ? ie((m(), o("input", {
450
+ key: 0,
451
+ "onUpdate:modelValue": i[0] ||= (e) => N.value.value = e,
452
+ class: "kima-table__edit-input",
453
+ "aria-label": `编辑${e.label}`,
454
+ onKeydown: [ae((t) => X(u, d, e), ["enter"]), ae(rt, ["esc"])],
455
+ onBlur: (t) => X(u, d, e)
456
+ }, null, 40, Ie)), [[re, N.value.value]]) : _(n.$slots, `cell-${e.key}`, {
457
+ row: u,
458
+ value: u[e.key],
459
+ column: e
460
+ }, () => [c(v(u[e.key]), 1)], !0, 1)], 46, Fe))), 128))
461
+ ], 42, Ae), e.expandable && U.value.has(J(u, d)) ? (m(), o("tr", Le, [s("td", { colspan: q.value }, [_(n.$slots, "expanded", {
462
+ row: u,
463
+ index: d
464
+ }, () => [c(v(u), 1)], !0)], 8, Re)])) : a("", !0)], 64))), 128))])) : (m(), o("tbody", ze, [s("tr", null, [s("td", {
465
+ class: "kima-table__message",
466
+ colspan: q.value
467
+ }, [s("div", Ve, [_(n.$slots, "empty", {}, () => [i[2] ||= c("暂无数据", -1)], !0)])], 8, Be)])])),
468
+ Ze.value ? (m(), o("tfoot", He, [s("tr", null, [
469
+ e.expandable ? (m(), o("th", Ue)) : a("", !0),
470
+ e.selectable ? (m(), o("th", We)) : a("", !0),
471
+ (m(!0), o(r, null, g(F.value, (e) => (m(), o("th", {
474
472
  key: e.key,
475
- class: m(`kima-table__align--${e.align || "start"}`),
476
- style: h({
473
+ class: f(`kima-table__align--${e.align || "start"}`),
474
+ style: p({
477
475
  width: $(e),
478
476
  minWidth: e.minWidth ? typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth : void 0
479
477
  })
480
- }, [y(o.$slots, `summary-${e.key}`, {
478
+ }, [_(n.$slots, `summary-${e.key}`, {
481
479
  column: e,
482
- rows: V.value
483
- }, () => [u(b(typeof e.summary == "function" ? e.summary(V.value, {
480
+ rows: B.value
481
+ }, () => [c(v(typeof e.summary == "function" ? e.summary(B.value, {
484
482
  column: e,
485
- rows: V.value
483
+ rows: B.value
486
484
  }) : ""), 1)], !0)], 6))), 128))
487
- ])])) : s("", !0)
488
- ], 16, he)], 8, me)], 2));
485
+ ])])) : a("", !0)
486
+ ], 16, pe)], 8, fe)], 2));
489
487
  }
490
- }), [["__scopeId", "data-v-44836eb1"]]);
491
- export { Ke as default };
488
+ }), [["__scopeId", "data-v-c1ac8a33"]]);
489
+ export { Ge as default };