@guoyg578/k-ui 0.1.5 → 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 (96) 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 +19 -18
  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/KDataTable.vue.d.ts +48 -1
  19. package/dist/components/KDataTable.vue.js +1 -1
  20. package/dist/components/KDataTable.vue_vue_type_script_setup_true_lang.js +305 -74
  21. package/dist/components/KDatePicker.vue.d.ts +8 -0
  22. package/dist/components/KDatePicker.vue_vue_type_script_setup_true_lang.js +32 -22
  23. package/dist/components/KDialog.vue.d.ts +4 -4
  24. package/dist/components/KDialog.vue.js +1 -1
  25. package/dist/components/KDialog.vue_vue_type_script_setup_true_lang.js +80 -71
  26. package/dist/components/KDropdown.vue.d.ts +4 -3
  27. package/dist/components/KDropdown.vue_vue_type_script_setup_true_lang.js +45 -28
  28. package/dist/components/KDynamicInput.vue.d.ts +2 -0
  29. package/dist/components/KDynamicInput.vue.js +1 -1
  30. package/dist/components/KDynamicInput.vue_vue_type_script_setup_true_lang.js +17 -6
  31. package/dist/components/KDynamicTags.vue.d.ts +2 -0
  32. package/dist/components/KDynamicTags.vue.js +1 -1
  33. package/dist/components/KDynamicTags.vue_vue_type_script_setup_true_lang.js +11 -10
  34. package/dist/components/KForm.vue.d.ts +12 -0
  35. package/dist/components/KForm.vue.js +1 -1
  36. package/dist/components/KForm.vue_vue_type_script_setup_true_lang.js +26 -4
  37. package/dist/components/KFormField.vue.d.ts +3 -1
  38. package/dist/components/KFormField.vue.js +1 -1
  39. package/dist/components/KFormField.vue_vue_type_script_setup_true_lang.js +124 -61
  40. package/dist/components/KInputNumber.vue.js +1 -1
  41. package/dist/components/KInputNumber.vue_vue_type_script_setup_true_lang.js +35 -29
  42. package/dist/components/KMention.vue.d.ts +2 -0
  43. package/dist/components/KMention.vue.js +1 -1
  44. package/dist/components/KMention.vue_vue_type_script_setup_true_lang.js +34 -33
  45. package/dist/components/KMenu.vue.js +1 -1
  46. package/dist/components/KMenu.vue_vue_type_script_setup_true_lang.js +132 -51
  47. package/dist/components/KMenuItem.vue.js +1 -1
  48. package/dist/components/KMenuItem.vue_vue_type_script_setup_true_lang.js +21 -6
  49. package/dist/components/KMessage.d.ts +5 -0
  50. package/dist/components/KMessage.js +36 -23
  51. package/dist/components/KNotification.d.ts +8 -0
  52. package/dist/components/KNotification.js +45 -29
  53. package/dist/components/KNotificationProvider.vue.js +3 -8
  54. package/dist/components/KNotificationProvider.vue_vue_type_script_setup_true_lang.js +11 -0
  55. package/dist/components/KPagination.vue.d.ts +4 -1
  56. package/dist/components/KPagination.vue.js +1 -1
  57. package/dist/components/KPagination.vue_vue_type_script_setup_true_lang.js +36 -33
  58. package/dist/components/KRadio.vue.d.ts +1 -0
  59. package/dist/components/KRadio.vue.js +1 -1
  60. package/dist/components/KRadio.vue_vue_type_script_setup_true_lang.js +22 -14
  61. package/dist/components/KRadioGroup.vue.d.ts +4 -2
  62. package/dist/components/KRadioGroup.vue.js +1 -1
  63. package/dist/components/KRadioGroup.vue_vue_type_script_setup_true_lang.js +16 -4
  64. package/dist/components/KRate.vue.d.ts +5 -0
  65. package/dist/components/KRate.vue.js +1 -1
  66. package/dist/components/KRate.vue_vue_type_script_setup_true_lang.js +72 -24
  67. package/dist/components/KSelect.vue.d.ts +2 -2
  68. package/dist/components/KSelect.vue.js +1 -1
  69. package/dist/components/KSelect.vue_vue_type_script_setup_true_lang.js +1 -1
  70. package/dist/components/KSlider.vue.d.ts +2 -0
  71. package/dist/components/KSlider.vue.js +1 -1
  72. package/dist/components/KSlider.vue_vue_type_script_setup_true_lang.js +17 -16
  73. package/dist/components/KTextarea.vue.d.ts +2 -0
  74. package/dist/components/KTextarea.vue.js +1 -1
  75. package/dist/components/KTextarea.vue_vue_type_script_setup_true_lang.js +10 -9
  76. package/dist/components/KTimePicker.vue.d.ts +2 -0
  77. package/dist/components/KTimePicker.vue.js +1 -1
  78. package/dist/components/KTimePicker.vue_vue_type_script_setup_true_lang.js +61 -48
  79. package/dist/components/KTransfer.vue.d.ts +2 -0
  80. package/dist/components/KTransfer.vue.js +1 -1
  81. package/dist/components/KTransfer.vue_vue_type_script_setup_true_lang.js +35 -34
  82. package/dist/components/KTreeSelect.vue.d.ts +2 -0
  83. package/dist/components/KTreeSelect.vue.js +1 -1
  84. package/dist/components/KTreeSelect.vue_vue_type_script_setup_true_lang.js +15 -14
  85. package/dist/components/KUpload.vue.d.ts +14 -0
  86. package/dist/components/KUpload.vue.js +1 -1
  87. package/dist/components/KUpload.vue_vue_type_script_setup_true_lang.js +159 -117
  88. package/dist/components/checkbox-context.d.ts +10 -0
  89. package/dist/components/checkbox-context.js +4 -0
  90. package/dist/components/form-context.d.ts +19 -2
  91. package/dist/components/form-context.js +31 -1
  92. package/dist/components/menu-context.d.ts +4 -0
  93. package/dist/components/radio-context.d.ts +6 -1
  94. package/dist/k-ui.css +1 -1
  95. package/dist/styles/tokens.css +40 -1
  96. package/package.json +1 -1
