@guoyg578/k-ui 0.1.5 → 0.1.6
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/dist/components/KAutoComplete.vue.d.ts +2 -0
- package/dist/components/KAutoComplete.vue.js +1 -1
- package/dist/components/KAutoComplete.vue_vue_type_script_setup_true_lang.js +89 -29
- package/dist/components/KCalendar.vue.js +1 -1
- package/dist/components/KCalendar.vue_vue_type_script_setup_true_lang.js +132 -39
- package/dist/components/KCascader.vue.d.ts +2 -0
- package/dist/components/KCascader.vue.js +1 -1
- package/dist/components/KCascader.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/components/KCheckbox.vue.d.ts +6 -2
- package/dist/components/KCheckbox.vue.js +1 -1
- package/dist/components/KCheckbox.vue_vue_type_script_setup_true_lang.js +38 -18
- package/dist/components/KCheckboxGroup.vue.d.ts +2 -0
- package/dist/components/KCheckboxGroup.vue.js +1 -1
- package/dist/components/KCheckboxGroup.vue_vue_type_script_setup_true_lang.js +23 -15
- package/dist/components/KCollapse.vue.d.ts +3 -1
- package/dist/components/KCollapse.vue.js +1 -1
- package/dist/components/KCollapse.vue_vue_type_script_setup_true_lang.js +27 -16
- package/dist/components/KDataTable.vue.d.ts +48 -1
- package/dist/components/KDataTable.vue.js +1 -1
- package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +305 -74
- package/dist/components/KDatePicker.vue.d.ts +8 -0
- package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +32 -22
- package/dist/components/KDialog.vue.d.ts +4 -4
- package/dist/components/KDialog.vue.js +1 -1
- package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +80 -71
- package/dist/components/KDropdown.vue.d.ts +4 -3
- package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +45 -28
- package/dist/components/KDynamicInput.vue.d.ts +2 -0
- package/dist/components/KDynamicInput.vue.js +1 -1
- package/dist/components/KDynamicInput.vue_vue_type_script_setup_true_lang.js +17 -6
- package/dist/components/KDynamicTags.vue.d.ts +2 -0
- package/dist/components/KDynamicTags.vue.js +1 -1
- package/dist/components/KDynamicTags.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/components/KForm.vue.d.ts +12 -0
- package/dist/components/KForm.vue.js +1 -1
- package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +26 -4
- package/dist/components/KFormField.vue.d.ts +3 -1
- package/dist/components/KFormField.vue.js +1 -1
- package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +124 -61
- package/dist/components/KInputNumber.vue.js +1 -1
- package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +35 -29
- package/dist/components/KMention.vue.d.ts +2 -0
- package/dist/components/KMention.vue.js +1 -1
- package/dist/components/KMention.vue_vue_type_script_setup_true_lang.js +34 -33
- package/dist/components/KMenu.vue.js +1 -1
- package/dist/components/KMenu.vue_vue_type_script_setup_true_lang.js +132 -51
- package/dist/components/KMenuItem.vue.js +1 -1
- package/dist/components/KMenuItem.vue_vue_type_script_setup_true_lang.js +21 -6
- package/dist/components/KMessage.d.ts +5 -0
- package/dist/components/KMessage.js +36 -23
- package/dist/components/KNotification.d.ts +8 -0
- package/dist/components/KNotification.js +45 -29
- package/dist/components/KNotificationProvider.vue.js +3 -8
- package/dist/components/KNotificationProvider.vue_vue_type_script_setup_true_lang.js +11 -0
- package/dist/components/KPagination.vue.d.ts +4 -1
- package/dist/components/KPagination.vue.js +1 -1
- package/dist/components/KPagination.vue_vue_type_script_setup_true_lang.js +36 -33
- package/dist/components/KRadio.vue.d.ts +1 -0
- package/dist/components/KRadio.vue.js +1 -1
- package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +22 -14
- package/dist/components/KRadioGroup.vue.d.ts +4 -2
- package/dist/components/KRadioGroup.vue.js +1 -1
- package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +16 -4
- package/dist/components/KRate.vue.d.ts +5 -0
- package/dist/components/KRate.vue.js +1 -1
- package/dist/components/KRate.vue_vue_type_script_setup_true_lang.js +72 -24
- package/dist/components/KSelect.vue.d.ts +2 -2
- package/dist/components/KSelect.vue.js +1 -1
- package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/components/KSlider.vue.d.ts +2 -0
- package/dist/components/KSlider.vue.js +1 -1
- package/dist/components/KSlider.vue_vue_type_script_setup_true_lang.js +17 -16
- package/dist/components/KTextarea.vue.d.ts +2 -0
- package/dist/components/KTextarea.vue.js +1 -1
- package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +10 -9
- package/dist/components/KTimePicker.vue.d.ts +2 -0
- package/dist/components/KTimePicker.vue.js +1 -1
- package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +61 -48
- package/dist/components/KTransfer.vue.d.ts +2 -0
- package/dist/components/KTransfer.vue.js +1 -1
- package/dist/components/KTransfer.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/KTreeSelect.vue.d.ts +2 -0
- package/dist/components/KTreeSelect.vue.js +1 -1
- package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +15 -14
- package/dist/components/KUpload.vue.d.ts +14 -0
- package/dist/components/KUpload.vue.js +1 -1
- package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +159 -117
- package/dist/components/checkbox-context.d.ts +10 -0
- package/dist/components/checkbox-context.js +4 -0
- package/dist/components/form-context.d.ts +19 -2
- package/dist/components/form-context.js +31 -1
- package/dist/components/menu-context.d.ts +4 -0
- package/dist/components/radio-context.d.ts +6 -1
- package/dist/k-ui.css +1 -1
- package/dist/styles/tokens.css +40 -1
- package/package.json +1 -1
|
@@ -1,55 +1,71 @@
|
|
|
1
1
|
import e from "./KNotificationContainer.vue.js";
|
|
2
2
|
import { createApp as t, h as n, ref as r } from "vue";
|
|
3
3
|
//#region components/KNotification.ts
|
|
4
|
-
var i = null, a = null, o = null, s = 0;
|
|
5
|
-
function
|
|
6
|
-
|
|
4
|
+
var i = null, a = null, o = null, s = 0, c = /* @__PURE__ */ new Map(), l = 0;
|
|
5
|
+
function u(e) {
|
|
6
|
+
let t = c.get(e);
|
|
7
|
+
t && (clearTimeout(t), c.delete(e));
|
|
8
|
+
}
|
|
9
|
+
function d() {
|
|
10
|
+
i || typeof document > "u" || (o = document.createElement("div"), document.body.appendChild(o), a = r([]), i = t({ setup() {
|
|
7
11
|
return () => n(e, {
|
|
8
12
|
notifications: a.value,
|
|
9
|
-
onRemove:
|
|
13
|
+
onRemove: p
|
|
10
14
|
});
|
|
11
15
|
} }), i.mount(o));
|
|
12
16
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
function f(e) {
|
|
18
|
+
if (typeof document > "u") return { destroy: () => {} };
|
|
19
|
+
d();
|
|
20
|
+
let t = ++s, n = e.duration ?? 4500, r = [...a.value, {
|
|
17
21
|
id: t,
|
|
18
22
|
...e
|
|
19
|
-
}]
|
|
23
|
+
}];
|
|
24
|
+
if (l > 0 && r.length > l) {
|
|
25
|
+
for (let e of r.slice(0, r.length - l)) u(e.id);
|
|
26
|
+
r = r.slice(r.length - l);
|
|
27
|
+
}
|
|
28
|
+
return a.value = r, n > 0 && c.set(t, setTimeout(() => p(t), n)), { destroy: () => p(t) };
|
|
20
29
|
}
|
|
21
|
-
function
|
|
22
|
-
a && (a.value = a.value.filter((t) => t.id !== e));
|
|
30
|
+
function p(e) {
|
|
31
|
+
u(e), a && (a.value = a.value.filter((t) => t.id !== e));
|
|
23
32
|
}
|
|
24
|
-
function
|
|
25
|
-
a && (a.value = []);
|
|
33
|
+
function m() {
|
|
34
|
+
c.forEach((e) => clearTimeout(e)), c.clear(), a && (a.value = []);
|
|
26
35
|
}
|
|
27
|
-
function
|
|
36
|
+
function h(e) {
|
|
37
|
+
typeof e.max == "number" && (l = Math.max(0, e.max));
|
|
38
|
+
}
|
|
39
|
+
function g() {
|
|
40
|
+
d();
|
|
41
|
+
}
|
|
42
|
+
function _(e) {
|
|
28
43
|
return typeof e == "string" ? { content: e } : e;
|
|
29
44
|
}
|
|
30
|
-
var
|
|
31
|
-
create:
|
|
32
|
-
close:
|
|
33
|
-
closeAll:
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
var v = {
|
|
46
|
+
create: f,
|
|
47
|
+
close: p,
|
|
48
|
+
closeAll: m,
|
|
49
|
+
config: h,
|
|
50
|
+
success: ((e) => f({
|
|
51
|
+
..._(e),
|
|
36
52
|
type: "success"
|
|
37
53
|
})),
|
|
38
|
-
error: ((e) =>
|
|
39
|
-
...
|
|
54
|
+
error: ((e) => f({
|
|
55
|
+
..._(e),
|
|
40
56
|
type: "error"
|
|
41
57
|
})),
|
|
42
|
-
warning: ((e) =>
|
|
43
|
-
...
|
|
58
|
+
warning: ((e) => f({
|
|
59
|
+
..._(e),
|
|
44
60
|
type: "warning"
|
|
45
61
|
})),
|
|
46
|
-
info: ((e) =>
|
|
47
|
-
...
|
|
62
|
+
info: ((e) => f({
|
|
63
|
+
..._(e),
|
|
48
64
|
type: "info"
|
|
49
65
|
}))
|
|
50
66
|
};
|
|
51
|
-
function
|
|
52
|
-
return
|
|
67
|
+
function y() {
|
|
68
|
+
return v;
|
|
53
69
|
}
|
|
54
70
|
//#endregion
|
|
55
|
-
export {
|
|
71
|
+
export { v as KNotification, g as ensureMounted, y as useNotification };
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import { renderSlot as t } from "vue";
|
|
1
|
+
import e from "./KNotificationProvider.vue_vue_type_script_setup_true_lang.js";
|
|
3
2
|
//#region components/KNotificationProvider.vue
|
|
4
|
-
var
|
|
5
|
-
function r(e, n) {
|
|
6
|
-
return t(e.$slots, "default");
|
|
7
|
-
}
|
|
8
|
-
var i = /* @__PURE__ */ e(n, [["render", r]]);
|
|
3
|
+
var t = e;
|
|
9
4
|
//#endregion
|
|
10
|
-
export {
|
|
5
|
+
export { t as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ensureMounted as e } from "./KNotification.js";
|
|
2
|
+
import { defineComponent as t, onMounted as n, renderSlot as r } from "vue";
|
|
3
|
+
//#region components/KNotificationProvider.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var i = /* @__PURE__ */ t({
|
|
5
|
+
__name: "KNotificationProvider",
|
|
6
|
+
setup(t) {
|
|
7
|
+
return n(e), (e, t) => r(e.$slots, "default");
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export { i as default };
|
|
@@ -4,11 +4,14 @@ type __VLS_Props = {
|
|
|
4
4
|
total: number;
|
|
5
5
|
/** 左侧显示 "start–end / total" 摘要 */
|
|
6
6
|
showSummary?: boolean;
|
|
7
|
+
size?: 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
10
|
"update:page": (value: number) => any;
|
|
10
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
12
|
"onUpdate:page"?: ((value: number) => any) | undefined;
|
|
12
|
-
}>, {
|
|
13
|
+
}>, {
|
|
14
|
+
size: "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
16
|
declare const _default: typeof __VLS_export;
|
|
14
17
|
export default _default;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KPagination.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KPagination.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-6b13fba6"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, renderList as d, toDisplayString as f, unref as p,
|
|
2
|
-
import { ChevronLeft as
|
|
3
|
-
import { PaginationEllipsis as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, renderList as d, toDisplayString as f, unref as p, watch as m, withCtx as h } from "vue";
|
|
2
|
+
import { ChevronLeft as g, ChevronRight as _, ChevronsLeft as v, ChevronsRight as y } from "lucide-vue-next";
|
|
3
|
+
import { PaginationEllipsis as b, PaginationFirst as x, PaginationLast as S, PaginationList as C, PaginationListItem as w, PaginationNext as T, PaginationPrev as E, PaginationRoot as D } from "reka-ui";
|
|
4
4
|
//#region components/KPagination.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "k-pg-bar"
|
|
8
|
-
}, O = {
|
|
5
|
+
var O = {
|
|
9
6
|
key: 0,
|
|
10
7
|
class: "k-pg-side"
|
|
11
8
|
}, k = {
|
|
@@ -17,74 +14,80 @@ var D = {
|
|
|
17
14
|
page: {},
|
|
18
15
|
pageSize: {},
|
|
19
16
|
total: {},
|
|
20
|
-
showSummary: { type: Boolean }
|
|
17
|
+
showSummary: { type: Boolean },
|
|
18
|
+
size: { default: "md" }
|
|
21
19
|
},
|
|
22
20
|
emits: ["update:page"],
|
|
23
21
|
setup(c, { emit: A }) {
|
|
24
|
-
let j = c, M =
|
|
25
|
-
function
|
|
26
|
-
e !== j.page &&
|
|
22
|
+
let j = c, M = t(() => j.size === "small" || j.size === "sm" ? "sm" : j.size === "large" || j.size === "lg" ? "lg" : "md"), N = A, P = t(() => j.total === 0 ? 0 : (j.page - 1) * j.pageSize + 1), F = t(() => Math.min(j.total, j.page * j.pageSize)), I = t(() => j.pageSize > 0 ? Math.ceil(j.total / j.pageSize) : 0);
|
|
23
|
+
function L(e) {
|
|
24
|
+
e !== j.page && N("update:page", e);
|
|
27
25
|
}
|
|
28
|
-
return (
|
|
26
|
+
return m([() => j.page, I], ([e, t]) => {
|
|
27
|
+
t <= 0 || (e > t ? N("update:page", t) : e < 1 && N("update:page", 1));
|
|
28
|
+
}, { immediate: !0 }), (t, m) => I.value > 1 ? (u(), i("div", {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: l(["k-pg-bar", `k-pg-bar--${M.value}`])
|
|
31
|
+
}, [
|
|
29
32
|
c.showSummary ? (u(), i("div", O, [
|
|
30
|
-
a("span", null, f(N.value), 1),
|
|
31
|
-
A[0] ||= o("–", -1),
|
|
32
33
|
a("span", null, f(P.value), 1),
|
|
33
|
-
|
|
34
|
+
m[0] ||= o("–", -1),
|
|
35
|
+
a("span", null, f(F.value), 1),
|
|
36
|
+
m[1] ||= o(" / ", -1),
|
|
34
37
|
a("span", null, f(c.total), 1)
|
|
35
38
|
])) : (u(), i("div", k)),
|
|
36
|
-
s(p(
|
|
39
|
+
s(p(D), {
|
|
37
40
|
page: c.page,
|
|
38
41
|
"items-per-page": c.pageSize,
|
|
39
42
|
total: c.total,
|
|
40
43
|
"sibling-count": 1,
|
|
41
44
|
"show-edges": "",
|
|
42
45
|
class: "k-pg-center",
|
|
43
|
-
"onUpdate:page":
|
|
46
|
+
"onUpdate:page": L
|
|
44
47
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
default:
|
|
47
|
-
s(p(
|
|
48
|
+
default: h(() => [s(p(C), { class: "k-pg-list" }, {
|
|
49
|
+
default: h(({ items: t }) => [
|
|
50
|
+
s(p(x), {
|
|
48
51
|
class: "k-pg-btn k-pg-arrow",
|
|
49
52
|
title: "首页"
|
|
50
53
|
}, {
|
|
51
|
-
default:
|
|
54
|
+
default: h(() => [s(p(v), { size: 14 })]),
|
|
52
55
|
_: 1
|
|
53
56
|
}),
|
|
54
|
-
s(p(
|
|
57
|
+
s(p(E), {
|
|
55
58
|
class: "k-pg-btn k-pg-arrow",
|
|
56
59
|
title: "上一页"
|
|
57
60
|
}, {
|
|
58
|
-
default:
|
|
61
|
+
default: h(() => [s(p(g), { size: 14 })]),
|
|
59
62
|
_: 1
|
|
60
63
|
}),
|
|
61
|
-
(u(!0), i(e, null, d(t, (t, r) => (u(), i(e, null, [t.type === "page" ? (u(), n(p(
|
|
64
|
+
(u(!0), i(e, null, d(t, (t, r) => (u(), i(e, null, [t.type === "page" ? (u(), n(p(w), {
|
|
62
65
|
key: `p-${t.value}`,
|
|
63
66
|
value: t.value,
|
|
64
67
|
class: l(["k-pg-btn k-pg-page", { active: t.value === c.page }])
|
|
65
68
|
}, {
|
|
66
|
-
default:
|
|
69
|
+
default: h(() => [o(f(t.value), 1)]),
|
|
67
70
|
_: 2
|
|
68
|
-
}, 1032, ["value", "class"])) : (u(), n(p(
|
|
71
|
+
}, 1032, ["value", "class"])) : (u(), n(p(b), {
|
|
69
72
|
key: `e-${r}`,
|
|
70
73
|
index: r,
|
|
71
74
|
class: "k-pg-ellipsis"
|
|
72
75
|
}, {
|
|
73
|
-
default:
|
|
76
|
+
default: h(() => [...m[2] ||= [o("…", -1)]]),
|
|
74
77
|
_: 1
|
|
75
78
|
}, 8, ["index"]))], 64))), 256)),
|
|
76
|
-
s(p(
|
|
79
|
+
s(p(T), {
|
|
77
80
|
class: "k-pg-btn k-pg-arrow",
|
|
78
81
|
title: "下一页"
|
|
79
82
|
}, {
|
|
80
|
-
default:
|
|
83
|
+
default: h(() => [s(p(_), { size: 14 })]),
|
|
81
84
|
_: 1
|
|
82
85
|
}),
|
|
83
|
-
s(p(
|
|
86
|
+
s(p(S), {
|
|
84
87
|
class: "k-pg-btn k-pg-arrow",
|
|
85
88
|
title: "末页"
|
|
86
89
|
}, {
|
|
87
|
-
default:
|
|
90
|
+
default: h(() => [s(p(y), { size: 14 })]),
|
|
88
91
|
_: 1
|
|
89
92
|
})
|
|
90
93
|
]),
|
|
@@ -96,8 +99,8 @@ var D = {
|
|
|
96
99
|
"items-per-page",
|
|
97
100
|
"total"
|
|
98
101
|
]),
|
|
99
|
-
|
|
100
|
-
])) : r("", !0);
|
|
102
|
+
m[3] ||= a("div", { class: "k-pg-side" }, null, -1)
|
|
103
|
+
], 2)) : r("", !0);
|
|
101
104
|
}
|
|
102
105
|
});
|
|
103
106
|
//#endregion
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KRadio.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KRadio.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-4980d31b"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,39 +1,47 @@
|
|
|
1
1
|
import { RADIO_GROUP_KEY as e } from "./radio-context.js";
|
|
2
|
-
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, createVNode as o, defineComponent as s, inject as c, normalizeClass as l,
|
|
3
|
-
import { RadioGroupIndicator as
|
|
2
|
+
import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, createVNode as o, defineComponent as s, inject as c, normalizeClass as l, onBeforeUnmount as u, openBlock as d, renderSlot as f, toDisplayString as p, unref as m, watch as h, withCtx as g } from "vue";
|
|
3
|
+
import { RadioGroupIndicator as _, RadioGroupItem as v } from "reka-ui";
|
|
4
4
|
//#region components/KRadio.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var y = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "k-radio__label"
|
|
8
|
-
},
|
|
8
|
+
}, b = /* @__PURE__ */ s({
|
|
9
9
|
__name: "KRadio",
|
|
10
10
|
props: {
|
|
11
11
|
value: {},
|
|
12
12
|
disabled: { type: Boolean },
|
|
13
|
-
label: {}
|
|
13
|
+
label: {},
|
|
14
|
+
size: {}
|
|
14
15
|
},
|
|
15
16
|
setup(s) {
|
|
16
|
-
let
|
|
17
|
-
|
|
17
|
+
let b = s, x = c(e, null), S = t(() => !!x?.button.value);
|
|
18
|
+
h(() => b.value, (e, t) => {
|
|
19
|
+
t !== void 0 && t !== e && x?.unregister(t), x?.register(e);
|
|
20
|
+
}, { immediate: !0 }), u(() => x?.unregister(b.value));
|
|
21
|
+
let C = t(() => b.size ?? x?.size?.value ?? "md"), w = t(() => {
|
|
22
|
+
let e = C.value;
|
|
23
|
+
return e === "small" || e === "sm" ? "sm" : e === "large" || e === "lg" ? "lg" : "md";
|
|
24
|
+
});
|
|
25
|
+
return (e, t) => S.value ? (d(), n(m(v), {
|
|
18
26
|
key: 0,
|
|
19
27
|
value: String(s.value),
|
|
20
28
|
disabled: s.disabled,
|
|
21
29
|
class: "k-radio-btn"
|
|
22
30
|
}, {
|
|
23
|
-
default:
|
|
31
|
+
default: g(() => [f(e.$slots, "default", {}, () => [a(p(s.label), 1)], !0)]),
|
|
24
32
|
_: 3
|
|
25
|
-
}, 8, ["value", "disabled"])) : (
|
|
33
|
+
}, 8, ["value", "disabled"])) : (d(), i("label", {
|
|
26
34
|
key: 1,
|
|
27
|
-
class: l(["k-radio-wrap", { "k-radio-wrap--disabled": s.disabled }])
|
|
28
|
-
}, [o(
|
|
35
|
+
class: l(["k-radio-wrap", [`k-radio-wrap--${w.value}`, { "k-radio-wrap--disabled": s.disabled }]])
|
|
36
|
+
}, [o(m(v), {
|
|
29
37
|
value: String(s.value),
|
|
30
38
|
disabled: s.disabled,
|
|
31
39
|
class: "k-radio"
|
|
32
40
|
}, {
|
|
33
|
-
default:
|
|
41
|
+
default: g(() => [o(m(_), { class: "k-radio__indicator" })]),
|
|
34
42
|
_: 1
|
|
35
|
-
}, 8, ["value", "disabled"]), s.label || e.$slots.default ? (
|
|
43
|
+
}, 8, ["value", "disabled"]), s.label || e.$slots.default ? (d(), i("span", y, [f(e.$slots, "default", {}, () => [a(p(s.label), 1)], !0)])) : r("", !0)], 2));
|
|
36
44
|
}
|
|
37
45
|
});
|
|
38
46
|
//#endregion
|
|
39
|
-
export {
|
|
47
|
+
export { b as default };
|
|
@@ -4,15 +4,17 @@ type __VLS_Props = {
|
|
|
4
4
|
direction?: 'horizontal' | 'vertical';
|
|
5
5
|
/** 分段按钮样式(对齐 naive-ui NRadioButton) */
|
|
6
6
|
button?: boolean;
|
|
7
|
+
/** 组级尺寸,下发给未单独设置 size 的 KRadio */
|
|
8
|
+
size?: 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
7
9
|
};
|
|
8
10
|
declare var __VLS_10: {};
|
|
9
11
|
type __VLS_Slots = {} & {
|
|
10
12
|
default?: (props: typeof __VLS_10) => any;
|
|
11
13
|
};
|
|
12
14
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
-
"update:modelValue": (v: string) => any;
|
|
15
|
+
"update:modelValue": (v: string | number) => any;
|
|
14
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
-
"onUpdate:modelValue"?: ((v: string) => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((v: string | number) => any) | undefined;
|
|
16
18
|
}>, {
|
|
17
19
|
button: boolean;
|
|
18
20
|
disabled: boolean;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KRadioGroup.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KRadioGroup.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c8d44ff2"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -14,15 +14,27 @@ var d = /* @__PURE__ */ n({
|
|
|
14
14
|
button: {
|
|
15
15
|
type: Boolean,
|
|
16
16
|
default: !1
|
|
17
|
-
}
|
|
17
|
+
},
|
|
18
|
+
size: {}
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:modelValue"],
|
|
20
|
-
setup(n) {
|
|
21
|
-
|
|
21
|
+
setup(n, { emit: d }) {
|
|
22
|
+
let f = n, p = d, m = /* @__PURE__ */ new Map();
|
|
23
|
+
a(e, {
|
|
24
|
+
button: s(f, "button"),
|
|
25
|
+
size: s(f, "size"),
|
|
26
|
+
register: (e) => m.set(String(e), e),
|
|
27
|
+
unregister: (e) => m.delete(String(e))
|
|
28
|
+
});
|
|
29
|
+
function h(e) {
|
|
30
|
+
let t = String(e);
|
|
31
|
+
p("update:modelValue", m.has(t) ? m.get(t) : t);
|
|
32
|
+
}
|
|
33
|
+
return (e, a) => (i(), t(c(u), {
|
|
22
34
|
"model-value": String(n.modelValue),
|
|
23
35
|
disabled: n.disabled,
|
|
24
36
|
class: r(["k-radio-group", [`k-radio-group--${n.direction}`, { "k-radio-group--button": n.button }]]),
|
|
25
|
-
"onUpdate:modelValue": a[0] ||= (
|
|
37
|
+
"onUpdate:modelValue": a[0] ||= (e) => h(String(e))
|
|
26
38
|
}, {
|
|
27
39
|
default: l(() => [o(e.$slots, "default", {}, void 0, !0)]),
|
|
28
40
|
_: 3
|
|
@@ -3,10 +3,13 @@ type __VLS_Props = {
|
|
|
3
3
|
count?: number;
|
|
4
4
|
allowHalf?: boolean;
|
|
5
5
|
readonly?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
6
7
|
size?: number;
|
|
7
8
|
color?: string;
|
|
8
9
|
/** 再次点击同值清零 */
|
|
9
10
|
clearable?: boolean;
|
|
11
|
+
/** 无障碍标签 */
|
|
12
|
+
ariaLabel?: string;
|
|
10
13
|
};
|
|
11
14
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
15
|
"update:modelValue": (v: number) => any;
|
|
@@ -14,12 +17,14 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
|
|
|
14
17
|
"onUpdate:modelValue"?: ((v: number) => any) | undefined;
|
|
15
18
|
}>, {
|
|
16
19
|
size: number;
|
|
20
|
+
disabled: boolean;
|
|
17
21
|
color: string;
|
|
18
22
|
modelValue: number;
|
|
19
23
|
readonly: boolean;
|
|
20
24
|
clearable: boolean;
|
|
21
25
|
count: number;
|
|
22
26
|
allowHalf: boolean;
|
|
27
|
+
ariaLabel: string;
|
|
23
28
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
29
|
declare const _default: typeof __VLS_export;
|
|
25
30
|
export default _default;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KRate.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KRate.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-9aa17cdf"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { Fragment as e, computed as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, ref as l, renderList as u, unref as d } from "vue";
|
|
2
2
|
import { Star as f } from "lucide-vue-next";
|
|
3
3
|
//#region components/KRate.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var p = [
|
|
4
|
+
var p = [
|
|
5
|
+
"tabindex",
|
|
6
|
+
"aria-label",
|
|
7
|
+
"aria-valuemax",
|
|
8
|
+
"aria-valuenow",
|
|
9
|
+
"aria-valuetext",
|
|
10
|
+
"aria-readonly",
|
|
11
|
+
"aria-disabled"
|
|
12
|
+
], m = ["onMousemove", "onClick"], h = /* @__PURE__ */ a({
|
|
5
13
|
__name: "KRate",
|
|
6
14
|
props: {
|
|
7
15
|
modelValue: { default: 0 },
|
|
@@ -14,39 +22,79 @@ var p = ["onMousemove", "onClick"], m = /* @__PURE__ */ a({
|
|
|
14
22
|
type: Boolean,
|
|
15
23
|
default: !1
|
|
16
24
|
},
|
|
25
|
+
disabled: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
17
29
|
size: { default: 22 },
|
|
18
30
|
color: { default: "#f59e0b" },
|
|
19
31
|
clearable: {
|
|
20
32
|
type: Boolean,
|
|
21
33
|
default: !0
|
|
22
|
-
}
|
|
34
|
+
},
|
|
35
|
+
ariaLabel: { default: "评分" }
|
|
23
36
|
},
|
|
24
37
|
emits: ["update:modelValue"],
|
|
25
|
-
setup(a, { emit:
|
|
26
|
-
let
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
setup(a, { emit: h }) {
|
|
39
|
+
let g = a, _ = h, v = l(null), y = t(() => v.value ?? g.modelValue), b = t(() => g.allowHalf ? .5 : 1);
|
|
40
|
+
function x(e) {
|
|
41
|
+
if (g.readonly || g.disabled) return;
|
|
42
|
+
let t = g.modelValue;
|
|
43
|
+
switch (e.key) {
|
|
44
|
+
case "ArrowRight":
|
|
45
|
+
case "ArrowUp":
|
|
46
|
+
t = Math.min(g.count, t + b.value);
|
|
47
|
+
break;
|
|
48
|
+
case "ArrowLeft":
|
|
49
|
+
case "ArrowDown":
|
|
50
|
+
t = Math.max(0, t - b.value);
|
|
51
|
+
break;
|
|
52
|
+
case "Home":
|
|
53
|
+
t = 0;
|
|
54
|
+
break;
|
|
55
|
+
case "End":
|
|
56
|
+
t = g.count;
|
|
57
|
+
break;
|
|
58
|
+
default: return;
|
|
59
|
+
}
|
|
60
|
+
e.preventDefault(), t !== g.modelValue && _("update:modelValue", t);
|
|
61
|
+
}
|
|
62
|
+
function S(e) {
|
|
63
|
+
let t = y.value;
|
|
64
|
+
return t >= e ? "full" : g.allowHalf && t >= e - .5 ? "half" : "empty";
|
|
30
65
|
}
|
|
31
|
-
function
|
|
32
|
-
if (!
|
|
66
|
+
function C(e, t) {
|
|
67
|
+
if (!g.allowHalf) return e;
|
|
33
68
|
let n = t.currentTarget.getBoundingClientRect();
|
|
34
69
|
return t.clientX - n.left < n.width / 2 ? e - .5 : e;
|
|
35
70
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
71
|
+
function w(e, t) {
|
|
72
|
+
g.readonly || g.disabled || (v.value = C(e, t));
|
|
38
73
|
}
|
|
39
|
-
function
|
|
40
|
-
|
|
74
|
+
function T() {
|
|
75
|
+
v.value = null;
|
|
41
76
|
}
|
|
42
|
-
function
|
|
43
|
-
if (
|
|
44
|
-
let n =
|
|
45
|
-
|
|
77
|
+
function E(e, t) {
|
|
78
|
+
if (g.readonly || g.disabled) return;
|
|
79
|
+
let n = C(e, t);
|
|
80
|
+
g.clearable && g.modelValue === n && (n = 0), _("update:modelValue", n);
|
|
46
81
|
}
|
|
47
82
|
return (t, l) => (c(), n("div", {
|
|
48
|
-
class: o(["k-rate", {
|
|
49
|
-
|
|
83
|
+
class: o(["k-rate", {
|
|
84
|
+
"k-rate--readonly": a.readonly,
|
|
85
|
+
"k-rate--disabled": a.disabled
|
|
86
|
+
}]),
|
|
87
|
+
role: "slider",
|
|
88
|
+
tabindex: a.readonly || a.disabled ? -1 : 0,
|
|
89
|
+
"aria-label": a.ariaLabel,
|
|
90
|
+
"aria-valuemin": 0,
|
|
91
|
+
"aria-valuemax": a.count,
|
|
92
|
+
"aria-valuenow": a.modelValue,
|
|
93
|
+
"aria-valuetext": `${a.modelValue} / ${a.count}`,
|
|
94
|
+
"aria-readonly": a.readonly || void 0,
|
|
95
|
+
"aria-disabled": a.disabled || void 0,
|
|
96
|
+
onMouseleave: T,
|
|
97
|
+
onKeydown: x
|
|
50
98
|
}, [(c(!0), n(e, null, u(a.count, (e) => (c(), n("span", {
|
|
51
99
|
key: e,
|
|
52
100
|
class: "k-rate__star",
|
|
@@ -54,14 +102,14 @@ var p = ["onMousemove", "onClick"], m = /* @__PURE__ */ a({
|
|
|
54
102
|
width: `${a.size}px`,
|
|
55
103
|
height: `${a.size}px`
|
|
56
104
|
}),
|
|
57
|
-
onMousemove: (t) =>
|
|
58
|
-
onClick: (t) =>
|
|
105
|
+
onMousemove: (t) => w(e, t),
|
|
106
|
+
onClick: (t) => E(e, t)
|
|
59
107
|
}, [i(d(f), {
|
|
60
108
|
size: a.size,
|
|
61
109
|
class: "k-rate__bg"
|
|
62
110
|
}, null, 8, ["size"]), r("span", {
|
|
63
111
|
class: "k-rate__fill",
|
|
64
|
-
style: s({ width:
|
|
112
|
+
style: s({ width: S(e) === "full" ? "100%" : S(e) === "half" ? "50%" : "0%" })
|
|
65
113
|
}, [i(d(f), {
|
|
66
114
|
size: a.size,
|
|
67
115
|
fill: a.color,
|
|
@@ -70,8 +118,8 @@ var p = ["onMousemove", "onClick"], m = /* @__PURE__ */ a({
|
|
|
70
118
|
"size",
|
|
71
119
|
"fill",
|
|
72
120
|
"color"
|
|
73
|
-
])], 4)], 44,
|
|
121
|
+
])], 4)], 44, m))), 128))], 42, p));
|
|
74
122
|
}
|
|
75
123
|
});
|
|
76
124
|
//#endregion
|
|
77
|
-
export {
|
|
125
|
+
export { h as default };
|
|
@@ -15,9 +15,9 @@ type __VLS_Props = {
|
|
|
15
15
|
filterPlaceholder?: string;
|
|
16
16
|
};
|
|
17
17
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
18
|
-
"update:modelValue": (v: string | number) => any;
|
|
18
|
+
"update:modelValue": (v: string | number | null) => any;
|
|
19
19
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
|
-
"onUpdate:modelValue"?: ((v: string | number) => any) | undefined;
|
|
20
|
+
"onUpdate:modelValue"?: ((v: string | number | null) => any) | undefined;
|
|
21
21
|
}>, {
|
|
22
22
|
size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
23
23
|
disabled: boolean;
|
|
@@ -4,6 +4,6 @@ import t from "./KSelect.vue_vue_type_script_setup_true_lang.js";
|
|
|
4
4
|
/* empty css */
|
|
5
5
|
/* empty css */
|
|
6
6
|
//#region components/KSelect.vue
|
|
7
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
7
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-42b3118e"]]);
|
|
8
8
|
//#endregion
|
|
9
9
|
export { n as default };
|
|
@@ -57,7 +57,7 @@ var N = {
|
|
|
57
57
|
q.value = !0;
|
|
58
58
|
}
|
|
59
59
|
function X(e) {
|
|
60
|
-
e.preventDefault(), e.stopPropagation(), z("update:modelValue", "");
|
|
60
|
+
e.preventDefault(), e.stopPropagation(), z("update:modelValue", typeof R.modelValue == "number" ? null : "");
|
|
61
61
|
}
|
|
62
62
|
let Z = t(() => R.clearable && !R.disabled && R.modelValue !== null && R.modelValue !== void 0 && R.modelValue !== "");
|
|
63
63
|
return (t, f) => (d(), n(h(k), {
|