@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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
modelValue?: string;
|
|
3
|
+
/** naive-ui alias for v-model:value */
|
|
4
|
+
value?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
showInput?: boolean;
|
|
7
|
+
/** accepted for migration; native color input is opaque hex-only */
|
|
8
|
+
showAlpha?: boolean;
|
|
9
|
+
size?: 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
10
|
+
presets?: string[];
|
|
11
|
+
};
|
|
12
|
+
declare function openPicker(): void;
|
|
13
|
+
declare var __VLS_1: {
|
|
14
|
+
value: string;
|
|
15
|
+
onClick: typeof openPicker;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_Slots = {} & {
|
|
18
|
+
trigger?: (props: typeof __VLS_1) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
21
|
+
"update:modelValue": (v: string) => any;
|
|
22
|
+
"update:value": (v: string) => any;
|
|
23
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
+
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
25
|
+
"onUpdate:value"?: ((v: string) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
size: "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
28
|
+
disabled: boolean;
|
|
29
|
+
showInput: boolean;
|
|
30
|
+
showAlpha: boolean;
|
|
31
|
+
presets: string[];
|
|
32
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
33
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import t from "./KColorPicker.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region components/KColorPicker.vue
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-cc1b7b9f"]]);
|
|
6
|
+
//#endregion
|
|
7
|
+
export { n as default };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, ref as l, renderList as u, renderSlot as d, vModelText as f, watch as p, withDirectives as m, withKeys as h } from "vue";
|
|
2
|
+
//#region components/KColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var g = ["value", "disabled"], _ = ["disabled"], v = ["disabled"], y = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "k-color__presets"
|
|
6
|
+
}, b = [
|
|
7
|
+
"disabled",
|
|
8
|
+
"aria-label",
|
|
9
|
+
"onClick"
|
|
10
|
+
], x = /* @__PURE__ */ a({
|
|
11
|
+
__name: "KColorPicker",
|
|
12
|
+
props: {
|
|
13
|
+
modelValue: {},
|
|
14
|
+
value: {},
|
|
15
|
+
disabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
showInput: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !0
|
|
22
|
+
},
|
|
23
|
+
showAlpha: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
size: { default: "md" },
|
|
28
|
+
presets: { default: () => [
|
|
29
|
+
"#0c78e4",
|
|
30
|
+
"#10b981",
|
|
31
|
+
"#f59e0b",
|
|
32
|
+
"#f43f5e",
|
|
33
|
+
"#64748b",
|
|
34
|
+
"#111827"
|
|
35
|
+
] }
|
|
36
|
+
},
|
|
37
|
+
emits: ["update:modelValue", "update:value"],
|
|
38
|
+
setup(a, { emit: x }) {
|
|
39
|
+
let S = a, C = x, w = l(null), T = t(() => S.value ?? S.modelValue ?? "#0c78e4"), E = l(T.value);
|
|
40
|
+
p(T, (e) => E.value = e || "#000000");
|
|
41
|
+
let D = t(() => /^#[0-9a-fA-F]{6}$/.test(E.value) ? E.value : "#000000"), O = t(() => S.size === "small" || S.size === "sm" ? "sm" : S.size === "large" || S.size === "lg" ? "lg" : "md");
|
|
42
|
+
function k() {
|
|
43
|
+
S.disabled || w.value?.click();
|
|
44
|
+
}
|
|
45
|
+
function A(e) {
|
|
46
|
+
E.value = e, C("update:modelValue", e), C("update:value", e);
|
|
47
|
+
}
|
|
48
|
+
function j() {
|
|
49
|
+
if (/^#[0-9a-fA-F]{3}$/.test(E.value)) {
|
|
50
|
+
let [, e, t, n] = E.value;
|
|
51
|
+
A(`#${e}${e}${t}${t}${n}${n}`);
|
|
52
|
+
} else /^#[0-9a-fA-F]{6}$/.test(E.value) ? A(E.value) : E.value = T.value || "#000000";
|
|
53
|
+
}
|
|
54
|
+
return (t, l) => (c(), r("div", { class: o(["k-color", [`k-color--${O.value}`, { "k-color--disabled": a.disabled }]]) }, [
|
|
55
|
+
i("input", {
|
|
56
|
+
ref_key: "inputRef",
|
|
57
|
+
ref: w,
|
|
58
|
+
type: "color",
|
|
59
|
+
value: D.value,
|
|
60
|
+
disabled: a.disabled,
|
|
61
|
+
class: "k-color__native",
|
|
62
|
+
onInput: l[0] ||= (e) => A(e.target.value)
|
|
63
|
+
}, null, 40, g),
|
|
64
|
+
d(t.$slots, "trigger", {
|
|
65
|
+
value: T.value,
|
|
66
|
+
onClick: k
|
|
67
|
+
}, () => [i("button", {
|
|
68
|
+
type: "button",
|
|
69
|
+
class: "k-color__swatch",
|
|
70
|
+
style: s({ backgroundColor: D.value }),
|
|
71
|
+
disabled: a.disabled,
|
|
72
|
+
onClick: k
|
|
73
|
+
}, null, 12, _)], !0),
|
|
74
|
+
a.showInput ? m((c(), r("input", {
|
|
75
|
+
key: 0,
|
|
76
|
+
"onUpdate:modelValue": l[1] ||= (e) => E.value = e,
|
|
77
|
+
class: "k-color__input",
|
|
78
|
+
disabled: a.disabled,
|
|
79
|
+
spellcheck: "false",
|
|
80
|
+
onBlur: j,
|
|
81
|
+
onKeydown: h(j, ["enter"])
|
|
82
|
+
}, null, 40, v)), [[f, E.value]]) : n("", !0),
|
|
83
|
+
a.presets.length ? (c(), r("div", y, [(c(!0), r(e, null, u(a.presets, (e) => (c(), r("button", {
|
|
84
|
+
key: e,
|
|
85
|
+
type: "button",
|
|
86
|
+
class: o(["k-color__preset", { "k-color__preset--active": e.toLowerCase() === T.value?.toLowerCase() }]),
|
|
87
|
+
style: s({ backgroundColor: e }),
|
|
88
|
+
disabled: a.disabled,
|
|
89
|
+
"aria-label": e,
|
|
90
|
+
onClick: (t) => A(e)
|
|
91
|
+
}, null, 14, b))), 128))])) : n("", !0)
|
|
92
|
+
], 2));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
//#endregion
|
|
96
|
+
export { x as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KCombobox.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
4
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
|
+
/* empty css */
|
|
5
5
|
//#region components/KCombobox.vue
|
|
6
6
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-55b7732f"]]);
|
|
7
7
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KCommandPalette.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KCommandPalette.vue
|
|
5
5
|
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-546dc9a8"]]);
|
|
6
6
|
//#endregion
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface GlobalThemeOverrides {
|
|
2
|
+
common?: Record<string, string | number>;
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
|
+
theme?: unknown;
|
|
9
|
+
themeOverrides?: GlobalThemeOverrides;
|
|
10
|
+
inlineThemeDisabled?: boolean;
|
|
11
|
+
abstract?: boolean;
|
|
12
|
+
clsPrefix?: string;
|
|
13
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
14
|
+
theme?: unknown;
|
|
15
|
+
themeOverrides?: GlobalThemeOverrides;
|
|
16
|
+
inlineThemeDisabled?: boolean;
|
|
17
|
+
abstract?: boolean;
|
|
18
|
+
clsPrefix?: string;
|
|
19
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
20
|
+
default?: (props: {}) => any;
|
|
21
|
+
}>;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponent as e, renderSlot as t } from "vue";
|
|
2
|
+
//#region components/KConfigProvider.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var n = /* @__PURE__ */ e({
|
|
4
|
+
__name: "KConfigProvider",
|
|
5
|
+
props: {
|
|
6
|
+
theme: {},
|
|
7
|
+
themeOverrides: {},
|
|
8
|
+
inlineThemeDisabled: { type: Boolean },
|
|
9
|
+
abstract: { type: Boolean },
|
|
10
|
+
clsPrefix: {}
|
|
11
|
+
},
|
|
12
|
+
setup(e) {
|
|
13
|
+
return (e, n) => t(e.$slots, "default");
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as default };
|
|
@@ -1,22 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
import type { VNodeChild } from 'vue';
|
|
2
|
+
export type RowClassValue = string | string[] | Record<string, boolean> | undefined;
|
|
3
|
+
export interface Column<T = Record<string, any>> {
|
|
2
4
|
key: string;
|
|
3
|
-
label
|
|
4
|
-
|
|
5
|
+
label?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
width?: string | number;
|
|
5
8
|
align?: 'left' | 'right' | 'center';
|
|
6
9
|
cellClass?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
render?: (row: T, index: number) => VNodeChild;
|
|
7
12
|
}
|
|
13
|
+
export interface DataTablePagination {
|
|
14
|
+
page?: number;
|
|
15
|
+
pageSize?: number;
|
|
16
|
+
itemCount?: number;
|
|
17
|
+
showSizePicker?: boolean;
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
export type DataTableColumn<T = Record<string, any>> = Column<T>;
|
|
21
|
+
export type DataTableColumns<T = Record<string, any>> = Column<T>[];
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
8
24
|
declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
9
25
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
10
|
-
columns: Column[];
|
|
11
|
-
rows
|
|
12
|
-
|
|
26
|
+
columns: Column<T>[];
|
|
27
|
+
rows?: T[];
|
|
28
|
+
/** naive-ui alias */
|
|
29
|
+
data?: T[];
|
|
30
|
+
rowKey?: string | ((row: T) => string | number);
|
|
31
|
+
rowClassName?: string | ((row: T, index: number) => RowClassValue);
|
|
13
32
|
hoverable?: boolean;
|
|
14
33
|
loading?: boolean;
|
|
15
34
|
empty?: string;
|
|
16
|
-
size?: "sm" | "md";
|
|
35
|
+
size?: "small" | "sm" | "medium" | "md";
|
|
17
36
|
striped?: boolean;
|
|
18
37
|
bordered?: boolean;
|
|
19
38
|
stickyHeader?: boolean;
|
|
39
|
+
pagination?: false | DataTablePagination;
|
|
40
|
+
singleLine?: boolean;
|
|
41
|
+
scrollX?: string | number;
|
|
20
42
|
} & {
|
|
21
43
|
onRowClick?: ((row: T) => any) | undefined;
|
|
22
44
|
}> & (typeof globalThis extends {
|
|
@@ -26,20 +48,21 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
26
48
|
attrs: any;
|
|
27
49
|
slots: {
|
|
28
50
|
[x: `header-${string}`]: ((props: {
|
|
29
|
-
col: Column
|
|
51
|
+
col: Column<T>;
|
|
30
52
|
}) => any) | undefined;
|
|
31
53
|
} & {
|
|
32
54
|
[x: `cell-${string}`]: ((props: {
|
|
33
55
|
row: T;
|
|
34
56
|
value: any;
|
|
57
|
+
index: number;
|
|
35
58
|
}) => any) | undefined;
|
|
59
|
+
} & {
|
|
60
|
+
empty?: (props: {}) => any;
|
|
36
61
|
};
|
|
37
62
|
emit: (e: "rowClick", row: T) => void;
|
|
38
63
|
}>) => import("vue").VNode & {
|
|
39
64
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
40
65
|
};
|
|
41
|
-
declare const _default: typeof __VLS_export;
|
|
42
|
-
export default _default;
|
|
43
66
|
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
44
67
|
[K in keyof T]: T[K];
|
|
45
68
|
} : {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KDataTable.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KDataTable.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-cc657cc6"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import e from "./KLoadingOverlay.js";
|
|
2
|
-
import t from "./KEmpty.js";
|
|
3
|
-
import
|
|
1
|
+
import e from "./KLoadingOverlay.vue.js";
|
|
2
|
+
import t from "./KEmpty.vue.js";
|
|
3
|
+
import n from "./KPagination.vue.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, openBlock as m, ref as h, renderList as g, renderSlot as _, toDisplayString as v, unref as y, watch as b } from "vue";
|
|
4
5
|
//#region components/KDataTable.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var x = ["onClick"], S = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "k-table-empty"
|
|
9
|
+
}, C = /* @__PURE__ */ d({
|
|
6
10
|
__name: "KDataTable",
|
|
7
11
|
props: {
|
|
8
12
|
columns: {},
|
|
9
13
|
rows: {},
|
|
14
|
+
data: {},
|
|
10
15
|
rowKey: {},
|
|
16
|
+
rowClassName: {},
|
|
11
17
|
hoverable: {
|
|
12
18
|
type: Boolean,
|
|
13
19
|
default: !0
|
|
@@ -29,34 +35,126 @@ var g = ["onClick"], _ = /* @__PURE__ */ l({
|
|
|
29
35
|
stickyHeader: {
|
|
30
36
|
type: Boolean,
|
|
31
37
|
default: !1
|
|
32
|
-
}
|
|
38
|
+
},
|
|
39
|
+
pagination: { type: [Boolean, Object] },
|
|
40
|
+
singleLine: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !0
|
|
43
|
+
},
|
|
44
|
+
scrollX: {}
|
|
33
45
|
},
|
|
34
46
|
emits: ["rowClick"],
|
|
35
|
-
setup(
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [
|
|
49
|
-
|
|
50
|
-
value
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
setup(C, { emit: w }) {
|
|
48
|
+
let T = C, E = w, D = h(1), O = i(() => T.rows ?? T.data ?? []), k = i(() => T.pagination && typeof T.pagination == "object" ? T.pagination : void 0), A = i(() => {
|
|
49
|
+
let e = Number(k.value?.pageSize ?? 0);
|
|
50
|
+
return Number.isFinite(e) && e > 0 ? e : 0;
|
|
51
|
+
}), j = i(() => O.value.length), M = i(() => {
|
|
52
|
+
if (!A.value) return O.value;
|
|
53
|
+
let e = (D.value - 1) * A.value;
|
|
54
|
+
return O.value.slice(e, e + A.value);
|
|
55
|
+
}), N = i(() => T.size === "small" || T.size === "sm" ? "sm" : "md"), P = i(() => {
|
|
56
|
+
if (T.scrollX !== void 0) return { minWidth: typeof T.scrollX == "number" ? `${T.scrollX}px` : T.scrollX };
|
|
57
|
+
});
|
|
58
|
+
b(() => k.value?.page, (e) => {
|
|
59
|
+
typeof e == "number" && e > 0 && (D.value = e);
|
|
60
|
+
}, { immediate: !0 }), b([j, A], () => {
|
|
61
|
+
let e = A.value ? Math.max(1, Math.ceil(j.value / A.value)) : 1;
|
|
62
|
+
D.value > e && (D.value = e), D.value < 1 && (D.value = 1);
|
|
63
|
+
});
|
|
64
|
+
function F(e) {
|
|
65
|
+
return e.label ?? e.title ?? e.key;
|
|
66
|
+
}
|
|
67
|
+
function I(e) {
|
|
68
|
+
if (e.width !== void 0) return { width: typeof e.width == "number" ? `${e.width}px` : e.width };
|
|
69
|
+
}
|
|
70
|
+
function L(e, t) {
|
|
71
|
+
return e[t.key] ?? "-";
|
|
72
|
+
}
|
|
73
|
+
function R(e, t) {
|
|
74
|
+
return typeof T.rowKey == "function" ? T.rowKey(e) : typeof T.rowKey == "string" ? e[T.rowKey] ?? t : t;
|
|
75
|
+
}
|
|
76
|
+
function z(e, t) {
|
|
77
|
+
return [{ "k-table__row--hoverable": T.hoverable }, typeof T.rowClassName == "function" ? T.rowClassName(e, t) : T.rowClassName];
|
|
78
|
+
}
|
|
79
|
+
function B(e, t, n) {
|
|
80
|
+
return e.render ? e.render(t, n) : L(t, e);
|
|
81
|
+
}
|
|
82
|
+
let V = d({
|
|
83
|
+
props: {
|
|
84
|
+
col: {
|
|
85
|
+
type: Object,
|
|
86
|
+
required: !0
|
|
87
|
+
},
|
|
88
|
+
row: {
|
|
89
|
+
type: Object,
|
|
90
|
+
required: !0
|
|
91
|
+
},
|
|
92
|
+
index: {
|
|
93
|
+
type: Number,
|
|
94
|
+
required: !0
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
setup(e) {
|
|
98
|
+
return () => B(e.col, e.row, e.index);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return (i, d) => (m(), s("div", { class: f(["k-table-wrap", [`k-table-wrap--${N.value}`, { "k-table-wrap--bordered": C.bordered }]]) }, [
|
|
102
|
+
c("div", { class: f(["k-table-scroll", { "k-table-scroll--sticky": C.stickyHeader }]) }, [c("table", {
|
|
103
|
+
class: f(["k-table", {
|
|
104
|
+
"k-table--striped": C.striped,
|
|
105
|
+
"k-table--single-line": C.singleLine
|
|
106
|
+
}]),
|
|
107
|
+
style: p(P.value)
|
|
108
|
+
}, [c("thead", null, [c("tr", null, [(m(!0), s(r, null, g(C.columns, (e) => (m(), s("th", {
|
|
109
|
+
key: e.key,
|
|
110
|
+
style: p(I(e)),
|
|
111
|
+
class: f(e.align ? `k-table__th--${e.align}` : "")
|
|
112
|
+
}, [_(i.$slots, `header-${e.key}`, { col: e }, () => [l(v(F(e)), 1)], !0)], 6))), 128))])]), c("tbody", null, [(m(!0), s(r, null, g(M.value, (e, t) => (m(), s("tr", {
|
|
113
|
+
key: R(e, t),
|
|
114
|
+
class: f(z(e, t)),
|
|
115
|
+
onClick: (t) => C.hoverable && E("rowClick", e)
|
|
116
|
+
}, [(m(!0), s(r, null, g(C.columns, (n) => (m(), s("td", {
|
|
117
|
+
key: n.key,
|
|
118
|
+
class: f([
|
|
119
|
+
n.cellClass,
|
|
120
|
+
n.className,
|
|
121
|
+
n.align ? `k-table__td--${n.align}` : ""
|
|
122
|
+
])
|
|
123
|
+
}, [_(i.$slots, `cell-${n.key}`, {
|
|
124
|
+
row: e,
|
|
125
|
+
value: L(e, n),
|
|
126
|
+
index: t
|
|
127
|
+
}, () => [u(y(V), {
|
|
128
|
+
col: n,
|
|
129
|
+
row: e,
|
|
130
|
+
index: t
|
|
131
|
+
}, null, 8, [
|
|
132
|
+
"col",
|
|
133
|
+
"row",
|
|
134
|
+
"index"
|
|
135
|
+
])], !0)], 2))), 128))], 10, x))), 128))])], 6), !C.loading && O.value.length === 0 ? (m(), s("div", S, [_(i.$slots, "empty", {}, () => [u(t, {
|
|
136
|
+
title: C.empty || "暂无数据",
|
|
137
|
+
compact: ""
|
|
138
|
+
}, null, 8, ["title"])], !0)])) : o("", !0)], 2),
|
|
139
|
+
A.value > 0 ? (m(), a(n, {
|
|
140
|
+
key: 0,
|
|
141
|
+
page: D.value,
|
|
142
|
+
"onUpdate:page": d[0] ||= (e) => D.value = e,
|
|
143
|
+
class: "k-table-pagination",
|
|
144
|
+
"page-size": A.value,
|
|
145
|
+
total: j.value,
|
|
146
|
+
"show-summary": ""
|
|
147
|
+
}, null, 8, [
|
|
148
|
+
"page",
|
|
149
|
+
"page-size",
|
|
150
|
+
"total"
|
|
151
|
+
])) : o("", !0),
|
|
152
|
+
u(e, {
|
|
153
|
+
show: C.loading,
|
|
154
|
+
text: "加载中..."
|
|
155
|
+
}, null, 8, ["show"])
|
|
156
|
+
], 2));
|
|
59
157
|
}
|
|
60
158
|
});
|
|
61
159
|
//#endregion
|
|
62
|
-
export {
|
|
160
|
+
export { C as default };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface DescriptionItem {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: string | number;
|
|
4
|
+
span?: number;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
items?: DescriptionItem[];
|
|
8
|
+
columns?: number;
|
|
9
|
+
bordered?: boolean;
|
|
10
|
+
labelWidth?: string;
|
|
11
|
+
size?: 'sm' | 'md' | 'lg';
|
|
12
|
+
};
|
|
13
|
+
declare var __VLS_1: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
default?: (props: typeof __VLS_1) => any;
|
|
16
|
+
};
|
|
17
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
18
|
+
size: "sm" | "md" | "lg";
|
|
19
|
+
bordered: boolean;
|
|
20
|
+
labelWidth: string;
|
|
21
|
+
columns: number;
|
|
22
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
24
|
+
declare const _default: typeof __VLS_export;
|
|
25
|
+
export default _default;
|
|
26
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
27
|
+
new (): {
|
|
28
|
+
$slots: S;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Fragment as e, createElementBlock as t, createElementVNode as n, defineComponent as r, normalizeClass as i, normalizeStyle as a, openBlock as o, renderList as s, renderSlot as c, toDisplayString as l } from "vue";
|
|
2
|
+
//#region components/KDescriptions.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var u = { class: "k-desc-item__label" }, d = { class: "k-desc-item__value" }, f = /* @__PURE__ */ r({
|
|
4
|
+
__name: "KDescriptions",
|
|
5
|
+
props: {
|
|
6
|
+
items: {},
|
|
7
|
+
columns: { default: 3 },
|
|
8
|
+
bordered: {
|
|
9
|
+
type: Boolean,
|
|
10
|
+
default: !0
|
|
11
|
+
},
|
|
12
|
+
labelWidth: { default: "96px" },
|
|
13
|
+
size: { default: "md" }
|
|
14
|
+
},
|
|
15
|
+
setup(r) {
|
|
16
|
+
return (f, p) => (o(), t("div", {
|
|
17
|
+
class: i(["k-descriptions", [`k-descriptions--${r.size}`, { "k-descriptions--bordered": r.bordered }]]),
|
|
18
|
+
style: a({
|
|
19
|
+
"--k-desc-columns": r.columns,
|
|
20
|
+
"--k-desc-label-width": r.labelWidth
|
|
21
|
+
})
|
|
22
|
+
}, [r.items?.length ? (o(!0), t(e, { key: 0 }, s(r.items, (e) => (o(), t("div", {
|
|
23
|
+
key: e.label,
|
|
24
|
+
class: "k-desc-item",
|
|
25
|
+
style: a({ gridColumn: e.span ? `span ${e.span}` : void 0 })
|
|
26
|
+
}, [n("div", u, l(e.label), 1), n("div", d, l(e.value), 1)], 4))), 128)) : c(f.$slots, "default", { key: 1 })], 6));
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
//#endregion
|
|
30
|
+
export { f as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label: string;
|
|
3
|
+
span?: number;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_1: {};
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
default?: (props: typeof __VLS_1) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
14
|
+
new (): {
|
|
15
|
+
$slots: S;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createElementBlock as e, createElementVNode as t, defineComponent as n, normalizeStyle as r, openBlock as i, renderSlot as a, toDisplayString as o } from "vue";
|
|
2
|
+
//#region components/KDescriptionsItem.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var s = { class: "k-desc-item__label" }, c = { class: "k-desc-item__value" }, l = /* @__PURE__ */ n({
|
|
4
|
+
__name: "KDescriptionsItem",
|
|
5
|
+
props: {
|
|
6
|
+
label: {},
|
|
7
|
+
span: {}
|
|
8
|
+
},
|
|
9
|
+
setup(n) {
|
|
10
|
+
return (l, u) => (i(), e("div", {
|
|
11
|
+
class: "k-desc-item",
|
|
12
|
+
style: r({ gridColumn: n.span ? `span ${n.span}` : void 0 })
|
|
13
|
+
}, [t("div", s, o(n.label), 1), t("div", c, [a(l.$slots, "default")])], 4));
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { l as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
2
2
|
import t from "./KDialog.vue_vue_type_script_setup_true_lang.js";
|
|
3
|
-
/* empty css
|
|
3
|
+
/* empty css */
|
|
4
4
|
//#region components/KDialog.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-f650c062"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|