@tmagic/editor 1.3.0-beta.0 → 1.3.0-beta.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 +30 -2
- package/dist/tmagic-editor.js +1053 -647
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +1071 -665
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +10 -10
- package/src/components/CodeBlockEditor.vue +15 -6
- package/src/components/ContentMenu.vue +88 -42
- package/src/components/Resizer.vue +8 -30
- package/src/components/SplitView.vue +3 -2
- package/src/components/ToolButton.vue +1 -1
- package/src/fields/DataSourceFields.vue +10 -0
- package/src/fields/DataSourceMethods.vue +1 -0
- package/src/fields/EventSelect.vue +15 -3
- package/src/hooks/use-getso.ts +35 -0
- package/src/icons/PinIcon.vue +25 -0
- package/src/icons/PinnedIcon.vue +25 -0
- package/src/index.ts +2 -0
- package/src/layouts/workspace/Workspace.vue +1 -1
- package/src/layouts/workspace/viewer/NodeListMenu.vue +166 -0
- package/src/layouts/workspace/viewer/NodeListMenuTitle.vue +68 -0
- package/src/layouts/workspace/{Stage.vue → viewer/Stage.vue} +2 -0
- package/src/layouts/workspace/{ViewerMenu.vue → viewer/ViewerMenu.vue} +1 -1
- package/src/services/dataSource.ts +11 -0
- package/src/theme/content-menu.scss +29 -3
- package/src/theme/index.scss +8 -0
- package/src/type.ts +3 -0
- package/src/utils/data-source/formConfigs/http.ts +9 -0
- package/src/utils/data-source/index.ts +12 -0
- package/src/utils/props.ts +21 -10
- package/types/components/CodeBlockEditor.vue.d.ts +2 -0
- package/types/components/ContentMenu.vue.d.ts +27 -8
- package/types/components/Resizer.vue.d.ts +1 -3
- package/types/hooks/use-code-block-edit.d.ts +7 -0
- package/types/hooks/use-data-source-method.d.ts +7 -0
- package/types/hooks/use-getso.d.ts +5 -0
- package/types/icons/PinIcon.vue.d.ts +2 -0
- package/types/icons/PinnedIcon.vue.d.ts +2 -0
- package/types/index.d.ts +1 -0
- package/types/layouts/PropsPanel.vue.d.ts +1 -1
- package/types/layouts/workspace/viewer/NodeListMenu.vue.d.ts +15 -0
- package/types/layouts/workspace/viewer/NodeListMenuTitle.vue.d.ts +15 -0
- package/types/layouts/workspace/{Stage.vue.d.ts → viewer/Stage.vue.d.ts} +1 -1
- package/types/layouts/workspace/{ViewerMenu.vue.d.ts → viewer/ViewerMenu.vue.d.ts} +1 -1
- package/types/services/dataSource.d.ts +4 -0
- package/types/type.d.ts +3 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ContentMenu
|
|
3
|
+
ref="menu"
|
|
4
|
+
class="magic-editor-node-list-menu"
|
|
5
|
+
style="max-width: 280px"
|
|
6
|
+
:menu-data="menuData"
|
|
7
|
+
:active="node?.id"
|
|
8
|
+
:auto-hide="!pinned"
|
|
9
|
+
@mouseenter="mouseenterHandler()"
|
|
10
|
+
>
|
|
11
|
+
<template #title>
|
|
12
|
+
<NodeListMenuTitle v-model:pinned="pinned" @change="dragMenuHandler" @close="closeHandler"></NodeListMenuTitle>
|
|
13
|
+
</template>
|
|
14
|
+
</ContentMenu>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script lang="ts" setup>
|
|
18
|
+
import { Component, computed, inject, ref, watch } from 'vue';
|
|
19
|
+
import type { OnDrag } from 'gesto';
|
|
20
|
+
|
|
21
|
+
import type { MNode } from '@tmagic/schema';
|
|
22
|
+
import { StageDragStatus } from '@tmagic/stage';
|
|
23
|
+
import { getNodes } from '@tmagic/utils';
|
|
24
|
+
|
|
25
|
+
import ContentMenu from '@editor/components/ContentMenu.vue';
|
|
26
|
+
import type { ComponentItem, MenuButton, Services } from '@editor/type';
|
|
27
|
+
|
|
28
|
+
import NodeListMenuTitle from './NodeListMenuTitle.vue';
|
|
29
|
+
const props = defineProps<{ isMultiSelect?: boolean }>();
|
|
30
|
+
|
|
31
|
+
const menu = ref<InstanceType<typeof ContentMenu>>();
|
|
32
|
+
const nodeList = ref<MNode[]>([]);
|
|
33
|
+
const pinned = ref(false);
|
|
34
|
+
|
|
35
|
+
const services = inject<Services>('services');
|
|
36
|
+
const editorService = services?.editorService;
|
|
37
|
+
const componentListService = services?.componentListService;
|
|
38
|
+
|
|
39
|
+
const stage = computed(() => editorService?.get('stage'));
|
|
40
|
+
const page = computed(() => editorService?.get('page'));
|
|
41
|
+
const node = computed(() => editorService?.get('node'));
|
|
42
|
+
|
|
43
|
+
let timeout: NodeJS.Timeout | null = null;
|
|
44
|
+
|
|
45
|
+
const cancel = () => {
|
|
46
|
+
if (timeout) {
|
|
47
|
+
globalThis.clearTimeout(timeout);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (pinned.value) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
nodeList.value = [];
|
|
55
|
+
menu.value?.hide();
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const clearTimeoutLazy = () => {
|
|
59
|
+
globalThis.setTimeout(() => {
|
|
60
|
+
if (timeout) {
|
|
61
|
+
globalThis.clearTimeout(timeout);
|
|
62
|
+
}
|
|
63
|
+
}, 300);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const unWatch = watch(
|
|
67
|
+
stage,
|
|
68
|
+
(stage) => {
|
|
69
|
+
if (!stage) return;
|
|
70
|
+
|
|
71
|
+
stage.on('drag-start', () => {
|
|
72
|
+
cancel();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
stage.on('mousemove', (event: MouseEvent) => {
|
|
76
|
+
cancel();
|
|
77
|
+
|
|
78
|
+
if (props.isMultiSelect || stage.getDragStatus() !== StageDragStatus.END) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
timeout = globalThis.setTimeout(() => {
|
|
83
|
+
const els = stage?.renderer.getElementsFromPoint(event);
|
|
84
|
+
|
|
85
|
+
const nodes = getNodes(
|
|
86
|
+
els.map((el) => el.id),
|
|
87
|
+
page.value?.items,
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
if (pinned.value && nodes.length === 0) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
nodeList.value = nodes;
|
|
95
|
+
|
|
96
|
+
if (nodeList.value.length > 1) {
|
|
97
|
+
menu.value?.show(pinned.value ? undefined : event);
|
|
98
|
+
}
|
|
99
|
+
}, 1500);
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
stage.on('mouseleave', () => {
|
|
103
|
+
// mouseleave后,大概率还有最后一个mousemove事件,这里延迟清除
|
|
104
|
+
clearTimeoutLazy();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
unWatch();
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
immediate: true,
|
|
111
|
+
},
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const componentMap = computed(() => {
|
|
115
|
+
const map: Record<string, ComponentItem> = {};
|
|
116
|
+
componentListService?.getList().forEach((group) => {
|
|
117
|
+
group.items.forEach((item) => {
|
|
118
|
+
map[item.type] = item;
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
return map;
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const menuData = computed<MenuButton[]>(() =>
|
|
125
|
+
nodeList.value.map((node: MNode) => {
|
|
126
|
+
let text = node.name;
|
|
127
|
+
let icon: string | Component<{}, {}, any> | undefined;
|
|
128
|
+
if (node.type) {
|
|
129
|
+
const item = componentMap.value[node.type];
|
|
130
|
+
text += ` (${item?.text})`;
|
|
131
|
+
icon = item?.icon;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
type: 'button',
|
|
136
|
+
text,
|
|
137
|
+
id: node.id,
|
|
138
|
+
icon,
|
|
139
|
+
handler: async () => {
|
|
140
|
+
await editorService?.select(node);
|
|
141
|
+
stage.value?.select(node.id);
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
}),
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const mouseenterHandler = () => {
|
|
148
|
+
// menu的mouseenter后,大概率还有最后一个mousemove事件,这里延迟清除
|
|
149
|
+
clearTimeoutLazy();
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const dragMenuHandler = ({ deltaY, deltaX }: OnDrag) => {
|
|
153
|
+
if (!menu.value) return;
|
|
154
|
+
|
|
155
|
+
const { menuPosition } = menu.value;
|
|
156
|
+
|
|
157
|
+
menu.value?.setPosition({
|
|
158
|
+
clientY: menuPosition.top + deltaY,
|
|
159
|
+
clientX: menuPosition.left + deltaX,
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const closeHandler = () => {
|
|
164
|
+
menu.value?.hide();
|
|
165
|
+
};
|
|
166
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
style="
|
|
4
|
+
text-align: center;
|
|
5
|
+
padding: 5px 0;
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
cursor: move;
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
align-items: center;
|
|
11
|
+
"
|
|
12
|
+
ref="target"
|
|
13
|
+
>
|
|
14
|
+
<TMagicTooltip placement="top" :content="pinned ? '取消置于顶层自动隐藏' : '置于顶层不消失'">
|
|
15
|
+
<MIcon
|
|
16
|
+
style="margin-left: 10px; cursor: pointer"
|
|
17
|
+
:icon="pinned ? PinnedIcon : PinIcon"
|
|
18
|
+
@click="pinHandler"
|
|
19
|
+
></MIcon>
|
|
20
|
+
</TMagicTooltip>
|
|
21
|
+
|
|
22
|
+
<span>可选组件</span>
|
|
23
|
+
|
|
24
|
+
<div style="margin-right: 10px">
|
|
25
|
+
<TMagicButton text size="small" @click="closeHandler">
|
|
26
|
+
<MIcon :icon="Close"></MIcon>
|
|
27
|
+
</TMagicButton>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import { ref } from 'vue';
|
|
34
|
+
import { Close } from '@element-plus/icons-vue';
|
|
35
|
+
import type { OnDrag } from 'gesto';
|
|
36
|
+
|
|
37
|
+
import { TMagicButton, TMagicTooltip } from '@tmagic/design';
|
|
38
|
+
|
|
39
|
+
import MIcon from '@editor/components/Icon.vue';
|
|
40
|
+
import { useGetSo } from '@editor/hooks/use-getso';
|
|
41
|
+
import PinIcon from '@editor/icons/PinIcon.vue';
|
|
42
|
+
import PinnedIcon from '@editor/icons/PinnedIcon.vue';
|
|
43
|
+
|
|
44
|
+
defineOptions({
|
|
45
|
+
name: 'MEditorNodeListMenuTitle',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const props = defineProps<{
|
|
49
|
+
pinned: boolean;
|
|
50
|
+
}>();
|
|
51
|
+
|
|
52
|
+
const emit = defineEmits<{
|
|
53
|
+
close: [];
|
|
54
|
+
'update:pinned': [pinned: boolean];
|
|
55
|
+
change: [e: OnDrag];
|
|
56
|
+
}>();
|
|
57
|
+
|
|
58
|
+
const pinHandler = () => {
|
|
59
|
+
emit('update:pinned', !props.pinned);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const closeHandler = () => {
|
|
63
|
+
emit('close');
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const target = ref<HTMLDivElement>();
|
|
67
|
+
useGetSo(target, emit);
|
|
68
|
+
</script>
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
></div>
|
|
25
25
|
<Teleport to="body">
|
|
26
26
|
<ViewerMenu ref="menu" :is-multi-select="isMultiSelect" :stage-content-menu="stageContentMenu"></ViewerMenu>
|
|
27
|
+
<NodeListMenu ref="nodeList" :is-multi-select="isMultiSelect"></NodeListMenu>
|
|
27
28
|
</Teleport>
|
|
28
29
|
</ScrollViewer>
|
|
29
30
|
</template>
|
|
@@ -40,6 +41,7 @@ import { useStage } from '@editor/hooks/use-stage';
|
|
|
40
41
|
import { Layout, MenuButton, MenuComponent, Services, StageOptions } from '@editor/type';
|
|
41
42
|
import { getConfig } from '@editor/utils/config';
|
|
42
43
|
|
|
44
|
+
import NodeListMenu from './NodeListMenu.vue';
|
|
43
45
|
import ViewerMenu from './ViewerMenu.vue';
|
|
44
46
|
|
|
45
47
|
defineOptions({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { reactive } from 'vue';
|
|
2
2
|
import { cloneDeep } from 'lodash-es';
|
|
3
3
|
|
|
4
|
+
import type { EventOption } from '@tmagic/core';
|
|
4
5
|
import type { FormConfig } from '@tmagic/form';
|
|
5
6
|
import type { DataSourceSchema } from '@tmagic/schema';
|
|
6
7
|
import { guid } from '@tmagic/utils';
|
|
@@ -16,6 +17,7 @@ interface State {
|
|
|
16
17
|
editable: boolean;
|
|
17
18
|
configs: Record<string, FormConfig>;
|
|
18
19
|
values: Record<string, Partial<DataSourceSchema>>;
|
|
20
|
+
events: Record<string, EventOption[]>;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
type StateKey = keyof State;
|
|
@@ -26,6 +28,7 @@ class DataSource extends BaseService {
|
|
|
26
28
|
editable: true,
|
|
27
29
|
configs: {},
|
|
28
30
|
values: {},
|
|
31
|
+
events: {},
|
|
29
32
|
});
|
|
30
33
|
|
|
31
34
|
public set<K extends StateKey, T extends State[K]>(name: K, value: T) {
|
|
@@ -52,6 +55,14 @@ class DataSource extends BaseService {
|
|
|
52
55
|
this.get('values')[type] = value;
|
|
53
56
|
}
|
|
54
57
|
|
|
58
|
+
public getFormEvent(type = 'base') {
|
|
59
|
+
return this.get('events')[type] || [];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
public setFormEvent(type: string, value: EventOption[] = []) {
|
|
63
|
+
this.get('events')[type] = value;
|
|
64
|
+
}
|
|
65
|
+
|
|
55
66
|
public add(config: DataSourceSchema) {
|
|
56
67
|
const newConfig = {
|
|
57
68
|
...config,
|
|
@@ -3,12 +3,13 @@
|
|
|
3
3
|
font-size: 12px;
|
|
4
4
|
background: #fff;
|
|
5
5
|
box-shadow: 0 2px 8px 2px rgba(68, 73, 77, 0.16);
|
|
6
|
-
z-index:
|
|
6
|
+
z-index: 1000;
|
|
7
7
|
transform-origin: 0% 0%;
|
|
8
8
|
font-weight: 600;
|
|
9
9
|
padding: 4px 0px;
|
|
10
10
|
overflow: auto;
|
|
11
11
|
max-height: 80%;
|
|
12
|
+
min-width: 180px;
|
|
12
13
|
|
|
13
14
|
.menu-item {
|
|
14
15
|
color: #333;
|
|
@@ -43,8 +44,33 @@
|
|
|
43
44
|
}
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
&.button {
|
|
48
|
+
&:hover {
|
|
49
|
+
background-color: $--hover-color;
|
|
50
|
+
.tmagic-design-button,
|
|
51
|
+
.tmagic-design-button:active,
|
|
52
|
+
.tmagic-design-button:focus {
|
|
53
|
+
color: $--font-color;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&.menu-item i {
|
|
57
|
+
color: $--font-color;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.active {
|
|
62
|
+
background-color: $--theme-color;
|
|
63
|
+
.tmagic-design-button,
|
|
64
|
+
.tmagic-design-button:active,
|
|
65
|
+
.tmagic-design-button:focus {
|
|
66
|
+
color: #fff;
|
|
67
|
+
background-color: transparent;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
&.menu-item i {
|
|
71
|
+
color: #fff;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
48
74
|
}
|
|
49
75
|
}
|
|
50
76
|
}
|
package/src/theme/index.scss
CHANGED
package/src/type.ts
CHANGED
|
@@ -201,6 +201,8 @@ export interface MenuButton {
|
|
|
201
201
|
className?: string;
|
|
202
202
|
/** type为dropdown时,下拉的菜单列表, 或者有子菜单时 */
|
|
203
203
|
items?: MenuButton[];
|
|
204
|
+
/** 唯一标识,用于高亮 */
|
|
205
|
+
id?: string | number;
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
export interface MenuComponent {
|
|
@@ -416,6 +418,7 @@ export interface HistoryState {
|
|
|
416
418
|
export interface EventSelectConfig {
|
|
417
419
|
name: string;
|
|
418
420
|
type: 'event-select';
|
|
421
|
+
src: 'datasource' | 'component';
|
|
419
422
|
/** 事件名称表单配置 */
|
|
420
423
|
eventNameConfig?: FormItem;
|
|
421
424
|
/** 动作类型配置 */
|
|
@@ -29,6 +29,18 @@ const fillConfig = (config: FormConfig): FormConfig => [
|
|
|
29
29
|
},
|
|
30
30
|
],
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
type: 'panel',
|
|
34
|
+
title: '事件配置',
|
|
35
|
+
display: false,
|
|
36
|
+
items: [
|
|
37
|
+
{
|
|
38
|
+
name: 'events',
|
|
39
|
+
src: 'datasource',
|
|
40
|
+
type: 'event-select',
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
},
|
|
32
44
|
];
|
|
33
45
|
|
|
34
46
|
export const getFormConfig = (type: string, configs: Record<string, FormConfig>): FormConfig => {
|
package/src/utils/props.ts
CHANGED
|
@@ -205,6 +205,7 @@ export const eventTabConfig: TabPaneConfig = {
|
|
|
205
205
|
items: [
|
|
206
206
|
{
|
|
207
207
|
name: 'events',
|
|
208
|
+
src: 'component',
|
|
208
209
|
type: 'event-select',
|
|
209
210
|
},
|
|
210
211
|
],
|
|
@@ -248,7 +249,7 @@ export const displayTabConfig: TabPaneConfig = {
|
|
|
248
249
|
},
|
|
249
250
|
{
|
|
250
251
|
type: 'select',
|
|
251
|
-
options: (mForm
|
|
252
|
+
options: (mForm, { model }) => {
|
|
252
253
|
const [id, field] = model.field;
|
|
253
254
|
|
|
254
255
|
const ds = dataSourceService.getDataSourceById(id);
|
|
@@ -284,23 +285,33 @@ export const displayTabConfig: TabPaneConfig = {
|
|
|
284
285
|
items: [
|
|
285
286
|
{
|
|
286
287
|
name: 'value',
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
288
|
+
type: (mForm, { model }) => {
|
|
289
|
+
const [id, field] = model.field;
|
|
290
|
+
|
|
291
|
+
const ds = dataSourceService.getDataSourceById(id);
|
|
292
|
+
|
|
293
|
+
const type = ds?.fields.find((f) => f.name === field)?.type;
|
|
294
|
+
|
|
295
|
+
if (type === 'number') {
|
|
296
|
+
return 'number';
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (type === 'boolean') {
|
|
300
|
+
return 'select';
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return 'text';
|
|
304
|
+
},
|
|
293
305
|
options: [
|
|
294
306
|
{ text: 'true', value: true },
|
|
295
307
|
{ text: 'false', value: false },
|
|
296
308
|
],
|
|
297
|
-
display: (vm
|
|
309
|
+
display: (vm, { model }) => !['between', 'not_between'].includes(model.op),
|
|
298
310
|
},
|
|
299
311
|
{
|
|
300
312
|
name: 'range',
|
|
301
313
|
type: 'number-range',
|
|
302
|
-
display: (vm
|
|
303
|
-
['between', 'not_between'].includes(model.op) && !['is', 'not'].includes(model.op),
|
|
314
|
+
display: (vm, { model }) => ['between', 'not_between'].includes(model.op),
|
|
304
315
|
},
|
|
305
316
|
],
|
|
306
317
|
},
|
|
@@ -3,6 +3,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
3
3
|
content: CodeBlockContent;
|
|
4
4
|
disabled?: boolean | undefined;
|
|
5
5
|
isDataSource?: boolean | undefined;
|
|
6
|
+
dataSourceType?: string | undefined;
|
|
6
7
|
}>, {
|
|
7
8
|
show(): void;
|
|
8
9
|
hide(): void;
|
|
@@ -10,6 +11,7 @@ declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimePr
|
|
|
10
11
|
content: CodeBlockContent;
|
|
11
12
|
disabled?: boolean | undefined;
|
|
12
13
|
isDataSource?: boolean | undefined;
|
|
14
|
+
dataSourceType?: string | undefined;
|
|
13
15
|
}>>>, {}, {}>;
|
|
14
16
|
export default _default;
|
|
15
17
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,28 +1,42 @@
|
|
|
1
1
|
import { MenuButton, MenuComponent } from '../type';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
4
4
|
isSubMenu?: boolean | undefined;
|
|
5
|
+
active?: string | number | undefined;
|
|
6
|
+
autoHide?: boolean | undefined;
|
|
5
7
|
}>, {
|
|
6
8
|
menuData: () => never[];
|
|
7
9
|
isSubMenu: boolean;
|
|
10
|
+
autoHide: boolean;
|
|
8
11
|
}>, {
|
|
9
12
|
menu: import("vue").Ref<HTMLDivElement | undefined>;
|
|
13
|
+
menuPosition: import("vue").Ref<{
|
|
14
|
+
left: number;
|
|
15
|
+
top: number;
|
|
16
|
+
}>;
|
|
10
17
|
hide: () => void;
|
|
11
|
-
show: (e
|
|
18
|
+
show: (e?: MouseEvent | undefined) => void;
|
|
12
19
|
contains: (el: HTMLElement) => any;
|
|
13
|
-
|
|
20
|
+
setPosition: (e: {
|
|
21
|
+
clientY: number;
|
|
22
|
+
clientX: number;
|
|
23
|
+
}) => void;
|
|
24
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
25
|
menuData?: (MenuButton | MenuComponent)[] | undefined;
|
|
15
26
|
isSubMenu?: boolean | undefined;
|
|
27
|
+
active?: string | number | undefined;
|
|
28
|
+
autoHide?: boolean | undefined;
|
|
16
29
|
}>, {
|
|
17
30
|
menuData: () => never[];
|
|
18
31
|
isSubMenu: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
onHide?: ((...args: any[]) => any) | undefined;
|
|
22
|
-
}, {
|
|
32
|
+
autoHide: boolean;
|
|
33
|
+
}>>>, {
|
|
23
34
|
menuData: (MenuButton | MenuComponent)[];
|
|
24
35
|
isSubMenu: boolean;
|
|
25
|
-
|
|
36
|
+
autoHide: boolean;
|
|
37
|
+
}, {}>, {
|
|
38
|
+
title?(_: {}): any;
|
|
39
|
+
}>;
|
|
26
40
|
export default _default;
|
|
27
41
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
28
42
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -38,6 +52,11 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
38
52
|
default: D[K];
|
|
39
53
|
}> : P[K];
|
|
40
54
|
};
|
|
55
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
56
|
+
new (): {
|
|
57
|
+
$slots: S;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
41
60
|
type __VLS_Prettify<T> = {
|
|
42
61
|
[K in keyof T]: T[K];
|
|
43
62
|
} & {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
2
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
3
|
-
}, {}, {}>, {
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
|
|
4
2
|
default?(_: {}): any;
|
|
5
3
|
}>;
|
|
6
4
|
export default _default;
|
|
@@ -55,6 +55,7 @@ export declare const useCodeBlockEdit: (codeBlockService?: CodeBlockService) =>
|
|
|
55
55
|
readonly content: CodeBlockContent;
|
|
56
56
|
readonly disabled?: boolean | undefined;
|
|
57
57
|
readonly isDataSource?: boolean | undefined;
|
|
58
|
+
readonly dataSourceType?: string | undefined;
|
|
58
59
|
};
|
|
59
60
|
$attrs: {
|
|
60
61
|
[x: string]: unknown;
|
|
@@ -80,6 +81,9 @@ export declare const useCodeBlockEdit: (codeBlockService?: CodeBlockService) =>
|
|
|
80
81
|
isDataSource: {
|
|
81
82
|
type: import("vue").PropType<boolean>;
|
|
82
83
|
};
|
|
84
|
+
dataSourceType: {
|
|
85
|
+
type: import("vue").PropType<string>;
|
|
86
|
+
};
|
|
83
87
|
}>>, {
|
|
84
88
|
show(): void;
|
|
85
89
|
hide(): void;
|
|
@@ -114,6 +118,9 @@ export declare const useCodeBlockEdit: (codeBlockService?: CodeBlockService) =>
|
|
|
114
118
|
isDataSource: {
|
|
115
119
|
type: import("vue").PropType<boolean>;
|
|
116
120
|
};
|
|
121
|
+
dataSourceType: {
|
|
122
|
+
type: import("vue").PropType<string>;
|
|
123
|
+
};
|
|
117
124
|
}>> & import("vue").ShallowUnwrapRef<{
|
|
118
125
|
show(): void;
|
|
119
126
|
hide(): void;
|
|
@@ -53,6 +53,7 @@ export declare const useDataSourceMethod: () => {
|
|
|
53
53
|
readonly content: CodeBlockContent;
|
|
54
54
|
readonly disabled?: boolean | undefined;
|
|
55
55
|
readonly isDataSource?: boolean | undefined;
|
|
56
|
+
readonly dataSourceType?: string | undefined;
|
|
56
57
|
};
|
|
57
58
|
$attrs: {
|
|
58
59
|
[x: string]: unknown;
|
|
@@ -78,6 +79,9 @@ export declare const useDataSourceMethod: () => {
|
|
|
78
79
|
isDataSource: {
|
|
79
80
|
type: import("vue").PropType<boolean>;
|
|
80
81
|
};
|
|
82
|
+
dataSourceType: {
|
|
83
|
+
type: import("vue").PropType<string>;
|
|
84
|
+
};
|
|
81
85
|
}>>, {
|
|
82
86
|
show(): void;
|
|
83
87
|
hide(): void;
|
|
@@ -112,6 +116,9 @@ export declare const useDataSourceMethod: () => {
|
|
|
112
116
|
isDataSource: {
|
|
113
117
|
type: import("vue").PropType<boolean>;
|
|
114
118
|
};
|
|
119
|
+
dataSourceType: {
|
|
120
|
+
type: import("vue").PropType<string>;
|
|
121
|
+
};
|
|
115
122
|
}>> & import("vue").ShallowUnwrapRef<{
|
|
116
123
|
show(): void;
|
|
117
124
|
hide(): void;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
|
|
2
|
+
export default _default;
|
package/types/index.d.ts
CHANGED
|
@@ -18,7 +18,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
18
18
|
height?: string | undefined;
|
|
19
19
|
inline?: boolean | undefined;
|
|
20
20
|
labelPosition?: string | undefined;
|
|
21
|
-
onChange?: ((...args: any[]) => any) | undefined;
|
|
22
21
|
key?: string | number | symbol | undefined;
|
|
23
22
|
ref?: import("vue").VNodeRef | undefined;
|
|
24
23
|
ref_for?: boolean | undefined;
|
|
@@ -63,6 +62,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
63
62
|
}>) => void)[] | undefined;
|
|
64
63
|
class?: unknown;
|
|
65
64
|
style?: unknown;
|
|
65
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
66
66
|
readonly size?: "default" | "small" | "large" | undefined;
|
|
67
67
|
readonly popperClass?: string | undefined;
|
|
68
68
|
readonly extendState?: ((state: FormState) => Record<string, any> | Promise<Record<string, any>>) | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
|
|
2
|
+
isMultiSelect?: boolean | undefined;
|
|
3
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
isMultiSelect?: boolean | undefined;
|
|
5
|
+
}>>>, {}, {}>;
|
|
6
|
+
export default _default;
|
|
7
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
8
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
9
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
10
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
11
|
+
} : {
|
|
12
|
+
type: import('vue').PropType<T[K]>;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
};
|