@guoyg578/k-ui 0.1.1 → 0.1.3
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 +11 -9
- package/dist/components/KAffix.vue.d.ts +17 -0
- package/dist/components/KAffix.vue.js +7 -0
- package/dist/components/KAffix.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/KAnchor.vue.d.ts +14 -0
- package/dist/components/KAnchor.vue.js +7 -0
- package/dist/components/KAnchor.vue_vue_type_script_setup_true_lang.js +40 -0
- package/dist/components/KAutoComplete.vue.d.ts +26 -0
- package/dist/components/KAutoComplete.vue.js +8 -0
- package/dist/components/KAutoComplete.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/components/KBackTop.vue.d.ts +24 -0
- package/dist/components/KBackTop.vue.js +7 -0
- package/dist/components/KBackTop.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/KBadge.vue.d.ts +31 -0
- package/dist/components/KBadge.vue.js +7 -0
- package/dist/components/KBadge.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/components/KButtonGroup.vue.d.ts +18 -0
- package/dist/components/KButtonGroup.vue.js +6 -0
- package/dist/components/KButtonGroup.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/components/KCalendar.vue.d.ts +33 -0
- package/dist/components/KCalendar.vue.js +7 -0
- package/dist/components/KCalendar.vue_vue_type_script_setup_true_lang.js +78 -0
- package/dist/components/KCascader.vue.d.ts +29 -0
- package/dist/components/KCascader.vue.js +8 -0
- package/dist/components/KCascader.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/KCode.vue.d.ts +27 -0
- package/dist/components/KCode.vue.js +7 -0
- package/dist/components/KCode.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/components/KCollapse.vue.d.ts +25 -0
- package/dist/components/KCollapse.vue.js +7 -0
- package/dist/components/KCollapse.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/components/KCollapseItem.vue.d.ts +22 -0
- package/dist/components/KCollapseItem.vue.js +7 -0
- package/dist/components/KCollapseItem.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/components/KCountdown.vue.d.ts +15 -0
- package/dist/components/KCountdown.vue.js +7 -0
- package/dist/components/KCountdown.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/components/KDescriptions.vue.d.ts +1 -1
- package/dist/components/KDivider.vue.d.ts +21 -0
- package/dist/components/KDivider.vue.js +7 -0
- package/dist/components/KDivider.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/KDropdown.vue.d.ts +1 -1
- package/dist/components/KDropdown.vue.js +1 -1
- package/dist/components/KDynamicInput.vue.d.ts +33 -0
- package/dist/components/KDynamicInput.vue.js +7 -0
- package/dist/components/KDynamicInput.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/components/KDynamicTags.vue.d.ts +20 -0
- package/dist/components/KDynamicTags.vue.js +7 -0
- package/dist/components/KDynamicTags.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/components/KGrid.vue.d.ts +29 -0
- package/dist/components/KGrid.vue.js +7 -0
- package/dist/components/KGrid.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/components/KGridItem.vue.d.ts +20 -0
- package/dist/components/KGridItem.vue.js +7 -0
- package/dist/components/KGridItem.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/components/KImage.vue.d.ts +2 -0
- package/dist/components/KImage.vue.js +1 -1
- package/dist/components/KImage.vue_vue_type_script_setup_true_lang.js +15 -4
- package/dist/components/KImageViewer.vue.d.ts +2 -0
- package/dist/components/KImageViewer.vue.js +1 -1
- package/dist/components/KImageViewer.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/components/KLayout.vue.d.ts +19 -0
- package/dist/components/KLayout.vue.js +7 -0
- package/dist/components/KLayout.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/components/KLayoutContent.vue.d.ts +17 -0
- package/dist/components/KLayoutContent.vue.js +7 -0
- package/dist/components/KLayoutContent.vue_vue_type_script_setup_true_lang.js +11 -0
- package/dist/components/KLayoutHeader.vue.d.ts +19 -0
- package/dist/components/KLayoutHeader.vue.js +7 -0
- package/dist/components/KLayoutHeader.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/components/KLayoutSider.vue.d.ts +28 -0
- package/dist/components/KLayoutSider.vue.js +7 -0
- package/dist/components/KLayoutSider.vue_vue_type_script_setup_true_lang.js +34 -0
- package/dist/components/KList.vue.d.ts +24 -0
- package/dist/components/KList.vue.js +7 -0
- package/dist/components/KList.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/components/KListItem.vue.d.ts +17 -0
- package/dist/components/KListItem.vue.js +7 -0
- package/dist/components/KListItem.vue_vue_type_script_setup_true_lang.js +22 -0
- package/dist/components/KMention.vue.d.ts +27 -0
- package/dist/components/KMention.vue.js +8 -0
- package/dist/components/KMention.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/components/KMenu.vue.d.ts +30 -0
- package/dist/components/KMenu.vue.js +9 -0
- package/dist/components/KMenu.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/components/KMenuItem.vue.d.ts +10 -0
- package/dist/components/KMenuItem.vue.js +7 -0
- package/dist/components/KMenuItem.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/components/KNumberAnimation.vue.d.ts +33 -0
- package/dist/components/KNumberAnimation.vue.js +7 -0
- package/dist/components/KNumberAnimation.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/components/KPopconfirm.vue.d.ts +1 -1
- package/dist/components/KPopover.vue.d.ts +1 -1
- package/dist/components/KRadio.vue.d.ts +4 -2
- package/dist/components/KRadio.vue.js +1 -1
- package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +24 -11
- package/dist/components/KRadioGroup.vue.d.ts +3 -0
- package/dist/components/KRadioGroup.vue.js +1 -1
- package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +17 -12
- package/dist/components/KRate.vue.d.ts +25 -0
- package/dist/components/KRate.vue.js +7 -0
- package/dist/components/KRate.vue_vue_type_script_setup_true_lang.js +77 -0
- package/dist/components/KSpace.vue.d.ts +32 -0
- package/dist/components/KSpace.vue.js +7 -0
- package/dist/components/KSpace.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/components/KStatistic.vue.d.ts +23 -0
- package/dist/components/KStatistic.vue.js +7 -0
- package/dist/components/KStatistic.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/components/KText.vue.d.ts +26 -0
- package/dist/components/KText.vue.js +7 -0
- package/dist/components/KText.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/components/KTime.vue.d.ts +14 -0
- package/dist/components/KTime.vue.js +7 -0
- package/dist/components/KTime.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/components/KTimePicker.vue.d.ts +19 -0
- package/dist/components/KTimePicker.vue.js +8 -0
- package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/components/KTimeline.vue.d.ts +13 -0
- package/dist/components/KTimeline.vue.js +7 -0
- package/dist/components/KTimeline.vue_vue_type_script_setup_true_lang.js +10 -0
- package/dist/components/KTimelineItem.vue.d.ts +29 -0
- package/dist/components/KTimelineItem.vue.js +7 -0
- package/dist/components/KTimelineItem.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/components/KTransfer.vue.d.ts +24 -0
- package/dist/components/KTransfer.vue.js +7 -0
- package/dist/components/KTransfer.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/components/KTreeSelect.vue.d.ts +22 -0
- package/dist/components/KTreeSelect.vue.js +8 -0
- package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/components/KTypography.vue.d.ts +13 -0
- package/dist/components/KTypography.vue.js +7 -0
- package/dist/components/KTypography.vue_vue_type_script_setup_true_lang.js +10 -0
- package/dist/components/KUpload.vue.d.ts +1 -1
- package/dist/components/KWatermark.vue.d.ts +27 -0
- package/dist/components/KWatermark.vue.js +7 -0
- package/dist/components/KWatermark.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/components/list-context.d.ts +6 -0
- package/dist/components/list-context.js +4 -0
- package/dist/components/menu-context.d.ts +26 -0
- package/dist/components/menu-context.js +4 -0
- package/dist/components/radio-context.d.ts +6 -0
- package/dist/components/radio-context.js +4 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +102 -64
- package/dist/k-ui.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface TransferOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
options: TransferOption[];
|
|
8
|
+
modelValue?: (string | number)[];
|
|
9
|
+
titles?: [string, string];
|
|
10
|
+
filterable?: boolean;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
|
+
"update:modelValue": (v: (string | number)[]) => any;
|
|
15
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
"onUpdate:modelValue"?: ((v: (string | number)[]) => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
modelValue: (string | number)[];
|
|
20
|
+
filterable: boolean;
|
|
21
|
+
titles: [string, string];
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KTransfer.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KTransfer.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-eb667962"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import e from "./KButton.vue.js";
|
|
2
|
+
import t from "./KCheckbox.vue.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createVNode as c, defineComponent as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, vModelText as g, withCtx as _, withDirectives as v } from "vue";
|
|
4
|
+
import { ChevronLeft as y, ChevronRight as b, Search as x } from "lucide-vue-next";
|
|
5
|
+
//#region components/KTransfer.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var S = { class: "k-transfer__panel" }, C = { class: "k-transfer__head" }, w = { class: "k-transfer__title" }, T = { class: "k-transfer__count" }, E = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "k-transfer__search"
|
|
9
|
+
}, D = { class: "k-transfer__list" }, O = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "k-transfer__empty"
|
|
12
|
+
}, k = { class: "k-transfer__ops" }, A = { class: "k-transfer__panel" }, j = { class: "k-transfer__head" }, M = { class: "k-transfer__title" }, N = { class: "k-transfer__count" }, P = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "k-transfer__search"
|
|
15
|
+
}, F = { class: "k-transfer__list" }, I = {
|
|
16
|
+
key: 0,
|
|
17
|
+
class: "k-transfer__empty"
|
|
18
|
+
}, L = /* @__PURE__ */ l({
|
|
19
|
+
__name: "KTransfer",
|
|
20
|
+
props: {
|
|
21
|
+
options: {},
|
|
22
|
+
modelValue: { default: () => [] },
|
|
23
|
+
titles: { default: () => ["源列表", "目标列表"] },
|
|
24
|
+
filterable: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: !1
|
|
27
|
+
},
|
|
28
|
+
disabled: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
emits: ["update:modelValue"],
|
|
34
|
+
setup(l, { emit: L }) {
|
|
35
|
+
let R = l, z = L, B = f(/* @__PURE__ */ new Set()), V = f(/* @__PURE__ */ new Set()), H = f(""), U = f(""), W = r(() => new Set(R.modelValue));
|
|
36
|
+
function G(e, t) {
|
|
37
|
+
return !t || e.label.toLowerCase().includes(t.toLowerCase());
|
|
38
|
+
}
|
|
39
|
+
let K = r(() => R.options.filter((e) => !W.value.has(e.value) && G(e, H.value))), q = r(() => R.options.filter((e) => W.value.has(e.value) && G(e, U.value)));
|
|
40
|
+
function J(e, t) {
|
|
41
|
+
let n = e === "l" ? B : V, r = new Set(n.value);
|
|
42
|
+
r.has(t) ? r.delete(t) : r.add(t), n.value = r;
|
|
43
|
+
}
|
|
44
|
+
function Y() {
|
|
45
|
+
R.disabled || (z("update:modelValue", [...R.modelValue, ...B.value]), B.value = /* @__PURE__ */ new Set());
|
|
46
|
+
}
|
|
47
|
+
function X() {
|
|
48
|
+
if (R.disabled) return;
|
|
49
|
+
let e = V.value;
|
|
50
|
+
z("update:modelValue", R.modelValue.filter((t) => !e.has(t))), V.value = /* @__PURE__ */ new Set();
|
|
51
|
+
}
|
|
52
|
+
return (r, f) => (d(), o("div", { class: u(["k-transfer", { "k-transfer--disabled": l.disabled }]) }, [
|
|
53
|
+
s("div", S, [
|
|
54
|
+
s("div", C, [s("span", w, m(l.titles[0]), 1), s("span", T, m(K.value.length), 1)]),
|
|
55
|
+
l.filterable ? (d(), o("div", E, [c(h(x), { size: 14 }), v(s("input", {
|
|
56
|
+
"onUpdate:modelValue": f[0] ||= (e) => H.value = e,
|
|
57
|
+
placeholder: "搜索"
|
|
58
|
+
}, null, 512), [[g, H.value]])])) : a("", !0),
|
|
59
|
+
s("div", D, [(d(!0), o(n, null, p(K.value, (e) => (d(), i(t, {
|
|
60
|
+
key: e.value,
|
|
61
|
+
class: "k-transfer__row",
|
|
62
|
+
"model-value": B.value.has(e.value),
|
|
63
|
+
disabled: e.disabled || l.disabled,
|
|
64
|
+
label: e.label,
|
|
65
|
+
"onUpdate:modelValue": (t) => J("l", e.value)
|
|
66
|
+
}, null, 8, [
|
|
67
|
+
"model-value",
|
|
68
|
+
"disabled",
|
|
69
|
+
"label",
|
|
70
|
+
"onUpdate:modelValue"
|
|
71
|
+
]))), 128)), K.value.length ? a("", !0) : (d(), o("p", O, "无数据"))])
|
|
72
|
+
]),
|
|
73
|
+
s("div", k, [c(e, {
|
|
74
|
+
size: "sm",
|
|
75
|
+
circle: "",
|
|
76
|
+
disabled: !B.value.size || l.disabled,
|
|
77
|
+
onClick: Y
|
|
78
|
+
}, {
|
|
79
|
+
icon: _(() => [c(h(b), { size: 16 })]),
|
|
80
|
+
_: 1
|
|
81
|
+
}, 8, ["disabled"]), c(e, {
|
|
82
|
+
size: "sm",
|
|
83
|
+
circle: "",
|
|
84
|
+
disabled: !V.value.size || l.disabled,
|
|
85
|
+
onClick: X
|
|
86
|
+
}, {
|
|
87
|
+
icon: _(() => [c(h(y), { size: 16 })]),
|
|
88
|
+
_: 1
|
|
89
|
+
}, 8, ["disabled"])]),
|
|
90
|
+
s("div", A, [
|
|
91
|
+
s("div", j, [s("span", M, m(l.titles[1]), 1), s("span", N, m(q.value.length), 1)]),
|
|
92
|
+
l.filterable ? (d(), o("div", P, [c(h(x), { size: 14 }), v(s("input", {
|
|
93
|
+
"onUpdate:modelValue": f[1] ||= (e) => U.value = e,
|
|
94
|
+
placeholder: "搜索"
|
|
95
|
+
}, null, 512), [[g, U.value]])])) : a("", !0),
|
|
96
|
+
s("div", F, [(d(!0), o(n, null, p(q.value, (e) => (d(), i(t, {
|
|
97
|
+
key: e.value,
|
|
98
|
+
class: "k-transfer__row",
|
|
99
|
+
"model-value": V.value.has(e.value),
|
|
100
|
+
disabled: e.disabled || l.disabled,
|
|
101
|
+
label: e.label,
|
|
102
|
+
"onUpdate:modelValue": (t) => J("r", e.value)
|
|
103
|
+
}, null, 8, [
|
|
104
|
+
"model-value",
|
|
105
|
+
"disabled",
|
|
106
|
+
"label",
|
|
107
|
+
"onUpdate:modelValue"
|
|
108
|
+
]))), 128)), q.value.length ? a("", !0) : (d(), o("p", I, "无数据"))])
|
|
109
|
+
])
|
|
110
|
+
], 2));
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
//#endregion
|
|
114
|
+
export { L as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TreeNode } from './tree-context';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue?: string | number | null;
|
|
4
|
+
nodes: TreeNode[];
|
|
5
|
+
placeholder?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
clearable?: boolean;
|
|
8
|
+
/** 仅叶子节点可选(父节点点击只展开) */
|
|
9
|
+
leafOnly?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
|
+
"update:modelValue": (v: string | number | null) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((v: string | number | null) => any) | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
placeholder: string;
|
|
18
|
+
clearable: boolean;
|
|
19
|
+
leafOnly: boolean;
|
|
20
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KTreeSelect.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
|
+
//#region components/KTreeSelect.vue
|
|
6
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-73115ed6"]]);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as default };
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import e from "./KTreeView.vue.js";
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
|
|
3
|
+
import { ChevronDown as p, X as m } from "lucide-vue-next";
|
|
4
|
+
import { PopoverContent as h, PopoverPortal as g, PopoverRoot as _, PopoverTrigger as v } from "reka-ui";
|
|
5
|
+
//#region components/KTreeSelect.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var y = ["disabled"], b = { class: "k-tsel-field__text" }, x = /* @__PURE__ */ o({
|
|
7
|
+
__name: "KTreeSelect",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: {},
|
|
10
|
+
nodes: {},
|
|
11
|
+
placeholder: { default: "请选择" },
|
|
12
|
+
disabled: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
},
|
|
16
|
+
clearable: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !0
|
|
19
|
+
},
|
|
20
|
+
leafOnly: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !0
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
emits: ["update:modelValue"],
|
|
26
|
+
setup(o, { emit: x }) {
|
|
27
|
+
let S = o, C = x, w = l(!1), T = l([]);
|
|
28
|
+
function E(e, t) {
|
|
29
|
+
for (let n of e) {
|
|
30
|
+
if (n.id === t) return n.label;
|
|
31
|
+
if (n.children) {
|
|
32
|
+
let e = E(n.children, t);
|
|
33
|
+
if (e) return e;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
let D = t(() => S.modelValue == null ? "" : E(S.nodes, S.modelValue) ?? "");
|
|
39
|
+
function O(e) {
|
|
40
|
+
S.leafOnly && e.children?.length || (C("update:modelValue", e.id), w.value = !1);
|
|
41
|
+
}
|
|
42
|
+
function k(e) {
|
|
43
|
+
e.stopPropagation(), C("update:modelValue", null);
|
|
44
|
+
}
|
|
45
|
+
return (t, l) => (c(), n(d(_), {
|
|
46
|
+
open: w.value,
|
|
47
|
+
"onUpdate:open": l[1] ||= (e) => w.value = e
|
|
48
|
+
}, {
|
|
49
|
+
default: f(() => [a(d(v), {
|
|
50
|
+
"as-child": "",
|
|
51
|
+
disabled: o.disabled
|
|
52
|
+
}, {
|
|
53
|
+
default: f(() => [i("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
class: s(["k-tsel-field", {
|
|
56
|
+
"k-tsel-field--disabled": o.disabled,
|
|
57
|
+
"k-tsel-field--placeholder": !D.value
|
|
58
|
+
}]),
|
|
59
|
+
disabled: o.disabled
|
|
60
|
+
}, [
|
|
61
|
+
i("span", b, u(D.value || o.placeholder), 1),
|
|
62
|
+
o.clearable && D.value && !o.disabled ? (c(), n(d(m), {
|
|
63
|
+
key: 0,
|
|
64
|
+
size: 14,
|
|
65
|
+
class: "k-tsel-field__clear",
|
|
66
|
+
onClick: k
|
|
67
|
+
})) : r("", !0),
|
|
68
|
+
a(d(p), {
|
|
69
|
+
size: 15,
|
|
70
|
+
class: "k-tsel-field__arrow"
|
|
71
|
+
})
|
|
72
|
+
], 10, y)]),
|
|
73
|
+
_: 1
|
|
74
|
+
}, 8, ["disabled"]), a(d(g), null, {
|
|
75
|
+
default: f(() => [a(d(h), {
|
|
76
|
+
class: "k-menu-surface k-tsel-panel",
|
|
77
|
+
"side-offset": 6,
|
|
78
|
+
align: "start"
|
|
79
|
+
}, {
|
|
80
|
+
default: f(() => [a(e, {
|
|
81
|
+
nodes: o.nodes,
|
|
82
|
+
selected: o.modelValue ?? null,
|
|
83
|
+
expanded: T.value,
|
|
84
|
+
"onUpdate:expanded": l[0] ||= (e) => T.value = e,
|
|
85
|
+
onNodeClick: O
|
|
86
|
+
}, null, 8, [
|
|
87
|
+
"nodes",
|
|
88
|
+
"selected",
|
|
89
|
+
"expanded"
|
|
90
|
+
])]),
|
|
91
|
+
_: 1
|
|
92
|
+
})]),
|
|
93
|
+
_: 1
|
|
94
|
+
})]),
|
|
95
|
+
_: 1
|
|
96
|
+
}, 8, ["open"]));
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
//#endregion
|
|
100
|
+
export { x as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare var __VLS_1: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
default?: (props: typeof __VLS_1) => any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
9
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
10
|
+
new (): {
|
|
11
|
+
$slots: S;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KTypography.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KTypography.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-10183554"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createElementBlock as e, defineComponent as t, openBlock as n, renderSlot as r } from "vue";
|
|
2
|
+
//#region components/KTypography.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var i = { class: "k-typography" }, a = /* @__PURE__ */ t({
|
|
4
|
+
__name: "KTypography",
|
|
5
|
+
setup(t) {
|
|
6
|
+
return (t, a) => (n(), e("div", i, [r(t.$slots, "default", {}, void 0, !0)]));
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { a as default };
|
|
@@ -160,10 +160,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
160
160
|
}>, {
|
|
161
161
|
disabled: boolean;
|
|
162
162
|
multiple: boolean;
|
|
163
|
+
showList: boolean;
|
|
163
164
|
drag: boolean;
|
|
164
165
|
autoUpload: boolean;
|
|
165
166
|
defaultUpload: boolean;
|
|
166
|
-
showList: boolean;
|
|
167
167
|
showFileList: boolean;
|
|
168
168
|
buttonText: string;
|
|
169
169
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
content?: string;
|
|
3
|
+
fontSize?: number;
|
|
4
|
+
color?: string;
|
|
5
|
+
rotate?: number;
|
|
6
|
+
/** 单个水印的横纵间距 [x, y] */
|
|
7
|
+
gap?: [number, number];
|
|
8
|
+
};
|
|
9
|
+
declare var __VLS_1: {};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
default?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
14
|
+
color: string;
|
|
15
|
+
rotate: number;
|
|
16
|
+
fontSize: number;
|
|
17
|
+
gap: [number, number];
|
|
18
|
+
content: string;
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KWatermark.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KWatermark.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-534968f5"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { computed as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeStyle as i, openBlock as a, renderSlot as o } from "vue";
|
|
2
|
+
//#region components/KWatermark.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var s = { class: "k-watermark" }, c = /* @__PURE__ */ r({
|
|
4
|
+
__name: "KWatermark",
|
|
5
|
+
props: {
|
|
6
|
+
content: { default: "k-ui" },
|
|
7
|
+
fontSize: { default: 15 },
|
|
8
|
+
color: { default: "rgba(0,0,0,0.08)" },
|
|
9
|
+
rotate: { default: -22 },
|
|
10
|
+
gap: { default: () => [120, 80] }
|
|
11
|
+
},
|
|
12
|
+
setup(r) {
|
|
13
|
+
let c = r, l = e(() => {
|
|
14
|
+
if (typeof document > "u") return "";
|
|
15
|
+
let [e, t] = c.gap, n = document.createElement("canvas"), r = n.getContext("2d");
|
|
16
|
+
if (!r) return "";
|
|
17
|
+
r.font = `${c.fontSize}px sans-serif`;
|
|
18
|
+
let i = Math.ceil(r.measureText(c.content).width) + e, a = c.fontSize + t;
|
|
19
|
+
return n.width = i, n.height = a, r.font = `${c.fontSize}px sans-serif`, r.fillStyle = c.color, r.textAlign = "center", r.textBaseline = "middle", r.translate(i / 2, a / 2), r.rotate(c.rotate * Math.PI / 180), r.fillText(c.content, 0, 0), n.toDataURL();
|
|
20
|
+
});
|
|
21
|
+
return (e, r) => (a(), t("div", s, [o(e.$slots, "default", {}, void 0, !0), n("div", {
|
|
22
|
+
class: "k-watermark__layer",
|
|
23
|
+
style: i({ backgroundImage: l.value ? `url(${l.value})` : void 0 })
|
|
24
|
+
}, null, 4)]));
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { c as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Component, InjectionKey, VNodeChild } from 'vue';
|
|
2
|
+
export interface MenuOption {
|
|
3
|
+
/** 唯一标识,select 事件回传、active 比对都用它 */
|
|
4
|
+
key: string;
|
|
5
|
+
/** 文本,或返回 VNode 的渲染函数(如塞入自定义内容)。
|
|
6
|
+
* 推荐用纯字符串 + 监听 @select 做导航,保持路由无关。 */
|
|
7
|
+
label?: string | (() => VNodeChild);
|
|
8
|
+
/** lucide 图标组件,或返回 VNode 的渲染函数 */
|
|
9
|
+
icon?: Component | (() => VNodeChild);
|
|
10
|
+
/** 子菜单 */
|
|
11
|
+
children?: MenuOption[];
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** 渲染为分隔线,其余字段忽略 */
|
|
14
|
+
type?: 'divider';
|
|
15
|
+
}
|
|
16
|
+
/** KMenu 通过 provide 下发给 KMenuItem 的上下文 */
|
|
17
|
+
export interface MenuContext {
|
|
18
|
+
isActive: (key: string) => boolean;
|
|
19
|
+
inActiveTrail: (key: string) => boolean;
|
|
20
|
+
isExpanded: (key: string) => boolean;
|
|
21
|
+
toggle: (key: string) => void;
|
|
22
|
+
select: (option: MenuOption) => void;
|
|
23
|
+
indent: number;
|
|
24
|
+
rootIndent: number;
|
|
25
|
+
}
|
|
26
|
+
export declare const MENU_KEY: InjectionKey<MenuContext>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as KConfigProvider } from './components/KConfigProvider.vue';
|
|
2
2
|
export type { GlobalThemeOverrides } from './components/KConfigProvider.vue';
|
|
3
3
|
export { default as KButton } from './components/KButton.vue';
|
|
4
|
+
export { default as KButtonGroup } from './components/KButtonGroup.vue';
|
|
4
5
|
export { default as KInput } from './components/KInput.vue';
|
|
5
6
|
export { default as KTextarea } from './components/KTextarea.vue';
|
|
6
7
|
export { default as KInputNumber } from './components/KInputNumber.vue';
|
|
@@ -9,9 +10,19 @@ export { default as KTag } from './components/KTag.vue';
|
|
|
9
10
|
export { default as KIcon } from './components/KIcon.vue';
|
|
10
11
|
export { default as KSlider } from './components/KSlider.vue';
|
|
11
12
|
export { default as KColorPicker } from './components/KColorPicker.vue';
|
|
13
|
+
export { default as KText } from './components/KText.vue';
|
|
14
|
+
export { default as KTime } from './components/KTime.vue';
|
|
15
|
+
export { default as KSpace } from './components/KSpace.vue';
|
|
12
16
|
export { default as KSelect } from './components/KSelect.vue';
|
|
13
17
|
export { default as KCombobox } from './components/KCombobox.vue';
|
|
14
18
|
export { default as KDatePicker } from './components/KDatePicker.vue';
|
|
19
|
+
export { default as KTimePicker } from './components/KTimePicker.vue';
|
|
20
|
+
export { default as KCascader } from './components/KCascader.vue';
|
|
21
|
+
export type { CascaderOption } from './components/KCascader.vue';
|
|
22
|
+
export { default as KAutoComplete } from './components/KAutoComplete.vue';
|
|
23
|
+
export { default as KTreeSelect } from './components/KTreeSelect.vue';
|
|
24
|
+
export { default as KMention } from './components/KMention.vue';
|
|
25
|
+
export type { MentionOption } from './components/KMention.vue';
|
|
15
26
|
export { default as KSwitch } from './components/KSwitch.vue';
|
|
16
27
|
export { default as KCheckbox } from './components/KCheckbox.vue';
|
|
17
28
|
export { default as KCheckboxGroup } from './components/KCheckboxGroup.vue';
|
|
@@ -20,6 +31,11 @@ export { default as KRadioGroup } from './components/KRadioGroup.vue';
|
|
|
20
31
|
export { default as KForm } from './components/KForm.vue';
|
|
21
32
|
export { default as KFormField } from './components/KFormField.vue';
|
|
22
33
|
export type { FormRule, FormRules, FormFieldRef } from './components/form-context';
|
|
34
|
+
export { default as KRate } from './components/KRate.vue';
|
|
35
|
+
export { default as KDynamicTags } from './components/KDynamicTags.vue';
|
|
36
|
+
export { default as KDynamicInput } from './components/KDynamicInput.vue';
|
|
37
|
+
export { default as KTransfer } from './components/KTransfer.vue';
|
|
38
|
+
export type { TransferOption } from './components/KTransfer.vue';
|
|
23
39
|
export { default as KConfirmDialog } from './components/KConfirmDialog.vue';
|
|
24
40
|
export { default as KDialog } from './components/KDialog.vue';
|
|
25
41
|
export { default as KDrawer } from './components/KDrawer.vue';
|
|
@@ -36,6 +52,16 @@ export type { NotificationOptions, NotificationReactive } from './components/KNo
|
|
|
36
52
|
export { default as KNotificationProvider } from './components/KNotificationProvider.vue';
|
|
37
53
|
export { useConfirm } from './composables/useConfirm';
|
|
38
54
|
export type { ConfirmOptions } from './composables/useConfirm';
|
|
55
|
+
export { default as KBadge } from './components/KBadge.vue';
|
|
56
|
+
export { default as KStatistic } from './components/KStatistic.vue';
|
|
57
|
+
export { default as KCollapse } from './components/KCollapse.vue';
|
|
58
|
+
export { default as KCollapseItem } from './components/KCollapseItem.vue';
|
|
59
|
+
export { default as KTimeline } from './components/KTimeline.vue';
|
|
60
|
+
export { default as KTimelineItem } from './components/KTimelineItem.vue';
|
|
61
|
+
export { default as KList } from './components/KList.vue';
|
|
62
|
+
export { default as KListItem } from './components/KListItem.vue';
|
|
63
|
+
export { default as KCalendar } from './components/KCalendar.vue';
|
|
64
|
+
export { default as KCode } from './components/KCode.vue';
|
|
39
65
|
export { default as KDataTable } from './components/KDataTable.vue';
|
|
40
66
|
export type { Column, DataTableColumn, DataTableColumns } from './components/KDataTable.vue';
|
|
41
67
|
export { default as KPagination } from './components/KPagination.vue';
|
|
@@ -49,14 +75,24 @@ export { default as KAvatarGroup } from './components/KAvatarGroup.vue';
|
|
|
49
75
|
export { default as KSkeleton } from './components/KSkeleton.vue';
|
|
50
76
|
export { default as KListSkeleton } from './components/KListSkeleton.vue';
|
|
51
77
|
export { default as KGridSkeleton } from './components/KGridSkeleton.vue';
|
|
78
|
+
export { default as KLayout } from './components/KLayout.vue';
|
|
79
|
+
export { default as KLayoutHeader } from './components/KLayoutHeader.vue';
|
|
80
|
+
export { default as KLayoutContent } from './components/KLayoutContent.vue';
|
|
81
|
+
export { default as KLayoutSider } from './components/KLayoutSider.vue';
|
|
82
|
+
export { default as KDivider } from './components/KDivider.vue';
|
|
83
|
+
export { default as KGrid } from './components/KGrid.vue';
|
|
84
|
+
export { default as KGridItem } from './components/KGridItem.vue';
|
|
52
85
|
export { default as KTabs } from './components/KTabs.vue';
|
|
53
86
|
export { default as KBreadcrumb } from './components/KBreadcrumb.vue';
|
|
87
|
+
export { default as KMenu } from './components/KMenu.vue';
|
|
88
|
+
export type { MenuOption } from './components/menu-context';
|
|
54
89
|
export { default as KCard } from './components/KCard.vue';
|
|
55
90
|
export { default as KDescriptions } from './components/KDescriptions.vue';
|
|
56
91
|
export { default as KDescriptionsItem } from './components/KDescriptionsItem.vue';
|
|
57
92
|
export type { DescriptionItem } from './components/KDescriptions.vue';
|
|
58
93
|
export { default as KResult } from './components/KResult.vue';
|
|
59
94
|
export { default as KSteps } from './components/KSteps.vue';
|
|
95
|
+
export { default as KTypography } from './components/KTypography.vue';
|
|
60
96
|
export { default as KImage } from './components/KImage.vue';
|
|
61
97
|
export { default as KImageViewer } from './components/KImageViewer.vue';
|
|
62
98
|
export { default as KCarousel } from './components/KCarousel.vue';
|
|
@@ -71,6 +107,13 @@ export { default as KResizablePanel } from './components/KResizablePanel.vue';
|
|
|
71
107
|
export { default as KTreeView } from './components/KTreeView.vue';
|
|
72
108
|
export type { TreeNode } from './components/tree-context';
|
|
73
109
|
export { default as KDiff } from './components/KDiff.vue';
|
|
110
|
+
export { default as KBackTop } from './components/KBackTop.vue';
|
|
111
|
+
export { default as KAffix } from './components/KAffix.vue';
|
|
112
|
+
export { default as KAnchor } from './components/KAnchor.vue';
|
|
113
|
+
export type { AnchorItem } from './components/KAnchor.vue';
|
|
114
|
+
export { default as KWatermark } from './components/KWatermark.vue';
|
|
115
|
+
export { default as KNumberAnimation } from './components/KNumberAnimation.vue';
|
|
116
|
+
export { default as KCountdown } from './components/KCountdown.vue';
|
|
74
117
|
export { default as KThemeToggleButton } from './components/KThemeToggleButton.vue';
|
|
75
118
|
export type { ThemeMode } from './types';
|
|
76
119
|
export { installDirectives, vReveal, vSpotlight } from './directives';
|