@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
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
import { computed as e,
|
|
2
|
-
import { ChevronDown as
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, onBeforeUnmount as s, openBlock as c, renderSlot as l, unref as u, withModifiers as d } from "vue";
|
|
2
|
+
import { ChevronDown as f, ChevronUp as p } from "lucide-vue-next";
|
|
3
3
|
//#region components/KInputNumber.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var m = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "k-num__affix k-num__affix--prefix"
|
|
7
|
+
}, h = [
|
|
5
8
|
"value",
|
|
6
9
|
"disabled",
|
|
7
10
|
"readonly",
|
|
8
11
|
"placeholder"
|
|
9
|
-
],
|
|
12
|
+
], g = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "k-num__affix k-num__affix--suffix"
|
|
15
|
+
}, _ = {
|
|
16
|
+
key: 2,
|
|
17
|
+
class: "k-num__steps"
|
|
18
|
+
}, v = ["disabled"], y = ["disabled"], b = /* @__PURE__ */ a({
|
|
10
19
|
__name: "KInputNumber",
|
|
11
20
|
props: {
|
|
12
21
|
modelValue: { default: null },
|
|
@@ -27,83 +36,92 @@ var f = [
|
|
|
27
36
|
error: {
|
|
28
37
|
type: Boolean,
|
|
29
38
|
default: !1
|
|
39
|
+
},
|
|
40
|
+
showButton: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !0
|
|
30
43
|
}
|
|
31
44
|
},
|
|
32
45
|
emits: ["update:modelValue", "change"],
|
|
33
|
-
setup(
|
|
34
|
-
let
|
|
35
|
-
function
|
|
36
|
-
if (
|
|
37
|
-
let t = 10 **
|
|
46
|
+
setup(a, { emit: b }) {
|
|
47
|
+
let x = a, S = b;
|
|
48
|
+
function C(e) {
|
|
49
|
+
if (x.min !== void 0 && e < x.min && (e = x.min), x.max !== void 0 && e > x.max && (e = x.max), x.precision !== void 0) {
|
|
50
|
+
let t = 10 ** x.precision;
|
|
38
51
|
e = Math.round(e * t) / t;
|
|
39
52
|
}
|
|
40
53
|
return e;
|
|
41
54
|
}
|
|
42
|
-
let
|
|
43
|
-
function
|
|
44
|
-
let t =
|
|
45
|
-
|
|
55
|
+
let w = e(() => x.disabled || x.readonly || x.max !== void 0 && (x.modelValue ?? 0) >= x.max), T = e(() => x.disabled || x.readonly || x.min !== void 0 && (x.modelValue ?? 0) <= x.min);
|
|
56
|
+
function E(e) {
|
|
57
|
+
let t = C((x.modelValue ?? x.min ?? 0) + e * x.step);
|
|
58
|
+
S("update:modelValue", t), S("change", t);
|
|
46
59
|
}
|
|
47
|
-
let
|
|
48
|
-
function
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
let D = null, O = null;
|
|
61
|
+
function k(e) {
|
|
62
|
+
x.disabled || x.readonly || (E(e), D = window.setTimeout(() => {
|
|
63
|
+
O = window.setInterval(() => E(e), 60);
|
|
51
64
|
}, 400));
|
|
52
65
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
66
|
+
function A() {
|
|
67
|
+
D &&= (clearTimeout(D), null), O &&= (clearInterval(O), null);
|
|
55
68
|
}
|
|
56
|
-
|
|
57
|
-
function
|
|
69
|
+
s(A);
|
|
70
|
+
function j(e) {
|
|
58
71
|
let t = e.target.value;
|
|
59
72
|
if (t === "" || t === "-") {
|
|
60
|
-
|
|
73
|
+
S("update:modelValue", null);
|
|
61
74
|
return;
|
|
62
75
|
}
|
|
63
76
|
let n = Number(t);
|
|
64
|
-
Number.isNaN(n) ||
|
|
77
|
+
Number.isNaN(n) || S("update:modelValue", n);
|
|
65
78
|
}
|
|
66
|
-
function
|
|
67
|
-
if (
|
|
68
|
-
let e =
|
|
69
|
-
e !==
|
|
79
|
+
function M() {
|
|
80
|
+
if (x.modelValue === null || x.modelValue === void 0) return;
|
|
81
|
+
let e = C(x.modelValue);
|
|
82
|
+
e !== x.modelValue && (S("update:modelValue", e), S("change", e));
|
|
70
83
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
84
|
+
function N(e) {
|
|
85
|
+
x.disabled || x.readonly || (e.key === "ArrowUp" ? (e.preventDefault(), E(1)) : e.key === "ArrowDown" && (e.preventDefault(), E(-1)));
|
|
73
86
|
}
|
|
74
|
-
let
|
|
75
|
-
return (e,
|
|
76
|
-
"k-num--error":
|
|
77
|
-
"k-num--disabled":
|
|
78
|
-
}]]) }, [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
87
|
+
let P = e(() => x.modelValue === null || x.modelValue === void 0 ? "" : String(x.modelValue)), F = e(() => x.size === "tiny" || x.size === "xs" || x.size === "small" || x.size === "sm" ? "sm" : x.size === "large" || x.size === "lg" ? "lg" : "md");
|
|
88
|
+
return (e, s) => (c(), n("div", { class: o(["k-num", [`k-num--${F.value}`, {
|
|
89
|
+
"k-num--error": a.error,
|
|
90
|
+
"k-num--disabled": a.disabled
|
|
91
|
+
}]]) }, [
|
|
92
|
+
e.$slots.prefix ? (c(), n("span", m, [l(e.$slots, "prefix", {}, void 0, !0)])) : t("", !0),
|
|
93
|
+
r("input", {
|
|
94
|
+
type: "text",
|
|
95
|
+
inputmode: "decimal",
|
|
96
|
+
value: P.value,
|
|
97
|
+
disabled: a.disabled,
|
|
98
|
+
readonly: a.readonly,
|
|
99
|
+
placeholder: a.placeholder,
|
|
100
|
+
class: "k-num__inner",
|
|
101
|
+
onInput: j,
|
|
102
|
+
onBlur: M,
|
|
103
|
+
onKeydown: N
|
|
104
|
+
}, null, 40, h),
|
|
105
|
+
e.$slots.suffix ? (c(), n("span", g, [l(e.$slots, "suffix", {}, void 0, !0)])) : t("", !0),
|
|
106
|
+
a.showButton ? (c(), n("div", _, [r("button", {
|
|
107
|
+
type: "button",
|
|
108
|
+
tabindex: "-1",
|
|
109
|
+
class: "k-num__step k-num__step--up",
|
|
110
|
+
disabled: w.value,
|
|
111
|
+
onMousedown: s[0] ||= d((e) => k(1), ["prevent"]),
|
|
112
|
+
onMouseup: A,
|
|
113
|
+
onMouseleave: A
|
|
114
|
+
}, [i(u(p), { size: 11 })], 40, v), r("button", {
|
|
115
|
+
type: "button",
|
|
116
|
+
tabindex: "-1",
|
|
117
|
+
class: "k-num__step k-num__step--down",
|
|
118
|
+
disabled: T.value,
|
|
119
|
+
onMousedown: s[1] ||= d((e) => k(-1), ["prevent"]),
|
|
120
|
+
onMouseup: A,
|
|
121
|
+
onMouseleave: A
|
|
122
|
+
}, [i(u(f), { size: 11 })], 40, y)])) : t("", !0)
|
|
123
|
+
], 2));
|
|
106
124
|
}
|
|
107
125
|
});
|
|
108
126
|
//#endregion
|
|
109
|
-
export {
|
|
127
|
+
export { b as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KLoadingOverlay.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KLoadingOverlay.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-0199872e"]]);
|
|
6
6
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KMessageContainer.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KMessageContainer.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-44613943"]]);
|
|
6
6
|
//#endregion
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type VNodeChild } from 'vue';
|
|
2
|
+
export interface NotificationOptions {
|
|
3
|
+
type?: 'success' | 'error' | 'info' | 'warning';
|
|
4
|
+
title?: string | (() => VNodeChild);
|
|
5
|
+
content?: string | (() => VNodeChild);
|
|
6
|
+
duration?: number;
|
|
7
|
+
closable?: boolean;
|
|
8
|
+
avatar?: () => VNodeChild;
|
|
9
|
+
action?: () => VNodeChild;
|
|
10
|
+
}
|
|
11
|
+
export interface NotificationReactive {
|
|
12
|
+
destroy: () => void;
|
|
13
|
+
}
|
|
14
|
+
declare function create(options: NotificationOptions): NotificationReactive;
|
|
15
|
+
declare function close(id: number): void;
|
|
16
|
+
declare function closeAll(): void;
|
|
17
|
+
type ShortHand = (options: Omit<NotificationOptions, 'type'> | string) => NotificationReactive;
|
|
18
|
+
export declare const KNotification: {
|
|
19
|
+
create: typeof create;
|
|
20
|
+
close: typeof close;
|
|
21
|
+
closeAll: typeof closeAll;
|
|
22
|
+
success: ShortHand;
|
|
23
|
+
error: ShortHand;
|
|
24
|
+
warning: ShortHand;
|
|
25
|
+
info: ShortHand;
|
|
26
|
+
};
|
|
27
|
+
export declare function useNotification(): {
|
|
28
|
+
create: typeof create;
|
|
29
|
+
close: typeof close;
|
|
30
|
+
closeAll: typeof closeAll;
|
|
31
|
+
success: ShortHand;
|
|
32
|
+
error: ShortHand;
|
|
33
|
+
warning: ShortHand;
|
|
34
|
+
info: ShortHand;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import e from "./KNotificationContainer.vue.js";
|
|
2
|
+
import { createApp as t, h as n, ref as r } from "vue";
|
|
3
|
+
//#region components/KNotification.ts
|
|
4
|
+
var i = null, a = null, o = null, s = 0;
|
|
5
|
+
function c() {
|
|
6
|
+
i || (o = document.createElement("div"), document.body.appendChild(o), a = r([]), i = t({ setup() {
|
|
7
|
+
return () => n(e, {
|
|
8
|
+
notifications: a.value,
|
|
9
|
+
onRemove: u
|
|
10
|
+
});
|
|
11
|
+
} }), i.mount(o));
|
|
12
|
+
}
|
|
13
|
+
function l(e) {
|
|
14
|
+
c();
|
|
15
|
+
let t = ++s, n = e.duration ?? 4500;
|
|
16
|
+
return a.value = [...a.value, {
|
|
17
|
+
id: t,
|
|
18
|
+
...e
|
|
19
|
+
}], n > 0 && setTimeout(() => u(t), n), { destroy: () => u(t) };
|
|
20
|
+
}
|
|
21
|
+
function u(e) {
|
|
22
|
+
a && (a.value = a.value.filter((t) => t.id !== e));
|
|
23
|
+
}
|
|
24
|
+
function d() {
|
|
25
|
+
a && (a.value = []);
|
|
26
|
+
}
|
|
27
|
+
function f(e) {
|
|
28
|
+
return typeof e == "string" ? { content: e } : e;
|
|
29
|
+
}
|
|
30
|
+
var p = {
|
|
31
|
+
create: l,
|
|
32
|
+
close: u,
|
|
33
|
+
closeAll: d,
|
|
34
|
+
success: ((e) => l({
|
|
35
|
+
...f(e),
|
|
36
|
+
type: "success"
|
|
37
|
+
})),
|
|
38
|
+
error: ((e) => l({
|
|
39
|
+
...f(e),
|
|
40
|
+
type: "error"
|
|
41
|
+
})),
|
|
42
|
+
warning: ((e) => l({
|
|
43
|
+
...f(e),
|
|
44
|
+
type: "warning"
|
|
45
|
+
})),
|
|
46
|
+
info: ((e) => l({
|
|
47
|
+
...f(e),
|
|
48
|
+
type: "info"
|
|
49
|
+
}))
|
|
50
|
+
};
|
|
51
|
+
function m() {
|
|
52
|
+
return p;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { p as KNotification, m as useNotification };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type VNodeChild } from 'vue';
|
|
2
|
+
export interface NotificationItem {
|
|
3
|
+
id: number;
|
|
4
|
+
type?: 'success' | 'error' | 'warning' | 'info';
|
|
5
|
+
title?: string | (() => VNodeChild);
|
|
6
|
+
content?: string | (() => VNodeChild);
|
|
7
|
+
avatar?: () => VNodeChild;
|
|
8
|
+
action?: () => VNodeChild;
|
|
9
|
+
closable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
type __VLS_Props = {
|
|
12
|
+
notifications: NotificationItem[];
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
15
|
+
remove: (id: number) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
17
|
+
onRemove?: ((id: number) => any) | undefined;
|
|
18
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KNotificationContainer.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KNotificationContainer.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c681409f"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Fragment as e, TransitionGroup as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, renderList as u, resolveDynamicComponent as d, unref as f, withCtx as p } from "vue";
|
|
2
|
+
import { AlertCircle as m, AlertTriangle as h, CheckCircle2 as g, Info as _, X as v } from "lucide-vue-next";
|
|
3
|
+
//#region components/KNotificationContainer.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var y = { class: "k-notif__avatar" }, b = { class: "k-notif__main" }, x = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "k-notif__title"
|
|
7
|
+
}, S = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "k-notif__content"
|
|
10
|
+
}, C = {
|
|
11
|
+
key: 2,
|
|
12
|
+
class: "k-notif__action"
|
|
13
|
+
}, w = ["onClick"], T = /* @__PURE__ */ s({
|
|
14
|
+
__name: "KNotificationContainer",
|
|
15
|
+
props: { notifications: {} },
|
|
16
|
+
emits: ["remove"],
|
|
17
|
+
setup(T) {
|
|
18
|
+
let E = {
|
|
19
|
+
success: g,
|
|
20
|
+
error: m,
|
|
21
|
+
warning: h,
|
|
22
|
+
info: _
|
|
23
|
+
}, D = s({
|
|
24
|
+
props: { value: { type: [String, Function] } },
|
|
25
|
+
setup(e) {
|
|
26
|
+
return () => typeof e.value == "function" ? e.value() : e.value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return (s, m) => (l(), n(t, {
|
|
30
|
+
name: "k-notif",
|
|
31
|
+
tag: "div",
|
|
32
|
+
class: "k-notif-container"
|
|
33
|
+
}, {
|
|
34
|
+
default: p(() => [(l(!0), i(e, null, u(T.notifications, (e) => (l(), i("article", {
|
|
35
|
+
key: e.id,
|
|
36
|
+
class: c(["k-notif", `k-notif--${e.type || "info"}`])
|
|
37
|
+
}, [
|
|
38
|
+
a("div", y, [e.avatar ? (l(), n(f(D), {
|
|
39
|
+
key: 0,
|
|
40
|
+
value: e.avatar
|
|
41
|
+
}, null, 8, ["value"])) : (l(), n(d(E[e.type || "info"]), {
|
|
42
|
+
key: 1,
|
|
43
|
+
size: 20
|
|
44
|
+
}))]),
|
|
45
|
+
a("div", b, [
|
|
46
|
+
e.title ? (l(), i("div", x, [o(f(D), { value: e.title }, null, 8, ["value"])])) : r("", !0),
|
|
47
|
+
e.content ? (l(), i("div", S, [o(f(D), { value: e.content }, null, 8, ["value"])])) : r("", !0),
|
|
48
|
+
e.action ? (l(), i("div", C, [o(f(D), { value: e.action }, null, 8, ["value"])])) : r("", !0)
|
|
49
|
+
]),
|
|
50
|
+
e.closable === !1 ? r("", !0) : (l(), i("button", {
|
|
51
|
+
key: 0,
|
|
52
|
+
type: "button",
|
|
53
|
+
class: "k-notif__close",
|
|
54
|
+
"aria-label": "关闭",
|
|
55
|
+
onClick: (t) => s.$emit("remove", e.id)
|
|
56
|
+
}, [o(f(v), { size: 14 })], 8, w))
|
|
57
|
+
], 2))), 128))]),
|
|
58
|
+
_: 1
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
export { T 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,10 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import { renderSlot as t } from "vue";
|
|
3
|
+
//#region components/KNotificationProvider.vue
|
|
4
|
+
var n = {};
|
|
5
|
+
function r(e, n) {
|
|
6
|
+
return t(e.$slots, "default");
|
|
7
|
+
}
|
|
8
|
+
var i = /* @__PURE__ */ e(n, [["render", r]]);
|
|
9
|
+
//#endregion
|
|
10
|
+
export { i as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KPagination.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KPagination.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-40bca1a3"]]);
|
|
6
6
|
//#endregion
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title?: string;
|
|
3
|
+
message?: string;
|
|
4
|
+
confirmText?: string;
|
|
5
|
+
cancelText?: string;
|
|
6
|
+
positiveText?: string;
|
|
7
|
+
negativeText?: string;
|
|
8
|
+
confirmType?: 'primary' | 'danger' | 'error' | 'warning';
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
11
|
+
align?: 'start' | 'center' | 'end';
|
|
12
|
+
};
|
|
13
|
+
declare var __VLS_8: {}, __VLS_10: {}, __VLS_18: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
trigger?: (props: typeof __VLS_8) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: typeof __VLS_10) => any;
|
|
18
|
+
} & {
|
|
19
|
+
content?: (props: typeof __VLS_18) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
22
|
+
confirm: () => any;
|
|
23
|
+
cancel: () => any;
|
|
24
|
+
positiveClick: () => any;
|
|
25
|
+
negativeClick: () => any;
|
|
26
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onConfirm?: (() => any) | undefined;
|
|
28
|
+
onCancel?: (() => any) | undefined;
|
|
29
|
+
onPositiveClick?: (() => any) | undefined;
|
|
30
|
+
onNegativeClick?: (() => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
side: "top" | "right" | "bottom" | "left";
|
|
34
|
+
align: "start" | "center" | "end";
|
|
35
|
+
confirmText: string;
|
|
36
|
+
cancelText: string;
|
|
37
|
+
confirmType: "primary" | "danger" | "error" | "warning";
|
|
38
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
42
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import e from "./KButton.vue.js";
|
|
2
|
+
import t from "./KPopover.vue.js";
|
|
3
|
+
import { createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, openBlock as l, ref as u, renderSlot as d, toDisplayString as f, unref as p, withCtx as m } from "vue";
|
|
4
|
+
import { AlertTriangle as h } from "lucide-vue-next";
|
|
5
|
+
//#region components/KPopconfirm.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var g = { class: "k-popconfirm__body" }, _ = { class: "k-popconfirm__text" }, v = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "k-popconfirm__title"
|
|
9
|
+
}, y = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "k-popconfirm__message"
|
|
12
|
+
}, b = { class: "k-popconfirm__actions" }, x = /* @__PURE__ */ c({
|
|
13
|
+
__name: "KPopconfirm",
|
|
14
|
+
props: {
|
|
15
|
+
title: {},
|
|
16
|
+
message: {},
|
|
17
|
+
confirmText: { default: "确定" },
|
|
18
|
+
cancelText: { default: "取消" },
|
|
19
|
+
positiveText: {},
|
|
20
|
+
negativeText: {},
|
|
21
|
+
confirmType: { default: "primary" },
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
side: { default: "top" },
|
|
27
|
+
align: { default: "center" }
|
|
28
|
+
},
|
|
29
|
+
emits: [
|
|
30
|
+
"confirm",
|
|
31
|
+
"cancel",
|
|
32
|
+
"positiveClick",
|
|
33
|
+
"negativeClick"
|
|
34
|
+
],
|
|
35
|
+
setup(c, { emit: x }) {
|
|
36
|
+
let S = x, C = u(!1);
|
|
37
|
+
function w() {
|
|
38
|
+
S("confirm"), S("positiveClick"), C.value = !1;
|
|
39
|
+
}
|
|
40
|
+
function T() {
|
|
41
|
+
S("cancel"), S("negativeClick"), C.value = !1;
|
|
42
|
+
}
|
|
43
|
+
return (u, x) => (l(), n(t, {
|
|
44
|
+
open: C.value,
|
|
45
|
+
"onUpdate:open": x[0] ||= (e) => C.value = e,
|
|
46
|
+
disabled: c.disabled,
|
|
47
|
+
side: c.side,
|
|
48
|
+
align: c.align,
|
|
49
|
+
"content-class": "k-popconfirm",
|
|
50
|
+
"show-arrow": ""
|
|
51
|
+
}, {
|
|
52
|
+
content: m(() => [a("div", g, [s(p(h), {
|
|
53
|
+
size: 16,
|
|
54
|
+
class: "k-popconfirm__icon"
|
|
55
|
+
}), a("div", _, [c.title ? (l(), i("p", v, f(c.title), 1)) : r("", !0), u.$slots.content || c.message ? (l(), i("div", y, [d(u.$slots, "content", {}, () => [o(f(c.message), 1)])])) : r("", !0)])]), a("div", b, [s(e, {
|
|
56
|
+
size: "sm",
|
|
57
|
+
type: "secondary",
|
|
58
|
+
onClick: T
|
|
59
|
+
}, {
|
|
60
|
+
default: m(() => [o(f(c.negativeText ?? c.cancelText), 1)]),
|
|
61
|
+
_: 1
|
|
62
|
+
}), s(e, {
|
|
63
|
+
size: "sm",
|
|
64
|
+
type: c.confirmType === "error" ? "danger" : c.confirmType,
|
|
65
|
+
onClick: w
|
|
66
|
+
}, {
|
|
67
|
+
default: m(() => [o(f(c.positiveText ?? c.confirmText), 1)]),
|
|
68
|
+
_: 1
|
|
69
|
+
}, 8, ["type"])])]),
|
|
70
|
+
default: m(() => [d(u.$slots, "trigger", {}, () => [d(u.$slots, "default")])]),
|
|
71
|
+
_: 3
|
|
72
|
+
}, 8, [
|
|
73
|
+
"open",
|
|
74
|
+
"disabled",
|
|
75
|
+
"side",
|
|
76
|
+
"align"
|
|
77
|
+
]));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//#endregion
|
|
81
|
+
export { x as default };
|
|
@@ -3,15 +3,16 @@ type __VLS_Props = {
|
|
|
3
3
|
max?: number;
|
|
4
4
|
type?: 'line' | 'circle';
|
|
5
5
|
size?: 'sm' | 'md' | 'lg';
|
|
6
|
-
color?: 'brand' | 'success' | 'warning' | 'error';
|
|
6
|
+
color?: 'brand' | 'success' | 'warning' | 'error' | string;
|
|
7
7
|
indeterminate?: boolean;
|
|
8
8
|
showText?: boolean;
|
|
9
9
|
strokeWidth?: number;
|
|
10
|
+
height?: number | string;
|
|
10
11
|
};
|
|
11
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
12
13
|
type: "line" | "circle";
|
|
13
14
|
size: "sm" | "md" | "lg";
|
|
14
|
-
color: "brand" | "success" | "warning" | "error";
|
|
15
|
+
color: "brand" | "success" | "warning" | "error" | string;
|
|
15
16
|
max: number;
|
|
16
17
|
value: number;
|
|
17
18
|
indeterminate: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KProgress.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KProgress.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-4cb63d6e"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|