@tmagic/editor 1.1.0-beta.7 → 1.1.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 (63) hide show
  1. package/dist/style.css +50 -0
  2. package/dist/tmagic-editor.mjs +1198 -1027
  3. package/dist/tmagic-editor.mjs.map +1 -1
  4. package/dist/tmagic-editor.umd.js +1201 -1026
  5. package/dist/tmagic-editor.umd.js.map +1 -1
  6. package/package.json +10 -10
  7. package/src/Editor.vue +22 -6
  8. package/src/components/ContentMenu.vue +4 -4
  9. package/src/components/Icon.vue +7 -21
  10. package/src/components/ScrollBar.vue +147 -0
  11. package/src/components/ScrollViewer.vue +89 -44
  12. package/src/components/ToolButton.vue +40 -138
  13. package/src/fields/UISelect.vue +2 -2
  14. package/src/index.ts +2 -0
  15. package/src/layouts/NavMenu.vue +156 -23
  16. package/src/layouts/PropsPanel.vue +49 -51
  17. package/src/layouts/sidebar/LayerMenu.vue +3 -3
  18. package/src/layouts/sidebar/LayerPanel.vue +39 -8
  19. package/src/layouts/workspace/PageBar.vue +1 -1
  20. package/src/layouts/workspace/Stage.vue +8 -86
  21. package/src/layouts/workspace/ViewerMenu.vue +10 -13
  22. package/src/layouts/workspace/Workspace.vue +133 -138
  23. package/src/services/componentList.ts +5 -0
  24. package/src/services/editor.ts +201 -112
  25. package/src/services/events.ts +8 -2
  26. package/src/services/props.ts +31 -52
  27. package/src/services/storage.ts +4 -0
  28. package/src/services/ui.ts +32 -30
  29. package/src/theme/component-list-panel.scss +5 -0
  30. package/src/theme/nav-menu.scss +6 -0
  31. package/src/type.ts +28 -11
  32. package/src/utils/editor.ts +17 -10
  33. package/src/utils/index.ts +1 -0
  34. package/src/utils/operator.ts +22 -123
  35. package/src/utils/props.ts +0 -3
  36. package/src/utils/scroll-viewer.ts +90 -158
  37. package/src/utils/stage.ts +91 -0
  38. package/types/Editor.vue.d.ts +17 -8
  39. package/types/components/ContentMenu.vue.d.ts +8 -8
  40. package/types/components/Icon.vue.d.ts +62 -12
  41. package/types/components/ScrollBar.vue.d.ts +83 -0
  42. package/types/components/ScrollViewer.vue.d.ts +131 -19
  43. package/types/components/ToolButton.vue.d.ts +56 -59
  44. package/types/index.d.ts +2 -0
  45. package/types/layouts/NavMenu.vue.d.ts +92 -23
  46. package/types/layouts/PropsPanel.vue.d.ts +25 -208
  47. package/types/layouts/sidebar/LayerMenu.vue.d.ts +7 -7
  48. package/types/layouts/sidebar/LayerPanel.vue.d.ts +17 -15
  49. package/types/layouts/workspace/ViewerMenu.vue.d.ts +3 -3
  50. package/types/layouts/workspace/Workspace.vue.d.ts +54 -4
  51. package/types/services/componentList.d.ts +1 -0
  52. package/types/services/editor.d.ts +10 -17
  53. package/types/services/events.d.ts +1 -0
  54. package/types/services/props.d.ts +41 -9
  55. package/types/services/storage.d.ts +1 -0
  56. package/types/services/ui.d.ts +3 -1
  57. package/types/type.d.ts +25 -11
  58. package/types/utils/editor.d.ts +4 -1
  59. package/types/utils/index.d.ts +1 -0
  60. package/types/utils/operator.d.ts +3 -26
  61. package/types/utils/props.d.ts +0 -1
  62. package/types/utils/scroll-viewer.d.ts +16 -18
  63. package/types/utils/stage.d.ts +3 -0
@@ -1,4 +1,4 @@
1
- import { Keys } from '../type';
1
+ import { EventEmitter } from 'events';
2
2
 
