@guoyg578/k-ui 0.1.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 (179) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.js +8 -0
  4. package/dist/components/KAlert.js +7 -0
  5. package/dist/components/KAlert.vue.d.ts +40 -0
  6. package/dist/components/KAlert.vue_vue_type_script_setup_true_lang.js +76 -0
  7. package/dist/components/KAvatar.js +7 -0
  8. package/dist/components/KAvatar.vue.d.ts +15 -0
  9. package/dist/components/KAvatar.vue_vue_type_script_setup_true_lang.js +53 -0
  10. package/dist/components/KAvatarGroup.js +7 -0
  11. package/dist/components/KAvatarGroup.vue.d.ts +18 -0
  12. package/dist/components/KAvatarGroup.vue_vue_type_script_setup_true_lang.js +11 -0
  13. package/dist/components/KBreadcrumb.js +7 -0
  14. package/dist/components/KBreadcrumb.vue.d.ts +12 -0
  15. package/dist/components/KBreadcrumb.vue_vue_type_script_setup_true_lang.js +38 -0
  16. package/dist/components/KButton.js +7 -0
  17. package/dist/components/KButton.vue.d.ts +36 -0
  18. package/dist/components/KButton.vue_vue_type_script_setup_true_lang.js +50 -0
  19. package/dist/components/KCard.js +7 -0
  20. package/dist/components/KCard.vue.d.ts +33 -0
  21. package/dist/components/KCard.vue_vue_type_script_setup_true_lang.js +50 -0
  22. package/dist/components/KCarousel.js +7 -0
  23. package/dist/components/KCarousel.vue.d.ts +59 -0
  24. package/dist/components/KCarousel.vue_vue_type_script_setup_true_lang.js +141 -0
  25. package/dist/components/KCheckbox.js +7 -0
  26. package/dist/components/KCheckbox.vue.d.ts +26 -0
  27. package/dist/components/KCheckbox.vue_vue_type_script_setup_true_lang.js +48 -0
  28. package/dist/components/KCheckboxGroup.js +7 -0
  29. package/dist/components/KCheckboxGroup.vue.d.ts +27 -0
  30. package/dist/components/KCheckboxGroup.vue_vue_type_script_setup_true_lang.js +36 -0
  31. package/dist/components/KCombobox.js +8 -0
  32. package/dist/components/KCombobox.vue.d.ts +28 -0
  33. package/dist/components/KCombobox.vue_vue_type_script_setup_true_lang.js +120 -0
  34. package/dist/components/KCommandPalette.js +7 -0
  35. package/dist/components/KCommandPalette.vue.d.ts +31 -0
  36. package/dist/components/KCommandPalette.vue_vue_type_script_setup_true_lang.js +169 -0
  37. package/dist/components/KConfirmDialog.js +6 -0
  38. package/dist/components/KConfirmDialog.vue.d.ts +3 -0
  39. package/dist/components/KConfirmDialog.vue_vue_type_script_setup_true_lang.js +48 -0
  40. package/dist/components/KDataTable.js +7 -0
  41. package/dist/components/KDataTable.vue.d.ts +47 -0
  42. package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +62 -0
  43. package/dist/components/KDatePicker.js +6 -0
  44. package/dist/components/KDatePicker.vue.d.ts +19 -0
  45. package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +57 -0
  46. package/dist/components/KDialog.js +7 -0
  47. package/dist/components/KDialog.vue.d.ts +52 -0
  48. package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +117 -0
  49. package/dist/components/KDiff.js +7 -0
  50. package/dist/components/KDiff.vue.d.ts +13 -0
  51. package/dist/components/KDiff.vue_vue_type_script_setup_true_lang.js +116 -0
  52. package/dist/components/KDrawer.js +7 -0
  53. package/dist/components/KDrawer.vue.d.ts +37 -0
  54. package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +81 -0
  55. package/dist/components/KDropdown.js +7 -0
  56. package/dist/components/KDropdown.vue.d.ts +56 -0
  57. package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +93 -0
  58. package/dist/components/KEmpty.js +5 -0
  59. package/dist/components/KEmpty.vue.d.ts +22 -0
  60. package/dist/components/KEmpty.vue_vue_type_script_setup_true_lang.js +30 -0
  61. package/dist/components/KForm.js +7 -0
  62. package/dist/components/KForm.vue.d.ts +38 -0
  63. package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +69 -0
  64. package/dist/components/KFormField.js +7 -0
  65. package/dist/components/KFormField.vue.d.ts +32 -0
  66. package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +84 -0
  67. package/dist/components/KGridSkeleton.js +5 -0
  68. package/dist/components/KGridSkeleton.vue.d.ts +10 -0
  69. package/dist/components/KGridSkeleton.vue_vue_type_script_setup_true_lang.js +21 -0
  70. package/dist/components/KImage.js +7 -0
  71. package/dist/components/KImage.vue.d.ts +25 -0
  72. package/dist/components/KImage.vue_vue_type_script_setup_true_lang.js +97 -0
  73. package/dist/components/KImageViewer.js +7 -0
  74. package/dist/components/KImageViewer.vue.d.ts +14 -0
  75. package/dist/components/KImageViewer.vue_vue_type_script_setup_true_lang.js +108 -0
  76. package/dist/components/KInput.js +7 -0
  77. package/dist/components/KInput.vue.d.ts +43 -0
  78. package/dist/components/KInput.vue_vue_type_script_setup_true_lang.js +89 -0
  79. package/dist/components/KInputNumber.js +7 -0
  80. package/dist/components/KInputNumber.vue.d.ts +28 -0
  81. package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +109 -0
  82. package/dist/components/KListSkeleton.js +5 -0
  83. package/dist/components/KListSkeleton.vue.d.ts +8 -0
  84. package/dist/components/KListSkeleton.vue_vue_type_script_setup_true_lang.js +14 -0
  85. package/dist/components/KLoadingOverlay.js +7 -0
  86. package/dist/components/KLoadingOverlay.vue.d.ts +11 -0
  87. package/dist/components/KLoadingOverlay.vue_vue_type_script_setup_true_lang.js +34 -0
  88. package/dist/components/KMessage.d.ts +20 -0
  89. package/dist/components/KMessage.js +55 -0
  90. package/dist/components/KMessageContainer.js +7 -0
  91. package/dist/components/KMessageContainer.vue.d.ts +15 -0
  92. package/dist/components/KMessageContainer.vue_vue_type_script_setup_true_lang.js +41 -0
  93. package/dist/components/KPagination.js +7 -0
  94. package/dist/components/KPagination.vue.d.ts +14 -0
  95. package/dist/components/KPagination.vue_vue_type_script_setup_true_lang.js +104 -0
  96. package/dist/components/KPopover.js +6 -0
  97. package/dist/components/KPopover.vue.d.ts +40 -0
  98. package/dist/components/KPopover.vue_vue_type_script_setup_true_lang.js +63 -0
  99. package/dist/components/KProgress.js +7 -0
  100. package/dist/components/KProgress.vue.d.ts +21 -0
  101. package/dist/components/KProgress.vue_vue_type_script_setup_true_lang.js +108 -0
  102. package/dist/components/KRadio.js +7 -0
  103. package/dist/components/KRadio.vue.d.ts +18 -0
  104. package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +26 -0
  105. package/dist/components/KRadioGroup.js +7 -0
  106. package/dist/components/KRadioGroup.vue.d.ts +26 -0
  107. package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +32 -0
  108. package/dist/components/KRefetchOverlay.js +5 -0
  109. package/dist/components/KRefetchOverlay.vue.d.ts +8 -0
  110. package/dist/components/KRefetchOverlay.vue_vue_type_script_setup_true_lang.js +26 -0
  111. package/dist/components/KResizablePanel.js +7 -0
  112. package/dist/components/KResizablePanel.vue.d.ts +30 -0
  113. package/dist/components/KResizablePanel.vue_vue_type_script_setup_true_lang.js +57 -0
  114. package/dist/components/KResult.js +7 -0
  115. package/dist/components/KResult.vue.d.ts +29 -0
  116. package/dist/components/KResult.vue_vue_type_script_setup_true_lang.js +82 -0
  117. package/dist/components/KSearchBar.js +5 -0
  118. package/dist/components/KSearchBar.vue.d.ts +11 -0
  119. package/dist/components/KSearchBar.vue_vue_type_script_setup_true_lang.js +38 -0
  120. package/dist/components/KSelect.js +9 -0
  121. package/dist/components/KSelect.vue.d.ts +22 -0
  122. package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +96 -0
  123. package/dist/components/KSkeleton.js +7 -0
  124. package/dist/components/KSkeleton.vue.d.ts +14 -0
  125. package/dist/components/KSkeleton.vue_vue_type_script_setup_true_lang.js +27 -0
  126. package/dist/components/KSteps.js +7 -0
  127. package/dist/components/KSteps.vue.d.ts +20 -0
  128. package/dist/components/KSteps.vue_vue_type_script_setup_true_lang.js +39 -0
  129. package/dist/components/KSwitch.js +7 -0
  130. package/dist/components/KSwitch.vue.d.ts +16 -0
  131. package/dist/components/KSwitch.vue_vue_type_script_setup_true_lang.js +35 -0
  132. package/dist/components/KTabs.js +7 -0
  133. package/dist/components/KTabs.vue.d.ts +35 -0
  134. package/dist/components/KTabs.vue_vue_type_script_setup_true_lang.js +47 -0
  135. package/dist/components/KTag.js +7 -0
  136. package/dist/components/KTag.vue.d.ts +32 -0
  137. package/dist/components/KTag.vue_vue_type_script_setup_true_lang.js +40 -0
  138. package/dist/components/KTextarea.js +7 -0
  139. package/dist/components/KTextarea.vue.d.ts +23 -0
  140. package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +51 -0
  141. package/dist/components/KThemeToggleButton.js +7 -0
  142. package/dist/components/KThemeToggleButton.vue.d.ts +14 -0
  143. package/dist/components/KThemeToggleButton.vue_vue_type_script_setup_true_lang.js +48 -0
  144. package/dist/components/KTooltip.js +6 -0
  145. package/dist/components/KTooltip.vue.d.ts +23 -0
  146. package/dist/components/KTooltip.vue_vue_type_script_setup_true_lang.js +49 -0
  147. package/dist/components/KTreeNode.js +7 -0
  148. package/dist/components/KTreeNode.vue.d.ts +8 -0
  149. package/dist/components/KTreeNode.vue_vue_type_script_setup_true_lang.js +47 -0
  150. package/dist/components/KTreeView.js +7 -0
  151. package/dist/components/KTreeView.vue.d.ts +22 -0
  152. package/dist/components/KTreeView.vue_vue_type_script_setup_true_lang.js +45 -0
  153. package/dist/components/KUpload.js +7 -0
  154. package/dist/components/KUpload.vue.d.ts +81 -0
  155. package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +181 -0
  156. package/dist/components/KVirtualList.js +7 -0
  157. package/dist/components/KVirtualList.vue.d.ts +31 -0
  158. package/dist/components/KVirtualList.vue_vue_type_script_setup_true_lang.js +41 -0
  159. package/dist/components/form-context.d.ts +25 -0
  160. package/dist/components/form-context.js +4 -0
  161. package/dist/components/tree-context.d.ts +16 -0
  162. package/dist/components/tree-context.js +4 -0
  163. package/dist/composables/useConfirm.d.ts +17 -0
  164. package/dist/composables/useConfirm.js +31 -0
  165. package/dist/directives/index.d.ts +6 -0
  166. package/dist/directives/index.js +8 -0
  167. package/dist/directives/reveal.d.ts +20 -0
  168. package/dist/directives/reveal.js +18 -0
  169. package/dist/directives/spotlight.d.ts +22 -0
  170. package/dist/directives/spotlight.js +25 -0
  171. package/dist/index.d.ts +62 -0
  172. package/dist/index.js +55 -0
  173. package/dist/k-ui.css +2 -0
  174. package/dist/styles/components.css +92 -0
  175. package/dist/styles/index.css +2 -0
  176. package/dist/styles/menu.css +59 -0
  177. package/dist/styles/tokens.css +229 -0
  178. package/dist/types.d.ts +1 -0
  179. package/package.json +79 -0
