@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.
- package/dist/components/advanced-input/editable.ce.vue_vue_type_style_index_0_scoped_82c96de0_lang.css +1 -0
- 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
- package/dist/components/data/table.ce.vue_vue_type_style_index_0_scoped_c1ac8a33_lang.css +1 -0
- package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_df3ec98f_lang.css +1 -0
- package/dist/components/display/skeleton.ce.vue_vue_type_style_index_0_scoped_92807af5_lang.css +1 -0
- package/dist/components/display/timeline.ce.vue_vue_type_style_index_0_scoped_72323605_lang.css +1 -0
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_6a5bc26a_lang.css +1 -0
- package/dist/components/form-completion/upload-manager.ce.vue_vue_type_style_index_0_scoped_fe810c3a_lang.css +1 -0
- package/dist/components/input/field.ce.vue_vue_type_style_index_0_scoped_a01eded5_lang.css +1 -0
- 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
- package/dist/components/input/tags-input.ce.vue_vue_type_style_index_0_scoped_b46618b2_lang.css +1 -0
- package/dist/components/input/textarea.ce.vue_vue_type_style_index_0_scoped_60d0751b_lang.css +1 -0
- package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_cf70a212_lang.css +1 -0
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_03e729d7_lang.css +1 -0
- package/dist/components/utility/progress-group.ce.vue_vue_type_style_index_0_scoped_d4453504_lang.css +1 -0
- package/dist/components/utility/tag-group.ce.vue_vue_type_style_index_0_scoped_892954ad_lang.css +1 -0
- package/dist/kima-elements-core.js +9739 -9684
- package/dist/kima-elements.js +11180 -11079
- package/dist/style.css +16 -16
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/core.css +5 -5
- package/dist/styles/dynamic-input.css +1 -1
- package/dist/styles/editable.css +1 -1
- package/dist/styles/field.css +1 -1
- package/dist/styles/file-upload.css +1 -1
- package/dist/styles/list.css +1 -1
- package/dist/styles/multi-select.css +1 -1
- package/dist/styles/progress-group.css +1 -1
- package/dist/styles/skeleton.css +1 -1
- package/dist/styles/table.css +1 -1
- package/dist/styles/tag-group.css +1 -1
- package/dist/styles/tags-input.css +1 -1
- package/dist/styles/text-field.css +1 -1
- package/dist/styles/textarea.css +1 -1
- package/dist/styles/timeline.css +1 -1
- package/dist/styles/upload-manager.css +2 -2
- package/dist/vue/components/advanced-input/editable.ce.js +70 -69
- package/dist/vue/components/core/text-field.ce.js +66 -65
- package/dist/vue/components/data/table.ce.js +230 -232
- package/dist/vue/components/display/list.ce.js +28 -22
- package/dist/vue/components/display/skeleton.ce.js +27 -20
- package/dist/vue/components/display/timeline.ce.js +33 -25
- package/dist/vue/components/form-completion/dynamic-input.ce.js +75 -68
- package/dist/vue/components/form-completion/upload-manager.ce.js +91 -82
- package/dist/vue/components/input/field.ce.js +25 -23
- package/dist/vue/components/input/file-upload.ce.js +70 -64
- package/dist/vue/components/input/tags-input.ce.js +62 -56
- package/dist/vue/components/input/textarea.ce.js +36 -35
- package/dist/vue/components/interaction/multi-select.ce.js +95 -90
- package/dist/vue/components/navigation/carousel.ce.js +1 -1
- package/dist/vue/components/utility/progress-group.ce.js +26 -22
- package/dist/vue/components/utility/tag-group.ce.js +51 -45
- package/dist/vue/utils/content-motion.js +63 -28
- package/dist/vue/utils/motion.js +32 -17
- package/package.json +1 -1
- package/dist/components/advanced-input/editable.ce.vue_vue_type_style_index_0_scoped_91cd5b33_lang.css +0 -1
- package/dist/components/data/table.ce.vue_vue_type_style_index_0_scoped_44836eb1_lang.css +0 -1
- package/dist/components/display/list.ce.vue_vue_type_style_index_0_scoped_1c170b37_lang.css +0 -1
- package/dist/components/display/skeleton.ce.vue_vue_type_style_index_0_scoped_d9a7d212_lang.css +0 -1
- package/dist/components/display/timeline.ce.vue_vue_type_style_index_0_scoped_ff6a1726_lang.css +0 -1
- package/dist/components/form-completion/dynamic-input.ce.vue_vue_type_style_index_0_scoped_5913d05a_lang.css +0 -1
- package/dist/components/form-completion/upload-manager.ce.vue_vue_type_style_index_0_scoped_5d214e0f_lang.css +0 -1
- package/dist/components/input/field.ce.vue_vue_type_style_index_0_scoped_f2ce3fc2_lang.css +0 -1
- package/dist/components/input/tags-input.ce.vue_vue_type_style_index_0_scoped_7a178bc6_lang.css +0 -1
- package/dist/components/input/textarea.ce.vue_vue_type_style_index_0_scoped_c0cc3612_lang.css +0 -1
- package/dist/components/interaction/multi-select.ce.vue_vue_type_style_index_0_scoped_b5be8e98_lang.css +0 -1
- package/dist/components/navigation/carousel.ce.vue_vue_type_style_index_0_scoped_6a7ca57f_lang.css +0 -1
- package/dist/components/utility/progress-group.ce.vue_vue_type_style_index_0_scoped_681cf67d_lang.css +0 -1
- 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 {
|
|
3
|
+
import { useContentMotion as n } from "../../utils/content-motion.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { Fragment as r,
|
|
6
|
-
import { ArrowDown01Icon as
|
|
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
|
|
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
|
-
},
|
|
12
|
+
}, ge = {
|
|
13
13
|
key: 1,
|
|
14
14
|
scope: "col",
|
|
15
15
|
class: "kima-table__select-column"
|
|
16
|
-
},
|
|
16
|
+
}, _e = [
|
|
17
17
|
"aria-checked",
|
|
18
18
|
"aria-label",
|
|
19
19
|
"title",
|
|
20
20
|
"disabled"
|
|
21
|
-
],
|
|
21
|
+
], ve = ["aria-sort"], ye = [
|
|
22
22
|
"aria-label",
|
|
23
23
|
"title",
|
|
24
24
|
"disabled",
|
|
25
25
|
"onClick"
|
|
26
|
-
],
|
|
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
|
-
],
|
|
33
|
+
], Se = {
|
|
34
34
|
key: 0,
|
|
35
35
|
class: "kima-table__filter-row"
|
|
36
|
-
},
|
|
36
|
+
}, Ce = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "kima-table__expand-column",
|
|
39
39
|
"aria-hidden": "true"
|
|
40
|
-
},
|
|
40
|
+
}, we = {
|
|
41
41
|
key: 1,
|
|
42
42
|
class: "kima-table__select-column",
|
|
43
43
|
"aria-hidden": "true"
|
|
44
|
-
},
|
|
44
|
+
}, Te = [
|
|
45
45
|
"value",
|
|
46
46
|
"aria-label",
|
|
47
47
|
"placeholder",
|
|
48
48
|
"onInput"
|
|
49
|
-
],
|
|
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
|
-
},
|
|
52
|
+
}, Me = [
|
|
53
53
|
"aria-expanded",
|
|
54
54
|
"aria-label",
|
|
55
55
|
"onClick"
|
|
56
|
-
],
|
|
56
|
+
], Ne = {
|
|
57
57
|
key: 1,
|
|
58
58
|
class: "kima-table__select-column"
|
|
59
|
-
},
|
|
59
|
+
}, Pe = [
|
|
60
60
|
"aria-checked",
|
|
61
61
|
"aria-label",
|
|
62
62
|
"title",
|
|
63
63
|
"onClick"
|
|
64
|
-
],
|
|
64
|
+
], Fe = ["onDblclick"], Ie = [
|
|
65
65
|
"aria-label",
|
|
66
66
|
"onKeydown",
|
|
67
67
|
"onBlur"
|
|
68
|
-
],
|
|
68
|
+
], Le = {
|
|
69
69
|
key: 0,
|
|
70
70
|
class: "kima-table__expanded-row"
|
|
71
|
-
},
|
|
72
|
-
key:
|
|
71
|
+
}, Re = ["colspan"], ze = { key: "empty" }, Be = ["colspan"], Ve = { role: "status" }, He = {
|
|
72
|
+
key: 4,
|
|
73
73
|
class: "kima-table__summary"
|
|
74
|
-
},
|
|
74
|
+
}, Ue = {
|
|
75
75
|
key: 0,
|
|
76
76
|
class: "kima-table__expand-column",
|
|
77
77
|
"aria-hidden": "true"
|
|
78
|
-
},
|
|
78
|
+
}, We = {
|
|
79
79
|
key: 1,
|
|
80
80
|
class: "kima-table__select-column",
|
|
81
81
|
"aria-hidden": "true"
|
|
82
|
-
},
|
|
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:
|
|
146
|
-
let
|
|
147
|
-
...
|
|
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
|
-
} :
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}, { deep: !0 }),
|
|
153
|
-
|
|
154
|
-
}, { deep: !0 }),
|
|
155
|
-
|
|
156
|
-
}, { deep: !0 }),
|
|
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
|
-
}),
|
|
159
|
-
|
|
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
|
-
}),
|
|
164
|
+
}), M.value = t;
|
|
165
165
|
}, { deep: !0 });
|
|
166
|
-
let
|
|
167
|
-
let n = String(
|
|
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
|
-
}))),
|
|
170
|
-
let e =
|
|
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
|
-
}),
|
|
173
|
-
let e =
|
|
174
|
-
if (!e || !
|
|
175
|
-
let t =
|
|
176
|
-
return
|
|
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
|
-
}),
|
|
188
|
-
|
|
189
|
-
|
|
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
|
|
192
|
-
let n =
|
|
193
|
-
r.has(n) ? r.delete(n) : r.add(n),
|
|
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
|
|
196
|
-
let e = new Set(
|
|
197
|
-
for (let t of
|
|
198
|
-
|
|
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
|
|
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 ||
|
|
208
|
+
n && n !== t.currentTarget || w("row-click", e, t);
|
|
203
209
|
}
|
|
204
|
-
function
|
|
210
|
+
function et(e, t) {
|
|
205
211
|
let n = t.target.value;
|
|
206
|
-
|
|
207
|
-
...
|
|
212
|
+
O.value = {
|
|
213
|
+
...O.value,
|
|
208
214
|
[e.key]: n
|
|
209
|
-
},
|
|
210
|
-
...
|
|
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
|
|
216
|
-
let n =
|
|
217
|
-
r.has(n) ? r.delete(n) : r.add(n),
|
|
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
|
|
224
|
-
|
|
225
|
-
rowKey:
|
|
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
|
|
232
|
-
if (!
|
|
233
|
-
let r =
|
|
234
|
-
|
|
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:
|
|
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
|
|
244
|
-
|
|
249
|
+
function rt() {
|
|
250
|
+
N.value = null;
|
|
245
251
|
}
|
|
246
|
-
function
|
|
247
|
-
return
|
|
252
|
+
function it(e, t, n) {
|
|
253
|
+
return N.value?.rowKey === J(e, t) && N.value?.columnKey === n.key;
|
|
248
254
|
}
|
|
249
|
-
function
|
|
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 === " " && !
|
|
259
|
-
|
|
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
|
-
|
|
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
|
|
276
|
+
return C.sortable && e.sortable !== !1 || e.sortable === !0;
|
|
271
277
|
}
|
|
272
278
|
function Q(e) {
|
|
273
|
-
return
|
|
279
|
+
return C.resizable && e.resizable !== !1 || e.resizable === !0;
|
|
274
280
|
}
|
|
275
281
|
function $(e) {
|
|
276
|
-
let t =
|
|
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
|
|
285
|
+
function ot(e) {
|
|
280
286
|
if (!Z(e)) return;
|
|
281
|
-
let t =
|
|
282
|
-
|
|
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
|
|
288
|
-
let t =
|
|
293
|
+
function st(e) {
|
|
294
|
+
let t = R.value === e.key && z.value === "asc";
|
|
289
295
|
return `${e.label}:按${t ? "降" : "升"}序排列`;
|
|
290
296
|
}
|
|
291
|
-
function
|
|
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
|
-
|
|
294
|
-
...
|
|
299
|
+
M.value = {
|
|
300
|
+
...M.value,
|
|
295
301
|
[e.key]: i
|
|
296
|
-
},
|
|
302
|
+
}, w("column-resize", {
|
|
297
303
|
key: e.key,
|
|
298
304
|
width: i
|
|
299
305
|
});
|
|
300
306
|
}
|
|
301
|
-
function
|
|
302
|
-
Q(e) && t.button === 0 && (t.preventDefault(),
|
|
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(
|
|
306
|
-
}, document.addEventListener("pointermove",
|
|
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
|
|
309
|
-
|
|
314
|
+
function ut(e) {
|
|
315
|
+
P && ct(P.column, P.startWidth + e.clientX - P.startX);
|
|
310
316
|
}
|
|
311
|
-
function
|
|
312
|
-
|
|
317
|
+
function dt() {
|
|
318
|
+
P = null, document.removeEventListener("pointermove", ut);
|
|
313
319
|
}
|
|
314
|
-
function
|
|
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(
|
|
323
|
-
|
|
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
|
|
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
|
-
}]) }, [
|
|
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 ||
|
|
333
|
-
}, [
|
|
334
|
-
e.caption ? (
|
|
335
|
-
|
|
336
|
-
e.expandable ? (
|
|
337
|
-
e.selectable ? (
|
|
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":
|
|
342
|
-
"aria-label":
|
|
343
|
-
title:
|
|
344
|
-
disabled: e.loading || !
|
|
345
|
-
onClick:
|
|
346
|
-
}, [
|
|
347
|
-
icon:
|
|
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,
|
|
351
|
-
(
|
|
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:
|
|
355
|
-
style:
|
|
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) ?
|
|
360
|
-
}, [Z(n) ? (
|
|
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":
|
|
365
|
-
title:
|
|
372
|
+
"aria-label": st(n),
|
|
373
|
+
title: st(n),
|
|
366
374
|
disabled: e.loading,
|
|
367
|
-
onClick: (e) =>
|
|
368
|
-
}, [
|
|
369
|
-
icon:
|
|
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,
|
|
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(
|
|
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) =>
|
|
382
|
-
onKeydown: (e) =>
|
|
383
|
-
}, null, 40,
|
|
384
|
-
]),
|
|
385
|
-
e.expandable ? (
|
|
386
|
-
e.selectable ? (
|
|
387
|
-
(
|
|
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:
|
|
390
|
-
}, [e.filterable ? (
|
|
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:
|
|
402
|
+
value: O.value[e.key] || "",
|
|
395
403
|
"aria-label": `过滤${e.label}`,
|
|
396
404
|
placeholder: e.filterPlaceholder || `过滤${e.label}`,
|
|
397
|
-
onInput: (t) =>
|
|
398
|
-
}, null, 40,
|
|
399
|
-
])) :
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
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:
|
|
476
|
-
style:
|
|
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
|
-
}, [
|
|
478
|
+
}, [_(n.$slots, `summary-${e.key}`, {
|
|
481
479
|
column: e,
|
|
482
|
-
rows:
|
|
483
|
-
}, () => [
|
|
480
|
+
rows: B.value
|
|
481
|
+
}, () => [c(v(typeof e.summary == "function" ? e.summary(B.value, {
|
|
484
482
|
column: e,
|
|
485
|
-
rows:
|
|
483
|
+
rows: B.value
|
|
486
484
|
}) : ""), 1)], !0)], 6))), 128))
|
|
487
|
-
])])) :
|
|
488
|
-
], 16,
|
|
485
|
+
])])) : a("", !0)
|
|
486
|
+
], 16, pe)], 8, fe)], 2));
|
|
489
487
|
}
|
|
490
|
-
}), [["__scopeId", "data-v-
|
|
491
|
-
export {
|
|
488
|
+
}), [["__scopeId", "data-v-c1ac8a33"]]);
|
|
489
|
+
export { Ge as default };
|