@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.
Files changed (69) hide show
  1. package/cdn/index.js +1 -1
  2. package/cdn/style.css +1 -1
  3. package/lib/index.js +2739 -246
  4. package/lib/style.css +1 -1
  5. package/package.json +11 -11
  6. package/types/components/action/Action.d.ts +363 -0
  7. package/types/components/action/Trigger.d.ts +187 -0
  8. package/types/components/action/hooks.d.ts +43 -0
  9. package/types/components/action/index.d.ts +3 -0
  10. package/types/components/action/types.d.ts +151 -0
  11. package/types/components/action-bar/ActionBar.d.ts +684 -0
  12. package/types/components/action-bar/index.d.ts +3 -0
  13. package/types/components/action-bar/types.d.ts +124 -0
  14. package/types/components/container/Container.d.ts +147 -0
  15. package/types/components/container/index.d.ts +3 -0
  16. package/types/components/container/types.d.ts +120 -0
  17. package/types/components/dialog/Dialog.d.ts +334 -0
  18. package/types/components/dialog/create.d.ts +11 -0
  19. package/types/components/dialog/hooks.d.ts +58 -0
  20. package/types/components/dialog/index.d.ts +4 -0
  21. package/types/components/dialog/types.d.ts +124 -0
  22. package/types/components/header/Header.d.ts +61 -0
  23. package/types/components/header/index.d.ts +3 -0
  24. package/types/components/header/types.d.ts +29 -0
  25. package/types/components/icon/Icon.d.ts +1 -1
  26. package/types/components/index.d.ts +7 -0
  27. package/types/components/mask/Mask.d.ts +469 -0
  28. package/types/components/mask/components/Avatar.d.ts +21 -0
  29. package/types/components/mask/components/Brand.d.ts +47 -0
  30. package/types/components/mask/components/Content.d.ts +33 -0
  31. package/types/components/mask/components/Menu.d.ts +65 -0
  32. package/types/components/mask/components/Sidebar.d.ts +22 -0
  33. package/types/components/mask/components/SwitchBar.d.ts +39 -0
  34. package/types/components/mask/components/Tabs.d.ts +62 -0
  35. package/types/components/mask/components/ThemeSwitch.d.ts +3 -0
  36. package/types/components/mask/components/Toolbar.d.ts +50 -0
  37. package/types/components/mask/defineTab.d.ts +6 -0
  38. package/types/components/mask/hooks/index.d.ts +5 -0
  39. package/types/components/mask/hooks/useContent.d.ts +20 -0
  40. package/types/components/mask/hooks/useHome.d.ts +3 -0
  41. package/types/components/mask/hooks/useMenus.d.ts +28 -0
  42. package/types/components/mask/hooks/useSidebar.d.ts +7 -0
  43. package/types/components/mask/hooks/useTabs.d.ts +22 -0
  44. package/types/components/mask/index.d.ts +4 -0
  45. package/types/components/mask/types.d.ts +112 -0
  46. package/types/components/menu/Menu.d.ts +9 -75
  47. package/types/components/menu/MenuItem.d.ts +17 -2
  48. package/types/components/menu/types.d.ts +16 -5
  49. package/types/components/panel/Panel.d.ts +401 -0
  50. package/types/components/panel/index.d.ts +3 -0
  51. package/types/components/panel/types.d.ts +223 -0
  52. package/types/components/shared.d.ts +12 -0
  53. package/types/components/startup/Startup.d.ts +10 -0
  54. package/types/constants.d.ts +0 -3
  55. package/types/directives/index.d.ts +2 -0
  56. package/types/directives/vDraggable.d.ts +45 -0
  57. package/types/directives/vResizable.d.ts +37 -0
  58. package/types/hooks/index.d.ts +1 -2
  59. package/types/hooks/useDisabled.d.ts +3 -0
  60. package/types/hooks/useIcon.d.ts +3 -3
  61. package/types/index.d.ts +3 -0
  62. package/types/utils/index.d.ts +0 -2
  63. package/types/utils/install.d.ts +3 -8
  64. package/types/utils/util.d.ts +0 -3
  65. package/types/version.d.ts +1 -0
  66. package/types/hooks/useDraggable.d.ts +0 -13
  67. package/types/hooks/useResizable.d.ts +0 -25
  68. package/types/utils/emits.d.ts +0 -6
  69. package/types/utils/make-install.d.ts +0 -4
