@guoyg578/k-ui 0.1.0 → 0.1.1

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 (139) hide show
  1. package/README.md +66 -22
  2. package/dist/components/KAlert.vue.d.ts +1 -1
  3. package/dist/components/{KAlert.js → KAlert.vue.js} +2 -2
  4. package/dist/components/KAlert.vue_vue_type_script_setup_true_lang.js +35 -32
  5. package/dist/components/{KAvatar.js → KAvatar.vue.js} +1 -1
  6. package/dist/components/{KAvatarGroup.js → KAvatarGroup.vue.js} +1 -1
  7. package/dist/components/KBreadcrumb.vue.d.ts +30 -1
  8. package/dist/components/{KBreadcrumb.js → KBreadcrumb.vue.js} +2 -2
  9. package/dist/components/KBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -21
  10. package/dist/components/KButton.vue.d.ts +17 -2
  11. package/dist/components/{KButton.js → KButton.vue.js} +2 -2
  12. package/dist/components/KButton.vue_vue_type_script_setup_true_lang.js +51 -17
  13. package/dist/components/KCard.vue.d.ts +5 -3
  14. package/dist/components/{KCard.js → KCard.vue.js} +2 -2
  15. package/dist/components/KCard.vue_vue_type_script_setup_true_lang.js +2 -2
  16. package/dist/components/{KCarousel.js → KCarousel.vue.js} +1 -1
  17. package/dist/components/{KCheckbox.js → KCheckbox.vue.js} +1 -1
  18. package/dist/components/{KCheckboxGroup.js → KCheckboxGroup.vue.js} +1 -1
  19. package/dist/components/KColorPicker.vue.d.ts +40 -0
  20. package/dist/components/KColorPicker.vue.js +7 -0
  21. package/dist/components/KColorPicker.vue_vue_type_script_setup_true_lang.js +96 -0
  22. package/dist/components/{KCombobox.js → KCombobox.vue.js} +2 -2
  23. package/dist/components/{KCommandPalette.js → KCommandPalette.vue.js} +1 -1
  24. package/dist/components/KConfigProvider.vue.d.ts +26 -0
  25. package/dist/components/KConfigProvider.vue.js +5 -0
  26. package/dist/components/KConfigProvider.vue_vue_type_script_setup_true_lang.js +17 -0
  27. package/dist/components/{KConfirmDialog.js → KConfirmDialog.vue.js} +1 -1
  28. package/dist/components/KDataTable.vue.d.ts +33 -10
  29. package/dist/components/{KDataTable.js → KDataTable.vue.js} +2 -2
  30. package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +128 -30
  31. package/dist/components/{KDatePicker.js → KDatePicker.vue.js} +1 -1
  32. package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +1 -1
  33. package/dist/components/KDescriptions.vue.d.ts +30 -0
  34. package/dist/components/KDescriptions.vue.js +6 -0
  35. package/dist/components/KDescriptions.vue_vue_type_script_setup_true_lang.js +30 -0
  36. package/dist/components/KDescriptionsItem.vue.d.ts +17 -0
  37. package/dist/components/KDescriptionsItem.vue.js +5 -0
  38. package/dist/components/KDescriptionsItem.vue_vue_type_script_setup_true_lang.js +17 -0
  39. package/dist/components/KDialog.vue.d.ts +1 -0
  40. package/dist/components/{KDialog.js → KDialog.vue.js} +2 -2
  41. package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +45 -38
  42. package/dist/components/{KDiff.js → KDiff.vue.js} +1 -1
  43. package/dist/components/KDrawer.vue.d.ts +7 -3
  44. package/dist/components/{KDrawer.js → KDrawer.vue.js} +2 -2
  45. package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +41 -29
  46. package/dist/components/KDropdown.vue.d.ts +7 -4
  47. package/dist/components/{KDropdown.js → KDropdown.vue.js} +2 -2
  48. package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +40 -38
  49. package/dist/components/KEmpty.vue.d.ts +8 -4
  50. package/dist/components/KEmpty.vue_vue_type_script_setup_true_lang.js +17 -14
  51. package/dist/components/KForm.vue.d.ts +12 -6
  52. package/dist/components/{KForm.js → KForm.vue.js} +2 -2
  53. package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +31 -15
  54. package/dist/components/KFormField.vue.d.ts +3 -2
  55. package/dist/components/{KFormField.js → KFormField.vue.js} +2 -2
  56. package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +41 -28
  57. package/dist/components/KIcon.vue.d.ts +22 -0
  58. package/dist/components/KIcon.vue.js +7 -0
  59. package/dist/components/KIcon.vue_vue_type_script_setup_true_lang.js +31 -0
  60. package/dist/components/KImage.vue.d.ts +3 -3
  61. package/dist/components/{KImage.js → KImage.vue.js} +1 -1
  62. package/dist/components/KImage.vue_vue_type_script_setup_true_lang.js +1 -1
  63. package/dist/components/{KImageViewer.js → KImageViewer.vue.js} +1 -1
  64. package/dist/components/KInput.vue.d.ts +11 -5
  65. package/dist/components/{KInput.js → KInput.vue.js} +2 -2
  66. package/dist/components/KInput.vue_vue_type_script_setup_true_lang.js +62 -38
  67. package/dist/components/KInputNumber.vue.d.ts +18 -4
  68. package/dist/components/{KInputNumber.js → KInputNumber.vue.js} +2 -2
  69. package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +80 -62
  70. package/dist/components/{KLoadingOverlay.js → KLoadingOverlay.vue.js} +1 -1
  71. package/dist/components/KMessage.js +1 -1
  72. package/dist/components/{KMessageContainer.js → KMessageContainer.vue.js} +1 -1
  73. package/dist/components/KNotification.d.ts +36 -0
  74. package/dist/components/KNotification.js +55 -0
  75. package/dist/components/KNotificationContainer.vue.d.ts +20 -0
  76. package/dist/components/KNotificationContainer.vue.js +7 -0
  77. package/dist/components/KNotificationContainer.vue_vue_type_script_setup_true_lang.js +63 -0
  78. package/dist/components/KNotificationProvider.vue.d.ts +13 -0
  79. package/dist/components/KNotificationProvider.vue.js +10 -0
  80. package/dist/components/{KPagination.js → KPagination.vue.js} +1 -1
  81. package/dist/components/KPopconfirm.vue.d.ts +46 -0
  82. package/dist/components/KPopconfirm.vue.js +6 -0
  83. package/dist/components/KPopconfirm.vue_vue_type_script_setup_true_lang.js +81 -0
  84. package/dist/components/{KPopover.js → KPopover.vue.js} +1 -1
  85. package/dist/components/KProgress.vue.d.ts +3 -2
  86. package/dist/components/{KProgress.js → KProgress.vue.js} +2 -2
  87. package/dist/components/KProgress.vue_vue_type_script_setup_true_lang.js +23 -20
  88. package/dist/components/{KRadio.js → KRadio.vue.js} +1 -1
  89. package/dist/components/{KRadioGroup.js → KRadioGroup.vue.js} +1 -1
  90. package/dist/components/{KResizablePanel.js → KResizablePanel.vue.js} +1 -1
  91. package/dist/components/{KResult.js → KResult.vue.js} +1 -1
  92. package/dist/components/KSelect.vue.d.ts +10 -3
  93. package/dist/components/{KSelect.js → KSelect.vue.js} +4 -4
  94. package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +89 -48
  95. package/dist/components/{KSkeleton.js → KSkeleton.vue.js} +1 -1
  96. package/dist/components/KSlider.vue.d.ts +24 -0
  97. package/dist/components/KSlider.vue.js +7 -0
  98. package/dist/components/KSlider.vue_vue_type_script_setup_true_lang.js +82 -0
  99. package/dist/components/KSpin.vue.d.ts +23 -0
  100. package/dist/components/KSpin.vue.js +7 -0
  101. package/dist/components/KSpin.vue_vue_type_script_setup_true_lang.js +35 -0
  102. package/dist/components/KSteps.vue.d.ts +1 -1
  103. package/dist/components/{KSteps.js → KSteps.vue.js} +1 -1
  104. package/dist/components/KSwitch.vue.d.ts +2 -2
  105. package/dist/components/{KSwitch.js → KSwitch.vue.js} +2 -2
  106. package/dist/components/KSwitch.vue_vue_type_script_setup_true_lang.js +12 -11
  107. package/dist/components/KTabs.vue.d.ts +10 -5
  108. package/dist/components/{KTabs.js → KTabs.vue.js} +2 -2
  109. package/dist/components/KTabs.vue_vue_type_script_setup_true_lang.js +31 -21
  110. package/dist/components/KTag.vue.d.ts +3 -3
  111. package/dist/components/{KTag.js → KTag.vue.js} +2 -2
  112. package/dist/components/KTag.vue_vue_type_script_setup_true_lang.js +14 -13
  113. package/dist/components/KTextarea.vue.d.ts +17 -2
  114. package/dist/components/{KTextarea.js → KTextarea.vue.js} +2 -2
  115. package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +51 -22
  116. package/dist/components/{KThemeToggleButton.js → KThemeToggleButton.vue.js} +1 -1
  117. package/dist/components/{KTooltip.js → KTooltip.vue.js} +1 -1
  118. package/dist/components/{KTreeNode.js → KTreeNode.vue.js} +1 -1
  119. package/dist/components/{KTreeView.js → KTreeView.vue.js} +1 -1
  120. package/dist/components/KTreeView.vue_vue_type_script_setup_true_lang.js +1 -1
  121. package/dist/components/KUpload.vue.d.ts +100 -4
  122. package/dist/components/{KUpload.js → KUpload.vue.js} +2 -2
  123. package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +189 -94
  124. package/dist/components/KUploadDragger.vue.d.ts +13 -0
  125. package/dist/components/KUploadDragger.vue.js +7 -0
  126. package/dist/components/KUploadDragger.vue_vue_type_script_setup_true_lang.js +12 -0
  127. package/dist/components/{KVirtualList.js → KVirtualList.vue.js} +1 -1
  128. package/dist/components/form-context.d.ts +7 -3
  129. package/dist/components/upload-context.d.ts +6 -0
  130. package/dist/components/upload-context.js +4 -0
  131. package/dist/index.d.ts +17 -3
  132. package/dist/index.js +66 -55
  133. package/dist/k-ui.css +1 -1
  134. package/package.json +6 -12
  135. /package/dist/components/{KEmpty.js → KEmpty.vue.js} +0 -0
  136. /package/dist/components/{KGridSkeleton.js → KGridSkeleton.vue.js} +0 -0
  137. /package/dist/components/{KListSkeleton.js → KListSkeleton.vue.js} +0 -0
  138. /package/dist/components/{KRefetchOverlay.js → KRefetchOverlay.vue.js} +0 -0
  139. /package/dist/components/{KSearchBar.js → KSearchBar.vue.js} +0 -0
