@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.
- package/README.md +66 -22
- package/dist/components/KAlert.vue.d.ts +1 -1
- package/dist/components/{KAlert.js → KAlert.vue.js} +2 -2
- package/dist/components/KAlert.vue_vue_type_script_setup_true_lang.js +35 -32
- package/dist/components/{KAvatar.js → KAvatar.vue.js} +1 -1
- package/dist/components/{KAvatarGroup.js → KAvatarGroup.vue.js} +1 -1
- package/dist/components/KBreadcrumb.vue.d.ts +30 -1
- package/dist/components/{KBreadcrumb.js → KBreadcrumb.vue.js} +2 -2
- package/dist/components/KBreadcrumb.vue_vue_type_script_setup_true_lang.js +36 -21
- package/dist/components/KButton.vue.d.ts +17 -2
- package/dist/components/{KButton.js → KButton.vue.js} +2 -2
- package/dist/components/KButton.vue_vue_type_script_setup_true_lang.js +51 -17
- package/dist/components/KCard.vue.d.ts +5 -3
- package/dist/components/{KCard.js → KCard.vue.js} +2 -2
- package/dist/components/KCard.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/components/{KCarousel.js → KCarousel.vue.js} +1 -1
- package/dist/components/{KCheckbox.js → KCheckbox.vue.js} +1 -1
- package/dist/components/{KCheckboxGroup.js → KCheckboxGroup.vue.js} +1 -1
- package/dist/components/KColorPicker.vue.d.ts +40 -0
- package/dist/components/KColorPicker.vue.js +7 -0
- package/dist/components/KColorPicker.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/components/{KCombobox.js → KCombobox.vue.js} +2 -2
- package/dist/components/{KCommandPalette.js → KCommandPalette.vue.js} +1 -1
- package/dist/components/KConfigProvider.vue.d.ts +26 -0
- package/dist/components/KConfigProvider.vue.js +5 -0
- package/dist/components/KConfigProvider.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/components/{KConfirmDialog.js → KConfirmDialog.vue.js} +1 -1
- package/dist/components/KDataTable.vue.d.ts +33 -10
- package/dist/components/{KDataTable.js → KDataTable.vue.js} +2 -2
- package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +128 -30
- package/dist/components/{KDatePicker.js → KDatePicker.vue.js} +1 -1
- package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/KDescriptions.vue.d.ts +30 -0
- package/dist/components/KDescriptions.vue.js +6 -0
- package/dist/components/KDescriptions.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/components/KDescriptionsItem.vue.d.ts +17 -0
- package/dist/components/KDescriptionsItem.vue.js +5 -0
- package/dist/components/KDescriptionsItem.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/components/KDialog.vue.d.ts +1 -0
- package/dist/components/{KDialog.js → KDialog.vue.js} +2 -2
- package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +45 -38
- package/dist/components/{KDiff.js → KDiff.vue.js} +1 -1
- package/dist/components/KDrawer.vue.d.ts +7 -3
- package/dist/components/{KDrawer.js → KDrawer.vue.js} +2 -2
- package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +41 -29
- package/dist/components/KDropdown.vue.d.ts +7 -4
- package/dist/components/{KDropdown.js → KDropdown.vue.js} +2 -2
- package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +40 -38
- package/dist/components/KEmpty.vue.d.ts +8 -4
- package/dist/components/KEmpty.vue_vue_type_script_setup_true_lang.js +17 -14
- package/dist/components/KForm.vue.d.ts +12 -6
- package/dist/components/{KForm.js → KForm.vue.js} +2 -2
- package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +31 -15
- package/dist/components/KFormField.vue.d.ts +3 -2
- package/dist/components/{KFormField.js → KFormField.vue.js} +2 -2
- package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +41 -28
- package/dist/components/KIcon.vue.d.ts +22 -0
- package/dist/components/KIcon.vue.js +7 -0
- package/dist/components/KIcon.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/KImage.vue.d.ts +3 -3
- package/dist/components/{KImage.js → KImage.vue.js} +1 -1
- package/dist/components/KImage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/{KImageViewer.js → KImageViewer.vue.js} +1 -1
- package/dist/components/KInput.vue.d.ts +11 -5
- package/dist/components/{KInput.js → KInput.vue.js} +2 -2
- package/dist/components/KInput.vue_vue_type_script_setup_true_lang.js +62 -38
- package/dist/components/KInputNumber.vue.d.ts +18 -4
- package/dist/components/{KInputNumber.js → KInputNumber.vue.js} +2 -2
- package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +80 -62
- package/dist/components/{KLoadingOverlay.js → KLoadingOverlay.vue.js} +1 -1
- package/dist/components/KMessage.js +1 -1
- package/dist/components/{KMessageContainer.js → KMessageContainer.vue.js} +1 -1
- package/dist/components/KNotification.d.ts +36 -0
- package/dist/components/KNotification.js +55 -0
- package/dist/components/KNotificationContainer.vue.d.ts +20 -0
- package/dist/components/KNotificationContainer.vue.js +7 -0
- package/dist/components/KNotificationContainer.vue_vue_type_script_setup_true_lang.js +63 -0
- package/dist/components/KNotificationProvider.vue.d.ts +13 -0
- package/dist/components/KNotificationProvider.vue.js +10 -0
- package/dist/components/{KPagination.js → KPagination.vue.js} +1 -1
- package/dist/components/KPopconfirm.vue.d.ts +46 -0
- package/dist/components/KPopconfirm.vue.js +6 -0
- package/dist/components/KPopconfirm.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/{KPopover.js → KPopover.vue.js} +1 -1
- package/dist/components/KProgress.vue.d.ts +3 -2
- package/dist/components/{KProgress.js → KProgress.vue.js} +2 -2
- package/dist/components/KProgress.vue_vue_type_script_setup_true_lang.js +23 -20
- package/dist/components/{KRadio.js → KRadio.vue.js} +1 -1
- package/dist/components/{KRadioGroup.js → KRadioGroup.vue.js} +1 -1
- package/dist/components/{KResizablePanel.js → KResizablePanel.vue.js} +1 -1
- package/dist/components/{KResult.js → KResult.vue.js} +1 -1
- package/dist/components/KSelect.vue.d.ts +10 -3
- package/dist/components/{KSelect.js → KSelect.vue.js} +4 -4
- package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +89 -48
- package/dist/components/{KSkeleton.js → KSkeleton.vue.js} +1 -1
- package/dist/components/KSlider.vue.d.ts +24 -0
- package/dist/components/KSlider.vue.js +7 -0
- package/dist/components/KSlider.vue_vue_type_script_setup_true_lang.js +82 -0
- package/dist/components/KSpin.vue.d.ts +23 -0
- package/dist/components/KSpin.vue.js +7 -0
- package/dist/components/KSpin.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/KSteps.vue.d.ts +1 -1
- package/dist/components/{KSteps.js → KSteps.vue.js} +1 -1
- package/dist/components/KSwitch.vue.d.ts +2 -2
- package/dist/components/{KSwitch.js → KSwitch.vue.js} +2 -2
- package/dist/components/KSwitch.vue_vue_type_script_setup_true_lang.js +12 -11
- package/dist/components/KTabs.vue.d.ts +10 -5
- package/dist/components/{KTabs.js → KTabs.vue.js} +2 -2
- package/dist/components/KTabs.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/components/KTag.vue.d.ts +3 -3
- package/dist/components/{KTag.js → KTag.vue.js} +2 -2
- package/dist/components/KTag.vue_vue_type_script_setup_true_lang.js +14 -13
- package/dist/components/KTextarea.vue.d.ts +17 -2
- package/dist/components/{KTextarea.js → KTextarea.vue.js} +2 -2
- package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +51 -22
- package/dist/components/{KThemeToggleButton.js → KThemeToggleButton.vue.js} +1 -1
- package/dist/components/{KTooltip.js → KTooltip.vue.js} +1 -1
- package/dist/components/{KTreeNode.js → KTreeNode.vue.js} +1 -1
- package/dist/components/{KTreeView.js → KTreeView.vue.js} +1 -1
- package/dist/components/KTreeView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/KUpload.vue.d.ts +100 -4
- package/dist/components/{KUpload.js → KUpload.vue.js} +2 -2
- package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +189 -94
- package/dist/components/KUploadDragger.vue.d.ts +13 -0
- package/dist/components/KUploadDragger.vue.js +7 -0
- package/dist/components/KUploadDragger.vue_vue_type_script_setup_true_lang.js +12 -0
- package/dist/components/{KVirtualList.js → KVirtualList.vue.js} +1 -1
- package/dist/components/form-context.d.ts +7 -3
- package/dist/components/upload-context.d.ts +6 -0
- package/dist/components/upload-context.js +4 -0
- package/dist/index.d.ts +17 -3
- package/dist/index.js +66 -55
- package/dist/k-ui.css +1 -1
- package/package.json +6 -12
- /package/dist/components/{KEmpty.js → KEmpty.vue.js} +0 -0
- /package/dist/components/{KGridSkeleton.js → KGridSkeleton.vue.js} +0 -0
- /package/dist/components/{KListSkeleton.js → KListSkeleton.vue.js} +0 -0
- /package/dist/components/{KRefetchOverlay.js → KRefetchOverlay.vue.js} +0 -0
- /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
|
-
|
|
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
|
|
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
|
|
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
|
|
56
|
+
async function g(e) {
|
|
45
57
|
let t = d.get(e);
|
|
46
58
|
return t ? t.validate() : !0;
|
|
47
59
|
}
|
|
48
|
-
function
|
|
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
|
-
|
|
55
|
-
|
|
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:
|
|
59
|
-
validateField:
|
|
60
|
-
resetFields:
|
|
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:
|
|
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
|
|
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-
|
|
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?.[
|
|
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
|
-
}),
|
|
29
|
-
function
|
|
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
|
|
33
|
-
let e = C.model[
|
|
34
|
-
for (let t of
|
|
35
|
-
if (t.
|
|
36
|
-
|
|
37
|
-
|
|
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
|
|
57
|
+
function A() {
|
|
50
58
|
w.value = "";
|
|
51
59
|
}
|
|
52
|
-
function
|
|
60
|
+
function j() {
|
|
53
61
|
w.value = "";
|
|
54
62
|
}
|
|
55
|
-
let
|
|
56
|
-
validate:
|
|
57
|
-
reset:
|
|
58
|
-
clearValidate:
|
|
63
|
+
let M = {
|
|
64
|
+
validate: k,
|
|
65
|
+
reset: A,
|
|
66
|
+
clearValidate: j
|
|
59
67
|
};
|
|
60
|
-
d(() =>
|
|
61
|
-
|
|
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:
|
|
67
|
-
reset:
|
|
68
|
-
clearValidate:
|
|
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(
|
|
73
|
-
}, [
|
|
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:
|
|
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
|
-
|
|
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: {},
|
|
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
|
|
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
|
-
|
|
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-
|
|
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,
|
|
2
|
-
import { X as
|
|
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
|
|
4
|
+
var g = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "k-input__affix k-input__affix--prefix"
|
|
7
|
-
},
|
|
7
|
+
}, _ = [
|
|
8
8
|
"type",
|
|
9
9
|
"value",
|
|
10
10
|
"disabled",
|
|
11
11
|
"readonly",
|
|
12
12
|
"placeholder"
|
|
13
|
-
],
|
|
14
|
-
key:
|
|
13
|
+
], v = ["aria-label"], y = {
|
|
14
|
+
key: 3,
|
|
15
15
|
class: "k-input__affix k-input__affix--suffix"
|
|
16
|
-
},
|
|
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(
|
|
47
|
-
let
|
|
48
|
-
function
|
|
49
|
-
|
|
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
|
|
52
|
-
|
|
59
|
+
function D() {
|
|
60
|
+
S("update:modelValue", ""), S("update:value", ""), S("clear");
|
|
53
61
|
}
|
|
54
|
-
let
|
|
55
|
-
return (e,
|
|
56
|
-
"k-input--focused":
|
|
57
|
-
"k-input--error":
|
|
58
|
-
"k-input--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 ? (
|
|
61
|
-
|
|
62
|
-
type:
|
|
63
|
-
value:
|
|
64
|
-
disabled:
|
|
65
|
-
readonly:
|
|
66
|
-
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:
|
|
69
|
-
onFocus:
|
|
70
|
-
|
|
77
|
+
onInput: E,
|
|
78
|
+
onFocus: l[0] ||= (e) => {
|
|
79
|
+
C.value = !0, S("focus", e);
|
|
71
80
|
},
|
|
72
|
-
onBlur:
|
|
73
|
-
|
|
81
|
+
onBlur: l[1] ||= (e) => {
|
|
82
|
+
C.value = !1, S("blur", e);
|
|
74
83
|
}
|
|
75
|
-
}, null, 40,
|
|
76
|
-
|
|
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:
|
|
82
|
-
onClick:
|
|
83
|
-
}, [
|
|
84
|
-
e.$slots.suffix ? (
|
|
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 {
|
|
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
|
|
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
|
-
|
|
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-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-3f7b7ae1"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|