@guoyg578/k-ui 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/components/KAutoComplete.vue.d.ts +2 -0
  2. package/dist/components/KAutoComplete.vue.js +1 -1
  3. package/dist/components/KAutoComplete.vue_vue_type_script_setup_true_lang.js +89 -29
  4. package/dist/components/KCalendar.vue.js +1 -1
  5. package/dist/components/KCalendar.vue_vue_type_script_setup_true_lang.js +132 -39
  6. package/dist/components/KCascader.vue.d.ts +2 -0
  7. package/dist/components/KCascader.vue.js +1 -1
  8. package/dist/components/KCascader.vue_vue_type_script_setup_true_lang.js +45 -43
  9. package/dist/components/KCheckbox.vue.d.ts +6 -2
  10. package/dist/components/KCheckbox.vue.js +1 -1
  11. package/dist/components/KCheckbox.vue_vue_type_script_setup_true_lang.js +38 -18
  12. package/dist/components/KCheckboxGroup.vue.d.ts +2 -0
  13. package/dist/components/KCheckboxGroup.vue.js +1 -1
  14. package/dist/components/KCheckboxGroup.vue_vue_type_script_setup_true_lang.js +23 -15
  15. package/dist/components/KCollapse.vue.d.ts +3 -1
  16. package/dist/components/KCollapse.vue.js +1 -1
  17. package/dist/components/KCollapse.vue_vue_type_script_setup_true_lang.js +27 -16
  18. package/dist/components/KCombobox.vue.js +1 -1
  19. package/dist/components/KCombobox.vue_vue_type_script_setup_true_lang.js +48 -47
  20. package/dist/components/KDataTable.vue.d.ts +48 -1
  21. package/dist/components/KDataTable.vue.js +1 -1
  22. package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +305 -74
  23. package/dist/components/KDatePicker.vue.d.ts +8 -0
  24. package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +32 -22
  25. package/dist/components/KDialog.vue.d.ts +4 -4
  26. package/dist/components/KDialog.vue.js +1 -1
  27. package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +83 -73
  28. package/dist/components/KDrawer.vue.js +1 -1
  29. package/dist/components/KDrawer.vue_vue_type_script_setup_true_lang.js +36 -35
  30. package/dist/components/KDropdown.vue.d.ts +4 -3
  31. package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +48 -30
  32. package/dist/components/KDynamicInput.vue.d.ts +2 -0
  33. package/dist/components/KDynamicInput.vue.js +1 -1
  34. package/dist/components/KDynamicInput.vue_vue_type_script_setup_true_lang.js +17 -6
  35. package/dist/components/KDynamicTags.vue.d.ts +2 -0
  36. package/dist/components/KDynamicTags.vue.js +1 -1
  37. package/dist/components/KDynamicTags.vue_vue_type_script_setup_true_lang.js +11 -10
  38. package/dist/components/KForm.vue.d.ts +12 -0
  39. package/dist/components/KForm.vue.js +1 -1
  40. package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +26 -4
  41. package/dist/components/KFormField.vue.d.ts +3 -1
  42. package/dist/components/KFormField.vue.js +1 -1
  43. package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +124 -61
  44. package/dist/components/KInputNumber.vue.js +1 -1
  45. package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +35 -29
  46. package/dist/components/KMention.vue.d.ts +2 -0
  47. package/dist/components/KMention.vue.js +1 -1
  48. package/dist/components/KMention.vue_vue_type_script_setup_true_lang.js +34 -33
  49. package/dist/components/KMenu.vue.js +1 -1
  50. package/dist/components/KMenu.vue_vue_type_script_setup_true_lang.js +132 -51
  51. package/dist/components/KMenuItem.vue.js +1 -1
  52. package/dist/components/KMenuItem.vue_vue_type_script_setup_true_lang.js +21 -6
  53. package/dist/components/KMessage.d.ts +5 -0
  54. package/dist/components/KMessage.js +36 -23
  55. package/dist/components/KNotification.d.ts +8 -0
  56. package/dist/components/KNotification.js +45 -29
  57. package/dist/components/KNotificationProvider.vue.js +3 -8
  58. package/dist/components/KNotificationProvider.vue_vue_type_script_setup_true_lang.js +11 -0
  59. package/dist/components/KPagination.vue.d.ts +4 -1
  60. package/dist/components/KPagination.vue.js +1 -1
  61. package/dist/components/KPagination.vue_vue_type_script_setup_true_lang.js +36 -33
  62. package/dist/components/KPopover.vue_vue_type_script_setup_true_lang.js +15 -14
  63. package/dist/components/KRadio.vue.d.ts +1 -0
  64. package/dist/components/KRadio.vue.js +1 -1
  65. package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +22 -14
  66. package/dist/components/KRadioGroup.vue.d.ts +4 -2
  67. package/dist/components/KRadioGroup.vue.js +1 -1
  68. package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +16 -4
  69. package/dist/components/KRate.vue.d.ts +5 -0
  70. package/dist/components/KRate.vue.js +1 -1
  71. package/dist/components/KRate.vue_vue_type_script_setup_true_lang.js +72 -24
  72. package/dist/components/KSelect.vue.d.ts +2 -2
  73. package/dist/components/KSelect.vue.js +1 -1
  74. package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +60 -59
  75. package/dist/components/KSlider.vue.d.ts +2 -0
  76. package/dist/components/KSlider.vue.js +1 -1
  77. package/dist/components/KSlider.vue_vue_type_script_setup_true_lang.js +17 -16
  78. package/dist/components/KTextarea.vue.d.ts +2 -0
  79. package/dist/components/KTextarea.vue.js +1 -1
  80. package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +10 -9
  81. package/dist/components/KTimePicker.vue.d.ts +2 -0
  82. package/dist/components/KTimePicker.vue.js +1 -1
  83. package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +63 -49
  84. package/dist/components/KTooltip.vue_vue_type_script_setup_true_lang.js +13 -12
  85. package/dist/components/KTransfer.vue.d.ts +2 -0
  86. package/dist/components/KTransfer.vue.js +1 -1
  87. package/dist/components/KTransfer.vue_vue_type_script_setup_true_lang.js +35 -34
  88. package/dist/components/KTreeSelect.vue.d.ts +2 -0
  89. package/dist/components/KTreeSelect.vue.js +1 -1
  90. package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +20 -18
  91. package/dist/components/KUpload.vue.d.ts +14 -0
  92. package/dist/components/KUpload.vue.js +1 -1
  93. package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +159 -117
  94. package/dist/components/checkbox-context.d.ts +10 -0
  95. package/dist/components/checkbox-context.js +4 -0
  96. package/dist/components/form-context.d.ts +19 -2
  97. package/dist/components/form-context.js +31 -1
  98. package/dist/components/menu-context.d.ts +4 -0
  99. package/dist/components/radio-context.d.ts +6 -1
  100. package/dist/k-ui.css +1 -1
  101. package/dist/styles/tokens.css +40 -1
  102. package/package.json +1 -1
