@tmagic/editor 1.1.0-beta.9 → 1.1.2
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/dist/style.css +53 -4
- package/dist/tmagic-editor.mjs +1134 -928
- package/dist/tmagic-editor.mjs.map +1 -1
- package/dist/tmagic-editor.umd.js +1138 -929
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/package.json +10 -10
- package/src/Editor.vue +28 -8
- package/src/components/ContentMenu.vue +4 -4
- package/src/components/Icon.vue +11 -23
- package/src/components/ScrollBar.vue +147 -0
- package/src/components/ScrollViewer.vue +89 -44
- package/src/components/ToolButton.vue +40 -138
- package/src/fields/UISelect.vue +2 -2
- package/src/index.ts +2 -2
- package/src/layouts/NavMenu.vue +156 -23
- package/src/layouts/PropsPanel.vue +49 -51
- package/src/layouts/sidebar/ComponentListPanel.vue +78 -90
- package/src/layouts/sidebar/LayerMenu.vue +3 -3
- package/src/layouts/sidebar/LayerPanel.vue +39 -8
- package/src/layouts/sidebar/Sidebar.vue +4 -0
- package/src/layouts/sidebar/TabPane.vue +12 -0
- package/src/layouts/workspace/PageBar.vue +2 -2
- package/src/layouts/workspace/PageBarScrollContainer.vue +13 -3
- package/src/layouts/workspace/Stage.vue +10 -92
- package/src/layouts/workspace/ViewerMenu.vue +3 -3
- package/src/layouts/workspace/Workspace.vue +133 -138
- package/src/services/componentList.ts +5 -0
- package/src/services/editor.ts +57 -20
- package/src/services/events.ts +8 -2
- package/src/services/props.ts +31 -52
- package/src/services/storage.ts +4 -0
- package/src/services/ui.ts +33 -30
- package/src/theme/component-list-panel.scss +0 -5
- package/src/theme/content-menu.scss +4 -0
- package/src/theme/icon.scss +6 -0
- package/src/theme/index.scss +1 -0
- package/src/theme/nav-menu.scss +6 -0
- package/src/type.ts +28 -10
- package/src/utils/index.ts +1 -0
- package/src/utils/operator.ts +3 -3
- package/src/utils/props.ts +0 -3
- package/src/utils/scroll-viewer.ts +90 -158
- package/src/utils/stage.ts +91 -0
- package/types/Editor.vue.d.ts +7 -7
- package/types/components/ContentMenu.vue.d.ts +8 -8
- package/types/components/Icon.vue.d.ts +62 -12
- package/types/components/ScrollBar.vue.d.ts +83 -0
- package/types/components/ScrollViewer.vue.d.ts +131 -19
- package/types/components/ToolButton.vue.d.ts +56 -59
- package/types/index.d.ts +2 -1
- package/types/layouts/NavMenu.vue.d.ts +92 -23
- package/types/layouts/PropsPanel.vue.d.ts +25 -208
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +50 -12
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +7 -7
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +17 -15
- package/types/layouts/workspace/Workspace.vue.d.ts +54 -4
- package/types/services/componentList.d.ts +1 -0
- package/types/services/editor.d.ts +1 -0
- package/types/services/events.d.ts +1 -0
- package/types/services/props.d.ts +41 -9
- package/types/services/storage.d.ts +1 -0
- package/types/services/ui.d.ts +4 -1
- package/types/type.d.ts +25 -10
- package/types/utils/index.d.ts +1 -0
- package/types/utils/operator.d.ts +1 -1
- package/types/utils/props.d.ts +0 -1
- package/types/utils/scroll-viewer.d.ts +16 -18
- package/types/utils/stage.d.ts +3 -0
- package/src/utils/polyfills.ts +0 -8
- package/types/utils/polyfills.d.ts +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
|
|
21
|
-
private
|
|
17
|
+
private scrollHeight = 0;
|
|
18
|
+
private scrollWidth = 0;
|
|
22
19
|
|
|
23
|
-
private
|
|
24
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
if (targetHeight < height) {
|
|
35
|
-
(this.target as any)._top = 0;
|
|
36
|
-
}
|
|
23
|
+
private translateXCorrectionValue = 0;
|
|
24
|
+
private translateYCorrectionValue = 0;
|
|
37
25
|
|
|
38
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
56
|
+
public scrollTo({ left, top }: { left?: number; top?: number }) {
|
|
57
|
+
if (typeof left !== 'undefined') {
|
|
58
|
+
this.scrollLeft = left;
|
|
59
|
+
}
|
|
78
60
|
|
|
79
|
-
|
|
80
|
-
|
|
61
|
+
if (typeof top !== 'undefined') {
|
|
62
|
+
this.scrollTop = top;
|
|
63
|
+
}
|
|
81
64
|
|
|
82
|
-
|
|
83
|
-
this.
|
|
84
|
-
this.target.
|
|
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
|
-
|
|
97
|
-
this.
|
|
98
|
-
|
|
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
|
-
|
|
161
|
-
|
|
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.
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
|
171
|
-
|
|
172
|
-
|
|
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
|
-
|
|
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
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
if (
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
214
|
-
|
|
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
|
+
};
|
package/types/Editor.vue.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { FormConfig } from '@tmagic/form';
|
|
|
3
3
|
import type { MApp, MNode } from '@tmagic/schema';
|
|
4
4
|
import type StageCore from '@tmagic/stage';
|
|
5
5
|
import { ContainerHighlightType, MoveableOptions } from '@tmagic/stage';
|
|
6
|
-
import type { ComponentGroup, MenuBarData,
|
|
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<
|
|
24
|
+
type: PropType<(MenuButton | MenuComponent)[]>;
|
|
25
25
|
default: () => never[];
|
|
26
26
|
};
|
|
27
27
|
stageContentMenu: {
|
|
28
|
-
type: PropType<
|
|
28
|
+
type: PropType<(MenuButton | MenuComponent)[]>;
|
|
29
29
|
default: () => never[];
|
|
30
30
|
};
|
|
31
31
|
/** 顶部工具栏配置 */
|
|
@@ -114,11 +114,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
114
|
type: PropType<SideBarData>;
|
|
115
115
|
};
|
|
116
116
|
layerContentMenu: {
|
|
117
|
-
type: PropType<
|
|
117
|
+
type: PropType<(MenuButton | MenuComponent)[]>;
|
|
118
118
|
default: () => never[];
|
|
119
119
|
};
|
|
120
120
|
stageContentMenu: {
|
|
121
|
-
type: PropType<
|
|
121
|
+
type: PropType<(MenuButton | MenuComponent)[]>;
|
|
122
122
|
default: () => never[];
|
|
123
123
|
};
|
|
124
124
|
/** 顶部工具栏配置 */
|
|
@@ -196,9 +196,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
196
196
|
}, {
|
|
197
197
|
menu: MenuBarData;
|
|
198
198
|
codeOptions: Record<string, any>;
|
|
199
|
-
layerContentMenu: MenuItem[];
|
|
200
|
-
stageContentMenu: MenuItem[];
|
|
201
199
|
modelValue: MApp;
|
|
200
|
+
layerContentMenu: (MenuButton | MenuComponent)[];
|
|
201
|
+
stageContentMenu: (MenuButton | MenuComponent)[];
|
|
202
202
|
componentGroupList: ComponentGroup[];
|
|
203
203
|
autoScrollIntoView: boolean;
|
|
204
204
|
propsConfigs: Record<string, FormConfig>;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { nextTick } from 'vue';
|
|
2
|
-
import {
|
|
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:
|
|
8
|
+
menuData: (MenuButton | MenuComponent)[];
|
|
9
9
|
isSubMenu: boolean;
|
|
10
10
|
}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
-
menuData?:
|
|
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?:
|
|
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:
|
|
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?:
|
|
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?:
|
|
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:
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
size: number;
|
|
7
|
+
scrollSize: number;
|
|
8
|
+
isHorizontal?: boolean | undefined;
|
|
9
|
+
pos: number;
|
|
10
|
+
}>>> & {
|
|
11
|
+
onScroll?: ((...args: any[]) => any) | undefined;
|
|
12
|
+
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
13
|
+
$attrs: {
|
|
14
|
+
[x: string]: unknown;
|
|
15
|
+
};
|
|
16
|
+
$refs: {
|
|
17
|
+
[x: string]: unknown;
|
|
18
|
+
};
|
|
19
|
+
$slots: Readonly<{
|
|
20
|
+
[name: string]: import("vue").Slot | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
23
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
24
|
+
$emit: (event: "scroll", ...args: any[]) => void;
|
|
25
|
+
$el: any;
|
|
26
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
27
|
+
size: number;
|
|
28
|
+
scrollSize: number;
|
|
29
|
+
isHorizontal?: boolean | undefined;
|
|
30
|
+
pos: number;
|
|
31
|
+
}>>> & {
|
|
32
|
+
onScroll?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "scroll"[], string, {}> & {
|
|
34
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
35
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
36
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
37
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
38
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
39
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
40
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
41
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
42
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
43
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
44
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
45
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
46
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
47
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
48
|
+
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;
|
|
49
|
+
};
|
|
50
|
+
$forceUpdate: () => void;
|
|
51
|
+
$nextTick: typeof import("vue").nextTick;
|
|
52
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
53
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
54
|
+
size: number;
|
|
55
|
+
scrollSize: number;
|
|
56
|
+
isHorizontal?: boolean | undefined;
|
|
57
|
+
pos: number;
|
|
58
|
+
}>>> & {
|
|
59
|
+
onScroll?: ((...args: any[]) => any) | undefined;
|
|
60
|
+
} & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
61
|
+
__isFragment?: undefined;
|
|
62
|
+
__isTeleport?: undefined;
|
|
63
|
+
__isSuspense?: undefined;
|
|
64
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
65
|
+
size: number;
|
|
66
|
+
scrollSize: number;
|
|
67
|
+
isHorizontal?: boolean | undefined;
|
|
68
|
+
pos: number;
|
|
69
|
+
}>>> & {
|
|
70
|
+
onScroll?: ((...args: any[]) => any) | undefined;
|
|
71
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "scroll"[], "scroll", {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
72
|
+
$slots: {};
|
|
73
|
+
});
|
|
74
|
+
export default _default;
|
|
75
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
76
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
77
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
78
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
79
|
+
} : {
|
|
80
|
+
type: import('vue').PropType<T[K]>;
|
|
81
|
+
required: true;
|
|
82
|
+
};
|
|
83
|
+
};
|