@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
@@ -8,7 +8,13 @@ var s = /* @__PURE__ */ n({
8
8
  rules: {},
9
9
  labelWidth: { default: "100px" },
10
10
  labelPosition: { default: "top" },
11
- size: { default: "md" }
11
+ labelPlacement: {},
12
+ requireMarkPlacement: {},
13
+ size: { default: "md" },
14
+ disabled: {
15
+ type: Boolean,
16
+ default: !1
17
+ }
12
18
  },
13
19
  emits: ["submit"],
14
20
  setup(n, { expose: s, emit: c }) {
@@ -19,6 +25,9 @@ var s = /* @__PURE__ */ n({
19
25
  function p(e) {
20
26
  d.delete(e);
21
27
  }
28
+ function m() {
29
+ return l.size === "small" || l.size === "sm" ? "sm" : l.size === "large" || l.size === "lg" ? "lg" : "md";
30
+ }
22
31
  i(e, {
23
32
  get model() {
24
33
  return l.model;
@@ -27,41 +36,48 @@ var s = /* @__PURE__ */ n({
27
36
  return l.rules;
28
37
  },
29
38
  get labelWidth() {
30
- return l.labelWidth;
39
+ return typeof l.labelWidth == "number" ? `${l.labelWidth}px` : l.labelWidth;
31
40
  },
32
41
  get labelPosition() {
33
- return l.labelPosition;
42
+ return l.labelPlacement ?? l.labelPosition;
34
43
  },
35
44
  get size() {
36
- return l.size;
45
+ return m();
46
+ },
47
+ get disabled() {
48
+ return l.disabled;
37
49
  },
38
50
  registerField: f,
39
51
  unregisterField: p
40
52
  });
41
- async function m() {
53
+ async function h() {
42
54
  return (await Promise.all(Array.from(d.values()).map((e) => e.validate()))).every(Boolean);
43
55
  }
44
- async function h(e) {
56
+ async function g(e) {
45
57
  let t = d.get(e);
46
58
  return t ? t.validate() : !0;
47
59
  }
48
- function g() {
60
+ function _() {
49
61
  d.forEach((e) => e.reset());
50
62
  }
51
- function _() {
63
+ function v() {
52
64
  d.forEach((e) => e.clearValidate());
53
65
  }
54
- async function v(e) {
55
- e.preventDefault(), await m() && u("submit", e);
66
+ function y() {
67
+ v();
68
+ }
69
+ async function b(e) {
70
+ e.preventDefault(), await h() && u("submit", e);
56
71
  }
57
72
  return s({
58
- validate: m,
59
- validateField: h,
60
- resetFields: g,
61
- clearValidate: _
73
+ validate: h,
74
+ validateField: g,
75
+ resetFields: _,
76
+ clearValidate: v,
77
+ restoreValidation: y
62
78
  }), (e, n) => (r(), t("form", {
63
79
  class: "k-form",
64
- onSubmit: v
80
+ onSubmit: b
65
81
  }, [o(e.$slots, "default", {}, void 0, !0)], 32));
66
82
  }
67
83
  });
@@ -1,10 +1,10 @@
1
1
  import { type FormRule } from './form-context';
2
2
  type __VLS_Props = {
3
- name: string;
3
+ name?: string;
4
+ path?: string;
4
5
  label?: string;
5
6
  rules?: FormRule | FormRule[];
6
7
  required?: boolean;
7
- /** 字段提示 (label 下灰色小字, 错误时隐藏) */
8
8
  hint?: string;
9
9
  };
10
10
  declare function validate(): Promise<boolean>;
@@ -13,6 +13,7 @@ declare function clearValidate(): void;
13
13
  declare var __VLS_1: {
14
14
  error: boolean;
15
15
  validate: typeof validate;
16
+ disabled: boolean;
16
17
  };
17
18
  type __VLS_Slots = {} & {
18
19
  default?: (props: typeof __VLS_1) => any;
@@ -1,7 +1,7 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KFormField.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KFormField.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-7d8c47c8"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-68d6a876"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -14,6 +14,7 @@ var _ = {
14
14
  __name: "KFormField",
15
15
  props: {
16
16
  name: {},
17
+ path: {},
17
18
  label: {},
18
19
  rules: {},
19
20
  required: { type: Boolean },
@@ -22,58 +23,70 @@ var _ = {
22
23
  setup(o, { expose: x }) {
23
24
  let S = o, C = s(e);
24
25
  if (!C) throw Error("KFormField 必须放在 <KForm> 内");
25
- let w = p(""), T = t(() => {
26
- let e = S.rules ?? C.rules?.[S.name] ?? [], t = Array.isArray(e) ? [...e] : [e];
26
+ let w = p(""), T = t(() => S.name ?? S.path ?? ""), E = t(() => {
27
+ let e = S.rules ?? C.rules?.[T.value] ?? [], t = Array.isArray(e) ? [...e] : [e];
27
28
  return S.required && !t.some((e) => e.required) && t.unshift({ required: !0 }), t.filter(Boolean);
28
- }), E = t(() => S.required || T.value.some((e) => e.required));
29
- function D(e) {
29
+ }), D = t(() => S.required || E.value.some((e) => e.required));
30
+ function O(e) {
30
31
  return !!(e == null || e === "" || Array.isArray(e) && e.length === 0);
31
32
  }
32
- async function O() {
33
- let e = C.model[S.name];
34
- for (let t of T.value) {
35
- if (t.required && D(e)) return w.value = t.message ?? `${S.label || S.name} 必填`, !1;
36
- if (!D(e)) {
37
- if (t.min !== void 0 && typeof e == "string" && e.length < t.min) return w.value = t.message ?? `至少 ${t.min} 个字符`, !1;
38
- if (t.max !== void 0 && typeof e == "string" && e.length > t.max) return w.value = t.message ?? `最多 ${t.max} 个字符`, !1;
39
- if (t.pattern && !t.pattern.test(String(e))) return w.value = t.message ?? "格式不正确", !1;
40
- if (t.validator) {
41
- let n = await t.validator(e);
33
+ async function k() {
34
+ let e = C.model[T.value];
35
+ for (let t of E.value) {
36
+ if (t.validator) {
37
+ try {
38
+ let n = await (t.validator.length <= 1 ? t.validator(e) : t.validator(t, e));
42
39
  if (n === !1) return w.value = t.message ?? "校验失败", !1;
43
40
  if (typeof n == "string") return w.value = n, !1;
41
+ if (n instanceof Error) return w.value = n.message || t.message || "校验失败", !1;
42
+ } catch (e) {
43
+ return w.value = e?.message || t.message || "校验失败", !1;
44
44
  }
45
+ continue;
46
+ }
47
+ if (t.required && O(e)) return w.value = t.message ?? `${S.label || T.value} 必填`, !1;
48
+ if (!O(e)) {
49
+ if (t.len !== void 0 && (typeof e == "string" || Array.isArray(e)) && e.length !== t.len) return w.value = t.message ?? `长度必须为 ${t.len}`, !1;
50
+ if (t.min !== void 0 && (typeof e == "string" || Array.isArray(e)) && e.length < t.min) return w.value = t.message ?? `至少 ${t.min} 个字符`, !1;
51
+ if (t.max !== void 0 && (typeof e == "string" || Array.isArray(e)) && e.length > t.max) return w.value = t.message ?? `最多 ${t.max} 个字符`, !1;
52
+ if (t.pattern && !t.pattern.test(String(e))) return w.value = t.message ?? "格式不正确", !1;
45
53
  }
46
54
  }
47
55
  return w.value = "", !0;
48
56
  }
49
- function k() {
57
+ function A() {
50
58
  w.value = "";
51
59
  }
52
- function A() {
60
+ function j() {
53
61
  w.value = "";
54
62
  }
55
- let j = {
56
- validate: O,
57
- reset: k,
58
- clearValidate: A
63
+ let M = {
64
+ validate: k,
65
+ reset: A,
66
+ clearValidate: j
59
67
  };
60
- d(() => C.registerField(S.name, j)), u(() => C.unregisterField(S.name));
61
- let M = t(() => C.labelPosition === "left" ? {
68
+ d(() => {
69
+ T.value && C.registerField(T.value, M);
70
+ }), u(() => {
71
+ T.value && C.unregisterField(T.value);
72
+ });
73
+ let N = t(() => C.labelPosition === "left" ? {
62
74
  width: C.labelWidth,
63
75
  textAlign: "right"
64
76
  } : {});
65
77
  return x({
66
- validate: O,
67
- reset: k,
68
- clearValidate: A
78
+ validate: k,
79
+ reset: A,
80
+ clearValidate: j
69
81
  }), (e, t) => (f(), r("div", { class: c(["k-field", `k-field--${g(C).labelPosition}`]) }, [o.label ? (f(), r("label", {
70
82
  key: 0,
71
83
  class: "k-field__label",
72
- style: l(M.value)
73
- }, [E.value ? (f(), r("span", _, "*")) : n("", !0), a(" " + h(o.label), 1)], 4)) : n("", !0), i("div", v, [
84
+ style: l(N.value)
85
+ }, [D.value ? (f(), r("span", _, "*")) : n("", !0), a(" " + h(o.label), 1)], 4)) : n("", !0), i("div", v, [
74
86
  m(e.$slots, "default", {
75
87
  error: !!w.value,
76
- validate: O
88
+ validate: k,
89
+ disabled: g(C).disabled
77
90
  }, void 0, !0),
78
91
  o.hint && !w.value ? (f(), r("p", y, h(o.hint), 1)) : n("", !0),
79
92
  w.value ? (f(), r("p", b, h(w.value), 1)) : n("", !0)
@@ -0,0 +1,22 @@
1
+ import { type Component } from 'vue';
2
+ type __VLS_Props = {
3
+ component?: Component;
4
+ size?: number | string;
5
+ color?: string;
6
+ depth?: 1 | 2 | 3 | 4 | 5;
7
+ };
8
+ declare var __VLS_6: {};
9
+ type __VLS_Slots = {} & {
10
+ default?: (props: typeof __VLS_6) => any;
11
+ };
12
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
13
+ size: number | string;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KIcon.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KIcon.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-1badf300"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,31 @@
1
+ import { computed as e, createBlock as t, createElementBlock as n, defineComponent as r, normalizeClass as i, normalizeStyle as a, openBlock as o, renderSlot as s, resolveDynamicComponent as c } from "vue";
2
+ //#region components/KIcon.vue?vue&type=script&setup=true&lang.ts
3
+ var l = /* @__PURE__ */ r({
4
+ __name: "KIcon",
5
+ props: {
6
+ component: {},
7
+ size: { default: 18 },
8
+ color: {},
9
+ depth: {}
10
+ },
11
+ setup(r) {
12
+ let l = r, u = e(() => {
13
+ let e = typeof l.size == "number" ? `${l.size}px` : l.size;
14
+ return {
15
+ width: e,
16
+ height: e,
17
+ fontSize: e,
18
+ color: l.color
19
+ };
20
+ });
21
+ return (e, l) => (o(), n("span", {
22
+ class: i(["k-icon", r.depth ? `k-icon--depth-${r.depth}` : void 0]),
23
+ style: a(u.value)
24
+ }, [r.component ? (o(), t(c(r.component), {
25
+ key: 0,
26
+ size: r.size
27
+ }, null, 8, ["size"])) : s(e.$slots, "default", { key: 1 }, void 0, !0)], 6));
28
+ }
29
+ });
30
+ //#endregion
31
+ export { l as default };
@@ -9,16 +9,16 @@ type __VLS_Props = {
9
9
  rounded?: string;
10
10
  };
11
11
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
- click: (ev: MouseEvent) => any;
13
12
  error: () => any;
13
+ click: (ev: MouseEvent) => any;
14
14
  load: () => any;
15
15
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
- onClick?: ((ev: MouseEvent) => any) | undefined;
17
16
  onError?: (() => any) | undefined;
17
+ onClick?: ((ev: MouseEvent) => any) | undefined;
18
18
  onLoad?: (() => any) | undefined;
19
19
  }>, {
20
- fit: "cover" | "contain" | "fill" | "none" | "scale-down";
21
20
  lazy: boolean;
21
+ fit: "cover" | "contain" | "fill" | "none" | "scale-down";
22
22
  preview: boolean;
23
23
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
24
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,6 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KImage.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KImage.vue
5
5
  var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c1e4cb5f"]]);
6
6
  //#endregion
@@ -1,4 +1,4 @@
1
- import e from "./KImageViewer.js";
1
+ import e from "./KImageViewer.vue.js";
2
2
  import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createVNode as a, defineComponent as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, unref as p, watch as m } from "vue";
3
3
  import { ImageIcon as h, ImageOff as g } from "lucide-vue-next";
4
4
  //#region components/KImage.vue?vue&type=script&setup=true&lang.ts
@@ -1,6 +1,6 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KImageViewer.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KImageViewer.vue
5
5
  var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b951291f"]]);
6
6
  //#endregion
@@ -1,37 +1,43 @@
1
1
  type __VLS_Props = {
2
2
  modelValue?: string | number;
3
- size?: 'sm' | 'md' | 'lg';
3
+ value?: string | number;
4
+ size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
4
5
  placeholder?: string;
5
6
  disabled?: boolean;
6
7
  readonly?: boolean;
7
8
  clearable?: boolean;
8
9
  error?: boolean;
9
10
  type?: string;
11
+ showPasswordOn?: boolean | 'click';
12
+ bordered?: boolean;
10
13
  };
11
- declare var __VLS_1: {}, __VLS_8: {};
14
+ declare var __VLS_1: {}, __VLS_18: {};
12
15
  type __VLS_Slots = {} & {
13
16
  prefix?: (props: typeof __VLS_1) => any;
14
17
  } & {
15
- suffix?: (props: typeof __VLS_8) => any;
18
+ suffix?: (props: typeof __VLS_18) => any;
16
19
  };
17
20
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
18
21
  "update:modelValue": (v: string) => any;
22
+ "update:value": (v: string) => any;
19
23
  blur: (ev: FocusEvent) => any;
20
24
  focus: (ev: FocusEvent) => any;
21
25
  clear: () => any;
22
26
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
23
27
  "onUpdate:modelValue"?: ((v: string) => any) | undefined;
28
+ "onUpdate:value"?: ((v: string) => any) | undefined;
24
29
  onBlur?: ((ev: FocusEvent) => any) | undefined;
25
30
  onFocus?: ((ev: FocusEvent) => any) | undefined;
26
31
  onClear?: (() => any) | undefined;
27
32
  }>, {
33
+ error: boolean;
28
34
  type: string;
29
- size: "sm" | "md" | "lg";
35
+ size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
30
36
  disabled: boolean;
31
37
  modelValue: string | number;
32
38
  readonly: boolean;
33
39
  clearable: boolean;
34
- error: boolean;
40
+ bordered: boolean;
35
41
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
42
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
37
43
  declare const _default: typeof __VLS_export;
@@ -1,7 +1,7 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KInput.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KInput.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-a551ddc7"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-801aa9cf"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -1,22 +1,23 @@
1
- import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, ref as c, renderSlot as l, unref as u, withModifiers as d } from "vue";
2
- import { X as f } from "lucide-vue-next";
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, renderSlot as u, unref as d, withModifiers as f } from "vue";
2
+ import { Eye as p, EyeOff as m, X as h } from "lucide-vue-next";
3
3
  //#region components/KInput.vue?vue&type=script&setup=true&lang.ts
4
- var p = {
4
+ var g = {
5
5
  key: 0,
6
6
  class: "k-input__affix k-input__affix--prefix"
7
- }, m = [
7
+ }, _ = [
8
8
  "type",
9
9
  "value",
10
10
  "disabled",
11
11
  "readonly",
12
12
  "placeholder"
13
- ], h = {
14
- key: 2,
13
+ ], v = ["aria-label"], y = {
14
+ key: 3,
15
15
  class: "k-input__affix k-input__affix--suffix"
16
- }, g = /* @__PURE__ */ a({
16
+ }, b = /* @__PURE__ */ o({
17
17
  __name: "KInput",
18
18
  props: {
19
19
  modelValue: { default: "" },
20
+ value: {},
20
21
  size: { default: "md" },
21
22
  placeholder: {},
22
23
  disabled: {
@@ -35,55 +36,78 @@ var p = {
35
36
  type: Boolean,
36
37
  default: !1
37
38
  },
38
- type: { default: "text" }
39
+ type: { default: "text" },
40
+ showPasswordOn: { type: [Boolean, String] },
41
+ bordered: {
42
+ type: Boolean,
43
+ default: !0
44
+ }
39
45
  },
40
46
  emits: [
41
47
  "update:modelValue",
48
+ "update:value",
42
49
  "blur",
43
50
  "focus",
44
51
  "clear"
45
52
  ],
46
- setup(a, { emit: g }) {
47
- let _ = a, v = g, y = c(!1);
48
- function b(e) {
49
- v("update:modelValue", e.target.value);
53
+ setup(o, { emit: b }) {
54
+ let x = o, S = b, C = l(!1), w = l(!1), T = e(() => x.value ?? x.modelValue ?? "");
55
+ function E(e) {
56
+ let t = e.target.value;
57
+ S("update:modelValue", t), S("update:value", t);
50
58
  }
51
- function x() {
52
- v("update:modelValue", ""), v("clear");
59
+ function D() {
60
+ S("update:modelValue", ""), S("update:value", ""), S("clear");
53
61
  }
54
- let S = e(() => _.clearable && !_.disabled && !_.readonly && String(_.modelValue ?? "").length > 0);
55
- return (e, c) => (s(), n("div", { class: o(["k-input", [`k-input--${a.size}`, {
56
- "k-input--focused": y.value,
57
- "k-input--error": a.error,
58
- "k-input--disabled": a.disabled
62
+ let O = e(() => x.clearable && !x.disabled && !x.readonly && String(T.value ?? "").length > 0), k = e(() => x.size === "tiny" || x.size === "xs" || x.size === "small" || x.size === "sm" ? "sm" : x.size === "large" || x.size === "lg" ? "lg" : "md"), A = e(() => x.type === "password" && !!x.showPasswordOn && !x.disabled && !x.readonly), j = e(() => A.value ? w.value ? "text" : "password" : x.type);
63
+ return (e, l) => (c(), r("div", { class: s(["k-input", [`k-input--${k.value}`, {
64
+ "k-input--focused": C.value,
65
+ "k-input--error": o.error,
66
+ "k-input--disabled": o.disabled,
67
+ "k-input--borderless": !o.bordered
59
68
  }]]) }, [
60
- e.$slots.prefix ? (s(), n("span", p, [l(e.$slots, "prefix", {}, void 0, !0)])) : t("", !0),
61
- r("input", {
62
- type: a.type,
63
- value: a.modelValue,
64
- disabled: a.disabled,
65
- readonly: a.readonly,
66
- placeholder: a.placeholder,
69
+ e.$slots.prefix ? (c(), r("span", g, [u(e.$slots, "prefix", {}, void 0, !0)])) : n("", !0),
70
+ i("input", {
71
+ type: j.value,
72
+ value: T.value,
73
+ disabled: o.disabled,
74
+ readonly: o.readonly,
75
+ placeholder: o.placeholder,
67
76
  class: "k-input__inner",
68
- onInput: b,
69
- onFocus: c[0] ||= (e) => {
70
- y.value = !0, v("focus", e);
77
+ onInput: E,
78
+ onFocus: l[0] ||= (e) => {
79
+ C.value = !0, S("focus", e);
71
80
  },
72
- onBlur: c[1] ||= (e) => {
73
- y.value = !1, v("blur", e);
81
+ onBlur: l[1] ||= (e) => {
82
+ C.value = !1, S("blur", e);
74
83
  }
75
- }, null, 40, m),
76
- S.value ? (s(), n("button", {
84
+ }, null, 40, _),
85
+ A.value ? (c(), r("button", {
86
+ key: 1,
87
+ type: "button",
88
+ class: "k-input__clear k-input__password",
89
+ tabindex: "-1",
90
+ "aria-label": w.value ? "隐藏密码" : "显示密码",
91
+ onMousedown: l[2] ||= f(() => {}, ["prevent"]),
92
+ onClick: l[3] ||= (e) => w.value = !w.value
93
+ }, [w.value ? (c(), t(d(m), {
94
+ key: 0,
95
+ size: 13
96
+ })) : (c(), t(d(p), {
77
97
  key: 1,
98
+ size: 13
99
+ }))], 40, v)) : n("", !0),
100
+ O.value ? (c(), r("button", {
101
+ key: 2,
78
102
  type: "button",
79
103
  class: "k-input__clear",
80
104
  tabindex: "-1",
81
- onMousedown: c[2] ||= d(() => {}, ["prevent"]),
82
- onClick: x
83
- }, [i(u(f), { size: 10 })], 32)) : t("", !0),
84
- e.$slots.suffix ? (s(), n("span", h, [l(e.$slots, "suffix", {}, void 0, !0)])) : t("", !0)
105
+ onMousedown: l[4] ||= f(() => {}, ["prevent"]),
106
+ onClick: D
107
+ }, [a(d(h), { size: 10 })], 32)) : n("", !0),
108
+ e.$slots.suffix ? (c(), r("span", y, [u(e.$slots, "suffix", {}, void 0, !0)])) : n("", !0)
85
109
  ], 2));
86
110
  }
87
111
  });
88
112
  //#endregion
89
- export { g as default };
113
+ export { b as default };
@@ -1,6 +1,6 @@
1
1
  type __VLS_Props = {
2
2
  modelValue?: number | null;
3
- size?: 'sm' | 'md' | 'lg';
3
+ size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
4
4
  placeholder?: string;
5
5
  disabled?: boolean;
6
6
  readonly?: boolean;
@@ -9,20 +9,34 @@ type __VLS_Props = {
9
9
  step?: number;
10
10
  precision?: number;
11
11
  error?: boolean;
12
+ showButton?: boolean;
12
13
  };
13
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
+ declare var __VLS_1: {}, __VLS_3: {};
15
+ type __VLS_Slots = {} & {
16
+ prefix?: (props: typeof __VLS_1) => any;
17
+ } & {
18
+ suffix?: (props: typeof __VLS_3) => any;
19
+ };
20
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
14
21
  "update:modelValue": (v: number | null) => any;
15
22
  change: (v: number | null) => any;
16
23
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
24
  "onUpdate:modelValue"?: ((v: number | null) => any) | undefined;
18
25
  onChange?: ((v: number | null) => any) | undefined;
19
26
  }>, {
20
- size: "sm" | "md" | "lg";
27
+ error: boolean;
28
+ size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
21
29
  disabled: boolean;
22
30
  modelValue: number | null;
23
31
  readonly: boolean;
24
- error: boolean;
25
32
  step: number;
33
+ showButton: boolean;
26
34
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
35
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
36
  declare const _default: typeof __VLS_export;
28
37
  export default _default;
38
+ type __VLS_WithSlots<T, S> = T & {
39
+ new (): {
40
+ $slots: S;
41
+ };
42
+ };
@@ -1,7 +1,7 @@
1
1
  import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KInputNumber.vue_vue_type_script_setup_true_lang.js";
3
- /* empty css */
3
+ /* empty css */
4
4
  //#region components/KInputNumber.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c7951eb7"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-3f7b7ae1"]]);
6
6
  //#endregion
7
7
  export { n as default };