@guoyg578/k-ui 0.1.4 → 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 +45 -43
- 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/KCombobox.vue.js +1 -1
- package/dist/components/KCombobox.vue_vue_type_script_setup_true_lang.js +48 -47
- 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 +83 -73
- package/dist/components/KDrawer.vue.js +1 -1
- package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +36 -35
- package/dist/components/KDropdown.vue.d.ts +4 -3
- package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +48 -30
- 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/KPopover.vue_vue_type_script_setup_true_lang.js +15 -14
- 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 +60 -59
- 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 +63 -49
- package/dist/components/KTooltip.vue_vue_type_script_setup_true_lang.js +13 -12
- 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 +20 -18
- 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,23 +1,16 @@
|
|
|
1
1
|
import e from "./KButton.vue.js";
|
|
2
|
-
import {
|
|
3
|
-
import { X as
|
|
2
|
+
import { createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeProps as c, openBlock as l, renderSlot as u, toDisplayString as d, unref as f, withCtx as p } from "vue";
|
|
3
|
+
import { X as m } from "lucide-vue-next";
|
|
4
|
+
import { DialogClose as h, DialogContent as g, DialogDescription as _, DialogOverlay as v, DialogPortal as y, DialogRoot as b, DialogTitle as x, VisuallyHidden as S } from "reka-ui";
|
|
4
5
|
//#region components/KDialog.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "k-dialog-stack"
|
|
8
|
-
}, S = { class: "k-dialog__center" }, C = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "k-dialog__header"
|
|
11
|
-
}, w = { class: "k-dialog__title-wrap" }, T = {
|
|
12
|
-
key: 0,
|
|
13
|
-
class: "k-dialog__title"
|
|
14
|
-
}, E = {
|
|
15
|
-
key: 1,
|
|
16
|
-
class: "k-dialog__subtitle"
|
|
17
|
-
}, D = { class: "k-dialog__body" }, O = {
|
|
6
|
+
var C = { class: "k-dialog__center" }, w = {
|
|
18
7
|
key: 1,
|
|
8
|
+
class: "k-dialog__header"
|
|
9
|
+
}, T = { class: "k-dialog__title-wrap" }, E = { class: "k-dialog__body" }, D = {
|
|
10
|
+
key: 2,
|
|
19
11
|
class: "k-dialog__footer"
|
|
20
|
-
},
|
|
12
|
+
}, O = /* @__PURE__ */ s({
|
|
13
|
+
inheritAttrs: !1,
|
|
21
14
|
__name: "KDialog",
|
|
22
15
|
props: {
|
|
23
16
|
open: { type: Boolean },
|
|
@@ -55,70 +48,87 @@ var x = {
|
|
|
55
48
|
"confirm",
|
|
56
49
|
"cancel"
|
|
57
50
|
],
|
|
58
|
-
setup(
|
|
59
|
-
let
|
|
60
|
-
function
|
|
61
|
-
|
|
51
|
+
setup(s, { emit: O }) {
|
|
52
|
+
let k = O;
|
|
53
|
+
function A(e) {
|
|
54
|
+
k("update:open", e), e || k("close");
|
|
62
55
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
56
|
+
function j() {
|
|
57
|
+
k("confirm");
|
|
65
58
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
function F() {
|
|
70
|
-
j("cancel"), M();
|
|
71
|
-
}
|
|
72
|
-
function I(e) {
|
|
73
|
-
e.key === "Escape" && A.open && A.closable && M();
|
|
59
|
+
function M() {
|
|
60
|
+
k("cancel"), A(!1);
|
|
74
61
|
}
|
|
75
|
-
function
|
|
62
|
+
function N(e) {
|
|
76
63
|
if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
|
|
77
64
|
}
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
document.body.style.overflow = e ? "hidden" : "";
|
|
82
|
-
}), (f, p) => (m(), r(t, { to: "body" }, [c(n, {
|
|
83
|
-
name: "k-dialog",
|
|
84
|
-
duration: {
|
|
85
|
-
enter: 280,
|
|
86
|
-
leave: 200
|
|
87
|
-
}
|
|
65
|
+
return (O, k) => (l(), t(f(b), {
|
|
66
|
+
open: s.open,
|
|
67
|
+
"onUpdate:open": A
|
|
88
68
|
}, {
|
|
89
|
-
default:
|
|
90
|
-
class: "k-dialog__overlay",
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
69
|
+
default: p(() => [o(f(y), null, {
|
|
70
|
+
default: p(() => [o(f(v), { class: "k-dialog__overlay" }), i("div", C, [o(f(g), c(O.$attrs, {
|
|
71
|
+
class: ["k-dialog", `k-dialog--${s.size}`],
|
|
72
|
+
style: { maxWidth: N(s.width) },
|
|
73
|
+
onPointerDownOutside: k[0] ||= (e) => {
|
|
74
|
+
s.maskClosable || e.preventDefault();
|
|
75
|
+
},
|
|
76
|
+
onEscapeKeyDown: k[1] ||= (e) => {
|
|
77
|
+
s.closable || e.preventDefault();
|
|
78
|
+
}
|
|
79
|
+
}), {
|
|
80
|
+
default: p(() => [
|
|
81
|
+
s.title || O.$slots.title ? n("", !0) : (l(), t(f(S), { key: 0 }, {
|
|
82
|
+
default: p(() => [o(f(x), null, {
|
|
83
|
+
default: p(() => [...k[2] ||= [a("对话框", -1)]]),
|
|
84
|
+
_: 1
|
|
85
|
+
})]),
|
|
86
|
+
_: 1
|
|
87
|
+
})),
|
|
88
|
+
s.title || O.$slots.title || s.closable ? (l(), r("header", w, [i("div", T, [s.title || O.$slots.title ? (l(), t(f(x), {
|
|
89
|
+
key: 0,
|
|
90
|
+
class: "k-dialog__title"
|
|
91
|
+
}, {
|
|
92
|
+
default: p(() => [u(O.$slots, "title", {}, () => [a(d(s.title), 1)], !0)]),
|
|
93
|
+
_: 3
|
|
94
|
+
})) : n("", !0), s.subtitle ? (l(), t(f(_), {
|
|
95
|
+
key: 1,
|
|
96
|
+
class: "k-dialog__subtitle"
|
|
97
|
+
}, {
|
|
98
|
+
default: p(() => [a(d(s.subtitle), 1)]),
|
|
99
|
+
_: 1
|
|
100
|
+
})) : n("", !0)]), s.closable ? (l(), t(f(h), {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: "k-dialog__close",
|
|
103
|
+
"aria-label": "关闭"
|
|
104
|
+
}, {
|
|
105
|
+
default: p(() => [o(f(m), { size: 18 })]),
|
|
106
|
+
_: 1
|
|
107
|
+
})) : n("", !0)])) : n("", !0),
|
|
108
|
+
i("div", E, [u(O.$slots, "default", {}, void 0, !0)]),
|
|
109
|
+
O.$slots.footer || s.footer ? (l(), r("footer", D, [u(O.$slots, "footer", {}, () => [s.hideCancel ? n("", !0) : (l(), t(e, {
|
|
110
|
+
key: 0,
|
|
111
|
+
type: "secondary",
|
|
112
|
+
onClick: M
|
|
113
|
+
}, {
|
|
114
|
+
default: p(() => [a(d(s.cancelText), 1)]),
|
|
115
|
+
_: 1
|
|
116
|
+
})), o(e, {
|
|
117
|
+
type: s.confirmType,
|
|
118
|
+
loading: s.confirmLoading,
|
|
119
|
+
onClick: j
|
|
120
|
+
}, {
|
|
121
|
+
default: p(() => [a(d(s.confirmText), 1)]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["type", "loading"])], !0)])) : n("", !0)
|
|
124
|
+
]),
|
|
125
|
+
_: 3
|
|
126
|
+
}, 16, ["class", "style"])])]),
|
|
127
|
+
_: 3
|
|
128
|
+
})]),
|
|
119
129
|
_: 3
|
|
120
|
-
}
|
|
130
|
+
}, 8, ["open"]));
|
|
121
131
|
}
|
|
122
132
|
});
|
|
123
133
|
//#endregion
|
|
124
|
-
export {
|
|
134
|
+
export { O as default };
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KDrawer.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KDrawer.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b6a89714"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { createBlock as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o,
|
|
2
|
-
import { X as
|
|
3
|
-
import { DialogClose as
|
|
1
|
+
import { createBlock as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, createVNode as a, defineComponent as o, mergeProps as s, openBlock as c, renderSlot as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
|
|
2
|
+
import { X as p } from "lucide-vue-next";
|
|
3
|
+
import { DialogClose as m, DialogContent as h, DialogDescription as g, DialogOverlay as _, DialogPortal as v, DialogRoot as y, DialogTitle as b } from "reka-ui";
|
|
4
4
|
//#region components/KDrawer.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var x = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "k-drawer__header"
|
|
8
|
-
},
|
|
8
|
+
}, S = { class: "k-drawer__title-wrap" }, C = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "k-drawer__header-actions"
|
|
11
|
-
},
|
|
11
|
+
}, w = { class: "k-drawer__body" }, T = {
|
|
12
12
|
key: 1,
|
|
13
13
|
class: "k-drawer__footer"
|
|
14
|
-
},
|
|
14
|
+
}, E = /* @__PURE__ */ o({
|
|
15
|
+
inheritAttrs: !1,
|
|
15
16
|
__name: "KDrawer",
|
|
16
17
|
props: {
|
|
17
18
|
open: { type: Boolean },
|
|
@@ -31,58 +32,58 @@ var S = {
|
|
|
31
32
|
height: {}
|
|
32
33
|
},
|
|
33
34
|
emits: ["update:open", "close"],
|
|
34
|
-
setup(o, { emit:
|
|
35
|
-
let
|
|
36
|
-
function
|
|
37
|
-
|
|
35
|
+
setup(o, { emit: E }) {
|
|
36
|
+
let D = E;
|
|
37
|
+
function O(e) {
|
|
38
|
+
D("update:open", e), e || D("close");
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function k(e) {
|
|
40
41
|
if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
|
|
41
42
|
}
|
|
42
|
-
return (
|
|
43
|
+
return (E, D) => (c(), e(d(y), {
|
|
43
44
|
open: o.open,
|
|
44
|
-
"onUpdate:open":
|
|
45
|
+
"onUpdate:open": O
|
|
45
46
|
}, {
|
|
46
|
-
default:
|
|
47
|
-
default:
|
|
48
|
-
class:
|
|
49
|
-
style:
|
|
50
|
-
width:
|
|
51
|
-
height:
|
|
52
|
-
}
|
|
53
|
-
onPointerDownOutside:
|
|
47
|
+
default: f(() => [a(d(v), null, {
|
|
48
|
+
default: f(() => [a(d(_), { class: "k-drawer__overlay" }), a(d(h), s(E.$attrs, {
|
|
49
|
+
class: ["k-drawer", [`k-drawer--${o.placement}`, `k-drawer--${o.size}`]],
|
|
50
|
+
style: {
|
|
51
|
+
width: k(o.width),
|
|
52
|
+
height: k(o.height)
|
|
53
|
+
},
|
|
54
|
+
onPointerDownOutside: D[0] ||= (e) => {
|
|
54
55
|
o.maskClosable || e.preventDefault();
|
|
55
56
|
},
|
|
56
|
-
onEscapeKeyDown:
|
|
57
|
+
onEscapeKeyDown: D[1] ||= (e) => {
|
|
57
58
|
o.closable || e.preventDefault();
|
|
58
59
|
}
|
|
59
|
-
}, {
|
|
60
|
-
default:
|
|
61
|
-
o.title ||
|
|
60
|
+
}), {
|
|
61
|
+
default: f(() => [
|
|
62
|
+
o.title || E.$slots.title || o.closable ? (c(), n("header", x, [r("div", S, [o.title || E.$slots.title ? (c(), e(d(b), {
|
|
62
63
|
key: 0,
|
|
63
64
|
class: "k-drawer__title"
|
|
64
65
|
}, {
|
|
65
|
-
default:
|
|
66
|
+
default: f(() => [l(E.$slots, "title", {}, () => [i(u(o.title), 1)], !0)]),
|
|
66
67
|
_: 3
|
|
67
|
-
})) : t("", !0), o.subtitle ? (
|
|
68
|
+
})) : t("", !0), o.subtitle ? (c(), e(d(g), {
|
|
68
69
|
key: 1,
|
|
69
70
|
class: "k-drawer__subtitle"
|
|
70
71
|
}, {
|
|
71
|
-
default:
|
|
72
|
+
default: f(() => [i(u(o.subtitle), 1)]),
|
|
72
73
|
_: 1
|
|
73
|
-
})) : t("", !0)]),
|
|
74
|
+
})) : t("", !0)]), E.$slots["header-extra"] || o.closable ? (c(), n("div", C, [l(E.$slots, "header-extra", {}, void 0, !0), o.closable ? (c(), e(d(m), {
|
|
74
75
|
key: 0,
|
|
75
76
|
class: "k-drawer__close",
|
|
76
77
|
"aria-label": "关闭"
|
|
77
78
|
}, {
|
|
78
|
-
default:
|
|
79
|
+
default: f(() => [a(d(p), { size: 18 })]),
|
|
79
80
|
_: 1
|
|
80
81
|
})) : t("", !0)])) : t("", !0)])) : t("", !0),
|
|
81
|
-
r("div",
|
|
82
|
-
|
|
82
|
+
r("div", w, [l(E.$slots, "default", {}, void 0, !0)]),
|
|
83
|
+
E.$slots.footer ? (c(), n("footer", T, [l(E.$slots, "footer", {}, void 0, !0)])) : t("", !0)
|
|
83
84
|
]),
|
|
84
85
|
_: 3
|
|
85
|
-
},
|
|
86
|
+
}, 16, ["class", "style"])]),
|
|
86
87
|
_: 3
|
|
87
88
|
})]),
|
|
88
89
|
_: 3
|
|
@@ -90,4 +91,4 @@ var S = {
|
|
|
90
91
|
}
|
|
91
92
|
});
|
|
92
93
|
//#endregion
|
|
93
|
-
export {
|
|
94
|
+
export { E as default };
|
|
@@ -19,7 +19,7 @@ type __VLS_Props = {
|
|
|
19
19
|
items?: DropdownItem[];
|
|
20
20
|
/** naive-ui alias */
|
|
21
21
|
options?: DropdownItem[];
|
|
22
|
-
trigger?: 'click' | 'hover'
|
|
22
|
+
trigger?: 'click' | 'hover';
|
|
23
23
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
24
24
|
align?: 'start' | 'center' | 'end';
|
|
25
25
|
sideOffset?: number;
|
|
@@ -30,11 +30,11 @@ type __VLS_ModelProps = {
|
|
|
30
30
|
'open'?: boolean;
|
|
31
31
|
};
|
|
32
32
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
33
|
-
declare var __VLS_14: {},
|
|
33
|
+
declare var __VLS_14: {}, __VLS_55: {};
|
|
34
34
|
type __VLS_Slots = {} & {
|
|
35
35
|
default?: (props: typeof __VLS_14) => any;
|
|
36
36
|
} & {
|
|
37
|
-
extra?: (props: typeof
|
|
37
|
+
extra?: (props: typeof __VLS_55) => any;
|
|
38
38
|
};
|
|
39
39
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
40
40
|
"update:open": (value: boolean | undefined) => any;
|
|
@@ -48,6 +48,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
48
48
|
align: "start" | "center" | "end";
|
|
49
49
|
side: "top" | "right" | "bottom" | "left";
|
|
50
50
|
sideOffset: number;
|
|
51
|
+
trigger: "click" | "hover";
|
|
51
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
52
53
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
53
54
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,15 +1,16 @@
|
|
|
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, mergeModels as l,
|
|
2
|
-
import { DropdownMenuContent 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, mergeModels as l, mergeProps as u, normalizeClass as d, onScopeDispose as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useModel as y, withCtx as b } from "vue";
|
|
2
|
+
import { DropdownMenuContent as x, DropdownMenuItem as S, DropdownMenuLabel as C, DropdownMenuPortal as w, DropdownMenuRoot as T, DropdownMenuSeparator as E, DropdownMenuTrigger as D } from "reka-ui";
|
|
3
3
|
//#region components/KDropdown.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var O = { class: "k-dropdown-item__label" }, k = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "k-dropdown-item__shortcut"
|
|
7
|
-
},
|
|
7
|
+
}, A = /* @__PURE__ */ c({
|
|
8
|
+
inheritAttrs: !1,
|
|
8
9
|
__name: "KDropdown",
|
|
9
10
|
props: /* @__PURE__ */ l({
|
|
10
11
|
items: {},
|
|
11
12
|
options: {},
|
|
12
|
-
trigger: {},
|
|
13
|
+
trigger: { default: "click" },
|
|
13
14
|
side: { default: "bottom" },
|
|
14
15
|
align: { default: "end" },
|
|
15
16
|
sideOffset: { default: 6 },
|
|
@@ -24,60 +25,77 @@ var E = { class: "k-dropdown-item__label" }, D = {
|
|
|
24
25
|
}),
|
|
25
26
|
emits: /* @__PURE__ */ l(["select"], ["update:open"]),
|
|
26
27
|
setup(c, { emit: l }) {
|
|
27
|
-
let
|
|
28
|
-
function
|
|
29
|
-
e.disabled ||
|
|
28
|
+
let A = c, j = y(c, "open"), M = l, N = t(() => A.items ?? A.options ?? []);
|
|
29
|
+
function P(e) {
|
|
30
|
+
e.disabled || M("select", e.key, e);
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
let F = t(() => A.trigger === "hover"), I;
|
|
33
|
+
function L() {
|
|
34
|
+
I &&= (clearTimeout(I), void 0);
|
|
35
|
+
}
|
|
36
|
+
function R() {
|
|
37
|
+
!F.value || A.disabled || (L(), j.value = !0);
|
|
38
|
+
}
|
|
39
|
+
function z() {
|
|
40
|
+
F.value && (L(), I = setTimeout(() => j.value = !1, 120));
|
|
41
|
+
}
|
|
42
|
+
return f(L), (t, l) => (p(), n(v(T), {
|
|
43
|
+
open: j.value,
|
|
44
|
+
"onUpdate:open": l[0] ||= (e) => j.value = e,
|
|
45
|
+
modal: !F.value
|
|
34
46
|
}, {
|
|
35
|
-
default:
|
|
47
|
+
default: b(() => [s(v(D), {
|
|
36
48
|
"as-child": "",
|
|
37
49
|
disabled: c.disabled
|
|
38
50
|
}, {
|
|
39
|
-
default:
|
|
51
|
+
default: b(() => [a("span", u(t.$attrs, {
|
|
52
|
+
class: ["k-dropdown-trigger", { "k-dropdown-trigger--disabled": c.disabled }],
|
|
53
|
+
onMouseenter: R,
|
|
54
|
+
onMouseleave: z
|
|
55
|
+
}), [h(t.$slots, "default")], 16)]),
|
|
40
56
|
_: 3
|
|
41
|
-
}, 8, ["disabled"]), s(
|
|
42
|
-
default:
|
|
43
|
-
class:
|
|
57
|
+
}, 8, ["disabled"]), s(v(w), null, {
|
|
58
|
+
default: b(() => [s(v(x), {
|
|
59
|
+
class: d(["k-dropdown-content k-menu-surface", c.contentClass]),
|
|
44
60
|
side: c.side,
|
|
45
61
|
align: c.align,
|
|
46
|
-
"side-offset": c.sideOffset
|
|
62
|
+
"side-offset": c.sideOffset,
|
|
63
|
+
onMouseenter: L,
|
|
64
|
+
onMouseleave: z
|
|
47
65
|
}, {
|
|
48
|
-
default:
|
|
66
|
+
default: b(() => [(p(!0), i(e, null, m(N.value, (t, s) => (p(), i(e, { key: t.key ?? `_${s}` }, [t.type === "separator" ? (p(), n(v(E), {
|
|
49
67
|
key: 0,
|
|
50
68
|
class: "k-dropdown-sep"
|
|
51
|
-
})) : t.type === "label" ? (
|
|
69
|
+
})) : t.type === "label" ? (p(), n(v(C), {
|
|
52
70
|
key: 1,
|
|
53
71
|
class: "k-dropdown-label"
|
|
54
72
|
}, {
|
|
55
|
-
default:
|
|
73
|
+
default: b(() => [o(_(t.label), 1)]),
|
|
56
74
|
_: 2
|
|
57
|
-
}, 1024)) : (
|
|
75
|
+
}, 1024)) : (p(), n(v(S), {
|
|
58
76
|
key: 2,
|
|
59
|
-
class:
|
|
77
|
+
class: d(["k-dropdown-item k-menu-item", {
|
|
60
78
|
"k-dropdown-item--danger": t.danger,
|
|
61
79
|
"k-dropdown-item--active": t.active
|
|
62
80
|
}]),
|
|
63
81
|
disabled: t.disabled,
|
|
64
|
-
onSelect: (e) =>
|
|
82
|
+
onSelect: (e) => P(t)
|
|
65
83
|
}, {
|
|
66
|
-
default:
|
|
67
|
-
t.icon ? (
|
|
84
|
+
default: b(() => [
|
|
85
|
+
t.icon ? (p(), n(g(t.icon), {
|
|
68
86
|
key: 0,
|
|
69
87
|
size: 15,
|
|
70
88
|
class: "k-dropdown-item__icon"
|
|
71
89
|
})) : r("", !0),
|
|
72
|
-
a("span",
|
|
73
|
-
t.shortcut ? (
|
|
90
|
+
a("span", O, _(t.label), 1),
|
|
91
|
+
t.shortcut ? (p(), i("span", k, _(t.shortcut), 1)) : r("", !0)
|
|
74
92
|
]),
|
|
75
93
|
_: 2
|
|
76
94
|
}, 1032, [
|
|
77
95
|
"class",
|
|
78
96
|
"disabled",
|
|
79
97
|
"onSelect"
|
|
80
|
-
]))], 64))), 128)),
|
|
98
|
+
]))], 64))), 128)), h(t.$slots, "extra")]),
|
|
81
99
|
_: 3
|
|
82
100
|
}, 8, [
|
|
83
101
|
"class",
|
|
@@ -88,8 +106,8 @@ var E = { class: "k-dropdown-item__label" }, D = {
|
|
|
88
106
|
_: 3
|
|
89
107
|
})]),
|
|
90
108
|
_: 3
|
|
91
|
-
}, 8, ["open"]));
|
|
109
|
+
}, 8, ["open", "modal"]));
|
|
92
110
|
}
|
|
93
111
|
});
|
|
94
112
|
//#endregion
|
|
95
|
-
export {
|
|
113
|
+
export { A as default };
|
|
@@ -3,6 +3,7 @@ type __VLS_Props = {
|
|
|
3
3
|
min?: number;
|
|
4
4
|
max?: number;
|
|
5
5
|
placeholder?: string;
|
|
6
|
+
size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
6
7
|
/** 新增行的默认值工厂 */
|
|
7
8
|
onCreate?: () => any;
|
|
8
9
|
};
|
|
@@ -19,6 +20,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
19
20
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
20
21
|
"onUpdate:modelValue"?: ((v: any[]) => any) | undefined;
|
|
21
22
|
}>, {
|
|
23
|
+
size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
22
24
|
min: number;
|
|
23
25
|
modelValue: any[];
|
|
24
26
|
placeholder: string;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KDynamicInput.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KDynamicInput.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-df0a67d3"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -10,6 +10,7 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
|
|
|
10
10
|
min: { default: 0 },
|
|
11
11
|
max: {},
|
|
12
12
|
placeholder: { default: "请输入" },
|
|
13
|
+
size: { default: "md" },
|
|
13
14
|
onCreate: {}
|
|
14
15
|
},
|
|
15
16
|
emits: ["update:modelValue"],
|
|
@@ -42,13 +43,15 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
|
|
|
42
43
|
}, () => [c(t, {
|
|
43
44
|
"model-value": n,
|
|
44
45
|
placeholder: l.placeholder,
|
|
46
|
+
size: l.size,
|
|
45
47
|
"onUpdate:modelValue": (e) => E(r, e)
|
|
46
48
|
}, null, 8, [
|
|
47
49
|
"model-value",
|
|
48
50
|
"placeholder",
|
|
51
|
+
"size",
|
|
49
52
|
"onUpdate:modelValue"
|
|
50
53
|
])], !0)]), o("div", y, [c(e, {
|
|
51
|
-
size:
|
|
54
|
+
size: l.size,
|
|
52
55
|
quaternary: "",
|
|
53
56
|
circle: "",
|
|
54
57
|
disabled: l.modelValue.length <= l.min,
|
|
@@ -56,8 +59,12 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
|
|
|
56
59
|
}, {
|
|
57
60
|
icon: m(() => [c(p(g), { size: 15 })]),
|
|
58
61
|
_: 1
|
|
59
|
-
}, 8, [
|
|
60
|
-
size
|
|
62
|
+
}, 8, [
|
|
63
|
+
"size",
|
|
64
|
+
"disabled",
|
|
65
|
+
"onClick"
|
|
66
|
+
]), c(e, {
|
|
67
|
+
size: l.size,
|
|
61
68
|
quaternary: "",
|
|
62
69
|
circle: "",
|
|
63
70
|
disabled: l.max != null && l.modelValue.length >= l.max,
|
|
@@ -65,16 +72,20 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
|
|
|
65
72
|
}, {
|
|
66
73
|
icon: m(() => [c(p(h), { size: 15 })]),
|
|
67
74
|
_: 1
|
|
68
|
-
}, 8, [
|
|
75
|
+
}, 8, [
|
|
76
|
+
"size",
|
|
77
|
+
"disabled",
|
|
78
|
+
"onClick"
|
|
79
|
+
])])]))), 128)), l.modelValue.length === 0 ? (u(), r(e, {
|
|
69
80
|
key: 0,
|
|
70
|
-
size:
|
|
81
|
+
size: l.size,
|
|
71
82
|
disabled: l.max != null && l.modelValue.length >= l.max,
|
|
72
83
|
onClick: x[0] ||= (e) => w()
|
|
73
84
|
}, {
|
|
74
85
|
icon: m(() => [c(p(h), { size: 15 })]),
|
|
75
86
|
default: m(() => [x[1] ||= s(" 添加一行 ", -1)]),
|
|
76
87
|
_: 1
|
|
77
|
-
}, 8, ["disabled"])) : i("", !0)]));
|
|
88
|
+
}, 8, ["size", "disabled"])) : i("", !0)]));
|
|
78
89
|
}
|
|
79
90
|
});
|
|
80
91
|
//#endregion
|
|
@@ -5,12 +5,14 @@ type __VLS_Props = {
|
|
|
5
5
|
/** 是否允许重复值 */
|
|
6
6
|
allowDuplicate?: boolean;
|
|
7
7
|
placeholder?: string;
|
|
8
|
+
size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
8
9
|
};
|
|
9
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
10
11
|
"update:modelValue": (v: string[]) => any;
|
|
11
12
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
13
|
"onUpdate:modelValue"?: ((v: string[]) => any) | undefined;
|
|
13
14
|
}>, {
|
|
15
|
+
size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
14
16
|
disabled: boolean;
|
|
15
17
|
modelValue: string[];
|
|
16
18
|
placeholder: string;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KDynamicTags.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KDynamicTags.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-2cee2891"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -14,31 +14,32 @@ var b = ["onClick"], x = ["placeholder", "onKeydown"], S = /* @__PURE__ */ o({
|
|
|
14
14
|
type: Boolean,
|
|
15
15
|
default: !1
|
|
16
16
|
},
|
|
17
|
-
placeholder: { default: "输入后回车" }
|
|
17
|
+
placeholder: { default: "输入后回车" },
|
|
18
|
+
size: { default: "md" }
|
|
18
19
|
},
|
|
19
20
|
emits: ["update:modelValue"],
|
|
20
21
|
setup(o, { emit: S }) {
|
|
21
|
-
let C = o, w = S, T = u(!1), E = u(""), D = u(null), O = t(() => C.max != null && C.modelValue.length >= C.max);
|
|
22
|
-
async function
|
|
22
|
+
let C = o, w = S, T = u(!1), E = u(""), D = u(null), O = t(() => C.max != null && C.modelValue.length >= C.max), k = t(() => C.size === "tiny" || C.size === "xs" || C.size === "small" || C.size === "sm" ? "sm" : C.size === "large" || C.size === "lg" ? "lg" : "md");
|
|
23
|
+
async function A() {
|
|
23
24
|
C.disabled || O.value || (T.value = !0, await s(), D.value?.focus());
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
+
function j() {
|
|
26
27
|
let e = E.value.trim();
|
|
27
28
|
e && (C.allowDuplicate || !C.modelValue.includes(e)) && w("update:modelValue", [...C.modelValue, e]), E.value = "", T.value = !1;
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function M(e) {
|
|
30
31
|
if (C.disabled) return;
|
|
31
32
|
let t = C.modelValue.slice();
|
|
32
33
|
t.splice(e, 1), w("update:modelValue", t);
|
|
33
34
|
}
|
|
34
|
-
return (t, s) => (l(), r("div", { class: c(["k-dtags", { "k-dtags--disabled": o.disabled }]) }, [(l(!0), r(e, null, d(o.modelValue, (e, t) => (l(), r("span", {
|
|
35
|
+
return (t, s) => (l(), r("div", { class: c(["k-dtags", [`k-dtags--${k.value}`, { "k-dtags--disabled": o.disabled }]]) }, [(l(!0), r(e, null, d(o.modelValue, (e, t) => (l(), r("span", {
|
|
35
36
|
key: `${e}-${t}`,
|
|
36
37
|
class: "k-dtags__tag"
|
|
37
38
|
}, [i(f(e) + " ", 1), o.disabled ? n("", !0) : (l(), r("button", {
|
|
38
39
|
key: 0,
|
|
39
40
|
type: "button",
|
|
40
41
|
class: "k-dtags__close",
|
|
41
|
-
onClick: (e) =>
|
|
42
|
+
onClick: (e) => M(t)
|
|
42
43
|
}, [a(p(y), { size: 12 })], 8, b))]))), 128)), T.value ? h((l(), r("input", {
|
|
43
44
|
key: 0,
|
|
44
45
|
ref_key: "inputEl",
|
|
@@ -46,13 +47,13 @@ var b = ["onClick"], x = ["placeholder", "onKeydown"], S = /* @__PURE__ */ o({
|
|
|
46
47
|
"onUpdate:modelValue": s[0] ||= (e) => E.value = e,
|
|
47
48
|
class: "k-dtags__input",
|
|
48
49
|
placeholder: o.placeholder,
|
|
49
|
-
onKeydown: g(_(
|
|
50
|
-
onBlur:
|
|
50
|
+
onKeydown: g(_(j, ["prevent"]), ["enter"]),
|
|
51
|
+
onBlur: j
|
|
51
52
|
}, null, 40, x)), [[m, E.value]]) : !o.disabled && !O.value ? (l(), r("button", {
|
|
52
53
|
key: 1,
|
|
53
54
|
type: "button",
|
|
54
55
|
class: "k-dtags__add",
|
|
55
|
-
onClick:
|
|
56
|
+
onClick: A
|
|
56
57
|
}, [a(p(v), { size: 13 }), s[1] ||= i(" 添加 ", -1)])) : n("", !0)], 2));
|
|
57
58
|
}
|
|
58
59
|
});
|