@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,95 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "../core/button.ce.js";
3
+ import { useInteractionModel as n, useInteractionRoot as r } from "../../utils/interaction.js";
4
+ import i from "./popover.ce.js";
5
+ /* empty css */
6
+ import { createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, mergeProps as u, normalizeClass as d, openBlock as f, renderSlot as p, toDisplayString as m, unref as h, useId as g, watch as _, withCtx as v } from "vue";
7
+ // src/components/interaction/popconfirm.ce.vue
8
+ var y = { key: 0 }, b = { class: "kima-popconfirm__actions" }, x = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
9
+ __name: "popconfirm.ce",
10
+ props: {
11
+ open: Boolean,
12
+ disabled: Boolean,
13
+ label: {
14
+ type: String,
15
+ default: "删除"
16
+ },
17
+ heading: {
18
+ type: String,
19
+ default: "确认此操作?"
20
+ },
21
+ description: {
22
+ type: String,
23
+ default: ""
24
+ },
25
+ confirmText: {
26
+ type: String,
27
+ default: "确认"
28
+ },
29
+ cancelText: {
30
+ type: String,
31
+ default: "取消"
32
+ },
33
+ placement: {
34
+ type: String,
35
+ default: "bottom-start"
36
+ },
37
+ danger: Boolean
38
+ },
39
+ emits: [
40
+ "update:open",
41
+ "confirm",
42
+ "cancel"
43
+ ],
44
+ setup(e, { emit: x }) {
45
+ let S = e, C = x, { root: w, forwardedAttrs: T } = r(), [E, D] = n(S, "open", C), O = `kima-popconfirm-${g()}`;
46
+ _(() => S.disabled, (e) => {
47
+ e && D(!1);
48
+ });
49
+ function k(e) {
50
+ !S.disabled && E.value && (D(!1), C(e));
51
+ }
52
+ return (n, r) => (f(), o("div", u({
53
+ ref_key: "root",
54
+ ref: w
55
+ }, h(T), { class: "kima-popconfirm" }), [l(i, {
56
+ open: h(E),
57
+ disabled: e.disabled,
58
+ label: e.label,
59
+ "content-label": e.heading,
60
+ placement: e.placement,
61
+ "onUpdate:open": h(D)
62
+ }, {
63
+ trigger: v(() => [p(n.$slots, "trigger", {}, () => [c(m(e.label), 1)], !0)]),
64
+ default: v(() => [s("section", { "aria-labelledby": O }, [
65
+ s("h3", { id: O }, m(e.heading), 1),
66
+ e.description ? (f(), o("p", y, m(e.description), 1)) : a("", !0),
67
+ p(n.$slots, "default", {}, void 0, !0),
68
+ s("div", b, [l(t, {
69
+ variant: "text",
70
+ disabled: e.disabled,
71
+ onClick: r[0] ||= (e) => k("cancel")
72
+ }, {
73
+ default: v(() => [c(m(e.cancelText), 1)]),
74
+ _: 1
75
+ }, 8, ["disabled"]), l(t, {
76
+ class: d({ "kima-popconfirm__danger": e.danger }),
77
+ disabled: e.disabled,
78
+ onClick: r[1] ||= (e) => k("confirm")
79
+ }, {
80
+ default: v(() => [c(m(e.confirmText), 1)]),
81
+ _: 1
82
+ }, 8, ["class", "disabled"])])
83
+ ])]),
84
+ _: 3
85
+ }, 8, [
86
+ "open",
87
+ "disabled",
88
+ "label",
89
+ "content-label",
90
+ "placement",
91
+ "onUpdate:open"
92
+ ])], 16));
93
+ }
94
+ }), [["__scopeId", "data-v-fae7c69d"]]);
95
+ export { x as default };
@@ -0,0 +1,83 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "../core/button.ce.js";
3
+ import { presenceTransition as n } from "../../utils/motion.js";
4
+ import { dismissInteraction as r, useInteractionModel as i, useInteractionRoot as a, usePlacement as o } from "../../utils/interaction.js";
5
+ /* empty css */
6
+ import { Transition 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, renderSlot as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
7
+ import { PopoverContent as x, PopoverRoot as S, PopoverTrigger as C } from "reka-ui";
8
+ // src/components/interaction/popover.ce.vue
9
+ var w = ["aria-label"], T = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
10
+ __name: "popover.ce",
11
+ props: {
12
+ open: Boolean,
13
+ disabled: Boolean,
14
+ label: {
15
+ type: String,
16
+ default: "展开内容"
17
+ },
18
+ contentLabel: {
19
+ type: String,
20
+ default: "详情"
21
+ },
22
+ placement: {
23
+ type: String,
24
+ default: "bottom-start"
25
+ },
26
+ variant: {
27
+ type: String,
28
+ default: "tonal"
29
+ }
30
+ },
31
+ emits: ["update:open", "close"],
32
+ setup(e, { emit: T }) {
33
+ let E = e, D = T, { root: O, forwardedAttrs: k } = a(), [A, j] = i(E, "open", D), M = o(E);
34
+ function N(e) {
35
+ if (e && E.disabled) return;
36
+ let t = A.value;
37
+ j(e), t && !e && D("close");
38
+ }
39
+ y(() => E.disabled, (e) => {
40
+ e && N(!1);
41
+ }, { immediate: !0 });
42
+ function P(e) {
43
+ r(e, () => N(!1));
44
+ }
45
+ return (r, i) => (h(), u("div", m({
46
+ ref_key: "root",
47
+ ref: O
48
+ }, v(k), { class: "kima-popover" }), [p(v(S), {
49
+ open: v(A) && !e.disabled,
50
+ modal: !1,
51
+ "onUpdate:open": N
52
+ }, {
53
+ default: b(() => [p(v(C), { "as-child": "" }, {
54
+ default: b(() => [p(t, {
55
+ disabled: e.disabled,
56
+ variant: e.variant
57
+ }, {
58
+ default: b(() => [g(r.$slots, "trigger", {}, () => [f(_(e.label), 1)], !0)]),
59
+ _: 3
60
+ }, 8, ["disabled", "variant"])]),
61
+ _: 3
62
+ }), p(s, m({ name: "kima-popup" }, v(n)), {
63
+ default: b(() => [v(A) && !e.disabled ? (h(), c(v(x), m({
64
+ key: 0,
65
+ "as-child": "",
66
+ "force-mount": ""
67
+ }, v(M), {
68
+ class: "kima-popover__popup",
69
+ onEscapeKeyDown: P
70
+ }), {
71
+ default: b(() => [d("div", {
72
+ "aria-label": e.contentLabel,
73
+ "aria-labelledby": ""
74
+ }, [g(r.$slots, "default", { close: () => N(!1) }, void 0, !0)], 8, w)]),
75
+ _: 3
76
+ }, 16)) : l("", !0)]),
77
+ _: 3
78
+ }, 16)]),
79
+ _: 3
80
+ }, 8, ["open"])], 16));
81
+ }
82
+ }), [["__scopeId", "data-v-be7411d6"]]);
83
+ export { T as default };
@@ -0,0 +1,195 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "../core/button.ce.js";
3
+ import ee from "../core/icon.ce.js";
4
+ import { presenceTransition as n } from "../../utils/motion.js";
5
+ import { dismissInteraction as r, flattenChoices as te, useInteractionModel as i, useInteractionReset as ne, useInteractionRoot as a, usePlacement as o } from "../../utils/interaction.js";
6
+ import s from "../core/icon-button.ce.js";
7
+ import c from "../core/tree.ce.js";
8
+ /* empty css */
9
+ import { Fragment as l, Transition as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, mergeProps as v, nextTick as y, openBlock as b, ref as x, renderList as S, toDisplayString as C, unref as w, vModelSelect as re, watch as ie, withCtx as T, withDirectives as ae, withKeys as oe, withModifiers as E } from "vue";
10
+ import { PopoverContent as D, PopoverRoot as O, PopoverTrigger as k } from "reka-ui";
11
+ import { Cancel01Icon as A } from "@hugeicons/core-free-icons";
12
+ // src/components/interaction/tree-select.ce.vue
13
+ var j = { class: "kima-tree-select__control" }, M = [
14
+ "multiple",
15
+ "name",
16
+ "required",
17
+ "disabled"
18
+ ], N = {
19
+ key: 0,
20
+ value: ""
21
+ }, P = [
22
+ "value",
23
+ "data-index",
24
+ "disabled"
25
+ ], F = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
26
+ __name: "tree-select.ce",
27
+ props: {
28
+ modelValue: {
29
+ type: [
30
+ String,
31
+ Number,
32
+ Boolean,
33
+ Array
34
+ ],
35
+ default: null
36
+ },
37
+ open: Boolean,
38
+ expanded: {
39
+ type: Array,
40
+ default: () => []
41
+ },
42
+ items: {
43
+ type: Array,
44
+ default: () => []
45
+ },
46
+ multiple: Boolean,
47
+ clearable: Boolean,
48
+ disabled: Boolean,
49
+ name: String,
50
+ required: Boolean,
51
+ label: {
52
+ type: String,
53
+ default: "树选择"
54
+ },
55
+ placeholder: {
56
+ type: String,
57
+ default: "请选择节点"
58
+ },
59
+ placement: {
60
+ type: String,
61
+ default: "bottom-start"
62
+ }
63
+ },
64
+ emits: [
65
+ "update:modelValue",
66
+ "update:open",
67
+ "update:expanded",
68
+ "change"
69
+ ],
70
+ setup(e, { emit: F }) {
71
+ let I = e, L = F, { root: R, attrs: z, forwardedAttrs: B } = a(), [V, H] = i(I, "modelValue", L), [U, W] = i(I, "open", L), [G, K] = i(I, "expanded", L), se = o(I), q = x(null), J = d(() => te(I.items)), Y = d(() => I.multiple ? Array.isArray(V.value) ? V.value : [] : V.value == null ? [] : [V.value]), X = d(() => J.value.filter((e) => Y.value.includes(e.value)));
72
+ function Z(e) {
73
+ e && I.disabled || W(e);
74
+ }
75
+ function Q(e) {
76
+ I.disabled || (H(e), L("change", e), I.multiple || Z(!1));
77
+ }
78
+ function ce() {
79
+ Q(I.multiple ? [] : null), y(() => {
80
+ U.value || R.value?.querySelector("button")?.focus();
81
+ });
82
+ }
83
+ function le(e) {
84
+ e.preventDefault(), y(() => {
85
+ (q.value?.$el || q.value)?.querySelector("[role=\"treeitem\"][tabindex=\"0\"]")?.focus();
86
+ });
87
+ }
88
+ let $ = d({
89
+ get: () => I.multiple ? Y.value.map(String) : Y.value.length ? String(Y.value[0]) : "",
90
+ set: (e) => {
91
+ let t = (Array.isArray(e) ? e : [e]).map((e) => J.value.find((t) => String(t.value) === e)?.value).filter((e) => e !== void 0);
92
+ Q(I.multiple ? t : t[0] ?? null);
93
+ }
94
+ });
95
+ return ne(R, V, H, () => Z(!1)), ie(() => I.disabled, (e) => {
96
+ e && Z(!1);
97
+ }), (te, i) => (b(), m("div", v({
98
+ ref_key: "root",
99
+ ref: R
100
+ }, w(B), { class: "kima-tree-select" }), [h("div", j, [_(w(O), {
101
+ open: w(U) && !e.disabled,
102
+ modal: !1,
103
+ "onUpdate:open": Z
104
+ }, {
105
+ default: T(() => [_(w(k), { "as-child": "" }, {
106
+ default: T(() => [_(t, {
107
+ variant: "tonal",
108
+ disabled: e.disabled,
109
+ "aria-label": w(z)["aria-label"] || e.label,
110
+ "aria-required": e.required || void 0,
111
+ onKeydown: i[0] ||= oe(E((e) => Z(!0), ["prevent"]), ["down"])
112
+ }, {
113
+ default: T(() => [g(C(X.value.length ? X.value.map((e) => e.label).join("、") : e.placeholder), 1)]),
114
+ _: 1
115
+ }, 8, [
116
+ "disabled",
117
+ "aria-label",
118
+ "aria-required"
119
+ ])]),
120
+ _: 1
121
+ }), _(u, v({ name: "kima-popup" }, w(n)), {
122
+ default: T(() => [w(U) && !e.disabled ? (b(), f(w(D), v({
123
+ key: 0,
124
+ "force-mount": ""
125
+ }, w(se), {
126
+ class: "kima-tree-select__popup",
127
+ inert: !w(U) || e.disabled,
128
+ "aria-hidden": !w(U) || e.disabled || void 0,
129
+ "aria-label": e.label,
130
+ onOpenAutoFocus: le,
131
+ onEscapeKeyDown: i[1] ||= (e) => w(r)(e, () => Z(!1))
132
+ }), {
133
+ default: T(() => [_(c, {
134
+ ref_key: "panel",
135
+ ref: q,
136
+ items: e.items,
137
+ "model-value": w(V),
138
+ expanded: w(G),
139
+ multiple: e.multiple,
140
+ selectable: "",
141
+ "aria-label": e.label,
142
+ "onUpdate:modelValue": Q,
143
+ "onUpdate:expanded": w(K)
144
+ }, null, 8, [
145
+ "items",
146
+ "model-value",
147
+ "expanded",
148
+ "multiple",
149
+ "aria-label",
150
+ "onUpdate:expanded"
151
+ ])]),
152
+ _: 1
153
+ }, 16, [
154
+ "inert",
155
+ "aria-hidden",
156
+ "aria-label"
157
+ ])) : p("", !0)]),
158
+ _: 1
159
+ }, 16)]),
160
+ _: 1
161
+ }, 8, ["open"]), _(u, v({ name: "kima-fade" }, w(n)), {
162
+ default: T(() => [e.clearable && X.value.length ? (b(), f(s, {
163
+ key: 0,
164
+ label: "清除选择",
165
+ disabled: e.disabled,
166
+ onClick: ce
167
+ }, {
168
+ default: T(() => [_(ee, {
169
+ icon: w(A),
170
+ size: 20
171
+ }, null, 8, ["icon"])]),
172
+ _: 1
173
+ }, 8, ["disabled"])) : p("", !0)]),
174
+ _: 1
175
+ }, 16)]), ae(h("select", {
176
+ "onUpdate:modelValue": i[2] ||= (e) => $.value = e,
177
+ class: "kima-tree-select__native",
178
+ multiple: e.multiple,
179
+ name: e.name,
180
+ required: e.required,
181
+ disabled: e.disabled,
182
+ tabindex: "-1",
183
+ "aria-hidden": "true",
184
+ onInput: i[3] ||= E(() => {}, ["stop"]),
185
+ onChange: i[4] ||= E(() => {}, ["stop"]),
186
+ onInvalid: i[5] ||= E((e) => w(R)?.querySelector("button")?.focus(), ["prevent"])
187
+ }, [e.multiple ? p("", !0) : (b(), m("option", N)), (b(!0), m(l, null, S(J.value, (e, t) => (b(), m("option", {
188
+ key: e.value,
189
+ value: String(e.value),
190
+ "data-index": t,
191
+ disabled: e.disabled
192
+ }, C(e.label), 9, P))), 128))], 40, M), [[re, $.value]])], 16));
193
+ }
194
+ }), [["__scopeId", "data-v-46d37539"]]);
195
+ export { F 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 n from "../core/icon.ce.js";
4
+ import { collapseTransition as r } from "../../utils/motion.js";
5
+ import { useNavigationModel as i, useNavigationRoot as a } from "../../utils/navigation.js";
6
+ /* empty css */
7
+ import { Fragment as o, Transition as s, computed as c, createBlock as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, mergeProps as m, normalizeClass as h, openBlock 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";
8
+ import { AccordionHeader as T, AccordionItem as E, AccordionRoot as D, AccordionTrigger as O } from "reka-ui";
9
+ import { ArrowDown01Icon as k } from "@hugeicons/core-free-icons";
10
+ // src/components/navigation/accordion.ce.vue
11
+ var A = [
12
+ "id",
13
+ "aria-labelledby",
14
+ "aria-hidden",
15
+ "inert"
16
+ ], j = { class: "kima-accordion__content" }, M = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
17
+ __name: "accordion.ce",
18
+ props: {
19
+ modelValue: {
20
+ type: [String, Array],
21
+ default: ""
22
+ },
23
+ items: {
24
+ type: Array,
25
+ default: () => []
26
+ },
27
+ multiple: Boolean,
28
+ disabled: Boolean,
29
+ collapsible: {
30
+ type: Boolean,
31
+ default: !0
32
+ },
33
+ label: {
34
+ type: String,
35
+ default: "折叠列表"
36
+ }
37
+ },
38
+ emits: ["update:modelValue", "change"],
39
+ setup(e, { emit: M }) {
40
+ let N = e, P = M, { root: F, forwardedAttrs: I } = a(), [L, R] = i(N, "modelValue", P), z = `kima-accordion-${x()}`, B = c(() => N.multiple ? Array.isArray(L.value) ? L.value : L.value ? [L.value] : [] : Array.isArray(L.value) ? L.value[0] || "" : L.value);
41
+ function V(e, t) {
42
+ return String(e.value ?? t);
43
+ }
44
+ function H(e) {
45
+ return N.multiple ? B.value.includes(e) : B.value === e;
46
+ }
47
+ return (i, a) => (g(), u("div", m({
48
+ ref_key: "root",
49
+ ref: F
50
+ }, b(I), { class: "kima-accordion" }), [p(b(D), {
51
+ "model-value": B.value,
52
+ type: e.multiple ? "multiple" : "single",
53
+ collapsible: e.collapsible,
54
+ disabled: e.disabled,
55
+ "aria-label": e.label,
56
+ "onUpdate:modelValue": b(R)
57
+ }, {
58
+ default: C(() => [(g(!0), u(o, null, _(e.items, (a, o) => (g(), l(b(E), {
59
+ key: V(a, o),
60
+ value: V(a, o),
61
+ disabled: a.disabled,
62
+ class: "kima-accordion__item"
63
+ }, {
64
+ default: C(() => [p(b(T), { class: "kima-accordion__heading" }, {
65
+ default: C(() => [p(b(O), { "as-child": "" }, {
66
+ default: C(() => [p(t, {
67
+ id: `${z}-trigger-${o}`,
68
+ variant: "text",
69
+ disabled: e.disabled || a.disabled,
70
+ "aria-controls": `${z}-panel-${o}`,
71
+ class: "kima-accordion__trigger"
72
+ }, {
73
+ default: C(() => [f(y(a.label), 1), p(n, {
74
+ class: h(["kima-accordion__arrow", { "kima-accordion__arrow--expanded": H(V(a, o)) }]),
75
+ icon: b(k),
76
+ size: 20,
77
+ "aria-hidden": "true"
78
+ }, null, 8, ["class", "icon"])]),
79
+ _: 2
80
+ }, 1032, [
81
+ "id",
82
+ "disabled",
83
+ "aria-controls"
84
+ ])]),
85
+ _: 2
86
+ }, 1024)]),
87
+ _: 2
88
+ }, 1024), p(s, m({ css: !1 }, { ref_for: !0 }, b(r)), {
89
+ default: C(() => [w(d("div", {
90
+ id: `${z}-panel-${o}`,
91
+ role: "region",
92
+ "aria-labelledby": `${z}-trigger-${o}`,
93
+ "aria-hidden": !H(V(a, o)),
94
+ inert: !H(V(a, o))
95
+ }, [d("div", j, [v(i.$slots, `panel-${V(a, o)}`, {
96
+ item: a,
97
+ index: o
98
+ }, () => [f(y(a.content), 1)], !0)])], 8, A), [[S, H(V(a, o))]])]),
99
+ _: 2
100
+ }, 1040)]),
101
+ _: 2
102
+ }, 1032, ["value", "disabled"]))), 128))]),
103
+ _: 3
104
+ }, 8, [
105
+ "model-value",
106
+ "type",
107
+ "collapsible",
108
+ "disabled",
109
+ "aria-label",
110
+ "onUpdate:modelValue"
111
+ ])], 16));
112
+ }
113
+ }), [["__scopeId", "data-v-19d76e75"]]);
114
+ export { M as default };
@@ -0,0 +1,125 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { scrollBehavior as t, scrollTarget as n, useNavigationModel as r, useNavigationRoot as i } from "../../utils/navigation.js";
3
+ import a from "./link.ce.js";
4
+ /* empty css */
5
+ import { Fragment as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, mergeProps as d, onBeforeUnmount as f, onMounted as p, openBlock as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
6
+ // src/components/navigation/anchor.ce.vue
7
+ var x = ["aria-label"], S = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
8
+ __name: "anchor.ce",
9
+ props: {
10
+ modelValue: {
11
+ type: String,
12
+ default: ""
13
+ },
14
+ items: {
15
+ type: Array,
16
+ default: () => []
17
+ },
18
+ target: {
19
+ type: [String, Object],
20
+ default: ""
21
+ },
22
+ offset: {
23
+ type: Number,
24
+ default: 24
25
+ },
26
+ smooth: {
27
+ type: Boolean,
28
+ default: !0
29
+ },
30
+ disabled: Boolean,
31
+ label: {
32
+ type: String,
33
+ default: "页内目录"
34
+ }
35
+ },
36
+ emits: [
37
+ "update:modelValue",
38
+ "change",
39
+ "navigate"
40
+ ],
41
+ setup(e, { emit: S }) {
42
+ let C = e, w = S, { root: T, forwardedAttrs: E } = i(), [D, O] = r(C, "modelValue", w), k, A, j, M, N = !1;
43
+ function P(e) {
44
+ if (!e?.startsWith("#")) return null;
45
+ try {
46
+ return document.getElementById(decodeURIComponent(e.slice(1)));
47
+ } catch {
48
+ return null;
49
+ }
50
+ }
51
+ function F() {
52
+ return C.items.filter((e) => !e.disabled).map((e) => ({
53
+ item: e,
54
+ element: P(e.href)
55
+ })).filter(({ element: e }) => e && (k === window || k?.contains(e)));
56
+ }
57
+ function I() {
58
+ if (M = void 0, !k) return;
59
+ let e = F();
60
+ if (!e.length) return;
61
+ let t = k === window ? 0 : k.getBoundingClientRect().top + k.clientTop, n = e[0];
62
+ for (let r of e) r.element.getBoundingClientRect().top <= t + C.offset + 1 && (n = r);
63
+ let r = k === window ? window.scrollY : k.scrollTop, i = k === window ? window.innerHeight : k.clientHeight, a = k === window ? document.documentElement.scrollHeight : k.scrollHeight;
64
+ r > 0 && r + i >= a - 2 && (n = e.at(-1)), O(n.item.href);
65
+ }
66
+ function L() {
67
+ M ||= requestAnimationFrame(I);
68
+ }
69
+ function R(e, n) {
70
+ if (C.disabled || e.disabled || n.ctrlKey || n.metaKey || n.shiftKey || n.altKey || n.button !== 0) return;
71
+ let r = P(e.href);
72
+ if (!r || !k) return;
73
+ n.preventDefault();
74
+ let i = k === window ? 0 : k.getBoundingClientRect().top + k.clientTop, a = k === window ? window.scrollY : k.scrollTop;
75
+ k.scrollTo({
76
+ top: a + r.getBoundingClientRect().top - i - C.offset,
77
+ behavior: t(C.smooth)
78
+ }), O(e.href), w("navigate", e.href);
79
+ }
80
+ function z() {
81
+ k?.removeEventListener("scroll", L), window.removeEventListener("resize", L), A?.disconnect(), j?.disconnect(), M && cancelAnimationFrame(M), M = void 0;
82
+ }
83
+ function B() {
84
+ z(), k = n(C.target), k?.addEventListener("scroll", L, { passive: !0 }), window.addEventListener("resize", L), A = new ResizeObserver(L);
85
+ for (let { element: e } of F()) A.observe(e);
86
+ j = new MutationObserver(L), j.observe(k === window ? document.body : k || T.value, {
87
+ childList: !0,
88
+ subtree: !0
89
+ }), L();
90
+ }
91
+ return p(() => {
92
+ N = !0, B();
93
+ }), y(() => [
94
+ C.target,
95
+ C.items,
96
+ C.offset
97
+ ], () => {
98
+ N && B();
99
+ }, {
100
+ deep: !0,
101
+ flush: "post"
102
+ }), f(z), (t, n) => (m(), s("nav", d({
103
+ ref_key: "root",
104
+ ref: T
105
+ }, v(E), {
106
+ class: "kima-anchor",
107
+ "aria-label": e.label
108
+ }), [c("ol", null, [(m(!0), s(o, null, h(e.items, (t, n) => (m(), s("li", { key: t.href ?? n }, [u(a, {
109
+ href: t.href,
110
+ disabled: e.disabled || t.disabled,
111
+ underline: !1,
112
+ current: v(D) === t.href && "location",
113
+ onNavigate: (e) => R(t, e)
114
+ }, {
115
+ default: b(() => [l(_(t.label), 1)]),
116
+ _: 2
117
+ }, 1032, [
118
+ "href",
119
+ "disabled",
120
+ "current",
121
+ "onNavigate"
122
+ ])]))), 128))]), g(t.$slots, "default", {}, void 0, !0)], 16, x));
123
+ }
124
+ }), [["__scopeId", "data-v-b3311001"]]);
125
+ export { S 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 { scrollBehavior as n, scrollTarget as r, useNavigationRoot as i } from "../../utils/navigation.js";
4
+ /* empty css */
5
+ import { Transition as a, createBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, mergeProps as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, unref as _, vShow as v, watch as y, withCtx as b, withDirectives as x } from "vue";
6
+ // src/components/navigation/back-top.ce.vue
7
+ var S = ["inert", "aria-hidden"], C = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
8
+ __name: "back-top.ce",
9
+ props: {
10
+ target: {
11
+ type: [String, Object],
12
+ default: ""
13
+ },
14
+ threshold: {
15
+ type: Number,
16
+ default: 240
17
+ },
18
+ smooth: {
19
+ type: Boolean,
20
+ default: !0
21
+ },
22
+ fixed: {
23
+ type: Boolean,
24
+ default: !0
25
+ },
26
+ disabled: Boolean,
27
+ label: {
28
+ type: String,
29
+ default: "返回顶部"
30
+ }
31
+ },
32
+ emits: ["click", "visibility-change"],
33
+ setup(e, { emit: C }) {
34
+ let w = e, T = C, { root: E, forwardedAttrs: D } = i(), O = m(!1), k;
35
+ function A() {
36
+ let e = !!(k && (k === window ? window.scrollY : k.scrollTop) >= Math.max(0, w.threshold));
37
+ e !== O.value && (O.value = e, T("visibility-change", e));
38
+ }
39
+ function j() {
40
+ k?.removeEventListener("scroll", A), k = r(w.target), k?.addEventListener("scroll", A, { passive: !0 }), A();
41
+ }
42
+ function M(e) {
43
+ w.disabled || (k?.scrollTo({
44
+ top: 0,
45
+ behavior: n(w.smooth)
46
+ }), T("click", e));
47
+ }
48
+ return f(j), y(() => w.target, j, { flush: "post" }), y(() => w.threshold, A), d(() => k?.removeEventListener("scroll", A)), (n, r) => (p(), o(a, { name: "kima-content" }, {
49
+ default: b(() => [x(s("div", u({
50
+ ref_key: "root",
51
+ ref: E
52
+ }, _(D), {
53
+ class: ["kima-back-top", { "kima-back-top--fixed": e.fixed }],
54
+ inert: !O.value,
55
+ "aria-hidden": !O.value
56
+ }), [l(t, {
57
+ disabled: e.disabled,
58
+ onClick: M
59
+ }, {
60
+ default: b(() => [h(n.$slots, "default", {}, () => [c(g(e.label), 1)], !0)]),
61
+ _: 3
62
+ }, 8, ["disabled"])], 16, S), [[v, O.value]])]),
63
+ _: 3
64
+ }));
65
+ }
66
+ }), [["__scopeId", "data-v-231687a3"]]);
67
+ export { C as default };