@@ -1,23 +1,23 @@
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";
1
+ import e from "./KButton.vue.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, normalizeStyle as d, onMounted as f, onUnmounted as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _, watch as v, withCtx as y } from "vue";
3
+ import { X as b } from "lucide-vue-next";
4
4
  //#region components/KDialog.vue?vue&type=script&setup=true&lang.ts
5
- var b = {
5
+ var x = {
6
6
  key: 0,
7
7
  class: "k-dialog-stack"
8
- }, x = { class: "k-dialog__center" }, S = {
8
+ }, S = { class: "k-dialog__center" }, C = {
9
9
  key: 0,
10
10
  class: "k-dialog__header"
11
- }, C = { class: "k-dialog__title-wrap" }, w = {
11
+ }, w = { class: "k-dialog__title-wrap" }, T = {
12
12
  key: 0,
13
13
  class: "k-dialog__title"
14
- }, T = {
14
+ }, E = {
15
15
  key: 1,
16
16
  class: "k-dialog__subtitle"
17
- }, E = { class: "k-dialog__body" }, D = {
17
+ }, D = { class: "k-dialog__body" }, O = {
18
18
  key: 1,
19
19
  class: "k-dialog__footer"
20
- }, O = /* @__PURE__ */ l({
20
+ }, k = /* @__PURE__ */ l({
21
21
  __name: "KDialog",
22
22
  props: {
23
23
  open: { type: Boolean },
@@ -46,7 +46,8 @@ var b = {
46
46
  hideCancel: {
47
47
  type: Boolean,
48
48
  default: !1
49
- }
49
+ },
50
+ width: {}
50
51
  },
51
52
  emits: [
52
53
  "update:open",
@@ -54,64 +55,70 @@ var b = {
54
55
  "confirm",
55
56
  "cancel"
56
57
  ],
57
- setup(l, { emit: O }) {
58
- let k = l, A = O;
59
- function j() {
60
- A("update:open", !1), A("close");
61
- }
58
+ setup(l, { emit: k }) {
59
+ let A = l, j = k;
62
60
  function M() {
63
- k.maskClosable && j();
61
+ j("update:open", !1), j("close");
64
62
  }
65
63
  function N() {
66
- A("confirm");
64
+ A.maskClosable && M();
67
65
  }
68
66
  function P() {
69
- A("cancel"), j();
67
+ j("confirm");
68
+ }
69
+ function F() {
70
+ j("cancel"), M();
70
71
  }
71
- function F(e) {
72
- e.key === "Escape" && k.open && k.closable && j();
72
+ function I(e) {
73
+ e.key === "Escape" && A.open && A.closable && M();
73
74
  }
74
- return d(() => window.addEventListener("keydown", F)), f(() => {
75
- window.removeEventListener("keydown", F), k.open && (document.body.style.overflow = "");
76
- }), _(() => k.open, (e) => {
75
+ function L(e) {
76
+ if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
77
+ }
78
+ return f(() => window.addEventListener("keydown", I)), p(() => {
79
+ window.removeEventListener("keydown", I), A.open && (document.body.style.overflow = "");
80
+ }), v(() => A.open, (e) => {
77
81
  document.body.style.overflow = e ? "hidden" : "";
78
- }), (d, f) => (p(), r(t, { to: "body" }, [c(n, {
82
+ }), (f, p) => (m(), r(t, { to: "body" }, [c(n, {
79
83
  name: "k-dialog",
80
84
  duration: {
81
85
  enter: 280,
82
86
  leave: 200
83
87
  }
84
88
  }, {
85
- default: v(() => [l.open ? (p(), a("div", b, [o("div", {
89
+ default: y(() => [l.open ? (m(), a("div", x, [o("div", {
86
90
  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", {
91
+ onClick: N
92
+ }), o("div", S, [o("div", {
93
+ class: u(["k-dialog", `k-dialog--${l.size}`]),
94
+ style: d({ maxWidth: L(l.width) })
95
+ }, [
96
+ l.title || f.$slots.title || l.closable ? (m(), a("header", C, [o("div", w, [l.title || f.$slots.title ? (m(), a("h2", T, [h(f.$slots, "title", {}, () => [s(g(l.title), 1)], !0)])) : i("", !0), l.subtitle ? (m(), a("p", E, g(l.subtitle), 1)) : i("", !0)]), l.closable ? (m(), a("button", {
90
97
  key: 0,
91
98
  type: "button",
92
99
  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, {
100
+ onClick: M
101
+ }, [c(_(b), { size: 18 })])) : i("", !0)])) : i("", !0),
102
+ o("div", D, [h(f.$slots, "default", {}, void 0, !0)]),
103
+ f.$slots.footer || l.footer ? (m(), a("footer", O, [h(f.$slots, "footer", {}, () => [l.hideCancel ? i("", !0) : (m(), r(e, {
97
104
  key: 0,
98
105
  type: "secondary",
99
- onClick: P
106
+ onClick: F
100
107
  }, {
101
- default: v(() => [s(h(l.cancelText), 1)]),
108
+ default: y(() => [s(g(l.cancelText), 1)]),
102
109
  _: 1
103
110
  })), c(e, {
104
111
  type: l.confirmType,
105
112
  loading: l.confirmLoading,
106
- onClick: N
113
+ onClick: P
107
114
  }, {
108
- default: v(() => [s(h(l.confirmText), 1)]),
115
+ default: y(() => [s(g(l.confirmText), 1)]),
109
116
  _: 1
110
117
  }, 8, ["type", "loading"])], !0)])) : i("", !0)
111
- ], 2)])])) : i("", !0)]),
118
+ ], 6)])])) : i("", !0)]),
112
119
  _: 3
113
120
  })]));
114
121
  }
115
122
  });
116
123
  //#endregion
117
- export { O as default };
124
+ export { k as default };
@@ -1,6 +1,6 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KDiff.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KDiff.vue
5
5
  var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-0e22db16"]]);
6
6
  //#endregion
@@ -6,14 +6,18 @@ type __VLS_Props = {
6
6
  placement?: 'right' | 'left' | 'top' | 'bottom';
7
7
  closable?: boolean;
8
8
  maskClosable?: boolean;
9
+ width?: string | number;
10
+ height?: string | number;
9
11
  };
10
- declare var __VLS_36: {}, __VLS_55: {}, __VLS_57: {};
12
+ declare var __VLS_36: {}, __VLS_44: {}, __VLS_57: {}, __VLS_59: {};
11
13
  type __VLS_Slots = {} & {
12
14
  title?: (props: typeof __VLS_36) => any;
13
15
  } & {
14
- default?: (props: typeof __VLS_55) => any;
16
+ 'header-extra'?: (props: typeof __VLS_44) => any;
15
17
  } & {
16
- footer?: (props: typeof __VLS_57) => any;
18
+ default?: (props: typeof __VLS_57) => any;
19
+ } & {
20
+ footer?: (props: typeof __VLS_59) => any;
17
21
  };
18
22
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
19
23
  close: () => any;
@@ -1,7 +1,7 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KDrawer.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KDrawer.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-dbd060f9"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-2ba8be6b"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -1,14 +1,17 @@
1
- import { createBlock as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, renderSlot as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
2
- import { X as p } from "lucide-vue-next";
3
- import { DialogClose as m, DialogContent as h, DialogDescription as g, DialogOverlay as _, DialogPortal as v, DialogRoot as y, DialogTitle as b } from "reka-ui";
1
+ import { createBlock as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, normalizeStyle as c, openBlock as l, renderSlot as u, toDisplayString as d, unref as f, withCtx as p } from "vue";
2
+ import { X as m } from "lucide-vue-next";
3
+ import { DialogClose as h, DialogContent as g, DialogDescription as _, DialogOverlay as v, DialogPortal as y, DialogRoot as b, DialogTitle as x } from "reka-ui";
4
4
  //#region components/KDrawer.vue?vue&type=script&setup=true&lang.ts
5
- var x = {
5
+ var S = {
6
6
  key: 0,
7
7
  class: "k-drawer__header"
8
- }, S = { class: "k-drawer__title-wrap" }, C = { class: "k-drawer__body" }, w = {
8
+ }, C = { class: "k-drawer__title-wrap" }, w = {
9
+ key: 0,
10
+ class: "k-drawer__header-actions"
11
+ }, T = { class: "k-drawer__body" }, E = {
9
12
  key: 1,
10
13
  class: "k-drawer__footer"
11
- }, T = /* @__PURE__ */ o({
14
+ }, D = /* @__PURE__ */ o({
12
15
  __name: "KDrawer",
13
16
  props: {
14
17
  open: { type: Boolean },
@@ -23,54 +26,63 @@ var x = {
23
26
  maskClosable: {
24
27
  type: Boolean,
25
28
  default: !0
26
- }
29
+ },
30
+ width: {},
31
+ height: {}
27
32
  },
28
33
  emits: ["update:open", "close"],
29
- setup(o, { emit: T }) {
30
- let E = T;
31
- function D(e) {
32
- E("update:open", e), e || E("close");
34
+ setup(o, { emit: D }) {
35
+ let O = D;
36
+ function k(e) {
37
+ O("update:open", e), e || O("close");
38
+ }
39
+ function A(e) {
40
+ if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
33
41
  }
34
- return (T, E) => (c(), e(d(y), {
42
+ return (D, O) => (l(), e(f(b), {
35
43
  open: o.open,
36
- "onUpdate:open": D
44
+ "onUpdate:open": k
37
45
  }, {
38
- default: f(() => [a(d(v), null, {
39
- default: f(() => [a(d(_), { class: "k-drawer__overlay" }), a(d(h), {
46
+ default: p(() => [a(f(y), null, {
47
+ default: p(() => [a(f(v), { class: "k-drawer__overlay" }), a(f(g), {
40
48
  class: s(["k-drawer", [`k-drawer--${o.placement}`, `k-drawer--${o.size}`]]),
41
- onPointerDownOutside: E[0] ||= (e) => {
49
+ style: c({
50
+ width: A(o.width),
51
+ height: A(o.height)
52
+ }),
53
+ onPointerDownOutside: O[0] ||= (e) => {
42
54
  o.maskClosable || e.preventDefault();
43
55
  },
44
- onEscapeKeyDown: E[1] ||= (e) => {
56
+ onEscapeKeyDown: O[1] ||= (e) => {
45
57
  o.closable || e.preventDefault();
46
58
  }
47
59
  }, {
48
- default: f(() => [
49
- o.title || T.$slots.title || o.closable ? (c(), n("header", x, [r("div", S, [o.title || T.$slots.title ? (c(), e(d(b), {
60
+ default: p(() => [
61
+ o.title || D.$slots.title || o.closable ? (l(), n("header", S, [r("div", C, [o.title || D.$slots.title ? (l(), e(f(x), {
50
62
  key: 0,
51
63
  class: "k-drawer__title"
52
64
  }, {
53
- default: f(() => [l(T.$slots, "title", {}, () => [i(u(o.title), 1)], !0)]),
65
+ default: p(() => [u(D.$slots, "title", {}, () => [i(d(o.title), 1)], !0)]),
54
66
  _: 3
55
- })) : t("", !0), o.subtitle ? (c(), e(d(g), {
67
+ })) : t("", !0), o.subtitle ? (l(), e(f(_), {
56
68
  key: 1,
57
69
  class: "k-drawer__subtitle"
58
70
  }, {
59
- default: f(() => [i(u(o.subtitle), 1)]),
71
+ default: p(() => [i(d(o.subtitle), 1)]),
60
72
  _: 1
61
- })) : t("", !0)]), o.closable ? (c(), e(d(m), {
73
+ })) : t("", !0)]), D.$slots["header-extra"] || o.closable ? (l(), n("div", w, [u(D.$slots, "header-extra", {}, void 0, !0), o.closable ? (l(), e(f(h), {
62
74
  key: 0,
63
75
  class: "k-drawer__close",
64
76
  "aria-label": "关闭"
65
77
  }, {
66
- default: f(() => [a(d(p), { size: 18 })]),
78
+ default: p(() => [a(f(m), { size: 18 })]),
67
79
  _: 1
68
- })) : t("", !0)])) : t("", !0),
69
- r("div", C, [l(T.$slots, "default", {}, void 0, !0)]),
70
- T.$slots.footer ? (c(), n("footer", w, [l(T.$slots, "footer", {}, void 0, !0)])) : t("", !0)
80
+ })) : t("", !0)])) : t("", !0)])) : t("", !0),
81
+ r("div", T, [u(D.$slots, "default", {}, void 0, !0)]),
82
+ D.$slots.footer ? (l(), n("footer", E, [u(D.$slots, "footer", {}, void 0, !0)])) : t("", !0)
71
83
  ]),
72
84
  _: 3
73
- }, 8, ["class"])]),
85
+ }, 8, ["class", "style"])]),
74
86
  _: 3
75
87
  })]),
76
88
  _: 3
@@ -78,4 +90,4 @@ var x = {
78
90
  }
79
91
  });
80
92
  //#endregion
81
- export { T as default };
93
+ export { D as default };
@@ -1,7 +1,7 @@
1
1
  import type { Component } from 'vue';
2
2
  export interface DropdownItem {
3
3
  /** 唯一标识,select 事件回传 */
4
- key: string;
4
+ key: string | number;
5
5
  label?: string;
6
6
  /** lucide 图标组件,可选 */
7
7
  icon?: Component;
@@ -16,7 +16,10 @@ export interface DropdownItem {
16
16
  type?: 'item' | 'separator' | 'label';
17
17
  }
18
18
  type __VLS_Props = {
19
- items: DropdownItem[];
19
+ items?: DropdownItem[];
20
+ /** naive-ui alias */
21
+ options?: DropdownItem[];
22
+ trigger?: 'click' | 'hover' | 'focus' | 'manual';
20
23
  side?: 'top' | 'right' | 'bottom' | 'left';
21
24
  align?: 'start' | 'center' | 'end';
22
25
  sideOffset?: number;
@@ -36,9 +39,9 @@ type __VLS_Slots = {} & {
36
39
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
37
40
  "update:open": (value: boolean | undefined) => any;
38
41
  } & {
39
- select: (key: string, item: DropdownItem) => any;
42
+ select: (key: string | number, item: DropdownItem) => any;
40
43
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
41
- onSelect?: ((key: string, item: DropdownItem) => any) | undefined;
44
+ onSelect?: ((key: string | number, item: DropdownItem) => any) | undefined;
42
45
  "onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
43
46
  }>, {
44
47
  disabled: boolean;
@@ -1,6 +1,6 @@
1
1
  import e from "./KDropdown.vue_vue_type_script_setup_true_lang.js";
2
- /* empty css */
3
- /* empty css */
2
+ /* empty css */
3
+ /* empty css */
4
4
  //#region components/KDropdown.vue
5
5
  var t = e;
6
6
  //#endregion
@@ -1,13 +1,15 @@
1
- import { Fragment as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeModels as c, normalizeClass as l, openBlock as u, renderList as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, useModel as g, withCtx as _ } from "vue";
2
- import { DropdownMenuContent as v, DropdownMenuItem as y, DropdownMenuLabel as b, DropdownMenuPortal as x, DropdownMenuRoot as S, DropdownMenuSeparator as C, DropdownMenuTrigger as w } from "reka-ui";
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, mergeModels as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, resolveDynamicComponent as m, toDisplayString as h, unref as g, useModel as _, withCtx as v } from "vue";
2
+ import { DropdownMenuContent as y, DropdownMenuItem as b, DropdownMenuLabel as x, DropdownMenuPortal as S, DropdownMenuRoot as C, DropdownMenuSeparator as w, DropdownMenuTrigger as T } from "reka-ui";
3
3
  //#region components/KDropdown.vue?vue&type=script&setup=true&lang.ts
4
- var T = { class: "k-dropdown-item__label" }, E = {
4
+ var E = { class: "k-dropdown-item__label" }, D = {
5
5
  key: 1,
6
6
  class: "k-dropdown-item__shortcut"
7
- }, D = /* @__PURE__ */ s({
7
+ }, O = /* @__PURE__ */ c({
8
8
  __name: "KDropdown",
9
- props: /* @__PURE__ */ c({
9
+ props: /* @__PURE__ */ l({
10
10
  items: {},
11
+ options: {},
12
+ trigger: {},
11
13
  side: { default: "bottom" },
12
14
  align: { default: "end" },
13
15
  sideOffset: { default: 6 },
@@ -20,62 +22,62 @@ var T = { class: "k-dropdown-item__label" }, E = {
20
22
  open: { type: Boolean },
21
23
  openModifiers: {}
22
24
  }),
23
- emits: /* @__PURE__ */ c(["select"], ["update:open"]),
24
- setup(s, { emit: c }) {
25
- let D = g(s, "open"), O = c;
26
- function k(e) {
27
- e.disabled || O("select", e.key, e);
25
+ emits: /* @__PURE__ */ l(["select"], ["update:open"]),
26
+ setup(c, { emit: l }) {
27
+ let O = c, k = _(c, "open"), A = l, j = t(() => O.items ?? O.options ?? []);
28
+ function M(e) {
29
+ e.disabled || A("select", e.key, e);
28
30
  }
29
- return (c, g) => (u(), t(h(S), {
30
- open: D.value,
31
- "onUpdate:open": g[0] ||= (e) => D.value = e
31
+ return (t, l) => (d(), n(g(C), {
32
+ open: k.value,
33
+ "onUpdate:open": l[0] ||= (e) => k.value = e
32
34
  }, {
33
- default: _(() => [o(h(w), {
35
+ default: v(() => [s(g(T), {
34
36
  "as-child": "",
35
- disabled: s.disabled
37
+ disabled: c.disabled
36
38
  }, {
37
- default: _(() => [f(c.$slots, "default")]),
39
+ default: v(() => [a("span", { class: u(["k-dropdown-trigger", { "k-dropdown-trigger--disabled": c.disabled }]) }, [p(t.$slots, "default")], 2)]),
38
40
  _: 3
39
- }, 8, ["disabled"]), o(h(x), null, {
40
- default: _(() => [o(h(v), {
41
- class: l(["k-dropdown-content k-menu-surface", s.contentClass]),
42
- side: s.side,
43
- align: s.align,
44
- "side-offset": s.sideOffset
41
+ }, 8, ["disabled"]), s(g(S), null, {
42
+ default: v(() => [s(g(y), {
43
+ class: u(["k-dropdown-content k-menu-surface", c.contentClass]),
44
+ side: c.side,
45
+ align: c.align,
46
+ "side-offset": c.sideOffset
45
47
  }, {
46
- default: _(() => [(u(!0), r(e, null, d(s.items, (o, s) => (u(), r(e, { key: o.key || `_${s}` }, [o.type === "separator" ? (u(), t(h(C), {
48
+ default: v(() => [(d(!0), i(e, null, f(j.value, (t, s) => (d(), i(e, { key: t.key || `_${s}` }, [t.type === "separator" ? (d(), n(g(w), {
47
49
  key: 0,
48
50
  class: "k-dropdown-sep"
49
- })) : o.type === "label" ? (u(), t(h(b), {
51
+ })) : t.type === "label" ? (d(), n(g(x), {
50
52
  key: 1,
51
53
  class: "k-dropdown-label"
52
54
  }, {
53
- default: _(() => [a(m(o.label), 1)]),
55
+ default: v(() => [o(h(t.label), 1)]),
54
56
  _: 2
55
- }, 1024)) : (u(), t(h(y), {
57
+ }, 1024)) : (d(), n(g(b), {
56
58
  key: 2,
57
- class: l(["k-dropdown-item k-menu-item", {
58
- "k-dropdown-item--danger": o.danger,
59
- "k-dropdown-item--active": o.active
59
+ class: u(["k-dropdown-item k-menu-item", {
60
+ "k-dropdown-item--danger": t.danger,
61
+ "k-dropdown-item--active": t.active
60
62
  }]),
61
- disabled: o.disabled,
62
- onSelect: (e) => k(o)
63
+ disabled: t.disabled,
64
+ onSelect: (e) => M(t)
63
65
  }, {
64
- default: _(() => [
65
- o.icon ? (u(), t(p(o.icon), {
66
+ default: v(() => [
67
+ t.icon ? (d(), n(m(t.icon), {
66
68
  key: 0,
67
69
  size: 15,
68
70
  class: "k-dropdown-item__icon"
69
- })) : n("", !0),
70
- i("span", T, m(o.label), 1),
71
- o.shortcut ? (u(), r("span", E, m(o.shortcut), 1)) : n("", !0)
71
+ })) : r("", !0),
72
+ a("span", E, h(t.label), 1),
73
+ t.shortcut ? (d(), i("span", D, h(t.shortcut), 1)) : r("", !0)
72
74
  ]),
73
75
  _: 2
74
76
  }, 1032, [
75
77
  "class",
76
78
  "disabled",
77
79
  "onSelect"
78
- ]))], 64))), 128)), f(c.$slots, "extra")]),
80
+ ]))], 64))), 128)), p(t.$slots, "extra")]),
79
81
  _: 3
80
82
  }, 8, [
81
83
  "class",
@@ -90,4 +92,4 @@ var T = { class: "k-dropdown-item__label" }, E = {
90
92
  }
91
93
  });
92
94
  //#endregion
93
- export { D as default };
95
+ export { O as default };
@@ -1,15 +1,19 @@
1
1
  import type { Component } from 'vue';
2
2
  type __VLS_Props = {
3
3
  icon?: Component;
4
- title: string;
4
+ title?: string;
5
5
  description?: string;
6
6
  compact?: boolean;
7
7
  };
8
- declare var __VLS_6: {}, __VLS_8: {};
8
+ declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {};
9
9
  type __VLS_Slots = {} & {
10
- default?: (props: typeof __VLS_6) => any;
10
+ title?: (props: typeof __VLS_6) => any;
11
11
  } & {
12
- actions?: (props: typeof __VLS_8) => any;
12
+ default?: (props: typeof __VLS_8) => any;
13
+ } & {
14
+ actions?: (props: typeof __VLS_10) => any;
15
+ } & {
16
+ extra?: (props: typeof __VLS_12) => any;
13
17
  };
14
18
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
19
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,9 +1,9 @@
1
- import { createBlock as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderSlot as c, resolveDynamicComponent as l, toDisplayString as u } from "vue";
1
+ import { createBlock as e, createCommentVNode as t, createElementBlock as n, createTextVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, resolveDynamicComponent as c, toDisplayString as l } from "vue";
2
2
  //#region components/KEmpty.vue?vue&type=script&setup=true&lang.ts
3
- var d = {
4
- key: 2,
3
+ var u = {
4
+ key: 3,
5
5
  class: "mt-3 flex flex-wrap items-center justify-center gap-2"
6
- }, f = /* @__PURE__ */ a({
6
+ }, d = /* @__PURE__ */ i({
7
7
  __name: "KEmpty",
8
8
  props: {
9
9
  icon: {},
@@ -11,20 +11,23 @@ var d = {
11
11
  description: {},
12
12
  compact: { type: Boolean }
13
13
  },
14
- setup(a) {
15
- return (f, p) => (s(), n("div", { class: o(["grid place-items-center rounded-2xl border border-dashed border-ink-200 bg-white text-center", a.compact ? "px-4 py-10" : "px-6 py-20"]) }, [
16
- a.icon ? (s(), e(l(a.icon), {
14
+ setup(i) {
15
+ return (d, f) => (o(), n("div", { class: a(["grid place-items-center rounded-2xl border border-dashed border-ink-200 bg-white text-center", i.compact ? "px-4 py-10" : "px-6 py-20"]) }, [
16
+ i.icon ? (o(), e(c(i.icon), {
17
17
  key: 0,
18
- class: o(["text-ink-300", a.compact ? "size-7" : "size-10"])
18
+ class: a(["text-ink-300", i.compact ? "size-7" : "size-10"])
19
19
  }, null, 8, ["class"])) : t("", !0),
20
- r("p", { class: o(["mt-3 font-medium text-ink-700", a.compact ? "text-xs" : "text-sm"]) }, u(a.title), 3),
21
- f.$slots.default || a.description ? (s(), n("p", {
20
+ i.title || d.$slots.title ? (o(), n("p", {
22
21
  key: 1,
23
- class: o(["mt-1 text-ink-400", a.compact ? "text-[11px]" : "text-xs"])
24
- }, [c(f.$slots, "default", {}, () => [i(u(a.description), 1)])], 2)) : t("", !0),
25
- f.$slots.actions ? (s(), n("div", d, [c(f.$slots, "actions")])) : t("", !0)
22
+ class: a(["mt-3 font-medium text-ink-700", i.compact ? "text-xs" : "text-sm"])
23
+ }, [s(d.$slots, "title", {}, () => [r(l(i.title), 1)])], 2)) : t("", !0),
24
+ d.$slots.default || i.description ? (o(), n("p", {
25
+ key: 2,
26
+ class: a(["mt-1 text-ink-400", i.compact ? "text-[11px]" : "text-xs"])
27
+ }, [s(d.$slots, "default", {}, () => [r(l(i.description), 1)])], 2)) : t("", !0),
28
+ d.$slots.actions || d.$slots.extra ? (o(), n("div", u, [s(d.$slots, "actions", {}, () => [s(d.$slots, "extra")])])) : t("", !0)
26
29
  ], 2));
27
30
  }
28
31
  });
29
32
  //#endregion
30
- export { f as default };
33
+ export { d as default };
@@ -1,15 +1,19 @@
1
- import { type FormRule } from './form-context';
1
+ import { type FormRules } from './form-context';
2
2
  type __VLS_Props = {
3
3
  model: Record<string, any>;
4
- rules?: Record<string, FormRule | FormRule[]>;
5
- labelWidth?: string;
4
+ rules?: FormRules;
5
+ labelWidth?: string | number;
6
6
  labelPosition?: 'top' | 'left';
7
- size?: 'sm' | 'md' | 'lg';
7
+ labelPlacement?: 'top' | 'left';
8
+ requireMarkPlacement?: string;
9
+ size?: 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
10
+ disabled?: boolean;
8
11
  };
9
12
  declare function validate(): Promise<boolean>;
10
13
  declare function validateField(name: string): Promise<boolean>;
11
14
  declare function resetFields(): void;
12
15
  declare function clearValidate(): void;
16
+ declare function restoreValidation(): void;
13
17
  declare var __VLS_1: {};
14
18
  type __VLS_Slots = {} & {
15
19
  default?: (props: typeof __VLS_1) => any;
@@ -19,13 +23,15 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
19
23
  validateField: typeof validateField;
20
24
  resetFields: typeof resetFields;
21
25
  clearValidate: typeof clearValidate;
26
+ restoreValidation: typeof restoreValidation;
22
27
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
23
28
  submit: (ev: Event) => any;
24
29
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
25
30
  onSubmit?: ((ev: Event) => any) | undefined;
26
31
  }>, {
27
- size: "sm" | "md" | "lg";
28
- labelWidth: string;
32
+ size: "small" | "sm" | "medium" | "md" | "large" | "lg";
33
+ disabled: boolean;
34
+ labelWidth: string | number;
29
35
  labelPosition: "top" | "left";
30
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
31
37
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,7 +1,7 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KForm.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KForm.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-10becb62"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-18f37fb3"]]);
6
6
  //#endregion
7
7
  export { n as default };