@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,146 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { collapseTransition as t, rememberCollapseHeight as n } from "../../utils/motion.js";
3
+ import { useNavigationRoot as r } from "../../utils/navigation.js";
4
+ /* empty css */
5
+ import { Transition as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, mergeProps as u, onBeforeUnmount as d, onBeforeUpdate as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, unref as v, useId as y, vShow as b, watch as x, withCtx as S, withDirectives as C } from "vue";
6
+ // src/components/foundation/field-group.ce.vue
7
+ var w = [
8
+ "disabled",
9
+ "data-valid",
10
+ "aria-describedby"
11
+ ], T = {
12
+ key: 0,
13
+ class: "kima-field-group__legend"
14
+ }, E = {
15
+ key: 0,
16
+ class: "kima-field-group__required"
17
+ }, D = { class: "kima-field-group__fields" }, O = ["inert", "aria-hidden"], k = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
18
+ __name: "field-group.ce",
19
+ props: {
20
+ legend: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ hint: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ error: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ required: Boolean,
33
+ disabled: Boolean
34
+ },
35
+ emits: ["validity-change"],
36
+ setup(e, { expose: k, emit: A }) {
37
+ let j = e, M = A, { root: N, forwardedAttrs: P } = r(), F = h(null);
38
+ f(() => n(F.value));
39
+ let I = `kima-field-group-${y()}`, L = `${I}-hint`, R = `${I}-error`, z = `${I}-status`, B = h({
40
+ valid: !0,
41
+ errors: []
42
+ }), V = /* @__PURE__ */ new Set(), H = /* @__PURE__ */ new Set(), U;
43
+ function W() {
44
+ return N.value ? [...N.value.querySelectorAll("input:not([type=\"hidden\"]),select,textarea,[role=\"combobox\"],[role=\"radiogroup\"]")].filter((e) => e.closest(".kima-field-group") === N.value && !e.disabled) : [];
45
+ }
46
+ function G(e) {
47
+ return ["checkbox", "radio"].includes(e.type) ? e.checked : String(e.value ?? "").trim() !== "";
48
+ }
49
+ function K() {
50
+ let e = W(), t = [];
51
+ for (let n of e) {
52
+ n.validity && n.validity.valid === !1 && t.push({
53
+ name: n.name || n.getAttribute("aria-label") || "",
54
+ message: n.validationMessage || "字段值无效"
55
+ });
56
+ let e = (n.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean).filter((e) => e !== L && e !== R);
57
+ j.hint && e.push(L), j.error && e.push(R);
58
+ let r = e.join(" ");
59
+ (n.getAttribute("aria-describedby") || "") !== r && (r ? n.setAttribute("aria-describedby", r) : n.removeAttribute("aria-describedby")), (j.hint || j.error) && H.add(n), j.error && !n.hasAttribute("aria-invalid") && (n.setAttribute("aria-invalid", "true"), V.add(n)), !j.error && V.has(n) && (n.removeAttribute("aria-invalid"), V.delete(n));
60
+ }
61
+ j.required && !e.some(G) && t.push({
62
+ name: "",
63
+ message: "此分组至少需要填写一项"
64
+ });
65
+ let n = {
66
+ valid: t.length === 0,
67
+ errors: t
68
+ };
69
+ JSON.stringify(n) !== JSON.stringify(B.value) && (B.value = n, M("validity-change", {
70
+ ...n,
71
+ controls: e.length
72
+ }));
73
+ }
74
+ function q() {
75
+ return K(), B.value;
76
+ }
77
+ function J() {
78
+ let e = W();
79
+ return (e.find((e) => e.validity && e.validity.valid === !1) || (j.required && !e.some(G) ? e[0] : null))?.reportValidity?.(), K(), B.value.valid;
80
+ }
81
+ return x(() => [
82
+ j.hint,
83
+ j.error,
84
+ j.required
85
+ ], K, { flush: "post" }), p(() => {
86
+ K();
87
+ let e = N.value.ownerDocument.defaultView;
88
+ N.value.addEventListener("input", K, !0), N.value.addEventListener("change", K, !0), U = new e.MutationObserver(K), U.observe(N.value, {
89
+ childList: !0,
90
+ subtree: !0,
91
+ attributes: !0,
92
+ attributeFilter: [
93
+ "aria-describedby",
94
+ "aria-invalid",
95
+ "disabled"
96
+ ]
97
+ });
98
+ }), d(() => {
99
+ U?.disconnect(), N.value?.removeEventListener("input", K, !0), N.value?.removeEventListener("change", K, !0);
100
+ for (let e of H) {
101
+ let t = (e.getAttribute("aria-describedby") || "").split(/\s+/).filter((e) => e && e !== L && e !== R);
102
+ t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
103
+ }
104
+ for (let e of V) e.removeAttribute("aria-invalid");
105
+ }), k({
106
+ validate: q,
107
+ reportValidity: J
108
+ }), (n, r) => (m(), o("fieldset", u({
109
+ ref_key: "root",
110
+ ref: N
111
+ }, v(P), {
112
+ class: "kima-field-group",
113
+ disabled: e.disabled,
114
+ "data-valid": B.value.valid,
115
+ "aria-describedby": [e.hint ? L : "", e.error ? R : ""].filter(Boolean).join(" ") || void 0
116
+ }), [
117
+ e.legend ? (m(), o("legend", T, [c(_(e.legend), 1), e.required ? (m(), o("span", E, "必填")) : a("", !0)])) : a("", !0),
118
+ s("div", D, [g(n.$slots, "default", {}, void 0, !0)]),
119
+ l(i, u({ css: !1 }, v(t)), {
120
+ default: S(() => [C(s("div", {
121
+ ref_key: "messages",
122
+ ref: F,
123
+ class: "kima-field-group__messages",
124
+ inert: !e.hint && !e.error,
125
+ "aria-hidden": !e.hint && !e.error || void 0
126
+ }, [e.hint ? (m(), o("p", {
127
+ key: 0,
128
+ id: L,
129
+ class: "kima-field-group__hint"
130
+ }, _(e.hint), 1)) : a("", !0), e.error ? (m(), o("p", {
131
+ key: 1,
132
+ id: R,
133
+ class: "kima-field-group__error",
134
+ role: "alert"
135
+ }, _(e.error), 1)) : a("", !0)], 8, O), [[b, e.hint || e.error]])]),
136
+ _: 1
137
+ }, 16),
138
+ s("p", {
139
+ id: z,
140
+ class: "kima-field-group__status",
141
+ "aria-live": "polite"
142
+ }, _(B.value.valid ? "分组有效" : `分组有 ${B.value.errors.length} 项待处理`), 1)
143
+ ], 16, w));
144
+ }
145
+ }), [["__scopeId", "data-v-144ed12e"]]);
146
+ export { k as default };
@@ -0,0 +1,60 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import { choice as n, layoutVariables as r, space as i } from "../../utils/foundation.js";
4
+ /* empty css */
5
+ import { computed as a, createElementBlock as o, mergeProps as s, openBlock as c, renderSlot as l, unref as u } from "vue";
6
+ var d = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
7
+ __name: "flex.ce",
8
+ props: {
9
+ direction: {
10
+ type: String,
11
+ default: "row"
12
+ },
13
+ wrap: {
14
+ type: String,
15
+ default: "wrap"
16
+ },
17
+ gap: {
18
+ type: [Number, Object],
19
+ default: 4
20
+ },
21
+ align: {
22
+ type: String,
23
+ default: "stretch"
24
+ },
25
+ justify: {
26
+ type: String,
27
+ default: "start"
28
+ }
29
+ },
30
+ setup(e) {
31
+ let d = e, { root: f, forwardedAttrs: p } = t(), m = {
32
+ start: "flex-start",
33
+ end: "flex-end",
34
+ center: "center",
35
+ stretch: "stretch",
36
+ baseline: "baseline"
37
+ }, h = {
38
+ start: "flex-start",
39
+ end: "flex-end",
40
+ center: "center",
41
+ "space-between": "space-between",
42
+ "space-around": "space-around",
43
+ "space-evenly": "space-evenly"
44
+ }, g = a(() => ({
45
+ ...r("flex", "gap", d.gap, i, 4),
46
+ flexDirection: n(d.direction, ["row", "column"], "row"),
47
+ flexWrap: n(d.wrap, ["wrap", "nowrap"], "wrap"),
48
+ alignItems: m[n(d.align, Object.keys(m), "stretch")],
49
+ justifyContent: h[n(d.justify, Object.keys(h), "start")]
50
+ }));
51
+ return (e, t) => (c(), o("div", s({
52
+ ref_key: "root",
53
+ ref: f
54
+ }, u(p), {
55
+ class: "kima-flex",
56
+ style: g.value
57
+ }), [l(e.$slots, "default", {}, void 0, !0)], 16));
58
+ }
59
+ }), [["__scopeId", "data-v-317459cf"]]);
60
+ export { d as default };
@@ -0,0 +1,52 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import { choice as n, columnTemplate as r, gridAreas as i, layoutVariables as a, space as o } from "../../utils/foundation.js";
4
+ /* empty css */
5
+ import { Fragment as s, computed as c, createElementBlock as l, mergeProps as u, normalizeStyle as d, openBlock as f, renderList as p, renderSlot as m, unref as h } from "vue";
6
+ var g = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
7
+ __name: "grid.ce",
8
+ props: {
9
+ columns: {
10
+ type: [Number, Object],
11
+ default: void 0
12
+ },
13
+ gap: {
14
+ type: [Number, Object],
15
+ default: 4
16
+ },
17
+ areas: {
18
+ type: Array,
19
+ default: () => []
20
+ },
21
+ align: {
22
+ type: String,
23
+ default: "stretch"
24
+ }
25
+ },
26
+ setup(e) {
27
+ let g = e, { root: _, forwardedAttrs: v } = t(), y = c(() => i(g.areas)), b = c(() => y.value.columns || 1), x = c(() => ({
28
+ ...a("grid", "columns", g.columns ?? b.value, r, b.value),
29
+ ...a("grid", "gap", g.gap, o, 4),
30
+ gridTemplateAreas: y.value.template,
31
+ alignItems: n(g.align, [
32
+ "start",
33
+ "end",
34
+ "center",
35
+ "stretch",
36
+ "baseline"
37
+ ], "stretch")
38
+ }));
39
+ return (e, t) => (f(), l("div", u({
40
+ ref_key: "root",
41
+ ref: _
42
+ }, h(v), {
43
+ class: "kima-grid",
44
+ style: x.value
45
+ }), [(f(!0), l(s, null, p(y.value.names, (t) => (f(), l("div", {
46
+ key: t,
47
+ class: "kima-grid__cell",
48
+ style: d({ gridArea: t })
49
+ }, [m(e.$slots, t, {}, void 0, !0)], 4))), 128)), m(e.$slots, "default", {}, void 0, !0)], 16));
50
+ }
51
+ }), [["__scopeId", "data-v-c1ea1f88"]]);
52
+ export { g as default };
@@ -0,0 +1,34 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ /* empty css */
4
+ import { createCommentVNode as n, createElementBlock as r, createElementVNode as i, mergeProps as a, openBlock as o, renderSlot as s, unref as c } from "vue";
5
+ // src/components/foundation/input-group.ce.vue
6
+ var l = ["aria-label"], u = {
7
+ key: 0,
8
+ class: "kima-input-group__decoration kima-input-group__decoration--prefix"
9
+ }, d = { class: "kima-input-group__control" }, f = {
10
+ key: 1,
11
+ class: "kima-input-group__decoration kima-input-group__decoration--suffix"
12
+ }, p = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
13
+ __name: "input-group.ce",
14
+ props: { label: {
15
+ type: String,
16
+ default: "输入组"
17
+ } },
18
+ setup(e) {
19
+ let { root: p, forwardedAttrs: m, hasNativeSlot: h, isCustomElement: g } = t();
20
+ return (t, _) => (o(), r("div", a({
21
+ ref_key: "root",
22
+ ref: p
23
+ }, c(m), {
24
+ class: "kima-input-group",
25
+ role: "group",
26
+ "aria-label": e.label
27
+ }), [
28
+ t.$slots.prefix || c(h)("prefix") || c(g) ? (o(), r("div", u, [s(t.$slots, "prefix", {}, void 0, !0)])) : n("", !0),
29
+ i("div", d, [s(t.$slots, "default", {}, void 0, !0)]),
30
+ t.$slots.suffix || c(h)("suffix") || c(g) ? (o(), r("div", f, [s(t.$slots, "suffix", {}, void 0, !0)])) : n("", !0)
31
+ ], 16, l));
32
+ }
33
+ }), [["__scopeId", "data-v-5729e4c1"]]);
34
+ export { p as default };
@@ -0,0 +1,55 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import { choice as n } from "../../utils/foundation.js";
4
+ /* empty css */
5
+ import { computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, mergeProps as l, openBlock as u, renderSlot as d, resolveDynamicComponent as f, toDisplayString as p, unref as m, withCtx as h } from "vue";
6
+ // src/components/foundation/page-header.ce.vue
7
+ var g = {
8
+ key: 0,
9
+ class: "kima-page-header__breadcrumbs",
10
+ "aria-label": "面包屑"
11
+ }, _ = { class: "kima-page-header__row" }, v = { class: "kima-page-header__body" }, y = {
12
+ key: 1,
13
+ class: "kima-page-header__description"
14
+ }, b = {
15
+ key: 0,
16
+ class: "kima-page-header__actions"
17
+ }, x = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
18
+ __name: "page-header.ce",
19
+ props: {
20
+ heading: {
21
+ type: String,
22
+ default: ""
23
+ },
24
+ description: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ level: {
29
+ type: Number,
30
+ default: 1
31
+ },
32
+ align: {
33
+ type: String,
34
+ default: "start"
35
+ }
36
+ },
37
+ setup(e) {
38
+ let x = e, { root: S, forwardedAttrs: C, hasNativeSlot: w, isCustomElement: T } = t(), E = r(() => `h${Math.min(6, Math.max(1, Number(x.level) || 1))}`), D = r(() => n(x.align, ["start", "center"], "start"));
39
+ return (t, n) => (u(), o("header", l({
40
+ ref_key: "root",
41
+ ref: S
42
+ }, m(C), { class: ["kima-page-header", `kima-page-header--${D.value}`] }), [t.$slots.breadcrumbs || m(w)("breadcrumbs") || m(T) ? (u(), o("nav", g, [d(t.$slots, "breadcrumbs", {}, void 0, !0)])) : a("", !0), s("div", _, [s("div", v, [
43
+ e.heading ? (u(), i(f(E.value), {
44
+ key: 0,
45
+ class: "kima-page-header__title"
46
+ }, {
47
+ default: h(() => [c(p(e.heading), 1)]),
48
+ _: 1
49
+ })) : a("", !0),
50
+ e.description ? (u(), o("p", y, p(e.description), 1)) : a("", !0),
51
+ d(t.$slots, "default", {}, void 0, !0)
52
+ ]), t.$slots.actions || m(w)("actions") || m(T) ? (u(), o("div", b, [d(t.$slots, "actions", {}, void 0, !0)])) : a("", !0)])], 16));
53
+ }
54
+ }), [["__scopeId", "data-v-819de002"]]);
55
+ export { x as default };
@@ -0,0 +1,129 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import { choice as n } from "../../utils/foundation.js";
4
+ /* empty css */
5
+ import { computed as r, createElementBlock as i, mergeProps as a, openBlock as o, toDisplayString as s, unref as c } from "vue";
6
+ // src/components/foundation/time-display.ce.vue
7
+ var l = ["datetime"], u = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
8
+ __name: "time-display.ce",
9
+ props: {
10
+ value: {
11
+ type: [
12
+ String,
13
+ Number,
14
+ Date
15
+ ],
16
+ default: null
17
+ },
18
+ mode: {
19
+ type: String,
20
+ default: "datetime"
21
+ },
22
+ locale: {
23
+ type: [String, Array],
24
+ default: void 0
25
+ },
26
+ timeZone: {
27
+ type: String,
28
+ default: ""
29
+ },
30
+ dateStyle: {
31
+ type: String,
32
+ default: "medium"
33
+ },
34
+ timeStyle: {
35
+ type: String,
36
+ default: "short"
37
+ },
38
+ fallback: {
39
+ type: String,
40
+ default: "时间不可用"
41
+ }
42
+ },
43
+ setup(e) {
44
+ let u = e, { root: d, forwardedAttrs: f } = t(), p = r(() => n(u.mode, [
45
+ "date",
46
+ "time",
47
+ "datetime"
48
+ ], "datetime"));
49
+ function m(e) {
50
+ if (e instanceof Date) return Number.isNaN(e.getTime()) ? null : {
51
+ date: new Date(e.getTime()),
52
+ kind: "instant"
53
+ };
54
+ if (typeof e == "number") return Number.isFinite(e) ? {
55
+ date: new Date(e),
56
+ kind: "instant"
57
+ } : null;
58
+ if (typeof e != "string" || !e.trim()) return null;
59
+ let t = e.trim(), n = /^(\d{4})-(\d{2})-(\d{2})$/.exec(t);
60
+ if (n) {
61
+ let [e, r, i] = [
62
+ Number(n[1]),
63
+ Number(n[2]),
64
+ Number(n[3])
65
+ ], a = new Date(Date.UTC(e, r - 1, i));
66
+ return a.getUTCFullYear() === e && a.getUTCMonth() === r - 1 && a.getUTCDate() === i ? {
67
+ date: a,
68
+ kind: "date",
69
+ text: t
70
+ } : null;
71
+ }
72
+ if (n = /^(\d{2}):(\d{2})(?::(\d{2}))?$/.exec(t), n) {
73
+ let [e, r, i] = [
74
+ Number(n[1]),
75
+ Number(n[2]),
76
+ Number(n[3] || 0)
77
+ ];
78
+ return e > 23 || r > 59 || i > 59 ? null : {
79
+ date: new Date(Date.UTC(2e3, 0, 1, e, r, i)),
80
+ kind: "time",
81
+ text: t
82
+ };
83
+ }
84
+ let r = new Date(t);
85
+ return Number.isNaN(r.getTime()) ? null : {
86
+ date: r,
87
+ kind: "instant"
88
+ };
89
+ }
90
+ let h = r(() => m(u.value)), g = r(() => h.value?.date || null), _ = r(() => {
91
+ let e = [
92
+ "full",
93
+ "long",
94
+ "medium",
95
+ "short"
96
+ ], t = {};
97
+ return p.value !== "time" && (t.dateStyle = n(u.dateStyle, e, "medium")), p.value !== "date" && (t.timeStyle = n(u.timeStyle, e, "short")), h.value && h.value.kind !== "instant" ? t.timeZone = "UTC" : u.timeZone && (t.timeZone = u.timeZone), t;
98
+ });
99
+ function v(e) {
100
+ let t = e || u.locale;
101
+ try {
102
+ return new Intl.DateTimeFormat(t, _.value);
103
+ } catch {
104
+ let e = { ..._.value };
105
+ delete e.timeZone;
106
+ try {
107
+ return new Intl.DateTimeFormat(t, e);
108
+ } catch {
109
+ return null;
110
+ }
111
+ }
112
+ }
113
+ let y = r(() => {
114
+ if (!g.value) return u.fallback;
115
+ let e = v(void 0) || v("en-GB");
116
+ return e ? e.format(g.value) : p.value === "time" ? g.value.toISOString().slice(11, 16) : g.value.toISOString().slice(0, 10);
117
+ }), b = r(() => {
118
+ if (!(!g.value || p.value === "time" && h.value.kind !== "instant")) return h.value.kind === "date" && p.value === "date" ? h.value.text : g.value.toISOString();
119
+ });
120
+ return (e, t) => (o(), i("time", a({
121
+ ref_key: "root",
122
+ ref: d
123
+ }, c(f), {
124
+ class: "kima-time-display",
125
+ datetime: b.value
126
+ }), s(y.value), 17, l));
127
+ }
128
+ }), [["__scopeId", "data-v-31f1f739"]]);
129
+ export { u as default };
@@ -0,0 +1,71 @@
1
+ import e from "../../_virtual/_plugin-vue_export-helper.js";
2
+ import { useNavigationRoot as t } from "../../utils/navigation.js";
3
+ import { choice as n } from "../../utils/foundation.js";
4
+ /* empty css */
5
+ import { computed as r, createBlock as i, mergeProps as a, openBlock as o, renderSlot as s, resolveDynamicComponent as c, unref as l, withCtx as u } from "vue";
6
+ var d = /*#__PURE__*/ e(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
7
+ __name: "typography.ce",
8
+ props: {
9
+ type: {
10
+ type: String,
11
+ default: "body"
12
+ },
13
+ level: {
14
+ type: Number,
15
+ default: 2
16
+ },
17
+ size: {
18
+ type: String,
19
+ default: ""
20
+ },
21
+ color: {
22
+ type: String,
23
+ default: "default"
24
+ }
25
+ },
26
+ setup(e) {
27
+ let d = e, { root: f, forwardedAttrs: p } = t(), m = [
28
+ "display-large",
29
+ "display-medium",
30
+ "display-small",
31
+ "headline-large",
32
+ "headline-medium",
33
+ "headline-small",
34
+ "title-large",
35
+ "title-medium",
36
+ "title-small",
37
+ "body-large",
38
+ "body-medium",
39
+ "body-small",
40
+ "label-large",
41
+ "label-medium",
42
+ "label-small"
43
+ ], h = {
44
+ heading: "headline-small",
45
+ body: "body-medium",
46
+ caption: "label-medium"
47
+ }, g = r(() => n(d.type, [
48
+ "heading",
49
+ "body",
50
+ "caption"
51
+ ], "body")), _ = r(() => g.value === "heading" ? `h${Math.min(6, Math.max(1, Number(d.level) || 2))}` : g.value === "caption" ? "small" : "p"), v = r(() => n(d.size, m, h[g.value])), y = r(() => n(d.color, [
52
+ "default",
53
+ "muted",
54
+ "primary",
55
+ "success",
56
+ "warning",
57
+ "danger"
58
+ ], "default"));
59
+ return (e, t) => (o(), i(c(_.value), a({
60
+ ref_key: "root",
61
+ ref: f
62
+ }, l(p), {
63
+ class: ["kima-typography", [`kima-typography--${g.value}`, `kima-typography--color-${y.value}`]],
64
+ style: { "--kima-typography-size": `var(--kima-font-size-${v.value})` }
65
+ }), {
66
+ default: u(() => [s(e.$slots, "default", {}, void 0, !0)]),
67
+ _: 3
68
+ }, 16, ["class", "style"]));
69
+ }
70
+ }), [["__scopeId", "data-v-d92fa782"]]);
71
+ export { d as default };
@@ -0,0 +1,93 @@
1
+ import { useRipple as e } from "../../utils/ripple.js";
2
+ import t from "../../_virtual/_plugin-vue_export-helper.js";
3
+ import n from "../core/icon.ce.js";
4
+ import { useInputAttrs as r, useInputState as i } from "../../utils/input-state.js";
5
+ /* empty css */
6
+ import { Fragment as a, computed as o, createElementBlock as s, createElementVNode as c, createVNode as l, mergeProps as u, normalizeClass as d, openBlock as f, ref as p, renderList as m, toDisplayString as h, unref as g, withModifiers as _ } from "vue";
7
+ import { MinusSignIcon as v, Tick02Icon as y } from "@hugeicons/core-free-icons";
8
+ // src/components/input/checkbox-group.ce.vue
9
+ var b = [
10
+ "aria-label",
11
+ "aria-orientation",
12
+ "disabled",
13
+ "aria-disabled"
14
+ ], x = ["aria-disabled"], S = [
15
+ "name",
16
+ "value",
17
+ "checked",
18
+ "disabled",
19
+ "required",
20
+ "onChange"
21
+ ], C = {
22
+ class: "kima-checkbox-group__box",
23
+ "aria-hidden": "true"
24
+ }, w = { class: "kima-checkbox-group__label" }, T = /*#__PURE__*/ t(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
25
+ __name: "checkbox-group.ce",
26
+ props: {
27
+ modelValue: {
28
+ type: Array,
29
+ default: () => []
30
+ },
31
+ options: {
32
+ type: Array,
33
+ default: () => []
34
+ },
35
+ label: String,
36
+ name: String,
37
+ disabled: Boolean,
38
+ required: Boolean,
39
+ orientation: {
40
+ type: String,
41
+ default: "vertical"
42
+ }
43
+ },
44
+ emits: ["update:modelValue", "change"],
45
+ setup(t, { emit: T }) {
46
+ let E = t, D = T, O = p(null), { attrs: k, controlAttrs: A } = r(), { local: j, update: M } = i(E, D, O, (e) => Array.isArray(e) ? e : []), N = o(() => E.options.map((e) => typeof e == "object" ? e : {
47
+ value: e,
48
+ label: String(e)
49
+ })), P = o(() => N.value.findIndex((e) => !e.disabled)), F = o(() => N.value.some((e) => !e.disabled && j.value.includes(e.value)));
50
+ e(O);
51
+ function I(e, t) {
52
+ M(t ? [...j.value, e] : j.value.filter((t) => t !== e));
53
+ }
54
+ return (e, r) => (f(), s("fieldset", u({
55
+ ref_key: "root",
56
+ ref: O
57
+ }, g(A), {
58
+ class: ["kima-checkbox-group", g(k).class],
59
+ style: g(k).style,
60
+ "aria-label": g(A)["aria-label"] || t.label,
61
+ "aria-orientation": t.orientation,
62
+ disabled: t.disabled,
63
+ "aria-disabled": t.disabled || void 0
64
+ }), [(f(!0), s(a, null, m(N.value, (e, i) => (f(), s("label", {
65
+ key: e.value,
66
+ class: d(["kima-checkbox-group__item", { "kima-checkbox-group__item--disabled": t.disabled || e.disabled }]),
67
+ "aria-disabled": t.disabled || e.disabled || void 0
68
+ }, [
69
+ c("input", {
70
+ class: "kima-checkbox-group__input",
71
+ type: "checkbox",
72
+ name: t.name,
73
+ value: e.value,
74
+ checked: g(j).includes(e.value),
75
+ disabled: t.disabled || e.disabled,
76
+ required: t.required && !F.value && i === P.value,
77
+ onInput: r[0] ||= _(() => {}, ["stop"]),
78
+ onChange: _((t) => I(e.value, t.target.checked), ["stop"])
79
+ }, null, 40, S),
80
+ c("span", C, [l(n, {
81
+ class: "kima-checkbox-group__mark kima-checkbox-group__mark--tick",
82
+ icon: g(y),
83
+ size: 20
84
+ }, null, 8, ["icon"]), l(n, {
85
+ class: "kima-checkbox-group__mark kima-checkbox-group__mark--dash",
86
+ icon: g(v),
87
+ size: 20
88
+ }, null, 8, ["icon"])]),
89
+ c("span", w, h(e.label), 1)
90
+ ], 10, x))), 128))], 16, b));
91
+ }
92
+ }), [["__scopeId", "data-v-f017d36a"]]);
93
+ export { T as default };