@guoyg578/k-ui 0.1.4 → 0.1.5
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/KCascader.vue.js +1 -1
- package/dist/components/KCascader.vue_vue_type_script_setup_true_lang.js +43 -42
- 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/KDialog.vue.js +1 -1
- package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +40 -39
- 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_vue_type_script_setup_true_lang.js +28 -27
- package/dist/components/KPopover.vue_vue_type_script_setup_true_lang.js +15 -14
- 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/KTimePicker.vue.js +1 -1
- package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +45 -44
- package/dist/components/KTooltip.vue_vue_type_script_setup_true_lang.js +13 -12
- package/dist/components/KTreeSelect.vue.js +1 -1
- package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/k-ui.css +1 -1
- package/package.json +1 -1
|
@@ -3,6 +3,6 @@ import t from "./KCascader.vue_vue_type_script_setup_true_lang.js";
|
|
|
3
3
|
/* empty css */
|
|
4
4
|
/* empty css */
|
|
5
5
|
//#region components/KCascader.vue
|
|
6
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
6
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-04959f22"]]);
|
|
7
7
|
//#endregion
|
|
8
8
|
export { n as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
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,
|
|
2
|
-
import { ChevronRight 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, normalizeClass as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, unref as m, watch as h, withCtx as g } from "vue";
|
|
2
|
+
import { ChevronRight as _, X as v } from "lucide-vue-next";
|
|
3
|
+
import { PopoverContent as y, PopoverPortal as b, PopoverRoot as x, PopoverTrigger as S } from "reka-ui";
|
|
4
4
|
//#region components/KCascader.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var C = ["disabled"], w = { class: "k-casc-field__text" }, T = ["disabled", "onClick"], E = { class: "k-casc-item__label" }, D = /* @__PURE__ */ s({
|
|
6
|
+
inheritAttrs: !1,
|
|
6
7
|
__name: "KCascader",
|
|
7
8
|
props: {
|
|
8
9
|
modelValue: {},
|
|
@@ -23,85 +24,85 @@ var S = ["disabled"], C = { class: "k-casc-field__text" }, w = ["disabled", "onC
|
|
|
23
24
|
}
|
|
24
25
|
},
|
|
25
26
|
emits: ["update:modelValue"],
|
|
26
|
-
setup(s, { emit:
|
|
27
|
-
let
|
|
28
|
-
function
|
|
27
|
+
setup(s, { emit: D }) {
|
|
28
|
+
let O = s, k = D, A = d(!1), j = d([]);
|
|
29
|
+
function M(e, t, n = []) {
|
|
29
30
|
for (let r of e) {
|
|
30
31
|
let e = [...n, r];
|
|
31
32
|
if (r.value === t) return e;
|
|
32
33
|
if (r.children) {
|
|
33
|
-
let n =
|
|
34
|
+
let n = M(r.children, t, e);
|
|
34
35
|
if (n) return n;
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
return null;
|
|
38
39
|
}
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
e && (
|
|
40
|
+
let N = t(() => O.modelValue == null ? [] : M(O.options, O.modelValue) ?? []), P = t(() => N.value.map((e) => e.label).join(O.separator));
|
|
41
|
+
h(A, (e) => {
|
|
42
|
+
e && (j.value = N.value.slice());
|
|
42
43
|
});
|
|
43
|
-
let
|
|
44
|
-
let e = [
|
|
45
|
-
for (let t of
|
|
44
|
+
let F = t(() => {
|
|
45
|
+
let e = [O.options];
|
|
46
|
+
for (let t of j.value) if (t.children?.length) e.push(t.children);
|
|
46
47
|
else break;
|
|
47
48
|
return e;
|
|
48
49
|
});
|
|
49
|
-
function F(e, t) {
|
|
50
|
-
return A.value[e]?.value === t.value;
|
|
51
|
-
}
|
|
52
50
|
function I(e, t) {
|
|
51
|
+
return j.value[e]?.value === t.value;
|
|
52
|
+
}
|
|
53
|
+
function L(e, t) {
|
|
53
54
|
if (t.disabled) return;
|
|
54
|
-
let n =
|
|
55
|
-
n[e] = t,
|
|
55
|
+
let n = j.value.slice(0, e);
|
|
56
|
+
n[e] = t, j.value = n, t.children?.length ? O.changeOnSelect && k("update:modelValue", t.value) : (k("update:modelValue", t.value), A.value = !1);
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
e.stopPropagation(),
|
|
58
|
+
function R(e) {
|
|
59
|
+
e.stopPropagation(), k("update:modelValue", null);
|
|
59
60
|
}
|
|
60
|
-
return (t,
|
|
61
|
-
open:
|
|
62
|
-
"onUpdate:open":
|
|
61
|
+
return (t, d) => (u(), n(m(x), {
|
|
62
|
+
open: A.value,
|
|
63
|
+
"onUpdate:open": d[0] ||= (e) => A.value = e
|
|
63
64
|
}, {
|
|
64
|
-
default:
|
|
65
|
+
default: g(() => [o(m(S), {
|
|
65
66
|
"as-child": "",
|
|
66
67
|
disabled: s.disabled
|
|
67
68
|
}, {
|
|
68
|
-
default:
|
|
69
|
+
default: g(() => [a("button", c(t.$attrs, {
|
|
69
70
|
type: "button",
|
|
70
|
-
class:
|
|
71
|
+
class: ["k-casc-field", {
|
|
71
72
|
"k-casc-field--disabled": s.disabled,
|
|
72
|
-
"k-casc-field--placeholder": !
|
|
73
|
-
}]
|
|
73
|
+
"k-casc-field--placeholder": !P.value
|
|
74
|
+
}],
|
|
74
75
|
disabled: s.disabled
|
|
75
|
-
}, [a("span",
|
|
76
|
+
}), [a("span", w, p(P.value || s.placeholder), 1), s.clearable && P.value && !s.disabled ? (u(), n(m(v), {
|
|
76
77
|
key: 0,
|
|
77
78
|
size: 14,
|
|
78
79
|
class: "k-casc-field__clear",
|
|
79
|
-
onClick:
|
|
80
|
-
})) : r("", !0)],
|
|
80
|
+
onClick: R
|
|
81
|
+
})) : r("", !0)], 16, C)]),
|
|
81
82
|
_: 1
|
|
82
|
-
}, 8, ["disabled"]), o(
|
|
83
|
-
default:
|
|
83
|
+
}, 8, ["disabled"]), o(m(b), null, {
|
|
84
|
+
default: g(() => [o(m(y), {
|
|
84
85
|
class: "k-menu-surface k-casc-panel",
|
|
85
86
|
"side-offset": 6,
|
|
86
87
|
align: "start"
|
|
87
88
|
}, {
|
|
88
|
-
default:
|
|
89
|
+
default: g(() => [(u(!0), i(e, null, f(F.value, (t, o) => (u(), i("div", {
|
|
89
90
|
key: o,
|
|
90
91
|
class: "k-casc-col"
|
|
91
|
-
}, [(
|
|
92
|
+
}, [(u(!0), i(e, null, f(t, (e) => (u(), i("button", {
|
|
92
93
|
key: e.value,
|
|
93
94
|
type: "button",
|
|
94
|
-
class:
|
|
95
|
-
"k-casc-item--active":
|
|
95
|
+
class: l(["k-casc-item", {
|
|
96
|
+
"k-casc-item--active": I(o, e),
|
|
96
97
|
"k-casc-item--disabled": e.disabled
|
|
97
98
|
}]),
|
|
98
99
|
disabled: e.disabled,
|
|
99
|
-
onClick: (t) =>
|
|
100
|
-
}, [a("span",
|
|
100
|
+
onClick: (t) => L(o, e)
|
|
101
|
+
}, [a("span", E, p(e.label), 1), e.children?.length ? (u(), n(m(_), {
|
|
101
102
|
key: 0,
|
|
102
103
|
size: 14,
|
|
103
104
|
class: "k-casc-item__arrow"
|
|
104
|
-
})) : r("", !0)], 10,
|
|
105
|
+
})) : r("", !0)], 10, T))), 128))]))), 128))]),
|
|
105
106
|
_: 1
|
|
106
107
|
})]),
|
|
107
108
|
_: 1
|
|
@@ -111,4 +112,4 @@ var S = ["disabled"], C = { class: "k-casc-field__text" }, w = ["disabled", "onC
|
|
|
111
112
|
}
|
|
112
113
|
});
|
|
113
114
|
//#endregion
|
|
114
|
-
export {
|
|
115
|
+
export { D 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 };
|
|
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./KDialog.vue_vue_type_script_setup_true_lang.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
//#region components/KDialog.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-9539265d"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import e from "./KButton.vue.js";
|
|
2
|
-
import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l,
|
|
3
|
-
import { X as
|
|
2
|
+
import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeProps as u, onMounted as d, onUnmounted as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
|
|
3
|
+
import { X as y } from "lucide-vue-next";
|
|
4
4
|
//#region components/KDialog.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
5
|
+
var b = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "k-dialog-stack"
|
|
8
|
-
},
|
|
8
|
+
}, x = { class: "k-dialog__center" }, S = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "k-dialog__header"
|
|
11
|
-
},
|
|
11
|
+
}, C = { class: "k-dialog__title-wrap" }, w = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "k-dialog__title"
|
|
14
|
-
},
|
|
14
|
+
}, T = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "k-dialog__subtitle"
|
|
17
|
-
},
|
|
17
|
+
}, E = { class: "k-dialog__body" }, D = {
|
|
18
18
|
key: 1,
|
|
19
19
|
class: "k-dialog__footer"
|
|
20
|
-
},
|
|
20
|
+
}, O = /* @__PURE__ */ l({
|
|
21
|
+
inheritAttrs: !1,
|
|
21
22
|
__name: "KDialog",
|
|
22
23
|
props: {
|
|
23
24
|
open: { type: Boolean },
|
|
@@ -55,70 +56,70 @@ var x = {
|
|
|
55
56
|
"confirm",
|
|
56
57
|
"cancel"
|
|
57
58
|
],
|
|
58
|
-
setup(l, { emit:
|
|
59
|
-
let
|
|
59
|
+
setup(l, { emit: O }) {
|
|
60
|
+
let k = l, A = O;
|
|
61
|
+
function j() {
|
|
62
|
+
A("update:open", !1), A("close");
|
|
63
|
+
}
|
|
60
64
|
function M() {
|
|
61
|
-
|
|
65
|
+
k.maskClosable && j();
|
|
62
66
|
}
|
|
63
67
|
function N() {
|
|
64
|
-
A
|
|
68
|
+
A("confirm");
|
|
65
69
|
}
|
|
66
70
|
function P() {
|
|
67
|
-
|
|
71
|
+
A("cancel"), j();
|
|
68
72
|
}
|
|
69
|
-
function F() {
|
|
70
|
-
|
|
73
|
+
function F(e) {
|
|
74
|
+
e.key === "Escape" && k.open && k.closable && j();
|
|
71
75
|
}
|
|
72
76
|
function I(e) {
|
|
73
|
-
e.key === "Escape" && A.open && A.closable && M();
|
|
74
|
-
}
|
|
75
|
-
function L(e) {
|
|
76
77
|
if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
|
|
77
78
|
}
|
|
78
|
-
return
|
|
79
|
-
window.removeEventListener("keydown",
|
|
80
|
-
}),
|
|
79
|
+
return d(() => window.addEventListener("keydown", F)), f(() => {
|
|
80
|
+
window.removeEventListener("keydown", F), k.open && (document.body.style.overflow = "");
|
|
81
|
+
}), _(() => k.open, (e) => {
|
|
81
82
|
document.body.style.overflow = e ? "hidden" : "";
|
|
82
|
-
}), (
|
|
83
|
+
}), (d, f) => (p(), r(t, { to: "body" }, [c(n, {
|
|
83
84
|
name: "k-dialog",
|
|
84
85
|
duration: {
|
|
85
86
|
enter: 280,
|
|
86
87
|
leave: 200
|
|
87
88
|
}
|
|
88
89
|
}, {
|
|
89
|
-
default:
|
|
90
|
+
default: v(() => [l.open ? (p(), a("div", b, [o("div", {
|
|
90
91
|
class: "k-dialog__overlay",
|
|
91
|
-
onClick:
|
|
92
|
-
}), o("div",
|
|
93
|
-
class:
|
|
94
|
-
style:
|
|
95
|
-
}, [
|
|
96
|
-
l.title ||
|
|
92
|
+
onClick: M
|
|
93
|
+
}), o("div", x, [o("div", u(d.$attrs, {
|
|
94
|
+
class: ["k-dialog", `k-dialog--${l.size}`],
|
|
95
|
+
style: { maxWidth: I(l.width) }
|
|
96
|
+
}), [
|
|
97
|
+
l.title || d.$slots.title || l.closable ? (p(), a("header", S, [o("div", C, [l.title || d.$slots.title ? (p(), a("h2", w, [m(d.$slots, "title", {}, () => [s(h(l.title), 1)], !0)])) : i("", !0), l.subtitle ? (p(), a("p", T, h(l.subtitle), 1)) : i("", !0)]), l.closable ? (p(), a("button", {
|
|
97
98
|
key: 0,
|
|
98
99
|
type: "button",
|
|
99
100
|
class: "k-dialog__close",
|
|
100
|
-
onClick:
|
|
101
|
-
}, [c(
|
|
102
|
-
o("div",
|
|
103
|
-
|
|
101
|
+
onClick: j
|
|
102
|
+
}, [c(g(y), { size: 18 })])) : i("", !0)])) : i("", !0),
|
|
103
|
+
o("div", E, [m(d.$slots, "default", {}, void 0, !0)]),
|
|
104
|
+
d.$slots.footer || l.footer ? (p(), a("footer", D, [m(d.$slots, "footer", {}, () => [l.hideCancel ? i("", !0) : (p(), r(e, {
|
|
104
105
|
key: 0,
|
|
105
106
|
type: "secondary",
|
|
106
|
-
onClick:
|
|
107
|
+
onClick: P
|
|
107
108
|
}, {
|
|
108
|
-
default:
|
|
109
|
+
default: v(() => [s(h(l.cancelText), 1)]),
|
|
109
110
|
_: 1
|
|
110
111
|
})), c(e, {
|
|
111
112
|
type: l.confirmType,
|
|
112
113
|
loading: l.confirmLoading,
|
|
113
|
-
onClick:
|
|
114
|
+
onClick: N
|
|
114
115
|
}, {
|
|
115
|
-
default:
|
|
116
|
+
default: v(() => [s(h(l.confirmText), 1)]),
|
|
116
117
|
_: 1
|
|
117
118
|
}, 8, ["type", "loading"])], !0)])) : i("", !0)
|
|
118
|
-
],
|
|
119
|
+
], 16)])])) : i("", !0)]),
|
|
119
120
|
_: 3
|
|
120
121
|
})]));
|
|
121
122
|
}
|
|
122
123
|
});
|
|
123
124
|
//#endregion
|
|
124
|
-
export {
|
|
125
|
+
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 };
|