@guoyg578/k-ui 0.1.3 → 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.
@@ -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-1578d394"]]);
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, normalizeClass as c, openBlock as l, ref as u, renderList as d, toDisplayString as f, unref as p, watch as m, withCtx as h } from "vue";
2
- import { ChevronRight as g, X as _ } from "lucide-vue-next";
3
- import { PopoverContent as v, PopoverPortal as y, PopoverRoot as b, PopoverTrigger as x } from "reka-ui";
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 S = ["disabled"], C = { class: "k-casc-field__text" }, w = ["disabled", "onClick"], T = { class: "k-casc-item__label" }, E = /* @__PURE__ */ s({
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: E }) {
27
- let D = s, O = E, k = u(!1), A = u([]);
28
- function j(e, t, n = []) {
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 = j(r.children, t, e);
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 M = t(() => D.modelValue == null ? [] : j(D.options, D.modelValue) ?? []), N = t(() => M.value.map((e) => e.label).join(D.separator));
40
- m(k, (e) => {
41
- e && (A.value = M.value.slice());
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 P = t(() => {
44
- let e = [D.options];
45
- for (let t of A.value) if (t.children?.length) e.push(t.children);
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 = A.value.slice(0, e);
55
- n[e] = t, A.value = n, t.children?.length ? D.changeOnSelect && O("update:modelValue", t.value) : (O("update:modelValue", t.value), k.value = !1);
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 L(e) {
58
- e.stopPropagation(), O("update:modelValue", null);
58
+ function R(e) {
59
+ e.stopPropagation(), k("update:modelValue", null);
59
60
  }
60
- return (t, u) => (l(), n(p(b), {
61
- open: k.value,
62
- "onUpdate:open": u[0] ||= (e) => k.value = e
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: h(() => [o(p(x), {
65
+ default: g(() => [o(m(S), {
65
66
  "as-child": "",
66
67
  disabled: s.disabled
67
68
  }, {
68
- default: h(() => [a("button", {
69
+ default: g(() => [a("button", c(t.$attrs, {
69
70
  type: "button",
70
- class: c(["k-casc-field", {
71
+ class: ["k-casc-field", {
71
72
  "k-casc-field--disabled": s.disabled,
72
- "k-casc-field--placeholder": !N.value
73
- }]),
73
+ "k-casc-field--placeholder": !P.value
74
+ }],
74
75
  disabled: s.disabled
75
- }, [a("span", C, f(N.value || s.placeholder), 1), s.clearable && N.value && !s.disabled ? (l(), n(p(_), {
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: L
80
- })) : r("", !0)], 10, S)]),
80
+ onClick: R
81
+ })) : r("", !0)], 16, C)]),
81
82
  _: 1
82
- }, 8, ["disabled"]), o(p(y), null, {
83
- default: h(() => [o(p(v), {
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: h(() => [(l(!0), i(e, null, d(P.value, (t, o) => (l(), i("div", {
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
- }, [(l(!0), i(e, null, d(t, (e) => (l(), i("button", {
92
+ }, [(u(!0), i(e, null, f(t, (e) => (u(), i("button", {
92
93
  key: e.value,
93
94
  type: "button",
94
- class: c(["k-casc-item", {
95
- "k-casc-item--active": F(o, e),
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) => I(o, e)
100
- }, [a("span", T, f(e.label), 1), e.children?.length ? (l(), n(p(g), {
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, w))), 128))]))), 128))]),
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 { E as default };
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-55b7732f"]]);
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, normalizeClass as l, openBlock as u, ref as d, renderList as f, toDisplayString as p, unref as m, withCtx as h, withModifiers as g } from "vue";
2
- import { Check as _, ChevronDown as v, X as y } from "lucide-vue-next";
3
- import { ComboboxAnchor as b, ComboboxContent as x, ComboboxEmpty as S, ComboboxInput as C, ComboboxItem as w, ComboboxItemIndicator as T, ComboboxPortal as E, ComboboxRoot as D, ComboboxTrigger as O, ComboboxViewport as k } from "reka-ui";
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 A = {
5
+ var j = {
6
6
  key: 0,
7
7
  class: "k-cmb-chips"
8
- }, j = ["onClick"], M = {
8
+ }, M = ["onClick"], N = {
9
9
  key: 0,
10
10
  class: "k-cmb-hint"
11
- }, N = /* @__PURE__ */ c({
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: N }) {
34
- let P = c, F = N, I = d(""), L = t(() => P.multiple ? Array.isArray(P.modelValue) ? P.modelValue : [] : P.modelValue == null ? "" : String(P.modelValue));
35
- function R(e) {
36
- F("update:modelValue", e);
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 z(e, t) {
39
- t.stopPropagation(), !(!P.multiple || !Array.isArray(P.modelValue)) && F("update:modelValue", P.modelValue.filter((t) => t !== e));
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 B = (e) => P.options.find((t) => t.value === e)?.label ?? e, V = t(() => {
42
- if (P.multiple) return "";
43
- let e = L.value;
44
- return e ? B(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, d) => (u(), n(m(D), {
47
- "model-value": L.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": I.value,
51
- "onUpdate:modelValue": R,
52
- "onUpdate:searchTerm": d[1] ||= (e) => I.value = e
51
+ "search-term": L.value,
52
+ "onUpdate:modelValue": z,
53
+ "onUpdate:searchTerm": f[1] ||= (e) => L.value = e
53
54
  }, {
54
- default: h(() => [s(m(b), { class: l(["k-cmb-anchor", [`k-cmb-anchor--${c.size}`, { "k-cmb-anchor--disabled": c.disabled }]]) }, {
55
- default: h(() => [c.multiple ? (u(), i("div", A, [(u(!0), i(e, null, f(L.value, (e) => (u(), i("span", {
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(p(B(e)) + " ", 1), a("button", {
59
+ }, [o(m(V(e)) + " ", 1), a("button", {
59
60
  type: "button",
60
61
  class: "k-cmb-chip__close",
61
- onMousedown: d[0] ||= g(() => {}, ["prevent"]),
62
- onClick: (t) => z(e, t)
63
- }, [s(m(y), { size: 9 })], 40, j)]))), 128)), s(m(C), {
64
- placeholder: L.value.length === 0 ? c.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"])])) : (u(), i(e, { key: 1 }, [c.searchable ? (u(), n(m(C), {
67
+ }, null, 8, ["placeholder"])])) : (d(), i(e, { key: 1 }, [c.searchable ? (d(), n(h(w), {
67
68
  key: 0,
68
- placeholder: V.value || c.placeholder,
69
- "display-value": (e) => B(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"])) : (u(), i("span", {
72
+ }, null, 8, ["placeholder", "display-value"])) : (d(), i("span", {
72
73
  key: 1,
73
- class: l(["k-cmb-display", { "k-cmb-display--placeholder": !V.value }])
74
- }, p(V.value || c.placeholder || "请选择"), 3))], 64)), s(m(O), { class: "k-cmb-trigger" }, {
75
- default: h(() => [s(m(v), { size: 14 })]),
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
- }, 8, ["class"]), s(m(E), null, {
80
- default: h(() => [s(m(x), {
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: h(() => [s(m(S), { class: "k-cmb-empty" }, {
86
- default: h(() => [o(p(c.emptyText), 1)]),
86
+ default: g(() => [s(h(C), { class: "k-cmb-empty" }, {
87
+ default: g(() => [o(m(c.emptyText), 1)]),
87
88
  _: 1
88
- }), s(m(k), { class: "k-cmb-viewport" }, {
89
- default: h(() => [(u(!0), i(e, null, f(c.options, (e) => (u(), n(m(w), {
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: h(() => [
95
- s(m(T), { class: "k-cmb-indicator" }, {
96
- default: h(() => [s(m(_), { size: 12 })]),
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, p(e.label), 1),
100
- e.hint ? (u(), i("span", M, p(e.hint), 1)) : r("", !0)
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 { N as default };
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-f650c062"]]);
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, normalizeClass as u, normalizeStyle as d, onMounted as f, onUnmounted as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _, watch as v, withCtx as y } from "vue";
3
- import { X as b } from "lucide-vue-next";
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 x = {
5
+ var b = {
6
6
  key: 0,
7
7
  class: "k-dialog-stack"
8
- }, S = { class: "k-dialog__center" }, C = {
8
+ }, x = { class: "k-dialog__center" }, S = {
9
9
  key: 0,
10
10
  class: "k-dialog__header"
11
- }, w = { class: "k-dialog__title-wrap" }, T = {
11
+ }, C = { class: "k-dialog__title-wrap" }, w = {
12
12
  key: 0,
13
13
  class: "k-dialog__title"
14
- }, E = {
14
+ }, T = {
15
15
  key: 1,
16
16
  class: "k-dialog__subtitle"
17
- }, D = { class: "k-dialog__body" }, O = {
17
+ }, E = { class: "k-dialog__body" }, D = {
18
18
  key: 1,
19
19
  class: "k-dialog__footer"
20
- }, k = /* @__PURE__ */ l({
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: k }) {
59
- let A = l, j = k;
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
- j("update:open", !1), j("close");
65
+ k.maskClosable && j();
62
66
  }
63
67
  function N() {
64
- A.maskClosable && M();
68
+ A("confirm");
65
69
  }
66
70
  function P() {
67
- j("confirm");
71
+ A("cancel"), j();
68
72
  }
69
- function F() {
70
- j("cancel"), M();
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 f(() => window.addEventListener("keydown", I)), p(() => {
79
- window.removeEventListener("keydown", I), A.open && (document.body.style.overflow = "");
80
- }), v(() => A.open, (e) => {
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
- }), (f, p) => (m(), r(t, { to: "body" }, [c(n, {
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: y(() => [l.open ? (m(), a("div", x, [o("div", {
90
+ default: v(() => [l.open ? (p(), a("div", b, [o("div", {
90
91
  class: "k-dialog__overlay",
91
- onClick: N
92
- }), o("div", S, [o("div", {
93
- class: u(["k-dialog", `k-dialog--${l.size}`]),
94
- style: d({ maxWidth: L(l.width) })
95
- }, [
96
- l.title || f.$slots.title || l.closable ? (m(), a("header", C, [o("div", w, [l.title || f.$slots.title ? (m(), a("h2", T, [h(f.$slots, "title", {}, () => [s(g(l.title), 1)], !0)])) : i("", !0), l.subtitle ? (m(), a("p", E, g(l.subtitle), 1)) : i("", !0)]), l.closable ? (m(), a("button", {
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: M
101
- }, [c(_(b), { size: 18 })])) : i("", !0)])) : i("", !0),
102
- o("div", D, [h(f.$slots, "default", {}, void 0, !0)]),
103
- f.$slots.footer || l.footer ? (m(), a("footer", O, [h(f.$slots, "footer", {}, () => [l.hideCancel ? i("", !0) : (m(), r(e, {
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: F
107
+ onClick: P
107
108
  }, {
108
- default: y(() => [s(g(l.cancelText), 1)]),
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: P
114
+ onClick: N
114
115
  }, {
115
- default: y(() => [s(g(l.confirmText), 1)]),
116
+ default: v(() => [s(h(l.confirmText), 1)]),
116
117
  _: 1
117
118
  }, 8, ["type", "loading"])], !0)])) : i("", !0)
118
- ], 6)])])) : i("", !0)]),
119
+ ], 16)])])) : i("", !0)]),
119
120
  _: 3
120
121
  })]));
121
122
  }
122
123
  });
123
124
  //#endregion
124
- export { k as default };
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-2ba8be6b"]]);
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, normalizeClass as s, normalizeStyle as c, openBlock as l, renderSlot as u, toDisplayString as d, unref as f, withCtx as p } from "vue";
2
- import { X as m } from "lucide-vue-next";
3
- import { DialogClose as h, DialogContent as g, DialogDescription as _, DialogOverlay as v, DialogPortal as y, DialogRoot as b, DialogTitle as x } from "reka-ui";
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 S = {
5
+ var x = {
6
6
  key: 0,
7
7
  class: "k-drawer__header"
8
- }, C = { class: "k-drawer__title-wrap" }, w = {
8
+ }, S = { class: "k-drawer__title-wrap" }, C = {
9
9
  key: 0,
10
10
  class: "k-drawer__header-actions"
11
- }, T = { class: "k-drawer__body" }, E = {
11
+ }, w = { class: "k-drawer__body" }, T = {
12
12
  key: 1,
13
13
  class: "k-drawer__footer"
14
- }, D = /* @__PURE__ */ o({
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: D }) {
35
- let O = D;
36
- function k(e) {
37
- O("update:open", e), e || O("close");
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 A(e) {
40
+ function k(e) {
40
41
  if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
41
42
  }
42
- return (D, O) => (l(), e(f(b), {
43
+ return (E, D) => (c(), e(d(y), {
43
44
  open: o.open,
44
- "onUpdate:open": k
45
+ "onUpdate:open": O
45
46
  }, {
46
- default: p(() => [a(f(y), null, {
47
- default: p(() => [a(f(v), { class: "k-drawer__overlay" }), a(f(g), {
48
- class: s(["k-drawer", [`k-drawer--${o.placement}`, `k-drawer--${o.size}`]]),
49
- style: c({
50
- width: A(o.width),
51
- height: A(o.height)
52
- }),
53
- onPointerDownOutside: O[0] ||= (e) => {
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: O[1] ||= (e) => {
57
+ onEscapeKeyDown: D[1] ||= (e) => {
57
58
  o.closable || e.preventDefault();
58
59
  }
59
- }, {
60
- default: p(() => [
61
- o.title || D.$slots.title || o.closable ? (l(), n("header", S, [r("div", C, [o.title || D.$slots.title ? (l(), e(f(x), {
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: p(() => [u(D.$slots, "title", {}, () => [i(d(o.title), 1)], !0)]),
66
+ default: f(() => [l(E.$slots, "title", {}, () => [i(u(o.title), 1)], !0)]),
66
67
  _: 3
67
- })) : t("", !0), o.subtitle ? (l(), e(f(_), {
68
+ })) : t("", !0), o.subtitle ? (c(), e(d(g), {
68
69
  key: 1,
69
70
  class: "k-drawer__subtitle"
70
71
  }, {
71
- default: p(() => [i(d(o.subtitle), 1)]),
72
+ default: f(() => [i(u(o.subtitle), 1)]),
72
73
  _: 1
73
- })) : t("", !0)]), D.$slots["header-extra"] || o.closable ? (l(), n("div", w, [u(D.$slots, "header-extra", {}, void 0, !0), o.closable ? (l(), e(f(h), {
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: p(() => [a(f(m), { size: 18 })]),
79
+ default: f(() => [a(d(p), { size: 18 })]),
79
80
  _: 1
80
81
  })) : t("", !0)])) : t("", !0)])) : t("", !0),
81
- r("div", T, [u(D.$slots, "default", {}, void 0, !0)]),
82
- D.$slots.footer ? (l(), n("footer", E, [u(D.$slots, "footer", {}, void 0, !0)])) : t("", !0)
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
- }, 8, ["class", "style"])]),
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 { D as default };
94
+ export { E as default };