@@ -0,0 +1,141 @@
1
+ import { Fragment as e, Transition as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeModels as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, onMounted as f, openBlock as p, ref as m, renderList as h, renderSlot as g, unref as _, useModel as v, watch as y, withCtx as b, withKeys as x, withModifiers as S } from "vue";
2
+ import { ChevronLeft as C, ChevronRight as w } from "lucide-vue-next";
3
+ //#region components/KCarousel.vue?vue&type=script&setup=true&lang.ts
4
+ var T = ["onKeydown"], E = { class: "k-carousel__viewport" }, D = ["src", "alt"], O = ["disabled"], k = ["disabled"], A = [
5
+ "aria-label",
6
+ "aria-current",
7
+ "onClick"
8
+ ], j = /* @__PURE__ */ s({
9
+ __name: "KCarousel",
10
+ props: /* @__PURE__ */ c({
11
+ items: {},
12
+ autoplay: {
13
+ type: Boolean,
14
+ default: !1
15
+ },
16
+ interval: { default: 3500 },
17
+ loop: {
18
+ type: Boolean,
19
+ default: !0
20
+ },
21
+ arrows: {
22
+ type: Boolean,
23
+ default: !0
24
+ },
25
+ indicators: {
26
+ type: Boolean,
27
+ default: !0
28
+ },
29
+ indicatorType: { default: "dot" },
30
+ transition: { default: "slide" },
31
+ aspectRatio: { default: "16 / 9" },
32
+ height: {},
33
+ pauseOnHover: {
34
+ type: Boolean,
35
+ default: !0
36
+ }
37
+ }, {
38
+ modelValue: { default: 0 },
39
+ modelModifiers: {}
40
+ }),
41
+ emits: ["update:modelValue"],
42
+ setup(s, { expose: c }) {
43
+ let j = s, M = v(s, "modelValue"), N = m("next"), P = n(() => j.items.length);
44
+ function F(e) {
45
+ return typeof e == "string" ? e : e?.src;
46
+ }
47
+ function I(e) {
48
+ return typeof e == "string" ? "" : e?.alt ?? "";
49
+ }
50
+ function L(e, t) {
51
+ let n = P.value;
52
+ if (n <= 1) return;
53
+ let r = e;
54
+ r < 0 ? r = j.loop ? n - 1 : 0 : r >= n && (r = j.loop ? 0 : n - 1), r !== M.value && (N.value = t ?? (r > M.value ? "next" : "prev"), M.value = r, G());
55
+ }
56
+ function R() {
57
+ L(M.value + 1, "next");
58
+ }
59
+ function z() {
60
+ L(M.value - 1, "prev");
61
+ }
62
+ let B = n(() => !j.loop && M.value === 0), V = n(() => !j.loop && M.value === P.value - 1), H;
63
+ function U() {
64
+ H &&= (clearInterval(H), void 0);
65
+ }
66
+ function W() {
67
+ U(), j.autoplay && P.value > 1 && (H = setInterval(() => R(), j.interval));
68
+ }
69
+ function G() {
70
+ j.autoplay && W();
71
+ }
72
+ function K() {
73
+ j.pauseOnHover && U();
74
+ }
75
+ function q() {
76
+ j.pauseOnHover && W();
77
+ }
78
+ f(W), d(U), y(() => [
79
+ j.autoplay,
80
+ j.interval,
81
+ P.value
82
+ ], W), y(P, (e) => {
83
+ M.value > e - 1 && (M.value = Math.max(0, e - 1));
84
+ });
85
+ let J = n(() => j.height ? { height: j.height } : { aspectRatio: j.aspectRatio }), Y = n(() => j.transition === "fade" ? "k-carousel-fade" : `k-carousel-slide-${N.value}`);
86
+ return c({
87
+ next: R,
88
+ prev: z,
89
+ go: L
90
+ }), (n, c) => (p(), i("div", {
91
+ class: "k-carousel",
92
+ style: u(J.value),
93
+ role: "region",
94
+ "aria-roledescription": "carousel",
95
+ tabindex: "0",
96
+ onMouseenter: K,
97
+ onMouseleave: q,
98
+ onKeydown: [x(S(z, ["prevent"]), ["left"]), x(S(R, ["prevent"]), ["right"])]
99
+ }, [
100
+ a("div", E, [o(t, { name: Y.value }, {
101
+ default: b(() => [(p(), i("div", {
102
+ key: M.value,
103
+ class: "k-carousel__slide"
104
+ }, [g(n.$slots, "default", {
105
+ item: s.items[M.value],
106
+ index: M.value,
107
+ active: !0
108
+ }, () => [a("img", {
109
+ src: F(s.items[M.value]),
110
+ alt: I(s.items[M.value]),
111
+ class: "k-carousel__img",
112
+ draggable: "false"
113
+ }, null, 8, D)], !0)]))]),
114
+ _: 3
115
+ }, 8, ["name"])]),
116
+ s.arrows && P.value > 1 ? (p(), i(e, { key: 0 }, [a("button", {
117
+ class: "k-carousel__arrow k-carousel__arrow--prev",
118
+ disabled: B.value,
119
+ "aria-label": "上一张",
120
+ onClick: z
121
+ }, [o(_(C), { size: 20 })], 8, O), a("button", {
122
+ class: "k-carousel__arrow k-carousel__arrow--next",
123
+ disabled: V.value,
124
+ "aria-label": "下一张",
125
+ onClick: R
126
+ }, [o(_(w), { size: 20 })], 8, k)], 64)) : r("", !0),
127
+ s.indicators && P.value > 1 ? (p(), i("div", {
128
+ key: 1,
129
+ class: l(["k-carousel__indicators", `k-carousel__indicators--${s.indicatorType}`])
130
+ }, [(p(!0), i(e, null, h(s.items, (e, t) => (p(), i("button", {
131
+ key: t,
132
+ class: l(["k-carousel__dot", { "k-carousel__dot--active": t === M.value }]),
133
+ "aria-label": `第 ${t + 1} 张`,
134
+ "aria-current": t === M.value,
135
+ onClick: (e) => L(t)
136
+ }, null, 10, A))), 128))], 2)) : r("", !0)
137
+ ], 44, T));
138
+ }
139
+ });
140
+ //#endregion
141
+ export { j as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KCheckbox.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KCheckbox.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-17c1bf53"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,26 @@
1
+ type __VLS_Props = {
2
+ modelValue?: boolean;
3
+ value?: string | number;
4
+ disabled?: boolean;
5
+ label?: string;
6
+ };
7
+ declare var __VLS_20: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_20) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
+ "update:modelValue": (v: boolean) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ "onUpdate:modelValue"?: ((v: boolean) => any) | undefined;
15
+ }>, {
16
+ disabled: boolean;
17
+ modelValue: boolean;
18
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
19
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,48 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createTextVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderSlot as c, toDisplayString as l, unref as u, withCtx as d } from "vue";
2
+ import { Check as f } from "lucide-vue-next";
3
+ import { CheckboxIndicator as p, CheckboxRoot as m } from "reka-ui";
4
+ //#region components/KCheckbox.vue?vue&type=script&setup=true&lang.ts
5
+ var h = {
6
+ key: 0,
7
+ class: "k-cb__label"
8
+ }, g = /* @__PURE__ */ a({
9
+ __name: "KCheckbox",
10
+ props: {
11
+ modelValue: {
12
+ type: Boolean,
13
+ default: !1
14
+ },
15
+ value: {},
16
+ disabled: {
17
+ type: Boolean,
18
+ default: !1
19
+ },
20
+ label: {}
21
+ },
22
+ emits: ["update:modelValue"],
23
+ setup(a) {
24
+ let g = a, _ = e(() => g.value === void 0 ? void 0 : String(g.value));
25
+ return (e, g) => (s(), n("label", { class: o(["k-cb-wrap", { "k-cb-wrap--disabled": a.disabled }]) }, [i(u(m), {
26
+ "model-value": a.modelValue,
27
+ value: _.value,
28
+ disabled: a.disabled,
29
+ class: "k-cb",
30
+ "onUpdate:modelValue": g[0] ||= (t) => e.$emit("update:modelValue", !!t)
31
+ }, {
32
+ default: d(() => [i(u(p), { class: "k-cb__indicator" }, {
33
+ default: d(() => [i(u(f), {
34
+ size: 11,
35
+ "stroke-width": 3
36
+ })]),
37
+ _: 1
38
+ })]),
39
+ _: 1
40
+ }, 8, [
41
+ "model-value",
42
+ "value",
43
+ "disabled"
44
+ ]), a.label || e.$slots.default ? (s(), n("span", h, [c(e.$slots, "default", {}, () => [r(l(a.label), 1)], !0)])) : t("", !0)], 2));
45
+ }
46
+ });
47
+ //#endregion
48
+ export { g as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KCheckboxGroup.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KCheckboxGroup.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-0188db2b"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,27 @@
1
+ type Val = string | number;
2
+ type __VLS_Props = {
3
+ modelValue?: Val[];
4
+ disabled?: boolean;
5
+ direction?: 'horizontal' | 'vertical';
6
+ };
7
+ declare var __VLS_10: {};
8
+ type __VLS_Slots = {} & {
9
+ default?: (props: typeof __VLS_10) => any;
10
+ };
11
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
+ "update:modelValue": (v: Val[]) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ "onUpdate:modelValue"?: ((v: Val[]) => any) | undefined;
15
+ }>, {
16
+ disabled: boolean;
17
+ direction: "horizontal" | "vertical";
18
+ modelValue: Val[];
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
23
+ type __VLS_WithSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,36 @@
1
+ import { computed as e, createBlock as t, defineComponent as n, normalizeClass as r, openBlock as i, renderSlot as a, unref as o, withCtx as s } from "vue";
2
+ import { CheckboxGroupRoot as c } from "reka-ui";
3
+ //#region components/KCheckboxGroup.vue?vue&type=script&setup=true&lang.ts
4
+ var l = /* @__PURE__ */ n({
5
+ __name: "KCheckboxGroup",
6
+ props: {
7
+ modelValue: { default: () => [] },
8
+ disabled: {
9
+ type: Boolean,
10
+ default: !1
11
+ },
12
+ direction: { default: "horizontal" }
13
+ },
14
+ emits: ["update:modelValue"],
15
+ setup(n, { emit: l }) {
16
+ let u = n, d = l, f = e(() => u.modelValue.map((e) => String(e)));
17
+ function p(e) {
18
+ u.modelValue.length > 0 && u.modelValue.every((e) => typeof e == "number") && e.every((e) => /^-?\d+(\.\d+)?$/.test(e)) ? d("update:modelValue", e.map(Number)) : d("update:modelValue", e);
19
+ }
20
+ return (e, l) => (i(), t(o(c), {
21
+ "model-value": f.value,
22
+ disabled: n.disabled,
23
+ class: r(["k-cb-group", `k-cb-group--${n.direction}`]),
24
+ "onUpdate:modelValue": l[0] ||= (e) => p(e)
25
+ }, {
26
+ default: s(() => [a(e.$slots, "default", {}, void 0, !0)]),
27
+ _: 3
28
+ }, 8, [
29
+ "model-value",
30
+ "disabled",
31
+ "class"
32
+ ]));
33
+ }
34
+ });
35
+ //#endregion
36
+ export { l as default };
@@ -0,0 +1,8 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KCombobox.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ /* empty css */
5
+ //#region components/KCombobox.vue
6
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-55b7732f"]]);
7
+ //#endregion
8
+ export { n as default };
@@ -0,0 +1,28 @@
1
+ interface Option {
2
+ value: string;
3
+ label: string;
4
+ hint?: string;
5
+ }
6
+ type __VLS_Props = {
7
+ modelValue: string | string[] | null | undefined;
8
+ options: Option[];
9
+ placeholder?: string;
10
+ size?: 'sm' | 'md' | 'lg';
11
+ disabled?: boolean;
12
+ multiple?: boolean;
13
+ searchable?: boolean;
14
+ emptyText?: string;
15
+ };
16
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
17
+ "update:modelValue": (v: string | string[]) => any;
18
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ "onUpdate:modelValue"?: ((v: string | string[]) => any) | undefined;
20
+ }>, {
21
+ size: "sm" | "md" | "lg";
22
+ disabled: boolean;
23
+ multiple: boolean;
24
+ searchable: boolean;
25
+ emptyText: string;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
@@ -0,0 +1,120 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, unref as m, withCtx as h, withModifiers as g } from "vue";
2
+ import { Check as _, ChevronDown as v, X as y } from "lucide-vue-next";
3
+ import { ComboboxAnchor as b, ComboboxContent as x, ComboboxEmpty as S, ComboboxInput as C, ComboboxItem as w, ComboboxItemIndicator as T, ComboboxPortal as E, ComboboxRoot as D, ComboboxTrigger as O, ComboboxViewport as k } from "reka-ui";
4
+ //#region components/KCombobox.vue?vue&type=script&setup=true&lang.ts
5
+ var A = {
6
+ key: 0,
7
+ class: "k-cmb-chips"
8
+ }, j = ["onClick"], M = {
9
+ key: 0,
10
+ class: "k-cmb-hint"
11
+ }, N = /* @__PURE__ */ c({
12
+ __name: "KCombobox",
13
+ props: {
14
+ modelValue: {},
15
+ options: {},
16
+ placeholder: {},
17
+ size: { default: "md" },
18
+ disabled: {
19
+ type: Boolean,
20
+ default: !1
21
+ },
22
+ multiple: {
23
+ type: Boolean,
24
+ default: !1
25
+ },
26
+ searchable: {
27
+ type: Boolean,
28
+ default: !0
29
+ },
30
+ emptyText: { default: "无匹配项" }
31
+ },
32
+ emits: ["update:modelValue"],
33
+ setup(c, { emit: N }) {
34
+ let P = c, F = N, I = d(""), L = t(() => P.multiple ? Array.isArray(P.modelValue) ? P.modelValue : [] : P.modelValue == null ? "" : String(P.modelValue));
35
+ function R(e) {
36
+ F("update:modelValue", e);
37
+ }
38
+ function z(e, t) {
39
+ t.stopPropagation(), !(!P.multiple || !Array.isArray(P.modelValue)) && F("update:modelValue", P.modelValue.filter((t) => t !== e));
40
+ }
41
+ let B = (e) => P.options.find((t) => t.value === e)?.label ?? e, V = t(() => {
42
+ if (P.multiple) return "";
43
+ let e = L.value;
44
+ return e ? B(e) : "";
45
+ });
46
+ return (t, d) => (u(), n(m(D), {
47
+ "model-value": L.value,
48
+ disabled: c.disabled,
49
+ multiple: c.multiple,
50
+ "search-term": I.value,
51
+ "onUpdate:modelValue": R,
52
+ "onUpdate:searchTerm": d[1] ||= (e) => I.value = e
53
+ }, {
54
+ default: h(() => [s(m(b), { class: l(["k-cmb-anchor", [`k-cmb-anchor--${c.size}`, { "k-cmb-anchor--disabled": c.disabled }]]) }, {
55
+ default: h(() => [c.multiple ? (u(), i("div", A, [(u(!0), i(e, null, f(L.value, (e) => (u(), i("span", {
56
+ key: e,
57
+ class: "k-cmb-chip"
58
+ }, [o(p(B(e)) + " ", 1), a("button", {
59
+ type: "button",
60
+ class: "k-cmb-chip__close",
61
+ onMousedown: d[0] ||= g(() => {}, ["prevent"]),
62
+ onClick: (t) => z(e, t)
63
+ }, [s(m(y), { size: 9 })], 40, j)]))), 128)), s(m(C), {
64
+ placeholder: L.value.length === 0 ? c.placeholder : "",
65
+ class: "k-cmb-input k-cmb-input--multi"
66
+ }, null, 8, ["placeholder"])])) : (u(), i(e, { key: 1 }, [c.searchable ? (u(), n(m(C), {
67
+ key: 0,
68
+ placeholder: V.value || c.placeholder,
69
+ "display-value": (e) => B(e),
70
+ class: "k-cmb-input"
71
+ }, null, 8, ["placeholder", "display-value"])) : (u(), i("span", {
72
+ key: 1,
73
+ class: l(["k-cmb-display", { "k-cmb-display--placeholder": !V.value }])
74
+ }, p(V.value || c.placeholder || "请选择"), 3))], 64)), s(m(O), { class: "k-cmb-trigger" }, {
75
+ default: h(() => [s(m(v), { size: 14 })]),
76
+ _: 1
77
+ })]),
78
+ _: 1
79
+ }, 8, ["class"]), s(m(E), null, {
80
+ default: h(() => [s(m(x), {
81
+ class: "k-cmb-content k-menu",
82
+ position: "popper",
83
+ "side-offset": 6
84
+ }, {
85
+ default: h(() => [s(m(S), { class: "k-cmb-empty" }, {
86
+ default: h(() => [o(p(c.emptyText), 1)]),
87
+ _: 1
88
+ }), s(m(k), { class: "k-cmb-viewport" }, {
89
+ default: h(() => [(u(!0), i(e, null, f(c.options, (e) => (u(), n(m(w), {
90
+ key: e.value,
91
+ value: e.value,
92
+ class: "k-cmb-item"
93
+ }, {
94
+ default: h(() => [
95
+ s(m(T), { class: "k-cmb-indicator" }, {
96
+ default: h(() => [s(m(_), { size: 12 })]),
97
+ _: 1
98
+ }),
99
+ a("span", null, p(e.label), 1),
100
+ e.hint ? (u(), i("span", M, p(e.hint), 1)) : r("", !0)
101
+ ]),
102
+ _: 2
103
+ }, 1032, ["value"]))), 128))]),
104
+ _: 1
105
+ })]),
106
+ _: 1
107
+ })]),
108
+ _: 1
109
+ })]),
110
+ _: 1
111
+ }, 8, [
112
+ "model-value",
113
+ "disabled",
114
+ "multiple",
115
+ "search-term"
116
+ ]));
117
+ }
118
+ });
119
+ //#endregion
120
+ export { N as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KCommandPalette.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KCommandPalette.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-546dc9a8"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,31 @@
1
+ import type { Component } from 'vue';
2
+ export interface CmdItem {
3
+ id: string;
4
+ label: string;
5
+ hint?: string;
6
+ icon?: Component;
7
+ group?: string;
8
+ shortcut?: string;
9
+ handler: () => void | Promise<void>;
10
+ show?: () => boolean;
11
+ }
12
+ type __VLS_Props = {
13
+ items: CmdItem[];
14
+ placeholder?: string;
15
+ globalHotkey?: boolean;
16
+ emptyText?: string;
17
+ };
18
+ declare function open(): void;
19
+ declare function close(): void;
20
+ declare function toggle(): void;
21
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
22
+ open: typeof open;
23
+ close: typeof close;
24
+ toggle: typeof toggle;
25
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
26
+ placeholder: string;
27
+ emptyText: string;
28
+ globalHotkey: boolean;
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
@@ -0,0 +1,169 @@
1
+ import { Fragment as e, Teleport as t, Transition as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, nextTick as d, normalizeClass as f, onBeforeUnmount as p, onMounted as m, openBlock as h, ref as g, renderList as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, vModelText as x, watch as S, withCtx as C, withDirectives as w, withModifiers as T } from "vue";
2
+ import { ArrowRight as E, Search as D, X as O } from "lucide-vue-next";
3
+ //#region components/KCommandPalette.vue?vue&type=script&setup=true&lang.ts
4
+ var k = {
5
+ class: "k-cmd-panel",
6
+ role: "dialog",
7
+ "aria-modal": "true",
8
+ "aria-label": "命令面板"
9
+ }, A = { class: "k-cmd__searchbar" }, j = ["placeholder"], ee = {
10
+ key: 0,
11
+ class: "k-cmd__empty"
12
+ }, te = { class: "k-cmd__group-title" }, ne = { class: "k-cmd__group-list" }, M = ["data-cmd-index"], N = ["onMouseenter", "onClick"], P = { class: "k-cmd__text" }, F = { class: "k-cmd__label" }, I = {
13
+ key: 0,
14
+ class: "k-cmd__hint"
15
+ }, L = {
16
+ key: 0,
17
+ class: "k-cmd__kbd"
18
+ }, R = /* @__PURE__ */ u({
19
+ __name: "KCommandPalette",
20
+ props: {
21
+ items: {},
22
+ placeholder: { default: "搜索命令..." },
23
+ globalHotkey: {
24
+ type: Boolean,
25
+ default: !0
26
+ },
27
+ emptyText: { default: "没有匹配的命令" }
28
+ },
29
+ setup(u, { expose: R }) {
30
+ let z = u, B = g(!1), V = g(""), H = g(0), U = g(null), W = g(null);
31
+ function G() {
32
+ B.value = !0;
33
+ }
34
+ function K() {
35
+ B.value = !1;
36
+ }
37
+ function q() {
38
+ B.value = !B.value;
39
+ }
40
+ R({
41
+ open: G,
42
+ close: K,
43
+ toggle: q
44
+ }), S(B, async (e) => {
45
+ e && (V.value = "", H.value = 0, await d(), U.value?.focus());
46
+ });
47
+ let J = r(() => {
48
+ let e = V.value.trim().toLowerCase();
49
+ return z.items.filter((t) => t.show && !t.show() ? !1 : e ? t.label.toLowerCase().includes(e) || (t.hint ?? "").toLowerCase().includes(e) : !0);
50
+ }), Y = r(() => {
51
+ let e = /* @__PURE__ */ new Map();
52
+ for (let t of J.value) {
53
+ let n = t.group ?? "其它", r = e.get(n) ?? [];
54
+ r.push(t), e.set(n, r);
55
+ }
56
+ return Array.from(e.entries());
57
+ });
58
+ S(J, () => {
59
+ H.value >= J.value.length && (H.value = Math.max(0, J.value.length - 1));
60
+ });
61
+ function X(e) {
62
+ return J.value.indexOf(e);
63
+ }
64
+ async function Z(e) {
65
+ try {
66
+ await e.handler();
67
+ } catch (e) {
68
+ console.error("[KCommandPalette] command handler threw:", e);
69
+ } finally {
70
+ K();
71
+ }
72
+ }
73
+ function Q() {
74
+ d(() => {
75
+ (W.value?.querySelector(`[data-cmd-index="${H.value}"]`))?.scrollIntoView({ block: "nearest" });
76
+ });
77
+ }
78
+ function $(e) {
79
+ let t = e.ctrlKey || e.metaKey;
80
+ if (z.globalHotkey && t && (e.key === "k" || e.key === "K")) {
81
+ e.preventDefault(), q();
82
+ return;
83
+ }
84
+ if (B.value) {
85
+ if (e.key === "Escape") {
86
+ e.preventDefault(), K();
87
+ return;
88
+ }
89
+ if (e.key === "ArrowDown") {
90
+ if (e.preventDefault(), J.value.length === 0) return;
91
+ H.value = (H.value + 1) % J.value.length, Q();
92
+ return;
93
+ }
94
+ if (e.key === "ArrowUp") {
95
+ if (e.preventDefault(), J.value.length === 0) return;
96
+ H.value = (H.value - 1 + J.value.length) % J.value.length, Q();
97
+ return;
98
+ }
99
+ if (e.key === "Enter") {
100
+ e.preventDefault();
101
+ let t = J.value[H.value];
102
+ t && Z(t);
103
+ }
104
+ }
105
+ }
106
+ return m(() => window.addEventListener("keydown", $)), p(() => window.removeEventListener("keydown", $)), (r, d) => (h(), i(t, { to: "body" }, [l(n, { name: "k-cmd" }, {
107
+ default: C(() => [B.value ? (h(), o("div", {
108
+ key: 0,
109
+ class: "k-cmd-backdrop",
110
+ onClick: T(K, ["self"])
111
+ }, [s("div", k, [
112
+ s("div", A, [
113
+ l(b(D), {
114
+ size: 14,
115
+ class: "k-cmd__search-icon"
116
+ }),
117
+ w(s("input", {
118
+ ref_key: "inputRef",
119
+ ref: U,
120
+ "onUpdate:modelValue": d[0] ||= (e) => V.value = e,
121
+ type: "text",
122
+ placeholder: u.placeholder,
123
+ class: "k-cmd__input"
124
+ }, null, 8, j), [[x, V.value]]),
125
+ V.value ? (h(), o("button", {
126
+ key: 0,
127
+ type: "button",
128
+ class: "k-cmd__clear",
129
+ title: "清空",
130
+ onClick: d[1] ||= (e) => V.value = ""
131
+ }, [l(b(O), { size: 12 })])) : a("", !0),
132
+ d[2] ||= s("kbd", { class: "k-cmd__kbd k-cmd__kbd--esc" }, "ESC", -1)
133
+ ]),
134
+ s("div", {
135
+ ref_key: "listRef",
136
+ ref: W,
137
+ class: "k-cmd__list"
138
+ }, [J.value.length === 0 ? (h(), o("div", ee, y(u.emptyText), 1)) : (h(!0), o(e, { key: 1 }, _(Y.value, ([t, n]) => (h(), o("div", { key: t }, [s("div", te, y(t), 1), s("ul", ne, [(h(!0), o(e, null, _(n, (e) => (h(), o("li", {
139
+ key: e.id,
140
+ "data-cmd-index": X(e)
141
+ }, [s("button", {
142
+ type: "button",
143
+ class: f(["k-cmd__item", { "k-cmd__item--active": X(e) === H.value }]),
144
+ onMouseenter: (t) => H.value = X(e),
145
+ onClick: (t) => Z(e)
146
+ }, [
147
+ s("span", { class: f(["k-cmd__icon", { "k-cmd__icon--active": X(e) === H.value }]) }, [e.icon ? (h(), i(v(e.icon), {
148
+ key: 0,
149
+ size: 13
150
+ })) : a("", !0)], 2),
151
+ s("span", P, [s("span", F, y(e.label), 1), e.hint ? (h(), o("span", I, y(e.hint), 1)) : a("", !0)]),
152
+ e.shortcut ? (h(), o("kbd", L, y(e.shortcut), 1)) : X(e) === H.value ? (h(), i(b(E), {
153
+ key: 1,
154
+ size: 13,
155
+ class: "k-cmd__arrow"
156
+ })) : a("", !0)
157
+ ], 42, N)], 8, M))), 128))])]))), 128))], 512),
158
+ d[3] ||= s("div", { class: "k-cmd__footer" }, [
159
+ s("span", { class: "k-cmd__hint-row" }, [s("kbd", { class: "k-cmd__kbd" }, "↑↓"), c(" 选择 ")]),
160
+ s("span", { class: "k-cmd__hint-row" }, [s("kbd", { class: "k-cmd__kbd" }, "↵"), c(" 确认 ")]),
161
+ s("span", { class: "k-cmd__hint-row" }, [s("kbd", { class: "k-cmd__kbd" }, "⌘K"), c(" 开/关 ")])
162
+ ], -1)
163
+ ])])) : a("", !0)]),
164
+ _: 1
165
+ })]));
166
+ }
167
+ });
168
+ //#endregion
169
+ export { R as default };
@@ -0,0 +1,6 @@
1
+ import e from "./KConfirmDialog.vue_vue_type_script_setup_true_lang.js";
2
+ /* empty css */
3
+ //#region components/KConfirmDialog.vue
4
+ var t = e;
5
+ //#endregion
6
+ export { t as default };
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;