@@ -1,19 +1,27 @@
1
1
  import '@vuepic/vue-datepicker/dist/main.css';
2
+ import type { Locale } from 'date-fns';
2
3
  type __VLS_Props = {
3
4
  modelValue: string | string[] | null | undefined;
4
5
  placeholder?: string;
5
6
  range?: boolean;
6
7
  enableTime?: boolean;
7
8
  disabledDates?: (date: Date) => boolean;
9
+ minDate?: Date | string;
10
+ maxDate?: Date | string;
8
11
  clearable?: boolean;
12
+ /** date-fns Locale, 默认 zhCN */
13
+ locale?: Locale;
14
+ size?: 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
9
15
  };
10
16
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
17
  "update:modelValue": (v: string | string[] | null) => any;
12
18
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
13
19
  "onUpdate:modelValue"?: ((v: string | string[] | null) => any) | undefined;
14
20
  }>, {
21
+ size: "small" | "sm" | "medium" | "md" | "large" | "lg";
15
22
  clearable: boolean;
16
23
  enableTime: boolean;
24
+ locale: Locale;
17
25
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
18
26
  declare const _default: typeof __VLS_export;
19
27
  export default _default;
@@ -1,9 +1,9 @@
1
1
  /* empty css */
2
- import { createBlock as e, defineComponent as t, openBlock as n, unref as r } from "vue";
3
- import { VueDatePicker as i } from "@vuepic/vue-datepicker";
4
- import { zhCN as a } from "date-fns/locale";
2
+ import { computed as e, createBlock as t, defineComponent as n, normalizeClass as r, openBlock as i, unref as a } from "vue";
3
+ import { VueDatePicker as o } from "@vuepic/vue-datepicker";
4
+ import { zhCN as s } from "date-fns/locale";
5
5
  //#region components/KDatePicker.vue?vue&type=script&setup=true&lang.ts
6
- var o = /* @__PURE__ */ t({
6
+ var c = /* @__PURE__ */ n({
7
7
  __name: "KDatePicker",
8
8
  props: {
9
9
  modelValue: {},
@@ -14,44 +14,54 @@ var o = /* @__PURE__ */ t({
14
14
  default: !0
15
15
  },
16
16
  disabledDates: {},
17
+ minDate: {},
18
+ maxDate: {},
17
19
  clearable: {
18
20
  type: Boolean,
19
21
  default: !0
20
- }
22
+ },
23
+ locale: { default: () => s },
24
+ size: { default: "md" }
21
25
  },
22
26
  emits: ["update:modelValue"],
23
- setup(t, { emit: o }) {
24
- let s = o;
25
- function c(e) {
26
- s("update:modelValue", e ?? null);
27
+ setup(n, { emit: s }) {
28
+ let c = n, l = e(() => c.size === "small" || c.size === "sm" ? "sm" : c.size === "large" || c.size === "lg" ? "lg" : "md"), u = e(() => c.enableTime ? "yyyy-MM-dd HH:mm" : "yyyy-MM-dd"), d = s;
29
+ function f(e) {
30
+ d("update:modelValue", e ?? null);
27
31
  }
28
- return (o, s) => (n(), e(r(i), {
29
- class: "k-dp",
30
- "model-value": t.modelValue || null,
31
- "onUpdate:modelValue": c,
32
- "model-type": "yyyy-MM-dd HH:mm:ss",
33
- format: t.enableTime ? "yyyy-MM-dd HH:mm" : "yyyy-MM-dd",
34
- placeholder: t.placeholder,
35
- "enable-time-picker": t.enableTime,
36
- range: t.range,
37
- "disabled-dates": t.disabledDates,
38
- clearable: t.clearable,
39
- locale: r(a),
32
+ return (e, s) => (i(), t(a(o), {
33
+ class: r(["k-dp", `k-dp--${l.value}`]),
34
+ "model-value": n.modelValue || null,
35
+ "onUpdate:modelValue": f,
36
+ "model-type": u.value,
37
+ format: u.value,
38
+ placeholder: n.placeholder,
39
+ "enable-time-picker": n.enableTime,
40
+ range: n.range,
41
+ "disabled-dates": n.disabledDates,
42
+ "min-date": n.minDate,
43
+ "max-date": n.maxDate,
44
+ clearable: n.clearable,
45
+ locale: n.locale,
40
46
  "auto-apply": "",
41
47
  teleport: "",
42
48
  "text-input": "",
43
49
  "month-change-on-scroll": !1
44
50
  }, null, 8, [
51
+ "class",
45
52
  "model-value",
53
+ "model-type",
46
54
  "format",
47
55
  "placeholder",
48
56
  "enable-time-picker",
49
57
  "range",
50
58
  "disabled-dates",
59
+ "min-date",
60
+ "max-date",
51
61
  "clearable",
52
62
  "locale"
53
63
  ]));
54
64
  }
55
65
  });
56
66
  //#endregion
57
- export { o as default };
67
+ export { c as default };
@@ -14,13 +14,13 @@ type __VLS_Props = {
14
14
  hideCancel?: boolean;
15
15
  width?: string | number;
16
16
  };
17
- declare var __VLS_13: {}, __VLS_20: {}, __VLS_22: {};
17
+ declare var __VLS_48: {}, __VLS_67: {}, __VLS_69: {};
18
18
  type __VLS_Slots = {} & {
19
- title?: (props: typeof __VLS_13) => any;
19
+ title?: (props: typeof __VLS_48) => any;
20
20
  } & {
21
- default?: (props: typeof __VLS_20) => any;
21
+ default?: (props: typeof __VLS_67) => any;
22
22
  } & {
23
- footer?: (props: typeof __VLS_22) => any;
23
+ footer?: (props: typeof __VLS_69) => any;
24
24
  };
25
25
  declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
26
26
  close: () => any;
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KDialog.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region components/KDialog.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-9539265d"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-1151febd"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -1,23 +1,15 @@
1
1
  import e from "./KButton.vue.js";
2
- import { Teleport as t, Transition as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, createVNode as c, defineComponent as l, mergeProps as u, onMounted as d, onUnmounted as f, openBlock as p, renderSlot as m, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
3
- import { X as y } from "lucide-vue-next";
2
+ import { createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, mergeProps as c, openBlock as l, renderSlot as u, toDisplayString as d, unref as f, withCtx as p } from "vue";
3
+ import { X as m } from "lucide-vue-next";
4
+ import { DialogClose as h, DialogContent as g, DialogDescription as _, DialogOverlay as v, DialogPortal as y, DialogRoot as b, DialogTitle as x, VisuallyHidden as S } from "reka-ui";
4
5
  //#region components/KDialog.vue?vue&type=script&setup=true&lang.ts
5
- var b = {
6
- key: 0,
7
- class: "k-dialog-stack"
8
- }, x = { class: "k-dialog__center" }, S = {
9
- key: 0,
10
- class: "k-dialog__header"
11
- }, C = { class: "k-dialog__title-wrap" }, w = {
12
- key: 0,
13
- class: "k-dialog__title"
14
- }, T = {
15
- key: 1,
16
- class: "k-dialog__subtitle"
17
- }, E = { class: "k-dialog__body" }, D = {
6
+ var C = { class: "k-dialog__center" }, w = {
18
7
  key: 1,
8
+ class: "k-dialog__header"
9
+ }, T = { class: "k-dialog__title-wrap" }, E = { class: "k-dialog__body" }, D = {
10
+ key: 2,
19
11
  class: "k-dialog__footer"
20
- }, O = /* @__PURE__ */ l({
12
+ }, O = /* @__PURE__ */ s({
21
13
  inheritAttrs: !1,
22
14
  __name: "KDialog",
23
15
  props: {
@@ -56,69 +48,86 @@ var b = {
56
48
  "confirm",
57
49
  "cancel"
58
50
  ],
59
- setup(l, { emit: O }) {
60
- let k = l, A = O;
51
+ setup(s, { emit: O }) {
52
+ let k = O;
53
+ function A(e) {
54
+ k("update:open", e), e || k("close");
55
+ }
61
56
  function j() {
62
- A("update:open", !1), A("close");
57
+ k("confirm");
63
58
  }
64
59
  function M() {
65
- k.maskClosable && j();
66
- }
67
- function N() {
68
- A("confirm");
69
- }
70
- function P() {
71
- A("cancel"), j();
72
- }
73
- function F(e) {
74
- e.key === "Escape" && k.open && k.closable && j();
60
+ k("cancel"), A(!1);
75
61
  }
76
- function I(e) {
62
+ function N(e) {
77
63
  if (!(e == null || e === "")) return typeof e == "number" ? `${e}px` : e;
78
64
  }
79
- return d(() => window.addEventListener("keydown", F)), f(() => {
80
- window.removeEventListener("keydown", F), k.open && (document.body.style.overflow = "");
81
- }), _(() => k.open, (e) => {
82
- document.body.style.overflow = e ? "hidden" : "";
83
- }), (d, f) => (p(), r(t, { to: "body" }, [c(n, {
84
- name: "k-dialog",
85
- duration: {
86
- enter: 280,
87
- leave: 200
88
- }
65
+ return (O, k) => (l(), t(f(b), {
66
+ open: s.open,
67
+ "onUpdate:open": A
89
68
  }, {
90
- default: v(() => [l.open ? (p(), a("div", b, [o("div", {
91
- class: "k-dialog__overlay",
92
- onClick: M
93
- }), o("div", x, [o("div", u(d.$attrs, {
94
- class: ["k-dialog", `k-dialog--${l.size}`],
95
- style: { maxWidth: I(l.width) }
96
- }), [
97
- l.title || d.$slots.title || l.closable ? (p(), a("header", S, [o("div", C, [l.title || d.$slots.title ? (p(), a("h2", w, [m(d.$slots, "title", {}, () => [s(h(l.title), 1)], !0)])) : i("", !0), l.subtitle ? (p(), a("p", T, h(l.subtitle), 1)) : i("", !0)]), l.closable ? (p(), a("button", {
98
- key: 0,
99
- type: "button",
100
- class: "k-dialog__close",
101
- onClick: j
102
- }, [c(g(y), { size: 18 })])) : i("", !0)])) : i("", !0),
103
- o("div", E, [m(d.$slots, "default", {}, void 0, !0)]),
104
- d.$slots.footer || l.footer ? (p(), a("footer", D, [m(d.$slots, "footer", {}, () => [l.hideCancel ? i("", !0) : (p(), r(e, {
105
- key: 0,
106
- type: "secondary",
107
- onClick: P
108
- }, {
109
- default: v(() => [s(h(l.cancelText), 1)]),
110
- _: 1
111
- })), c(e, {
112
- type: l.confirmType,
113
- loading: l.confirmLoading,
114
- onClick: N
115
- }, {
116
- default: v(() => [s(h(l.confirmText), 1)]),
117
- _: 1
118
- }, 8, ["type", "loading"])], !0)])) : i("", !0)
119
- ], 16)])])) : i("", !0)]),
69
+ default: p(() => [o(f(y), null, {
70
+ default: p(() => [o(f(v), { class: "k-dialog__overlay" }), i("div", C, [o(f(g), c(O.$attrs, {
71
+ class: ["k-dialog", `k-dialog--${s.size}`],
72
+ style: { maxWidth: N(s.width) },
73
+ onPointerDownOutside: k[0] ||= (e) => {
74
+ s.maskClosable || e.preventDefault();
75
+ },
76
+ onEscapeKeyDown: k[1] ||= (e) => {
77
+ s.closable || e.preventDefault();
78
+ }
79
+ }), {
80
+ default: p(() => [
81
+ s.title || O.$slots.title ? n("", !0) : (l(), t(f(S), { key: 0 }, {
82
+ default: p(() => [o(f(x), null, {
83
+ default: p(() => [...k[2] ||= [a("对话框", -1)]]),
84
+ _: 1
85
+ })]),
86
+ _: 1
87
+ })),
88
+ s.title || O.$slots.title || s.closable ? (l(), r("header", w, [i("div", T, [s.title || O.$slots.title ? (l(), t(f(x), {
89
+ key: 0,
90
+ class: "k-dialog__title"
91
+ }, {
92
+ default: p(() => [u(O.$slots, "title", {}, () => [a(d(s.title), 1)], !0)]),
93
+ _: 3
94
+ })) : n("", !0), s.subtitle ? (l(), t(f(_), {
95
+ key: 1,
96
+ class: "k-dialog__subtitle"
97
+ }, {
98
+ default: p(() => [a(d(s.subtitle), 1)]),
99
+ _: 1
100
+ })) : n("", !0)]), s.closable ? (l(), t(f(h), {
101
+ key: 0,
102
+ class: "k-dialog__close",
103
+ "aria-label": "关闭"
104
+ }, {
105
+ default: p(() => [o(f(m), { size: 18 })]),
106
+ _: 1
107
+ })) : n("", !0)])) : n("", !0),
108
+ i("div", E, [u(O.$slots, "default", {}, void 0, !0)]),
109
+ O.$slots.footer || s.footer ? (l(), r("footer", D, [u(O.$slots, "footer", {}, () => [s.hideCancel ? n("", !0) : (l(), t(e, {
110
+ key: 0,
111
+ type: "secondary",
112
+ onClick: M
113
+ }, {
114
+ default: p(() => [a(d(s.cancelText), 1)]),
115
+ _: 1
116
+ })), o(e, {
117
+ type: s.confirmType,
118
+ loading: s.confirmLoading,
119
+ onClick: j
120
+ }, {
121
+ default: p(() => [a(d(s.confirmText), 1)]),
122
+ _: 1
123
+ }, 8, ["type", "loading"])], !0)])) : n("", !0)
124
+ ]),
125
+ _: 3
126
+ }, 16, ["class", "style"])])]),
127
+ _: 3
128
+ })]),
120
129
  _: 3
121
- })]));
130
+ }, 8, ["open"]));
122
131
  }
123
132
  });
124
133
  //#endregion
@@ -19,7 +19,7 @@ type __VLS_Props = {
19
19
  items?: DropdownItem[];
20
20
  /** naive-ui alias */
21
21
  options?: DropdownItem[];
22
- trigger?: 'click' | 'hover' | 'focus' | 'manual';
22
+ trigger?: 'click' | 'hover';
23
23
  side?: 'top' | 'right' | 'bottom' | 'left';
24
24
  align?: 'start' | 'center' | 'end';
25
25
  sideOffset?: number;
@@ -30,11 +30,11 @@ type __VLS_ModelProps = {
30
30
  'open'?: boolean;
31
31
  };
32
32
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
33
- declare var __VLS_14: {}, __VLS_52: {};
33
+ declare var __VLS_14: {}, __VLS_55: {};
34
34
  type __VLS_Slots = {} & {
35
35
  default?: (props: typeof __VLS_14) => any;
36
36
  } & {
37
- extra?: (props: typeof __VLS_52) => any;
37
+ extra?: (props: typeof __VLS_55) => any;
38
38
  };
39
39
  declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
40
40
  "update:open": (value: boolean | undefined) => any;
@@ -48,6 +48,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
48
48
  align: "start" | "center" | "end";
49
49
  side: "top" | "right" | "bottom" | "left";
50
50
  sideOffset: number;
51
+ trigger: "click" | "hover";
51
52
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
52
53
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
53
54
  declare const _default: typeof __VLS_export;
@@ -1,16 +1,16 @@
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";
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, onScopeDispose as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useModel as y, withCtx as b } from "vue";
2
+ import { DropdownMenuContent as x, DropdownMenuItem as S, DropdownMenuLabel as C, DropdownMenuPortal as w, DropdownMenuRoot as T, DropdownMenuSeparator as E, DropdownMenuTrigger as D } from "reka-ui";
3
3
  //#region components/KDropdown.vue?vue&type=script&setup=true&lang.ts
4
- var D = { class: "k-dropdown-item__label" }, O = {
4
+ var O = { class: "k-dropdown-item__label" }, k = {
5
5
  key: 1,
6
6
  class: "k-dropdown-item__shortcut"
7
- }, k = /* @__PURE__ */ c({
7
+ }, A = /* @__PURE__ */ c({
8
8
  inheritAttrs: !1,
9
9
  __name: "KDropdown",
10
10
  props: /* @__PURE__ */ l({
11
11
  items: {},
12
12
  options: {},
13
- trigger: {},
13
+ trigger: { default: "click" },
14
14
  side: { default: "bottom" },
15
15
  align: { default: "end" },
16
16
  sideOffset: { default: 6 },
@@ -25,60 +25,77 @@ var D = { class: "k-dropdown-item__label" }, O = {
25
25
  }),
26
26
  emits: /* @__PURE__ */ l(["select"], ["update:open"]),
27
27
  setup(c, { emit: l }) {
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);
28
+ let A = c, j = y(c, "open"), M = l, N = t(() => A.items ?? A.options ?? []);
29
+ function P(e) {
30
+ e.disabled || M("select", e.key, e);
31
31
  }
32
- return (t, l) => (f(), n(_(w), {
33
- open: A.value,
34
- "onUpdate:open": l[0] ||= (e) => A.value = e
32
+ let F = t(() => A.trigger === "hover"), I;
33
+ function L() {
34
+ I &&= (clearTimeout(I), void 0);
35
+ }
36
+ function R() {
37
+ !F.value || A.disabled || (L(), j.value = !0);
38
+ }
39
+ function z() {
40
+ F.value && (L(), I = setTimeout(() => j.value = !1, 120));
41
+ }
42
+ return f(L), (t, l) => (p(), n(v(T), {
43
+ open: j.value,
44
+ "onUpdate:open": l[0] ||= (e) => j.value = e,
45
+ modal: !F.value
35
46
  }, {
36
- default: y(() => [s(_(E), {
47
+ default: b(() => [s(v(D), {
37
48
  "as-child": "",
38
49
  disabled: c.disabled
39
50
  }, {
40
- default: y(() => [a("span", u(t.$attrs, { class: ["k-dropdown-trigger", { "k-dropdown-trigger--disabled": c.disabled }] }), [m(t.$slots, "default")], 16)]),
51
+ default: b(() => [a("span", u(t.$attrs, {
52
+ class: ["k-dropdown-trigger", { "k-dropdown-trigger--disabled": c.disabled }],
53
+ onMouseenter: R,
54
+ onMouseleave: z
55
+ }), [h(t.$slots, "default")], 16)]),
41
56
  _: 3
42
- }, 8, ["disabled"]), s(_(C), null, {
43
- default: y(() => [s(_(b), {
57
+ }, 8, ["disabled"]), s(v(w), null, {
58
+ default: b(() => [s(v(x), {
44
59
  class: d(["k-dropdown-content k-menu-surface", c.contentClass]),
45
60
  side: c.side,
46
61
  align: c.align,
47
- "side-offset": c.sideOffset
62
+ "side-offset": c.sideOffset,
63
+ onMouseenter: L,
64
+ onMouseleave: z
48
65
  }, {
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), {
66
+ default: b(() => [(p(!0), i(e, null, m(N.value, (t, s) => (p(), i(e, { key: t.key ?? `_${s}` }, [t.type === "separator" ? (p(), n(v(E), {
50
67
  key: 0,
51
68
  class: "k-dropdown-sep"
52
- })) : t.type === "label" ? (f(), n(_(S), {
69
+ })) : t.type === "label" ? (p(), n(v(C), {
53
70
  key: 1,
54
71
  class: "k-dropdown-label"
55
72
  }, {
56
- default: y(() => [o(g(t.label), 1)]),
73
+ default: b(() => [o(_(t.label), 1)]),
57
74
  _: 2
58
- }, 1024)) : (f(), n(_(x), {
75
+ }, 1024)) : (p(), n(v(S), {
59
76
  key: 2,
60
77
  class: d(["k-dropdown-item k-menu-item", {
61
78
  "k-dropdown-item--danger": t.danger,
62
79
  "k-dropdown-item--active": t.active
63
80
  }]),
64
81
  disabled: t.disabled,
65
- onSelect: (e) => N(t)
82
+ onSelect: (e) => P(t)
66
83
  }, {
67
- default: y(() => [
68
- t.icon ? (f(), n(h(t.icon), {
84
+ default: b(() => [
85
+ t.icon ? (p(), n(g(t.icon), {
69
86
  key: 0,
70
87
  size: 15,
71
88
  class: "k-dropdown-item__icon"
72
89
  })) : r("", !0),
73
- a("span", D, g(t.label), 1),
74
- t.shortcut ? (f(), i("span", O, g(t.shortcut), 1)) : r("", !0)
90
+ a("span", O, _(t.label), 1),
91
+ t.shortcut ? (p(), i("span", k, _(t.shortcut), 1)) : r("", !0)
75
92
  ]),
76
93
  _: 2
77
94
  }, 1032, [
78
95
  "class",
79
96
  "disabled",
80
97
  "onSelect"
81
- ]))], 64))), 128)), m(t.$slots, "extra")]),
98
+ ]))], 64))), 128)), h(t.$slots, "extra")]),
82
99
  _: 3
83
100
  }, 8, [
84
101
  "class",
@@ -89,8 +106,8 @@ var D = { class: "k-dropdown-item__label" }, O = {
89
106
  _: 3
90
107
  })]),
91
108
  _: 3
92
- }, 8, ["open"]));
109
+ }, 8, ["open", "modal"]));
93
110
  }
94
111
  });
95
112
  //#endregion
96
- export { k as default };
113
+ export { A as default };
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  min?: number;
4
4
  max?: number;
5
5
  placeholder?: string;
6
+ size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
6
7
  /** 新增行的默认值工厂 */
7
8
  onCreate?: () => any;
8
9
  };
@@ -19,6 +20,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
19
20
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
20
21
  "onUpdate:modelValue"?: ((v: any[]) => any) | undefined;
21
22
  }>, {
23
+ size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
22
24
  min: number;
23
25
  modelValue: any[];
24
26
  placeholder: string;
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KDynamicInput.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region components/KDynamicInput.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-455e370f"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-df0a67d3"]]);
6
6
  //#endregion
7
7
  export { n as default };
@@ -10,6 +10,7 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
10
10
  min: { default: 0 },
11
11
  max: {},
12
12
  placeholder: { default: "请输入" },
13
+ size: { default: "md" },
13
14
  onCreate: {}
14
15
  },
15
16
  emits: ["update:modelValue"],
@@ -42,13 +43,15 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
42
43
  }, () => [c(t, {
43
44
  "model-value": n,
44
45
  placeholder: l.placeholder,
46
+ size: l.size,
45
47
  "onUpdate:modelValue": (e) => E(r, e)
46
48
  }, null, 8, [
47
49
  "model-value",
48
50
  "placeholder",
51
+ "size",
49
52
  "onUpdate:modelValue"
50
53
  ])], !0)]), o("div", y, [c(e, {
51
- size: "sm",
54
+ size: l.size,
52
55
  quaternary: "",
53
56
  circle: "",
54
57
  disabled: l.modelValue.length <= l.min,
@@ -56,8 +59,12 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
56
59
  }, {
57
60
  icon: m(() => [c(p(g), { size: 15 })]),
58
61
  _: 1
59
- }, 8, ["disabled", "onClick"]), c(e, {
60
- size: "sm",
62
+ }, 8, [
63
+ "size",
64
+ "disabled",
65
+ "onClick"
66
+ ]), c(e, {
67
+ size: l.size,
61
68
  quaternary: "",
62
69
  circle: "",
63
70
  disabled: l.max != null && l.modelValue.length >= l.max,
@@ -65,16 +72,20 @@ var _ = { class: "k-dinput" }, v = { class: "k-dinput__field" }, y = { class: "k
65
72
  }, {
66
73
  icon: m(() => [c(p(h), { size: 15 })]),
67
74
  _: 1
68
- }, 8, ["disabled", "onClick"])])]))), 128)), l.modelValue.length === 0 ? (u(), r(e, {
75
+ }, 8, [
76
+ "size",
77
+ "disabled",
78
+ "onClick"
79
+ ])])]))), 128)), l.modelValue.length === 0 ? (u(), r(e, {
69
80
  key: 0,
70
- size: "sm",
81
+ size: l.size,
71
82
  disabled: l.max != null && l.modelValue.length >= l.max,
72
83
  onClick: x[0] ||= (e) => w()
73
84
  }, {
74
85
  icon: m(() => [c(p(h), { size: 15 })]),
75
86
  default: m(() => [x[1] ||= s(" 添加一行 ", -1)]),
76
87
  _: 1
77
- }, 8, ["disabled"])) : i("", !0)]));
88
+ }, 8, ["size", "disabled"])) : i("", !0)]));
78
89
  }
79
90
  });
80
91
  //#endregion
@@ -5,12 +5,14 @@ type __VLS_Props = {
5
5
  /** 是否允许重复值 */
6
6
  allowDuplicate?: boolean;
7
7
  placeholder?: string;
8
+ size?: 'tiny' | 'xs' | 'small' | 'sm' | 'medium' | 'md' | 'large' | 'lg';
8
9
  };
9
10
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
10
11
  "update:modelValue": (v: string[]) => any;
11
12
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
13
  "onUpdate:modelValue"?: ((v: string[]) => any) | undefined;
13
14
  }>, {
15
+ size: "tiny" | "xs" | "small" | "sm" | "medium" | "md" | "large" | "lg";
14
16
  disabled: boolean;
15
17
  modelValue: string[];
16
18
  placeholder: string;
@@ -2,6 +2,6 @@ import e from "../_virtual/_plugin-vue_export-helper.js";
2
2
  import t from "./KDynamicTags.vue_vue_type_script_setup_true_lang.js";
3
3
  /* empty css */
4
4
  //#region components/KDynamicTags.vue
5
- var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-084ffc13"]]);
5
+ var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-2cee2891"]]);
6
6
  //#endregion
7
7
  export { n as default };