@vtj/ui 0.5.2 → 0.6.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.
- package/cdn/index.js +1 -1
- package/cdn/style.css +1 -1
- package/lib/index.js +2739 -246
- package/lib/style.css +1 -1
- package/package.json +11 -11
- package/types/components/action/Action.d.ts +363 -0
- package/types/components/action/Trigger.d.ts +187 -0
- package/types/components/action/hooks.d.ts +43 -0
- package/types/components/action/index.d.ts +3 -0
- package/types/components/action/types.d.ts +151 -0
- package/types/components/action-bar/ActionBar.d.ts +684 -0
- package/types/components/action-bar/index.d.ts +3 -0
- package/types/components/action-bar/types.d.ts +124 -0
- package/types/components/container/Container.d.ts +147 -0
- package/types/components/container/index.d.ts +3 -0
- package/types/components/container/types.d.ts +120 -0
- package/types/components/dialog/Dialog.d.ts +334 -0
- package/types/components/dialog/create.d.ts +11 -0
- package/types/components/dialog/hooks.d.ts +58 -0
- package/types/components/dialog/index.d.ts +4 -0
- package/types/components/dialog/types.d.ts +124 -0
- package/types/components/header/Header.d.ts +61 -0
- package/types/components/header/index.d.ts +3 -0
- package/types/components/header/types.d.ts +29 -0
- package/types/components/icon/Icon.d.ts +1 -1
- package/types/components/index.d.ts +7 -0
- package/types/components/mask/Mask.d.ts +469 -0
- package/types/components/mask/components/Avatar.d.ts +21 -0
- package/types/components/mask/components/Brand.d.ts +47 -0
- package/types/components/mask/components/Content.d.ts +33 -0
- package/types/components/mask/components/Menu.d.ts +65 -0
- package/types/components/mask/components/Sidebar.d.ts +22 -0
- package/types/components/mask/components/SwitchBar.d.ts +39 -0
- package/types/components/mask/components/Tabs.d.ts +62 -0
- package/types/components/mask/components/ThemeSwitch.d.ts +3 -0
- package/types/components/mask/components/Toolbar.d.ts +50 -0
- package/types/components/mask/defineTab.d.ts +6 -0
- package/types/components/mask/hooks/index.d.ts +5 -0
- package/types/components/mask/hooks/useContent.d.ts +20 -0
- package/types/components/mask/hooks/useHome.d.ts +3 -0
- package/types/components/mask/hooks/useMenus.d.ts +28 -0
- package/types/components/mask/hooks/useSidebar.d.ts +7 -0
- package/types/components/mask/hooks/useTabs.d.ts +22 -0
- package/types/components/mask/index.d.ts +4 -0
- package/types/components/mask/types.d.ts +112 -0
- package/types/components/menu/Menu.d.ts +9 -75
- package/types/components/menu/MenuItem.d.ts +17 -2
- package/types/components/menu/types.d.ts +16 -5
- package/types/components/panel/Panel.d.ts +401 -0
- package/types/components/panel/index.d.ts +3 -0
- package/types/components/panel/types.d.ts +223 -0
- package/types/components/shared.d.ts +12 -0
- package/types/components/startup/Startup.d.ts +10 -0
- package/types/constants.d.ts +0 -3
- package/types/directives/index.d.ts +2 -0
- package/types/directives/vDraggable.d.ts +45 -0
- package/types/directives/vResizable.d.ts +37 -0
- package/types/hooks/index.d.ts +1 -2
- package/types/hooks/useDisabled.d.ts +3 -0
- package/types/hooks/useIcon.d.ts +3 -3
- package/types/index.d.ts +3 -0
- package/types/utils/index.d.ts +0 -2
- package/types/utils/install.d.ts +3 -8
- package/types/utils/util.d.ts +0 -3
- package/types/version.d.ts +1 -0
- package/types/hooks/useDraggable.d.ts +0 -13
- package/types/hooks/useResizable.d.ts +0 -25
- package/types/utils/emits.d.ts +0 -6
- package/types/utils/make-install.d.ts +0 -4
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { EpPropFinalized, Arrayable, EpPropMergeType } from 'element-plus/es/utils';
|
|
2
|
+
import { ElTooltipProps, BadgeProps, TooltipTriggerType, Placement, Options, ButtonProps } from 'element-plus';
|
|
3
|
+
import { ActionMode, ActionMenuItem } from './types';
|
|
4
|
+
import { IconParam, BaseSize, BaseType } from '..';
|
|
5
|
+
import { DefineComponent, PropType, ExtractPropTypes, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps } from 'vue';
|
|
6
|
+
declare const _default: DefineComponent<{
|
|
7
|
+
name: {
|
|
8
|
+
type: StringConstructor;
|
|
9
|
+
};
|
|
10
|
+
label: {
|
|
11
|
+
type: StringConstructor;
|
|
12
|
+
};
|
|
13
|
+
value: {
|
|
14
|
+
type: PropType<unknown>;
|
|
15
|
+
};
|
|
16
|
+
icon: {
|
|
17
|
+
type: PropType<IconParam>;
|
|
18
|
+
};
|
|
19
|
+
mode: {
|
|
20
|
+
type: PropType<ActionMode>;
|
|
21
|
+
default: string;
|
|
22
|
+
};
|
|
23
|
+
menus: {
|
|
24
|
+
type: PropType<ActionMenuItem[]>;
|
|
25
|
+
};
|
|
26
|
+
tooltip: {
|
|
27
|
+
type: PropType<string | Partial<ElTooltipProps>>;
|
|
28
|
+
};
|
|
29
|
+
badge: {
|
|
30
|
+
type: PropType<string | number | Partial<BadgeProps>>;
|
|
31
|
+
};
|
|
32
|
+
dropdown: {
|
|
33
|
+
type: PropType<Partial<ExtractPropTypes<{
|
|
34
|
+
readonly trigger: EpPropFinalized<(new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>) | ((new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
35
|
+
readonly effect: {
|
|
36
|
+
readonly default: "light";
|
|
37
|
+
readonly type: PropType<string>;
|
|
38
|
+
readonly required: false;
|
|
39
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
40
|
+
readonly __epPropKey: true;
|
|
41
|
+
};
|
|
42
|
+
readonly type: {
|
|
43
|
+
readonly type: PropType<EpPropMergeType<(new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>) | ((new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>))[], unknown, unknown>>;
|
|
44
|
+
readonly required: false;
|
|
45
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
46
|
+
__epPropKey: true;
|
|
47
|
+
};
|
|
48
|
+
readonly placement: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement) | ((new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement))[], unknown, unknown, "bottom", boolean>;
|
|
49
|
+
readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | ((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>))[], unknown, unknown, () => {}, boolean>;
|
|
50
|
+
readonly id: StringConstructor;
|
|
51
|
+
readonly size: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
52
|
+
readonly splitButton: BooleanConstructor;
|
|
53
|
+
readonly hideOnClick: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
54
|
+
readonly loop: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
55
|
+
readonly showTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
56
|
+
readonly hideTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
57
|
+
readonly tabindex: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, 0, boolean>;
|
|
58
|
+
readonly maxHeight: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
|
|
59
|
+
readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
60
|
+
readonly disabled: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
61
|
+
readonly role: EpPropFinalized<StringConstructor, unknown, unknown, "menu", boolean>;
|
|
62
|
+
readonly buttonProps: {
|
|
63
|
+
readonly type: PropType<ButtonProps>;
|
|
64
|
+
readonly required: false;
|
|
65
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
66
|
+
__epPropKey: true;
|
|
67
|
+
};
|
|
68
|
+
readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
69
|
+
}>>>;
|
|
70
|
+
};
|
|
71
|
+
button: {
|
|
72
|
+
type: PropType<Partial<ButtonProps>>;
|
|
73
|
+
};
|
|
74
|
+
disabled: {
|
|
75
|
+
type: PropType<boolean | (() => boolean)>;
|
|
76
|
+
};
|
|
77
|
+
size: {
|
|
78
|
+
type: PropType<BaseSize>;
|
|
79
|
+
default: string;
|
|
80
|
+
};
|
|
81
|
+
type: {
|
|
82
|
+
type: PropType<BaseType>;
|
|
83
|
+
default: string;
|
|
84
|
+
};
|
|
85
|
+
background: {
|
|
86
|
+
type: PropType<"hover" | "always">;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
circle: {
|
|
90
|
+
type: BooleanConstructor;
|
|
91
|
+
};
|
|
92
|
+
}, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "click"[], "click", VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
|
|
93
|
+
name: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
};
|
|
96
|
+
label: {
|
|
97
|
+
type: StringConstructor;
|
|
98
|
+
};
|
|
99
|
+
value: {
|
|
100
|
+
type: PropType<unknown>;
|
|
101
|
+
};
|
|
102
|
+
icon: {
|
|
103
|
+
type: PropType<IconParam>;
|
|
104
|
+
};
|
|
105
|
+
mode: {
|
|
106
|
+
type: PropType<ActionMode>;
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
menus: {
|
|
110
|
+
type: PropType<ActionMenuItem[]>;
|
|
111
|
+
};
|
|
112
|
+
tooltip: {
|
|
113
|
+
type: PropType<string | Partial<ElTooltipProps>>;
|
|
114
|
+
};
|
|
115
|
+
badge: {
|
|
116
|
+
type: PropType<string | number | Partial<BadgeProps>>;
|
|
117
|
+
};
|
|
118
|
+
dropdown: {
|
|
119
|
+
type: PropType<Partial<ExtractPropTypes<{
|
|
120
|
+
readonly trigger: EpPropFinalized<(new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>) | ((new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
121
|
+
readonly effect: {
|
|
122
|
+
readonly default: "light";
|
|
123
|
+
readonly type: PropType<string>;
|
|
124
|
+
readonly required: false;
|
|
125
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
126
|
+
readonly __epPropKey: true;
|
|
127
|
+
};
|
|
128
|
+
readonly type: {
|
|
129
|
+
readonly type: PropType<EpPropMergeType<(new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>) | ((new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>))[], unknown, unknown>>;
|
|
130
|
+
readonly required: false;
|
|
131
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
132
|
+
__epPropKey: true;
|
|
133
|
+
};
|
|
134
|
+
readonly placement: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement) | ((new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement))[], unknown, unknown, "bottom", boolean>;
|
|
135
|
+
readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | ((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>))[], unknown, unknown, () => {}, boolean>;
|
|
136
|
+
readonly id: StringConstructor;
|
|
137
|
+
readonly size: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
138
|
+
readonly splitButton: BooleanConstructor;
|
|
139
|
+
readonly hideOnClick: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
140
|
+
readonly loop: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
141
|
+
readonly showTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
142
|
+
readonly hideTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
143
|
+
readonly tabindex: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, 0, boolean>;
|
|
144
|
+
readonly maxHeight: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
|
|
145
|
+
readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
146
|
+
readonly disabled: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
147
|
+
readonly role: EpPropFinalized<StringConstructor, unknown, unknown, "menu", boolean>;
|
|
148
|
+
readonly buttonProps: {
|
|
149
|
+
readonly type: PropType<ButtonProps>;
|
|
150
|
+
readonly required: false;
|
|
151
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
152
|
+
__epPropKey: true;
|
|
153
|
+
};
|
|
154
|
+
readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
155
|
+
}>>>;
|
|
156
|
+
};
|
|
157
|
+
button: {
|
|
158
|
+
type: PropType<Partial<ButtonProps>>;
|
|
159
|
+
};
|
|
160
|
+
disabled: {
|
|
161
|
+
type: PropType<boolean | (() => boolean)>;
|
|
162
|
+
};
|
|
163
|
+
size: {
|
|
164
|
+
type: PropType<BaseSize>;
|
|
165
|
+
default: string;
|
|
166
|
+
};
|
|
167
|
+
type: {
|
|
168
|
+
type: PropType<BaseType>;
|
|
169
|
+
default: string;
|
|
170
|
+
};
|
|
171
|
+
background: {
|
|
172
|
+
type: PropType<"hover" | "always">;
|
|
173
|
+
default: string;
|
|
174
|
+
};
|
|
175
|
+
circle: {
|
|
176
|
+
type: BooleanConstructor;
|
|
177
|
+
};
|
|
178
|
+
}>> & {
|
|
179
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
180
|
+
}, {
|
|
181
|
+
type: BaseType;
|
|
182
|
+
size: BaseSize;
|
|
183
|
+
circle: boolean;
|
|
184
|
+
mode: ActionMode;
|
|
185
|
+
background: "hover" | "always";
|
|
186
|
+
}, {}>;
|
|
187
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EpPropFinalized, Arrayable, EpPropMergeType } from 'element-plus/es/utils';
|
|
2
|
+
import { ComputedRef, ExtractPropTypes, PropType } from 'vue';
|
|
3
|
+
import { TooltipTriggerType, Placement, Options, ButtonProps, ElTooltipProps, BadgeProps } from 'element-plus';
|
|
4
|
+
import { ActionProps } from './types';
|
|
5
|
+
export declare function useTooltip(props: ActionProps): ComputedRef<Partial<ElTooltipProps> | undefined>;
|
|
6
|
+
export declare function useBadge(props: ActionProps): ComputedRef<Partial<BadgeProps> | undefined>;
|
|
7
|
+
export declare function useDropdown(props: ActionProps): ComputedRef<Partial<ExtractPropTypes<{
|
|
8
|
+
readonly trigger: EpPropFinalized<(new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>) | ((new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
9
|
+
readonly effect: {
|
|
10
|
+
readonly default: "light";
|
|
11
|
+
readonly type: PropType<string>;
|
|
12
|
+
readonly required: false;
|
|
13
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
14
|
+
readonly __epPropKey: true;
|
|
15
|
+
};
|
|
16
|
+
readonly type: {
|
|
17
|
+
readonly type: PropType<EpPropMergeType<(new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>) | ((new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>))[], unknown, unknown>>;
|
|
18
|
+
readonly required: false;
|
|
19
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
20
|
+
__epPropKey: true;
|
|
21
|
+
};
|
|
22
|
+
readonly placement: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement) | ((new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement))[], unknown, unknown, "bottom", boolean>;
|
|
23
|
+
readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | ((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>))[], unknown, unknown, () => {}, boolean>;
|
|
24
|
+
readonly id: StringConstructor;
|
|
25
|
+
readonly size: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
26
|
+
readonly splitButton: BooleanConstructor;
|
|
27
|
+
readonly hideOnClick: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
28
|
+
readonly loop: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
29
|
+
readonly showTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
30
|
+
readonly hideTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
31
|
+
readonly tabindex: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, 0, boolean>;
|
|
32
|
+
readonly maxHeight: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
|
|
33
|
+
readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
34
|
+
readonly disabled: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
35
|
+
readonly role: EpPropFinalized<StringConstructor, unknown, unknown, "menu", boolean>;
|
|
36
|
+
readonly buttonProps: {
|
|
37
|
+
readonly type: PropType<ButtonProps>;
|
|
38
|
+
readonly required: false;
|
|
39
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
40
|
+
__epPropKey: true;
|
|
41
|
+
};
|
|
42
|
+
readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
43
|
+
}>> | undefined>;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { EpPropFinalized, Arrayable, EpPropMergeType } from 'element-plus/es/utils';
|
|
2
|
+
import { PropType, ExtractPropTypes } from 'vue';
|
|
3
|
+
import { TooltipTriggerType, Placement, Options, ElTooltipProps, BadgeProps, dropdownProps, ButtonProps } from 'element-plus';
|
|
4
|
+
import { ComponentPropsType, BaseSize, BaseType } from '../shared';
|
|
5
|
+
import { IconParam } from '../icon';
|
|
6
|
+
export type ActionMode = 'button' | 'text' | 'icon';
|
|
7
|
+
export interface ActionMenuItem {
|
|
8
|
+
command: string | number | object;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
divided?: boolean;
|
|
11
|
+
icon?: IconParam;
|
|
12
|
+
label?: string;
|
|
13
|
+
}
|
|
14
|
+
export type ActionDropdown = Partial<ExtractPropTypes<typeof dropdownProps>>;
|
|
15
|
+
export declare const actionProps: {
|
|
16
|
+
/**
|
|
17
|
+
* 动作名称标识
|
|
18
|
+
*/
|
|
19
|
+
name: {
|
|
20
|
+
type: StringConstructor;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* 动作标题文本
|
|
24
|
+
*/
|
|
25
|
+
label: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 动作值,用来传输数据
|
|
30
|
+
*/
|
|
31
|
+
value: {
|
|
32
|
+
type: PropType<unknown>;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 图标配置
|
|
36
|
+
*/
|
|
37
|
+
icon: {
|
|
38
|
+
type: PropType<IconParam>;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* 模式
|
|
42
|
+
*/
|
|
43
|
+
mode: {
|
|
44
|
+
type: PropType<ActionMode>;
|
|
45
|
+
default: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* 下拉菜单配置
|
|
49
|
+
*/
|
|
50
|
+
menus: {
|
|
51
|
+
type: PropType<ActionMenuItem[]>;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* tooltip 配置
|
|
55
|
+
*/
|
|
56
|
+
tooltip: {
|
|
57
|
+
type: PropType<string | Partial<ElTooltipProps>>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Badge 配置
|
|
61
|
+
*/
|
|
62
|
+
badge: {
|
|
63
|
+
type: PropType<string | number | Partial<BadgeProps>>;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* ElDropdown 组件配置
|
|
67
|
+
*/
|
|
68
|
+
dropdown: {
|
|
69
|
+
type: PropType<Partial<ExtractPropTypes<{
|
|
70
|
+
readonly trigger: EpPropFinalized<(new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>) | ((new (...args: any[]) => "click" | "hover" | "focus" | "contextmenu" | TooltipTriggerType[]) | (() => Arrayable<TooltipTriggerType>))[], unknown, unknown, "hover", boolean>;
|
|
71
|
+
readonly effect: {
|
|
72
|
+
readonly default: "light";
|
|
73
|
+
readonly type: PropType<string>;
|
|
74
|
+
readonly required: false;
|
|
75
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
76
|
+
readonly __epPropKey: true;
|
|
77
|
+
};
|
|
78
|
+
readonly type: {
|
|
79
|
+
readonly type: PropType<EpPropMergeType<(new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>) | ((new (...args: any[]) => "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text") | (() => EpPropMergeType<StringConstructor, "" | "success" | "warning" | "info" | "primary" | "danger" | "default" | "text", unknown>))[], unknown, unknown>>;
|
|
80
|
+
readonly required: false;
|
|
81
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
82
|
+
__epPropKey: true;
|
|
83
|
+
};
|
|
84
|
+
readonly placement: EpPropFinalized<(new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement) | ((new (...args: any[]) => "right" | "left" | "auto" | "auto-start" | "auto-end" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => Placement))[], unknown, unknown, "bottom", boolean>;
|
|
85
|
+
readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | ((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>))[], unknown, unknown, () => {}, boolean>;
|
|
86
|
+
readonly id: StringConstructor;
|
|
87
|
+
readonly size: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
88
|
+
readonly splitButton: BooleanConstructor;
|
|
89
|
+
readonly hideOnClick: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
90
|
+
readonly loop: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
91
|
+
readonly showTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
92
|
+
readonly hideTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
|
|
93
|
+
readonly tabindex: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, 0, boolean>;
|
|
94
|
+
readonly maxHeight: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
|
|
95
|
+
readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
96
|
+
readonly disabled: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
|
|
97
|
+
readonly role: EpPropFinalized<StringConstructor, unknown, unknown, "menu", boolean>;
|
|
98
|
+
readonly buttonProps: {
|
|
99
|
+
readonly type: PropType<ButtonProps>;
|
|
100
|
+
readonly required: false;
|
|
101
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
102
|
+
__epPropKey: true;
|
|
103
|
+
};
|
|
104
|
+
readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
105
|
+
}>>>;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* ElButton 组件配置,mode为button时有效
|
|
109
|
+
*/
|
|
110
|
+
button: {
|
|
111
|
+
type: PropType<Partial<ButtonProps>>;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* 禁用
|
|
115
|
+
*/
|
|
116
|
+
disabled: {
|
|
117
|
+
type: PropType<boolean | (() => boolean)>;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* 尺寸
|
|
121
|
+
*/
|
|
122
|
+
size: {
|
|
123
|
+
type: PropType<BaseSize>;
|
|
124
|
+
default: string;
|
|
125
|
+
};
|
|
126
|
+
/**
|
|
127
|
+
* 颜色类型
|
|
128
|
+
*/
|
|
129
|
+
type: {
|
|
130
|
+
type: PropType<BaseType>;
|
|
131
|
+
default: string;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* icon 背景设置,当 mode为 icon 时有效
|
|
135
|
+
*/
|
|
136
|
+
background: {
|
|
137
|
+
type: PropType<"hover" | "always">;
|
|
138
|
+
default: string;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* icon 背景样式圆形,当 mode为 icon 时有效
|
|
142
|
+
*/
|
|
143
|
+
circle: {
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export type ActionProps = ComponentPropsType<typeof actionProps>;
|
|
148
|
+
export type ActionEmits = {
|
|
149
|
+
click: [props: ActionProps];
|
|
150
|
+
command: [item: ActionMenuItem];
|
|
151
|
+
};
|