@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,39 +1,59 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { CHECKBOX_GROUP_KEY as e } from "./checkbox-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, 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 { Check as _, Minus as v } from "lucide-vue-next";
|
|
4
|
+
import { CheckboxIndicator as y, CheckboxRoot as b } from "reka-ui";
|
|
4
5
|
//#region components/KCheckbox.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var x = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "k-cb__label"
|
|
8
|
-
},
|
|
9
|
+
}, S = /* @__PURE__ */ s({
|
|
9
10
|
__name: "KCheckbox",
|
|
10
11
|
props: {
|
|
11
12
|
modelValue: {
|
|
12
13
|
type: Boolean,
|
|
13
14
|
default: !1
|
|
14
15
|
},
|
|
16
|
+
indeterminate: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !1
|
|
19
|
+
},
|
|
15
20
|
value: {},
|
|
16
21
|
disabled: {
|
|
17
22
|
type: Boolean,
|
|
18
23
|
default: !1
|
|
19
24
|
},
|
|
20
|
-
label: {}
|
|
25
|
+
label: {},
|
|
26
|
+
size: {}
|
|
21
27
|
},
|
|
22
28
|
emits: ["update:modelValue"],
|
|
23
|
-
setup(
|
|
24
|
-
let
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
setup(s) {
|
|
30
|
+
let S = s, C = t(() => S.indeterminate ? "indeterminate" : S.modelValue), w = c(e, null), T = t(() => S.value === void 0 ? void 0 : String(S.value));
|
|
31
|
+
h(() => S.value, (e, t) => {
|
|
32
|
+
w && (t !== void 0 && t !== e && w.unregister(t), e !== void 0 && w.register(e));
|
|
33
|
+
}, { immediate: !0 }), u(() => {
|
|
34
|
+
w && S.value !== void 0 && w.unregister(S.value);
|
|
35
|
+
});
|
|
36
|
+
let E = t(() => S.size ?? w?.size?.value ?? "md"), D = t(() => {
|
|
37
|
+
let e = E.value;
|
|
38
|
+
return e === "small" || e === "sm" ? "sm" : e === "large" || e === "lg" ? "lg" : "md";
|
|
39
|
+
});
|
|
40
|
+
return (e, t) => (d(), i("label", { class: l(["k-cb-wrap", [`k-cb-wrap--${D.value}`, { "k-cb-wrap--disabled": s.disabled }]]) }, [o(m(b), {
|
|
41
|
+
"model-value": C.value,
|
|
42
|
+
value: T.value,
|
|
43
|
+
disabled: s.disabled,
|
|
29
44
|
class: "k-cb",
|
|
30
|
-
"onUpdate:modelValue":
|
|
45
|
+
"onUpdate:modelValue": t[0] ||= (t) => e.$emit("update:modelValue", !!t)
|
|
31
46
|
}, {
|
|
32
|
-
default:
|
|
33
|
-
default:
|
|
47
|
+
default: g(() => [o(m(y), { class: "k-cb__indicator" }, {
|
|
48
|
+
default: g(() => [s.indeterminate ? (d(), n(m(v), {
|
|
49
|
+
key: 0,
|
|
50
|
+
size: 11,
|
|
51
|
+
"stroke-width": 3
|
|
52
|
+
})) : (d(), n(m(_), {
|
|
53
|
+
key: 1,
|
|
34
54
|
size: 11,
|
|
35
55
|
"stroke-width": 3
|
|
36
|
-
})]),
|
|
56
|
+
}))]),
|
|
37
57
|
_: 1
|
|
38
58
|
})]),
|
|
39
59
|
_: 1
|
|
@@ -41,8 +61,8 @@ var h = {
|
|
|
41
61
|
"model-value",
|
|
42
62
|
"value",
|
|
43
63
|
"disabled"
|
|
44
|
-
]),
|
|
64
|
+
]), s.label || e.$slots.default ? (d(), i("span", x, [f(e.$slots, "default", {}, () => [a(p(s.label), 1)], !0)])) : r("", !0)], 2));
|
|
45
65
|
}
|
|
46
66
|
});
|
|
47
67
|
//#endregion
|
|
48
|
-
export {
|
|
68
|
+
export { S as default };
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KCheckboxGroup.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KCheckboxGroup.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-6f7dd148"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CHECKBOX_GROUP_KEY as e } from "./checkbox-context.js";
|
|
2
|
+
import { computed as t, createBlock as n, defineComponent as r, normalizeClass as i, openBlock as a, provide as o, renderSlot as s, toRef as c, unref as l, withCtx as u } from "vue";
|
|
3
|
+
import { CheckboxGroupRoot as d } from "reka-ui";
|
|
3
4
|
//#region components/KCheckboxGroup.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
+
var f = /* @__PURE__ */ r({
|
|
5
6
|
__name: "KCheckboxGroup",
|
|
6
7
|
props: {
|
|
7
8
|
modelValue: { default: () => [] },
|
|
@@ -9,21 +10,28 @@ var l = /* @__PURE__ */ n({
|
|
|
9
10
|
type: Boolean,
|
|
10
11
|
default: !1
|
|
11
12
|
},
|
|
12
|
-
direction: { default: "horizontal" }
|
|
13
|
+
direction: { default: "horizontal" },
|
|
14
|
+
size: {}
|
|
13
15
|
},
|
|
14
16
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
setup(r, { emit: f }) {
|
|
18
|
+
let p = r, m = f, h = /* @__PURE__ */ new Map();
|
|
19
|
+
o(e, {
|
|
20
|
+
size: c(p, "size"),
|
|
21
|
+
register: (e) => h.set(String(e), e),
|
|
22
|
+
unregister: (e) => h.delete(String(e))
|
|
23
|
+
});
|
|
24
|
+
let g = t(() => p.modelValue.map((e) => String(e)));
|
|
25
|
+
function _(e) {
|
|
26
|
+
m("update:modelValue", e.map((e) => h.has(e) ? h.get(e) : e));
|
|
19
27
|
}
|
|
20
|
-
return (e,
|
|
21
|
-
"model-value":
|
|
22
|
-
disabled:
|
|
23
|
-
class:
|
|
24
|
-
"onUpdate:modelValue":
|
|
28
|
+
return (e, t) => (a(), n(l(d), {
|
|
29
|
+
"model-value": g.value,
|
|
30
|
+
disabled: r.disabled,
|
|
31
|
+
class: i(["k-cb-group", `k-cb-group--${r.direction}`]),
|
|
32
|
+
"onUpdate:modelValue": t[0] ||= (e) => _(e)
|
|
25
33
|
}, {
|
|
26
|
-
default:
|
|
34
|
+
default: u(() => [s(e.$slots, "default", {}, void 0, !0)]),
|
|
27
35
|
_: 3
|
|
28
36
|
}, 8, [
|
|
29
37
|
"model-value",
|
|
@@ -33,4 +41,4 @@ var l = /* @__PURE__ */ n({
|
|
|
33
41
|
}
|
|
34
42
|
});
|
|
35
43
|
//#endregion
|
|
36
|
-
export {
|
|
44
|
+
export { f as default };
|
|
@@ -3,9 +3,11 @@ type __VLS_Props = {
|
|
|
3
3
|
/** 手风琴模式:同时只展开一项 */
|
|
4
4
|
accordion?: boolean;
|
|
5
5
|
};
|
|
6
|
-
declare var __VLS_10: {};
|
|
6
|
+
declare var __VLS_10: {}, __VLS_21: {};
|
|
7
7
|
type __VLS_Slots = {} & {
|
|
8
8
|
default?: (props: typeof __VLS_10) => any;
|
|
9
|
+
} & {
|
|
10
|
+
default?: (props: typeof __VLS_21) => any;
|
|
9
11
|
};
|
|
10
12
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
13
|
"update:modelValue": (v: string[]) => any;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KCollapse.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KCollapse.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-0f4f3bc1"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AccordionRoot as
|
|
1
|
+
import { computed as e, createBlock as t, defineComponent as n, openBlock as r, renderSlot as i, unref as a, withCtx as o } from "vue";
|
|
2
|
+
import { AccordionRoot as s } from "reka-ui";
|
|
3
3
|
//#region components/KCollapse.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var c = /* @__PURE__ */ n({
|
|
5
5
|
__name: "KCollapse",
|
|
6
6
|
props: {
|
|
7
7
|
modelValue: { default: () => [] },
|
|
@@ -11,25 +11,36 @@ var s = /* @__PURE__ */ t({
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
let
|
|
16
|
-
function
|
|
17
|
-
let t = Array.isArray(e) ? e
|
|
18
|
-
|
|
19
|
-
let e = t.find((e) => !c.modelValue.includes(e));
|
|
20
|
-
l("update:modelValue", e ? [e] : []);
|
|
21
|
-
} else l("update:modelValue", t);
|
|
14
|
+
setup(n, { emit: c }) {
|
|
15
|
+
let l = n, u = c, d = e(() => l.modelValue[0] ?? "");
|
|
16
|
+
function f(e) {
|
|
17
|
+
let t = Array.isArray(e) ? e[0] : e;
|
|
18
|
+
u("update:modelValue", t ? [t] : []);
|
|
22
19
|
}
|
|
23
|
-
|
|
20
|
+
function p(e) {
|
|
21
|
+
u("update:modelValue", Array.isArray(e) ? e : e ? [e] : []);
|
|
22
|
+
}
|
|
23
|
+
return (e, c) => n.accordion ? (r(), t(a(s), {
|
|
24
|
+
key: 0,
|
|
25
|
+
type: "single",
|
|
26
|
+
collapsible: "",
|
|
27
|
+
"model-value": d.value,
|
|
28
|
+
class: "k-collapse",
|
|
29
|
+
"onUpdate:modelValue": f
|
|
30
|
+
}, {
|
|
31
|
+
default: o(() => [i(e.$slots, "default", {}, void 0, !0)]),
|
|
32
|
+
_: 3
|
|
33
|
+
}, 8, ["model-value"])) : (r(), t(a(s), {
|
|
34
|
+
key: 1,
|
|
24
35
|
type: "multiple",
|
|
25
|
-
"model-value":
|
|
36
|
+
"model-value": n.modelValue,
|
|
26
37
|
class: "k-collapse",
|
|
27
|
-
"onUpdate:modelValue":
|
|
38
|
+
"onUpdate:modelValue": p
|
|
28
39
|
}, {
|
|
29
|
-
default:
|
|
40
|
+
default: o(() => [i(e.$slots, "default", {}, void 0, !0)]),
|
|
30
41
|
_: 3
|
|
31
42
|
}, 8, ["model-value"]));
|
|
32
43
|
}
|
|
33
44
|
});
|
|
34
45
|
//#endregion
|
|
35
|
-
export {
|
|
46
|
+
export { c as default };
|
|
@@ -3,6 +3,6 @@ import t from "./KCombobox.vue_vue_type_script_setup_true_lang.js";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region components/KCombobox.vue
|
|
6
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-d3c61058"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
|
@@ -1,14 +1,15 @@
|
|
|
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,
|
|
2
|
-
import { Check as
|
|
3
|
-
import { ComboboxAnchor 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, mergeProps as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, withCtx as g, withModifiers as _ } from "vue";
|
|
2
|
+
import { Check as v, ChevronDown as y, X as b } from "lucide-vue-next";
|
|
3
|
+
import { ComboboxAnchor as x, ComboboxContent as S, ComboboxEmpty as C, ComboboxInput as w, ComboboxItem as T, ComboboxItemIndicator as E, ComboboxPortal as D, ComboboxRoot as O, ComboboxTrigger as k, ComboboxViewport as A } from "reka-ui";
|
|
4
4
|
//#region components/KCombobox.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var j = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "k-cmb-chips"
|
|
8
|
-
},
|
|
8
|
+
}, M = ["onClick"], N = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "k-cmb-hint"
|
|
11
|
-
},
|
|
11
|
+
}, P = /* @__PURE__ */ c({
|
|
12
|
+
inheritAttrs: !1,
|
|
12
13
|
__name: "KCombobox",
|
|
13
14
|
props: {
|
|
14
15
|
modelValue: {},
|
|
@@ -30,74 +31,74 @@ var A = {
|
|
|
30
31
|
emptyText: { default: "无匹配项" }
|
|
31
32
|
},
|
|
32
33
|
emits: ["update:modelValue"],
|
|
33
|
-
setup(c, { emit:
|
|
34
|
-
let
|
|
35
|
-
function
|
|
36
|
-
|
|
34
|
+
setup(c, { emit: P }) {
|
|
35
|
+
let F = c, I = P, L = f(""), R = t(() => F.multiple ? Array.isArray(F.modelValue) ? F.modelValue : [] : F.modelValue == null ? "" : String(F.modelValue));
|
|
36
|
+
function z(e) {
|
|
37
|
+
I("update:modelValue", e);
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
t.stopPropagation(), !(!
|
|
39
|
+
function B(e, t) {
|
|
40
|
+
t.stopPropagation(), !(!F.multiple || !Array.isArray(F.modelValue)) && I("update:modelValue", F.modelValue.filter((t) => t !== e));
|
|
40
41
|
}
|
|
41
|
-
let
|
|
42
|
-
if (
|
|
43
|
-
let e =
|
|
44
|
-
return e ?
|
|
42
|
+
let V = (e) => F.options.find((t) => t.value === e)?.label ?? e, H = t(() => {
|
|
43
|
+
if (F.multiple) return "";
|
|
44
|
+
let e = R.value;
|
|
45
|
+
return e ? V(e) : "";
|
|
45
46
|
});
|
|
46
|
-
return (t,
|
|
47
|
-
"model-value":
|
|
47
|
+
return (t, f) => (d(), n(h(O), {
|
|
48
|
+
"model-value": R.value,
|
|
48
49
|
disabled: c.disabled,
|
|
49
50
|
multiple: c.multiple,
|
|
50
|
-
"search-term":
|
|
51
|
-
"onUpdate:modelValue":
|
|
52
|
-
"onUpdate:searchTerm":
|
|
51
|
+
"search-term": L.value,
|
|
52
|
+
"onUpdate:modelValue": z,
|
|
53
|
+
"onUpdate:searchTerm": f[1] ||= (e) => L.value = e
|
|
53
54
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
default:
|
|
55
|
+
default: g(() => [s(h(x), l(t.$attrs, { class: ["k-cmb-anchor", [`k-cmb-anchor--${c.size}`, { "k-cmb-anchor--disabled": c.disabled }]] }), {
|
|
56
|
+
default: g(() => [c.multiple ? (d(), i("div", j, [(d(!0), i(e, null, p(R.value, (e) => (d(), i("span", {
|
|
56
57
|
key: e,
|
|
57
58
|
class: "k-cmb-chip"
|
|
58
|
-
}, [o(
|
|
59
|
+
}, [o(m(V(e)) + " ", 1), a("button", {
|
|
59
60
|
type: "button",
|
|
60
61
|
class: "k-cmb-chip__close",
|
|
61
|
-
onMousedown:
|
|
62
|
-
onClick: (t) =>
|
|
63
|
-
}, [s(
|
|
64
|
-
placeholder:
|
|
62
|
+
onMousedown: f[0] ||= _(() => {}, ["prevent"]),
|
|
63
|
+
onClick: (t) => B(e, t)
|
|
64
|
+
}, [s(h(b), { size: 9 })], 40, M)]))), 128)), s(h(w), {
|
|
65
|
+
placeholder: R.value.length === 0 ? c.placeholder : "",
|
|
65
66
|
class: "k-cmb-input k-cmb-input--multi"
|
|
66
|
-
}, null, 8, ["placeholder"])])) : (
|
|
67
|
+
}, null, 8, ["placeholder"])])) : (d(), i(e, { key: 1 }, [c.searchable ? (d(), n(h(w), {
|
|
67
68
|
key: 0,
|
|
68
|
-
placeholder:
|
|
69
|
-
"display-value": (e) =>
|
|
69
|
+
placeholder: H.value || c.placeholder,
|
|
70
|
+
"display-value": (e) => V(e),
|
|
70
71
|
class: "k-cmb-input"
|
|
71
|
-
}, null, 8, ["placeholder", "display-value"])) : (
|
|
72
|
+
}, null, 8, ["placeholder", "display-value"])) : (d(), i("span", {
|
|
72
73
|
key: 1,
|
|
73
|
-
class:
|
|
74
|
-
},
|
|
75
|
-
default:
|
|
74
|
+
class: u(["k-cmb-display", { "k-cmb-display--placeholder": !H.value }])
|
|
75
|
+
}, m(H.value || c.placeholder || "请选择"), 3))], 64)), s(h(k), { class: "k-cmb-trigger" }, {
|
|
76
|
+
default: g(() => [s(h(y), { size: 14 })]),
|
|
76
77
|
_: 1
|
|
77
78
|
})]),
|
|
78
79
|
_: 1
|
|
79
|
-
},
|
|
80
|
-
default:
|
|
80
|
+
}, 16, ["class"]), s(h(D), null, {
|
|
81
|
+
default: g(() => [s(h(S), {
|
|
81
82
|
class: "k-cmb-content k-menu",
|
|
82
83
|
position: "popper",
|
|
83
84
|
"side-offset": 6
|
|
84
85
|
}, {
|
|
85
|
-
default:
|
|
86
|
-
default:
|
|
86
|
+
default: g(() => [s(h(C), { class: "k-cmb-empty" }, {
|
|
87
|
+
default: g(() => [o(m(c.emptyText), 1)]),
|
|
87
88
|
_: 1
|
|
88
|
-
}), s(
|
|
89
|
-
default:
|
|
89
|
+
}), s(h(A), { class: "k-cmb-viewport" }, {
|
|
90
|
+
default: g(() => [(d(!0), i(e, null, p(c.options, (e) => (d(), n(h(T), {
|
|
90
91
|
key: e.value,
|
|
91
92
|
value: e.value,
|
|
92
93
|
class: "k-cmb-item"
|
|
93
94
|
}, {
|
|
94
|
-
default:
|
|
95
|
-
s(
|
|
96
|
-
default:
|
|
95
|
+
default: g(() => [
|
|
96
|
+
s(h(E), { class: "k-cmb-indicator" }, {
|
|
97
|
+
default: g(() => [s(h(v), { size: 12 })]),
|
|
97
98
|
_: 1
|
|
98
99
|
}),
|
|
99
|
-
a("span", null,
|
|
100
|
-
e.hint ? (
|
|
100
|
+
a("span", null, m(e.label), 1),
|
|
101
|
+
e.hint ? (d(), i("span", N, m(e.hint), 1)) : r("", !0)
|
|
101
102
|
]),
|
|
102
103
|
_: 2
|
|
103
104
|
}, 1032, ["value"]))), 128))]),
|
|
@@ -117,4 +118,4 @@ var A = {
|
|
|
117
118
|
}
|
|
118
119
|
});
|
|
119
120
|
//#endregion
|
|
120
|
-
export {
|
|
121
|
+
export { P as default };
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import type { VNodeChild } from 'vue';
|
|
2
2
|
export type RowClassValue = string | string[] | Record<string, boolean> | undefined;
|
|
3
|
+
export type SortOrder = 'ascend' | 'descend';
|
|
4
|
+
export interface SortState {
|
|
5
|
+
columnKey: string;
|
|
6
|
+
order: SortOrder;
|
|
7
|
+
}
|
|
3
8
|
export interface Column<T = Record<string, any>> {
|
|
4
9
|
key: string;
|
|
5
10
|
label?: string;
|
|
6
11
|
title?: string;
|
|
7
12
|
width?: string | number;
|
|
13
|
+
/** 列最小宽度 (auto 布局下作为列宽下限) */
|
|
14
|
+
minWidth?: string | number;
|
|
15
|
+
/** 单行截断 + 省略号。需配合 width 或 maxWidth 给出宽度上限才会生效 (auto 布局下没有上限无法截断)。
|
|
16
|
+
* 开启后默认用单元格原始值作 hover title;自定义插槽里可自行覆盖 title。 */
|
|
17
|
+
ellipsis?: boolean;
|
|
18
|
+
/** ellipsis 的最大宽度,接受数字 (px) 或任意 CSS 值,如 'clamp(160px, 22vw, 420px)'。未给则回退到 width。 */
|
|
19
|
+
maxWidth?: string | number;
|
|
8
20
|
align?: 'left' | 'right' | 'center';
|
|
21
|
+
/** 固定列: 'left' | 'right' (CSS sticky)。固定列建议显式给 width,否则偏移量按 0 计算会错位。 */
|
|
22
|
+
fixed?: 'left' | 'right';
|
|
23
|
+
/** 特殊列类型。'selection' 渲染多选框列 (需配合 row-key 与 v-model:checked-row-keys)。 */
|
|
24
|
+
type?: 'selection';
|
|
25
|
+
/** selection 列: 返回 true 的行禁用选择 */
|
|
26
|
+
disabled?: (row: T) => boolean;
|
|
27
|
+
/** 排序: true / 'default' 用默认比较 row[key];传函数自定义比较 (a, b) => number (升序语义) */
|
|
28
|
+
sorter?: boolean | 'default' | ((a: T, b: T) => number);
|
|
29
|
+
/** 非受控初始排序方向 */
|
|
30
|
+
defaultSortOrder?: SortOrder;
|
|
9
31
|
cellClass?: string;
|
|
10
32
|
className?: string;
|
|
11
33
|
render?: (row: T, index: number) => VNodeChild;
|
|
@@ -36,11 +58,22 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
36
58
|
striped?: boolean;
|
|
37
59
|
bordered?: boolean;
|
|
38
60
|
stickyHeader?: boolean;
|
|
61
|
+
/** body 最大高度;设置后表头自动吸顶 (内部 overflow:auto 限高) */
|
|
62
|
+
maxHeight?: string | number;
|
|
39
63
|
pagination?: false | DataTablePagination;
|
|
40
64
|
singleLine?: boolean;
|
|
41
65
|
scrollX?: string | number;
|
|
66
|
+
/** 远程模式: 不在本地做排序/分页 (数据已由外部处理好) */
|
|
67
|
+
remote?: boolean;
|
|
68
|
+
/** 选中行 key (受控);不传则内部维护 */
|
|
69
|
+
checkedRowKeys?: (string | number)[];
|
|
70
|
+
defaultCheckedRowKeys?: (string | number)[];
|
|
71
|
+
/** 排序状态 (受控,单列);不传则内部维护 */
|
|
72
|
+
sortState?: SortState | null;
|
|
42
73
|
} & {
|
|
43
74
|
onRowClick?: ((row: T) => any) | undefined;
|
|
75
|
+
"onUpdate:sortState"?: ((state: SortState | null) => any) | undefined;
|
|
76
|
+
"onUpdate:checkedRowKeys"?: ((keys: (string | number)[], rows: T[]) => any) | undefined;
|
|
44
77
|
}> & (typeof globalThis extends {
|
|
45
78
|
__VLS_PROPS_FALLBACK: infer P;
|
|
46
79
|
} ? P : {});
|
|
@@ -50,6 +83,16 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
50
83
|
[x: `header-${string}`]: ((props: {
|
|
51
84
|
col: Column<T>;
|
|
52
85
|
}) => any) | undefined;
|
|
86
|
+
} & {
|
|
87
|
+
[x: `header-${string}`]: ((props: {
|
|
88
|
+
col: Column<T>;
|
|
89
|
+
}) => any) | undefined;
|
|
90
|
+
} & {
|
|
91
|
+
[x: `cell-${string}`]: ((props: {
|
|
92
|
+
row: T;
|
|
93
|
+
value: any;
|
|
94
|
+
index: number;
|
|
95
|
+
}) => any) | undefined;
|
|
53
96
|
} & {
|
|
54
97
|
[x: `cell-${string}`]: ((props: {
|
|
55
98
|
row: T;
|
|
@@ -59,7 +102,11 @@ declare const __VLS_export: <T extends Record<string, any>>(__VLS_props: NonNull
|
|
|
59
102
|
} & {
|
|
60
103
|
empty?: (props: {}) => any;
|
|
61
104
|
};
|
|
62
|
-
emit:
|
|
105
|
+
emit: {
|
|
106
|
+
(e: "rowClick", row: T): void;
|
|
107
|
+
(e: "update:checkedRowKeys", keys: (string | number)[], rows: T[]): void;
|
|
108
|
+
(e: "update:sortState", state: SortState | null): void;
|
|
109
|
+
};
|
|
63
110
|
}>) => import("vue").VNode & {
|
|
64
111
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
65
112
|
};
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KDataTable.vue_vue_type_script_setup_true_lang.js";
|
|
3
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-6085ee8c"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|