@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.
Files changed (168) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +166 -2
  3. package/dist/THIRD_PARTY_NOTICES.txt +2676 -0
  4. package/dist/kima-elements-core.js +53209 -0
  5. package/dist/kima-elements.js +126371 -0
  6. package/dist/kima-theme.js +1583 -0
  7. package/dist/kima.js +141 -0
  8. package/dist/style.css +2 -0
  9. package/dist/vue/_virtual/_plugin-vue_export-helper.js +7 -0
  10. package/dist/vue/components/advanced-input/calendar.ce.js +216 -0
  11. package/dist/vue/components/advanced-input/date-range-picker.ce.js +224 -0
  12. package/dist/vue/components/advanced-input/editable.ce.js +160 -0
  13. package/dist/vue/components/advanced-input/mention.ce.js +181 -0
  14. package/dist/vue/components/advanced-input/range-slider.ce.js +111 -0
  15. package/dist/vue/components/advanced-input/time-range-picker.ce.js +120 -0
  16. package/dist/vue/components/advanced-input/transfer.ce.js +192 -0
  17. package/dist/vue/components/content/chart.ce.js +282 -0
  18. package/dist/vue/components/content/code-editor.ce.js +309 -0
  19. package/dist/vue/components/content/equation.ce.js +69 -0
  20. package/dist/vue/components/content/heatmap.ce.js +148 -0
  21. package/dist/vue/components/content/rich-text-editor.ce.js +319 -0
  22. package/dist/vue/components/core/badge.ce.js +66 -0
  23. package/dist/vue/components/core/button-group.ce.js +142 -0
  24. package/dist/vue/components/core/button.ce.js +73 -0
  25. package/dist/vue/components/core/card.ce.js +73 -0
  26. package/dist/vue/components/core/cascader.ce.js +329 -0
  27. package/dist/vue/components/core/checkbox.ce.js +116 -0
  28. package/dist/vue/components/core/code-block.ce.js +108 -0
  29. package/dist/vue/components/core/combobox.ce.js +354 -0
  30. package/dist/vue/components/core/date-picker.ce.js +433 -0
  31. package/dist/vue/components/core/dialog.ce.js +118 -0
  32. package/dist/vue/components/core/divider.ce.js +49 -0
  33. package/dist/vue/components/core/drawer.ce.js +235 -0
  34. package/dist/vue/components/core/empty-state.ce.js +58 -0
  35. package/dist/vue/components/core/icon-button.ce.js +93 -0
  36. package/dist/vue/components/core/icon.ce.js +42 -0
  37. package/dist/vue/components/core/layout.ce.js +68 -0
  38. package/dist/vue/components/core/menu.ce.js +178 -0
  39. package/dist/vue/components/core/notification.ce.js +158 -0
  40. package/dist/vue/components/core/pagination.ce.js +158 -0
  41. package/dist/vue/components/core/progress.ce.js +49 -0
  42. package/dist/vue/components/core/select.ce.js +325 -0
  43. package/dist/vue/components/core/slider.ce.js +116 -0
  44. package/dist/vue/components/core/switch.ce.js +100 -0
  45. package/dist/vue/components/core/tabs.ce.js +193 -0
  46. package/dist/vue/components/core/text-field.ce.js +194 -0
  47. package/dist/vue/components/core/time-picker.ce.js +486 -0
  48. package/dist/vue/components/core/tooltip.ce.js +125 -0
  49. package/dist/vue/components/core/tree.ce.js +248 -0
  50. package/dist/vue/components/core/virtual-scroll.ce.js +176 -0
  51. package/dist/vue/components/data/copy-button.ce.js +75 -0
  52. package/dist/vue/components/data/image-preview.ce.js +226 -0
  53. package/dist/vue/components/data/infinite-scroll.ce.js +126 -0
  54. package/dist/vue/components/data/long-text.ce.js +70 -0
  55. package/dist/vue/components/data/relative-time.ce.js +77 -0
  56. package/dist/vue/components/data/ring-progress.ce.js +87 -0
  57. package/dist/vue/components/data/table.ce.js +491 -0
  58. package/dist/vue/components/data/virtual-table.ce.js +178 -0
  59. package/dist/vue/components/data/virtual-tree.ce.js +213 -0
  60. package/dist/vue/components/display/alert.ce.js +101 -0
  61. package/dist/vue/components/display/avatar-group.ce.js +65 -0
  62. package/dist/vue/components/display/avatar.ce.js +84 -0
  63. package/dist/vue/components/display/blockquote.ce.js +44 -0
  64. package/dist/vue/components/display/countdown.ce.js +77 -0
  65. package/dist/vue/components/display/descriptions.ce.js +43 -0
  66. package/dist/vue/components/display/highlight.ce.js +48 -0
  67. package/dist/vue/components/display/image.ce.js +146 -0
  68. package/dist/vue/components/display/list.ce.js +68 -0
  69. package/dist/vue/components/display/result.ce.js +57 -0
  70. package/dist/vue/components/display/skeleton.ce.js +67 -0
  71. package/dist/vue/components/display/spinner.ce.js +42 -0
  72. package/dist/vue/components/display/statistic.ce.js +71 -0
  73. package/dist/vue/components/display/timeline.ce.js +59 -0
  74. package/dist/vue/components/form-completion/angle-slider.ce.js +103 -0
  75. package/dist/vue/components/form-completion/color-picker.ce.js +286 -0
  76. package/dist/vue/components/form-completion/date-field.ce.js +131 -0
  77. package/dist/vue/components/form-completion/dynamic-input.ce.js +158 -0
  78. package/dist/vue/components/form-completion/form.ce.js +248 -0
  79. package/dist/vue/components/form-completion/json-input.ce.js +114 -0
  80. package/dist/vue/components/form-completion/masked-input.ce.js +88 -0
  81. package/dist/vue/components/form-completion/period-picker.ce.js +147 -0
  82. package/dist/vue/components/form-completion/time-field.ce.js +120 -0
  83. package/dist/vue/components/form-completion/upload-manager.ce.js +223 -0
  84. package/dist/vue/components/foundation/banner.ce.js +106 -0
  85. package/dist/vue/components/foundation/error-state.ce.js +108 -0
  86. package/dist/vue/components/foundation/field-group.ce.js +146 -0
  87. package/dist/vue/components/foundation/flex.ce.js +60 -0
  88. package/dist/vue/components/foundation/grid.ce.js +52 -0
  89. package/dist/vue/components/foundation/input-group.ce.js +34 -0
  90. package/dist/vue/components/foundation/page-header.ce.js +55 -0
  91. package/dist/vue/components/foundation/time-display.ce.js +129 -0
  92. package/dist/vue/components/foundation/typography.ce.js +71 -0
  93. package/dist/vue/components/input/checkbox-group.ce.js +93 -0
  94. package/dist/vue/components/input/field.ce.js +74 -0
  95. package/dist/vue/components/input/file-upload.ce.js +142 -0
  96. package/dist/vue/components/input/number-field.ce.js +103 -0
  97. package/dist/vue/components/input/pin-input.ce.js +112 -0
  98. package/dist/vue/components/input/radio-group.ce.js +96 -0
  99. package/dist/vue/components/input/rating.ce.js +115 -0
  100. package/dist/vue/components/input/tags-input.ce.js +153 -0
  101. package/dist/vue/components/input/textarea.ce.js +180 -0
  102. package/dist/vue/components/input/toggle.ce.js +58 -0
  103. package/dist/vue/components/interaction/chip.ce.js +95 -0
  104. package/dist/vue/components/interaction/command.ce.js +161 -0
  105. package/dist/vue/components/interaction/context-menu.ce.js +113 -0
  106. package/dist/vue/components/interaction/hover-card.ce.js +92 -0
  107. package/dist/vue/components/interaction/loading-overlay.ce.js +70 -0
  108. package/dist/vue/components/interaction/menubar.ce.js +134 -0
  109. package/dist/vue/components/interaction/multi-select.ce.js +264 -0
  110. package/dist/vue/components/interaction/popconfirm.ce.js +95 -0
  111. package/dist/vue/components/interaction/popover.ce.js +83 -0
  112. package/dist/vue/components/interaction/tree-select.ce.js +195 -0
  113. package/dist/vue/components/navigation/accordion.ce.js +114 -0
  114. package/dist/vue/components/navigation/anchor.ce.js +125 -0
  115. package/dist/vue/components/navigation/back-top.ce.js +67 -0
  116. package/dist/vue/components/navigation/breadcrumb.ce.js +48 -0
  117. package/dist/vue/components/navigation/carousel.ce.js +114 -0
  118. package/dist/vue/components/navigation/collapsible.ce.js +57 -0
  119. package/dist/vue/components/navigation/link.ce.js +62 -0
  120. package/dist/vue/components/navigation/navigation-menu.ce.js +91 -0
  121. package/dist/vue/components/navigation/overflow-list.ce.js +67 -0
  122. package/dist/vue/components/navigation/scroll-area.ce.js +47 -0
  123. package/dist/vue/components/navigation/splitter.ce.js +131 -0
  124. package/dist/vue/components/navigation/stepper.ce.js +74 -0
  125. package/dist/vue/components/navigation/toolbar.ce.js +93 -0
  126. package/dist/vue/components/navigation/visually-hidden.ce.js +16 -0
  127. package/dist/vue/components/shell/app-shell.ce.js +87 -0
  128. package/dist/vue/components/shell/config-provider.ce.js +110 -0
  129. package/dist/vue/components/shell/marquee.ce.js +92 -0
  130. package/dist/vue/components/shell/masonry.ce.js +50 -0
  131. package/dist/vue/components/shell/sidebar.ce.js +125 -0
  132. package/dist/vue/components/utility/affix.ce.js +64 -0
  133. package/dist/vue/components/utility/alert-dialog.ce.js +124 -0
  134. package/dist/vue/components/utility/animated-number.ce.js +66 -0
  135. package/dist/vue/components/utility/float-button.ce.js +104 -0
  136. package/dist/vue/components/utility/listbox.ce.js +81 -0
  137. package/dist/vue/components/utility/loading-bar.ce.js +85 -0
  138. package/dist/vue/components/utility/log-viewer.ce.js +124 -0
  139. package/dist/vue/components/utility/notification-queue.ce.js +109 -0
  140. package/dist/vue/components/utility/progress-group.ce.js +59 -0
  141. package/dist/vue/components/utility/qr-code.ce.js +62 -0
  142. package/dist/vue/components/utility/tag-group.ce.js +124 -0
  143. package/dist/vue/components/utility/tour.ce.js +214 -0
  144. package/dist/vue/components/utility/virtual-select.ce.js +207 -0
  145. package/dist/vue/components/utility/watermark.ce.js +44 -0
  146. package/dist/vue/internal/menu-items.js +184 -0
  147. package/dist/vue/internal/navigation-items.js +110 -0
  148. package/dist/vue/utils/code-highlight.js +142 -0
  149. package/dist/vue/utils/config.js +47 -0
  150. package/dist/vue/utils/content-motion.js +37 -0
  151. package/dist/vue/utils/content.js +83 -0
  152. package/dist/vue/utils/display-status.js +31 -0
  153. package/dist/vue/utils/foundation.js +65 -0
  154. package/dist/vue/utils/input-state.js +38 -0
  155. package/dist/vue/utils/interaction.js +103 -0
  156. package/dist/vue/utils/local-date.js +48 -0
  157. package/dist/vue/utils/motion.js +80 -0
  158. package/dist/vue/utils/native-slots.js +30 -0
  159. package/dist/vue/utils/navigation.js +44 -0
  160. package/dist/vue/utils/notifications.js +60 -0
  161. package/dist/vue/utils/qr.js +20 -0
  162. package/dist/vue/utils/remote-options.js +65 -0
  163. package/dist/vue/utils/ripple.js +20 -0
  164. package/dist/vue/utils/scoped-slots.js +22 -0
  165. package/dist/vue/utils/shell.js +43 -0
  166. package/dist/vue/utils/theme.js +50 -0
  167. package/dist/vue/utils/utility-choice.js +56 -0
  168. package/package.json +99 -4
