@keyblade/pro-components 1.13.8-alpha.8 → 1.14.0

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 (156) hide show
  1. package/es/components.d.ts +7 -0
  2. package/es/global-props.d.ts +21 -2
  3. package/es/global-props.js +6 -2
  4. package/es/index.d.ts +7 -0
  5. package/es/index.js +47 -28
  6. package/es/inerface.d.ts +5 -1
  7. package/es/pro-calendar/calendar.vue.d.ts +75 -0
  8. package/es/pro-calendar/calendar.vue.js +159 -0
  9. package/es/pro-calendar/calendar.vue3.js +5 -0
  10. package/es/pro-calendar/enum.d.ts +6 -0
  11. package/es/pro-calendar/enum.js +4 -0
  12. package/es/pro-calendar/header.vue.d.ts +35 -0
  13. package/es/pro-calendar/header.vue.js +146 -0
  14. package/es/pro-calendar/header.vue2.js +4 -0
  15. package/es/pro-calendar/hooks/useCellClassName.d.ts +12 -0
  16. package/es/pro-calendar/hooks/useCellClassName.js +40 -0
  17. package/es/pro-calendar/index.d.ts +117 -0
  18. package/es/pro-calendar/index.js +12 -0
  19. package/es/pro-calendar/interface.d.ts +89 -0
  20. package/es/pro-calendar/month.d.ts +5 -0
  21. package/es/pro-calendar/month.js +53 -0
  22. package/es/pro-calendar/month.vue.d.ts +22 -0
  23. package/es/pro-calendar/month.vue.js +126 -0
  24. package/es/pro-calendar/month.vue2.js +4 -0
  25. package/es/pro-calendar/week.vue.d.ts +3 -0
  26. package/es/pro-calendar/week.vue.js +34 -0
  27. package/es/pro-calendar/week.vue2.js +4 -0
  28. package/es/pro-calendar/year.vue.d.ts +3 -0
  29. package/es/pro-calendar/year.vue.js +123 -0
  30. package/es/pro-calendar/year.vue2.js +4 -0
  31. package/es/pro-date-range-picker/index.d.ts +183 -13
  32. package/es/pro-date-range-picker/index.js +6 -7
  33. package/es/pro-date-range-picker/interface.d.ts +38 -0
  34. package/es/pro-date-range-picker/pro-date-range-picker.vue.d.ts +173 -6
  35. package/es/pro-date-range-picker/pro-date-range-picker.vue.js +1 -1
  36. package/es/pro-date-range-picker/pro-date-range-picker.vue2.js +127 -97
  37. package/es/pro-dates-picker/index.d.ts +49 -0
  38. package/es/pro-dates-picker/index.js +11 -0
  39. package/es/pro-dates-picker/index.vue.d.ts +29 -0
  40. package/es/pro-dates-picker/index.vue.js +135 -0
  41. package/es/pro-dates-picker/index.vue3.js +5 -0
  42. package/es/pro-dates-picker/interface.d.ts +38 -0
  43. package/es/pro-dates-picker/util.d.ts +12 -0
  44. package/es/pro-dates-picker/util.js +9 -0
  45. package/es/pro-find-password/enum.d.ts +8 -0
  46. package/es/pro-find-password/enum.js +4 -0
  47. package/es/pro-find-password/index.d.ts +11 -0
  48. package/es/pro-find-password/index.js +11 -0
  49. package/es/pro-find-password/index.vue.d.ts +4459 -0
  50. package/es/pro-find-password/index.vue.js +176 -0
  51. package/es/pro-find-password/index.vue3.js +5 -0
  52. package/es/pro-find-password/interface.d.ts +45 -0
  53. package/es/pro-find-password/reset-password.vue.d.ts +591 -0
  54. package/es/pro-find-password/reset-password.vue.js +179 -0
  55. package/es/pro-find-password/reset-password.vue2.js +4 -0
  56. package/es/pro-find-password/verify-user-name.vue.d.ts +795 -0
  57. package/es/pro-find-password/verify-user-name.vue.js +112 -0
  58. package/es/pro-find-password/verify-user-name.vue3.js +5 -0
  59. package/es/pro-footer-bar/index.d.ts +6 -3
  60. package/es/pro-footer-bar/index.js +6 -7
  61. package/es/pro-footer-bar/index.vue.d.ts +1 -1
  62. package/es/pro-footer-bar/index.vue.js +2 -2
  63. package/es/pro-footer-bar/index.vue2.js +24 -26
  64. package/es/pro-footer-bar/{inerface.d.ts → interface.d.ts} +1 -0
  65. package/es/pro-form-group/index.d.ts +7 -6
  66. package/es/pro-form-group/index.js +6 -8
  67. package/es/pro-form-group/index.vue.d.ts +2 -2
  68. package/es/pro-form-group/index.vue.js +1 -1
  69. package/es/pro-form-group/index.vue2.js +31 -32
  70. package/es/pro-image-upload/cropper.vue.js +2 -2
  71. package/es/pro-image-upload/cropper.vue2.js +200 -190
  72. package/es/pro-image-upload/image-upload.vue.d.ts +1124 -371
  73. package/es/pro-image-upload/image-upload.vue.js +178 -144
  74. package/es/pro-image-upload/index.d.ts +1727 -1001
  75. package/es/pro-image-upload/index.js +6 -8
  76. package/es/pro-keep-alive-router-view/index.d.ts +1 -0
  77. package/es/pro-keep-alive-router-view/pro-keep-alive-router-view.vue.js +17 -18
  78. package/es/pro-layout/hooks.d.ts +80 -1
  79. package/es/pro-layout/hooks.js +133 -84
  80. package/es/pro-layout/index.d.ts +9 -6
  81. package/es/pro-layout/index.js +6 -11
  82. package/es/pro-layout/pro-layout.vue.d.ts +4 -2
  83. package/es/pro-layout/pro-layout.vue.js +220 -208
  84. package/es/pro-loader/index.d.ts +43 -0
  85. package/es/pro-loader/index.js +11 -0
  86. package/es/pro-loader/index.vue.d.ts +28 -0
  87. package/es/pro-loader/index.vue.js +112 -0
  88. package/es/pro-loader/index.vue3.js +5 -0
  89. package/es/pro-loader/interface.d.ts +16 -0
  90. package/es/pro-login/enum.d.ts +6 -0
  91. package/es/pro-login/enum.js +4 -0
  92. package/es/pro-login/form-mobile.vue.d.ts +797 -0
  93. package/es/pro-login/form-mobile.vue.js +146 -0
  94. package/es/pro-login/form-mobile.vue2.js +4 -0
  95. package/es/pro-login/form-password.vue.d.ts +584 -0
  96. package/es/pro-login/form-password.vue.js +99 -0
  97. package/es/pro-login/form-password.vue2.js +4 -0
  98. package/es/pro-login/index.d.ts +11 -0
  99. package/es/pro-login/index.js +11 -0
  100. package/es/pro-login/index.vue.d.ts +4429 -0
  101. package/es/pro-login/index.vue.js +105 -0
  102. package/es/pro-login/index.vue3.js +5 -0
  103. package/es/pro-login/interface.d.ts +72 -0
  104. package/es/pro-login/regexp.d.ts +17 -0
  105. package/es/pro-login/regexp.js +28 -0
  106. package/es/pro-menu/index.d.ts +18 -80
  107. package/es/pro-menu/index.js +6 -7
  108. package/es/pro-menu/interface.d.ts +31 -0
  109. package/es/pro-menu/menu-item.vue.d.ts +27 -0
  110. package/es/pro-menu/menu-item.vue.js +35 -0
  111. package/es/pro-menu/menu-item.vue2.js +4 -0
  112. package/es/pro-menu/pro-menu-item.vue.d.ts +9 -0
  113. package/es/pro-menu/pro-menu-item.vue.js +63 -0
  114. package/es/pro-menu/pro-menu-item.vue2.js +4 -0
  115. package/es/pro-menu/pro-menu.vue.d.ts +9 -55
  116. package/es/pro-menu/pro-menu.vue.js +36 -119
  117. package/es/pro-menu/sub-menu.vue.d.ts +22 -0
  118. package/es/pro-menu/sub-menu.vue.js +55 -0
  119. package/es/pro-menu/sub-menu.vue2.js +4 -0
  120. package/es/pro-menu/util.d.ts +9 -0
  121. package/es/pro-menu/util.js +7 -0
  122. package/es/pro-page-container/constant.d.ts +2 -0
  123. package/es/pro-page-container/constant.js +9 -0
  124. package/es/pro-page-container/index.d.ts +7 -21
  125. package/es/pro-page-container/index.js +6 -8
  126. package/es/pro-page-container/interface.d.ts +12 -0
  127. package/es/pro-page-container/pro-page-container.vue.d.ts +4 -15
  128. package/es/pro-page-container/pro-page-container.vue.js +58 -38
  129. package/es/pro-page-header/constant.d.ts +2 -0
  130. package/es/pro-page-header/constant.js +13 -0
  131. package/es/pro-page-header/index.d.ts +12 -146
  132. package/es/pro-page-header/index.js +6 -8
  133. package/es/pro-page-header/interface.d.ts +21 -0
  134. package/es/pro-page-header/pro-page-header.vue.d.ts +18 -103
  135. package/es/pro-page-header/pro-page-header.vue.js +141 -124
  136. package/es/pro-reuse-tabs/index.d.ts +8 -6
  137. package/es/pro-reuse-tabs/index.js +6 -7
  138. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.d.ts +2 -2
  139. package/es/pro-reuse-tabs/pro-reuse-tabs.vue.js +33 -35
  140. package/es/pro-table/index.d.ts +18 -18
  141. package/es/pro-table/index.js +6 -7
  142. package/es/pro-table/index.vue.d.ts +6 -6
  143. package/es/pro-table/index.vue.js +94 -39
  144. package/es/pro-table/interface.d.ts +73 -65
  145. package/es/pro-textarea/index.d.ts +7 -5
  146. package/es/pro-textarea/index.js +5 -6
  147. package/es/pro-textarea/index.vue.d.ts +1 -1
  148. package/es/pro-textarea/index.vue.js +1 -1
  149. package/es/pro-textarea/index.vue2.js +14 -16
  150. package/es/pro-textarea/{inerface.d.ts → interface.d.ts} +19 -18
  151. package/es/style.css +1 -1
  152. package/es/utils.d.ts +6 -0
  153. package/es/utils.js +7 -0
  154. package/package.json +5 -4
  155. package/es/pro-date-range-picker/type.d.ts +0 -22
  156. package/es/pro-page-container/inerface.d.ts +0 -12
@@ -0,0 +1,105 @@
1
+ import { defineComponent as C, useSlots as T, ref as y, computed as b, createBlock as m, openBlock as u, unref as t, mergeProps as p, withCtx as r, createVNode as f, renderSlot as P, createSlots as _ } from "vue";
2
+ import { Card as $, Tabs as I, TabPane as w } from "@arco-design/web-vue";
3
+ import { EProLoginType as a } from "./enum.js";
4
+ import x from "./form-mobile.vue.js";
5
+ import B from "./form-password.vue.js";
6
+ const S = "keyblade-pro-login", V = /* @__PURE__ */ C({
7
+ __name: "index",
8
+ props: {
9
+ activeKey: { default: a.password },
10
+ cardProps: { default: () => ({
11
+ bordered: !1
12
+ }) },
13
+ inputProps: { default: () => ({
14
+ size: "large"
15
+ }) },
16
+ formItemProps: { default: () => ({
17
+ hideLabel: !0,
18
+ validateTrigger: []
19
+ }) },
20
+ countdown: {},
21
+ onSendSmsCode: {},
22
+ onSubmitSuccess: {},
23
+ "update:activeKey": {}
24
+ },
25
+ emits: ["update:activeKey", "submit-success", "send-sms-code"],
26
+ setup(g, { expose: K, emit: k }) {
27
+ const n = k, R = T(), i = y(), l = y(), d = g, c = b(() => ({
28
+ inputProps: d.inputProps,
29
+ formItemProps: d.formItemProps,
30
+ prefixClsName: S
31
+ })), v = b({
32
+ get: () => d.activeKey,
33
+ set: (e) => n("update:activeKey", e)
34
+ });
35
+ return K({
36
+ get resetTime() {
37
+ var e, o;
38
+ return (o = (e = i.value) == null ? void 0 : e.resetTime) != null ? o : (() => {
39
+ });
40
+ },
41
+ get mobileRef() {
42
+ var e;
43
+ return (e = i.value) == null ? void 0 : e.formRef;
44
+ },
45
+ get passwordRef() {
46
+ var e;
47
+ return (e = l.value) == null ? void 0 : e.formRef;
48
+ }
49
+ }), (e, o) => (u(), m(t($), p({ class: S }, e.cardProps), {
50
+ default: r(() => [
51
+ f(t(I), {
52
+ activeKey: v.value,
53
+ "onUpdate:activeKey": o[3] || (o[3] = (s) => v.value = s)
54
+ }, {
55
+ default: r(() => [
56
+ (u(), m(t(w), {
57
+ key: t(a).mobile,
58
+ title: "短信登录"
59
+ }, {
60
+ default: r(() => [
61
+ f(x, p({
62
+ ref_key: "mobileRef",
63
+ ref: i,
64
+ countdown: e.countdown
65
+ }, c.value, {
66
+ onSendSmsCode: o[0] || (o[0] = (s) => n("send-sms-code", s)),
67
+ onSubmit: o[1] || (o[1] = (s) => n("submit-success", { value: s, type: t(a).mobile }))
68
+ }), _({ _: 2 }, [
69
+ t(R)["area-code"] ? {
70
+ name: "area-code",
71
+ fn: r(() => [
72
+ P(e.$slots, "area-code")
73
+ ]),
74
+ key: "0"
75
+ } : void 0
76
+ ]), 1040, ["countdown"])
77
+ ]),
78
+ _: 3
79
+ })),
80
+ (u(), m(t(w), {
81
+ key: t(a).password,
82
+ title: "密码登录"
83
+ }, {
84
+ default: r(() => [
85
+ f(B, p({
86
+ ref_key: "passwordRef",
87
+ ref: l
88
+ }, c.value, {
89
+ onSubmit: o[2] || (o[2] = (s) => n("submit-success", { value: s, type: t(a).password }))
90
+ }), null, 16)
91
+ ]),
92
+ _: 1
93
+ }))
94
+ ]),
95
+ _: 3
96
+ }, 8, ["activeKey"]),
97
+ P(e.$slots, "footer")
98
+ ]),
99
+ _: 3
100
+ }, 16));
101
+ }
102
+ });
103
+ export {
104
+ V as default
105
+ };
@@ -0,0 +1,5 @@
1
+ import o from "./index.vue.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
@@ -0,0 +1,72 @@
1
+ import { CSSProperties } from 'vue';
2
+ import { FormInstance, FormItemInstance } from '@arco-design/web-vue';
3
+ import { EProLoginType } from './enum';
4
+ export * from './enum';
5
+ export interface ICardProps {
6
+ /** 是否显示边框 */
7
+ bordered?: boolean;
8
+ /** 是否为加载中 */
9
+ loading?: boolean;
10
+ /** 是否可悬浮 */
11
+ hoverable?: boolean;
12
+ /** 卡片尺寸 */
13
+ size?: 'small' | 'medium';
14
+ /** 头部样式 */
15
+ headerStyle?: CSSProperties;
16
+ /** 内容区域样式 */
17
+ bodyStyle?: CSSProperties;
18
+ /** 卡片标题 */
19
+ title?: string;
20
+ /** 卡片右上角的操作区域 */
21
+ extra?: string;
22
+ }
23
+ export interface IInputProps {
24
+ /** 输入框大小 */
25
+ size?: 'mini' | 'small' | 'medium' | 'large';
26
+ /** 是否允许清空输入框 */
27
+ allowClear?: boolean;
28
+ }
29
+ export type IProLogin = {
30
+ activeKey?: EProLoginType;
31
+ /** 卡片属性 */
32
+ cardProps?: ICardProps;
33
+ /** 输入框属性 */
34
+ inputProps?: IInputProps;
35
+ /** 表单项属性 */
36
+ formItemProps?: Partial<FormItemInstance>;
37
+ /** 倒计时(秒) */
38
+ countdown?: number;
39
+ /** 获取短信验证码 */
40
+ onSendSmsCode?: (value: string) => void;
41
+ /** 提交 */
42
+ onSubmitSuccess?: (value: IProLoginFormData) => void;
43
+ } & {
44
+ 'update:activeKey'?: (value: EProLoginType) => void;
45
+ };
46
+ export type IProLoginByMobile = Omit<IProLogin, 'activeKey' | 'cardProps'> & {
47
+ prefixClsName: string;
48
+ };
49
+ export type IProLoginByPassword = Pick<IProLogin, 'inputProps' | 'formItemProps'> & {
50
+ prefixClsName: string;
51
+ };
52
+ export interface IProLoginFormRef {
53
+ formRef: FormInstance;
54
+ }
55
+ export interface IProLoginRef {
56
+ resetTime: () => void;
57
+ mobileRef: FormInstance;
58
+ passwordRef: FormInstance;
59
+ }
60
+ export type PasswordFormField = {
61
+ username: string;
62
+ password: string;
63
+ };
64
+ export type MobileFormField = {
65
+ mobile: string;
66
+ validCode: string;
67
+ };
68
+ export interface IProLoginFormData {
69
+ value: PasswordFormField | MobileFormField;
70
+ type: EProLoginType;
71
+ }
72
+ export type ProLoginProps = Partial<IProLogin>;
@@ -0,0 +1,17 @@
1
+ export declare const regexp: {
2
+ mobile: RegExp;
3
+ validCode: RegExp;
4
+ password: RegExp;
5
+ };
6
+ export declare const message: {
7
+ mobile: string;
8
+ validCode: string;
9
+ password: string;
10
+ };
11
+ /**
12
+ * 验证用户名+手机号
13
+ * @param value
14
+ * @param callback
15
+ * @returns
16
+ */
17
+ export declare const testUserName: (value: string, callback: (err: string) => void) => void;
@@ -0,0 +1,28 @@
1
+ const x = {
2
+ mobile: /^1[3-9]\d{9}$/,
3
+ validCode: /^\d{6}$/,
4
+ password: /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)]|[()])+$)([^(0-9a-zA-Z)]|[()]|[a-z]|[A-Z]|[0-9]){6,32}$/
5
+ }, $ = {
6
+ mobile: "请填写正确的手机号",
7
+ validCode: "请输入6位数字验证码",
8
+ password: "包含大小写字母、数字、特殊字符至少2种,且为6-32位"
9
+ }, c = (e, r) => {
10
+ const t = {
11
+ verify: !1,
12
+ errText: ""
13
+ };
14
+ if (/^\d+$/.test(e)) {
15
+ x.mobile.test(e) || r($.mobile);
16
+ return;
17
+ }
18
+ const i = /^[\u4E00-\u9FA50-9a-zA-Z_]{4,16}$/, o = /[\u4E00-\u9FA5]/, n = /[a-zA-Z]/, f = /[0-9]/;
19
+ let s = 0;
20
+ e.indexOf("_") >= 0 && s++, o.test(e) && s++, n.test(e) && s++, f.test(e) && s++;
21
+ const d = e.length;
22
+ e.length < 4 ? t.errText = "用户名长度至少4位" : d > 16 ? t.errText = "用户名不能超过16位" : i.test(e) ? s < 2 ? t.errText = "用户名必须至少包含数字、中文字符、英文字符、下划线中的两种类型" : t.verify = !0 : t.errText = "用户名必须是数字、中英文字符、下划线组成,不能包含其他特殊字符", t.verify || r(t.errText);
23
+ };
24
+ export {
25
+ $ as message,
26
+ x as regexp,
27
+ c as testUserName
28
+ };
@@ -1,67 +1,24 @@
1
1
  import { App } from 'vue';
2
2
  declare const ProMenu: {
3
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
4
- mode: {
5
- type: import('vue').PropType<"horizontal" | "vertical">;
6
- required: false;
7
- default: string;
8
- };
9
- collapsed: {
10
- type: import('vue').PropType<boolean>;
11
- required: false;
12
- };
13
- selectedKeys: {
14
- type: import('vue').PropType<string[]>;
15
- required: true;
16
- };
17
- items: {
18
- type: import('vue').PropType<import('./interface').IProMenuItem[]>;
19
- required: true;
20
- };
21
- menuProps: {
22
- type: import('vue').PropType<Partial<import('@arco-design/web-vue/es/menu/interface').MenuProps>>;
23
- required: false;
24
- default: () => {};
25
- };
26
- }>> & Readonly<{
27
- "onMenu-item-click"?: ((_item: import('./interface').IProMenuItem) => any) | undefined;
28
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
29
- "menu-item-click": (_item: import('./interface').IProMenuItem) => void;
3
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./interface').IProMenuProps> & Readonly<{
4
+ "onOpen-keys-change"?: ((v: string[]) => any) | undefined;
5
+ "onMenu-item-click"?: ((item: import('./interface').IProMenuItem) => any) | undefined;
6
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
7
+ "open-keys-change": (v: string[]) => any;
8
+ "menu-item-click": (item: import('./interface').IProMenuItem) => any;
30
9
  }, import('vue').PublicProps, {
31
10
  mode: "horizontal" | "vertical";
32
11
  menuProps: Partial<import('@arco-design/web-vue/es/menu/interface').MenuProps>;
33
- }, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
12
+ }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
34
13
  P: {};
35
14
  B: {};
36
15
  D: {};
37
16
  C: {};
38
17
  M: {};
39
18
  Defaults: {};
40
- }, Readonly<import('vue').ExtractPropTypes<{
41
- mode: {
42
- type: import('vue').PropType<"horizontal" | "vertical">;
43
- required: false;
44
- default: string;
45
- };
46
- collapsed: {
47
- type: import('vue').PropType<boolean>;
48
- required: false;
49
- };
50
- selectedKeys: {
51
- type: import('vue').PropType<string[]>;
52
- required: true;
53
- };
54
- items: {
55
- type: import('vue').PropType<import('./interface').IProMenuItem[]>;
56
- required: true;
57
- };
58
- menuProps: {
59
- type: import('vue').PropType<Partial<import('@arco-design/web-vue/es/menu/interface').MenuProps>>;
60
- required: false;
61
- default: () => {};
62
- };
63
- }>> & Readonly<{
64
- "onMenu-item-click"?: ((_item: import('./interface').IProMenuItem) => any) | undefined;
19
+ }, Readonly<import('./interface').IProMenuProps> & Readonly<{
20
+ "onOpen-keys-change"?: ((v: string[]) => any) | undefined;
21
+ "onMenu-item-click"?: ((item: import('./interface').IProMenuItem) => any) | undefined;
65
22
  }>, {}, {}, {}, {}, {
66
23
  mode: "horizontal" | "vertical";
67
24
  menuProps: Partial<import('@arco-design/web-vue/es/menu/interface').MenuProps>;
@@ -69,39 +26,20 @@ declare const ProMenu: {
69
26
  __isFragment?: never;
70
27
  __isTeleport?: never;
71
28
  __isSuspense?: never;
72
- } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
73
- mode: {
74
- type: import('vue').PropType<"horizontal" | "vertical">;
75
- required: false;
76
- default: string;
77
- };
78
- collapsed: {
79
- type: import('vue').PropType<boolean>;
80
- required: false;
81
- };
82
- selectedKeys: {
83
- type: import('vue').PropType<string[]>;
84
- required: true;
85
- };
86
- items: {
87
- type: import('vue').PropType<import('./interface').IProMenuItem[]>;
88
- required: true;
89
- };
90
- menuProps: {
91
- type: import('vue').PropType<Partial<import('@arco-design/web-vue/es/menu/interface').MenuProps>>;
92
- required: false;
93
- default: () => {};
94
- };
95
- }>> & Readonly<{
96
- "onMenu-item-click"?: ((_item: import('./interface').IProMenuItem) => any) | undefined;
97
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
98
- "menu-item-click": (_item: import('./interface').IProMenuItem) => void;
29
+ } & import('vue').ComponentOptionsBase<Readonly<import('./interface').IProMenuProps> & Readonly<{
30
+ "onOpen-keys-change"?: ((v: string[]) => any) | undefined;
31
+ "onMenu-item-click"?: ((item: import('./interface').IProMenuItem) => any) | undefined;
32
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
33
+ "open-keys-change": (v: string[]) => any;
34
+ "menu-item-click": (item: import('./interface').IProMenuItem) => any;
99
35
  }, string, {
100
36
  mode: "horizontal" | "vertical";
101
37
  menuProps: Partial<import('@arco-design/web-vue/es/menu/interface').MenuProps>;
102
38
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & {
103
39
  install: (app: App) => void;
104
40
  };
41
+ /** 导出类型 */
105
42
  export * from './interface';
43
+ /** 导出组件 */
106
44
  export { ProMenu };
107
45
  export default ProMenu;
@@ -1,12 +1,11 @@
1
- import n from "./pro-menu.vue.js";
1
+ import o from "./pro-menu.vue.js";
2
2
  /* empty css */
3
- import { Menu as t } from "@arco-design/web-vue";
4
- const s = Object.assign(n, {
5
- install: (o) => {
6
- o.use(t), o.component("KbProMenu", n);
3
+ const r = Object.assign(o, {
4
+ install: (n) => {
5
+ n.component("KbProMenu", o);
7
6
  }
8
7
  });
9
8
  export {
10
- s as ProMenu,
11
- s as default
9
+ r as ProMenu,
10
+ r as default
12
11
  };
@@ -1,3 +1,5 @@
1
+ import { MenuProps } from '@arco-design/web-vue/es/menu/interface';
2
+ import { RouteRecordRedirectOption } from 'vue-router';
1
3
  export interface IProMenuItem {
2
4
  /** 英文名称(唯一标识,不能重复) */
3
5
  name: string;
@@ -30,6 +32,10 @@ export interface IProMenuItem {
30
32
  * 方式二、url: 绝对路径或相对路径
31
33
  * */
32
34
  selectedIcon?: string;
35
+ /** 菜单排序 */
36
+ order?: number;
37
+ /** 是否固定路由(在使用动态路由中就算后端没有返回数据,也会生成该路由,前提是拥有该路由的父级路由) */
38
+ fixed?: boolean;
33
39
  /** 如果设置为 true,右侧菜单不显示 */
34
40
  hideInMenu?: boolean;
35
41
  /** 如果设置为 true,右侧菜单不显示下面子菜单 */
@@ -47,4 +53,29 @@ export interface IProMenuItem {
47
53
  componentKey?: 'path' | 'fullPath';
48
54
  /** 子菜单 */
49
55
  children?: IProMenuItem[];
56
+ /** 重定向(只有当菜单为顶部菜单、并且子菜单不是顶部菜单才生效) */
57
+ redirect?: RouteRecordRedirectOption;
50
58
  }
59
+ /**
60
+ * 组件emits
61
+ */
62
+ export interface IProMenuEmits {
63
+ /** 展开菜单改变 */
64
+ (e: 'open-keys-change', v: string[]): void;
65
+ (e: 'menu-item-click', item: IProMenuItem): void;
66
+ }
67
+ export interface IProMenuProps {
68
+ items: IProMenuItem[];
69
+ /** 选中的菜单 */
70
+ selectedKeys: string[];
71
+ /** 打开的菜单 */
72
+ openKeys?: string[];
73
+ mode?: 'horizontal' | 'vertical';
74
+ collapsed?: boolean;
75
+ menuProps?: Partial<MenuProps>;
76
+ }
77
+ export type IProMenuItemProps = {
78
+ item: IProMenuItem;
79
+ selectedKeys: string[];
80
+ mode?: 'horizontal' | 'vertical';
81
+ } & Pick<IProMenuProps, 'selectedKeys' | 'mode'>;
@@ -0,0 +1,27 @@
1
+ import { IProMenuItem } from './interface.ts';
2
+ type __VLS_Props = {
3
+ item: IProMenuItem;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ icon?(_: {}): any;
9
+ };
10
+ refs: {};
11
+ rootEl: any;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
15
+ "open-keys-change": (v: string[]) => any;
16
+ "menu-item-click": (item: IProMenuItem) => any;
17
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ "onOpen-keys-change"?: ((v: string[]) => any) | undefined;
19
+ "onMenu-item-click"?: ((item: IProMenuItem) => any) | undefined;
20
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
22
+ export default _default;
23
+ type __VLS_WithTemplateSlots<T, S> = T & {
24
+ new (): {
25
+ $slots: S;
26
+ };
27
+ };
@@ -0,0 +1,35 @@
1
+ import { defineComponent as r, createBlock as s, openBlock as l, unref as p, createSlots as a, withCtx as i, createTextVNode as c, toDisplayString as u, renderSlot as f } from "vue";
2
+ import { MenuItem as k } from "@arco-design/web-vue";
3
+ const g = /* @__PURE__ */ r({
4
+ __name: "menu-item",
5
+ props: {
6
+ item: {}
7
+ },
8
+ emits: ["open-keys-change", "menu-item-click"],
9
+ setup(d, { emit: o }) {
10
+ const m = o;
11
+ return (e, t) => {
12
+ var n;
13
+ return l(), s(p(k), {
14
+ key: e.item.name,
15
+ onClick: t[0] || (t[0] = (y) => m("menu-item-click", e.item))
16
+ }, a({
17
+ default: i(() => [
18
+ c(" " + u(e.item.title), 1)
19
+ ]),
20
+ _: 2
21
+ }, [
22
+ (n = e.item) != null && n.icon ? {
23
+ name: "icon",
24
+ fn: i(() => [
25
+ f(e.$slots, "icon")
26
+ ]),
27
+ key: "0"
28
+ } : void 0
29
+ ]), 1024);
30
+ };
31
+ }
32
+ });
33
+ export {
34
+ g as default
35
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./menu-item.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,9 @@
1
+ import { IProMenuItem, IProMenuItemProps } from './interface.ts';
2
+ declare const _default: import('vue').DefineComponent<IProMenuItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ "open-keys-change": (v: string[]) => any;
4
+ "menu-item-click": (item: IProMenuItem) => any;
5
+ }, string, import('vue').PublicProps, Readonly<IProMenuItemProps> & Readonly<{
6
+ "onOpen-keys-change"?: ((v: string[]) => any) | undefined;
7
+ "onMenu-item-click"?: ((item: IProMenuItem) => any) | undefined;
8
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
9
+ export default _default;
@@ -0,0 +1,63 @@
1
+ import { defineComponent as p, createBlock as u, createCommentVNode as l, openBlock as r, withCtx as i, createElementBlock as a, resolveDynamicComponent as m, normalizeClass as k } from "vue";
2
+ import I from "./menu-item.vue.js";
3
+ import M from "./sub-menu.vue.js";
4
+ const $ = ["src"], z = ["src"], y = "keyblade-pro-menu-item", v = /* @__PURE__ */ p({
5
+ __name: "pro-menu-item",
6
+ props: {
7
+ item: {},
8
+ selectedKeys: {},
9
+ mode: {}
10
+ },
11
+ emits: ["open-keys-change", "menu-item-click"],
12
+ setup(h, { emit: f }) {
13
+ const o = h, d = f, C = (e) => {
14
+ var n;
15
+ return (e == null ? void 0 : e.children) && ((n = e == null ? void 0 : e.children) == null ? void 0 : n.length) > 0 && ((o == null ? void 0 : o.mode) === "vertical" || (o == null ? void 0 : o.mode) === "horizontal" && e.topChildrenMenu);
16
+ }, g = (e) => {
17
+ var n;
18
+ return !(e != null && e.children) || ((n = e == null ? void 0 : e.children) == null ? void 0 : n.length) === 0 || o.mode === "horizontal" && e.children.length > 0 && !e.topChildrenMenu;
19
+ }, s = (e) => {
20
+ var n;
21
+ return (n = o == null ? void 0 : o.selectedKeys) != null && n.includes(e.name) && e != null && e.selectedIcon ? e == null ? void 0 : e.selectedIcon : e == null ? void 0 : e.icon;
22
+ }, c = (e) => {
23
+ const n = e == null ? void 0 : e.icon;
24
+ return n != null && n.startsWith("icon") ? "icon" : "url";
25
+ };
26
+ return (e, n) => C(e.item) ? (r(), u(M, {
27
+ key: 0,
28
+ item: e.item,
29
+ mode: e.mode,
30
+ "selected-keys": e.selectedKeys,
31
+ onMenuItemClick: n[0] || (n[0] = (t) => d("menu-item-click", t))
32
+ }, {
33
+ icon: i(() => [
34
+ c(e.item) === "icon" ? (r(), u(m(s(e.item)), { key: 0 })) : l("", !0),
35
+ c(e.item) === "url" ? (r(), a("img", {
36
+ key: 1,
37
+ class: k(`${y}-img`),
38
+ src: s(e.item),
39
+ alt: ""
40
+ }, null, 10, $)) : l("", !0)
41
+ ]),
42
+ _: 1
43
+ }, 8, ["item", "mode", "selected-keys"])) : g(e.item) ? (r(), u(I, {
44
+ key: 1,
45
+ item: e.item,
46
+ onMenuItemClick: n[1] || (n[1] = (t) => d("menu-item-click", t))
47
+ }, {
48
+ icon: i(() => [
49
+ c(e.item) === "icon" ? (r(), u(m(s(e.item)), { key: 0 })) : l("", !0),
50
+ c(e.item) === "url" ? (r(), a("img", {
51
+ key: 1,
52
+ class: k(`${y}-img`),
53
+ src: s(e.item),
54
+ alt: ""
55
+ }, null, 10, z)) : l("", !0)
56
+ ]),
57
+ _: 1
58
+ }, 8, ["item"])) : l("", !0);
59
+ }
60
+ });
61
+ export {
62
+ v as default
63
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./pro-menu-item.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,58 +1,12 @@
1
- import { PropType } from 'vue';
2
- import { IProMenuItem } from './interface';
3
- import { MenuProps } from '@arco-design/web-vue/es/menu/interface';
4
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
- mode: {
6
- type: PropType<"horizontal" | "vertical">;
7
- required: false;
8
- default: string;
9
- };
10
- collapsed: {
11
- type: PropType<boolean>;
12
- required: false;
13
- };
14
- selectedKeys: {
15
- type: PropType<string[]>;
16
- required: true;
17
- };
18
- items: {
19
- type: PropType<IProMenuItem[]>;
20
- required: true;
21
- };
22
- menuProps: {
23
- type: PropType<Partial<MenuProps>>;
24
- required: false;
25
- default: () => {};
26
- };
27
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
- "menu-item-click": (_item: IProMenuItem) => void;
29
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
30
- mode: {
31
- type: PropType<"horizontal" | "vertical">;
32
- required: false;
33
- default: string;
34
- };
35
- collapsed: {
36
- type: PropType<boolean>;
37
- required: false;
38
- };
39
- selectedKeys: {
40
- type: PropType<string[]>;
41
- required: true;
42
- };
43
- items: {
44
- type: PropType<IProMenuItem[]>;
45
- required: true;
46
- };
47
- menuProps: {
48
- type: PropType<Partial<MenuProps>>;
49
- required: false;
50
- default: () => {};
51
- };
52
- }>> & Readonly<{
53
- "onMenu-item-click"?: ((_item: IProMenuItem) => any) | undefined;
1
+ import { IProMenuProps } from './interface';
2
+ declare const _default: import('vue').DefineComponent<IProMenuProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
3
+ "open-keys-change": (v: string[]) => any;
4
+ "menu-item-click": (item: import('./interface').IProMenuItem) => any;
5
+ }, string, import('vue').PublicProps, Readonly<IProMenuProps> & Readonly<{
6
+ "onOpen-keys-change"?: ((v: string[]) => any) | undefined;
7
+ "onMenu-item-click"?: ((item: import('./interface').IProMenuItem) => any) | undefined;
54
8
  }>, {
55
9
  mode: "horizontal" | "vertical";
56
- menuProps: Partial<MenuProps>;
57
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
10
+ menuProps: Partial<import('@arco-design/web-vue/es/menu/interface').MenuProps>;
11
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
58
12
  export default _default;