3
3
  interface ScrollViewerOptions {
4
4
  container: HTMLDivElement;
@@ -6,10 +6,7 @@ interface ScrollViewerOptions {
6
6
  zoom: number;
7
7
  }
8
8
 
9
- export class ScrollViewer {
10
- private enter = false;
11
- private targetEnter = false;
12
- private keydown = false;
9
+ export class ScrollViewer extends EventEmitter {
13
10
  private container: HTMLDivElement;
14
11
  private target: HTMLDivElement;
15
12
  private zoom = 1;
@@ -17,200 +14,135 @@ export class ScrollViewer {
17
14
  private scrollLeft = 0;
18
15
  private scrollTop = 0;
19
16
 
20
- private x = 0;
21
- private y = 0;
17
+ private scrollHeight = 0;
18
+ private scrollWidth = 0;
22
19
 
23
- private resizeObserver = new ResizeObserver((entries) => {
24
- for (const { contentRect } of entries) {
25
- const { width, height } = contentRect;
26
- const targetRect = this.target.getBoundingClientRect();
27
- const targetWidth = targetRect.width * this.zoom;
28
- const targetMarginTop = Number(this.target.style.marginTop) || 0;
29
- const targetHeight = (targetRect.height + targetMarginTop) * this.zoom;
20
+ private width = 0;
21
+ private height = 0;
30
22
 
31
- if (targetWidth < width) {
32
- (this.target as any)._left = 0;
33
- }
34
- if (targetHeight < height) {
35
- (this.target as any)._top = 0;
36
- }
23
+ private translateXCorrectionValue = 0;
24
+ private translateYCorrectionValue = 0;
37
25
 
38
- this.scroll();
39
- }
26
+ private resizeObserver = new ResizeObserver(() => {
27
+ this.setSize();
28
+ this.setScrollSize();
40
29
  });
41
30
 
42
31
  constructor(options: ScrollViewerOptions) {
32
+ super();
33
+
43
34
  this.container = options.container;
44
35
  this.target = options.target;
45
36
  this.zoom = options.zoom;
46
37
 
47
- globalThis.addEventListener('keydown', this.keydownHandler);
48
- globalThis.addEventListener('keyup', this.keyupHandler);
49
-
50
- this.container.addEventListener('mouseenter', this.mouseEnterHandler);
51
- this.container.addEventListener('mouseleave', this.mouseLeaveHandler);
52
- this.target.addEventListener('mouseenter', this.targetMouseEnterHandler);
53
- this.target.addEventListener('mouseleave', this.targetMouseLeaveHandler);
54
-
55
- this.container.addEventListener('wheel', this.wheelHandler);
38
+ this.container.addEventListener('wheel', this.wheelHandler, false);
56
39
 
40
+ this.setSize();
41
+ this.setScrollSize();
57
42
  this.resizeObserver.observe(this.container);
58
43
  }
59
44
 
60
45
  public destroy() {
61
46
  this.resizeObserver.disconnect();
62
-
63
- this.container.removeEventListener('mouseenter', this.mouseEnterHandler);
64
- this.container.removeEventListener('mouseleave', this.mouseLeaveHandler);
65
- this.target.removeEventListener('mouseenter', this.targetMouseEnterHandler);
66
- this.target.removeEventListener('mouseleave', this.targetMouseLeaveHandler);
67
- globalThis.removeEventListener('keydown', this.keydownHandler);
68
- globalThis.removeEventListener('keyup', this.keyupHandler);
47
+ this.container.removeEventListener('wheel', this.wheelHandler, false);
48
+ this.removeAllListeners();
69
49
  }
70
50
 
71
51
  public setZoom(zoom: number) {
72
52
  this.zoom = zoom;
53
+ this.setScrollSize();
73
54
  }
74
55
 
75
- private scroll() {
76
- const scrollLeft = (this.target as any)._left;
77
- const scrollTop = (this.target as any)._top;
56
+ public scrollTo({ left, top }: { left?: number; top?: number }) {
57
+ if (typeof left !== 'undefined') {
58
+ this.scrollLeft = left;
59
+ }
78
60
 
79
- this.target.style.transform = `translate(${scrollLeft}px, ${scrollTop}px)`;
80
- }
61
+ if (typeof top !== 'undefined') {
62
+ this.scrollTop = top;
63
+ }
81
64
 
82
- private removeHandler() {
83
- this.target.style.cursor = '';
84
- this.target.removeEventListener('mousedown', this.mousedownHandler);
85
- document.removeEventListener('mousemove', this.mousemoveHandler);
86
- document.removeEventListener('mouseup', this.mouseupHandler);
65
+ const translateX = -this.scrollLeft + this.translateXCorrectionValue;
66
+ const translateY = -this.scrollTop + this.translateYCorrectionValue;
67
+ this.target.style.transform = `translate(${translateX}px, ${translateY}px)`;
87
68
  }
88
69
 
89
70
  private wheelHandler = (event: WheelEvent) => {
90
- if (this.targetEnter) return;
91
-
92
71
  const { deltaX, deltaY, currentTarget } = event;
93
72
 
94
73
  if (currentTarget !== this.container) return;
95
74
 
96
- this.setScrollOffset(deltaX, deltaY);
97
- this.scroll();
98
- this.scrollLeft = (this.target as any)._left;
99
- this.scrollTop = (this.target as any)._top;
100
- };
101
-
102
- private mouseEnterHandler = () => {
103
- this.enter = true;
104
- };
105
-
106
- private mouseLeaveHandler = () => {
107
- this.enter = false;
108
- };
109
-
110
- private targetMouseEnterHandler = () => {
111
- this.targetEnter = true;
112
- };
113
-
114
- private targetMouseLeaveHandler = () => {
115
- this.targetEnter = false;
116
- };
117
-
118
- private mousedownHandler = (event: MouseEvent) => {
119
- if (!this.keydown) return;
120
-
121
- event.stopImmediatePropagation();
122
- event.stopPropagation();
123
-
124
- this.target.style.cursor = 'grabbing';
125
-
126
- this.x = event.clientX;
127
- this.y = event.clientY;
128
-
129
- document.addEventListener('mousemove', this.mousemoveHandler);
130
- document.addEventListener('mouseup', this.mouseupHandler);
131
- };
132
-
133
- private mouseupHandler = () => {
134
- this.x = 0;
135
- this.y = 0;
136
-
137
- this.scrollLeft = (this.target as any)._left;
138
- this.scrollTop = (this.target as any)._top;
139
- this.removeHandler();
140
- };
141
-
142
- private mousemoveHandler = (event: MouseEvent) => {
143
- event.stopImmediatePropagation();
144
- event.stopPropagation();
145
-
146
- const deltaX = event.clientX - this.x;
147
- const deltaY = event.clientY - this.y;
148
-
149
- this.setScrollOffset(deltaX, deltaY);
150
- this.scroll();
151
- };
152
-
153
- private keydownHandler = (event: KeyboardEvent) => {
154
- if (event.code === Keys.ESCAPE && this.enter) {
155
- event.preventDefault();
156
- event.stopImmediatePropagation();
157
- event.stopPropagation();
75
+ let top: number | undefined;
76
+ if (this.scrollHeight > this.height) {
77
+ top = this.scrollTop + this.getPos(deltaY, this.scrollTop, this.scrollHeight, this.height);
158
78
  }
159
79
 
160
- if (event.code !== Keys.ESCAPE || !this.enter || this.keydown) {
161
- return;
80
+ let left: number | undefined;
81
+ if (this.scrollWidth > this.width) {
82
+ left = this.scrollLeft + this.getPos(deltaX, this.scrollLeft, this.scrollWidth, this.width);
162
83
  }
163
84
 
164
- this.keydown = true;
165
-
166
- this.target.style.cursor = 'grab';
167
- this.container.addEventListener('mousedown', this.mousedownHandler);
85
+ this.scrollTo({ left, top });
86
+ this.emit('scroll', {
87
+ scrollLeft: this.scrollLeft,
88
+ scrollTop: this.scrollTop,
89
+ scrollHeight: this.scrollHeight,
90
+ scrollWidth: this.scrollWidth,
91
+ });
168
92
  };
169
93
 
170
- private keyupHandler = (event: KeyboardEvent) => {
171
- if (event.code !== Keys.ESCAPE || !this.keydown) {
172
- return;
94
+ private getPos(delta: number, scrollPos: number, scrollSize: number, size: number) {
95
+ let pos = 0;
96
+ if (delta < 0) {
97
+ if (scrollPos > 0) {
98
+ pos = Math.max(delta, -scrollPos);
99
+ }
100
+ } else {
101
+ const leftPos = scrollSize - size - scrollPos;
102
+ if (leftPos > 0) {
103
+ pos = Math.min(delta, leftPos);
104
+ }
173
105
  }
106
+ return pos;
107
+ }
174
108
 
175
- event.preventDefault();
176
- event.stopImmediatePropagation();
177
- event.stopPropagation();
178
-
179
- this.keydown = false;
180
-
181
- event.preventDefault();
182
-
183
- this.removeHandler();
184
- };
185
-
186
- private setScrollOffset(deltaX: number, deltaY: number) {
187
- const { width, height } = this.container.getBoundingClientRect();
109
+ private setScrollSize = () => {
188
110
  const targetRect = this.target.getBoundingClientRect();
189
-
190
- const targetWidth = targetRect.width * this.zoom;
191
- const targetHeight = targetRect.height * this.zoom;
192
-
193
- let y = 0;
194
-
195
- if (targetHeight > height) {
196
- if (deltaY > 0) {
197
- y = this.scrollTop + Math.min(targetHeight - height - this.scrollTop, deltaY);
198
- } else {
199
- y = this.scrollTop + Math.max(-(targetHeight - height + this.scrollTop), deltaY);
200
- }
111
+ this.scrollWidth = targetRect.width * this.zoom + 100;
112
+ const targetMarginTop = Number(this.target.style.marginTop) || 0;
113
+ this.scrollHeight = (targetRect.height + targetMarginTop) * this.zoom + 100;
114
+
115
+ let left: number | undefined;
116
+ let top: number | undefined;
117
+ if (this.scrollWidth < this.width) {
118
+ left = 0;
119
+ this.translateXCorrectionValue = 0;
120
+ } else {
121
+ this.translateXCorrectionValue = (this.scrollWidth - this.width) / 2;
201
122
  }
202
-
203
- let x = 0;
204
-
205
- if (targetWidth > width) {
206
- if (deltaX > 0) {
207
- x = this.scrollLeft + Math.min(targetWidth - width - this.scrollLeft, deltaX);
208
- } else {
209
- x = this.scrollLeft + Math.max(-(targetWidth - width + this.scrollLeft), deltaX);
210
- }
123
+ if (this.scrollHeight < this.height) {
124
+ top = 0;
125
+ this.translateYCorrectionValue = 0;
126
+ } else {
127
+ this.translateYCorrectionValue = (this.scrollHeight - this.height) / 2;
211
128
  }
212
129
 
213
- (this.target as any)._left = x;
214
- (this.target as any)._top = y;
215
- }
130
+ this.scrollTo({
131
+ left,
132
+ top,
133
+ });
134
+
135
+ this.emit('scroll', {
136
+ scrollLeft: this.scrollLeft,
137
+ scrollTop: this.scrollTop,
138
+ scrollHeight: this.scrollHeight,
139
+ scrollWidth: this.scrollWidth,
140
+ });
141
+ };
142
+
143
+ private setSize = () => {
144
+ const { width, height } = this.container.getBoundingClientRect();
145
+ this.width = width;
146
+ this.height = height;
147
+ };
216
148
  }
@@ -0,0 +1,91 @@
1
+ import { computed } from 'vue';
2
+
3
+ import { MApp, MPage } from '@tmagic/schema';
4
+ import StageCore, { GuidesType, SortEventData, UpdateEventData } from '@tmagic/stage';
5
+
6
+ import editorService from '../services/editor';
7
+ import uiService from '../services/ui';
8
+ import { H_GUIDE_LINE_STORAGE_KEY, StageOptions, V_GUIDE_LINE_STORAGE_KEY } from '../type';
9
+
10
+ import { getGuideLineFromCache } from './editor';
11
+
12
+ const root = computed(() => editorService.get<MApp>('root'));
13
+ const page = computed(() => editorService.get<MPage>('page'));
14
+ const zoom = computed(() => uiService.get<number>('zoom') || 1);
15
+ const uiSelectMode = computed(() => uiService.get<boolean>('uiSelectMode'));
16
+
17
+ const getGuideLineKey = (key: string) => `${key}_${root.value?.id}_${page.value?.id}`;
18
+
19
+ export const useStage = (stageOptions: StageOptions) => {
20
+ const stage = new StageCore({
21
+ render: stageOptions.render,
22
+ runtimeUrl: stageOptions.runtimeUrl,
23
+ zoom: zoom.value,
24
+ autoScrollIntoView: stageOptions.autoScrollIntoView,
25
+ isContainer: stageOptions.isContainer,
26
+ containerHighlightClassName: stageOptions.containerHighlightClassName,
27
+ containerHighlightDuration: stageOptions.containerHighlightDuration,
28
+ containerHighlightType: stageOptions.containerHighlightType,
29
+ canSelect: (el, event, stop) => {
30
+ const elCanSelect = stageOptions.canSelect(el);
31
+ // 在组件联动过程中不能再往下选择,返回并触发 ui-select
32
+ if (uiSelectMode.value && elCanSelect && event.type === 'mousedown') {
33
+ document.dispatchEvent(new CustomEvent('ui-select', { detail: el }));
34
+ return stop();
35
+ }
36
+
37
+ return elCanSelect;
38
+ },
39
+ moveableOptions: stageOptions.moveableOptions,
40
+ updateDragEl: stageOptions.updateDragEl,
41
+ });
42
+
43
+ stage.mask.setGuides([
44
+ getGuideLineFromCache(getGuideLineKey(H_GUIDE_LINE_STORAGE_KEY)),
45
+ getGuideLineFromCache(getGuideLineKey(V_GUIDE_LINE_STORAGE_KEY)),
46
+ ]);
47
+
48
+ stage.on('select', (el: HTMLElement) => {
49
+ editorService.select(el.id);
50
+ });
51
+
52
+ stage.on('highlight', (el: HTMLElement) => {
53
+ editorService.highlight(el.id);
54
+ });
55
+
56
+ stage.on('multiSelect', (els: HTMLElement[]) => {
57
+ editorService.multiSelect(els.map((el) => el.id));
58
+ });
59
+
60
+ stage.on('update', (ev: UpdateEventData) => {
61
+ if (ev.parentEl) {
62
+ for (const data of ev.data) {
63
+ editorService.moveToContainer({ id: data.el.id, style: data.style }, ev.parentEl.id);
64
+ }
65
+ return;
66
+ }
67
+
68
+ editorService.update(ev.data.map((data) => ({ id: data.el.id, style: data.style })));
69
+ });
70
+
71
+ stage.on('sort', (ev: SortEventData) => {
72
+ editorService.sort(ev.src, ev.dist);
73
+ });
74
+
75
+ stage.on('changeGuides', (e) => {
76
+ uiService.set('showGuides', true);
77
+
78
+ if (!root.value || !page.value) return;
79
+
80
+ const storageKey = getGuideLineKey(
81
+ e.type === GuidesType.HORIZONTAL ? H_GUIDE_LINE_STORAGE_KEY : V_GUIDE_LINE_STORAGE_KEY,
82
+ );
83
+ if (e.guides.length) {
84
+ globalThis.localStorage.setItem(storageKey, JSON.stringify(e.guides));
85
+ } else {
86
+ globalThis.localStorage.removeItem(storageKey);
87
+ }
88
+ });
89
+
90
+ return stage;
91
+ };
@@ -2,8 +2,8 @@ import { PropType } from 'vue';
2
2
  import type { FormConfig } from '@tmagic/form';
3
3
  import type { MApp, MNode } from '@tmagic/schema';
4
4
  import type StageCore from '@tmagic/stage';
5
- import { MoveableOptions } from '@tmagic/stage';
6
- import type { ComponentGroup, MenuBarData, MenuItem, Services, SideBarData, StageRect } from './type';
5
+ import { ContainerHighlightType, MoveableOptions } from '@tmagic/stage';
6
+ import type { ComponentGroup, MenuBarData, MenuButton, MenuComponent, Services, SideBarData, StageRect } from './type';
7
7
  declare const _default: import("vue").DefineComponent<{
8
8
  /** 页面初始值 */
9
9
  modelValue: {
@@ -21,11 +21,11 @@ declare const _default: import("vue").DefineComponent<{
21
21
  type: PropType<SideBarData>;
22
22
  };
23
23
  layerContentMenu: {
24
- type: PropType<MenuItem[]>;
24
+ type: PropType<(MenuButton | MenuComponent)[]>;
25
25
  default: () => never[];
26
26
  };
27
27
  stageContentMenu: {
28
- type: PropType<MenuItem[]>;
28
+ type: PropType<(MenuButton | MenuComponent)[]>;
29
29
  default: () => never[];
30
30
  };
31
31
  /** 顶部工具栏配置 */
@@ -83,6 +83,10 @@ declare const _default: import("vue").DefineComponent<{
83
83
  type: NumberConstructor;
84
84
  default: number;
85
85
  };
86
+ containerHighlightType: {
87
+ type: PropType<ContainerHighlightType>;
88
+ default: ContainerHighlightType;
89
+ };
86
90
  stageRect: {
87
91
  type: PropType<StageRect>;
88
92
  };
@@ -110,11 +114,11 @@ declare const _default: import("vue").DefineComponent<{
110
114
  type: PropType<SideBarData>;
111
115
  };
112
116
  layerContentMenu: {
113
- type: PropType<MenuItem[]>;
117
+ type: PropType<(MenuButton | MenuComponent)[]>;
114
118
  default: () => never[];
115
119
  };
116
120
  stageContentMenu: {
117
- type: PropType<MenuItem[]>;
121
+ type: PropType<(MenuButton | MenuComponent)[]>;
118
122
  default: () => never[];
119
123
  };
120
124
  /** 顶部工具栏配置 */
@@ -172,6 +176,10 @@ declare const _default: import("vue").DefineComponent<{
172
176
  type: NumberConstructor;
173
177
  default: number;
174
178
  };
179
+ containerHighlightType: {
180
+ type: PropType<ContainerHighlightType>;
181
+ default: ContainerHighlightType;
182
+ };
175
183
  stageRect: {
176
184
  type: PropType<StageRect>;
177
185
  };
@@ -188,8 +196,8 @@ declare const _default: import("vue").DefineComponent<{
188
196
  }, {
189
197
  menu: MenuBarData;
190
198
  codeOptions: Record<string, any>;
191
- layerContentMenu: MenuItem[];
192
- stageContentMenu: MenuItem[];
199
+ layerContentMenu: (MenuButton | MenuComponent)[];
200
+ stageContentMenu: (MenuButton | MenuComponent)[];
193
201
  modelValue: MApp;
194
202
  componentGroupList: ComponentGroup[];
195
203
  autoScrollIntoView: boolean;
@@ -200,5 +208,6 @@ declare const _default: import("vue").DefineComponent<{
200
208
  isContainer: (el: HTMLElement) => boolean | Promise<boolean>;
201
209
  containerHighlightClassName: string;
202
210
  containerHighlightDuration: number;
211
+ containerHighlightType: ContainerHighlightType;
203
212
  }>;
204
213
  export default _default;
@@ -1,14 +1,14 @@
1
1
  import { nextTick } from 'vue';
2
- import { MenuItem } from '../type';
2
+ import { MenuButton, MenuComponent } from '../type';
3
3
  declare const _default: {
4
4
  new (...args: any[]): {
5
5
  $: import("vue").ComponentInternalInstance;
6
6
  $data: {};
7
7
  $props: Partial<{
8
- menuData: MenuItem[];
8
+ menuData: (MenuButton | MenuComponent)[];
9
9
  isSubMenu: boolean;
10
10
  }> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
11
- menuData?: MenuItem[] | undefined;
11
+ menuData?: (MenuButton | MenuComponent)[] | undefined;
12
12
  isSubMenu?: boolean | undefined;
13
13
  }>, {
14
14
  menuData: () => never[];
@@ -31,7 +31,7 @@ declare const _default: {
31
31
  $emit: (event: "hide" | "show", ...args: any[]) => void;
32
32
  $el: any;
33
33
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
34
- menuData?: MenuItem[] | undefined;
34
+ menuData?: (MenuButton | MenuComponent)[] | undefined;
35
35
  isSubMenu?: boolean | undefined;
36
36
  }>, {
37
37
  menuData: () => never[];
@@ -43,7 +43,7 @@ declare const _default: {
43
43
  hide: () => void;
44
44
  show: (e: MouseEvent) => void;
45
45
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hide" | "show")[], string, {
46
- menuData: MenuItem[];
46
+ menuData: (MenuButton | MenuComponent)[];
47
47
  isSubMenu: boolean;
48
48
  }> & {
49
49
  beforeCreate?: ((() => void) | (() => void)[]) | undefined;
@@ -66,7 +66,7 @@ declare const _default: {
66
66
  $nextTick: typeof nextTick;
67
67
  $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
68
68
  } & Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
69
- menuData?: MenuItem[] | undefined;
69
+ menuData?: (MenuButton | MenuComponent)[] | undefined;
70
70
  isSubMenu?: boolean | undefined;
71
71
  }>, {
72
72
  menuData: () => never[];
@@ -82,7 +82,7 @@ declare const _default: {
82
82
  __isTeleport?: undefined;
83
83
  __isSuspense?: undefined;
84
84
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
85
- menuData?: MenuItem[] | undefined;
85
+ menuData?: (MenuButton | MenuComponent)[] | undefined;
86
86
  isSubMenu?: boolean | undefined;
87
87
  }>, {
88
88
  menuData: () => never[];
@@ -94,7 +94,7 @@ declare const _default: {
94
94
  hide: () => void;
95
95
  show: (e: MouseEvent) => void;
96
96
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("hide" | "show")[], "hide" | "show", {
97
- menuData: MenuItem[];
97
+ menuData: (MenuButton | MenuComponent)[];
98
98
  isSubMenu: boolean;
99
99
  }> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
100
100
  $slots: {};
@@ -1,13 +1,63 @@
1
- import { Component, PropType, toRaw } from 'vue';
2
- declare const _default: import("vue").DefineComponent<{
3
- icon: {
4
- type: PropType<string | Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
5
- };
6
- }, {
7
- toRaw: typeof toRaw;
8
- }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
9
- icon: {
10
- type: PropType<string | Component<any, any, any, import("vue").ComputedOptions, import("vue").MethodOptions>>;
11
- };
12
- }>>, {}>;
1
+ declare const _default: {
2
+ new (...args: any[]): {
3
+ $: import("vue").ComponentInternalInstance;
4
+ $data: {};
5
+ $props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ icon?: any;
7
+ }>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
8
+ $attrs: {
9
+ [x: string]: unknown;
10
+ };
11
+ $refs: {
12
+ [x: string]: unknown;
13
+ };
14
+ $slots: Readonly<{
15
+ [name: string]: import("vue").Slot | undefined;
16
+ }>;
17
+ $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
18
+ $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
19
+ $emit: (event: string, ...args: any[]) => void;
20
+ $el: any;
21
+ $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
22
+ icon?: any;
23
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
24
+ beforeCreate?: ((() => void) | (() => void)[]) | undefined;
25
+ created?: ((() => void) | (() => void)[]) | undefined;
26
+ beforeMount?: ((() => void) | (() => void)[]) | undefined;
27
+ mounted?: ((() => void) | (() => void)[]) | undefined;
28
+ beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
29
+ updated?: ((() => void) | (() => void)[]) | undefined;
30
+ activated?: ((() => void) | (() => void)[]) | undefined;
31
+ deactivated?: ((() => void) | (() => void)[]) | undefined;
32
+ beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
33
+ beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
34
+ destroyed?: ((() => void) | (() => void)[]) | undefined;
35
+ unmounted?: ((() => void) | (() => void)[]) | undefined;
36
+ renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
37
+ renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
38
+ errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
39
+ };
40
+ $forceUpdate: () => void;
41
+ $nextTick: typeof import("vue").nextTick;
42
+ $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
43
+ } & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
44
+ icon?: any;
45
+ }>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
46
+ __isFragment?: undefined;
47
+ __isTeleport?: undefined;
48
+ __isSuspense?: undefined;
49
+ } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
50
+ icon?: any;
51
+ }>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
52
+ $slots: {};
53
+ });
13
54
  export default _default;
55
+ declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
56
+ declare type __VLS_TypePropsToRuntimeProps<T> = {
57
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
58
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
59
+ } : {
60
+ type: import('vue').PropType<T[K]>;
61
+ required: true;
62
+ };
63
+ };