@kernel4632/kima 0.0.0-stage → 0.6.0
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/LICENSE +21 -0
- package/README.md +166 -2
- package/dist/THIRD_PARTY_NOTICES.txt +2676 -0
- package/dist/kima-elements-core.js +53209 -0
- package/dist/kima-elements.js +126371 -0
- package/dist/kima-theme.js +1583 -0
- package/dist/kima.js +141 -0
- package/dist/style.css +2 -0
- package/dist/vue/_virtual/_plugin-vue_export-helper.js +7 -0
- package/dist/vue/components/advanced-input/calendar.ce.js +216 -0
- package/dist/vue/components/advanced-input/date-range-picker.ce.js +224 -0
- package/dist/vue/components/advanced-input/editable.ce.js +160 -0
- package/dist/vue/components/advanced-input/mention.ce.js +181 -0
- package/dist/vue/components/advanced-input/range-slider.ce.js +111 -0
- package/dist/vue/components/advanced-input/time-range-picker.ce.js +120 -0
- package/dist/vue/components/advanced-input/transfer.ce.js +192 -0
- package/dist/vue/components/content/chart.ce.js +282 -0
- package/dist/vue/components/content/code-editor.ce.js +309 -0
- package/dist/vue/components/content/equation.ce.js +69 -0
- package/dist/vue/components/content/heatmap.ce.js +148 -0
- package/dist/vue/components/content/rich-text-editor.ce.js +319 -0
- package/dist/vue/components/core/badge.ce.js +66 -0
- package/dist/vue/components/core/button-group.ce.js +142 -0
- package/dist/vue/components/core/button.ce.js +73 -0
- package/dist/vue/components/core/card.ce.js +73 -0
- package/dist/vue/components/core/cascader.ce.js +329 -0
- package/dist/vue/components/core/checkbox.ce.js +116 -0
- package/dist/vue/components/core/code-block.ce.js +108 -0
- package/dist/vue/components/core/combobox.ce.js +354 -0
- package/dist/vue/components/core/date-picker.ce.js +433 -0
- package/dist/vue/components/core/dialog.ce.js +118 -0
- package/dist/vue/components/core/divider.ce.js +49 -0
- package/dist/vue/components/core/drawer.ce.js +235 -0
- package/dist/vue/components/core/empty-state.ce.js +58 -0
- package/dist/vue/components/core/icon-button.ce.js +93 -0
- package/dist/vue/components/core/icon.ce.js +42 -0
- package/dist/vue/components/core/layout.ce.js +68 -0
- package/dist/vue/components/core/menu.ce.js +178 -0
- package/dist/vue/components/core/notification.ce.js +158 -0
- package/dist/vue/components/core/pagination.ce.js +158 -0
- package/dist/vue/components/core/progress.ce.js +49 -0
- package/dist/vue/components/core/select.ce.js +325 -0
- package/dist/vue/components/core/slider.ce.js +116 -0
- package/dist/vue/components/core/switch.ce.js +100 -0
- package/dist/vue/components/core/tabs.ce.js +193 -0
- package/dist/vue/components/core/text-field.ce.js +194 -0
- package/dist/vue/components/core/time-picker.ce.js +486 -0
- package/dist/vue/components/core/tooltip.ce.js +125 -0
- package/dist/vue/components/core/tree.ce.js +248 -0
- package/dist/vue/components/core/virtual-scroll.ce.js +176 -0
- package/dist/vue/components/data/copy-button.ce.js +75 -0
- package/dist/vue/components/data/image-preview.ce.js +226 -0
- package/dist/vue/components/data/infinite-scroll.ce.js +126 -0
- package/dist/vue/components/data/long-text.ce.js +70 -0
- package/dist/vue/components/data/relative-time.ce.js +77 -0
- package/dist/vue/components/data/ring-progress.ce.js +87 -0
- package/dist/vue/components/data/table.ce.js +491 -0
- package/dist/vue/components/data/virtual-table.ce.js +178 -0
- package/dist/vue/components/data/virtual-tree.ce.js +213 -0
- package/dist/vue/components/display/alert.ce.js +101 -0
- package/dist/vue/components/display/avatar-group.ce.js +65 -0
- package/dist/vue/components/display/avatar.ce.js +84 -0
- package/dist/vue/components/display/blockquote.ce.js +44 -0
- package/dist/vue/components/display/countdown.ce.js +77 -0
- package/dist/vue/components/display/descriptions.ce.js +43 -0
- package/dist/vue/components/display/highlight.ce.js +48 -0
- package/dist/vue/components/display/image.ce.js +146 -0
- package/dist/vue/components/display/list.ce.js +68 -0
- package/dist/vue/components/display/result.ce.js +57 -0
- package/dist/vue/components/display/skeleton.ce.js +67 -0
- package/dist/vue/components/display/spinner.ce.js +42 -0
- package/dist/vue/components/display/statistic.ce.js +71 -0
- package/dist/vue/components/display/timeline.ce.js +59 -0
- package/dist/vue/components/form-completion/angle-slider.ce.js +103 -0
- package/dist/vue/components/form-completion/color-picker.ce.js +286 -0
- package/dist/vue/components/form-completion/date-field.ce.js +131 -0
- package/dist/vue/components/form-completion/dynamic-input.ce.js +158 -0
- package/dist/vue/components/form-completion/form.ce.js +248 -0
- package/dist/vue/components/form-completion/json-input.ce.js +114 -0
- package/dist/vue/components/form-completion/masked-input.ce.js +88 -0
- package/dist/vue/components/form-completion/period-picker.ce.js +147 -0
- package/dist/vue/components/form-completion/time-field.ce.js +120 -0
- package/dist/vue/components/form-completion/upload-manager.ce.js +223 -0
- package/dist/vue/components/foundation/banner.ce.js +106 -0
- package/dist/vue/components/foundation/error-state.ce.js +108 -0
- package/dist/vue/components/foundation/field-group.ce.js +146 -0
- package/dist/vue/components/foundation/flex.ce.js +60 -0
- package/dist/vue/components/foundation/grid.ce.js +52 -0
- package/dist/vue/components/foundation/input-group.ce.js +34 -0
- package/dist/vue/components/foundation/page-header.ce.js +55 -0
- package/dist/vue/components/foundation/time-display.ce.js +129 -0
- package/dist/vue/components/foundation/typography.ce.js +71 -0
- package/dist/vue/components/input/checkbox-group.ce.js +93 -0
- package/dist/vue/components/input/field.ce.js +74 -0
- package/dist/vue/components/input/file-upload.ce.js +142 -0
- package/dist/vue/components/input/number-field.ce.js +103 -0
- package/dist/vue/components/input/pin-input.ce.js +112 -0
- package/dist/vue/components/input/radio-group.ce.js +96 -0
- package/dist/vue/components/input/rating.ce.js +115 -0
- package/dist/vue/components/input/tags-input.ce.js +153 -0
- package/dist/vue/components/input/textarea.ce.js +180 -0
- package/dist/vue/components/input/toggle.ce.js +58 -0
- package/dist/vue/components/interaction/chip.ce.js +95 -0
- package/dist/vue/components/interaction/command.ce.js +161 -0
- package/dist/vue/components/interaction/context-menu.ce.js +113 -0
- package/dist/vue/components/interaction/hover-card.ce.js +92 -0
- package/dist/vue/components/interaction/loading-overlay.ce.js +70 -0
- package/dist/vue/components/interaction/menubar.ce.js +134 -0
- package/dist/vue/components/interaction/multi-select.ce.js +264 -0
- package/dist/vue/components/interaction/popconfirm.ce.js +95 -0
- package/dist/vue/components/interaction/popover.ce.js +83 -0
- package/dist/vue/components/interaction/tree-select.ce.js +195 -0
- package/dist/vue/components/navigation/accordion.ce.js +114 -0
- package/dist/vue/components/navigation/anchor.ce.js +125 -0
- package/dist/vue/components/navigation/back-top.ce.js +67 -0
- package/dist/vue/components/navigation/breadcrumb.ce.js +48 -0
- package/dist/vue/components/navigation/carousel.ce.js +114 -0
- package/dist/vue/components/navigation/collapsible.ce.js +57 -0
- package/dist/vue/components/navigation/link.ce.js +62 -0
- package/dist/vue/components/navigation/navigation-menu.ce.js +91 -0
- package/dist/vue/components/navigation/overflow-list.ce.js +67 -0
- package/dist/vue/components/navigation/scroll-area.ce.js +47 -0
- package/dist/vue/components/navigation/splitter.ce.js +131 -0
- package/dist/vue/components/navigation/stepper.ce.js +74 -0
- package/dist/vue/components/navigation/toolbar.ce.js +93 -0
- package/dist/vue/components/navigation/visually-hidden.ce.js +16 -0
- package/dist/vue/components/shell/app-shell.ce.js +87 -0
- package/dist/vue/components/shell/config-provider.ce.js +110 -0
- package/dist/vue/components/shell/marquee.ce.js +92 -0
- package/dist/vue/components/shell/masonry.ce.js +50 -0
- package/dist/vue/components/shell/sidebar.ce.js +125 -0
- package/dist/vue/components/utility/affix.ce.js +64 -0
- package/dist/vue/components/utility/alert-dialog.ce.js +124 -0
- package/dist/vue/components/utility/animated-number.ce.js +66 -0
- package/dist/vue/components/utility/float-button.ce.js +104 -0
- package/dist/vue/components/utility/listbox.ce.js +81 -0
- package/dist/vue/components/utility/loading-bar.ce.js +85 -0
- package/dist/vue/components/utility/log-viewer.ce.js +124 -0
- package/dist/vue/components/utility/notification-queue.ce.js +109 -0
- package/dist/vue/components/utility/progress-group.ce.js +59 -0
- package/dist/vue/components/utility/qr-code.ce.js +62 -0
- package/dist/vue/components/utility/tag-group.ce.js +124 -0
- package/dist/vue/components/utility/tour.ce.js +214 -0
- package/dist/vue/components/utility/virtual-select.ce.js +207 -0
- package/dist/vue/components/utility/watermark.ce.js +44 -0
- package/dist/vue/internal/menu-items.js +184 -0
- package/dist/vue/internal/navigation-items.js +110 -0
- package/dist/vue/utils/code-highlight.js +142 -0
- package/dist/vue/utils/config.js +47 -0
- package/dist/vue/utils/content-motion.js +37 -0
- package/dist/vue/utils/content.js +83 -0
- package/dist/vue/utils/display-status.js +31 -0
- package/dist/vue/utils/foundation.js +65 -0
- package/dist/vue/utils/input-state.js +38 -0
- package/dist/vue/utils/interaction.js +103 -0
- package/dist/vue/utils/local-date.js +48 -0
- package/dist/vue/utils/motion.js +80 -0
- package/dist/vue/utils/native-slots.js +30 -0
- package/dist/vue/utils/navigation.js +44 -0
- package/dist/vue/utils/notifications.js +60 -0
- package/dist/vue/utils/qr.js +20 -0
- package/dist/vue/utils/remote-options.js +65 -0
- package/dist/vue/utils/ripple.js +20 -0
- package/dist/vue/utils/scoped-slots.js +22 -0
- package/dist/vue/utils/shell.js +43 -0
- package/dist/vue/utils/theme.js +50 -0
- package/dist/vue/utils/utility-choice.js +56 -0
- package/package.json +99 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { onBeforeUnmount as e, ref as t, watch as n } from "vue";
|
|
2
|
+
// src/utils/remote-options.js
|
|
3
|
+
function r(r, i, a, o, s) {
|
|
4
|
+
let c = t([]), l = t(!1), u = t(""), d = null, f = null, p = 0;
|
|
5
|
+
function m() {
|
|
6
|
+
clearTimeout(d), d = null, f?.abort(), f = null;
|
|
7
|
+
}
|
|
8
|
+
async function h(e, t) {
|
|
9
|
+
let n = r.value;
|
|
10
|
+
if (typeof n != "function") return;
|
|
11
|
+
f = new AbortController();
|
|
12
|
+
let i = f.signal;
|
|
13
|
+
l.value = !0, u.value = "", s?.("options-loading", { search: e });
|
|
14
|
+
let a = Math.max(0, Number(o.value) || 0) + 1;
|
|
15
|
+
try {
|
|
16
|
+
let r, o;
|
|
17
|
+
for (let s = 0; s < a; s += 1) {
|
|
18
|
+
if (i.aborted || t !== p) return;
|
|
19
|
+
try {
|
|
20
|
+
r = await n(e, { signal: i }), o = null;
|
|
21
|
+
break;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
if (o = e, i.aborted || t !== p) return;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (o) throw o;
|
|
27
|
+
if (i.aborted || t !== p) return;
|
|
28
|
+
let l = Array.isArray(r) ? r : Array.isArray(r?.items) ? r.items : [];
|
|
29
|
+
c.value = l, s?.("options-load", {
|
|
30
|
+
search: e,
|
|
31
|
+
items: l
|
|
32
|
+
});
|
|
33
|
+
} catch (n) {
|
|
34
|
+
if (i.aborted || t !== p) return;
|
|
35
|
+
u.value = n?.message || "选项加载失败", c.value = [], s?.("options-error", {
|
|
36
|
+
search: e,
|
|
37
|
+
error: n
|
|
38
|
+
});
|
|
39
|
+
} finally {
|
|
40
|
+
t === p && (l.value = !1, f = null);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function g(e = !1) {
|
|
44
|
+
if (m(), typeof r.value != "function") {
|
|
45
|
+
l.value = !1, u.value = "", c.value = [];
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
let t = ++p, n = String(i.value ?? ""), o = e ? 0 : Math.max(0, Number(a.value) || 0);
|
|
49
|
+
d = setTimeout(() => {
|
|
50
|
+
d = null, h(n, t);
|
|
51
|
+
}, o);
|
|
52
|
+
}
|
|
53
|
+
function _() {
|
|
54
|
+
g(!0);
|
|
55
|
+
}
|
|
56
|
+
return n([r, i], () => g(), { immediate: !0 }), e(() => {
|
|
57
|
+
p += 1, m();
|
|
58
|
+
}), {
|
|
59
|
+
items: c,
|
|
60
|
+
loading: l,
|
|
61
|
+
error: u,
|
|
62
|
+
retry: _
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export { r as useRemoteOptions };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { onBeforeUnmount as e, onMounted as t } from "vue";
|
|
2
|
+
// src/utils/ripple.js
|
|
3
|
+
function n(n) {
|
|
4
|
+
let r = null;
|
|
5
|
+
function i(e) {
|
|
6
|
+
if (!r || e.button !== 0 || r.matches(":disabled, [aria-disabled='true']")) return;
|
|
7
|
+
let t = getComputedStyle(r).position;
|
|
8
|
+
if (t !== "relative" && t !== "absolute" && t !== "fixed") return;
|
|
9
|
+
let n = document.createElement("span");
|
|
10
|
+
n.className = "kima-ripple";
|
|
11
|
+
let i = () => {
|
|
12
|
+
n.getAnimations().some((e) => e.playState === "running") || n.remove();
|
|
13
|
+
};
|
|
14
|
+
n.addEventListener("animationend", i), setTimeout(i, 700), r.append(n);
|
|
15
|
+
}
|
|
16
|
+
t(() => {
|
|
17
|
+
r = n.value, r?.addEventListener("pointerdown", i);
|
|
18
|
+
}), e(() => r?.removeEventListener("pointerdown", i));
|
|
19
|
+
}
|
|
20
|
+
export { n as useRipple };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getCurrentInstance as e, useHost as t } from "vue";
|
|
2
|
+
// src/utils/scoped-slots.js
|
|
3
|
+
function n() {
|
|
4
|
+
let n = !!e()?.ce, r = n ? t() : null, i = r ? Object.values(r._slots || {}).flat() : [];
|
|
5
|
+
if (r && !r.__kimaScopedOutlets) {
|
|
6
|
+
r.__kimaScopedOutlets = !0;
|
|
7
|
+
let e = r._getSlots;
|
|
8
|
+
r._getSlots = function() {
|
|
9
|
+
return e.call(this).filter((e) => {
|
|
10
|
+
for (let t = e.parentElement; t; t = t.parentElement) if (t.localName.startsWith("kima-")) return t === r;
|
|
11
|
+
return !1;
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
native: n,
|
|
17
|
+
vOutlet: { mounted(e, t) {
|
|
18
|
+
for (let n of i) (n.nodeType === 1 && n.getAttribute("slot") || "default") === (t.value || "default") && e.append(n);
|
|
19
|
+
} }
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export { n as useScopedSlots };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { computed as e, getCurrentInstance as t, onBeforeUnmount as n, onMounted as r, ref as i, shallowRef as a, useHost as o, watch as s } from "vue";
|
|
2
|
+
// src/utils/shell.js
|
|
3
|
+
function c(n, r, i) {
|
|
4
|
+
let c = t(), l = c?.ce ? o() : null, u = a(n[r]), d = r.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`), f = () => !l && (Object.hasOwn(c.vnode.props || {}, r) || Object.hasOwn(c.vnode.props || {}, d));
|
|
5
|
+
s(() => n[r], (e) => {
|
|
6
|
+
u.value = e;
|
|
7
|
+
});
|
|
8
|
+
let p = e(() => f() ? n[r] : u.value);
|
|
9
|
+
function m(e) {
|
|
10
|
+
Object.is(p.value, e) || (f() || (u.value = e), l && (l[r] = e), i(`update:${r}`, e));
|
|
11
|
+
}
|
|
12
|
+
return [p, m];
|
|
13
|
+
}
|
|
14
|
+
function l(e, t) {
|
|
15
|
+
let [n, r] = c(e, "checked", t);
|
|
16
|
+
function i(e, i) {
|
|
17
|
+
let a = e.type === "radio" ? e.group || "default" : e.value, o = {
|
|
18
|
+
...n.value,
|
|
19
|
+
[a]: i
|
|
20
|
+
};
|
|
21
|
+
r(o), t("check", o, e);
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
checked: n,
|
|
25
|
+
check: i
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function u(e, t, a = !1) {
|
|
29
|
+
let o = i(!1), c;
|
|
30
|
+
return r(() => {
|
|
31
|
+
let n = a ? e.value.closest("kima-sidebar")?.parentElement || e.value.parentElement : e.value, r = () => {
|
|
32
|
+
o.value = n.getBoundingClientRect().width < Number(t());
|
|
33
|
+
};
|
|
34
|
+
c = new ResizeObserver(r), c.observe(n), r();
|
|
35
|
+
}), s(t, () => {
|
|
36
|
+
e.value && (o.value = e.value.getBoundingClientRect().width < Number(t()));
|
|
37
|
+
}), n(() => c?.disconnect()), o;
|
|
38
|
+
}
|
|
39
|
+
var d = (e) => String(e.value ?? e.href ?? e.label);
|
|
40
|
+
function f(e, t) {
|
|
41
|
+
return d(e) === t || (e.children || []).some((e) => f(e, t));
|
|
42
|
+
}
|
|
43
|
+
export { f as navContains, d as navKey, l as useMenuChecks, u as useNarrow, c as useShellModel };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Hct as e, MaterialDynamicColors as t, SchemeMonochrome as n, SchemeNeutral as r, SchemeTonalSpot as i, argbFromHex as a, hexFromArgb as o } from "@material/material-color-utilities";
|
|
2
|
+
// src/utils/theme.js
|
|
3
|
+
var s = "#61afef", c = "tonal-spot", l = [
|
|
4
|
+
["surface", "页面背景"],
|
|
5
|
+
["surfaceContainerLowest", "最低层容器"],
|
|
6
|
+
["surfaceContainerLow", "低层容器"],
|
|
7
|
+
["surfaceContainer", "主容器"],
|
|
8
|
+
["surfaceContainerHigh", "高层容器"],
|
|
9
|
+
["surfaceContainerHighest", "最高层容器"],
|
|
10
|
+
["onSurface", "主文字"],
|
|
11
|
+
["onSurfaceVariant", "次要文字"],
|
|
12
|
+
["outline", "强描边"],
|
|
13
|
+
["outlineVariant", "弱描边"],
|
|
14
|
+
["primary", "主操作"],
|
|
15
|
+
["onPrimary", "主操作上的文字"],
|
|
16
|
+
["primaryContainer", "柔和主操作"],
|
|
17
|
+
["onPrimaryContainer", "柔和主操作上的文字"],
|
|
18
|
+
["secondaryContainer", "次操作"],
|
|
19
|
+
["onSecondaryContainer", "次操作上的文字"],
|
|
20
|
+
["tertiaryContainer", "强调色"],
|
|
21
|
+
["onTertiaryContainer", "强调色上的文字"],
|
|
22
|
+
["error", "危险操作"],
|
|
23
|
+
["onError", "危险操作上的文字"],
|
|
24
|
+
["errorContainer", "危险柔和"],
|
|
25
|
+
["onErrorContainer", "危险柔和上的文字"],
|
|
26
|
+
["inverseSurface", "反色表面(提示条)"],
|
|
27
|
+
["inverseOnSurface", "反色表面上的文字"],
|
|
28
|
+
["scrim", "抽屉背后的遮罩"]
|
|
29
|
+
], u = {
|
|
30
|
+
"tonal-spot": i,
|
|
31
|
+
monochrome: n,
|
|
32
|
+
neutral: r
|
|
33
|
+
};
|
|
34
|
+
function d(e) {
|
|
35
|
+
return e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
36
|
+
}
|
|
37
|
+
function f(n, { isDark: r = !0, variant: s = c } = {}) {
|
|
38
|
+
let f = new (u[s] || i)(e.fromInt(a(n)), r, 0), p = {};
|
|
39
|
+
for (let [e] of l) p[d(e)] = o(t[e].getArgb(f));
|
|
40
|
+
return p;
|
|
41
|
+
}
|
|
42
|
+
function p(e, { isDark: t = !0, variant: n = c, target: r } = {}) {
|
|
43
|
+
let i = f(e, {
|
|
44
|
+
isDark: t,
|
|
45
|
+
variant: n
|
|
46
|
+
}), a = r || document.documentElement;
|
|
47
|
+
for (let [e, t] of Object.entries(i)) a.style.setProperty(`--kima-color-${e}`, t);
|
|
48
|
+
return i;
|
|
49
|
+
}
|
|
50
|
+
export { p as applyPalette, d as cssName, s as defaultSeed, c as defaultVariant, f as generatePalette, l as paletteRoles };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useInteractionModel as e, useInteractionReset as t } from "./interaction.js";
|
|
2
|
+
import { computed as n, nextTick as r, ref as i, useId as a, watch as o } from "vue";
|
|
3
|
+
// src/utils/utility-choice.js
|
|
4
|
+
function s(s, c, l, u) {
|
|
5
|
+
let [d, f] = e(s, "modelValue", c), p = i(""), m = i(-1), h = `kima-choice-${a()}`, g = n(() => s.options.map((e, t) => typeof e == "object" && e ? {
|
|
6
|
+
...e,
|
|
7
|
+
index: t
|
|
8
|
+
} : {
|
|
9
|
+
value: e,
|
|
10
|
+
label: String(e),
|
|
11
|
+
index: t
|
|
12
|
+
})), _ = n(() => g.value.filter((e) => String(e.label ?? e.value).toLocaleLowerCase().includes(p.value.toLocaleLowerCase()))), v = n(() => _.value.flatMap((e, t) => e.disabled ? [] : [t])), y = (e) => s.multiple ? (Array.isArray(d.value) ? d.value : []).includes(e.value) : Object.is(d.value, e.value);
|
|
13
|
+
function b(e) {
|
|
14
|
+
if (!e || e.disabled || s.disabled) return;
|
|
15
|
+
let t = Array.isArray(d.value) ? d.value : [];
|
|
16
|
+
f(s.multiple ? y(e) ? t.filter((t) => !Object.is(t, e.value)) : [...t, e.value] : e.value), c("change", d.value);
|
|
17
|
+
}
|
|
18
|
+
let x = n(() => s.multiple ? Array.isArray(d.value) ? d.value : [] : d.value == null || d.value === "" ? [] : [d.value]);
|
|
19
|
+
function S(e, t = !1) {
|
|
20
|
+
if (s.disabled || e.isComposing || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
21
|
+
let n = v.value;
|
|
22
|
+
if (["Enter", " "].includes(e.key)) {
|
|
23
|
+
e.preventDefault(), b(_.value[m.value]);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (![
|
|
27
|
+
"ArrowDown",
|
|
28
|
+
"ArrowUp",
|
|
29
|
+
"Home",
|
|
30
|
+
"End"
|
|
31
|
+
].includes(e.key)) return;
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
let i = n.indexOf(m.value), a = e.key === "ArrowUp" ? -1 : 1;
|
|
34
|
+
m.value = e.key === "Home" ? n[0] ?? -1 : e.key === "End" ? n.at(-1) ?? -1 : n[i < 0 ? a > 0 ? 0 : n.length - 1 : (i + a + n.length) % n.length] ?? -1, t && r(() => l.value?.querySelector(`[id="${h}-${m.value}"]`)?.focus());
|
|
35
|
+
}
|
|
36
|
+
return o(_, () => {
|
|
37
|
+
let e = _.value.findIndex((e) => !e.disabled && y(e));
|
|
38
|
+
m.value = e >= 0 ? e : v.value[0] ?? -1;
|
|
39
|
+
}, { immediate: !0 }), t(l, d, f, () => {
|
|
40
|
+
p.value = "", u?.();
|
|
41
|
+
}), {
|
|
42
|
+
value: d,
|
|
43
|
+
values: x,
|
|
44
|
+
update: f,
|
|
45
|
+
query: p,
|
|
46
|
+
active: m,
|
|
47
|
+
id: h,
|
|
48
|
+
options: g,
|
|
49
|
+
filtered: _,
|
|
50
|
+
enabled: v,
|
|
51
|
+
selected: y,
|
|
52
|
+
choose: b,
|
|
53
|
+
move: S
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export { s as useUtilityChoice };
|
package/package.json
CHANGED
|
@@ -1,6 +1,101 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kernel4632/kima",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"description": "KIMA (Kinetic, Interaction, Motion, Alive) - a Material 3 style Web UI design system and component library.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/kernel4632/kima.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/kernel4632/kima#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/kernel4632/kima/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"vue",
|
|
17
|
+
"web-components",
|
|
18
|
+
"design-system",
|
|
19
|
+
"kima"
|
|
20
|
+
],
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"main": "./dist/kima.js",
|
|
25
|
+
"module": "./dist/kima.js",
|
|
26
|
+
"style": "./dist/style.css",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": "./dist/kima.js",
|
|
30
|
+
"default": "./dist/kima.js"
|
|
31
|
+
},
|
|
32
|
+
"./elements": {
|
|
33
|
+
"import": "./dist/kima-elements.js",
|
|
34
|
+
"default": "./dist/kima-elements.js"
|
|
35
|
+
},
|
|
36
|
+
"./elements/core": {
|
|
37
|
+
"import": "./dist/kima-elements-core.js",
|
|
38
|
+
"default": "./dist/kima-elements-core.js"
|
|
39
|
+
},
|
|
40
|
+
"./style.css": "./dist/style.css",
|
|
41
|
+
"./theme": "./dist/kima-theme.js",
|
|
42
|
+
"./package.json": "./package.json"
|
|
43
|
+
},
|
|
44
|
+
"sideEffects": [
|
|
45
|
+
"**/*.css",
|
|
46
|
+
"./dist/kima-elements.js",
|
|
47
|
+
"./dist/kima-elements-core.js"
|
|
48
|
+
],
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"registry": "https://registry.npmjs.org"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"dev": "vite",
|
|
55
|
+
"build": "vite build",
|
|
56
|
+
"build:lib": "node scripts/build-lib.js",
|
|
57
|
+
"verify:lib": "node scripts/verify-package.js",
|
|
58
|
+
"verify:install": "node scripts/verify-install.js",
|
|
59
|
+
"release:check": "pnpm build:lib && pnpm verify:lib && pnpm verify:install",
|
|
60
|
+
"prepublishOnly": "pnpm release:check",
|
|
61
|
+
"shots": "playwright test --config playwright.shots.config.js",
|
|
62
|
+
"prepack": "pnpm build:lib",
|
|
63
|
+
"preview": "vite preview --outDir site-dist",
|
|
64
|
+
"test": "playwright test",
|
|
65
|
+
"test:ssr": "node --test tests/*.ssr.test.js"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@codemirror/autocomplete": "^6.20.4",
|
|
69
|
+
"@codemirror/commands": "^6.11.1",
|
|
70
|
+
"@codemirror/lang-css": "^6.3.1",
|
|
71
|
+
"@codemirror/lang-html": "^6.4.12",
|
|
72
|
+
"@codemirror/lang-javascript": "^6.2.5",
|
|
73
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
74
|
+
"@codemirror/language": "^6.13.1",
|
|
75
|
+
"@codemirror/search": "^6.7.2",
|
|
76
|
+
"@codemirror/state": "^6.7.6",
|
|
77
|
+
"@codemirror/view": "^6.43.15",
|
|
78
|
+
"@hugeicons/core-free-icons": "^4.3.5",
|
|
79
|
+
"@hugeicons/vue": "^1.0.8",
|
|
80
|
+
"@lezer/highlight": "^1.2.5",
|
|
81
|
+
"@material/material-color-utilities": "^0.3.0",
|
|
82
|
+
"@tiptap/core": "^3.32.0",
|
|
83
|
+
"@tiptap/extension-placeholder": "^3.32.0",
|
|
84
|
+
"@tiptap/starter-kit": "^3.32.0",
|
|
85
|
+
"highlight.js": "^11.12.0",
|
|
86
|
+
"katex": "^0.19.0",
|
|
87
|
+
"qrcode-generator": "^2.0.4",
|
|
88
|
+
"reka-ui": "^2.11.0",
|
|
89
|
+
"xss": "^1.0.16"
|
|
90
|
+
},
|
|
91
|
+
"peerDependencies": {
|
|
92
|
+
"vue": "^3.5.42"
|
|
93
|
+
},
|
|
94
|
+
"devDependencies": {
|
|
95
|
+
"@playwright/test": "^1.63.0",
|
|
96
|
+
"@vitejs/plugin-vue": "^6.0.8",
|
|
97
|
+
"sass": "^1.105.1",
|
|
98
|
+
"vite": "^8.3.5",
|
|
99
|
+
"vue": "^3.5.42"
|
|
100
|
+
}
|
|
101
|
+
}
|