@@ -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", typeof R.modelValue == "number" ? null : "");
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 };
@@ -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-40d1535e"]]);
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 = p, g = e(() => Array.isArray(m.modelValue) ? [m.modelValue[0], m.modelValue[1]] : [m.min, Number(m.modelValue ?? m.min)]), _ = e(() => Math.min(g.value[0], g.value[1])), v = e(() => Math.max(g.value[0], g.value[1])), y = e(() => (_.value - m.min) / (m.max - m.min) * 100), b = e(() => (v.value - m.min) / (m.max - m.min) * 100), x = e(() => ({
41
- left: `${m.range ? y.value : 0}%`,
42
- width: `${m.range ? b.value - y.value : b.value}%`
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 S(e) {
45
- h("update:modelValue", Number(e));
45
+ function w(e) {
46
+ g("update:modelValue", Number(e));
46
47
  }
47
- function C(e, t) {
48
- let n = [...g.value];
49
- n[e] = Number(t), h("update:modelValue", [Math.min(n[0], n[1]), Math.max(n[0], n[1])]);
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(x.value)
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: g.value[0],
64
+ value: _.value[0],
64
65
  disabled: i.disabled,
65
- onInput: p[0] ||= (e) => C(0, e.target.value)
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 ? g.value[1] : i.modelValue,
74
+ value: i.range ? _.value[1] : i.modelValue,
74
75
  disabled: i.disabled,
75
- onInput: p[1] ||= (e) => i.range ? C(1, e.target.value) : S(e.target.value)
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 ? `${_.value} - ${v.value}` : i.modelValue), 1)) : t("", !0)
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-cbba0863"]]);
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 = g.value.minRows * n + r, a = g.value.maxRows ? g.value.maxRows * n + r : Infinity;
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 v(e) {
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(_), { immediate: !0 }), u({
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: v,
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-52df9cd5"]]);
6
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-1d65209e"]]);
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, 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 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 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
- }, O = ["onClick"], k = /* @__PURE__ */ s({
8
+ }, j = ["onClick"], M = /* @__PURE__ */ s({
9
+ inheritAttrs: !1,
9
10
  __name: "KTimePicker",
10
11
  props: {
11
12
  modelValue: {},
@@ -21,12 +22,13 @@ var x = ["disabled"], S = { class: "k-tp-field__text" }, C = { class: "k-tp-col"
21
22
  type: Boolean,
22
23
  default: !0
23
24
  },
24
- placeholder: { default: "选择时间" }
25
+ placeholder: { default: "选择时间" },
26
+ size: { default: "md" }
25
27
  },
26
28
  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;
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;
30
32
  if (!e) return {
31
33
  h: null,
32
34
  m: null,
@@ -34,76 +36,88 @@ var x = ["disabled"], S = { class: "k-tp-field__text" }, C = { class: "k-tp-col"
34
36
  };
35
37
  let [t, n, r] = e.split(":").map((e) => parseInt(e, 10));
36
38
  return {
37
- h: Number.isNaN(t) ? null : t,
38
- m: Number.isNaN(n) ? null : n,
39
- s: Number.isNaN(r) ? null : r
39
+ h: V(t, 23),
40
+ m: V(n, 59),
41
+ s: V(r, 59)
40
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
+ });
41
51
  });
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)}`);
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)}`);
44
54
  }
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);
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);
48
58
  }
