@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
|
@@ -6,12 +6,14 @@ type __VLS_Props = {
|
|
|
6
6
|
range?: boolean;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
showTooltip?: boolean;
|
|
9
|
+
size?: 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
9
10
|
};
|
|
10
11
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
12
|
"update:modelValue": (v: number | [number, number]) => any;
|
|
12
13
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
14
|
"onUpdate:modelValue"?: ((v: number | [number, number]) => any) | undefined;
|
|
14
15
|
}>, {
|
|
16
|
+
size: "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
15
17
|
disabled: boolean;
|
|
16
18
|
max: number;
|
|
17
19
|
min: number;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KSlider.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KSlider.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-15331c04"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -33,25 +33,26 @@ var l = { class: "k-slider__rail" }, u = [
|
|
|
33
33
|
showTooltip: {
|
|
34
34
|
type: Boolean,
|
|
35
35
|
default: !0
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
|
+
size: { default: "md" }
|
|
37
38
|
},
|
|
38
39
|
emits: ["update:modelValue"],
|
|
39
40
|
setup(i, { emit: p }) {
|
|
40
|
-
let m = i, h =
|
|
41
|
-
left: `${m.range ?
|
|
42
|
-
width: `${m.range ?
|
|
41
|
+
let m = i, h = e(() => m.size === "small" || m.size === "sm" ? "sm" : m.size === "large" || m.size === "lg" ? "lg" : "md"), g = p, _ = e(() => Array.isArray(m.modelValue) ? [m.modelValue[0], m.modelValue[1]] : [m.min, Number(m.modelValue ?? m.min)]), v = e(() => m.max - m.min === 0 ? 1 : m.max - m.min), y = e(() => Math.min(_.value[0], _.value[1])), b = e(() => Math.max(_.value[0], _.value[1])), x = e(() => (y.value - m.min) / v.value * 100), S = e(() => (b.value - m.min) / v.value * 100), C = e(() => ({
|
|
42
|
+
left: `${m.range ? x.value : 0}%`,
|
|
43
|
+
width: `${m.range ? S.value - x.value : S.value}%`
|
|
43
44
|
}));
|
|
44
|
-
function
|
|
45
|
-
|
|
45
|
+
function w(e) {
|
|
46
|
+
g("update:modelValue", Number(e));
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
-
let n = [...
|
|
49
|
-
|
|
48
|
+
function T(e, t) {
|
|
49
|
+
let n = Number(t), r = [..._.value];
|
|
50
|
+
e === 0 ? r[0] = Math.min(n, r[1]) : r[1] = Math.max(n, r[0]), g("update:modelValue", r);
|
|
50
51
|
}
|
|
51
|
-
return (e, p) => (s(), n("div", { class: a(["k-slider", { "k-slider--disabled": i.disabled }]) }, [
|
|
52
|
+
return (e, p) => (s(), n("div", { class: a(["k-slider", [`k-slider--${h.value}`, { "k-slider--disabled": i.disabled }]]) }, [
|
|
52
53
|
r("div", l, [r("div", {
|
|
53
54
|
class: "k-slider__fill",
|
|
54
|
-
style: o(
|
|
55
|
+
style: o(C.value)
|
|
55
56
|
}, null, 4)]),
|
|
56
57
|
i.range ? (s(), n("input", {
|
|
57
58
|
key: 0,
|
|
@@ -60,9 +61,9 @@ var l = { class: "k-slider__rail" }, u = [
|
|
|
60
61
|
min: i.min,
|
|
61
62
|
max: i.max,
|
|
62
63
|
step: i.step,
|
|
63
|
-
value:
|
|
64
|
+
value: _.value[0],
|
|
64
65
|
disabled: i.disabled,
|
|
65
|
-
onInput: p[0] ||= (e) =>
|
|
66
|
+
onInput: p[0] ||= (e) => T(0, e.target.value)
|
|
66
67
|
}, null, 40, u)) : t("", !0),
|
|
67
68
|
r("input", {
|
|
68
69
|
type: "range",
|
|
@@ -70,11 +71,11 @@ var l = { class: "k-slider__rail" }, u = [
|
|
|
70
71
|
min: i.min,
|
|
71
72
|
max: i.max,
|
|
72
73
|
step: i.step,
|
|
73
|
-
value: i.range ?
|
|
74
|
+
value: i.range ? _.value[1] : i.modelValue,
|
|
74
75
|
disabled: i.disabled,
|
|
75
|
-
onInput: p[1] ||= (e) => i.range ?
|
|
76
|
+
onInput: p[1] ||= (e) => i.range ? T(1, e.target.value) : w(e.target.value)
|
|
76
77
|
}, null, 40, d),
|
|
77
|
-
i.showTooltip ? (s(), n("div", f, c(i.range ? `${
|
|
78
|
+
i.showTooltip ? (s(), n("div", f, c(i.range ? `${y.value} - ${b.value}` : i.modelValue), 1)) : t("", !0)
|
|
78
79
|
], 2));
|
|
79
80
|
}
|
|
80
81
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
modelValue?: string;
|
|
3
3
|
value?: string;
|
|
4
|
+
size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
4
5
|
rows?: number;
|
|
5
6
|
placeholder?: string;
|
|
6
7
|
disabled?: boolean;
|
|
@@ -28,6 +29,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
|
28
29
|
onFocus?: ((ev: FocusEvent) => any) | undefined;
|
|
29
30
|
}>, {
|
|
30
31
|
error: boolean;
|
|
32
|
+
size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
31
33
|
disabled: boolean;
|
|
32
34
|
modelValue: string;
|
|
33
35
|
readonly: boolean;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KTextarea.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KTextarea.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-aa2dd648"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -11,6 +11,7 @@ var l = [
|
|
|
11
11
|
props: {
|
|
12
12
|
modelValue: { default: "" },
|
|
13
13
|
value: {},
|
|
14
|
+
size: { default: "md" },
|
|
14
15
|
rows: { default: 3 },
|
|
15
16
|
placeholder: {},
|
|
16
17
|
disabled: {
|
|
@@ -35,42 +36,42 @@ var l = [
|
|
|
35
36
|
"focus"
|
|
36
37
|
],
|
|
37
38
|
setup(n, { expose: u, emit: d }) {
|
|
38
|
-
let f = n, p = d, m = s(null), h = e(() => f.value ?? f.modelValue ?? ""), g = e(() => !f.autosize || f.autosize === !0 ? {
|
|
39
|
+
let f = n, p = d, m = s(null), h = e(() => f.value ?? f.modelValue ?? ""), g = e(() => f.size === "tiny" || f.size === "xs" || f.size === "small" || f.size === "sm" ? "sm" : f.size === "large" || f.size === "lg" ? "lg" : "md"), _ = e(() => !f.autosize || f.autosize === !0 ? {
|
|
39
40
|
minRows: f.rows,
|
|
40
41
|
maxRows: void 0
|
|
41
42
|
} : {
|
|
42
43
|
minRows: f.autosize.minRows ?? f.rows,
|
|
43
44
|
maxRows: f.autosize.maxRows
|
|
44
45
|
});
|
|
45
|
-
function
|
|
46
|
+
function v() {
|
|
46
47
|
if (!f.autosize || !m.value) return;
|
|
47
48
|
let e = m.value, t = window.getComputedStyle(e), n = Number.parseFloat(t.lineHeight) || 20, r = Number.parseFloat(t.paddingTop) + Number.parseFloat(t.paddingBottom);
|
|
48
49
|
e.style.height = "auto";
|
|
49
|
-
let i =
|
|
50
|
+
let i = _.value.minRows * n + r, a = _.value.maxRows ? _.value.maxRows * n + r : Infinity;
|
|
50
51
|
e.style.height = `${Math.max(i, Math.min(e.scrollHeight, a))}px`, e.style.overflowY = e.scrollHeight > a ? "auto" : "hidden";
|
|
51
52
|
}
|
|
52
|
-
function
|
|
53
|
+
function y(e) {
|
|
53
54
|
let t = e.target.value;
|
|
54
|
-
p("update:modelValue", t), p("update:value", t), r(
|
|
55
|
+
p("update:modelValue", t), p("update:value", t), r(v);
|
|
55
56
|
}
|
|
56
|
-
return c(h, () => r(
|
|
57
|
+
return c(h, () => r(v), { immediate: !0 }), u({
|
|
57
58
|
textareaElRef: m,
|
|
58
59
|
focus: () => m.value?.focus(),
|
|
59
60
|
blur: () => m.value?.blur()
|
|
60
61
|
}), (e, r) => (o(), t("textarea", {
|
|
61
62
|
ref_key: "textareaElRef",
|
|
62
63
|
ref: m,
|
|
63
|
-
class: i(["k-textarea", {
|
|
64
|
+
class: i(["k-textarea", [`k-textarea--${g.value}`, {
|
|
64
65
|
"k-textarea--error": n.error,
|
|
65
66
|
"k-textarea--disabled": n.disabled
|
|
66
|
-
}]),
|
|
67
|
+
}]]),
|
|
67
68
|
value: h.value,
|
|
68
69
|
rows: n.rows,
|
|
69
70
|
placeholder: n.placeholder,
|
|
70
71
|
disabled: n.disabled,
|
|
71
72
|
readonly: n.readonly,
|
|
72
73
|
style: a({ resize: n.resize }),
|
|
73
|
-
onInput:
|
|
74
|
+
onInput: y,
|
|
74
75
|
onFocus: r[0] ||= (e) => p("focus", e),
|
|
75
76
|
onBlur: r[1] ||= (e) => p("blur", e)
|
|
76
77
|
}, null, 46, l));
|
|
@@ -4,12 +4,14 @@ type __VLS_Props = {
|
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
clearable?: boolean;
|
|
6
6
|
placeholder?: string;
|
|
7
|
+
size?: 'tiny' | 'xs' | '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:modelValue": (v: string | null) => any;
|
|
10
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
12
|
"onUpdate:modelValue"?: ((v: string | null) => any) | undefined;
|
|
12
13
|
}>, {
|
|
14
|
+
size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
13
15
|
disabled: boolean;
|
|
14
16
|
placeholder: string;
|
|
15
17
|
clearable: boolean;
|
|
@@ -3,6 +3,6 @@ import t from "./KTimePicker.vue_vue_type_script_setup_true_lang.js";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region components/KTimePicker.vue
|
|
6
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-1d65209e"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeProps as c,
|
|
2
|
-
import { Clock as
|
|
3
|
-
import { PopoverContent as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeProps as c, nextTick as l, normalizeClass as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, watch as g, withCtx as _ } from "vue";
|
|
2
|
+
import { Clock as v, X as y } from "lucide-vue-next";
|
|
3
|
+
import { PopoverContent as b, PopoverPortal as x, PopoverRoot as S, PopoverTrigger as C } from "reka-ui";
|
|
4
4
|
//#region components/KTimePicker.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var w = ["disabled"], T = { class: "k-tp-field__text" }, E = { class: "k-tp-col" }, D = ["onClick"], O = { class: "k-tp-col" }, k = ["onClick"], A = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "k-tp-col"
|
|
8
|
-
},
|
|
8
|
+
}, j = ["onClick"], M = /* @__PURE__ */ s({
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "KTimePicker",
|
|
11
11
|
props: {
|
|
@@ -22,12 +22,13 @@ var S = ["disabled"], C = { class: "k-tp-field__text" }, w = { class: "k-tp-col"
|
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: !0
|
|
24
24
|
},
|
|
25
|
-
placeholder: { default: "选择时间" }
|
|
25
|
+
placeholder: { default: "选择时间" },
|
|
26
|
+
size: { default: "md" }
|
|
26
27
|
},
|
|
27
28
|
emits: ["update:modelValue"],
|
|
28
|
-
setup(s, { emit:
|
|
29
|
-
let
|
|
30
|
-
let e =
|
|
29
|
+
setup(s, { emit: M }) {
|
|
30
|
+
let N = s, P = M, F = f(!1), I = t(() => N.size === "tiny" || N.size === "xs" || N.size === "small" || N.size === "sm" ? "sm" : N.size === "large" || N.size === "lg" ? "lg" : "md"), L = (e) => String(e).padStart(2, "0"), R = Array.from({ length: 24 }, (e, t) => t), z = Array.from({ length: 60 }, (e, t) => t), B = Array.from({ length: 60 }, (e, t) => t), V = (e, t) => Number.isNaN(e) || e < 0 || e > t ? null : e, H = t(() => {
|
|
31
|
+
let e = N.modelValue;
|
|
31
32
|
if (!e) return {
|
|
32
33
|
h: null,
|
|
33
34
|
m: null,
|
|
@@ -35,76 +36,88 @@ var S = ["disabled"], C = { class: "k-tp-field__text" }, w = { class: "k-tp-col"
|
|
|
35
36
|
};
|
|
36
37
|
let [t, n, r] = e.split(":").map((e) => parseInt(e, 10));
|
|
37
38
|
return {
|
|
38
|
-
h:
|
|
39
|
-
m:
|
|
40
|
-
s:
|
|
39
|
+
h: V(t, 23),
|
|
40
|
+
m: V(n, 59),
|
|
41
|
+
s: V(r, 59)
|
|
41
42
|
};
|
|
43
|
+
}), U = f();
|
|
44
|
+
g(F, (e) => {
|
|
45
|
+
e && l(() => {
|
|
46
|
+
U.value?.querySelectorAll(".k-tp-col").forEach((e) => {
|
|
47
|
+
let t = e.querySelector(".k-tp-cell--active");
|
|
48
|
+
t && (e.scrollTop = t.offsetTop - e.clientHeight / 2 + t.clientHeight / 2);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
42
51
|
});
|
|
43
|
-
function
|
|
44
|
-
|
|
52
|
+
function W(e, t, n) {
|
|
53
|
+
P("update:modelValue", N.useSeconds ? `${L(e ?? 0)}:${L(t ?? 0)}:${L(n ?? 0)}` : `${L(e ?? 0)}:${L(t ?? 0)}`);
|
|
45
54
|
}
|
|
46
|
-
function
|
|
47
|
-
let n =
|
|
48
|
-
|
|
55
|
+
function G(e, t) {
|
|
56
|
+
let n = H.value;
|
|
57
|
+
W(e === "h" ? t : n.h, e === "m" ? t : n.m, e === "s" ? t : n.s);
|
|
49
58
|
}
|
|
50
|
-
function
|
|
51
|
-
e.stopPropagation(),
|
|
59
|
+
function K(e) {
|
|
60
|
+
e.stopPropagation(), P("update:modelValue", null);
|
|
52
61
|
}
|
|
53
|
-
return (t,
|
|
54
|
-
open:
|
|
55
|
-
"onUpdate:open":
|
|
62
|
+
return (t, l) => (d(), n(h(S), {
|
|
63
|
+
open: F.value,
|
|
64
|
+
"onUpdate:open": l[0] ||= (e) => F.value = e
|
|
56
65
|
}, {
|
|
57
|
-
default:
|
|
66
|
+
default: _(() => [o(h(C), {
|
|
58
67
|
"as-child": "",
|
|
59
68
|
disabled: s.disabled
|
|
60
69
|
}, {
|
|
61
|
-
default:
|
|
70
|
+
default: _(() => [a("button", c(t.$attrs, {
|
|
62
71
|
type: "button",
|
|
63
|
-
class: ["k-tp-field", {
|
|
72
|
+
class: ["k-tp-field", [`k-tp-field--${I.value}`, {
|
|
64
73
|
"k-tp-field--disabled": s.disabled,
|
|
65
74
|
"k-tp-field--placeholder": !s.modelValue
|
|
66
|
-
}],
|
|
75
|
+
}]],
|
|
67
76
|
disabled: s.disabled
|
|
68
77
|
}), [
|
|
69
|
-
o(
|
|
78
|
+
o(h(v), {
|
|
70
79
|
size: 15,
|
|
71
80
|
class: "k-tp-field__icon"
|
|
72
81
|
}),
|
|
73
|
-
a("span",
|
|
74
|
-
s.clearable && s.modelValue && !s.disabled ? (
|
|
82
|
+
a("span", T, m(s.modelValue || s.placeholder), 1),
|
|
83
|
+
s.clearable && s.modelValue && !s.disabled ? (d(), n(h(y), {
|
|
75
84
|
key: 0,
|
|
76
85
|
size: 14,
|
|
77
86
|
class: "k-tp-field__clear",
|
|
78
|
-
onClick:
|
|
87
|
+
onClick: K
|
|
79
88
|
})) : r("", !0)
|
|
80
|
-
], 16,
|
|
89
|
+
], 16, w)]),
|
|
81
90
|
_: 1
|
|
82
|
-
}, 8, ["disabled"]), o(
|
|
83
|
-
default:
|
|
91
|
+
}, 8, ["disabled"]), o(h(x), null, {
|
|
92
|
+
default: _(() => [o(h(b), {
|
|
84
93
|
class: "k-menu-surface k-tp-panel",
|
|
85
94
|
"side-offset": 6,
|
|
86
95
|
align: "start"
|
|
87
96
|
}, {
|
|
88
|
-
default:
|
|
89
|
-
|
|
97
|
+
default: _(() => [a("div", {
|
|
98
|
+
ref_key: "panelRef",
|
|
99
|
+
ref: U,
|
|
100
|
+
class: "k-tp-cols"
|
|
101
|
+
}, [
|
|
102
|
+
a("div", E, [(d(!0), i(e, null, p(h(R), (e) => (d(), i("button", {
|
|
90
103
|
key: `h${e}`,
|
|
91
104
|
type: "button",
|
|
92
|
-
class:
|
|
93
|
-
onClick: (t) =>
|
|
94
|
-
},
|
|
95
|
-
a("div",
|
|
105
|
+
class: u(["k-tp-cell", { "k-tp-cell--active": H.value.h === e }]),
|
|
106
|
+
onClick: (t) => G("h", e)
|
|
107
|
+
}, m(L(e)), 11, D))), 128))]),
|
|
108
|
+
a("div", O, [(d(!0), i(e, null, p(h(z), (e) => (d(), i("button", {
|
|
96
109
|
key: `m${e}`,
|
|
97
110
|
type: "button",
|
|
98
|
-
class:
|
|
99
|
-
onClick: (t) =>
|
|
100
|
-
},
|
|
101
|
-
s.useSeconds ? (
|
|
111
|
+
class: u(["k-tp-cell", { "k-tp-cell--active": H.value.m === e }]),
|
|
112
|
+
onClick: (t) => G("m", e)
|
|
113
|
+
}, m(L(e)), 11, k))), 128))]),
|
|
114
|
+
s.useSeconds ? (d(), i("div", A, [(d(!0), i(e, null, p(h(B), (e) => (d(), i("button", {
|
|
102
115
|
key: `s${e}`,
|
|
103
116
|
type: "button",
|
|
104
|
-
class:
|
|
105
|
-
onClick: (t) =>
|
|
106
|
-
},
|
|
107
|
-
]),
|
|
117
|
+
class: u(["k-tp-cell", { "k-tp-cell--active": H.value.s === e }]),
|
|
118
|
+
onClick: (t) => G("s", e)
|
|
119
|
+
}, m(L(e)), 11, j))), 128))])) : r("", !0)
|
|
120
|
+
], 512)]),
|
|
108
121
|
_: 1
|
|
109
122
|
})]),
|
|
110
123
|
_: 1
|
|
@@ -114,4 +127,4 @@ var S = ["disabled"], C = { class: "k-tp-field__text" }, w = { class: "k-tp-col"
|
|
|
114
127
|
}
|
|
115
128
|
});
|
|
116
129
|
//#endregion
|
|
117
|
-
export {
|
|
130
|
+
export { M as default };
|
|
@@ -9,12 +9,14 @@ type __VLS_Props = {
|
|
|
9
9
|
titles?: [string, string];
|
|
10
10
|
filterable?: boolean;
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
12
13
|
};
|
|
13
14
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
15
|
"update:modelValue": (v: (string | number)[]) => any;
|
|
15
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
17
|
"onUpdate:modelValue"?: ((v: (string | number)[]) => any) | undefined;
|
|
17
18
|
}>, {
|
|
19
|
+
size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
18
20
|
disabled: boolean;
|
|
19
21
|
modelValue: (string | number)[];
|
|
20
22
|
filterable: boolean;
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KTransfer.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KTransfer.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-4cabb608"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -28,84 +28,85 @@ var S = { class: "k-transfer__panel" }, C = { class: "k-transfer__head" }, w = {
|
|
|
28
28
|
disabled: {
|
|
29
29
|
type: Boolean,
|
|
30
30
|
default: !1
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
|
+
size: { default: "md" }
|
|
32
33
|
},
|
|
33
34
|
emits: ["update:modelValue"],
|
|
34
35
|
setup(l, { emit: L }) {
|
|
35
|
-
let R = l, z = L, B = f(/* @__PURE__ */ new Set()),
|
|
36
|
-
function
|
|
36
|
+
let R = l, z = L, B = r(() => R.size === "tiny" || R.size === "xs" || R.size === "small" || R.size === "sm" ? "sm" : R.size === "large" || R.size === "lg" ? "lg" : "md"), V = f(/* @__PURE__ */ new Set()), H = f(/* @__PURE__ */ new Set()), U = f(""), W = f(""), G = r(() => new Set(R.modelValue));
|
|
37
|
+
function K(e, t) {
|
|
37
38
|
return !t || e.label.toLowerCase().includes(t.toLowerCase());
|
|
38
39
|
}
|
|
39
|
-
let
|
|
40
|
-
function
|
|
41
|
-
let n = e === "l" ?
|
|
40
|
+
let q = r(() => R.options.filter((e) => !G.value.has(e.value) && K(e, U.value))), J = r(() => R.options.filter((e) => G.value.has(e.value) && K(e, W.value)));
|
|
41
|
+
function Y(e, t) {
|
|
42
|
+
let n = e === "l" ? V : H, r = new Set(n.value);
|
|
42
43
|
r.has(t) ? r.delete(t) : r.add(t), n.value = r;
|
|
43
44
|
}
|
|
44
|
-
function Y() {
|
|
45
|
-
R.disabled || (z("update:modelValue", [...R.modelValue, ...B.value]), B.value = /* @__PURE__ */ new Set());
|
|
46
|
-
}
|
|
47
45
|
function X() {
|
|
46
|
+
R.disabled || (z("update:modelValue", [...R.modelValue, ...V.value]), V.value = /* @__PURE__ */ new Set());
|
|
47
|
+
}
|
|
48
|
+
function Z() {
|
|
48
49
|
if (R.disabled) return;
|
|
49
|
-
let e =
|
|
50
|
-
z("update:modelValue", R.modelValue.filter((t) => !e.has(t))),
|
|
50
|
+
let e = H.value;
|
|
51
|
+
z("update:modelValue", R.modelValue.filter((t) => !e.has(t))), H.value = /* @__PURE__ */ new Set();
|
|
51
52
|
}
|
|
52
|
-
return (r, f) => (d(), o("div", { class: u(["k-transfer", { "k-transfer--disabled": l.disabled }]) }, [
|
|
53
|
+
return (r, f) => (d(), o("div", { class: u(["k-transfer", [`k-transfer--${B.value}`, { "k-transfer--disabled": l.disabled }]]) }, [
|
|
53
54
|
s("div", S, [
|
|
54
|
-
s("div", C, [s("span", w, m(l.titles[0]), 1), s("span", T, m(
|
|
55
|
+
s("div", C, [s("span", w, m(l.titles[0]), 1), s("span", T, m(q.value.length), 1)]),
|
|
55
56
|
l.filterable ? (d(), o("div", E, [c(h(x), { size: 14 }), v(s("input", {
|
|
56
|
-
"onUpdate:modelValue": f[0] ||= (e) =>
|
|
57
|
+
"onUpdate:modelValue": f[0] ||= (e) => U.value = e,
|
|
57
58
|
placeholder: "搜索"
|
|
58
|
-
}, null, 512), [[g,
|
|
59
|
-
s("div", D, [(d(!0), o(n, null, p(
|
|
59
|
+
}, null, 512), [[g, U.value]])])) : a("", !0),
|
|
60
|
+
s("div", D, [(d(!0), o(n, null, p(q.value, (e) => (d(), i(t, {
|
|
60
61
|
key: e.value,
|
|
61
62
|
class: "k-transfer__row",
|
|
62
|
-
"model-value":
|
|
63
|
+
"model-value": V.value.has(e.value),
|
|
63
64
|
disabled: e.disabled || l.disabled,
|
|
64
65
|
label: e.label,
|
|
65
|
-
"onUpdate:modelValue": (t) =>
|
|
66
|
+
"onUpdate:modelValue": (t) => Y("l", e.value)
|
|
66
67
|
}, null, 8, [
|
|
67
68
|
"model-value",
|
|
68
69
|
"disabled",
|
|
69
70
|
"label",
|
|
70
71
|
"onUpdate:modelValue"
|
|
71
|
-
]))), 128)),
|
|
72
|
+
]))), 128)), q.value.length ? a("", !0) : (d(), o("p", O, "无数据"))])
|
|
72
73
|
]),
|
|
73
74
|
s("div", k, [c(e, {
|
|
74
|
-
size:
|
|
75
|
+
size: l.size,
|
|
75
76
|
circle: "",
|
|
76
|
-
disabled: !
|
|
77
|
-
onClick:
|
|
77
|
+
disabled: !V.value.size || l.disabled,
|
|
78
|
+
onClick: X
|
|
78
79
|
}, {
|
|
79
80
|
icon: _(() => [c(h(b), { size: 16 })]),
|
|
80
81
|
_: 1
|
|
81
|
-
}, 8, ["disabled"]), c(e, {
|
|
82
|
-
size:
|
|
82
|
+
}, 8, ["size", "disabled"]), c(e, {
|
|
83
|
+
size: l.size,
|
|
83
84
|
circle: "",
|
|
84
|
-
disabled: !
|
|
85
|
-
onClick:
|
|
85
|
+
disabled: !H.value.size || l.disabled,
|
|
86
|
+
onClick: Z
|
|
86
87
|
}, {
|
|
87
88
|
icon: _(() => [c(h(y), { size: 16 })]),
|
|
88
89
|
_: 1
|
|
89
|
-
}, 8, ["disabled"])]),
|
|
90
|
+
}, 8, ["size", "disabled"])]),
|
|
90
91
|
s("div", A, [
|
|
91
|
-
s("div", j, [s("span", M, m(l.titles[1]), 1), s("span", N, m(
|
|
92
|
+
s("div", j, [s("span", M, m(l.titles[1]), 1), s("span", N, m(J.value.length), 1)]),
|
|
92
93
|
l.filterable ? (d(), o("div", P, [c(h(x), { size: 14 }), v(s("input", {
|
|
93
|
-
"onUpdate:modelValue": f[1] ||= (e) =>
|
|
94
|
+
"onUpdate:modelValue": f[1] ||= (e) => W.value = e,
|
|
94
95
|
placeholder: "搜索"
|
|
95
|
-
}, null, 512), [[g,
|
|
96
|
-
s("div", F, [(d(!0), o(n, null, p(
|
|
96
|
+
}, null, 512), [[g, W.value]])])) : a("", !0),
|
|
97
|
+
s("div", F, [(d(!0), o(n, null, p(J.value, (e) => (d(), i(t, {
|
|
97
98
|
key: e.value,
|
|
98
99
|
class: "k-transfer__row",
|
|
99
|
-
"model-value":
|
|
100
|
+
"model-value": H.value.has(e.value),
|
|
100
101
|
disabled: e.disabled || l.disabled,
|
|
101
102
|
label: e.label,
|
|
102
|
-
"onUpdate:modelValue": (t) =>
|
|
103
|
+
"onUpdate:modelValue": (t) => Y("r", e.value)
|
|
103
104
|
}, null, 8, [
|
|
104
105
|
"model-value",
|
|
105
106
|
"disabled",
|
|
106
107
|
"label",
|
|
107
108
|
"onUpdate:modelValue"
|
|
108
|
-
]))), 128)),
|
|
109
|
+
]))), 128)), J.value.length ? a("", !0) : (d(), o("p", I, "无数据"))])
|
|
109
110
|
])
|
|
110
111
|
], 2));
|
|
111
112
|
}
|
|
@@ -7,12 +7,14 @@ type __VLS_Props = {
|
|
|
7
7
|
clearable?: boolean;
|
|
8
8
|
/** 仅叶子节点可选(父节点点击只展开) */
|
|
9
9
|
leafOnly?: boolean;
|
|
10
|
+
size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
|
|
10
11
|
};
|
|
11
12
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
12
13
|
"update:modelValue": (v: string | number | null) => any;
|
|
13
14
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
15
|
"onUpdate:modelValue"?: ((v: string | number | null) => any) | undefined;
|
|
15
16
|
}>, {
|
|
17
|
+
size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
|
|
16
18
|
disabled: boolean;
|
|
17
19
|
placeholder: string;
|
|
18
20
|
clearable: boolean;
|
|
@@ -3,6 +3,6 @@ import t from "./KTreeSelect.vue_vue_type_script_setup_true_lang.js";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region components/KTreeSelect.vue
|
|
6
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-47492dc2"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
|
@@ -21,26 +21,27 @@ var y = ["disabled"], b = { class: "k-tsel-field__text" }, x = /* @__PURE__ */ o
|
|
|
21
21
|
leafOnly: {
|
|
22
22
|
type: Boolean,
|
|
23
23
|
default: !0
|
|
24
|
-
}
|
|
24
|
+
},
|
|
25
|
+
size: { default: "md" }
|
|
25
26
|
},
|
|
26
27
|
emits: ["update:modelValue"],
|
|
27
28
|
setup(o, { emit: x }) {
|
|
28
|
-
let S = o, C = x, w = l(!1), T = l([]);
|
|
29
|
-
function
|
|
29
|
+
let S = o, C = x, w = l(!1), T = l([]), E = t(() => S.size === "tiny" || S.size === "xs" || S.size === "small" || S.size === "sm" ? "sm" : S.size === "large" || S.size === "lg" ? "lg" : "md");
|
|
30
|
+
function D(e, t) {
|
|
30
31
|
for (let n of e) {
|
|
31
32
|
if (n.id === t) return n.label;
|
|
32
33
|
if (n.children) {
|
|
33
|
-
let e =
|
|
34
|
+
let e = D(n.children, t);
|
|
34
35
|
if (e) return e;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
return null;
|
|
38
39
|
}
|
|
39
|
-
let
|
|
40
|
-
function
|
|
40
|
+
let O = t(() => S.modelValue == null ? "" : D(S.nodes, S.modelValue) ?? "");
|
|
41
|
+
function k(e) {
|
|
41
42
|
S.leafOnly && e.children?.length || (C("update:modelValue", e.id), w.value = !1);
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function A(e) {
|
|
44
45
|
e.stopPropagation(), C("update:modelValue", null);
|
|
45
46
|
}
|
|
46
47
|
return (t, l) => (c(), n(d(_), {
|
|
@@ -53,18 +54,18 @@ var y = ["disabled"], b = { class: "k-tsel-field__text" }, x = /* @__PURE__ */ o
|
|
|
53
54
|
}, {
|
|
54
55
|
default: f(() => [i("button", s(t.$attrs, {
|
|
55
56
|
type: "button",
|
|
56
|
-
class: ["k-tsel-field", {
|
|
57
|
+
class: ["k-tsel-field", [`k-tsel-field--${E.value}`, {
|
|
57
58
|
"k-tsel-field--disabled": o.disabled,
|
|
58
|
-
"k-tsel-field--placeholder": !
|
|
59
|
-
}],
|
|
59
|
+
"k-tsel-field--placeholder": !O.value
|
|
60
|
+
}]],
|
|
60
61
|
disabled: o.disabled
|
|
61
62
|
}), [
|
|
62
|
-
i("span", b, u(
|
|
63
|
-
o.clearable &&
|
|
63
|
+
i("span", b, u(O.value || o.placeholder), 1),
|
|
64
|
+
o.clearable && O.value && !o.disabled ? (c(), n(d(m), {
|
|
64
65
|
key: 0,
|
|
65
66
|
size: 14,
|
|
66
67
|
class: "k-tsel-field__clear",
|
|
67
|
-
onClick:
|
|
68
|
+
onClick: A
|
|
68
69
|
})) : r("", !0),
|
|
69
70
|
a(d(p), {
|
|
70
71
|
size: 15,
|
|
@@ -83,7 +84,7 @@ var y = ["disabled"], b = { class: "k-tsel-field__text" }, x = /* @__PURE__ */ o
|
|
|
83
84
|
selected: o.modelValue ?? null,
|
|
84
85
|
expanded: T.value,
|
|
85
86
|
"onUpdate:expanded": l[0] ||= (e) => T.value = e,
|
|
86
|
-
onNodeClick:
|
|
87
|
+
onNodeClick: k
|
|
87
88
|
}, null, 8, [
|
|
88
89
|
"nodes",
|
|
89
90
|
"selected",
|