@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.
@@ -1,10 +1,11 @@
1
- import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, normalizeClass as u, openBlock as d, renderList as f, renderSlot as p, resolveDynamicComponent as m, toDisplayString as h, unref as g, useModel as _, withCtx as v } from "vue";
2
- import { DropdownMenuContent as y, DropdownMenuItem as b, DropdownMenuLabel as x, DropdownMenuPortal as S, DropdownMenuRoot as C, DropdownMenuSeparator as w, DropdownMenuTrigger as T } 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, mergeModels as l, mergeProps as u, normalizeClass as d, openBlock as f, renderList as p, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useModel as v, withCtx as y } from "vue";
2
+ import { DropdownMenuContent as b, DropdownMenuItem as x, DropdownMenuLabel as S, DropdownMenuPortal as C, DropdownMenuRoot as w, DropdownMenuSeparator as T, DropdownMenuTrigger as E } from "reka-ui";
3
3
  //#region components/KDropdown.vue?vue&type=script&setup=true&lang.ts
4
- var E = { class: "k-dropdown-item__label" }, D = {
4
+ var D = { class: "k-dropdown-item__label" }, O = {
5
5
  key: 1,
6
6
  class: "k-dropdown-item__shortcut"
7
- }, O = /* @__PURE__ */ c({
7
+ }, k = /* @__PURE__ */ c({
8
+ inheritAttrs: !1,
8
9
  __name: "KDropdown",
9
10
  props: /* @__PURE__ */ l({
10
11
  items: {},
@@ -24,60 +25,60 @@ var E = { class: "k-dropdown-item__label" }, D = {
24
25
  }),
25
26
  emits: /* @__PURE__ */ l(["select"], ["update:open"]),
26
27
  setup(c, { emit: l }) {
27
- let O = c, k = _(c, "open"), A = l, j = t(() => O.items ?? O.options ?? []);
28
- function M(e) {
29
- e.disabled || A("select", e.key, e);
28
+ let k = c, A = v(c, "open"), j = l, M = t(() => k.items ?? k.options ?? []);
29
+ function N(e) {
30
+ e.disabled || j("select", e.key, e);
30
31
  }
31
- return (t, l) => (d(), n(g(C), {
32
- open: k.value,
33
- "onUpdate:open": l[0] ||= (e) => k.value = e
32
+ return (t, l) => (f(), n(_(w), {
33
+ open: A.value,
34
+ "onUpdate:open": l[0] ||= (e) => A.value = e
34
35
  }, {
35
- default: v(() => [s(g(T), {
36
+ default: y(() => [s(_(E), {
36
37
  "as-child": "",
37
38
  disabled: c.disabled
38
39
  }, {
39
- default: v(() => [a("span", { class: u(["k-dropdown-trigger", { "k-dropdown-trigger--disabled": c.disabled }]) }, [p(t.$slots, "default")], 2)]),
40
+ default: y(() => [a("span", u(t.$attrs, { class: ["k-dropdown-trigger", { "k-dropdown-trigger--disabled": c.disabled }] }), [m(t.$slots, "default")], 16)]),
40
41
  _: 3
41
- }, 8, ["disabled"]), s(g(S), null, {
42
- default: v(() => [s(g(y), {
43
- class: u(["k-dropdown-content k-menu-surface", c.contentClass]),
42
+ }, 8, ["disabled"]), s(_(C), null, {
43
+ default: y(() => [s(_(b), {
44
+ class: d(["k-dropdown-content k-menu-surface", c.contentClass]),
44
45
  side: c.side,
45
46
  align: c.align,
46
47
  "side-offset": c.sideOffset
47
48
  }, {
48
- default: v(() => [(d(!0), i(e, null, f(j.value, (t, s) => (d(), i(e, { key: t.key || `_${s}` }, [t.type === "separator" ? (d(), n(g(w), {
49
+ default: y(() => [(f(!0), i(e, null, p(M.value, (t, s) => (f(), i(e, { key: t.key || `_${s}` }, [t.type === "separator" ? (f(), n(_(T), {
49
50
  key: 0,
50
51
  class: "k-dropdown-sep"
51
- })) : t.type === "label" ? (d(), n(g(x), {
52
+ })) : t.type === "label" ? (f(), n(_(S), {
52
53
  key: 1,
53
54
  class: "k-dropdown-label"
54
55
  }, {
55
- default: v(() => [o(h(t.label), 1)]),
56
+ default: y(() => [o(g(t.label), 1)]),
56
57
  _: 2
57
- }, 1024)) : (d(), n(g(b), {
58
+ }, 1024)) : (f(), n(_(x), {
58
59
  key: 2,
59
- class: u(["k-dropdown-item k-menu-item", {
60
+ class: d(["k-dropdown-item k-menu-item", {
60
61
  "k-dropdown-item--danger": t.danger,
61
62
  "k-dropdown-item--active": t.active
62
63
  }]),
63
64
  disabled: t.disabled,
64
- onSelect: (e) => M(t)
65
+ onSelect: (e) => N(t)
65
66
  }, {
66
- default: v(() => [
67
- t.icon ? (d(), n(m(t.icon), {
67
+ default: y(() => [
68
+ t.icon ? (f(), n(h(t.icon), {
68
69
  key: 0,
69
70
  size: 15,
70
71
  class: "k-dropdown-item__icon"
71
72
  })) : r("", !0),
72
- a("span", E, h(t.label), 1),
73
- t.shortcut ? (d(), i("span", D, h(t.shortcut), 1)) : r("", !0)
73
+ a("span", D, g(t.label), 1),
74
+ t.shortcut ? (f(), i("span", O, g(t.shortcut), 1)) : r("", !0)
74
75
  ]),
75
76
  _: 2
76
77
  }, 1032, [
77
78
  "class",
78
79
  "disabled",
79
80
  "onSelect"
80
- ]))], 64))), 128)), p(t.$slots, "extra")]),
81
+ ]))], 64))), 128)), m(t.$slots, "extra")]),
81
82
  _: 3
82
83
  }, 8, [
83
84
  "class",
@@ -92,4 +93,4 @@ var E = { class: "k-dropdown-item__label" }, D = {
92
93
  }
93
94
  });
94
95
  //#endregion
95
- export { O as default };
96
+ export { k as default };
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KImageViewer.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region components/KImageViewer.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-d5bf0d85"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-2a679196"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -22,9 +22,9 @@ var w = ["disabled"], T = [
22
22
  h(() => j.open, (e) => {
23
23
  if (e) {
24
24
  let e = Math.max(0, j.images.length - 1);
25
- N.value = Math.min(Math.max(0, j.initial), e), P.value = 1, F.value = 0, window.addEventListener("keydown", W);
26
- } else window.removeEventListener("keydown", W);
27
- }), u(() => window.removeEventListener("keydown", W));
25
+ N.value = Math.min(Math.max(0, j.initial), e), P.value = 1, F.value = 0, window.addEventListener("keydown", W, !0);
26
+ } else window.removeEventListener("keydown", W, !0);
27
+ }), u(() => window.removeEventListener("keydown", W, !0));
28
28
  function I() {
29
29
  M("update:open", !1);
30
30
  }
@@ -51,7 +51,7 @@ var w = ["disabled"], T = [
51
51
  P.value = Math.min(4, Math.max(.5, +(P.value + t).toFixed(2)));
52
52
  }
53
53
  function W(e) {
54
- j.open && (e.key === "Escape" ? I() : e.key === "ArrowLeft" ? L() : e.key === "ArrowRight" && R());
54
+ j.open && (e.key === "Escape" ? (e.stopPropagation(), I()) : e.key === "ArrowLeft" ? (e.stopPropagation(), L()) : e.key === "ArrowRight" && (e.stopPropagation(), R()));
55
55
  }
56
56
  let G = n(() => ({ transform: `scale(${P.value}) rotate(${F.value}deg)` }));
57
57
  return (n, u) => (d(), r(e, { to: "body" }, [s(t, { name: "k-viewer" }, {
@@ -1,7 +1,8 @@
1
- import { createBlock as e, createCommentVNode as t, createVNode as n, defineComponent as r, mergeModels as i, normalizeClass as a, openBlock as o, renderSlot as s, unref as c, useModel as l, withCtx as u } from "vue";
2
- import { PopoverArrow as d, PopoverContent as f, PopoverPortal as p, PopoverRoot as m, PopoverTrigger as h } from "reka-ui";
1
+ import { createBlock as e, createCommentVNode as t, createVNode as n, defineComponent as r, mergeModels as i, mergeProps as a, normalizeClass as o, openBlock as s, renderSlot as c, unref as l, useModel as u, withCtx as d } from "vue";
2
+ import { PopoverArrow as f, PopoverContent as p, PopoverPortal as m, PopoverRoot as h, PopoverTrigger as g } from "reka-ui";
3
3
  //#region components/KPopover.vue?vue&type=script&setup=true&lang.ts
4
- var g = /* @__PURE__ */ r({
4
+ var _ = /* @__PURE__ */ r({
5
+ inheritAttrs: !1,
5
6
  __name: "KPopover",
6
7
  props: /* @__PURE__ */ i({
7
8
  side: { default: "bottom" },
@@ -22,25 +23,25 @@ var g = /* @__PURE__ */ r({
22
23
  }),
23
24
  emits: ["update:open"],
24
25
  setup(r) {
25
- let i = l(r, "open");
26
- return (l, g) => (o(), e(c(m), {
26
+ let i = u(r, "open");
27
+ return (u, _) => (s(), e(l(h), {
27
28
  open: i.value,
28
- "onUpdate:open": g[0] ||= (e) => i.value = e
29
+ "onUpdate:open": _[0] ||= (e) => i.value = e
29
30
  }, {
30
- default: u(() => [n(c(h), {
31
+ default: d(() => [n(l(g), a(u.$attrs, {
31
32
  "as-child": "",
32
33
  disabled: r.disabled
33
- }, {
34
- default: u(() => [s(l.$slots, "default")]),
34
+ }), {
35
+ default: d(() => [c(u.$slots, "default")]),
35
36
  _: 3
36
- }, 8, ["disabled"]), n(c(p), null, {
37
- default: u(() => [n(c(f), {
38
- class: a(["k-popover-content", r.contentClass]),
37
+ }, 16, ["disabled"]), n(l(m), null, {
38
+ default: d(() => [n(l(p), {
39
+ class: o(["k-popover-content", r.contentClass]),
39
40
  side: r.side,
40
41
  align: r.align,
41
42
  "side-offset": r.sideOffset
42
43
  }, {
43
- default: u(() => [s(l.$slots, "content", { close: () => i.value = !1 }), r.showArrow ? (o(), e(c(d), {
44
+ default: d(() => [c(u.$slots, "content", { close: () => i.value = !1 }), r.showArrow ? (s(), e(l(f), {
44
45
  key: 0,
45
46
  class: "k-popover-arrow",
46
47
  width: 11,
@@ -60,4 +61,4 @@ var g = /* @__PURE__ */ r({
60
61
  }
61
62
  });
62
63
  //#endregion
63
- export { g as default };
64
+ export { _ as default };
@@ -4,6 +4,6 @@ import t from "./KSelect.vue_vue_type_script_setup_true_lang.js";
4
4
  /* empty css */
5
5
  /* empty css */
6
6
  //#region components/KSelect.vue
7
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b8c18845"]]);
7
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-fa7ff6ee"]]);
8
8
  //#endregion
9
9
  export { n as default };
@@ -1,17 +1,18 @@
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, vModelText as h, withCtx as g, withDirectives as _, withModifiers as v } from "vue";
2
- import { Check as y, ChevronDown as b, X as x } from "lucide-vue-next";
3
- import { SelectContent as S, SelectIcon as C, SelectItem as w, SelectItemIndicator as T, SelectItemText as E, SelectPortal as D, SelectRoot as O, SelectTrigger as k, SelectValue as A, SelectViewport as j } 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, vModelText as g, withCtx as _, withDirectives as v, withModifiers as y } from "vue";
2
+ import { Check as b, ChevronDown as x, X as S } from "lucide-vue-next";
3
+ import { SelectContent as C, SelectIcon as w, SelectItem as T, SelectItemIndicator as E, SelectItemText as D, SelectPortal as O, SelectRoot as k, SelectTrigger as A, SelectValue as j, SelectViewport as M } from "reka-ui";
4
4
  //#region components/KSelect.vue?vue&type=script&setup=true&lang.ts
5
- var M = {
5
+ var N = {
6
6
  key: 0,
7
7
  class: "k-select-search"
8
- }, N = ["placeholder"], P = {
8
+ }, P = ["placeholder"], F = {
9
9
  key: 0,
10
10
  class: "k-select-hint"
11
- }, F = {
11
+ }, I = {
12
12
  key: 0,
13
13
  class: "k-select-empty"
14
- }, I = /* @__PURE__ */ c({
14
+ }, L = /* @__PURE__ */ c({
15
+ inheritAttrs: !1,
15
16
  __name: "KSelect",
16
17
  props: {
17
18
  modelValue: {},
@@ -33,96 +34,96 @@ var M = {
33
34
  filterPlaceholder: { default: "搜索" }
34
35
  },
35
36
  emits: ["update:modelValue"],
36
- setup(c, { emit: I }) {
37
- let L = c, R = I, z = t(() => L.modelValue == null || L.modelValue === "" ? "__none__" : String(L.modelValue)), B = t(() => L.size === "tiny" || L.size === "xs" || L.size === "small" || L.size === "sm" ? "sm" : L.size === "large" || L.size === "lg" ? "lg" : "md");
38
- function V(e) {
37
+ setup(c, { emit: L }) {
38
+ let R = c, z = L, B = t(() => R.modelValue == null || R.modelValue === "" ? "__none__" : String(R.modelValue)), V = t(() => R.size === "tiny" || R.size === "xs" || R.size === "small" || R.size === "sm" ? "sm" : R.size === "large" || R.size === "lg" ? "lg" : "md");
39
+ function H(e) {
39
40
  let t = e === "__none__" ? "" : e ?? "";
40
- typeof L.modelValue == "number" && t !== "" && /^-?\d+(\.\d+)?$/.test(t) ? R("update:modelValue", Number(t)) : R("update:modelValue", t);
41
+ typeof R.modelValue == "number" && t !== "" && /^-?\d+(\.\d+)?$/.test(t) ? z("update:modelValue", Number(t)) : z("update:modelValue", t);
41
42
  }
42
- let H = t(() => {
43
- let e = L.modelValue == null ? "" : String(L.modelValue);
44
- return L.options.find((t) => String(t.value) === e)?.label ?? L.placeholder ?? "请选择";
45
- }), U = d(""), W = t(() => {
46
- let e = U.value.trim().toLowerCase();
47
- return !L.filterable || !e ? L.options : L.options.filter((t) => `${t.label} ${t.value} ${t.hint ?? ""}`.toLowerCase().includes(e));
48
- }), G = t(() => W.value.some((e) => e.value === "") ? W.value.map((e) => e.value === "" ? {
43
+ let U = t(() => {
44
+ let e = R.modelValue == null ? "" : String(R.modelValue);
45
+ return R.options.find((t) => String(t.value) === e)?.label ?? R.placeholder ?? "请选择";
46
+ }), W = f(""), G = t(() => {
47
+ let e = W.value.trim().toLowerCase();
48
+ return !R.filterable || !e ? R.options : R.options.filter((t) => `${t.label} ${t.value} ${t.hint ?? ""}`.toLowerCase().includes(e));
49
+ }), K = t(() => G.value.some((e) => e.value === "") ? G.value.map((e) => e.value === "" ? {
49
50
  ...e,
50
51
  value: "__none__"
51
- } : e) : W.value), K = d(!1);
52
- function q() {
53
- K.value = !1, U.value = "";
54
- }
52
+ } : e) : G.value), q = f(!1);
55
53
  function J() {
56
- K.value = !0;
54
+ q.value = !1, W.value = "";
55
+ }
56
+ function Y() {
57
+ q.value = !0;
57
58
  }
58
- function Y(e) {
59
- e.preventDefault(), e.stopPropagation(), R("update:modelValue", "");
59
+ function X(e) {
60
+ e.preventDefault(), e.stopPropagation(), z("update:modelValue", "");
60
61
  }
61
- let X = t(() => L.clearable && !L.disabled && L.modelValue !== null && L.modelValue !== void 0 && L.modelValue !== "");
62
- return (t, d) => (u(), n(m(O), {
63
- "model-value": z.value,
62
+ let Z = t(() => R.clearable && !R.disabled && R.modelValue !== null && R.modelValue !== void 0 && R.modelValue !== "");
63
+ return (t, f) => (d(), n(h(k), {
64
+ "model-value": B.value,
64
65
  disabled: c.disabled,
65
- "onUpdate:open": q,
66
- "onUpdate:modelValue": d[4] ||= (e) => V(e)
66
+ "onUpdate:open": J,
67
+ "onUpdate:modelValue": f[4] ||= (e) => H(e)
67
68
  }, {
68
- default: g(() => [s(m(k), { class: l(["k-select-trigger", [`k-select-trigger--${B.value}`, { "k-select-trigger--disabled": c.disabled }]]) }, {
69
- default: g(() => [
70
- s(m(A), null, {
71
- default: g(() => [o(p(H.value), 1)]),
69
+ default: _(() => [s(h(A), l(t.$attrs, { class: ["k-select-trigger", [`k-select-trigger--${V.value}`, { "k-select-trigger--disabled": c.disabled }]] }), {
70
+ default: _(() => [
71
+ s(h(j), null, {
72
+ default: _(() => [o(m(U.value), 1)]),
72
73
  _: 1
73
74
  }),
74
- X.value ? (u(), i("span", {
75
+ Z.value ? (d(), i("span", {
75
76
  key: 0,
76
77
  role: "button",
77
78
  class: "k-select-clear",
78
79
  tabindex: "-1",
79
80
  "aria-label": "清空",
80
- onPointerdown: d[0] ||= v(() => {}, ["stop", "prevent"]),
81
- onClick: Y
82
- }, [s(m(x), { size: 11 })], 32)) : r("", !0),
83
- s(m(C), { class: "k-select-icon" }, {
84
- default: g(() => [s(m(b), { size: 14 })]),
81
+ onPointerdown: f[0] ||= y(() => {}, ["stop", "prevent"]),
82
+ onClick: X
83
+ }, [s(h(S), { size: 11 })], 32)) : r("", !0),
84
+ s(h(w), { class: "k-select-icon" }, {
85
+ default: _(() => [s(h(x), { size: 14 })]),
85
86
  _: 1
86
87
  })
87
88
  ]),
88
89
  _: 1
89
- }, 8, ["class"]), s(m(D), null, {
90
- default: g(() => [s(m(S), {
91
- class: l(["k-select-content k-menu-surface", { "k-select-content--navigating": K.value }]),
90
+ }, 16, ["class"]), s(h(O), null, {
91
+ default: _(() => [s(h(C), {
92
+ class: u(["k-select-content k-menu-surface", { "k-select-content--navigating": q.value }]),
92
93
  position: "popper",
93
94
  "side-offset": 6,
94
95
  align: "start",
95
96
  "body-lock": !1,
96
97
  "disable-outside-pointer-events": !1,
97
- onPointermove: J,
98
- onKeydown: J
98
+ onPointermove: Y,
99
+ onKeydown: Y
99
100
  }, {
100
- default: g(() => [c.filterable ? (u(), i("div", M, [_(a("input", {
101
- "onUpdate:modelValue": d[1] ||= (e) => U.value = e,
101
+ default: _(() => [c.filterable ? (d(), i("div", N, [v(a("input", {
102
+ "onUpdate:modelValue": f[1] ||= (e) => W.value = e,
102
103
  class: "k-select-search__input",
103
104
  placeholder: c.filterPlaceholder,
104
- onKeydown: d[2] ||= v(() => {}, ["stop"]),
105
- onPointerdown: d[3] ||= v(() => {}, ["stop"])
106
- }, null, 40, N), [[h, U.value]])])) : r("", !0), s(m(j), { class: "k-select-viewport" }, {
107
- default: g(() => [(u(!0), i(e, null, f(G.value, (e) => (u(), n(m(w), {
105
+ onKeydown: f[2] ||= y(() => {}, ["stop"]),
106
+ onPointerdown: f[3] ||= y(() => {}, ["stop"])
107
+ }, null, 40, P), [[g, W.value]])])) : r("", !0), s(h(M), { class: "k-select-viewport" }, {
108
+ default: _(() => [(d(!0), i(e, null, p(K.value, (e) => (d(), n(h(T), {
108
109
  key: e.value,
109
110
  value: String(e.value),
110
111
  disabled: e.disabled,
111
112
  class: "k-select-item k-menu-item"
112
113
  }, {
113
- default: g(() => [
114
- s(m(T), { class: "k-select-indicator" }, {
115
- default: g(() => [s(m(y), { size: 12 })]),
114
+ default: _(() => [
115
+ s(h(E), { class: "k-select-indicator" }, {
116
+ default: _(() => [s(h(b), { size: 12 })]),
116
117
  _: 1
117
118
  }),
118
- s(m(E), null, {
119
- default: g(() => [o(p(e.label), 1)]),
119
+ s(h(D), null, {
120
+ default: _(() => [o(m(e.label), 1)]),
120
121
  _: 2
121
122
  }, 1024),
122
- e.hint ? (u(), i("span", P, p(e.hint), 1)) : r("", !0)
123
+ e.hint ? (d(), i("span", F, m(e.hint), 1)) : r("", !0)
123
124
  ]),
124
125
  _: 2
125
- }, 1032, ["value", "disabled"]))), 128)), G.value.length === 0 ? (u(), i("div", F, " 无匹配项 ")) : r("", !0)]),
126
+ }, 1032, ["value", "disabled"]))), 128)), K.value.length === 0 ? (d(), i("div", I, " 无匹配项 ")) : r("", !0)]),
126
127
  _: 1
127
128
  })]),
128
129
  _: 1
@@ -134,4 +135,4 @@ var M = {
134
135
  }
135
136
  });
136
137
  //#endregion
137
- export { I as default };
138
+ export { L as default };
@@ -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-52df9cd5"]]);
6
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-e7dc0de0"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -1,11 +1,12 @@
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, withCtx as m } from "vue";
2
- import { Clock as h, X as g } from "lucide-vue-next";
3
- import { PopoverContent as _, PopoverPortal as v, PopoverRoot as y, PopoverTrigger as b } 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, withCtx as h } from "vue";
2
+ import { Clock 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";
4
4
  //#region components/KTimePicker.vue?vue&type=script&setup=true&lang.ts
5
- var x = ["disabled"], S = { class: "k-tp-field__text" }, C = { class: "k-tp-col" }, w = ["onClick"], T = { class: "k-tp-col" }, E = ["onClick"], D = {
5
+ var S = ["disabled"], C = { class: "k-tp-field__text" }, w = { class: "k-tp-col" }, T = ["onClick"], E = { class: "k-tp-col" }, D = ["onClick"], O = {
6
6
  key: 0,
7
7
  class: "k-tp-col"
8
- }, O = ["onClick"], k = /* @__PURE__ */ s({
8
+ }, k = ["onClick"], A = /* @__PURE__ */ s({
9
+ inheritAttrs: !1,
9
10
  __name: "KTimePicker",
10
11
  props: {
11
12
  modelValue: {},
@@ -24,9 +25,9 @@ var x = ["disabled"], S = { class: "k-tp-field__text" }, C = { class: "k-tp-col"
24
25
  placeholder: { default: "选择时间" }
25
26
  },
26
27
  emits: ["update:modelValue"],
27
- setup(s, { emit: k }) {
28
- let A = s, j = k, M = u(!1), N = (e) => String(e).padStart(2, "0"), P = Array.from({ length: 24 }, (e, t) => t), F = Array.from({ length: 60 }, (e, t) => t), I = Array.from({ length: 60 }, (e, t) => t), L = t(() => {
29
- let e = A.modelValue;
28
+ setup(s, { emit: A }) {
29
+ let j = s, M = A, N = d(!1), P = (e) => String(e).padStart(2, "0"), F = Array.from({ length: 24 }, (e, t) => t), I = Array.from({ length: 60 }, (e, t) => t), L = Array.from({ length: 60 }, (e, t) => t), R = t(() => {
30
+ let e = j.modelValue;
30
31
  if (!e) return {
31
32
  h: null,
32
33
  m: null,
@@ -39,70 +40,70 @@ var x = ["disabled"], S = { class: "k-tp-field__text" }, C = { class: "k-tp-col"
39
40
  s: Number.isNaN(r) ? null : r
40
41
  };
41
42
  });
42
- function R(e, t, n) {
43
- j("update:modelValue", A.useSeconds ? `${N(e ?? 0)}:${N(t ?? 0)}:${N(n ?? 0)}` : `${N(e ?? 0)}:${N(t ?? 0)}`);
43
+ function z(e, t, n) {
44
+ M("update:modelValue", j.useSeconds ? `${P(e ?? 0)}:${P(t ?? 0)}:${P(n ?? 0)}` : `${P(e ?? 0)}:${P(t ?? 0)}`);
44
45
  }
45
- function z(e, t) {
46
- let n = L.value;
47
- R(e === "h" ? t : n.h, e === "m" ? t : n.m, e === "s" ? t : n.s);
46
+ function B(e, t) {
47
+ let n = R.value;
48
+ z(e === "h" ? t : n.h, e === "m" ? t : n.m, e === "s" ? t : n.s);
48
49
  }
49
- function B(e) {
50
- e.stopPropagation(), j("update:modelValue", null);
50
+ function V(e) {
51
+ e.stopPropagation(), M("update:modelValue", null);
51
52
  }
52
- return (t, u) => (l(), n(p(y), {
53
- open: M.value,
54
- "onUpdate:open": u[0] ||= (e) => M.value = e
53
+ return (t, d) => (u(), n(m(b), {
54
+ open: N.value,
55
+ "onUpdate:open": d[0] ||= (e) => N.value = e
55
56
  }, {
56
- default: m(() => [o(p(b), {
57
+ default: h(() => [o(m(x), {
57
58
  "as-child": "",
58
59
  disabled: s.disabled
59
60
  }, {
60
- default: m(() => [a("button", {
61
+ default: h(() => [a("button", c(t.$attrs, {
61
62
  type: "button",
62
- class: c(["k-tp-field", {
63
+ class: ["k-tp-field", {
63
64
  "k-tp-field--disabled": s.disabled,
64
65
  "k-tp-field--placeholder": !s.modelValue
65
- }]),
66
+ }],
66
67
  disabled: s.disabled
67
- }, [
68
- o(p(h), {
68
+ }), [
69
+ o(m(g), {
69
70
  size: 15,
70
71
  class: "k-tp-field__icon"
71
72
  }),
72
- a("span", S, f(s.modelValue || s.placeholder), 1),
73
- s.clearable && s.modelValue && !s.disabled ? (l(), n(p(g), {
73
+ a("span", C, p(s.modelValue || s.placeholder), 1),
74
+ s.clearable && s.modelValue && !s.disabled ? (u(), n(m(_), {
74
75
  key: 0,
75
76
  size: 14,
76
77
  class: "k-tp-field__clear",
77
- onClick: B
78
+ onClick: V
78
79
  })) : r("", !0)
79
- ], 10, x)]),
80
+ ], 16, S)]),
80
81
  _: 1
81
- }, 8, ["disabled"]), o(p(v), null, {
82
- default: m(() => [o(p(_), {
82
+ }, 8, ["disabled"]), o(m(y), null, {
83
+ default: h(() => [o(m(v), {
83
84
  class: "k-menu-surface k-tp-panel",
84
85
  "side-offset": 6,
85
86
  align: "start"
86
87
  }, {
87
- default: m(() => [
88
- a("div", C, [(l(!0), i(e, null, d(p(P), (e) => (l(), i("button", {
88
+ default: h(() => [
89
+ a("div", w, [(u(!0), i(e, null, f(m(F), (e) => (u(), i("button", {
89
90
  key: `h${e}`,
90
91
  type: "button",
91
- class: c(["k-tp-cell", { "k-tp-cell--active": L.value.h === e }]),
92
- onClick: (t) => z("h", e)
93
- }, f(N(e)), 11, w))), 128))]),
94
- a("div", T, [(l(!0), i(e, null, d(p(F), (e) => (l(), i("button", {
92
+ class: l(["k-tp-cell", { "k-tp-cell--active": R.value.h === e }]),
93
+ onClick: (t) => B("h", e)
94
+ }, p(P(e)), 11, T))), 128))]),
95
+ a("div", E, [(u(!0), i(e, null, f(m(I), (e) => (u(), i("button", {
95
96
  key: `m${e}`,
96
97
  type: "button",
97
- class: c(["k-tp-cell", { "k-tp-cell--active": L.value.m === e }]),
98
- onClick: (t) => z("m", e)
99
- }, f(N(e)), 11, E))), 128))]),
100
- s.useSeconds ? (l(), i("div", D, [(l(!0), i(e, null, d(p(I), (e) => (l(), i("button", {
98
+ class: l(["k-tp-cell", { "k-tp-cell--active": R.value.m === e }]),
99
+ onClick: (t) => B("m", e)
100
+ }, p(P(e)), 11, D))), 128))]),
101
+ s.useSeconds ? (u(), i("div", O, [(u(!0), i(e, null, f(m(L), (e) => (u(), i("button", {
101
102
  key: `s${e}`,
102
103
  type: "button",
103
- class: c(["k-tp-cell", { "k-tp-cell--active": L.value.s === e }]),
104
- onClick: (t) => z("s", e)
105
- }, f(N(e)), 11, O))), 128))])) : r("", !0)
104
+ class: l(["k-tp-cell", { "k-tp-cell--active": R.value.s === e }]),
105
+ onClick: (t) => B("s", e)
106
+ }, p(P(e)), 11, k))), 128))])) : r("", !0)
106
107
  ]),
107
108
  _: 1
108
109
  })]),
@@ -113,4 +114,4 @@ var x = ["disabled"], S = { class: "k-tp-field__text" }, C = { class: "k-tp-col"
113
114
  }
114
115
  });
115
116
  //#endregion
116
- export { k as default };
117
+ export { A as default };
@@ -1,7 +1,8 @@
1
- import { createBlock as e, createTextVNode as t, createVNode as n, defineComponent as r, openBlock as i, renderSlot as a, toDisplayString as o, unref as s, withCtx as c } from "vue";
2
- import { TooltipArrow as l, TooltipContent as u, TooltipPortal as d, TooltipProvider as f, TooltipRoot as p, TooltipTrigger as m } from "reka-ui";
1
+ import { createBlock as e, createTextVNode as t, createVNode as n, defineComponent as r, mergeProps as i, openBlock as a, renderSlot as o, toDisplayString as s, unref as c, withCtx as l } from "vue";
2
+ import { TooltipArrow as u, TooltipContent as d, TooltipPortal as f, TooltipProvider as p, TooltipRoot as m, TooltipTrigger as h } from "reka-ui";
3
3
  //#region components/KTooltip.vue?vue&type=script&setup=true&lang.ts
4
- var h = /* @__PURE__ */ r({
4
+ var g = /* @__PURE__ */ r({
5
+ inheritAttrs: !1,
5
6
  __name: "KTooltip",
6
7
  props: {
7
8
  label: {},
@@ -13,24 +14,24 @@ var h = /* @__PURE__ */ r({
13
14
  }
14
15
  },
15
16
  setup(r) {
16
- return (h, g) => (i(), e(s(f), {
17
+ return (g, _) => (a(), e(c(p), {
17
18
  "delay-duration": r.delayMs,
18
19
  "skip-delay-duration": 200
19
20
  }, {
20
- default: c(() => [n(s(p), null, {
21
- default: c(() => [n(s(m), {
21
+ default: l(() => [n(c(m), null, {
22
+ default: l(() => [n(c(h), i(g.$attrs, {
22
23
  "as-child": "",
23
24
  disabled: r.disabled
24
- }, {
25
- default: c(() => [a(h.$slots, "default")]),
25
+ }), {
26
+ default: l(() => [o(g.$slots, "default")]),
26
27
  _: 3
27
- }, 8, ["disabled"]), n(s(d), null, {
28
- default: c(() => [n(s(u), {
28
+ }, 16, ["disabled"]), n(c(f), null, {
29
+ default: l(() => [n(c(d), {
29
30
  side: r.side,
30
31
  "side-offset": 6,
31
32
  class: "k-tooltip pointer-events-none z-50 select-none rounded-md bg-ink-900 px-2 py-1 text-[11px] font-medium text-ink-50 shadow-md will-change-[transform,opacity]"
32
33
  }, {
33
- default: c(() => [t(o(r.label) + " ", 1), n(s(l), {
34
+ default: l(() => [t(s(r.label) + " ", 1), n(c(u), {
34
35
  class: "fill-ink-900",
35
36
  width: 8,
36
37
  height: 4
@@ -46,4 +47,4 @@ var h = /* @__PURE__ */ r({
46
47
  }
47
48
  });
48
49
  //#endregion
49
- export { h as default };
50
+ export { g as default };
@@ -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-73115ed6"]]);
6
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-b172871d"]]);
7
7
  //#endregion
8
8
  export { n as default };