@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.
- 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,16 +1,17 @@
|
|
|
1
1
|
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
2
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
import {
|
|
3
|
+
import { freezeLeaveLayout as n, presenceTransition as r } from "../../utils/motion.js";
|
|
4
|
+
import { useContentMotion as i } from "../../utils/content-motion.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import { Fragment as
|
|
6
|
+
import { Fragment as a, TransitionGroup as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, mergeProps as f, openBlock as p, ref as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, toRaw as y, unref as b, useAttrs as x, withCtx as S } from "vue";
|
|
6
7
|
// src/components/display/list.ce.vue
|
|
7
|
-
var
|
|
8
|
+
var C = { class: "kima-list__body" }, w = { key: 0 }, T = {
|
|
8
9
|
key: 0,
|
|
9
10
|
class: "kima-list__action"
|
|
10
|
-
},
|
|
11
|
+
}, E = {
|
|
11
12
|
key: "empty",
|
|
12
13
|
class: "kima-list__empty"
|
|
13
|
-
},
|
|
14
|
+
}, D = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
14
15
|
__name: "list.ce",
|
|
15
16
|
props: {
|
|
16
17
|
items: {
|
|
@@ -36,38 +37,43 @@ var x = { class: "kima-list__body" }, S = { key: 0 }, C = {
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
setup(t) {
|
|
39
|
-
let
|
|
40
|
-
|
|
40
|
+
let D = t, O = x(), k = m(null), { isCustomElement: A, hasNativeSlot: j } = e(k);
|
|
41
|
+
i(k, () => D.items);
|
|
42
|
+
let M = /* @__PURE__ */ new WeakMap(), N = 0;
|
|
43
|
+
function P(e, t) {
|
|
41
44
|
let n;
|
|
42
45
|
if (typeof e == "object" && e) {
|
|
43
|
-
let t =
|
|
44
|
-
t.id == null ? (
|
|
46
|
+
let t = y(e);
|
|
47
|
+
t.id == null ? (M.has(t) || M.set(t, ++N), n = `object:${M.get(t)}`) : n = `id:${typeof t.id}:${t.id}`;
|
|
45
48
|
} else n = `value:${typeof e}:${e}`;
|
|
46
|
-
let r =
|
|
49
|
+
let r = D.items.slice(0, t).filter((t) => Object.is(y(t), y(e))).length;
|
|
47
50
|
return `${n}:${r}`;
|
|
48
51
|
}
|
|
49
|
-
return (e,
|
|
52
|
+
return (e, i) => (p(), s(_(t.ordered ? "ol" : "ul"), f({
|
|
50
53
|
ref_key: "root",
|
|
51
|
-
ref:
|
|
54
|
+
ref: k
|
|
52
55
|
}, {
|
|
53
|
-
...
|
|
54
|
-
id:
|
|
56
|
+
...b(O),
|
|
57
|
+
id: b(A) ? void 0 : b(O).id
|
|
55
58
|
}, {
|
|
56
59
|
class: ["kima-list", { "kima-list--plain": t.variant === "plain" }],
|
|
57
60
|
style: { "--kima-list-gap": typeof t.gap == "number" ? `${t.gap}px` : t.gap || void 0 },
|
|
58
61
|
"aria-label": t.label
|
|
59
62
|
}), {
|
|
60
|
-
default:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
default: S(() => [g(e.$slots, "default", {}, () => [d(o, f({ name: "kima-list" }, {
|
|
64
|
+
...b(r),
|
|
65
|
+
onBeforeLeave: b(n)
|
|
66
|
+
}), {
|
|
67
|
+
default: S(() => [(p(!0), l(a, null, h(t.items, (t, n) => (p(), l("li", {
|
|
68
|
+
key: P(t, n),
|
|
63
69
|
class: "kima-list__item"
|
|
64
|
-
}, [
|
|
70
|
+
}, [g(e.$slots, "item", {
|
|
65
71
|
item: t,
|
|
66
72
|
index: n
|
|
67
|
-
}, () => [
|
|
73
|
+
}, () => [u("div", C, [u("strong", null, v(typeof t == "object" && t ? t.title : t), 1), t?.description ? (p(), l("p", w, v(t.description), 1)) : c("", !0)]), e.$slots.action ? (p(), l("div", T, [g(e.$slots, "action", {
|
|
68
74
|
item: t,
|
|
69
75
|
index: n
|
|
70
|
-
}, void 0, !0)])) :
|
|
76
|
+
}, void 0, !0)])) : c("", !0)], !0)]))), 128)), !t.items.length && !b(j)("default") ? (p(), l("li", E, v(t.emptyText), 1)) : c("", !0)]),
|
|
71
77
|
_: 3
|
|
72
78
|
}, 16)], !0)]),
|
|
73
79
|
_: 3
|
|
@@ -77,5 +83,5 @@ var x = { class: "kima-list__body" }, S = { key: 0 }, C = {
|
|
|
77
83
|
"aria-label"
|
|
78
84
|
]));
|
|
79
85
|
}
|
|
80
|
-
}), [["__scopeId", "data-v-
|
|
81
|
-
export {
|
|
86
|
+
}), [["__scopeId", "data-v-df3ec98f"]]);
|
|
87
|
+
export { D as default };
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
2
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
import {
|
|
3
|
+
import { freezeLeaveLayout as n, presenceTransition as r } from "../../utils/motion.js";
|
|
4
|
+
import { useContentMotion as i } from "../../utils/content-motion.js";
|
|
4
5
|
/* empty css */
|
|
5
|
-
import { Fragment as
|
|
6
|
+
import { Fragment as a, Transition as o, computed as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, mergeProps as f, openBlock as p, ref as m, renderList as h, renderSlot as g, unref as _, useAttrs as v, vShow as y, withCtx as b, withDirectives as x } from "vue";
|
|
6
7
|
// src/components/display/skeleton.ce.vue
|
|
7
|
-
var
|
|
8
|
+
var S = [
|
|
8
9
|
"aria-busy",
|
|
9
10
|
"aria-label",
|
|
10
11
|
"role"
|
|
11
|
-
],
|
|
12
|
+
], C = {
|
|
12
13
|
class: "kima-skeleton__placeholder",
|
|
13
14
|
"aria-hidden": "true"
|
|
14
|
-
},
|
|
15
|
+
}, w = {
|
|
15
16
|
key: 0,
|
|
16
17
|
class: "kima-skeleton__avatar"
|
|
17
|
-
},
|
|
18
|
+
}, T = { class: "kima-skeleton__lines" }, E = ["inert", "aria-hidden"], D = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
18
19
|
__name: "skeleton.ce",
|
|
19
20
|
props: {
|
|
20
21
|
loading: {
|
|
@@ -36,32 +37,38 @@ var b = [
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
setup(t) {
|
|
39
|
-
let
|
|
40
|
-
return (e,
|
|
40
|
+
let D = t, O = v(), k = m(null), { isCustomElement: A } = e(k), j = s(() => Number.isFinite(D.rows) ? Math.min(50, Math.max(1, Math.floor(D.rows))) : 3);
|
|
41
|
+
return i(k, () => D.loading), (e, i) => (p(), l("div", f({
|
|
41
42
|
ref_key: "root",
|
|
42
|
-
ref:
|
|
43
|
+
ref: k
|
|
43
44
|
}, {
|
|
44
|
-
...
|
|
45
|
-
id:
|
|
45
|
+
..._(O),
|
|
46
|
+
id: _(A) ? void 0 : _(O).id
|
|
46
47
|
}, {
|
|
47
48
|
class: ["kima-skeleton", { "kima-skeleton--animated": t.animated && t.loading }],
|
|
48
49
|
"aria-busy": t.loading || void 0,
|
|
49
50
|
"aria-label": t.loading ? t.label : void 0,
|
|
50
51
|
role: t.loading ? "status" : void 0
|
|
51
|
-
}), [
|
|
52
|
-
|
|
52
|
+
}), [d(o, f({ name: "kima-fade" }, {
|
|
53
|
+
..._(r),
|
|
54
|
+
onBeforeLeave: _(n)
|
|
55
|
+
}), {
|
|
56
|
+
default: b(() => [x(u("div", C, [t.avatar ? (p(), l("span", w)) : c("", !0), u("div", T, [(p(!0), l(a, null, h(j.value, (e) => (p(), l("span", {
|
|
53
57
|
key: e,
|
|
54
58
|
class: "kima-skeleton__line"
|
|
55
|
-
}))), 128))])], 512), [[
|
|
59
|
+
}))), 128))])], 512), [[y, t.loading]])]),
|
|
56
60
|
_: 1
|
|
57
|
-
}),
|
|
58
|
-
|
|
61
|
+
}, 16), d(o, f({ name: "kima-fade" }, {
|
|
62
|
+
..._(r),
|
|
63
|
+
onBeforeLeave: _(n)
|
|
64
|
+
}), {
|
|
65
|
+
default: b(() => [x(u("div", {
|
|
59
66
|
class: "kima-skeleton__content",
|
|
60
67
|
inert: t.loading,
|
|
61
68
|
"aria-hidden": t.loading || void 0
|
|
62
|
-
}, [
|
|
69
|
+
}, [g(e.$slots, "default", {}, void 0, !0)], 8, E), [[y, !t.loading]])]),
|
|
63
70
|
_: 3
|
|
64
|
-
}, 16)], 16,
|
|
71
|
+
}, 16)], 16, S));
|
|
65
72
|
}
|
|
66
|
-
}), [["__scopeId", "data-v-
|
|
67
|
-
export {
|
|
73
|
+
}), [["__scopeId", "data-v-92807af5"]]);
|
|
74
|
+
export { D as default };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useNativeSlots as e } from "../../utils/native-slots.js";
|
|
2
2
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
3
3
|
import n from "../core/icon.ce.js";
|
|
4
|
-
import {
|
|
5
|
-
import { displayStatus as
|
|
4
|
+
import { freezeLeaveLayout as r, presenceTransition as i } from "../../utils/motion.js";
|
|
5
|
+
import { displayStatus as a } from "../../utils/display-status.js";
|
|
6
|
+
import { useContentMotion as o } from "../../utils/content-motion.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { Fragment as
|
|
8
|
+
import { Fragment as s, TransitionGroup as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, mergeProps as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, useAttrs as b, withCtx as x } from "vue";
|
|
8
9
|
// src/components/display/timeline.ce.vue
|
|
9
|
-
var
|
|
10
|
+
var S = ["aria-label"], C = ["data-variant"], w = ["aria-label"], T = { class: "kima-timeline__body" }, E = ["datetime"], D = { key: 1 }, O = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
10
11
|
__name: "timeline.ce",
|
|
11
12
|
props: {
|
|
12
13
|
items: {
|
|
@@ -19,41 +20,48 @@ var b = ["aria-label"], x = ["data-variant"], S = ["aria-label"], C = { class: "
|
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
22
|
setup(t) {
|
|
22
|
-
let
|
|
23
|
-
return (e,
|
|
23
|
+
let O = t, k = b(), A = h(null), { isCustomElement: j } = e(A);
|
|
24
|
+
return o(A, () => O.items), (e, o) => (m(), u("ol", p({
|
|
24
25
|
ref_key: "root",
|
|
25
|
-
ref:
|
|
26
|
+
ref: A
|
|
26
27
|
}, {
|
|
27
|
-
...
|
|
28
|
-
id:
|
|
28
|
+
...y(k),
|
|
29
|
+
id: y(j) ? void 0 : y(k).id
|
|
29
30
|
}, {
|
|
30
31
|
class: "kima-timeline",
|
|
31
32
|
"aria-label": t.label
|
|
32
|
-
}), [
|
|
33
|
-
|
|
33
|
+
}), [f(c, p({
|
|
34
|
+
name: "kima-list",
|
|
35
|
+
tag: "div",
|
|
36
|
+
class: "kima-timeline__items"
|
|
37
|
+
}, {
|
|
38
|
+
...y(i),
|
|
39
|
+
onBeforeLeave: y(r)
|
|
40
|
+
}), {
|
|
41
|
+
default: x(() => [(m(!0), u(s, null, g(t.items, (t, r) => (m(), u("li", {
|
|
34
42
|
key: t.id ?? r,
|
|
35
43
|
class: "kima-timeline__item",
|
|
36
|
-
"data-variant":
|
|
37
|
-
}, [
|
|
44
|
+
"data-variant": y(a)(t.variant).variant
|
|
45
|
+
}, [d("span", {
|
|
38
46
|
class: "kima-timeline__marker",
|
|
39
47
|
role: "img",
|
|
40
|
-
"aria-label":
|
|
41
|
-
}, [
|
|
42
|
-
icon:
|
|
48
|
+
"aria-label": y(a)(t.variant).label
|
|
49
|
+
}, [f(n, {
|
|
50
|
+
icon: y(a)(t.variant).icon,
|
|
43
51
|
size: 24
|
|
44
|
-
}, null, 8, ["icon"])], 8,
|
|
52
|
+
}, null, 8, ["icon"])], 8, w), d("div", T, [_(e.$slots, "item", {
|
|
45
53
|
item: t,
|
|
46
54
|
index: r
|
|
47
55
|
}, () => [
|
|
48
|
-
t.time ? (
|
|
56
|
+
t.time ? (m(), u("time", {
|
|
49
57
|
key: 0,
|
|
50
58
|
datetime: t.datetime
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
t.description ? (
|
|
54
|
-
], !0)])], 8,
|
|
59
|
+
}, v(t.time), 9, E)) : l("", !0),
|
|
60
|
+
d("strong", null, v(t.title), 1),
|
|
61
|
+
t.description ? (m(), u("p", D, v(t.description), 1)) : l("", !0)
|
|
62
|
+
], !0)])], 8, C))), 128))]),
|
|
55
63
|
_: 3
|
|
56
|
-
}, 16)],
|
|
64
|
+
}, 16)], 16, S));
|
|
57
65
|
}
|
|
58
|
-
}), [["__scopeId", "data-v-
|
|
59
|
-
export {
|
|
66
|
+
}), [["__scopeId", "data-v-72323605"]]);
|
|
67
|
+
export { O as default };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "../core/button.ce.js";
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { freezeLeaveLayout as n, presenceTransition as r } from "../../utils/motion.js";
|
|
4
|
+
import i from "../core/icon-button.ce.js";
|
|
5
|
+
import a from "../core/tooltip.ce.js";
|
|
6
|
+
import { useContentMotion as o } from "../../utils/content-motion.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { ArrowDown01Icon as
|
|
8
|
+
import { Fragment as s, TransitionGroup as c, computed as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, mergeProps as m, openBlock as h, ref as g, renderList as _, renderSlot as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
|
|
9
|
+
import { ArrowDown01Icon as S, ArrowUp01Icon as C, Cancel01Icon as w } from "@hugeicons/core-free-icons";
|
|
9
10
|
// src/components/form-completion/dynamic-input.ce.vue
|
|
10
|
-
var
|
|
11
|
+
var T = ["aria-label"], E = { class: "kima-dynamic-input__actions" }, D = /*#__PURE__*/ e({
|
|
11
12
|
__name: "dynamic-input.ce",
|
|
12
13
|
props: {
|
|
13
14
|
modelValue: {
|
|
@@ -39,80 +40,86 @@ var C = ["aria-label"], w = { class: "kima-dynamic-input__actions" }, T = /*#__P
|
|
|
39
40
|
"remove",
|
|
40
41
|
"move"
|
|
41
42
|
],
|
|
42
|
-
setup(e, { expose:
|
|
43
|
-
let
|
|
44
|
-
function
|
|
45
|
-
return !e || typeof e != "object" ? `row-${++
|
|
43
|
+
setup(e, { expose: D, emit: O }) {
|
|
44
|
+
let k = e, A = O, j = 0, M = /* @__PURE__ */ new WeakMap();
|
|
45
|
+
function N(e) {
|
|
46
|
+
return !e || typeof e != "object" ? `row-${++j}` : (M.has(e) || M.set(e, e.id || `row-${++j}`), M.get(e));
|
|
46
47
|
}
|
|
47
|
-
let
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
let P = g(k.modelValue.map((e) => ({ ...e }))), F = l(() => k.disabled || P.value.length >= k.max), I = g(null);
|
|
49
|
+
o(I, () => P.value);
|
|
50
|
+
function L(e, t, n) {
|
|
51
|
+
P.value = e, A("update:modelValue", e.map((e) => ({ ...e }))), A("change", e.map((e) => ({ ...e }))), t && A(t, n);
|
|
50
52
|
}
|
|
51
|
-
function
|
|
52
|
-
if (
|
|
53
|
+
function R() {
|
|
54
|
+
if (F.value) return;
|
|
53
55
|
let e = {
|
|
54
|
-
...
|
|
55
|
-
id: `row-${++
|
|
56
|
+
...k.create(),
|
|
57
|
+
id: `row-${++j}`
|
|
56
58
|
};
|
|
57
|
-
|
|
59
|
+
L([...P.value, e], "add", {
|
|
58
60
|
row: e,
|
|
59
|
-
index:
|
|
61
|
+
index: P.value.length
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
|
-
function
|
|
63
|
-
if (
|
|
64
|
-
let t =
|
|
65
|
-
P
|
|
64
|
+
function z(e) {
|
|
65
|
+
if (k.disabled || P.value.length <= k.min) return;
|
|
66
|
+
let t = P.value[e];
|
|
67
|
+
L(P.value.filter((t, n) => n !== e), "remove", {
|
|
66
68
|
row: t,
|
|
67
69
|
index: e
|
|
68
70
|
});
|
|
69
71
|
}
|
|
70
|
-
function
|
|
72
|
+
function B(e, t) {
|
|
71
73
|
let n = e + t;
|
|
72
|
-
if (
|
|
73
|
-
let r = [...
|
|
74
|
-
[r[e], r[n]] = [r[n], r[e]],
|
|
74
|
+
if (k.disabled || n < 0 || n >= P.value.length) return;
|
|
75
|
+
let r = [...P.value];
|
|
76
|
+
[r[e], r[n]] = [r[n], r[e]], L(r, "move", {
|
|
75
77
|
row: r[n],
|
|
76
78
|
from: e,
|
|
77
79
|
to: n
|
|
78
80
|
});
|
|
79
81
|
}
|
|
80
|
-
function
|
|
81
|
-
let n = [...
|
|
82
|
-
n[e] = t,
|
|
82
|
+
function V(e, t) {
|
|
83
|
+
let n = [...P.value];
|
|
84
|
+
n[e] = t, L(n);
|
|
83
85
|
}
|
|
84
|
-
function
|
|
85
|
-
return
|
|
86
|
+
function H() {
|
|
87
|
+
return P.value.every((e) => e && e.valid !== !1);
|
|
86
88
|
}
|
|
87
|
-
return
|
|
88
|
-
add:
|
|
89
|
-
remove:
|
|
90
|
-
move:
|
|
91
|
-
validate:
|
|
92
|
-
rows:
|
|
93
|
-
}), (
|
|
89
|
+
return D({
|
|
90
|
+
add: R,
|
|
91
|
+
remove: z,
|
|
92
|
+
move: B,
|
|
93
|
+
validate: H,
|
|
94
|
+
rows: P
|
|
95
|
+
}), (o, l) => (h(), u("div", {
|
|
96
|
+
ref_key: "root",
|
|
97
|
+
ref: I,
|
|
94
98
|
class: "kima-dynamic-input",
|
|
95
99
|
role: "group",
|
|
96
100
|
"aria-label": e.label
|
|
97
|
-
}, [
|
|
101
|
+
}, [p(c, m({
|
|
98
102
|
tag: "div",
|
|
99
103
|
name: "kima-list"
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
}, {
|
|
105
|
+
...b(r),
|
|
106
|
+
onBeforeLeave: b(n)
|
|
107
|
+
}, { class: "kima-dynamic-input__rows" }), {
|
|
108
|
+
default: x(() => [(h(!0), u(s, null, _(P.value, (t, n) => (h(), u("div", {
|
|
109
|
+
key: N(t),
|
|
103
110
|
class: "kima-dynamic-input__row"
|
|
104
|
-
}, [
|
|
111
|
+
}, [v(o.$slots, "default", {
|
|
105
112
|
row: t,
|
|
106
113
|
index: n,
|
|
107
|
-
id:
|
|
108
|
-
update: (e) =>
|
|
109
|
-
}, () => [
|
|
110
|
-
|
|
111
|
-
default:
|
|
112
|
-
icon:
|
|
114
|
+
id: N(t),
|
|
115
|
+
update: (e) => V(n, e)
|
|
116
|
+
}, () => [d("output", null, y(JSON.stringify(t)), 1)], !0), d("div", E, [
|
|
117
|
+
p(a, { text: "上移" }, {
|
|
118
|
+
default: x(() => [p(i, {
|
|
119
|
+
icon: b(C),
|
|
113
120
|
label: `${e.label}上移第${n + 1}项`,
|
|
114
121
|
disabled: e.disabled || n === 0,
|
|
115
|
-
onClick: (e) =>
|
|
122
|
+
onClick: (e) => B(n, -1)
|
|
116
123
|
}, null, 8, [
|
|
117
124
|
"icon",
|
|
118
125
|
"label",
|
|
@@ -121,12 +128,12 @@ var C = ["aria-label"], w = { class: "kima-dynamic-input__actions" }, T = /*#__P
|
|
|
121
128
|
])]),
|
|
122
129
|
_: 2
|
|
123
130
|
}, 1024),
|
|
124
|
-
|
|
125
|
-
default:
|
|
126
|
-
icon:
|
|
131
|
+
p(a, { text: "下移" }, {
|
|
132
|
+
default: x(() => [p(i, {
|
|
133
|
+
icon: b(S),
|
|
127
134
|
label: `${e.label}下移第${n + 1}项`,
|
|
128
|
-
disabled: e.disabled || n ===
|
|
129
|
-
onClick: (e) =>
|
|
135
|
+
disabled: e.disabled || n === P.value.length - 1,
|
|
136
|
+
onClick: (e) => B(n, 1)
|
|
130
137
|
}, null, 8, [
|
|
131
138
|
"icon",
|
|
132
139
|
"label",
|
|
@@ -135,12 +142,12 @@ var C = ["aria-label"], w = { class: "kima-dynamic-input__actions" }, T = /*#__P
|
|
|
135
142
|
])]),
|
|
136
143
|
_: 2
|
|
137
144
|
}, 1024),
|
|
138
|
-
|
|
139
|
-
default:
|
|
140
|
-
icon:
|
|
145
|
+
p(a, { text: "移除" }, {
|
|
146
|
+
default: x(() => [p(i, {
|
|
147
|
+
icon: b(w),
|
|
141
148
|
label: `移除第${n + 1}项`,
|
|
142
|
-
disabled: e.disabled ||
|
|
143
|
-
onClick: (e) =>
|
|
149
|
+
disabled: e.disabled || P.value.length <= e.min,
|
|
150
|
+
onClick: (e) => z(n)
|
|
144
151
|
}, null, 8, [
|
|
145
152
|
"icon",
|
|
146
153
|
"label",
|
|
@@ -151,14 +158,14 @@ var C = ["aria-label"], w = { class: "kima-dynamic-input__actions" }, T = /*#__P
|
|
|
151
158
|
}, 1024)
|
|
152
159
|
])]))), 128))]),
|
|
153
160
|
_: 3
|
|
154
|
-
}, 16),
|
|
161
|
+
}, 16), p(t, {
|
|
155
162
|
variant: "tonal",
|
|
156
|
-
disabled:
|
|
157
|
-
onClick:
|
|
163
|
+
disabled: F.value,
|
|
164
|
+
onClick: R
|
|
158
165
|
}, {
|
|
159
|
-
default:
|
|
166
|
+
default: x(() => [...l[0] ||= [f("添加字段", -1)]]),
|
|
160
167
|
_: 1
|
|
161
|
-
}, 8, ["disabled"])], 8,
|
|
168
|
+
}, 8, ["disabled"])], 8, T));
|
|
162
169
|
}
|
|
163
|
-
}, [["__scopeId", "data-v-
|
|
164
|
-
export {
|
|
170
|
+
}, [["__scopeId", "data-v-6a5bc26a"]]);
|
|
171
|
+
export { D as default };
|