@@ -0,0 +1,3 @@
1
+ import XActionBar from "./ActionBar";
2
+ export { XActionBar };
3
+ export * from './types';
@@ -0,0 +1,124 @@
1
+ import { EpPropFinalized, Arrayable, EpPropMergeType } from 'element-plus/es/utils';
2
+ import { ExtractPropTypes, PropType } from 'vue';
3
+ import { ComponentPropsType, BaseSize, BaseType } from '../shared';
4
+ import { ActionMode, ActionProps, ActionMenuItem, ContainerProps } from '../';
5
+ import { TooltipTriggerType, Placement, Options, ElTooltipProps, BadgeProps, ButtonProps } from 'element-plus';
6
+ export type ActionBarItem = ActionProps & {
7
+ [key: string]: any;
8
+ };
9
+ export type ActionBarItems = Array<ActionBarItem | '|'>;
10
+ export declare const actionBarProps: {
11
+ /**
12
+ * 动作项
13
+ */
14
+ items: {
15
+ type: PropType<ActionBarItems>;
16
+ };
17
+ /**
18
+ * 模式
19
+ */
20
+ mode: {
21
+ type: PropType<ActionMode>;
22
+ default: string;
23
+ };
24
+ /**
25
+ * 尺寸
26
+ */
27
+ size: {
28
+ type: PropType<BaseSize>;
29
+ default: string;
30
+ };
31
+ /**
32
+ * 颜色类型
33
+ */
34
+ type: {
35
+ type: PropType<BaseType>;
36
+ default: string;
37
+ };
38
+ /**
39
+ * icon 背景设置,当 mode为 icon 时有效
40
+ */
41
+ background: {
42
+ type: PropType<"hover" | "always">;
43
+ default: string;
44
+ };
45
+ /**
46
+ * icon 背景样式圆形,当 mode为 icon 时有效
47
+ */
48
+ circle: {
49
+ type: BooleanConstructor;
50
+ };
51
+ /**
52
+ * 禁用
53
+ */
54
+ disabled: {
55
+ type: PropType<boolean | ((item: ActionProps) => boolean)>;
56
+ };
57
+ /**
58
+ * tooltip 配置
59
+ */
60
+ tooltip: {
61
+ type: PropType<Partial<ElTooltipProps>>;
62
+ };
63
+ /**
64
+ * Badge 配置
65
+ */
66
+ badge: {
67
+ type: PropType<Partial<BadgeProps>>;
68
+ };
69
+ /**
70
+ * ElDropdown 组件配置
71
+ */
72
+ dropdown: {
73
+ type: PropType<Partial<ExtractPropTypes<{
74
+ 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>;
75
+ readonly effect: {
76
+ readonly default: "light";
77
+ readonly type: PropType<string>; /**
78
+ * ElButton 组件配置,mode为button时有效
79
+ */
80
+ readonly required: false;
81
+ readonly validator: ((val: unknown) => boolean) | undefined;
82
+ readonly __epPropKey: true;
83
+ };
84
+ readonly type: {
85
+ 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>>;
86
+ readonly required: false;
87
+ readonly validator: ((val: unknown) => boolean) | undefined;
88
+ __epPropKey: true;
89
+ };
90
+ 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>;
91
+ readonly popperOptions: EpPropFinalized<(new (...args: any[]) => Partial<Options>) | (() => Partial<Options>) | ((new (...args: any[]) => Partial<Options>) | (() => Partial<Options>))[], unknown, unknown, () => {}, boolean>;
92
+ readonly id: StringConstructor;
93
+ readonly size: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
94
+ readonly splitButton: BooleanConstructor;
95
+ readonly hideOnClick: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
96
+ readonly loop: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
97
+ readonly showTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
98
+ readonly hideTimeout: EpPropFinalized<NumberConstructor, unknown, unknown, 150, boolean>;
99
+ readonly tabindex: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, 0, boolean>;
100
+ readonly maxHeight: EpPropFinalized<(new (...args: any[]) => string | number) | (() => string | number) | ((new (...args: any[]) => string | number) | (() => string | number))[], unknown, unknown, "", boolean>;
101
+ readonly popperClass: EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
102
+ readonly disabled: EpPropFinalized<BooleanConstructor, unknown, unknown, false, boolean>;
103
+ readonly role: EpPropFinalized<StringConstructor, unknown, unknown, "menu", boolean>;
104
+ readonly buttonProps: {
105
+ readonly type: PropType<ButtonProps>;
106
+ readonly required: false;
107
+ readonly validator: ((val: unknown) => boolean) | undefined;
108
+ __epPropKey: true;
109
+ };
110
+ readonly teleported: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
111
+ }>>>;
112
+ };
113
+ /**
114
+ * ElButton 组件配置,mode为button时有效
115
+ */
116
+ button: {
117
+ type: PropType<Partial<ButtonProps>>;
118
+ };
119
+ };
120
+ export type ActionBarProps = ComponentPropsType<typeof actionBarProps> & ContainerProps;
121
+ export type ActionBarEmits = {
122
+ click: [action: ActionProps];
123
+ command: [action: ActionProps, menu: ActionMenuItem];
124
+ };
@@ -0,0 +1,147 @@
1
+ import { ContainerDirection, ContainerWrap, ContainerJustifyContent, ContainerAlignItems, ContainerAlignContent } from './types';
2
+ import { DefineComponent, PropType, ComponentOptionsMixin, VNodeProps, AllowedComponentProps, ComponentCustomProps, ExtractPropTypes } from 'vue';
3
+ declare const _default: __VLS_WithTemplateSlots<DefineComponent<{
4
+ tag: {
5
+ type: StringConstructor;
6
+ default: string;
7
+ };
8
+ fit: {
9
+ type: BooleanConstructor;
10
+ default: boolean;
11
+ };
12
+ width: {
13
+ type: (StringConstructor | NumberConstructor)[];
14
+ };
15
+ height: {
16
+ type: (StringConstructor | NumberConstructor)[];
17
+ };
18
+ flex: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ inline: {
23
+ type: BooleanConstructor;
24
+ };
25
+ direction: {
26
+ type: PropType<ContainerDirection>;
27
+ default: string;
28
+ };
29
+ wrap: {
30
+ type: PropType<ContainerWrap>;
31
+ default: string;
32
+ };
33
+ justify: {
34
+ type: PropType<ContainerJustifyContent>;
35
+ default: string;
36
+ };
37
+ align: {
38
+ type: PropType<ContainerAlignItems>;
39
+ default: string;
40
+ };
41
+ alignContent: {
42
+ type: PropType<ContainerAlignContent>;
43
+ default: string;
44
+ };
45
+ grow: {
46
+ type: BooleanConstructor;
47
+ default: boolean;
48
+ };
49
+ shrink: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ alignSelf: {
54
+ type: PropType<"auto" | ContainerAlignItems>;
55
+ default: string;
56
+ };
57
+ overflow: {
58
+ type: PropType<"hidden" | "visible" | "auto">;
59
+ };
60
+ padding: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, VNodeProps & AllowedComponentProps & ComponentCustomProps, Readonly<ExtractPropTypes<{
65
+ tag: {
66
+ type: StringConstructor;
67
+ default: string;
68
+ };
69
+ fit: {
70
+ type: BooleanConstructor;
71
+ default: boolean;
72
+ };
73
+ width: {
74
+ type: (StringConstructor | NumberConstructor)[];
75
+ };
76
+ height: {
77
+ type: (StringConstructor | NumberConstructor)[];
78
+ };
79
+ flex: {
80
+ type: BooleanConstructor;
81
+ default: boolean;
82
+ };
83
+ inline: {
84
+ type: BooleanConstructor;
85
+ };
86
+ direction: {
87
+ type: PropType<ContainerDirection>;
88
+ default: string;
89
+ };
90
+ wrap: {
91
+ type: PropType<ContainerWrap>;
92
+ default: string;
93
+ };
94
+ justify: {
95
+ type: PropType<ContainerJustifyContent>;
96
+ default: string;
97
+ };
98
+ align: {
99
+ type: PropType<ContainerAlignItems>;
100
+ default: string;
101
+ };
102
+ alignContent: {
103
+ type: PropType<ContainerAlignContent>;
104
+ default: string;
105
+ };
106
+ grow: {
107
+ type: BooleanConstructor;
108
+ default: boolean;
109
+ };
110
+ shrink: {
111
+ type: BooleanConstructor;
112
+ default: boolean;
113
+ };
114
+ alignSelf: {
115
+ type: PropType<"auto" | ContainerAlignItems>;
116
+ default: string;
117
+ };
118
+ overflow: {
119
+ type: PropType<"hidden" | "visible" | "auto">;
120
+ };
121
+ padding: {
122
+ type: BooleanConstructor;
123
+ default: boolean;
124
+ };
125
+ }>>, {
126
+ tag: string;
127
+ direction: ContainerDirection;
128
+ wrap: ContainerWrap;
129
+ fit: boolean;
130
+ flex: boolean;
131
+ inline: boolean;
132
+ justify: ContainerJustifyContent;
133
+ align: ContainerAlignItems;
134
+ alignContent: ContainerAlignContent;
135
+ grow: boolean;
136
+ shrink: boolean;
137
+ alignSelf: "auto" | ContainerAlignItems;
138
+ padding: boolean;
139
+ }, {}>, {
140
+ default?(_: {}): any;
141
+ }>;
142
+ export default _default;
143
+ type __VLS_WithTemplateSlots<T, S> = T & {
144
+ new (): {
145
+ $slots: S;
146
+ };
147
+ };
@@ -0,0 +1,3 @@
1
+ import XContainer from "./Container";
2
+ export { XContainer };
3
+ export * from './types';
@@ -0,0 +1,120 @@
1
+ import { PropType } from 'vue';
2
+ import { ComponentPropsType } from '../shared';
3
+ import type Container from "./Container";
4
+ export type ContainerDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse';
5
+ export type ContainerWrap = 'nowrap' | 'wrap' | 'wrap-reverse';
6
+ export type ContainerJustifyContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around';
7
+ export type ContainerAlignItems = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch';
8
+ export type ContainerAlignContent = 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'stretch';
9
+ export declare const containerProps: {
10
+ /**
11
+ * 组件渲染html标签
12
+ */
13
+ tag: {
14
+ type: StringConstructor;
15
+ default: string;
16
+ };
17
+ /**
18
+ * 宽高自适应
19
+ */
20
+ fit: {
21
+ type: BooleanConstructor;
22
+ default: boolean;
23
+ };
24
+ /**
25
+ * 指定高度,fit 为true 失效
26
+ */
27
+ width: {
28
+ type: (StringConstructor | NumberConstructor)[];
29
+ };
30
+ /**
31
+ * 指定高度,fit 为true失效
32
+ */
33
+ height: {
34
+ type: (StringConstructor | NumberConstructor)[];
35
+ };
36
+ /**
37
+ * 开启flex布局
38
+ */
39
+ flex: {
40
+ type: BooleanConstructor;
41
+ default: boolean;
42
+ };
43
+ /**
44
+ * inline-flex
45
+ */
46
+ inline: {
47
+ type: BooleanConstructor;
48
+ };
49
+ /**
50
+ * flex主轴方向
51
+ */
52
+ direction: {
53
+ type: PropType<ContainerDirection>;
54
+ default: string;
55
+ };
56
+ /**
57
+ * 换行
58
+ */
59
+ wrap: {
60
+ type: PropType<ContainerWrap>;
61
+ default: string;
62
+ };
63
+ /**
64
+ * 主轴上的对齐方式。
65
+ */
66
+ justify: {
67
+ type: PropType<ContainerJustifyContent>;
68
+ default: string;
69
+ };
70
+ /**
71
+ * 交叉轴上对齐方式
72
+ */
73
+ align: {
74
+ type: PropType<ContainerAlignItems>;
75
+ default: string;
76
+ };
77
+ /**
78
+ * 多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用
79
+ */
80
+ alignContent: {
81
+ type: PropType<ContainerAlignContent>;
82
+ default: string;
83
+ };
84
+ /**
85
+ * 放大
86
+ */
87
+ grow: {
88
+ type: BooleanConstructor;
89
+ default: boolean;
90
+ };
91
+ /**
92
+ * 缩小
93
+ */
94
+ shrink: {
95
+ type: BooleanConstructor;
96
+ default: boolean;
97
+ };
98
+ /**
99
+ * 单个项目有与其他项目不一样的对齐方式。可覆盖容器的align-items属性
100
+ */
101
+ alignSelf: {
102
+ type: PropType<"auto" | ContainerAlignItems>;
103
+ default: string;
104
+ };
105
+ /**
106
+ * css overflow
107
+ */
108
+ overflow: {
109
+ type: PropType<"hidden" | "visible" | "auto">;
110
+ };
111
+ /**
112
+ * 内边距
113
+ */
114
+ padding: {
115
+ type: BooleanConstructor;
116
+ default: boolean;
117
+ };
118
+ };
119
+ export type ContainerProps = ComponentPropsType<typeof containerProps>;
120
+ export type ContainerInstance = InstanceType<typeof Container>;