@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,48 @@
1
+ import { useConfirm as e } from "../composables/useConfirm.js";
2
+ import { createBlock as t, createCommentVNode as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, toDisplayString as l, unref as u, withCtx as d } from "vue";
3
+ import { DialogClose as f, DialogContent as p, DialogDescription as m, DialogOverlay as h, DialogPortal as g, DialogRoot as _, DialogTitle as v } from "reka-ui";
4
+ //#region components/KConfirmDialog.vue?vue&type=script&setup=true&lang.ts
5
+ var y = { class: "mt-6 flex items-center justify-end gap-2" }, b = /* @__PURE__ */ o({
6
+ __name: "KConfirmDialog",
7
+ setup(o) {
8
+ let { isOpen: b, title: x, message: S, confirmText: C, cancelText: w, destructive: T, close: E } = e();
9
+ function D(e) {
10
+ e || E(!1);
11
+ }
12
+ return (e, o) => (c(), t(u(_), {
13
+ open: u(b),
14
+ "onUpdate:open": D
15
+ }, {
16
+ default: d(() => [a(u(g), null, {
17
+ default: d(() => [a(u(h), { class: "k-overlay" }), a(u(p), { class: "k-modal w-[90vw] max-w-md rounded-xl border border-ink-200 p-6 shadow-md focus:outline-none" }, {
18
+ default: d(() => [
19
+ a(u(v), { class: "text-base font-semibold text-ink-900" }, {
20
+ default: d(() => [i(l(u(x)), 1)]),
21
+ _: 1
22
+ }),
23
+ u(S) ? (c(), t(u(m), {
24
+ key: 0,
25
+ class: "mt-2 text-sm leading-relaxed text-ink-500"
26
+ }, {
27
+ default: d(() => [i(l(u(S)), 1)]),
28
+ _: 1
29
+ })) : n("", !0),
30
+ r("div", y, [a(u(f), { class: "inline-flex h-9 items-center rounded-md border border-ink-200 bg-white px-4 text-xs font-medium text-ink-700 transition-colors hover:bg-ink-50" }, {
31
+ default: d(() => [i(l(u(w) ?? "取消"), 1)]),
32
+ _: 1
33
+ }), r("button", {
34
+ type: "button",
35
+ class: s(["inline-flex h-9 items-center rounded-md px-4 text-xs font-medium text-white transition-colors", u(T) ? "bg-red-500 hover:bg-red-400" : "bg-brand-500 hover:bg-brand-400"]),
36
+ onClick: o[0] ||= (e) => u(E)(!0)
37
+ }, l(u(C) ?? "确定"), 3)])
38
+ ]),
39
+ _: 1
40
+ })]),
41
+ _: 1
42
+ })]),
43
+ _: 1
44
+ }, 8, ["open"]));
45
+ }
46
+ });
47
+ //#endregion
48
+ export { b as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KDataTable.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KDataTable.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-4d42a83d"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,47 @@
1
+ export interface Column {
2
+ key: string;
3
+ label: string;
4
+ width?: string;
5
+ align?: 'left' | 'right' | 'center';
6
+ cellClass?: string;
7
+ }
8
+ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
9
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<{
10
+ columns: Column[];
11
+ rows: T[];
12
+ rowKey?: (row: T) => string | number;
13
+ hoverable?: boolean;
14
+ loading?: boolean;
15
+ empty?: string;
16
+ size?: "sm" | "md";
17
+ striped?: boolean;
18
+ bordered?: boolean;
19
+ stickyHeader?: boolean;
20
+ } & {
21
+ onRowClick?: ((row: T) => any) | undefined;
22
+ }> & (typeof globalThis extends {
23
+ __VLS_PROPS_FALLBACK: infer P;
24
+ } ? P : {});
25
+ expose: (exposed: {}) => void;
26
+ attrs: any;
27
+ slots: {
28
+ [x: `header-${string}`]: ((props: {
29
+ col: Column;
30
+ }) => any) | undefined;
31
+ } & {
32
+ [x: `cell-${string}`]: ((props: {
33
+ row: T;
34
+ value: any;
35
+ }) => any) | undefined;
36
+ };
37
+ emit: (e: "rowClick", row: T) => void;
38
+ }>) => import("vue").VNode & {
39
+ __ctx?: Awaited<typeof __VLS_setup>;
40
+ };
41
+ declare const _default: typeof __VLS_export;
42
+ export default _default;
43
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
44
+ [K in keyof T]: T[K];
45
+ } : {
46
+ [K in keyof T as K]: T[K];
47
+ }) & {};
@@ -0,0 +1,62 @@
1
+ import e from "./KLoadingOverlay.js";
2
+ import t from "./KEmpty.js";
3
+ import { Fragment as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, renderSlot as m, toDisplayString as h } from "vue";
4
+ //#region components/KDataTable.vue?vue&type=script&setup=true&lang.ts
5
+ var g = ["onClick"], _ = /* @__PURE__ */ l({
6
+ __name: "KDataTable",
7
+ props: {
8
+ columns: {},
9
+ rows: {},
10
+ rowKey: {},
11
+ hoverable: {
12
+ type: Boolean,
13
+ default: !0
14
+ },
15
+ loading: {
16
+ type: Boolean,
17
+ default: !1
18
+ },
19
+ empty: {},
20
+ size: { default: "md" },
21
+ striped: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ bordered: {
26
+ type: Boolean,
27
+ default: !0
28
+ },
29
+ stickyHeader: {
30
+ type: Boolean,
31
+ default: !1
32
+ }
33
+ },
34
+ emits: ["rowClick"],
35
+ setup(l, { emit: _ }) {
36
+ let v = _;
37
+ return (_, y) => (f(), a("div", { class: u(["k-table-wrap", [`k-table-wrap--${l.size}`, { "k-table-wrap--bordered": l.bordered }]]) }, [o("div", { class: u(["k-table-scroll", { "k-table-scroll--sticky": l.stickyHeader }]) }, [o("table", { class: u(["k-table", { "k-table--striped": l.striped }]) }, [o("thead", null, [o("tr", null, [(f(!0), a(n, null, p(l.columns, (e) => (f(), a("th", {
38
+ key: e.key,
39
+ style: d(e.width ? { width: e.width } : void 0),
40
+ class: u(e.align ? `k-table__th--${e.align}` : "")
41
+ }, [m(_.$slots, `header-${e.key}`, { col: e }, () => [s(h(e.label), 1)], !0)], 6))), 128))])]), o("tbody", null, [(f(!0), a(n, null, p(l.rows, (e, t) => (f(), a("tr", {
42
+ key: l.rowKey ? l.rowKey(e) : t,
43
+ class: u({ "k-table__row--hoverable": l.hoverable }),
44
+ onClick: (t) => l.hoverable && v("rowClick", e)
45
+ }, [(f(!0), a(n, null, p(l.columns, (t) => (f(), a("td", {
46
+ key: t.key,
47
+ class: u([t.cellClass, t.align ? `k-table__td--${t.align}` : ""])
48
+ }, [m(_.$slots, `cell-${t.key}`, {
49
+ row: e,
50
+ value: e[t.key]
51
+ }, () => [o("span", null, h(e[t.key] ?? "—"), 1)], !0)], 2))), 128))], 10, g))), 128))])], 2), !l.loading && l.rows.length === 0 ? (f(), r(t, {
52
+ key: 0,
53
+ title: l.empty || "暂无数据",
54
+ compact: ""
55
+ }, null, 8, ["title"])) : i("", !0)], 2), c(e, {
56
+ show: l.loading,
57
+ text: "加载中..."
58
+ }, null, 8, ["show"])], 2));
59
+ }
60
+ });
61
+ //#endregion
62
+ export { _ as default };
@@ -0,0 +1,6 @@
1
+ import e from "./KDatePicker.vue_vue_type_script_setup_true_lang.js";
2
+ /* empty css */
3
+ //#region components/KDatePicker.vue
4
+ var t = e;
5
+ //#endregion
6
+ export { t as default };
@@ -0,0 +1,19 @@
1
+ import '@vuepic/vue-datepicker/dist/main.css';
2
+ type __VLS_Props = {
3
+ modelValue: string | string[] | null | undefined;
4
+ placeholder?: string;
5
+ range?: boolean;
6
+ enableTime?: boolean;
7
+ disabledDates?: (date: Date) => boolean;
8
+ clearable?: boolean;
9
+ };
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ "update:modelValue": (v: string | string[] | null) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
+ "onUpdate:modelValue"?: ((v: string | string[] | null) => any) | undefined;
14
+ }>, {
15
+ clearable: boolean;
16
+ enableTime: boolean;
17
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
+ declare const _default: typeof __VLS_export;
19
+ export default _default;
@@ -0,0 +1,57 @@
1
+ /* empty css */
2
+ import { createBlock as e, defineComponent as t, openBlock as n, unref as r } from "vue";
3
+ import { VueDatePicker as i } from "@vuepic/vue-datepicker";
4
+ import { zhCN as a } from "date-fns/locale";
5
+ //#region components/KDatePicker.vue?vue&type=script&setup=true&lang.ts
6
+ var o = /* @__PURE__ */ t({
7
+ __name: "KDatePicker",
8
+ props: {
9
+ modelValue: {},
10
+ placeholder: {},
11
+ range: { type: Boolean },
12
+ enableTime: {
13
+ type: Boolean,
14
+ default: !0
15
+ },
16
+ disabledDates: {},
17
+ clearable: {
18
+ type: Boolean,
19
+ default: !0
20
+ }
21
+ },
22
+ emits: ["update:modelValue"],
23
+ setup(t, { emit: o }) {
24
+ let s = o;
25
+ function c(e) {
26
+ s("update:modelValue", e ?? null);
27
+ }
28
+ return (o, s) => (n(), e(r(i), {
29
+ class: "k-dp",
30
+ "model-value": t.modelValue || null,
31
+ "onUpdate:modelValue": c,
32
+ "model-type": "yyyy-MM-dd HH:mm:ss",
33
+ format: t.enableTime ? "yyyy-MM-dd HH:mm" : "yyyy-MM-dd",
34
+ placeholder: t.placeholder,
35
+ "enable-time-picker": t.enableTime,
36
+ range: t.range,
37
+ "disabled-dates": t.disabledDates,
38
+ clearable: t.clearable,
39
+ locale: r(a),
40
+ "auto-apply": "",
41
+ teleport: "",
42
+ "text-input": "",
43
+ "month-change-on-scroll": !1
44
+ }, null, 8, [
45
+ "model-value",
46
+ "format",
47
+ "placeholder",
48
+ "enable-time-picker",
49
+ "range",
50
+ "disabled-dates",
51
+ "clearable",
52
+ "locale"
53
+ ]));
54
+ }
55
+ });
56
+ //#endregion
57
+ export { o as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KDialog.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KDialog.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-f2253276"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,52 @@
1
+ type __VLS_Props = {
2
+ open: boolean;
3
+ title?: string;
4
+ subtitle?: string;
5
+ size?: 'sm' | 'md' | 'lg' | 'xl';
6
+ closable?: boolean;
7
+ maskClosable?: boolean;
8
+ /** 显示默认 footer (取消/确认按钮); footer 插槽存在时插槽优先 */
9
+ footer?: boolean;
10
+ confirmText?: string;
11
+ cancelText?: string;
12
+ confirmLoading?: boolean;
13
+ confirmType?: 'primary' | 'danger';
14
+ hideCancel?: boolean;
15
+ };
16
+ declare var __VLS_13: {}, __VLS_20: {}, __VLS_22: {};
17
+ type __VLS_Slots = {} & {
18
+ title?: (props: typeof __VLS_13) => any;
19
+ } & {
20
+ default?: (props: typeof __VLS_20) => any;
21
+ } & {
22
+ footer?: (props: typeof __VLS_22) => any;
23
+ };
24
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
25
+ close: () => any;
26
+ "update:open": (v: boolean) => any;
27
+ confirm: () => any;
28
+ cancel: () => any;
29
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onClose?: (() => any) | undefined;
31
+ "onUpdate:open"?: ((v: boolean) => any) | undefined;
32
+ onConfirm?: (() => any) | undefined;
33
+ onCancel?: (() => any) | undefined;
34
+ }>, {
35
+ size: "sm" | "md" | "lg" | "xl";
36
+ footer: boolean;
37
+ closable: boolean;
38
+ confirmText: string;
39
+ cancelText: string;
40
+ maskClosable: boolean;
41
+ confirmLoading: boolean;
42
+ confirmType: "primary" | "danger";
43
+ hideCancel: boolean;
44
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
45
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
46
+ declare const _default: typeof __VLS_export;
47
+ export default _default;
48
+ type __VLS_WithSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -0,0 +1,117 @@
1
+ import e from "./KButton.js";
2
+ import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, onMounted as d, onUnmounted as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
3
+ import { X as y } from "lucide-vue-next";
4
+ //#region components/KDialog.vue?vue&type=script&setup=true&lang.ts
5
+ var b = {
6
+ key: 0,
7
+ class: "k-dialog-stack"
8
+ }, x = { class: "k-dialog__center" }, S = {
9
+ key: 0,
10
+ class: "k-dialog__header"
11
+ }, C = { class: "k-dialog__title-wrap" }, w = {
12
+ key: 0,
13
+ class: "k-dialog__title"
14
+ }, T = {
15
+ key: 1,
16
+ class: "k-dialog__subtitle"
17
+ }, E = { class: "k-dialog__body" }, D = {
18
+ key: 1,
19
+ class: "k-dialog__footer"
20
+ }, O = /* @__PURE__ */ l({
21
+ __name: "KDialog",
22
+ props: {
23
+ open: { type: Boolean },
24
+ title: {},
25
+ subtitle: {},
26
+ size: { default: "md" },
27
+ closable: {
28
+ type: Boolean,
29
+ default: !0
30
+ },
31
+ maskClosable: {
32
+ type: Boolean,
33
+ default: !0
34
+ },
35
+ footer: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ confirmText: { default: "确定" },
40
+ cancelText: { default: "取消" },
41
+ confirmLoading: {
42
+ type: Boolean,
43
+ default: !1
44
+ },
45
+ confirmType: { default: "primary" },
46
+ hideCancel: {
47
+ type: Boolean,
48
+ default: !1
49
+ }
50
+ },
51
+ emits: [
52
+ "update:open",
53
+ "close",
54
+ "confirm",
55
+ "cancel"
56
+ ],
57
+ setup(l, { emit: O }) {
58
+ let k = l, A = O;
59
+ function j() {
60
+ A("update:open", !1), A("close");
61
+ }
62
+ function M() {
63
+ k.maskClosable && j();
64
+ }
65
+ function N() {
66
+ A("confirm");
67
+ }
68
+ function P() {
69
+ A("cancel"), j();
70
+ }
71
+ function F(e) {
72
+ e.key === "Escape" && k.open && k.closable && j();
73
+ }
74
+ return d(() => window.addEventListener("keydown", F)), f(() => {
75
+ window.removeEventListener("keydown", F), k.open && (document.body.style.overflow = "");
76
+ }), _(() => k.open, (e) => {
77
+ document.body.style.overflow = e ? "hidden" : "";
78
+ }), (d, f) => (p(), r(t, { to: "body" }, [c(n, {
79
+ name: "k-dialog",
80
+ duration: {
81
+ enter: 280,
82
+ leave: 200
83
+ }
84
+ }, {
85
+ default: v(() => [l.open ? (p(), a("div", b, [o("div", {
86
+ class: "k-dialog__overlay",
87
+ onClick: M
88
+ }), o("div", x, [o("div", { class: u(["k-dialog", `k-dialog--${l.size}`]) }, [
89
+ l.title || d.$slots.title || l.closable ? (p(), a("header", S, [o("div", C, [l.title || d.$slots.title ? (p(), a("h2", w, [m(d.$slots, "title", {}, () => [s(h(l.title), 1)], !0)])) : i("", !0), l.subtitle ? (p(), a("p", T, h(l.subtitle), 1)) : i("", !0)]), l.closable ? (p(), a("button", {
90
+ key: 0,
91
+ type: "button",
92
+ class: "k-dialog__close",
93
+ onClick: j
94
+ }, [c(g(y), { size: 18 })])) : i("", !0)])) : i("", !0),
95
+ o("div", E, [m(d.$slots, "default", {}, void 0, !0)]),
96
+ d.$slots.footer || l.footer ? (p(), a("footer", D, [m(d.$slots, "footer", {}, () => [l.hideCancel ? i("", !0) : (p(), r(e, {
97
+ key: 0,
98
+ type: "secondary",
99
+ onClick: P
100
+ }, {
101
+ default: v(() => [s(h(l.cancelText), 1)]),
102
+ _: 1
103
+ })), c(e, {
104
+ type: l.confirmType,
105
+ loading: l.confirmLoading,
106
+ onClick: N
107
+ }, {
108
+ default: v(() => [s(h(l.confirmText), 1)]),
109
+ _: 1
110
+ }, 8, ["type", "loading"])], !0)])) : i("", !0)
111
+ ], 2)])])) : i("", !0)]),
112
+ _: 3
113
+ })]));
114
+ }
115
+ });
116
+ //#endregion
117
+ export { O as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KDiff.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KDiff.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-0e22db16"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,13 @@
1
+ type __VLS_Props = {
2
+ before: string;
3
+ after: string;
4
+ view?: 'split' | 'unified';
5
+ /** 显示行号 */
6
+ showLineNumbers?: boolean;
7
+ };
8
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
9
+ view: "split" | "unified";
10
+ showLineNumbers: boolean;
11
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,116 @@
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c, toDisplayString as l } from "vue";
2
+ //#region components/KDiff.vue?vue&type=script&setup=true&lang.ts
3
+ var u = { class: "k-diff__pane" }, d = {
4
+ key: 0,
5
+ class: "k-diff__lineno"
6
+ }, f = { class: "k-diff__text" }, p = { class: "k-diff__pane" }, m = {
7
+ key: 0,
8
+ class: "k-diff__lineno"
9
+ }, h = { class: "k-diff__text" }, g = {
10
+ key: 0,
11
+ class: "k-diff__lineno"
12
+ }, _ = {
13
+ key: 1,
14
+ class: "k-diff__lineno"
15
+ }, v = { class: "k-diff__marker" }, y = { class: "k-diff__text" }, b = /* @__PURE__ */ a({
16
+ __name: "KDiff",
17
+ props: {
18
+ before: {},
19
+ after: {},
20
+ view: { default: "split" },
21
+ showLineNumbers: {
22
+ type: Boolean,
23
+ default: !0
24
+ }
25
+ },
26
+ setup(a) {
27
+ let b = a;
28
+ function x(e, t) {
29
+ let n = e.split("\n"), r = t.split("\n"), i = n.length, a = r.length, o = Array.from({ length: i + 1 }, () => Array(a + 1).fill(0));
30
+ for (let e = 1; e <= i; e++) for (let t = 1; t <= a; t++) n[e - 1] === r[t - 1] ? o[e][t] = o[e - 1][t - 1] + 1 : o[e][t] = Math.max(o[e - 1][t], o[e][t - 1]);
31
+ let s = [], c = i, l = a;
32
+ for (; c > 0 && l > 0;) n[c - 1] === r[l - 1] ? (s.unshift({
33
+ type: "equal",
34
+ text: n[c - 1],
35
+ a: c,
36
+ b: l
37
+ }), c--, l--) : o[c - 1][l] >= o[c][l - 1] ? (s.unshift({
38
+ type: "remove",
39
+ text: n[c - 1],
40
+ a: c
41
+ }), c--) : (s.unshift({
42
+ type: "add",
43
+ text: r[l - 1],
44
+ b: l
45
+ }), l--);
46
+ for (; c > 0;) s.unshift({
47
+ type: "remove",
48
+ text: n[c - 1],
49
+ a: c
50
+ }), c--;
51
+ for (; l > 0;) s.unshift({
52
+ type: "add",
53
+ text: r[l - 1],
54
+ b: l
55
+ }), l--;
56
+ return s;
57
+ }
58
+ let S = t(() => x(b.before, b.after)), C = t(() => {
59
+ let e = [], t = [], n = 0;
60
+ for (; n < S.value.length;) {
61
+ let r = S.value[n];
62
+ if (r.type === "equal") e.push({
63
+ type: "equal",
64
+ text: r.text,
65
+ line: r.a
66
+ }), t.push({
67
+ type: "equal",
68
+ text: r.text,
69
+ line: r.b
70
+ }), n++;
71
+ else {
72
+ let r = [], i = [];
73
+ for (; n < S.value.length && S.value[n].type === "remove";) r.push(S.value[n++]);
74
+ for (; n < S.value.length && S.value[n].type === "add";) i.push(S.value[n++]);
75
+ let a = Math.max(r.length, i.length);
76
+ for (let n = 0; n < a; n++) n < r.length ? e.push({
77
+ type: "remove",
78
+ text: r[n].text,
79
+ line: r[n].a
80
+ }) : e.push({
81
+ type: "empty",
82
+ text: ""
83
+ }), n < i.length ? t.push({
84
+ type: "add",
85
+ text: i[n].text,
86
+ line: i[n].b
87
+ }) : t.push({
88
+ type: "empty",
89
+ text: ""
90
+ });
91
+ }
92
+ }
93
+ return {
94
+ left: e,
95
+ right: t
96
+ };
97
+ });
98
+ return (t, b) => (s(), r("div", { class: o(["k-diff", `k-diff--${a.view}`]) }, [a.view === "split" ? (s(), r(e, { key: 0 }, [i("div", u, [(s(!0), r(e, null, c(C.value.left, (e, t) => (s(), r("div", {
99
+ key: t,
100
+ class: o(["k-diff__row", `k-diff__row--${e.type}`])
101
+ }, [a.showLineNumbers ? (s(), r("span", d, l(e.line ?? ""), 1)) : n("", !0), i("span", f, l(e.text), 1)], 2))), 128))]), i("div", p, [(s(!0), r(e, null, c(C.value.right, (e, t) => (s(), r("div", {
102
+ key: t,
103
+ class: o(["k-diff__row", `k-diff__row--${e.type}`])
104
+ }, [a.showLineNumbers ? (s(), r("span", m, l(e.line ?? ""), 1)) : n("", !0), i("span", h, l(e.text), 1)], 2))), 128))])], 64)) : (s(!0), r(e, { key: 1 }, c(S.value, (e, t) => (s(), r("div", {
105
+ key: t,
106
+ class: o(["k-diff__row", `k-diff__row--${e.type}`])
107
+ }, [
108
+ a.showLineNumbers ? (s(), r("span", g, l(e.a ?? ""), 1)) : n("", !0),
109
+ a.showLineNumbers ? (s(), r("span", _, l(e.b ?? ""), 1)) : n("", !0),
110
+ i("span", v, l(e.type === "add" ? "+" : e.type === "remove" ? "−" : " "), 1),
111
+ i("span", y, l(e.text), 1)
112
+ ], 2))), 128))], 2));
113
+ }
114
+ });
115
+ //#endregion
116
+ export { b as default };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KDrawer.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KDrawer.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-dbd060f9"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,37 @@
1
+ type __VLS_Props = {
2
+ open: boolean;
3
+ title?: string;
4
+ subtitle?: string;
5
+ size?: 'sm' | 'md' | 'lg';
6
+ placement?: 'right' | 'left' | 'top' | 'bottom';
7
+ closable?: boolean;
8
+ maskClosable?: boolean;
9
+ };
10
+ declare var __VLS_36: {}, __VLS_55: {}, __VLS_57: {};
11
+ type __VLS_Slots = {} & {
12
+ title?: (props: typeof __VLS_36) => any;
13
+ } & {
14
+ default?: (props: typeof __VLS_55) => any;
15
+ } & {
16
+ footer?: (props: typeof __VLS_57) => any;
17
+ };
18
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
+ close: () => any;
20
+ "update:open": (v: boolean) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onClose?: (() => any) | undefined;
23
+ "onUpdate:open"?: ((v: boolean) => any) | undefined;
24
+ }>, {
25
+ size: "sm" | "md" | "lg";
26
+ closable: boolean;
27
+ maskClosable: boolean;
28
+ placement: "right" | "left" | "top" | "bottom";
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };