@guoyg578/k-ui 0.1.1 → 0.1.2

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 (140) hide show
  1. package/README.md +11 -9
  2. package/dist/components/KAffix.vue.d.ts +17 -0
  3. package/dist/components/KAffix.vue.js +7 -0
  4. package/dist/components/KAffix.vue_vue_type_script_setup_true_lang.js +18 -0
  5. package/dist/components/KAnchor.vue.d.ts +14 -0
  6. package/dist/components/KAnchor.vue.js +7 -0
  7. package/dist/components/KAnchor.vue_vue_type_script_setup_true_lang.js +40 -0
  8. package/dist/components/KAutoComplete.vue.d.ts +26 -0
  9. package/dist/components/KAutoComplete.vue.js +8 -0
  10. package/dist/components/KAutoComplete.vue_vue_type_script_setup_true_lang.js +58 -0
  11. package/dist/components/KBackTop.vue.d.ts +24 -0
  12. package/dist/components/KBackTop.vue.js +7 -0
  13. package/dist/components/KBackTop.vue_vue_type_script_setup_true_lang.js +56 -0
  14. package/dist/components/KBadge.vue.d.ts +31 -0
  15. package/dist/components/KBadge.vue.js +7 -0
  16. package/dist/components/KBadge.vue_vue_type_script_setup_true_lang.js +48 -0
  17. package/dist/components/KButtonGroup.vue.d.ts +18 -0
  18. package/dist/components/KButtonGroup.vue.js +6 -0
  19. package/dist/components/KButtonGroup.vue_vue_type_script_setup_true_lang.js +14 -0
  20. package/dist/components/KCalendar.vue.d.ts +33 -0
  21. package/dist/components/KCalendar.vue.js +7 -0
  22. package/dist/components/KCalendar.vue_vue_type_script_setup_true_lang.js +78 -0
  23. package/dist/components/KCascader.vue.d.ts +29 -0
  24. package/dist/components/KCascader.vue.js +8 -0
  25. package/dist/components/KCascader.vue_vue_type_script_setup_true_lang.js +114 -0
  26. package/dist/components/KCode.vue.d.ts +27 -0
  27. package/dist/components/KCode.vue.js +7 -0
  28. package/dist/components/KCode.vue_vue_type_script_setup_true_lang.js +42 -0
  29. package/dist/components/KCollapse.vue.d.ts +25 -0
  30. package/dist/components/KCollapse.vue.js +7 -0
  31. package/dist/components/KCollapse.vue_vue_type_script_setup_true_lang.js +35 -0
  32. package/dist/components/KCollapseItem.vue.d.ts +22 -0
  33. package/dist/components/KCollapseItem.vue.js +7 -0
  34. package/dist/components/KCollapseItem.vue_vue_type_script_setup_true_lang.js +46 -0
  35. package/dist/components/KCountdown.vue.d.ts +15 -0
  36. package/dist/components/KCountdown.vue.js +7 -0
  37. package/dist/components/KCountdown.vue_vue_type_script_setup_true_lang.js +36 -0
  38. package/dist/components/KDescriptions.vue.d.ts +1 -1
  39. package/dist/components/KDivider.vue.d.ts +21 -0
  40. package/dist/components/KDivider.vue.js +7 -0
  41. package/dist/components/KDivider.vue_vue_type_script_setup_true_lang.js +33 -0
  42. package/dist/components/KDropdown.vue.d.ts +1 -1
  43. package/dist/components/KDropdown.vue.js +1 -1
  44. package/dist/components/KDynamicInput.vue.d.ts +33 -0
  45. package/dist/components/KDynamicInput.vue.js +7 -0
  46. package/dist/components/KDynamicInput.vue_vue_type_script_setup_true_lang.js +81 -0
  47. package/dist/components/KDynamicTags.vue.d.ts +20 -0
  48. package/dist/components/KDynamicTags.vue.js +7 -0
  49. package/dist/components/KDynamicTags.vue_vue_type_script_setup_true_lang.js +60 -0
  50. package/dist/components/KGrid.vue.d.ts +29 -0
  51. package/dist/components/KGrid.vue.js +7 -0
  52. package/dist/components/KGrid.vue_vue_type_script_setup_true_lang.js +33 -0
  53. package/dist/components/KGridItem.vue.d.ts +20 -0
  54. package/dist/components/KGridItem.vue.js +7 -0
  55. package/dist/components/KGridItem.vue_vue_type_script_setup_true_lang.js +18 -0
  56. package/dist/components/KLayout.vue.d.ts +19 -0
  57. package/dist/components/KLayout.vue.js +7 -0
  58. package/dist/components/KLayout.vue_vue_type_script_setup_true_lang.js +14 -0
  59. package/dist/components/KLayoutContent.vue.d.ts +17 -0
  60. package/dist/components/KLayoutContent.vue.js +7 -0
  61. package/dist/components/KLayoutContent.vue_vue_type_script_setup_true_lang.js +11 -0
  62. package/dist/components/KLayoutHeader.vue.d.ts +19 -0
  63. package/dist/components/KLayoutHeader.vue.js +7 -0
  64. package/dist/components/KLayoutHeader.vue_vue_type_script_setup_true_lang.js +14 -0
  65. package/dist/components/KLayoutSider.vue.d.ts +28 -0
  66. package/dist/components/KLayoutSider.vue.js +7 -0
  67. package/dist/components/KLayoutSider.vue_vue_type_script_setup_true_lang.js +34 -0
  68. package/dist/components/KList.vue.d.ts +24 -0
  69. package/dist/components/KList.vue.js +7 -0
  70. package/dist/components/KList.vue_vue_type_script_setup_true_lang.js +39 -0
  71. package/dist/components/KListItem.vue.d.ts +17 -0
  72. package/dist/components/KListItem.vue.js +7 -0
  73. package/dist/components/KListItem.vue_vue_type_script_setup_true_lang.js +22 -0
  74. package/dist/components/KMention.vue.d.ts +27 -0
  75. package/dist/components/KMention.vue.js +8 -0
  76. package/dist/components/KMention.vue_vue_type_script_setup_true_lang.js +73 -0
  77. package/dist/components/KMenu.vue.d.ts +30 -0
  78. package/dist/components/KMenu.vue.js +9 -0
  79. package/dist/components/KMenu.vue_vue_type_script_setup_true_lang.js +134 -0
  80. package/dist/components/KMenuItem.vue.d.ts +10 -0
  81. package/dist/components/KMenuItem.vue.js +7 -0
  82. package/dist/components/KMenuItem.vue_vue_type_script_setup_true_lang.js +58 -0
  83. package/dist/components/KNumberAnimation.vue.d.ts +33 -0
  84. package/dist/components/KNumberAnimation.vue.js +7 -0
  85. package/dist/components/KNumberAnimation.vue_vue_type_script_setup_true_lang.js +45 -0
  86. package/dist/components/KPopconfirm.vue.d.ts +1 -1
  87. package/dist/components/KPopover.vue.d.ts +1 -1
  88. package/dist/components/KRadio.vue.d.ts +4 -2
  89. package/dist/components/KRadio.vue.js +1 -1
  90. package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +24 -11
  91. package/dist/components/KRadioGroup.vue.d.ts +3 -0
  92. package/dist/components/KRadioGroup.vue.js +1 -1
  93. package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +17 -12
  94. package/dist/components/KRate.vue.d.ts +25 -0
  95. package/dist/components/KRate.vue.js +7 -0
  96. package/dist/components/KRate.vue_vue_type_script_setup_true_lang.js +77 -0
  97. package/dist/components/KSpace.vue.d.ts +32 -0
  98. package/dist/components/KSpace.vue.js +7 -0
  99. package/dist/components/KSpace.vue_vue_type_script_setup_true_lang.js +52 -0
  100. package/dist/components/KStatistic.vue.d.ts +23 -0
  101. package/dist/components/KStatistic.vue.js +7 -0
  102. package/dist/components/KStatistic.vue_vue_type_script_setup_true_lang.js +27 -0
  103. package/dist/components/KText.vue.d.ts +26 -0
  104. package/dist/components/KText.vue.js +7 -0
  105. package/dist/components/KText.vue_vue_type_script_setup_true_lang.js +31 -0
  106. package/dist/components/KTime.vue.d.ts +14 -0
  107. package/dist/components/KTime.vue.js +7 -0
  108. package/dist/components/KTime.vue_vue_type_script_setup_true_lang.js +56 -0
  109. package/dist/components/KTimePicker.vue.d.ts +19 -0
  110. package/dist/components/KTimePicker.vue.js +8 -0
  111. package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +116 -0
  112. package/dist/components/KTimeline.vue.d.ts +13 -0
  113. package/dist/components/KTimeline.vue.js +7 -0
  114. package/dist/components/KTimeline.vue_vue_type_script_setup_true_lang.js +10 -0
  115. package/dist/components/KTimelineItem.vue.d.ts +29 -0
  116. package/dist/components/KTimelineItem.vue.js +7 -0
  117. package/dist/components/KTimelineItem.vue_vue_type_script_setup_true_lang.js +37 -0
  118. package/dist/components/KTransfer.vue.d.ts +24 -0
  119. package/dist/components/KTransfer.vue.js +7 -0
  120. package/dist/components/KTransfer.vue_vue_type_script_setup_true_lang.js +114 -0
  121. package/dist/components/KTreeSelect.vue.d.ts +22 -0
  122. package/dist/components/KTreeSelect.vue.js +8 -0
  123. package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +100 -0
  124. package/dist/components/KTypography.vue.d.ts +13 -0
  125. package/dist/components/KTypography.vue.js +7 -0
  126. package/dist/components/KTypography.vue_vue_type_script_setup_true_lang.js +10 -0
  127. package/dist/components/KUpload.vue.d.ts +1 -1
  128. package/dist/components/KWatermark.vue.d.ts +27 -0
  129. package/dist/components/KWatermark.vue.js +7 -0
  130. package/dist/components/KWatermark.vue_vue_type_script_setup_true_lang.js +28 -0
  131. package/dist/components/list-context.d.ts +6 -0
  132. package/dist/components/list-context.js +4 -0
  133. package/dist/components/menu-context.d.ts +26 -0
  134. package/dist/components/menu-context.js +4 -0
  135. package/dist/components/radio-context.d.ts +6 -0
  136. package/dist/components/radio-context.js +4 -0
  137. package/dist/index.d.ts +43 -0
  138. package/dist/index.js +102 -64
  139. package/dist/k-ui.css +1 -1
  140. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ /* empty css */
3
+ import t from "./KMenu.vue_vue_type_script_setup_true_lang.js";
4
+ /* empty css */
5
+ /* empty css */
6
+ //#region components/KMenu.vue
7
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-c59150ee"]]);
8
+ //#endregion
9
+ export { n as default };
@@ -0,0 +1,134 @@
1
+ import { MENU_KEY as e } from "./menu-context.js";
2
+ import t from "./KMenuItem.vue.js";
3
+ import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, createTextVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, provide as m, ref as h, renderList as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, watch as b, withCtx as x } from "vue";
4
+ import { HoverCardContent as S, HoverCardPortal as C, HoverCardRoot as w, HoverCardTrigger as T } from "reka-ui";
5
+ //#region components/KMenu.vue?vue&type=script&setup=true&lang.ts
6
+ var E = {
7
+ key: 0,
8
+ class: "k-menu-tree__divider"
9
+ }, D = ["aria-label"], O = ["disabled", "onClick"], k = {
10
+ key: 0,
11
+ class: "k-menu-tree-flyout__icon"
12
+ }, A = { class: "k-menu-tree-flyout__label" }, j = [
13
+ "disabled",
14
+ "aria-label",
15
+ "onClick"
16
+ ], M = /* @__PURE__ */ u({
17
+ __name: "KMenu",
18
+ props: {
19
+ value: {},
20
+ options: {},
21
+ collapsed: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ collapsedWidth: { default: 64 },
26
+ indent: { default: 20 },
27
+ rootIndent: { default: 16 },
28
+ accordion: {
29
+ type: Boolean,
30
+ default: !1
31
+ }
32
+ },
33
+ emits: ["update:value", "select"],
34
+ setup(u, { emit: M }) {
35
+ let N = u, P = M, F = h(/* @__PURE__ */ new Set()), I = r(() => {
36
+ let e = [], t = (n, r) => {
37
+ for (let i of n) if (i.type !== "divider") {
38
+ if (i.key === N.value) return e.push(...r), !0;
39
+ if (i.children?.length && t(i.children, [...r, i.key])) return !0;
40
+ }
41
+ return !1;
42
+ };
43
+ return t(N.options, []), e;
44
+ });
45
+ b(I, (e) => {
46
+ if (!e.length) return;
47
+ let t = new Set(F.value);
48
+ e.forEach((e) => t.add(e)), F.value = t;
49
+ }, { immediate: !0 });
50
+ let L = {
51
+ isActive: (e) => e === N.value,
52
+ inActiveTrail: (e) => I.value.includes(e),
53
+ isExpanded: (e) => F.value.has(e),
54
+ toggle: (e) => {
55
+ let t = new Set(F.value);
56
+ t.has(e) ? t.delete(e) : (N.accordion && t.clear(), t.add(e)), F.value = t;
57
+ },
58
+ select: (e) => {
59
+ P("update:value", e.key), P("select", e.key, e);
60
+ },
61
+ get indent() {
62
+ return N.indent;
63
+ },
64
+ get rootIndent() {
65
+ return N.rootIndent;
66
+ }
67
+ };
68
+ m(e, L);
69
+ let R = (e) => typeof e == "function";
70
+ function z(e) {
71
+ e.disabled || (P("update:value", e.key), P("select", e.key, e));
72
+ }
73
+ return (e, r) => (p(), o("nav", {
74
+ class: d(["k-menu-tree", { "k-menu-tree--collapsed": u.collapsed }]),
75
+ style: f(u.collapsed ? { width: `${u.collapsedWidth}px` } : void 0)
76
+ }, [u.collapsed ? (p(!0), o(n, { key: 1 }, g(u.options, (e, t) => (p(), o(n, { key: e.key || `_div${t}` }, [e.type === "divider" ? (p(), o("div", E)) : e.children?.length ? (p(), i(y(w), {
77
+ key: 1,
78
+ "open-delay": 0,
79
+ "close-delay": 120
80
+ }, {
81
+ default: x(() => [l(y(T), { "as-child": "" }, {
82
+ default: x(() => [s("button", {
83
+ type: "button",
84
+ class: d(["k-menu-tree__icon-btn", { "k-menu-tree__icon-btn--trail": L.inActiveTrail(e.key) }]),
85
+ "aria-label": typeof e.label == "string" ? e.label : void 0
86
+ }, [e.icon ? (p(), i(_(e.icon), {
87
+ key: 0,
88
+ size: 20
89
+ })) : a("", !0)], 10, D)]),
90
+ _: 2
91
+ }, 1024), l(y(C), null, {
92
+ default: x(() => [l(y(S), {
93
+ class: "k-menu-surface k-menu-tree-flyout",
94
+ side: "right",
95
+ align: "start",
96
+ "side-offset": 10
97
+ }, {
98
+ default: x(() => [(p(!0), o(n, null, g(e.children, (e) => (p(), o("button", {
99
+ key: e.key,
100
+ type: "button",
101
+ class: d(["k-menu-tree-flyout__item", {
102
+ "k-menu-tree-flyout__item--active": L.isActive(e.key),
103
+ "k-menu-tree-flyout__item--disabled": e.disabled
104
+ }]),
105
+ disabled: e.disabled,
106
+ onClick: (t) => z(e)
107
+ }, [e.icon ? (p(), o("span", k, [(p(), i(_(e.icon), { size: 16 }))])) : a("", !0), s("span", A, [R(e.label) ? (p(), i(_(e.label), { key: 0 })) : (p(), o(n, { key: 1 }, [c(v(e.label), 1)], 64))])], 10, O))), 128))]),
108
+ _: 2
109
+ }, 1024)]),
110
+ _: 2
111
+ }, 1024)]),
112
+ _: 2
113
+ }, 1024)) : (p(), o("button", {
114
+ key: 2,
115
+ type: "button",
116
+ class: d(["k-menu-tree__icon-btn", {
117
+ "k-menu-tree__icon-btn--active": L.isActive(e.key),
118
+ "k-menu-tree__icon-btn--disabled": e.disabled
119
+ }]),
120
+ disabled: e.disabled,
121
+ "aria-label": typeof e.label == "string" ? e.label : void 0,
122
+ onClick: (t) => z(e)
123
+ }, [e.icon ? (p(), i(_(e.icon), {
124
+ key: 0,
125
+ size: 20
126
+ })) : a("", !0)], 10, j))], 64))), 128)) : (p(!0), o(n, { key: 0 }, g(u.options, (e, n) => (p(), i(t, {
127
+ key: e.key || `_div${n}`,
128
+ option: e,
129
+ depth: 0
130
+ }, null, 8, ["option"]))), 128))], 6));
131
+ }
132
+ });
133
+ //#endregion
134
+ export { M as default };
@@ -0,0 +1,10 @@
1
+ import { type MenuOption } from './menu-context';
2
+ type __VLS_Props = {
3
+ option: MenuOption;
4
+ depth?: number;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ depth: number;
8
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
+ declare const _default: typeof __VLS_export;
10
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KMenuItem.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KMenuItem.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-7e1cc01a"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,58 @@
1
+ import { MENU_KEY as e } from "./menu-context.js";
2
+ import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, inject as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderList as p, resolveComponent as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, vShow as v, withDirectives as y } from "vue";
3
+ import { ChevronDown as b } from "lucide-vue-next";
4
+ //#region components/KMenuItem.vue?vue&type=script&setup=true&lang.ts
5
+ var x = {
6
+ key: 0,
7
+ class: "k-menu-tree__divider"
8
+ }, S = {
9
+ key: 1,
10
+ class: "k-menu-tree__node"
11
+ }, C = ["disabled"], w = {
12
+ key: 0,
13
+ class: "k-menu-tree__icon"
14
+ }, T = { class: "k-menu-tree__label" }, E = {
15
+ key: 0,
16
+ class: "k-menu-tree__children"
17
+ }, D = /* @__PURE__ */ c({
18
+ name: "KMenuItem",
19
+ __name: "KMenuItem",
20
+ props: {
21
+ option: {},
22
+ depth: { default: 0 }
23
+ },
24
+ setup(c) {
25
+ let D = c, O = l(e), k = n(() => !!D.option.children?.length), A = (e) => typeof e == "function", j = n(() => `${O.rootIndent + D.depth * O.indent}px`);
26
+ function M() {
27
+ D.option.disabled || (k.value ? O.toggle(D.option.key) : O.select(D.option));
28
+ }
29
+ return (e, n) => {
30
+ let l = m("KMenuItem", !0);
31
+ return c.option.type === "divider" ? (f(), a("div", x)) : (f(), a("div", S, [o("button", {
32
+ type: "button",
33
+ class: u(["k-menu-tree__item", {
34
+ "k-menu-tree__item--active": !k.value && _(O).isActive(c.option.key),
35
+ "k-menu-tree__item--trail": k.value && _(O).inActiveTrail(c.option.key),
36
+ "k-menu-tree__item--disabled": c.option.disabled
37
+ }]),
38
+ style: d({ paddingLeft: j.value }),
39
+ disabled: c.option.disabled,
40
+ onClick: M
41
+ }, [
42
+ c.option.icon ? (f(), a("span", w, [(f(), r(h(c.option.icon), { size: 18 }))])) : i("", !0),
43
+ o("span", T, [A(c.option.label) ? (f(), r(h(c.option.label), { key: 0 })) : (f(), a(t, { key: 1 }, [s(g(c.option.label), 1)], 64))]),
44
+ k.value ? (f(), r(_(b), {
45
+ key: 1,
46
+ size: 14,
47
+ class: u(["k-menu-tree__arrow", { "k-menu-tree__arrow--open": _(O).isExpanded(c.option.key) }])
48
+ }, null, 8, ["class"])) : i("", !0)
49
+ ], 14, C), k.value ? y((f(), a("div", E, [(f(!0), a(t, null, p(c.option.children, (e) => (f(), r(l, {
50
+ key: e.key,
51
+ option: e,
52
+ depth: c.depth + 1
53
+ }, null, 8, ["option", "depth"]))), 128))], 512)), [[v, _(O).isExpanded(c.option.key)]]) : i("", !0)]));
54
+ };
55
+ }
56
+ });
57
+ //#endregion
58
+ export { D as default };
@@ -0,0 +1,33 @@
1
+ type __VLS_Props = {
2
+ from?: number;
3
+ to: number;
4
+ duration?: number;
5
+ precision?: number;
6
+ /** 千分位分隔 */
7
+ showSeparator?: boolean;
8
+ /** 挂载即播放 */
9
+ active?: boolean;
10
+ };
11
+ declare var __VLS_1: {}, __VLS_3: {};
12
+ type __VLS_Slots = {} & {
13
+ prefix?: (props: typeof __VLS_1) => any;
14
+ } & {
15
+ suffix?: (props: typeof __VLS_3) => any;
16
+ };
17
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
18
+ play: () => void;
19
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
+ from: number;
21
+ precision: number;
22
+ duration: number;
23
+ active: boolean;
24
+ showSeparator: boolean;
25
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KNumberAnimation.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KNumberAnimation.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-ae3aef09"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,45 @@
1
+ import { computed as e, createElementBlock as t, createTextVNode as n, defineComponent as r, onMounted as i, onUnmounted as a, openBlock as o, ref as s, renderSlot as c, toDisplayString as l, watch as u } from "vue";
2
+ //#region components/KNumberAnimation.vue?vue&type=script&setup=true&lang.ts
3
+ var d = { class: "k-num" }, f = /* @__PURE__ */ r({
4
+ __name: "KNumberAnimation",
5
+ props: {
6
+ from: { default: 0 },
7
+ to: {},
8
+ duration: { default: 2e3 },
9
+ precision: { default: 0 },
10
+ showSeparator: {
11
+ type: Boolean,
12
+ default: !1
13
+ },
14
+ active: {
15
+ type: Boolean,
16
+ default: !0
17
+ }
18
+ },
19
+ setup(r, { expose: f }) {
20
+ let p = r, m = s(p.from), h = 0;
21
+ function g(e, t) {
22
+ cancelAnimationFrame(h);
23
+ let n = performance.now(), r = (i) => {
24
+ let a = Math.min(1, (i - n) / p.duration), o = 1 - (1 - a) ** 3;
25
+ m.value = e + (t - e) * o, a < 1 && (h = requestAnimationFrame(r));
26
+ };
27
+ h = requestAnimationFrame(r);
28
+ }
29
+ let _ = e(() => {
30
+ let e = m.value.toFixed(p.precision);
31
+ if (!p.showSeparator) return e;
32
+ let [t, n] = e.split("."), r = t.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
33
+ return n ? `${r}.${n}` : r;
34
+ });
35
+ return f({ play: () => g(p.from, p.to) }), i(() => {
36
+ p.active && g(p.from, p.to);
37
+ }), a(() => cancelAnimationFrame(h)), u(() => p.to, (e, t) => g(t ?? p.from, e)), (e, r) => (o(), t("span", d, [
38
+ c(e.$slots, "prefix", {}, void 0, !0),
39
+ n(l(_.value), 1),
40
+ c(e.$slots, "suffix", {}, void 0, !0)
41
+ ]));
42
+ }
43
+ });
44
+ //#endregion
45
+ export { f as default };
@@ -30,8 +30,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
30
30
  onNegativeClick?: (() => any) | undefined;
31
31
  }>, {
32
32
  disabled: boolean;
33
- side: "top" | "right" | "bottom" | "left";
34
33
  align: "start" | "center" | "end";
34
+ side: "top" | "right" | "bottom" | "left";
35
35
  confirmText: string;
36
36
  cancelText: string;
37
37
  confirmType: "primary" | "danger" | "error" | "warning";
@@ -25,9 +25,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
25
25
  "onUpdate:open"?: ((value: boolean | undefined) => any) | undefined;
26
26
  }>, {
27
27
  disabled: boolean;
28
+ align: "start" | "center" | "end";
28
29
  side: "top" | "right" | "bottom" | "left";
29
30
  sideOffset: number;
30
- align: "start" | "center" | "end";
31
31
  showArrow: boolean;
32
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
33
33
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -3,9 +3,11 @@ type __VLS_Props = {
3
3
  disabled?: boolean;
4
4
  label?: string;
5
5
  };
6
- declare var __VLS_12: {};
6
+ declare var __VLS_8: {}, __VLS_21: {};
7
7
  type __VLS_Slots = {} & {
8
- default?: (props: typeof __VLS_12) => any;
8
+ default?: (props: typeof __VLS_8) => any;
9
+ } & {
10
+ default?: (props: typeof __VLS_21) => any;
9
11
  };
10
12
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
13
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KRadio.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region components/KRadio.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-47a8aaeb"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-9ec711b6"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -1,26 +1,39 @@
1
- import { createCommentVNode as e, createElementBlock as t, createTextVNode as n, createVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, toDisplayString as c, unref as l, withCtx as u } from "vue";
2
- import { RadioGroupIndicator as d, RadioGroupItem as f } from "reka-ui";
1
+ import { RADIO_GROUP_KEY as e } from "./radio-context.js";
2
+ import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createTextVNode as a, createVNode as o, defineComponent as s, inject as c, normalizeClass as l, openBlock as u, renderSlot as d, toDisplayString as f, unref as p, withCtx as m } from "vue";
3
+ import { RadioGroupIndicator as h, RadioGroupItem as g } from "reka-ui";
3
4
  //#region components/KRadio.vue?vue&type=script&setup=true&lang.ts
4
- var p = {
5
+ var _ = {
5
6
  key: 0,
6
7
  class: "k-radio__label"
7
- }, m = /* @__PURE__ */ i({
8
+ }, v = /* @__PURE__ */ s({
8
9
  __name: "KRadio",
9
10
  props: {
10
11
  value: {},
11
12
  disabled: { type: Boolean },
12
13
  label: {}
13
14
  },
14
- setup(i) {
15
- return (m, h) => (o(), t("label", { class: a(["k-radio-wrap", { "k-radio-wrap--disabled": i.disabled }]) }, [r(l(f), {
16
- value: String(i.value),
17
- disabled: i.disabled,
15
+ setup(s) {
16
+ let v = c(e, null), y = t(() => !!v?.button.value);
17
+ return (e, t) => y.value ? (u(), n(p(g), {
18
+ key: 0,
19
+ value: String(s.value),
20
+ disabled: s.disabled,
21
+ class: "k-radio-btn"
22
+ }, {
23
+ default: m(() => [d(e.$slots, "default", {}, () => [a(f(s.label), 1)], !0)]),
24
+ _: 3
25
+ }, 8, ["value", "disabled"])) : (u(), i("label", {
26
+ key: 1,
27
+ class: l(["k-radio-wrap", { "k-radio-wrap--disabled": s.disabled }])
28
+ }, [o(p(g), {
29
+ value: String(s.value),
30
+ disabled: s.disabled,
18
31
  class: "k-radio"
19
32
  }, {
20
- default: u(() => [r(l(d), { class: "k-radio__indicator" })]),
33
+ default: m(() => [o(p(h), { class: "k-radio__indicator" })]),
21
34
  _: 1
22
- }, 8, ["value", "disabled"]), i.label || m.$slots.default ? (o(), t("span", p, [s(m.$slots, "default", {}, () => [n(c(i.label), 1)], !0)])) : e("", !0)], 2));
35
+ }, 8, ["value", "disabled"]), s.label || e.$slots.default ? (u(), i("span", _, [d(e.$slots, "default", {}, () => [a(f(s.label), 1)], !0)])) : r("", !0)], 2));
23
36
  }
24
37
  });
25
38
  //#endregion
26
- export { m as default };
39
+ export { v as default };
@@ -2,6 +2,8 @@ type __VLS_Props = {
2
2
  modelValue?: string | number;
3
3
  disabled?: boolean;
4
4
  direction?: 'horizontal' | 'vertical';
5
+ /** 分段按钮样式(对齐 naive-ui NRadioButton) */
6
+ button?: boolean;
5
7
  };
6
8
  declare var __VLS_10: {};
7
9
  type __VLS_Slots = {} & {
@@ -12,6 +14,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
12
14
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
15
  "onUpdate:modelValue"?: ((v: string) => any) | undefined;
14
16
  }>, {
17
+ button: boolean;
15
18
  disabled: boolean;
16
19
  direction: "horizontal" | "vertical";
17
20
  modelValue: string | number;
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KRadioGroup.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region components/KRadioGroup.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-f6d3b657"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-813698ee"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -1,7 +1,8 @@
1
- import { createBlock as e, defineComponent as t, normalizeClass as n, openBlock as r, renderSlot as i, unref as a, withCtx as o } from "vue";
2
- import { RadioGroupRoot as s } from "reka-ui";
1
+ import { RADIO_GROUP_KEY as e } from "./radio-context.js";
2
+ import { createBlock as t, defineComponent as n, normalizeClass as r, openBlock as i, provide as a, renderSlot as o, toRef as s, unref as c, withCtx as l } from "vue";
3
+ import { RadioGroupRoot as u } from "reka-ui";
3
4
  //#region components/KRadioGroup.vue?vue&type=script&setup=true&lang.ts
4
- var c = /* @__PURE__ */ t({
5
+ var d = /* @__PURE__ */ n({
5
6
  __name: "KRadioGroup",
6
7
  props: {
7
8
  modelValue: { default: "" },
@@ -9,17 +10,21 @@ var c = /* @__PURE__ */ t({
9
10
  type: Boolean,
10
11
  default: !1
11
12
  },
12
- direction: { default: "horizontal" }
13
+ direction: { default: "horizontal" },
14
+ button: {
15
+ type: Boolean,
16
+ default: !1
17
+ }
13
18
  },
14
19
  emits: ["update:modelValue"],
15
- setup(t) {
16
- return (c, l) => (r(), e(a(s), {
17
- "model-value": String(t.modelValue),
18
- disabled: t.disabled,
19
- class: n(["k-radio-group", `k-radio-group--${t.direction}`]),
20
- "onUpdate:modelValue": l[0] ||= (e) => c.$emit("update:modelValue", String(e))
20
+ setup(n) {
21
+ return a(e, { button: s(n, "button") }), (e, a) => (i(), t(c(u), {
22
+ "model-value": String(n.modelValue),
23
+ disabled: n.disabled,
24
+ class: r(["k-radio-group", [`k-radio-group--${n.direction}`, { "k-radio-group--button": n.button }]]),
25
+ "onUpdate:modelValue": a[0] ||= (t) => e.$emit("update:modelValue", String(t))
21
26
  }, {
22
- default: o(() => [i(c.$slots, "default", {}, void 0, !0)]),
27
+ default: l(() => [o(e.$slots, "default", {}, void 0, !0)]),
23
28
  _: 3
24
29
  }, 8, [
25
30
  "model-value",
@@ -29,4 +34,4 @@ var c = /* @__PURE__ */ t({
29
34
  }
30
35
  });
31
36
  //#endregion
32
- export { c as default };
37
+ export { d as default };
@@ -0,0 +1,25 @@
1
+ type __VLS_Props = {
2
+ modelValue?: number;
3
+ count?: number;
4
+ allowHalf?: boolean;
5
+ readonly?: boolean;
6
+ size?: number;
7
+ color?: string;
8
+ /** 再次点击同值清零 */
9
+ clearable?: boolean;
10
+ };
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
+ "update:modelValue": (v: number) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ "onUpdate:modelValue"?: ((v: number) => any) | undefined;
15
+ }>, {
16
+ size: number;
17
+ color: string;
18
+ modelValue: number;
19
+ readonly: boolean;
20
+ clearable: boolean;
21
+ count: number;
22
+ allowHalf: boolean;
23
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
24
+ declare const _default: typeof __VLS_export;
25
+ export default _default;
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KRate.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KRate.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-9306d0f6"]]);
6
+ //#endregion
7
+ export { n as default };
@@ -0,0 +1,77 @@
1
+ import { Fragment as e, computed as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, normalizeClass as o, normalizeStyle as s, openBlock as c, ref as l, renderList as u, unref as d } from "vue";
2
+ import { Star as f } from "lucide-vue-next";
3
+ //#region components/KRate.vue?vue&type=script&setup=true&lang.ts
4
+ var p = ["onMousemove", "onClick"], m = /* @__PURE__ */ a({
5
+ __name: "KRate",
6
+ props: {
7
+ modelValue: { default: 0 },
8
+ count: { default: 5 },
9
+ allowHalf: {
10
+ type: Boolean,
11
+ default: !1
12
+ },
13
+ readonly: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ size: { default: 22 },
18
+ color: { default: "#f59e0b" },
19
+ clearable: {
20
+ type: Boolean,
21
+ default: !0
22
+ }
23
+ },
24
+ emits: ["update:modelValue"],
25
+ setup(a, { emit: m }) {
26
+ let h = a, g = m, _ = l(null), v = t(() => _.value ?? h.modelValue);
27
+ function y(e) {
28
+ let t = v.value;
29
+ return t >= e ? "full" : h.allowHalf && t >= e - .5 ? "half" : "empty";
30
+ }
31
+ function b(e, t) {
32
+ if (!h.allowHalf) return e;
33
+ let n = t.currentTarget.getBoundingClientRect();
34
+ return t.clientX - n.left < n.width / 2 ? e - .5 : e;
35
+ }
36
+ function x(e, t) {
37
+ h.readonly || (_.value = b(e, t));
38
+ }
39
+ function S() {
40
+ _.value = null;
41
+ }
42
+ function C(e, t) {
43
+ if (h.readonly) return;
44
+ let n = b(e, t);
45
+ h.clearable && h.modelValue === n && (n = 0), g("update:modelValue", n);
46
+ }
47
+ return (t, l) => (c(), n("div", {
48
+ class: o(["k-rate", { "k-rate--readonly": a.readonly }]),
49
+ onMouseleave: S
50
+ }, [(c(!0), n(e, null, u(a.count, (e) => (c(), n("span", {
51
+ key: e,
52
+ class: "k-rate__star",
53
+ style: s({
54
+ width: `${a.size}px`,
55
+ height: `${a.size}px`
56
+ }),
57
+ onMousemove: (t) => x(e, t),
58
+ onClick: (t) => C(e, t)
59
+ }, [i(d(f), {
60
+ size: a.size,
61
+ class: "k-rate__bg"
62
+ }, null, 8, ["size"]), r("span", {
63
+ class: "k-rate__fill",
64
+ style: s({ width: y(e) === "full" ? "100%" : y(e) === "half" ? "50%" : "0%" })
65
+ }, [i(d(f), {
66
+ size: a.size,
67
+ fill: a.color,
68
+ color: a.color
69
+ }, null, 8, [
70
+ "size",
71
+ "fill",
72
+ "color"
73
+ ])], 4)], 44, p))), 128))], 34));
74
+ }
75
+ });
76
+ //#endregion
77
+ export { m as default };
@@ -0,0 +1,32 @@
1
+ type __VLS_Props = {
2
+ /** 间距:数字(px) / 档位 / [水平, 垂直] */
3
+ size?: number | 'small' | 'medium' | 'large' | [number, number];
4
+ /** 纵向排列 */
5
+ vertical?: boolean;
6
+ /** 交叉轴对齐 */
7
+ align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch';
8
+ /** 主轴对齐 */
9
+ justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between' | 'space-evenly';
10
+ /** 是否换行(纵向时强制不换行) */
11
+ wrap?: boolean;
12
+ /** 行内显示 */
13
+ inline?: boolean;
14
+ };
15
+ declare var __VLS_1: {};
16
+ type __VLS_Slots = {} & {
17
+ default?: (props: typeof __VLS_1) => any;
18
+ };
19
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
20
+ size: number | "small" | "medium" | "large" | [number, number];
21
+ vertical: boolean;
22
+ inline: boolean;
23
+ wrap: boolean;
24
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
28
+ type __VLS_WithSlots<T, S> = T & {
29
+ new (): {
30
+ $slots: S;
31
+ };
32
+ };
@@ -0,0 +1,7 @@
1
+ import e from "../_virtual/_plugin-vue_export-helper.js";
2
+ import t from "./KSpace.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region components/KSpace.vue
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-d97339d4"]]);
6
+ //#endregion
7
+ export { n as default };