49
- function B(e) {
50
- e.stopPropagation(), j("update:modelValue", null);
59
+ function K(e) {
60
+ e.stopPropagation(), P("update:modelValue", null);
51
61
  }
52
- return (t, u) => (l(), n(p(y), {
53
- open: M.value,
54
- "onUpdate:open": u[0] ||= (e) => M.value = e
62
+ return (t, l) => (d(), n(h(S), {
63
+ open: F.value,
64
+ "onUpdate:open": l[0] ||= (e) => F.value = e
55
65
  }, {
56
- default: m(() => [o(p(b), {
66
+ default: _(() => [o(h(C), {
57
67
  "as-child": "",
58
68
  disabled: s.disabled
59
69
  }, {
60
- default: m(() => [a("button", {
70
+ default: _(() => [a("button", c(t.$attrs, {
61
71
  type: "button",
62
- class: c(["k-tp-field", {
72
+ class: ["k-tp-field", [`k-tp-field--${I.value}`, {
63
73
  "k-tp-field--disabled": s.disabled,
64
74
  "k-tp-field--placeholder": !s.modelValue
65
- }]),
75
+ }]],
66
76
  disabled: s.disabled
67
- }, [
68
- o(p(h), {
77
+ }), [
78
+ o(h(v), {
69
79
  size: 15,
70
80
  class: "k-tp-field__icon"
71
81
  }),
72
- a("span", S, f(s.modelValue || s.placeholder), 1),
73
- s.clearable && s.modelValue && !s.disabled ? (l(), n(p(g), {
82
+ a("span", T, m(s.modelValue || s.placeholder), 1),
83
+ s.clearable && s.modelValue && !s.disabled ? (d(), n(h(y), {
74
84
  key: 0,
75
85
  size: 14,
76
86
  class: "k-tp-field__clear",
77
- onClick: B
87
+ onClick: K
78
88
  })) : r("", !0)
79
- ], 10, x)]),
89
+ ], 16, w)]),
80
90
  _: 1
81
- }, 8, ["disabled"]), o(p(v), null, {
82
- default: m(() => [o(p(_), {
91
+ }, 8, ["disabled"]), o(h(x), null, {
92
+ default: _(() => [o(h(b), {
83
93
  class: "k-menu-surface k-tp-panel",
84
94
  "side-offset": 6,
85
95
  align: "start"
86
96
  }, {
87
- default: m(() => [
88
- a("div", C, [(l(!0), i(e, null, d(p(P), (e) => (l(), i("button", {
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", {
89
103
  key: `h${e}`,
90
104
  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", {
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", {
95
109
  key: `m${e}`,
96
110
  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", {
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", {
101
115
  key: `s${e}`,
102
116
  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)
106
- ]),
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)]),
107
121
  _: 1
108
122
  })]),
109
123
  _: 1
@@ -113,4 +127,4 @@ var x = ["disabled"], S = { class: "k-tp-field__text" }, C = { class: "k-tp-col"
113
127
  }
114
128
  });
115
129
  //#endregion
116
- export { k as default };
130
+ export { M 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 };
@@ -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-eb667962"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-4cabb608"]]);
6
6
  //#endregion
7
7
  export { n as default };