@@ -0,0 +1,48 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import n from "./link.ce.js";
4
+ /* empty css */
5
+ import { Fragment as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, mergeProps as l, openBlock as u, renderList as d, renderSlot as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
6
+ // src/components/navigation/breadcrumb.ce.vue
7
+ var g = ["aria-label"], _ = {
8
+ key: 0,
9
+ "aria-hidden": "true",
10
+ class: "kima-breadcrumb__separator"
11
+ }, v = ["aria-current"], y = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
12
+ __name: "breadcrumb.ce",
13
+ props: {
14
+ items: {
15
+ type: Array,
16
+ default: () => []
17
+ },
18
+ label: {
19
+ type: String,
20
+ default: "面包屑导航"
21
+ },
22
+ separator: {
23
+ type: String,
24
+ default: "/"
25
+ }
26
+ },
27
+ setup(e) {
28
+ let { root: y, forwardedAttrs: b } = t();
29
+ return (t, x) => (u(), o("nav", l({
30
+ ref_key: "root",
31
+ ref: y
32
+ }, m(b), {
33
+ class: "kima-breadcrumb",
34
+ "aria-label": e.label
35
+ }), [s("ol", null, [(u(!0), o(r, null, d(e.items, (t, r) => (u(), o("li", { key: r }, [r ? (u(), o("span", _, p(e.separator), 1)) : a("", !0), t.href && r !== e.items.length - 1 ? (u(), i(n, {
36
+ key: 1,
37
+ href: t.href,
38
+ disabled: t.disabled
39
+ }, {
40
+ default: h(() => [c(p(t.label), 1)]),
41
+ _: 2
42
+ }, 1032, ["href", "disabled"])) : (u(), o("span", {
43
+ key: 2,
44
+ "aria-current": r === e.items.length - 1 ? "page" : void 0
45
+ }, p(t.label), 9, v))]))), 128))]), f(t.$slots, "default", {}, void 0, !0)], 16, g));
46
+ }
47
+ }), [["__scopeId", "data-v-2a2cd6e2"]]);
48
+ export { y as default };
@@ -0,0 +1,114 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "../core/button.ce.js";
3
+ import { useNavigationModel as n, useNavigationRoot as r } from "../../utils/navigation.js";
4
+ import { useContentMotion as i } from "../../utils/content-motion.js";
5
+ /* empty css */
6
+ import { Fragment as a, Transition as o, computed as s, createBlock as c, createCommentVNode 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, useId as x, vShow as S, withCtx as C, withDirectives as w } from "vue";
7
+ // src/components/navigation/carousel.ce.vue
8
+ var T = ["aria-label"], E = [
9
+ "aria-label",
10
+ "aria-hidden",
11
+ "inert"
12
+ ], D = { key: 0 }, O = { key: 1 }, k = { key: 0 }, A = { class: "kima-carousel__controls" }, j = {
13
+ "aria-live": "polite",
14
+ "aria-atomic": "true"
15
+ }, M = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
16
+ __name: "carousel.ce",
17
+ props: {
18
+ modelValue: {
19
+ type: Number,
20
+ default: 0
21
+ },
22
+ items: {
23
+ type: Array,
24
+ default: () => []
25
+ },
26
+ loop: Boolean,
27
+ disabled: Boolean,
28
+ label: {
29
+ type: String,
30
+ default: "内容轮播"
31
+ }
32
+ },
33
+ emits: ["update:modelValue", "change"],
34
+ setup(e, { emit: M }) {
35
+ let N = e, P = M, { root: F, forwardedAttrs: I } = r(), [L, R] = n(N, "modelValue", P), z = `kima-carousel-${x()}`, B = g(null), V = s(() => Math.max(0, Math.min(N.items.length - 1, Math.trunc(Number(L.value) || 0))));
36
+ i(B, () => V.value, { opacity: !1 });
37
+ let H = s(() => N.disabled || N.items.length < 2 || !N.loop && V.value === 0), U = s(() => N.disabled || N.items.length < 2 || !N.loop && V.value === N.items.length - 1);
38
+ function W(e) {
39
+ return e && typeof e == "object" ? e.content ?? e.label ?? "" : e;
40
+ }
41
+ function G(e) {
42
+ e < 0 && H.value || e > 0 && U.value || R((V.value + e + N.items.length) % N.items.length);
43
+ }
44
+ function K(e) {
45
+ if (N.disabled || !N.items.length || e.altKey || e.ctrlKey || e.metaKey || e.isComposing || e.target.closest("input,textarea,select,a,[contenteditable=\"true\"]")) return;
46
+ let t = getComputedStyle(F.value).direction === "rtl";
47
+ if (e.key === "ArrowRight") G(t ? -1 : 1);
48
+ else if (e.key === "ArrowLeft") G(t ? 1 : -1);
49
+ else if (e.key === "Home") R(0);
50
+ else if (e.key === "End") R(N.items.length - 1);
51
+ else return;
52
+ e.preventDefault();
53
+ }
54
+ return (n, r) => (h(), u("section", m({
55
+ ref_key: "root",
56
+ ref: F
57
+ }, b(I), {
58
+ class: "kima-carousel",
59
+ role: "region",
60
+ "aria-roledescription": "轮播",
61
+ "aria-label": e.label,
62
+ tabindex: "0",
63
+ onKeydown: K
64
+ }), [
65
+ d("div", {
66
+ id: z,
67
+ ref_key: "viewport",
68
+ ref: B,
69
+ class: "kima-carousel__viewport"
70
+ }, [(h(!0), u(a, null, _(e.items, (t, r) => (h(), c(o, {
71
+ key: t.value ?? r,
72
+ name: "kima-fade"
73
+ }, {
74
+ default: C(() => [w(d("div", {
75
+ class: "kima-carousel__slide",
76
+ role: "group",
77
+ "aria-roledescription": "幻灯片",
78
+ "aria-label": `第 ${r + 1} 张,共 ${e.items.length} 张`,
79
+ "aria-hidden": V.value !== r,
80
+ inert: V.value !== r
81
+ }, [v(n.$slots, `slide-${r}`, {
82
+ item: t,
83
+ index: r
84
+ }, () => [t.title ? (h(), u("h3", D, y(t.title), 1)) : l("", !0), W(t) ? (h(), u("p", O, y(W(t)), 1)) : l("", !0)], !0)], 8, E), [[S, V.value === r]])]),
85
+ _: 2
86
+ }, 1024))), 128)), e.items.length ? l("", !0) : (h(), u("p", k, "暂无内容"))], 512),
87
+ d("div", A, [
88
+ p(t, {
89
+ variant: "tonal",
90
+ disabled: H.value,
91
+ "aria-controls": z,
92
+ "aria-label": "上一张",
93
+ onClick: r[0] ||= (e) => G(-1)
94
+ }, {
95
+ default: C(() => [...r[2] ||= [f("上一张", -1)]]),
96
+ _: 1
97
+ }, 8, ["disabled"]),
98
+ d("output", j, y(e.items.length ? V.value + 1 : 0) + " / " + y(e.items.length), 1),
99
+ p(t, {
100
+ variant: "tonal",
101
+ disabled: U.value,
102
+ "aria-controls": z,
103
+ "aria-label": "下一张",
104
+ onClick: r[1] ||= (e) => G(1)
105
+ }, {
106
+ default: C(() => [...r[3] ||= [f("下一张", -1)]]),
107
+ _: 1
108
+ }, 8, ["disabled"])
109
+ ]),
110
+ v(n.$slots, "default", {}, void 0, !0)
111
+ ], 16, T));
112
+ }
113
+ }), [["__scopeId", "data-v-c082836f"]]);
114
+ export { M as default };
@@ -0,0 +1,57 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "../core/button.ce.js";
3
+ import { collapseTransition as n } from "../../utils/motion.js";
4
+ import { useNavigationModel as r, useNavigationRoot as i } from "../../utils/navigation.js";
5
+ /* empty css */
6
+ import { Transition as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, mergeProps as u, openBlock as d, renderSlot as f, toDisplayString as p, unref as m, useId as h, vShow as g, withCtx as _, withDirectives as v } from "vue";
7
+ import { CollapsibleRoot as y, CollapsibleTrigger as b } from "reka-ui";
8
+ // src/components/navigation/collapsible.ce.vue
9
+ var x = ["aria-hidden", "inert"], S = { class: "kima-collapsible__content" }, C = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
10
+ __name: "collapsible.ce",
11
+ props: {
12
+ open: Boolean,
13
+ disabled: Boolean,
14
+ label: {
15
+ type: String,
16
+ default: "展开内容"
17
+ }
18
+ },
19
+ emits: ["update:open", "change"],
20
+ setup(e, { emit: C }) {
21
+ let w = e, T = C, { root: E, forwardedAttrs: D } = i(), [O, k] = r(w, "open", T), A = `kima-collapsible-${h()}`;
22
+ return (r, i) => (d(), o("div", u({
23
+ ref_key: "root",
24
+ ref: E
25
+ }, m(D), { class: "kima-collapsible" }), [l(m(y), {
26
+ open: m(O),
27
+ disabled: e.disabled,
28
+ "onUpdate:open": m(k)
29
+ }, {
30
+ default: _(() => [l(m(b), { "as-child": "" }, {
31
+ default: _(() => [l(t, {
32
+ variant: "text",
33
+ disabled: e.disabled,
34
+ "aria-expanded": m(O),
35
+ "aria-controls": A
36
+ }, {
37
+ default: _(() => [f(r.$slots, "trigger", {}, () => [c(p(e.label), 1)], !0)]),
38
+ _: 3
39
+ }, 8, ["disabled", "aria-expanded"])]),
40
+ _: 3
41
+ }), l(a, u({ css: !1 }, m(n)), {
42
+ default: _(() => [v(s("div", {
43
+ id: A,
44
+ "aria-hidden": !m(O),
45
+ inert: !m(O)
46
+ }, [s("div", S, [f(r.$slots, "default", {}, void 0, !0)])], 8, x), [[g, m(O)]])]),
47
+ _: 3
48
+ }, 16)]),
49
+ _: 3
50
+ }, 8, [
51
+ "open",
52
+ "disabled",
53
+ "onUpdate:open"
54
+ ])], 16));
55
+ }
56
+ }), [["__scopeId", "data-v-ddf8529a"]]);
57
+ export { C as default };
@@ -0,0 +1,62 @@
1
+ import { useRipple as e } from "../../utils/ripple.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ import { useNavigationRoot as n } from "../../utils/navigation.js";
4
+ /* empty css */
5
+ import { computed as r, createElementBlock as i, mergeProps as a, openBlock as o, renderSlot as s, unref as c } from "vue";
6
+ // src/components/navigation/link.ce.vue
7
+ var l = [
8
+ "href",
9
+ "target",
10
+ "rel",
11
+ "aria-disabled",
12
+ "aria-current",
13
+ "tabindex"
14
+ ], u = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
15
+ __name: "link.ce",
16
+ props: {
17
+ href: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ target: {
22
+ type: String,
23
+ default: ""
24
+ },
25
+ rel: {
26
+ type: String,
27
+ default: ""
28
+ },
29
+ disabled: Boolean,
30
+ current: {
31
+ type: [Boolean, String],
32
+ default: !1
33
+ },
34
+ underline: {
35
+ type: Boolean,
36
+ default: !0
37
+ }
38
+ },
39
+ emits: ["navigate"],
40
+ setup(t, { emit: u }) {
41
+ let d = t, f = u, { root: p, forwardedAttrs: m } = n();
42
+ e(p);
43
+ let h = r(() => [...new Set(`${d.rel} ${d.target === "_blank" ? "noopener noreferrer" : ""}`.split(/\s+/).filter(Boolean))].join(" ") || void 0);
44
+ function g(e) {
45
+ d.disabled ? (e.preventDefault(), e.stopImmediatePropagation()) : f("navigate", e);
46
+ }
47
+ return (e, n) => (o(), i("a", a({
48
+ ref_key: "root",
49
+ ref: p
50
+ }, c(m), {
51
+ class: ["kima-link", { "kima-link--underline": t.underline }],
52
+ href: t.disabled ? void 0 : t.href || void 0,
53
+ target: t.target || void 0,
54
+ rel: h.value,
55
+ "aria-disabled": t.disabled || void 0,
56
+ "aria-current": t.current ? typeof t.current == "string" ? t.current : "page" : void 0,
57
+ tabindex: t.disabled ? -1 : void 0,
58
+ onClick: g
59
+ }), [s(e.$slots, "default", {}, void 0, !0)], 16, l));
60
+ }
61
+ }), [["__scopeId", "data-v-24e2c032"]]);
62
+ export { u as default };
@@ -0,0 +1,91 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import { navContains as n, navKey as r, useShellModel as i } from "../../utils/shell.js";
4
+ import a from "../../internal/navigation-items.js";
5
+ /* empty css */
6
+ import { createElementBlock as o, createVNode as s, mergeProps as c, openBlock as l, renderSlot as u, unref as d, watch as f } from "vue";
7
+ // src/components/navigation/navigation-menu.ce.vue
8
+ var p = ["aria-label"], m = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
9
+ __name: "navigation-menu.ce",
10
+ props: {
11
+ modelValue: {
12
+ type: String,
13
+ default: ""
14
+ },
15
+ items: {
16
+ type: Array,
17
+ default: () => []
18
+ },
19
+ label: {
20
+ type: String,
21
+ default: "主导航"
22
+ },
23
+ orientation: {
24
+ type: String,
25
+ default: "horizontal"
26
+ },
27
+ disabled: Boolean,
28
+ expanded: {
29
+ type: Array,
30
+ default: () => []
31
+ }
32
+ },
33
+ emits: [
34
+ "update:modelValue",
35
+ "change",
36
+ "navigate",
37
+ "update:expanded"
38
+ ],
39
+ setup(e, { emit: m }) {
40
+ let h = e, g = m, { root: _, forwardedAttrs: v } = t(), [y, b] = i(h, "modelValue", g), [x, S] = i(h, "expanded", g);
41
+ function C(e, t) {
42
+ if (h.disabled || e.disabled) return;
43
+ let n = r(e);
44
+ b(n), g("change", n), g("navigate", e, t);
45
+ }
46
+ f([y, () => h.items], () => {
47
+ let e = [];
48
+ function t(i) {
49
+ for (let a of i) a.children?.length && a.children.some((e) => n(e, y.value)) && (e.push(r(a)), t(a.children));
50
+ }
51
+ t(h.items);
52
+ let i = [.../* @__PURE__ */ new Set([...x.value, ...e])];
53
+ i.length !== x.value.length && S(i);
54
+ }, {
55
+ immediate: !0,
56
+ deep: !0
57
+ });
58
+ function w(e) {
59
+ if (![
60
+ "ArrowDown",
61
+ "ArrowUp",
62
+ "Home",
63
+ "End"
64
+ ].includes(e.key) || e.isComposing) return;
65
+ let t = [..._.value.querySelectorAll("a[href], button:not(:disabled)")].filter((e) => !e.closest("[inert]")), n = t.indexOf(e.target);
66
+ n < 0 || (e.preventDefault(), t[e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : (n + (e.key === "ArrowDown" ? 1 : -1) + t.length) % t.length]?.focus());
67
+ }
68
+ return (t, n) => (l(), o("nav", c({
69
+ ref_key: "root",
70
+ ref: _
71
+ }, d(v), {
72
+ class: ["kima-navigation-menu", { "kima-navigation-menu--vertical": e.orientation === "vertical" }],
73
+ "aria-label": e.label,
74
+ onKeydown: w
75
+ }), [s(a, {
76
+ items: e.items,
77
+ "model-value": d(y),
78
+ expanded: d(x),
79
+ disabled: e.disabled,
80
+ onNavigate: C,
81
+ onExpand: d(S)
82
+ }, null, 8, [
83
+ "items",
84
+ "model-value",
85
+ "expanded",
86
+ "disabled",
87
+ "onExpand"
88
+ ]), u(t.$slots, "default", {}, void 0, !0)], 16, p));
89
+ }
90
+ }), [["__scopeId", "data-v-5a0a5b21"]]);
91
+ export { m as default };
@@ -0,0 +1,67 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "../core/button.ce.js";
3
+ import { collapseTransition as n } from "../../utils/motion.js";
4
+ import { useNavigationModel as r, useNavigationRoot as i } from "../../utils/navigation.js";
5
+ /* empty css */
6
+ import { Fragment as a, Transition as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, mergeProps as p, openBlock as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, useId as y, vShow as b, withCtx as x, withDirectives as S } from "vue";
7
+ // src/components/navigation/overflow-list.ce.vue
8
+ var C = ["aria-label"], w = ["inert", "aria-hidden"], T = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
9
+ __name: "overflow-list.ce",
10
+ props: {
11
+ items: {
12
+ type: Array,
13
+ default: () => []
14
+ },
15
+ max: {
16
+ type: Number,
17
+ default: 3
18
+ },
19
+ expanded: Boolean,
20
+ disabled: Boolean,
21
+ label: {
22
+ type: String,
23
+ default: "内容列表"
24
+ }
25
+ },
26
+ emits: ["update:expanded", "change"],
27
+ setup(e, { emit: T }) {
28
+ let E = e, D = T, { root: O, forwardedAttrs: k } = i(), [A, j] = r(E, "expanded", D), M = s(() => Math.max(0, Math.floor(Number(E.max) || 0))), N = s(() => Math.max(0, E.items.length - M.value)), P = `kima-overflow-${y()}`;
29
+ function F(e) {
30
+ return typeof e == "object" && e ? e.label ?? e.value ?? "" : e;
31
+ }
32
+ return (r, i) => (m(), u("div", p({
33
+ ref_key: "root",
34
+ ref: O
35
+ }, v(k), { class: "kima-overflow-list" }), [
36
+ d("ul", {
37
+ id: P,
38
+ "aria-label": e.label
39
+ }, [(m(!0), u(a, null, h(e.items, (e, t) => (m(), c(o, p({
40
+ key: e?.value ?? t,
41
+ css: !1
42
+ }, { ref_for: !0 }, v(n)), {
43
+ default: x(() => [S(d("li", {
44
+ inert: !v(A) && t >= M.value,
45
+ "aria-hidden": !v(A) && t >= M.value || void 0
46
+ }, [d("div", null, [g(r.$slots, `item-${t}`, {
47
+ item: e,
48
+ index: t
49
+ }, () => [f(_(F(e)), 1)], !0)])], 8, w), [[b, v(A) || t < M.value]])]),
50
+ _: 2
51
+ }, 1040))), 128))], 8, C),
52
+ N.value ? (m(), c(t, {
53
+ key: 0,
54
+ variant: "text",
55
+ disabled: e.disabled,
56
+ "aria-controls": P,
57
+ "aria-expanded": v(A),
58
+ onClick: i[0] ||= (e) => v(j)(!v(A))
59
+ }, {
60
+ default: x(() => [f(_(v(A) ? "收起列表" : `展开其余 ${N.value} 项`), 1)]),
61
+ _: 1
62
+ }, 8, ["disabled", "aria-expanded"])) : l("", !0),
63
+ g(r.$slots, "default", {}, void 0, !0)
64
+ ], 16));
65
+ }
66
+ }), [["__scopeId", "data-v-b6fec7f9"]]);
67
+ export { T as default };
@@ -0,0 +1,47 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { cssSize as t, useNavigationRoot as n } from "../../utils/navigation.js";
3
+ /* empty css */
4
+ import { computed as r, createElementBlock as i, mergeProps as a, openBlock as o, renderSlot as s, unref as c } from "vue";
5
+ // src/components/navigation/scroll-area.ce.vue
6
+ var l = ["aria-label"], u = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
7
+ __name: "scroll-area.ce",
8
+ props: {
9
+ label: {
10
+ type: String,
11
+ default: "滚动内容"
12
+ },
13
+ maxHeight: {
14
+ type: [Number, String],
15
+ default: 360
16
+ },
17
+ maxWidth: {
18
+ type: [Number, String],
19
+ default: "100%"
20
+ },
21
+ orientation: {
22
+ type: String,
23
+ default: "vertical"
24
+ }
25
+ },
26
+ emits: ["scroll"],
27
+ setup(e, { emit: u }) {
28
+ let d = e, f = u, { root: p, forwardedAttrs: m } = n(), h = r(() => ({
29
+ maxHeight: t(d.maxHeight),
30
+ maxWidth: t(d.maxWidth),
31
+ overflowX: d.orientation === "vertical" ? "hidden" : "auto",
32
+ overflowY: d.orientation === "horizontal" ? "hidden" : "auto"
33
+ }));
34
+ return (t, n) => (o(), i("div", a({
35
+ ref_key: "root",
36
+ ref: p
37
+ }, c(m), {
38
+ class: "kima-scroll-area",
39
+ role: "region",
40
+ "aria-label": e.label,
41
+ tabindex: "0",
42
+ style: h.value,
43
+ onScroll: n[0] ||= (e) => f("scroll", e)
44
+ }), [s(t.$slots, "default", {}, void 0, !0)], 16, l));
45
+ }
46
+ }), [["__scopeId", "data-v-78178cc3"]]);
47
+ export { u as default };
@@ -0,0 +1,131 @@
1
+ import { useRipple as e } from "../../utils/ripple.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ import { useNavigationModel as n, useNavigationRoot as r } from "../../utils/navigation.js";
4
+ /* empty css */
5
+ import { computed as i, createElementBlock as a, createElementVNode as o, mergeProps as s, normalizeStyle as c, onBeforeUnmount as l, openBlock as u, ref as d, renderSlot as f, unref as p, useId as m, watch as h } from "vue";
6
+ // src/components/navigation/splitter.ce.vue
7
+ var g = ["id"], _ = [
8
+ "tabindex",
9
+ "aria-label",
10
+ "aria-controls",
11
+ "aria-orientation",
12
+ "aria-valuenow",
13
+ "aria-valuemin",
14
+ "aria-valuemax",
15
+ "aria-valuetext",
16
+ "aria-disabled"
17
+ ], v = ["id"], y = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
18
+ __name: "splitter.ce",
19
+ props: {
20
+ modelValue: {
21
+ type: Number,
22
+ default: 40
23
+ },
24
+ min: {
25
+ type: Number,
26
+ default: 15
27
+ },
28
+ max: {
29
+ type: Number,
30
+ default: 85
31
+ },
32
+ step: {
33
+ type: Number,
34
+ default: 5
35
+ },
36
+ orientation: {
37
+ type: String,
38
+ default: "horizontal"
39
+ },
40
+ disabled: Boolean,
41
+ label: {
42
+ type: String,
43
+ default: "调整面板大小"
44
+ }
45
+ },
46
+ emits: [
47
+ "update:modelValue",
48
+ "change",
49
+ "resize-start",
50
+ "resize-end"
51
+ ],
52
+ setup(t, { emit: y }) {
53
+ let b = t, x = y, { root: S, forwardedAttrs: C } = r(), [w, T] = n(b, "modelValue", x), E = d(null);
54
+ e(E);
55
+ let D = `kima-splitter-${m()}`, O = i(() => Math.min(100, Math.max(0, Number(b.min) || 0))), k = i(() => Math.max(O.value, Math.min(100, Number.isFinite(b.max) ? b.max : 100))), A = i(() => b.orientation === "vertical"), j = i(() => P(w.value)), M = i(() => ({ flexBasis: `calc((100% - 48px) * ${j.value / 100})` })), N;
56
+ function P(e) {
57
+ return Math.min(k.value, Math.max(O.value, Number.isFinite(Number(e)) ? Number(e) : 40));
58
+ }
59
+ function F(e) {
60
+ b.disabled || T(Math.round(P(e) * 100) / 100);
61
+ }
62
+ function I(e) {
63
+ if (b.disabled || e.button !== 0 || N) return;
64
+ e.preventDefault();
65
+ let t = S.value.getBoundingClientRect(), n = (A.value ? t.height : t.width) - 48;
66
+ n <= 0 || (N = {
67
+ id: e.pointerId,
68
+ position: A.value ? e.clientY : e.clientX,
69
+ size: j.value,
70
+ available: n,
71
+ direction: !A.value && getComputedStyle(S.value).direction === "rtl" ? -1 : 1
72
+ }, e.currentTarget.setPointerCapture(e.pointerId), x("resize-start", j.value));
73
+ }
74
+ function L(e) {
75
+ if (!N || N.id !== e.pointerId) return;
76
+ let t = A.value ? e.clientY : e.clientX;
77
+ F(N.size + (t - N.position) / N.available * 100 * N.direction);
78
+ }
79
+ function R(e) {
80
+ if (!N || e && e.pointerId !== N.id) return;
81
+ let t = N.id;
82
+ N = void 0, E.value?.hasPointerCapture(t) && E.value.releasePointerCapture(t), x("resize-end", j.value);
83
+ }
84
+ function z(e) {
85
+ if (b.disabled || e.isComposing) return;
86
+ let t = A.value ? "ArrowDown" : "ArrowRight", n = A.value ? "ArrowUp" : "ArrowLeft", r = Math.max(.1, Number(b.step) || 5) * (e.shiftKey ? 2 : 1);
87
+ if (!A.value && getComputedStyle(S.value).direction === "rtl" && (r *= -1), e.key === "Home") F(O.value);
88
+ else if (e.key === "End") F(k.value);
89
+ else if (e.key === t) F(j.value + r);
90
+ else if (e.key === n) F(j.value - r);
91
+ else return;
92
+ e.preventDefault();
93
+ }
94
+ return h(() => [b.disabled, b.orientation], () => R()), l(() => R()), (e, n) => (u(), a("div", s({
95
+ ref_key: "root",
96
+ ref: S
97
+ }, p(C), { class: ["kima-splitter", { "kima-splitter--vertical": A.value }] }), [
98
+ o("section", {
99
+ id: `${D}-first`,
100
+ class: "kima-splitter__panel kima-splitter__panel--first",
101
+ style: c(M.value)
102
+ }, [f(e.$slots, "first", {}, void 0, !0)], 12, g),
103
+ o("div", {
104
+ ref_key: "handle",
105
+ ref: E,
106
+ class: "kima-splitter__handle",
107
+ role: "separator",
108
+ tabindex: t.disabled ? -1 : 0,
109
+ "aria-label": t.label,
110
+ "aria-controls": `${D}-first ${D}-second`,
111
+ "aria-orientation": A.value ? "horizontal" : "vertical",
112
+ "aria-valuenow": j.value,
113
+ "aria-valuemin": O.value,
114
+ "aria-valuemax": k.value,
115
+ "aria-valuetext": `${j.value}%`,
116
+ "aria-disabled": t.disabled || void 0,
117
+ onPointerdown: I,
118
+ onPointermove: L,
119
+ onPointerup: R,
120
+ onPointercancel: R,
121
+ onLostpointercapture: R,
122
+ onKeydown: z
123
+ }, [...n[0] ||= [o("span", { "aria-hidden": "true" }, null, -1)]], 40, _),
124
+ o("section", {
125
+ id: `${D}-second`,
126
+ class: "kima-splitter__panel"
127
+ }, [f(e.$slots, "second", {}, void 0, !0)], 8, v)
128
+ ], 16));
129
+ }
130
+ }), [["__scopeId", "data-v-0fbcfa40"]]);
131
+ export { y as default };