@tmagic/editor 1.3.0-alpha.2 → 1.3.0-alpha.3
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/tmagic-editor.js +797 -514
- package/dist/tmagic-editor.js.map +1 -1
- package/dist/tmagic-editor.umd.cjs +798 -514
- package/dist/tmagic-editor.umd.cjs.map +1 -1
- package/package.json +17 -18
- package/src/Editor.vue +1 -1
- package/src/components/CodeDraftEditor.vue +5 -1
- package/src/components/ContentMenu.vue +5 -1
- package/src/components/FunctionEditor.vue +6 -1
- package/src/components/Icon.vue +5 -1
- package/src/components/Layout.vue +5 -1
- package/src/components/ScrollBar.vue +5 -1
- package/src/components/ScrollViewer.vue +5 -1
- package/src/components/SearchInput.vue +4 -0
- package/src/components/ToolButton.vue +5 -1
- package/src/fields/Code.vue +5 -1
- package/src/fields/CodeLink.vue +5 -1
- package/src/fields/CodeSelect.vue +6 -2
- package/src/fields/CodeSelectCol.vue +6 -2
- package/src/fields/DataSourceFields.vue +4 -0
- package/src/fields/DataSourceInput.vue +357 -0
- package/src/fields/EventSelect.vue +8 -3
- package/src/fields/KeyValue.vue +4 -0
- package/src/fields/UISelect.vue +5 -1
- package/src/icons/AppManageIcon.vue +5 -1
- package/src/icons/CodeIcon.vue +5 -1
- package/src/index.ts +3 -0
- package/src/layouts/AddPageBox.vue +5 -1
- package/src/layouts/CodeEditor.vue +5 -1
- package/src/layouts/Framework.vue +5 -1
- package/src/layouts/NavMenu.vue +5 -1
- package/src/layouts/PropsPanel.vue +5 -1
- package/src/layouts/Resizer.vue +5 -1
- package/src/layouts/sidebar/ComponentListPanel.vue +5 -1
- package/src/layouts/sidebar/LayerMenu.vue +5 -1
- package/src/layouts/sidebar/LayerPanel.vue +5 -1
- package/src/layouts/sidebar/Sidebar.vue +11 -7
- package/src/layouts/sidebar/code-block/CodeBlockEditor.vue +5 -1
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +5 -1
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +4 -0
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +4 -0
- package/src/layouts/workspace/Breadcrumb.vue +5 -1
- package/src/layouts/workspace/PageBar.vue +5 -1
- package/src/layouts/workspace/PageBarScrollContainer.vue +5 -1
- package/src/layouts/workspace/Stage.vue +5 -1
- package/src/layouts/workspace/ViewerMenu.vue +5 -1
- package/src/layouts/workspace/Workspace.vue +5 -1
- package/types/Editor.vue.d.ts +1 -1
- package/types/components/CodeDraftEditor.vue.d.ts +6 -3
- package/types/components/ContentMenu.vue.d.ts +8 -5
- package/types/components/FunctionEditor.vue.d.ts +66 -45
- package/types/components/Icon.vue.d.ts +2 -2
- package/types/components/Layout.vue.d.ts +9 -6
- package/types/components/ScrollBar.vue.d.ts +1 -1
- package/types/components/ScrollViewer.vue.d.ts +8 -5
- package/types/components/SearchInput.vue.d.ts +1 -1
- package/types/components/ToolButton.vue.d.ts +8 -5
- package/types/fields/Code.vue.d.ts +1 -1
- package/types/fields/CodeLink.vue.d.ts +9 -9
- package/types/fields/CodeSelect.vue.d.ts +10 -7
- package/types/fields/CodeSelectCol.vue.d.ts +8 -5
- package/types/fields/DataSourceFields.vue.d.ts +8 -5
- package/types/fields/DataSourceInput.vue.d.ts +54 -0
- package/types/fields/EventSelect.vue.d.ts +3 -3
- package/types/fields/KeyValue.vue.d.ts +8 -5
- package/types/fields/UISelect.vue.d.ts +1 -1
- package/types/icons/AppManageIcon.vue.d.ts +1 -1
- package/types/icons/CodeIcon.vue.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/layouts/AddPageBox.vue.d.ts +1 -1
- package/types/layouts/CodeEditor.vue.d.ts +7 -4
- package/types/layouts/Framework.vue.d.ts +13 -10
- package/types/layouts/NavMenu.vue.d.ts +7 -4
- package/types/layouts/PropsPanel.vue.d.ts +2 -2
- package/types/layouts/Resizer.vue.d.ts +2 -2
- package/types/layouts/sidebar/ComponentListPanel.vue.d.ts +4 -4
- package/types/layouts/sidebar/LayerMenu.vue.d.ts +2 -2
- package/types/layouts/sidebar/LayerPanel.vue.d.ts +5 -5
- package/types/layouts/sidebar/Sidebar.vue.d.ts +18 -15
- package/types/layouts/sidebar/code-block/CodeBlockEditor.vue.d.ts +4 -4
- package/types/layouts/sidebar/code-block/CodeBlockList.vue.d.ts +7 -7
- package/types/layouts/sidebar/data-source/DataSourceConfigPanel.vue.d.ts +1 -1
- package/types/layouts/sidebar/data-source/DataSourceListPanel.vue.d.ts +3 -3
- package/types/layouts/workspace/Breadcrumb.vue.d.ts +1 -1
- package/types/layouts/workspace/PageBar.vue.d.ts +5 -5
- package/types/layouts/workspace/PageBarScrollContainer.vue.d.ts +2 -2
- package/types/layouts/workspace/Stage.vue.d.ts +2 -2
- package/types/layouts/workspace/ViewerMenu.vue.d.ts +7 -4
- package/types/layouts/workspace/Workspace.vue.d.ts +8 -8
package/dist/tmagic-editor.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveComponent, openBlock, createBlock, normalizeStyle,
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createBlock, normalizeStyle, reactive, watch, createElementBlock, normalizeClass, createVNode, unref, withCtx, createElementVNode, resolveDynamicComponent, toRaw, inject, ref, createTextVNode, mergeProps, toDisplayString, Fragment, renderList, createCommentVNode, nextTick, watchEffect, withModifiers, onMounted, onUnmounted, renderSlot, createSlots, normalizeProps, markRaw, getCurrentInstance, createStaticVNode, withDirectives, Teleport, vShow, toHandlers, provide } from 'vue';
|
|
2
2
|
import serialize from 'serialize-javascript';
|
|
3
3
|
import { isEmpty, map, has, throttle, cloneDeep, mergeWith, isObject, uniq, forIn, difference, union, pick, keys } from 'lodash-es';
|
|
4
|
-
import { TMagicCard, TMagicIcon, TMagicButton, tMagicMessageBox, TMagicInput, TMagicTooltip, TMagicScrollbar, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, tMagicMessage, TMagicDrawer, TMagicTree, TMagicCollapse, TMagicCollapseItem,
|
|
4
|
+
import { TMagicCard, TMagicIcon, TMagicButton, tMagicMessageBox, getConfig as getConfig$1, TMagicTag, TMagicInput, TMagicTooltip, TMagicScrollbar, TMagicDivider, TMagicDropdown, TMagicDropdownMenu, TMagicDropdownItem, tMagicMessage, TMagicDrawer, TMagicTree, TMagicCollapse, TMagicCollapseItem, TMagicPopover } from '@tmagic/design';
|
|
5
5
|
import { HookType, ActionType, NodeType } from '@tmagic/schema';
|
|
6
|
-
import { Edit, View, Delete, Plus, Close, ArrowDown, Grid, Memo, FullScreen, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search,
|
|
6
|
+
import { Edit, View, Coin, Delete, Plus, Close, ArrowDown, Grid, Memo, FullScreen, ScaleToOriginal, ZoomOut, ZoomIn, Right, Back, Search, Aim, Files, CopyDocument, Goods, List, EditPen, ArrowLeftBold, ArrowRightBold, CaretBottom, DocumentCopy, Top, Bottom } from '@element-plus/icons-vue';
|
|
7
7
|
import { createValues, MFormDialog, MForm } from '@tmagic/form';
|
|
8
8
|
import { MagicTable } from '@tmagic/table';
|
|
9
9
|
import * as monaco from 'monaco-editor';
|
|
@@ -14,16 +14,16 @@ import StageCore, { GuidesType, getOffset, calcValueByFontsize, CONTAINER_HIGHLI
|
|
|
14
14
|
import { EventEmitter } from 'events';
|
|
15
15
|
import { DEFAULT_EVENTS, DEFAULT_METHODS } from '@tmagic/core';
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
18
|
+
...{
|
|
19
|
+
name: "MEditorCode"
|
|
20
|
+
},
|
|
21
|
+
__name: "Code",
|
|
22
22
|
props: {
|
|
23
|
-
model:
|
|
24
|
-
name:
|
|
25
|
-
config:
|
|
26
|
-
prop:
|
|
23
|
+
model: {},
|
|
24
|
+
name: {},
|
|
25
|
+
config: {},
|
|
26
|
+
prop: {}
|
|
27
27
|
},
|
|
28
28
|
emits: ["change"],
|
|
29
29
|
setup(__props, { emit }) {
|
|
@@ -37,26 +37,26 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
37
37
|
return (_ctx, _cache) => {
|
|
38
38
|
const _component_magic_code_editor = resolveComponent("magic-code-editor");
|
|
39
39
|
return openBlock(), createBlock(_component_magic_code_editor, {
|
|
40
|
-
style: normalizeStyle(`height: ${
|
|
41
|
-
"init-values":
|
|
42
|
-
language:
|
|
43
|
-
options:
|
|
40
|
+
style: normalizeStyle(`height: ${height.value}`),
|
|
41
|
+
"init-values": _ctx.model[_ctx.name],
|
|
42
|
+
language: language.value,
|
|
43
|
+
options: _ctx.config.options,
|
|
44
44
|
onSave: save
|
|
45
45
|
}, null, 8, ["style", "init-values", "language", "options"]);
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
51
|
+
...{
|
|
52
|
+
name: "MEditorCodeLink"
|
|
53
|
+
},
|
|
54
|
+
__name: "CodeLink",
|
|
55
55
|
props: {
|
|
56
|
-
config:
|
|
57
|
-
model:
|
|
58
|
-
name:
|
|
59
|
-
prop:
|
|
56
|
+
config: {},
|
|
57
|
+
model: {},
|
|
58
|
+
name: {},
|
|
59
|
+
prop: {}
|
|
60
60
|
},
|
|
61
61
|
emits: ["change"],
|
|
62
62
|
setup(__props, { emit }) {
|
|
@@ -111,7 +111,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
111
111
|
return (_ctx, _cache) => {
|
|
112
112
|
const _component_m_fields_link = resolveComponent("m-fields-link");
|
|
113
113
|
return openBlock(), createBlock(_component_m_fields_link, {
|
|
114
|
-
config:
|
|
114
|
+
config: formConfig.value,
|
|
115
115
|
model: modelValue,
|
|
116
116
|
name: "form",
|
|
117
117
|
onChange: changeHandler
|
|
@@ -120,17 +120,17 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
124
|
+
...{
|
|
125
|
+
name: "MEditorCodeSelect"
|
|
126
|
+
},
|
|
127
|
+
__name: "CodeSelect",
|
|
128
128
|
props: {
|
|
129
|
-
config:
|
|
130
|
-
model:
|
|
131
|
-
prop:
|
|
132
|
-
name:
|
|
133
|
-
size:
|
|
129
|
+
config: {},
|
|
130
|
+
model: {},
|
|
131
|
+
prop: {},
|
|
132
|
+
name: {},
|
|
133
|
+
size: {}
|
|
134
134
|
},
|
|
135
135
|
emits: ["change"],
|
|
136
136
|
setup(__props, { emit }) {
|
|
@@ -166,13 +166,13 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
166
166
|
return (_ctx, _cache) => {
|
|
167
167
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
168
168
|
return openBlock(), createElementBlock("div", {
|
|
169
|
-
class: normalizeClass(["m-fields-code-select",
|
|
169
|
+
class: normalizeClass(["m-fields-code-select", _ctx.config.className])
|
|
170
170
|
}, [
|
|
171
171
|
createVNode(unref(TMagicCard), null, {
|
|
172
172
|
default: withCtx(() => [
|
|
173
173
|
createVNode(_component_m_form_container, {
|
|
174
|
-
config:
|
|
175
|
-
model:
|
|
174
|
+
config: codeConfig.value,
|
|
175
|
+
model: _ctx.model[_ctx.name],
|
|
176
176
|
onChange: changeHandler
|
|
177
177
|
}, null, 8, ["config", "model"])
|
|
178
178
|
]),
|
|
@@ -183,18 +183,18 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
|
|
186
|
-
const _hoisted_1$
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
const _hoisted_1$m = ["src"];
|
|
187
|
+
const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
188
|
+
...{
|
|
189
|
+
name: "MEditorIcon"
|
|
190
|
+
},
|
|
191
|
+
__name: "Icon",
|
|
192
192
|
props: {
|
|
193
|
-
icon:
|
|
193
|
+
icon: {}
|
|
194
194
|
},
|
|
195
195
|
setup(__props) {
|
|
196
196
|
return (_ctx, _cache) => {
|
|
197
|
-
return !
|
|
197
|
+
return !_ctx.icon ? (openBlock(), createBlock(unref(TMagicIcon), {
|
|
198
198
|
key: 0,
|
|
199
199
|
class: "magic-editor-icon"
|
|
200
200
|
}, {
|
|
@@ -202,23 +202,23 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
202
202
|
createVNode(unref(Edit))
|
|
203
203
|
]),
|
|
204
204
|
_: 1
|
|
205
|
-
})) : typeof
|
|
205
|
+
})) : typeof _ctx.icon === "string" && _ctx.icon.startsWith("http") ? (openBlock(), createBlock(unref(TMagicIcon), {
|
|
206
206
|
key: 1,
|
|
207
207
|
class: "magic-editor-icon"
|
|
208
208
|
}, {
|
|
209
209
|
default: withCtx(() => [
|
|
210
|
-
createElementVNode("img", { src:
|
|
210
|
+
createElementVNode("img", { src: _ctx.icon }, null, 8, _hoisted_1$m)
|
|
211
211
|
]),
|
|
212
212
|
_: 1
|
|
213
|
-
})) : typeof
|
|
213
|
+
})) : typeof _ctx.icon === "string" ? (openBlock(), createElementBlock("i", {
|
|
214
214
|
key: 2,
|
|
215
|
-
class: normalizeClass(["magic-editor-icon",
|
|
215
|
+
class: normalizeClass(["magic-editor-icon", _ctx.icon])
|
|
216
216
|
}, null, 2)) : (openBlock(), createBlock(unref(TMagicIcon), {
|
|
217
217
|
key: 3,
|
|
218
218
|
class: "magic-editor-icon"
|
|
219
219
|
}, {
|
|
220
220
|
default: withCtx(() => [
|
|
221
|
-
(openBlock(), createBlock(resolveDynamicComponent(toRaw(
|
|
221
|
+
(openBlock(), createBlock(resolveDynamicComponent(toRaw(_ctx.icon))))
|
|
222
222
|
]),
|
|
223
223
|
_: 1
|
|
224
224
|
}));
|
|
@@ -226,19 +226,19 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
|
|
229
|
-
const _hoisted_1$
|
|
229
|
+
const _hoisted_1$l = { class: "m-fields-code-select-col" };
|
|
230
230
|
const _hoisted_2$e = { class: "code-select-container" };
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
232
|
+
...{
|
|
233
|
+
name: "MEditorCodeSelectCol"
|
|
234
|
+
},
|
|
235
|
+
__name: "CodeSelectCol",
|
|
236
236
|
props: {
|
|
237
|
-
config:
|
|
238
|
-
model:
|
|
239
|
-
prop:
|
|
240
|
-
name:
|
|
241
|
-
size:
|
|
237
|
+
config: {},
|
|
238
|
+
model: {},
|
|
239
|
+
prop: {},
|
|
240
|
+
name: {},
|
|
241
|
+
size: {}
|
|
242
242
|
},
|
|
243
243
|
emits: ["change"],
|
|
244
244
|
setup(__props, { emit }) {
|
|
@@ -320,23 +320,23 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
320
320
|
};
|
|
321
321
|
return (_ctx, _cache) => {
|
|
322
322
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
323
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
323
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
324
324
|
createElementVNode("div", _hoisted_2$e, [
|
|
325
325
|
createVNode(_component_m_form_container, {
|
|
326
326
|
class: "select",
|
|
327
327
|
config: selectConfig,
|
|
328
|
-
model:
|
|
328
|
+
model: _ctx.model,
|
|
329
329
|
onChange: onParamsChangeHandler
|
|
330
330
|
}, null, 8, ["model"]),
|
|
331
|
-
createVNode(_sfc_main$
|
|
331
|
+
createVNode(_sfc_main$B, {
|
|
332
332
|
class: "icon",
|
|
333
|
-
icon:
|
|
333
|
+
icon: editable.value ? unref(Edit) : unref(View),
|
|
334
334
|
onClick: editCode
|
|
335
335
|
}, null, 8, ["icon"])
|
|
336
336
|
]),
|
|
337
337
|
createVNode(_component_m_form_container, {
|
|
338
338
|
config: codeParamsConfig.value,
|
|
339
|
-
model:
|
|
339
|
+
model: _ctx.model,
|
|
340
340
|
onChange: onParamsChangeHandler
|
|
341
341
|
}, null, 8, ["config", "model"])
|
|
342
342
|
]);
|
|
@@ -344,17 +344,19 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
344
344
|
}
|
|
345
345
|
});
|
|
346
346
|
|
|
347
|
-
const _hoisted_1$
|
|
347
|
+
const _hoisted_1$k = { class: "m-editor-data-source-fields" };
|
|
348
348
|
const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
|
|
349
|
-
const
|
|
350
|
-
|
|
349
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
350
|
+
...{
|
|
351
|
+
name: "MEditorDataSourceFields"
|
|
352
|
+
},
|
|
351
353
|
__name: "DataSourceFields",
|
|
352
354
|
props: {
|
|
353
|
-
config:
|
|
354
|
-
model:
|
|
355
|
-
prop:
|
|
355
|
+
config: {},
|
|
356
|
+
model: {},
|
|
357
|
+
prop: {},
|
|
356
358
|
disabled: { type: Boolean, default: false },
|
|
357
|
-
name:
|
|
359
|
+
name: {}
|
|
358
360
|
},
|
|
359
361
|
emits: ["change"],
|
|
360
362
|
setup(__props, { emit }) {
|
|
@@ -490,21 +492,21 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
490
492
|
}
|
|
491
493
|
];
|
|
492
494
|
return (_ctx, _cache) => {
|
|
493
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
495
|
+
return openBlock(), createElementBlock("div", _hoisted_1$k, [
|
|
494
496
|
createVNode(unref(MagicTable), {
|
|
495
|
-
data:
|
|
497
|
+
data: _ctx.model[_ctx.name],
|
|
496
498
|
columns: filedColumns
|
|
497
499
|
}, null, 8, ["data"]),
|
|
498
500
|
createElementVNode("div", _hoisted_2$d, [
|
|
499
501
|
createVNode(unref(TMagicButton), {
|
|
500
502
|
size: "small",
|
|
501
503
|
type: "primary",
|
|
502
|
-
disabled:
|
|
504
|
+
disabled: _ctx.disabled,
|
|
503
505
|
plain: "",
|
|
504
506
|
onClick: _cache[0] || (_cache[0] = ($event) => newHandler())
|
|
505
507
|
}, {
|
|
506
508
|
default: withCtx(() => [
|
|
507
|
-
|
|
509
|
+
createTextVNode("添加")
|
|
508
510
|
]),
|
|
509
511
|
_: 1
|
|
510
512
|
}, 8, ["disabled"])
|
|
@@ -515,7 +517,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
515
517
|
title: filedTitle.value,
|
|
516
518
|
config: dataSourceFieldsConfig,
|
|
517
519
|
values: fieldValues.value,
|
|
518
|
-
parentValues:
|
|
520
|
+
parentValues: _ctx.model[_ctx.name],
|
|
519
521
|
onSubmit: fieldChange
|
|
520
522
|
}, null, 8, ["title", "values", "parentValues"])
|
|
521
523
|
]);
|
|
@@ -523,23 +525,287 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
|
523
525
|
}
|
|
524
526
|
});
|
|
525
527
|
|
|
526
|
-
const _hoisted_1$
|
|
527
|
-
const _hoisted_2$c = {
|
|
528
|
+
const _hoisted_1$j = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
529
|
+
const _hoisted_2$c = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
530
|
+
const _hoisted_3$5 = { class: "el-input__inner" };
|
|
531
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
532
|
+
...{
|
|
533
|
+
name: "MEditorDataSourceInput"
|
|
534
|
+
},
|
|
535
|
+
__name: "DataSourceInput",
|
|
536
|
+
props: {
|
|
537
|
+
config: {},
|
|
538
|
+
model: {},
|
|
539
|
+
name: {},
|
|
540
|
+
prop: {},
|
|
541
|
+
disabled: { type: Boolean, default: false },
|
|
542
|
+
lastValues: {},
|
|
543
|
+
size: {}
|
|
544
|
+
},
|
|
545
|
+
emits: ["change"],
|
|
546
|
+
setup(__props, { emit }) {
|
|
547
|
+
const props = __props;
|
|
548
|
+
const { dataSourceService } = inject("services") || {};
|
|
549
|
+
const autocomplete = ref();
|
|
550
|
+
const isFocused = ref(false);
|
|
551
|
+
const state = ref("");
|
|
552
|
+
const displayState = ref([]);
|
|
553
|
+
const input = computed(() => autocomplete.value?.inputRef?.input);
|
|
554
|
+
const dataSources = computed(() => dataSourceService?.get("dataSources") || []);
|
|
555
|
+
const setDisplayState = () => {
|
|
556
|
+
displayState.value = [];
|
|
557
|
+
const matches = state.value.matchAll(/\{\{([\s\S]+?)\}\}/g);
|
|
558
|
+
let index = 0;
|
|
559
|
+
for (const match of matches) {
|
|
560
|
+
if (typeof match.index === "undefined")
|
|
561
|
+
break;
|
|
562
|
+
displayState.value.push({
|
|
563
|
+
type: "text",
|
|
564
|
+
value: state.value.substring(index, match.index)
|
|
565
|
+
});
|
|
566
|
+
let dsText = "";
|
|
567
|
+
let ds;
|
|
568
|
+
let fields;
|
|
569
|
+
match[1].split(".").forEach((item, index2) => {
|
|
570
|
+
if (index2 === 0) {
|
|
571
|
+
ds = dataSources.value.find((ds2) => ds2.id === item);
|
|
572
|
+
dsText += ds?.title || item;
|
|
573
|
+
fields = ds?.fields;
|
|
574
|
+
return;
|
|
575
|
+
}
|
|
576
|
+
const field = fields?.find((field2) => field2.name === item);
|
|
577
|
+
fields = field?.fields;
|
|
578
|
+
dsText += `.${field?.title || item}`;
|
|
579
|
+
});
|
|
580
|
+
displayState.value.push({
|
|
581
|
+
type: "var",
|
|
582
|
+
value: dsText
|
|
583
|
+
});
|
|
584
|
+
index = match.index + match[0].length;
|
|
585
|
+
}
|
|
586
|
+
if (index < state.value.length) {
|
|
587
|
+
displayState.value.push({
|
|
588
|
+
type: "text",
|
|
589
|
+
value: state.value.substring(index)
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
watch(
|
|
594
|
+
() => props.model[props.name],
|
|
595
|
+
(value = "") => {
|
|
596
|
+
state.value = value;
|
|
597
|
+
setDisplayState();
|
|
598
|
+
},
|
|
599
|
+
{ immediate: true }
|
|
600
|
+
);
|
|
601
|
+
const mouseupHandler = async () => {
|
|
602
|
+
isFocused.value = true;
|
|
603
|
+
await nextTick();
|
|
604
|
+
autocomplete.value?.focus();
|
|
605
|
+
};
|
|
606
|
+
const blurHandler = () => {
|
|
607
|
+
isFocused.value = false;
|
|
608
|
+
setDisplayState();
|
|
609
|
+
};
|
|
610
|
+
const changeHandler = (v) => {
|
|
611
|
+
emit("change", v);
|
|
612
|
+
};
|
|
613
|
+
let inputText = "";
|
|
614
|
+
const inputHandler = (v) => {
|
|
615
|
+
if (!v) {
|
|
616
|
+
inputText = v;
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
const isRightCurlyBracket = (selectionStart = 0) => {
|
|
620
|
+
const lastChar = inputText.substring(selectionStart - 1, selectionStart);
|
|
621
|
+
return lastChar === "}";
|
|
622
|
+
};
|
|
623
|
+
const getSelectionStart = () => {
|
|
624
|
+
let selectionStart = input.value?.selectionStart || 0;
|
|
625
|
+
if (isRightCurlyBracket(selectionStart)) {
|
|
626
|
+
selectionStart -= 1;
|
|
627
|
+
}
|
|
628
|
+
return selectionStart;
|
|
629
|
+
};
|
|
630
|
+
const curCharIsLeftCurlyBracket = (leftCurlyBracketIndex) => leftCurlyBracketIndex > -1 && leftCurlyBracketIndex === getSelectionStart() - 1;
|
|
631
|
+
const curCharIsDot = (dotIndex) => dotIndex > -1 && dotIndex === getSelectionStart() - 1;
|
|
632
|
+
const dsQuerySearch = (queryString, leftCurlyBracketIndex, cb) => {
|
|
633
|
+
let result = [];
|
|
634
|
+
if (curCharIsLeftCurlyBracket(leftCurlyBracketIndex)) {
|
|
635
|
+
result = dataSources.value;
|
|
636
|
+
} else if (leftCurlyBracketIndex > -1) {
|
|
637
|
+
const queryName = queryString.substring(leftCurlyBracketIndex + 1).toLowerCase();
|
|
638
|
+
result = dataSources.value.filter((ds) => ds.title?.toLowerCase().includes(queryName) || ds.id.includes(queryName));
|
|
639
|
+
}
|
|
640
|
+
cb(
|
|
641
|
+
result.map((ds) => ({
|
|
642
|
+
value: ds.id,
|
|
643
|
+
text: ds.title,
|
|
644
|
+
type: "dataSource"
|
|
645
|
+
}))
|
|
646
|
+
);
|
|
647
|
+
};
|
|
648
|
+
const fieldQuerySearch = (queryString, leftAngleIndex, dotIndex, cb) => {
|
|
649
|
+
let result = [];
|
|
650
|
+
const dsKey = queryString.substring(leftAngleIndex + 1, dotIndex);
|
|
651
|
+
const keys = dsKey.split(".");
|
|
652
|
+
const ds = dataSources.value.find((ds2) => ds2.id === keys.shift());
|
|
653
|
+
if (!ds) {
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
let fields = ds.fields || [];
|
|
657
|
+
let key = keys.shift();
|
|
658
|
+
while (key) {
|
|
659
|
+
for (const field of fields) {
|
|
660
|
+
if (field.name === key) {
|
|
661
|
+
fields = field.fields || [];
|
|
662
|
+
key = keys.shift();
|
|
663
|
+
break;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
if (curCharIsDot(dotIndex)) {
|
|
668
|
+
result = fields || [];
|
|
669
|
+
} else if (dotIndex > -1) {
|
|
670
|
+
const queryName = queryString.substring(dotIndex + 1).toLowerCase();
|
|
671
|
+
result = fields.filter(
|
|
672
|
+
(field) => field.name?.toLowerCase().includes(queryName) || field.title?.toLowerCase().includes(queryName)
|
|
673
|
+
) || [];
|
|
674
|
+
}
|
|
675
|
+
cb(
|
|
676
|
+
result.map((field) => ({
|
|
677
|
+
value: field.name,
|
|
678
|
+
text: field.title,
|
|
679
|
+
type: "field"
|
|
680
|
+
}))
|
|
681
|
+
);
|
|
682
|
+
};
|
|
683
|
+
const querySearch = (queryString, cb) => {
|
|
684
|
+
inputText = queryString;
|
|
685
|
+
const selectionStart = getSelectionStart();
|
|
686
|
+
const curQueryString = queryString.substring(0, selectionStart);
|
|
687
|
+
const fieldKeyStringLastIndex = curQueryString.lastIndexOf(".");
|
|
688
|
+
const dsKeyStringLastIndex = curQueryString.lastIndexOf("{");
|
|
689
|
+
const isFieldTip = fieldKeyStringLastIndex > dsKeyStringLastIndex;
|
|
690
|
+
if (isFieldTip) {
|
|
691
|
+
fieldQuerySearch(curQueryString, dsKeyStringLastIndex, fieldKeyStringLastIndex, cb);
|
|
692
|
+
} else {
|
|
693
|
+
dsQuerySearch(curQueryString, dsKeyStringLastIndex, cb);
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
const selectHandler = async ({ value, type }) => {
|
|
697
|
+
const isDataSource = type === "dataSource";
|
|
698
|
+
const selectionStart = input.value?.selectionStart || 0;
|
|
699
|
+
let startText = inputText.substring(0, selectionStart);
|
|
700
|
+
const dotIndex = startText.lastIndexOf(".");
|
|
701
|
+
const leftCurlyBracketIndex = startText.lastIndexOf("{");
|
|
702
|
+
const endText = inputText.substring(selectionStart);
|
|
703
|
+
let suggestText = value;
|
|
704
|
+
if (isDataSource) {
|
|
705
|
+
if (!curCharIsLeftCurlyBracket(leftCurlyBracketIndex)) {
|
|
706
|
+
startText = startText.substring(0, leftCurlyBracketIndex + 1);
|
|
707
|
+
}
|
|
708
|
+
if (!isRightCurlyBracket(selectionStart + 1)) {
|
|
709
|
+
suggestText = `${suggestText}}`;
|
|
710
|
+
}
|
|
711
|
+
suggestText = `{${suggestText}}`;
|
|
712
|
+
} else if (!curCharIsDot(dotIndex)) {
|
|
713
|
+
startText = startText.substring(0, dotIndex + 1);
|
|
714
|
+
}
|
|
715
|
+
state.value = `${startText}${suggestText}${endText}`;
|
|
716
|
+
await nextTick();
|
|
717
|
+
let newSelectionStart = 0;
|
|
718
|
+
if (isDataSource) {
|
|
719
|
+
newSelectionStart = leftCurlyBracketIndex + suggestText.length - 1;
|
|
720
|
+
} else {
|
|
721
|
+
newSelectionStart = dotIndex + suggestText.length + 1;
|
|
722
|
+
}
|
|
723
|
+
input.value?.setSelectionRange(newSelectionStart, newSelectionStart);
|
|
724
|
+
};
|
|
725
|
+
return (_ctx, _cache) => {
|
|
726
|
+
return _ctx.disabled || isFocused.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(getConfig$1)("components")?.autocomplete.component || "el-autocomplete"), mergeProps(
|
|
727
|
+
{
|
|
728
|
+
key: 0,
|
|
729
|
+
class: "tmagic-design-auto-complete",
|
|
730
|
+
ref_key: "autocomplete",
|
|
731
|
+
ref: autocomplete,
|
|
732
|
+
modelValue: state.value,
|
|
733
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => state.value = $event)
|
|
734
|
+
},
|
|
735
|
+
unref(getConfig$1)("components")?.autocomplete.props({
|
|
736
|
+
disabled: _ctx.disabled,
|
|
737
|
+
size: _ctx.size,
|
|
738
|
+
fetchSuggestions: querySearch,
|
|
739
|
+
triggerOnFocus: false,
|
|
740
|
+
clearable: true
|
|
741
|
+
}) || {},
|
|
742
|
+
{
|
|
743
|
+
style: { "width": "100%" },
|
|
744
|
+
onBlur: blurHandler,
|
|
745
|
+
onChange: changeHandler,
|
|
746
|
+
onInput: inputHandler,
|
|
747
|
+
onSelect: selectHandler
|
|
748
|
+
}
|
|
749
|
+
), {
|
|
750
|
+
suffix: withCtx(() => [
|
|
751
|
+
createVNode(_sfc_main$B, { icon: unref(Coin) }, null, 8, ["icon"])
|
|
752
|
+
]),
|
|
753
|
+
default: withCtx(({ item }) => [
|
|
754
|
+
createElementVNode("div", _hoisted_1$j, [
|
|
755
|
+
createElementVNode("div", null, toDisplayString(item.text), 1),
|
|
756
|
+
createElementVNode("span", _hoisted_2$c, toDisplayString(item.value), 1)
|
|
757
|
+
])
|
|
758
|
+
]),
|
|
759
|
+
_: 1
|
|
760
|
+
}, 16, ["modelValue"])) : (openBlock(), createElementBlock("div", {
|
|
761
|
+
key: 1,
|
|
762
|
+
class: normalizeClass(`el-input el-input--${_ctx.size}`),
|
|
763
|
+
onMouseup: mouseupHandler
|
|
764
|
+
}, [
|
|
765
|
+
createElementVNode("div", {
|
|
766
|
+
class: normalizeClass(`el-input__wrapper ${isFocused.value ? " is-focus" : ""}`)
|
|
767
|
+
}, [
|
|
768
|
+
createElementVNode("div", _hoisted_3$5, [
|
|
769
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(displayState.value, (item, index) => {
|
|
770
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
771
|
+
item.type === "text" ? (openBlock(), createElementBlock("span", {
|
|
772
|
+
key: index,
|
|
773
|
+
style: { "margin-right": "2px" }
|
|
774
|
+
}, toDisplayString(item.value), 1)) : createCommentVNode("", true),
|
|
775
|
+
item.type === "var" ? (openBlock(), createBlock(unref(TMagicTag), {
|
|
776
|
+
key: index,
|
|
777
|
+
size: _ctx.size
|
|
778
|
+
}, {
|
|
779
|
+
default: withCtx(() => [
|
|
780
|
+
createTextVNode(toDisplayString(item.value), 1)
|
|
781
|
+
]),
|
|
782
|
+
_: 2
|
|
783
|
+
}, 1032, ["size"])) : createCommentVNode("", true)
|
|
784
|
+
], 64);
|
|
785
|
+
}), 256))
|
|
786
|
+
])
|
|
787
|
+
], 2)
|
|
788
|
+
], 34));
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
const _hoisted_1$i = { class: "m-fields-event-select" };
|
|
794
|
+
const _hoisted_2$b = {
|
|
528
795
|
key: 1,
|
|
529
796
|
class: "fullWidth"
|
|
530
797
|
};
|
|
531
|
-
const _hoisted_3$7 = /* @__PURE__ */ createTextVNode("添加事件");
|
|
532
|
-
const __default__$r = defineComponent({
|
|
533
|
-
name: "MEditorEventSelect"
|
|
534
|
-
});
|
|
535
798
|
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
536
|
-
...
|
|
799
|
+
...{
|
|
800
|
+
name: "MEditorEventSelect"
|
|
801
|
+
},
|
|
802
|
+
__name: "EventSelect",
|
|
537
803
|
props: {
|
|
538
|
-
config:
|
|
539
|
-
model:
|
|
540
|
-
prop:
|
|
541
|
-
name:
|
|
542
|
-
size:
|
|
804
|
+
config: {},
|
|
805
|
+
model: {},
|
|
806
|
+
prop: {},
|
|
807
|
+
name: {},
|
|
808
|
+
size: {}
|
|
543
809
|
},
|
|
544
810
|
emits: ["change"],
|
|
545
811
|
setup(__props, { emit }) {
|
|
@@ -690,16 +956,16 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
690
956
|
const _component_m_form_table = resolveComponent("m-form-table");
|
|
691
957
|
const _component_m_form_container = resolveComponent("m-form-container");
|
|
692
958
|
const _component_m_form_panel = resolveComponent("m-form-panel");
|
|
693
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
694
|
-
|
|
959
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
960
|
+
isOldVersion.value ? (openBlock(), createBlock(_component_m_form_table, {
|
|
695
961
|
key: 0,
|
|
696
962
|
ref: "eventForm",
|
|
697
963
|
size: props.size,
|
|
698
|
-
model:
|
|
964
|
+
model: _ctx.model,
|
|
699
965
|
name: "events",
|
|
700
|
-
config:
|
|
966
|
+
config: tableConfig.value,
|
|
701
967
|
onChange: onChangeHandler
|
|
702
|
-
}, null, 8, ["size", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$
|
|
968
|
+
}, null, 8, ["size", "model", "config"])) : (openBlock(), createElementBlock("div", _hoisted_2$b, [
|
|
703
969
|
createVNode(unref(TMagicButton), {
|
|
704
970
|
class: "create-button",
|
|
705
971
|
type: "primary",
|
|
@@ -707,21 +973,21 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
707
973
|
onClick: _cache[0] || (_cache[0] = ($event) => addEvent())
|
|
708
974
|
}, {
|
|
709
975
|
default: withCtx(() => [
|
|
710
|
-
|
|
976
|
+
createTextVNode("添加事件")
|
|
711
977
|
]),
|
|
712
978
|
_: 1
|
|
713
979
|
}),
|
|
714
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
980
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.model[_ctx.name], (cardItem, index) => {
|
|
715
981
|
return openBlock(), createBlock(_component_m_form_panel, {
|
|
716
982
|
key: index,
|
|
717
|
-
config:
|
|
983
|
+
config: actionsConfig.value,
|
|
718
984
|
model: cardItem,
|
|
719
985
|
onChange: onChangeHandler
|
|
720
986
|
}, {
|
|
721
987
|
header: withCtx(() => [
|
|
722
988
|
createVNode(_component_m_form_container, {
|
|
723
989
|
class: "fullWidth",
|
|
724
|
-
config:
|
|
990
|
+
config: eventNameConfig.value,
|
|
725
991
|
model: cardItem,
|
|
726
992
|
onChange: onChangeHandler
|
|
727
993
|
}, null, 8, ["config", "model"]),
|
|
@@ -741,19 +1007,21 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
|
741
1007
|
}
|
|
742
1008
|
});
|
|
743
1009
|
|
|
744
|
-
const _hoisted_1$
|
|
745
|
-
const _hoisted_2$
|
|
746
|
-
const _hoisted_3$6 = /* @__PURE__ */ createTextVNode("添加");
|
|
1010
|
+
const _hoisted_1$h = { class: "m-fields-key-value" };
|
|
1011
|
+
const _hoisted_2$a = /* @__PURE__ */ createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
747
1012
|
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
1013
|
+
...{
|
|
1014
|
+
name: "MEditorKeyValue"
|
|
1015
|
+
},
|
|
748
1016
|
__name: "KeyValue",
|
|
749
1017
|
props: {
|
|
750
|
-
config:
|
|
751
|
-
model:
|
|
752
|
-
name:
|
|
753
|
-
prop:
|
|
1018
|
+
config: {},
|
|
1019
|
+
model: {},
|
|
1020
|
+
name: {},
|
|
1021
|
+
prop: {},
|
|
754
1022
|
disabled: { type: Boolean, default: false },
|
|
755
|
-
lastValues:
|
|
756
|
-
size:
|
|
1023
|
+
lastValues: {},
|
|
1024
|
+
size: {}
|
|
757
1025
|
},
|
|
758
1026
|
emits: ["change"],
|
|
759
1027
|
setup(__props, { emit }) {
|
|
@@ -784,7 +1052,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
784
1052
|
records.value.splice(index, 1);
|
|
785
1053
|
};
|
|
786
1054
|
return (_ctx, _cache) => {
|
|
787
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
1055
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [
|
|
788
1056
|
(openBlock(true), createElementBlock(Fragment, null, renderList(records.value, (item, index) => {
|
|
789
1057
|
return openBlock(), createElementBlock("div", {
|
|
790
1058
|
class: "m-fields-key-value-item",
|
|
@@ -794,23 +1062,23 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
794
1062
|
placeholder: "key",
|
|
795
1063
|
modelValue: records.value[index][0],
|
|
796
1064
|
"onUpdate:modelValue": ($event) => records.value[index][0] = $event,
|
|
797
|
-
disabled:
|
|
798
|
-
size:
|
|
1065
|
+
disabled: _ctx.disabled,
|
|
1066
|
+
size: _ctx.size,
|
|
799
1067
|
onChange: keyChangeHandler
|
|
800
1068
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
801
|
-
_hoisted_2$
|
|
1069
|
+
_hoisted_2$a,
|
|
802
1070
|
createVNode(unref(TMagicInput), {
|
|
803
1071
|
placeholder: "value",
|
|
804
1072
|
modelValue: records.value[index][1],
|
|
805
1073
|
"onUpdate:modelValue": ($event) => records.value[index][1] = $event,
|
|
806
|
-
disabled:
|
|
807
|
-
size:
|
|
1074
|
+
disabled: _ctx.disabled,
|
|
1075
|
+
size: _ctx.size,
|
|
808
1076
|
onChange: valueChangeHandler
|
|
809
1077
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "disabled", "size"]),
|
|
810
1078
|
createVNode(unref(TMagicButton), {
|
|
811
1079
|
class: "m-fileds-key-value-delete",
|
|
812
1080
|
type: "danger",
|
|
813
|
-
size:
|
|
1081
|
+
size: _ctx.size,
|
|
814
1082
|
circle: "",
|
|
815
1083
|
plain: "",
|
|
816
1084
|
icon: unref(Delete),
|
|
@@ -820,13 +1088,13 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
820
1088
|
}), 128)),
|
|
821
1089
|
createVNode(unref(TMagicButton), {
|
|
822
1090
|
type: "primary",
|
|
823
|
-
size:
|
|
1091
|
+
size: _ctx.size,
|
|
824
1092
|
plain: "",
|
|
825
1093
|
icon: unref(Plus),
|
|
826
1094
|
onClick: addHandler
|
|
827
1095
|
}, {
|
|
828
1096
|
default: withCtx(() => [
|
|
829
|
-
|
|
1097
|
+
createTextVNode("添加")
|
|
830
1098
|
]),
|
|
831
1099
|
_: 1
|
|
832
1100
|
}, 8, ["size", "icon"])
|
|
@@ -835,17 +1103,16 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
835
1103
|
}
|
|
836
1104
|
});
|
|
837
1105
|
|
|
838
|
-
const _hoisted_1$i = /* @__PURE__ */ createTextVNode("取消");
|
|
839
|
-
const __default__$q = defineComponent({
|
|
840
|
-
name: "MEditorUISelect"
|
|
841
|
-
});
|
|
842
1106
|
const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
843
|
-
...
|
|
1107
|
+
...{
|
|
1108
|
+
name: "MEditorUISelect"
|
|
1109
|
+
},
|
|
1110
|
+
__name: "UISelect",
|
|
844
1111
|
props: {
|
|
845
|
-
config:
|
|
846
|
-
model:
|
|
847
|
-
prop:
|
|
848
|
-
name:
|
|
1112
|
+
config: {},
|
|
1113
|
+
model: {},
|
|
1114
|
+
prop: {},
|
|
1115
|
+
name: {}
|
|
849
1116
|
},
|
|
850
1117
|
emits: ["change"],
|
|
851
1118
|
setup(__props, { emit }) {
|
|
@@ -902,7 +1169,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
902
1169
|
style: { "padding": "0" }
|
|
903
1170
|
}, {
|
|
904
1171
|
default: withCtx(() => [
|
|
905
|
-
|
|
1172
|
+
createTextVNode("取消")
|
|
906
1173
|
]),
|
|
907
1174
|
_: 1
|
|
908
1175
|
}, 8, ["icon"])
|
|
@@ -912,7 +1179,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
912
1179
|
onClick: startSelect,
|
|
913
1180
|
style: { "display": "flex" }
|
|
914
1181
|
}, [
|
|
915
|
-
|
|
1182
|
+
val.value ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
916
1183
|
key: 0,
|
|
917
1184
|
content: "清除"
|
|
918
1185
|
}, {
|
|
@@ -928,7 +1195,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
928
1195
|
_: 1
|
|
929
1196
|
})) : createCommentVNode("", true),
|
|
930
1197
|
createVNode(unref(TMagicTooltip), {
|
|
931
|
-
content:
|
|
1198
|
+
content: val.value ? toName.value + "_" + val.value : "点击此处选择"
|
|
932
1199
|
}, {
|
|
933
1200
|
default: withCtx(() => [
|
|
934
1201
|
createVNode(unref(TMagicButton), {
|
|
@@ -936,7 +1203,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
936
1203
|
style: { "padding": "0", "margin": "0" }
|
|
937
1204
|
}, {
|
|
938
1205
|
default: withCtx(() => [
|
|
939
|
-
createTextVNode(toDisplayString(
|
|
1206
|
+
createTextVNode(toDisplayString(val.value ? toName.value + "_" + val.value : "点击此处选择"), 1)
|
|
940
1207
|
]),
|
|
941
1208
|
_: 1
|
|
942
1209
|
})
|
|
@@ -950,15 +1217,15 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
950
1217
|
|
|
951
1218
|
const UISelect_vue_vue_type_style_index_0_lang = '';
|
|
952
1219
|
|
|
953
|
-
const __default__$p = defineComponent({
|
|
954
|
-
name: "MEditorCodeEditor"
|
|
955
|
-
});
|
|
956
1220
|
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
957
|
-
...
|
|
1221
|
+
...{
|
|
1222
|
+
name: "MEditorCodeEditor"
|
|
1223
|
+
},
|
|
1224
|
+
__name: "CodeEditor",
|
|
958
1225
|
props: {
|
|
959
|
-
initValues:
|
|
960
|
-
modifiedValues:
|
|
961
|
-
type:
|
|
1226
|
+
initValues: {},
|
|
1227
|
+
modifiedValues: {},
|
|
1228
|
+
type: {},
|
|
962
1229
|
language: { default: "javascript" },
|
|
963
1230
|
options: { default: () => ({
|
|
964
1231
|
tabSize: 2
|
|
@@ -966,7 +1233,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
966
1233
|
autoSave: { type: Boolean, default: true }
|
|
967
1234
|
},
|
|
968
1235
|
emits: ["initd", "save"],
|
|
969
|
-
setup(__props, { expose, emit }) {
|
|
1236
|
+
setup(__props, { expose: __expose, emit }) {
|
|
970
1237
|
const props = __props;
|
|
971
1238
|
const toString = (v, language) => {
|
|
972
1239
|
let value = "";
|
|
@@ -1057,7 +1324,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
1057
1324
|
onUnmounted(() => {
|
|
1058
1325
|
resizeObserver.disconnect();
|
|
1059
1326
|
});
|
|
1060
|
-
|
|
1327
|
+
__expose({
|
|
1061
1328
|
getEditor() {
|
|
1062
1329
|
return vsEditor || vsDiffEditor;
|
|
1063
1330
|
},
|
|
@@ -1083,11 +1350,11 @@ const setConfig = (option) => {
|
|
|
1083
1350
|
};
|
|
1084
1351
|
const getConfig = (key) => $TMAGIC_EDITOR[key];
|
|
1085
1352
|
|
|
1086
|
-
const __default__$o = defineComponent({
|
|
1087
|
-
name: "MEditorResizer"
|
|
1088
|
-
});
|
|
1089
1353
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
1090
|
-
...
|
|
1354
|
+
...{
|
|
1355
|
+
name: "MEditorResizer"
|
|
1356
|
+
},
|
|
1357
|
+
__name: "Resizer",
|
|
1091
1358
|
emits: ["change"],
|
|
1092
1359
|
setup(__props, { emit }) {
|
|
1093
1360
|
const target = ref();
|
|
@@ -1119,20 +1386,20 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
1119
1386
|
}
|
|
1120
1387
|
});
|
|
1121
1388
|
|
|
1122
|
-
const __default__$n = defineComponent({
|
|
1123
|
-
name: "MEditorLayout"
|
|
1124
|
-
});
|
|
1125
1389
|
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
1126
|
-
...
|
|
1390
|
+
...{
|
|
1391
|
+
name: "MEditorLayout"
|
|
1392
|
+
},
|
|
1393
|
+
__name: "Layout",
|
|
1127
1394
|
props: {
|
|
1128
|
-
left:
|
|
1129
|
-
right:
|
|
1395
|
+
left: {},
|
|
1396
|
+
right: {},
|
|
1130
1397
|
minLeft: { default: 46 },
|
|
1131
1398
|
minRight: { default: 1 },
|
|
1132
1399
|
minCenter: { default: 5 },
|
|
1133
|
-
leftClass:
|
|
1134
|
-
rightClass:
|
|
1135
|
-
centerClass:
|
|
1400
|
+
leftClass: {},
|
|
1401
|
+
rightClass: {},
|
|
1402
|
+
centerClass: {}
|
|
1136
1403
|
},
|
|
1137
1404
|
emits: ["update:left", "change", "update:right"],
|
|
1138
1405
|
setup(__props, { emit }) {
|
|
@@ -1224,26 +1491,26 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
1224
1491
|
ref: el,
|
|
1225
1492
|
class: "m-editor-layout"
|
|
1226
1493
|
}, [
|
|
1227
|
-
|
|
1494
|
+
hasLeft.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1228
1495
|
createElementVNode("div", {
|
|
1229
|
-
class: normalizeClass(["m-editor-layout-left",
|
|
1230
|
-
style: normalizeStyle(`width: ${
|
|
1496
|
+
class: normalizeClass(["m-editor-layout-left", _ctx.leftClass]),
|
|
1497
|
+
style: normalizeStyle(`width: ${_ctx.left}px`)
|
|
1231
1498
|
}, [
|
|
1232
1499
|
renderSlot(_ctx.$slots, "left")
|
|
1233
1500
|
], 6),
|
|
1234
1501
|
createVNode(_sfc_main$t, { onChange: changeLeft })
|
|
1235
1502
|
], 64)) : createCommentVNode("", true),
|
|
1236
1503
|
createElementVNode("div", {
|
|
1237
|
-
class: normalizeClass(["m-editor-layout-center",
|
|
1504
|
+
class: normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
1238
1505
|
style: normalizeStyle(`width: ${center.value}px`)
|
|
1239
1506
|
}, [
|
|
1240
1507
|
renderSlot(_ctx.$slots, "center")
|
|
1241
1508
|
], 6),
|
|
1242
|
-
|
|
1509
|
+
hasRight.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
1243
1510
|
createVNode(_sfc_main$t, { onChange: changeRight }),
|
|
1244
1511
|
createElementVNode("div", {
|
|
1245
|
-
class: normalizeClass(["m-editor-layout-right",
|
|
1246
|
-
style: normalizeStyle(`width: ${
|
|
1512
|
+
class: normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
1513
|
+
style: normalizeStyle(`width: ${_ctx.right}px`)
|
|
1247
1514
|
}, [
|
|
1248
1515
|
renderSlot(_ctx.$slots, "right")
|
|
1249
1516
|
], 6)
|
|
@@ -3107,14 +3374,14 @@ const useStage = (stageOptions) => {
|
|
|
3107
3374
|
return stage;
|
|
3108
3375
|
};
|
|
3109
3376
|
|
|
3110
|
-
const _hoisted_1$
|
|
3111
|
-
const _hoisted_2$
|
|
3112
|
-
const _hoisted_3$
|
|
3113
|
-
const __default__$m = defineComponent({
|
|
3114
|
-
name: "MEditorAddPageBox"
|
|
3115
|
-
});
|
|
3377
|
+
const _hoisted_1$g = { class: "m-editor-empty-panel" };
|
|
3378
|
+
const _hoisted_2$9 = { class: "m-editor-empty-content" };
|
|
3379
|
+
const _hoisted_3$4 = /* @__PURE__ */ createElementVNode("p", null, "新增页面", -1);
|
|
3116
3380
|
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
3117
|
-
...
|
|
3381
|
+
...{
|
|
3382
|
+
name: "MEditorAddPageBox"
|
|
3383
|
+
},
|
|
3384
|
+
__name: "AddPageBox",
|
|
3118
3385
|
setup(__props) {
|
|
3119
3386
|
const services = inject("services");
|
|
3120
3387
|
const clickHandler = () => {
|
|
@@ -3130,16 +3397,16 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3130
3397
|
});
|
|
3131
3398
|
};
|
|
3132
3399
|
return (_ctx, _cache) => {
|
|
3133
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3134
|
-
createElementVNode("div", _hoisted_2$
|
|
3400
|
+
return openBlock(), createElementBlock("div", _hoisted_1$g, [
|
|
3401
|
+
createElementVNode("div", _hoisted_2$9, [
|
|
3135
3402
|
createElementVNode("div", {
|
|
3136
3403
|
class: "m-editor-empty-button",
|
|
3137
3404
|
onClick: clickHandler
|
|
3138
3405
|
}, [
|
|
3139
3406
|
createElementVNode("div", null, [
|
|
3140
|
-
createVNode(_sfc_main$
|
|
3407
|
+
createVNode(_sfc_main$B, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
3141
3408
|
]),
|
|
3142
|
-
_hoisted_3$
|
|
3409
|
+
_hoisted_3$4
|
|
3143
3410
|
])
|
|
3144
3411
|
])
|
|
3145
3412
|
]);
|
|
@@ -3147,25 +3414,25 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
3147
3414
|
}
|
|
3148
3415
|
});
|
|
3149
3416
|
|
|
3150
|
-
const _hoisted_1$
|
|
3151
|
-
const
|
|
3152
|
-
|
|
3153
|
-
|
|
3417
|
+
const _hoisted_1$f = { class: "m-editor" };
|
|
3418
|
+
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
3419
|
+
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
3420
|
+
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
3421
|
+
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
3154
3422
|
const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
3155
|
-
...
|
|
3423
|
+
...{
|
|
3424
|
+
name: "MEditorFramework"
|
|
3425
|
+
},
|
|
3426
|
+
__name: "Framework",
|
|
3156
3427
|
props: {
|
|
3157
3428
|
codeOptions: { default: () => ({}) }
|
|
3158
3429
|
},
|
|
3159
3430
|
setup(__props) {
|
|
3160
|
-
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
3161
|
-
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
3162
3431
|
const { editorService, uiService } = inject("services") || {};
|
|
3163
3432
|
const root = computed(() => editorService?.get("root"));
|
|
3164
3433
|
const nodes = computed(() => editorService?.get("nodes") || []);
|
|
3165
3434
|
const pageLength = computed(() => editorService?.get("pageLength") || 0);
|
|
3166
3435
|
const showSrc = computed(() => uiService?.get("showSrc"));
|
|
3167
|
-
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
3168
|
-
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
3169
3436
|
const leftColumnWidthCacheData = Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY));
|
|
3170
3437
|
const RightColumnWidthCacheData = Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY));
|
|
3171
3438
|
const columnWidth = ref({
|
|
@@ -3221,13 +3488,13 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3221
3488
|
};
|
|
3222
3489
|
return (_ctx, _cache) => {
|
|
3223
3490
|
const _component_magic_code_editor = resolveComponent("magic-code-editor");
|
|
3224
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3491
|
+
return openBlock(), createElementBlock("div", _hoisted_1$f, [
|
|
3225
3492
|
renderSlot(_ctx.$slots, "nav", { class: "m-editor-nav-menu" }),
|
|
3226
|
-
|
|
3493
|
+
showSrc.value ? (openBlock(), createBlock(_component_magic_code_editor, {
|
|
3227
3494
|
key: 0,
|
|
3228
3495
|
class: "m-editor-content",
|
|
3229
|
-
"init-values":
|
|
3230
|
-
options:
|
|
3496
|
+
"init-values": root.value,
|
|
3497
|
+
options: _ctx.codeOptions,
|
|
3231
3498
|
onSave: saveCode
|
|
3232
3499
|
}, null, 8, ["init-values", "options"])) : (openBlock(), createBlock(_sfc_main$s, {
|
|
3233
3500
|
key: 1,
|
|
@@ -3247,13 +3514,13 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3247
3514
|
renderSlot(_ctx.$slots, "sidebar")
|
|
3248
3515
|
]),
|
|
3249
3516
|
center: withCtx(() => [
|
|
3250
|
-
|
|
3517
|
+
pageLength.value > 0 ? renderSlot(_ctx.$slots, "workspace", { key: 0 }) : renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
3251
3518
|
createVNode(_sfc_main$r)
|
|
3252
3519
|
])
|
|
3253
3520
|
]),
|
|
3254
3521
|
_: 2
|
|
3255
3522
|
}, [
|
|
3256
|
-
|
|
3523
|
+
pageLength.value > 0 && nodes.value.length === 1 ? {
|
|
3257
3524
|
name: "right",
|
|
3258
3525
|
fn: withCtx(() => [
|
|
3259
3526
|
createVNode(unref(TMagicScrollbar), null, {
|
|
@@ -3262,7 +3529,8 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3262
3529
|
]),
|
|
3263
3530
|
_: 3
|
|
3264
3531
|
})
|
|
3265
|
-
])
|
|
3532
|
+
]),
|
|
3533
|
+
key: "0"
|
|
3266
3534
|
} : void 0
|
|
3267
3535
|
]), 1032, ["left", "right"]))
|
|
3268
3536
|
]);
|
|
@@ -3270,16 +3538,16 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
|
|
|
3270
3538
|
}
|
|
3271
3539
|
});
|
|
3272
3540
|
|
|
3273
|
-
const _hoisted_1$
|
|
3541
|
+
const _hoisted_1$e = {
|
|
3274
3542
|
key: 1,
|
|
3275
3543
|
class: "menu-item-text"
|
|
3276
3544
|
};
|
|
3277
|
-
const _hoisted_2$
|
|
3278
|
-
const __default__$k = defineComponent({
|
|
3279
|
-
name: "MEditorToolButton"
|
|
3280
|
-
});
|
|
3545
|
+
const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
|
|
3281
3546
|
const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
3282
|
-
...
|
|
3547
|
+
...{
|
|
3548
|
+
name: "MEditorToolButton"
|
|
3549
|
+
},
|
|
3550
|
+
__name: "ToolButton",
|
|
3283
3551
|
props: {
|
|
3284
3552
|
data: { default: () => ({
|
|
3285
3553
|
type: "text",
|
|
@@ -3344,35 +3612,35 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3344
3612
|
}
|
|
3345
3613
|
};
|
|
3346
3614
|
return (_ctx, _cache) => {
|
|
3347
|
-
return
|
|
3615
|
+
return display.value ? (openBlock(), createElementBlock("div", {
|
|
3348
3616
|
key: 0,
|
|
3349
|
-
class: normalizeClass(["menu-item", `${
|
|
3350
|
-
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(
|
|
3351
|
-
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(
|
|
3352
|
-
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(
|
|
3617
|
+
class: normalizeClass(["menu-item", `${_ctx.data.type} ${_ctx.data.className || ""}`]),
|
|
3618
|
+
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(_ctx.data, $event)),
|
|
3619
|
+
onMousedown: _cache[1] || (_cache[1] = ($event) => mousedownHandler(_ctx.data, $event)),
|
|
3620
|
+
onMouseup: _cache[2] || (_cache[2] = ($event) => mouseupHandler(_ctx.data, $event))
|
|
3353
3621
|
}, [
|
|
3354
|
-
|
|
3622
|
+
_ctx.data.type === "divider" ? (openBlock(), createBlock(unref(TMagicDivider), {
|
|
3355
3623
|
key: 0,
|
|
3356
|
-
direction:
|
|
3357
|
-
}, null, 8, ["direction"])) :
|
|
3358
|
-
|
|
3624
|
+
direction: _ctx.data.direction || "vertical"
|
|
3625
|
+
}, null, 8, ["direction"])) : _ctx.data.type === "text" ? (openBlock(), createElementBlock("div", _hoisted_1$e, toDisplayString(_ctx.data.text), 1)) : _ctx.data.type === "button" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
3626
|
+
_ctx.data.tooltip ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
3359
3627
|
key: 0,
|
|
3360
3628
|
effect: "dark",
|
|
3361
3629
|
placement: "bottom-start",
|
|
3362
|
-
content:
|
|
3630
|
+
content: _ctx.data.tooltip
|
|
3363
3631
|
}, {
|
|
3364
3632
|
default: withCtx(() => [
|
|
3365
3633
|
createVNode(unref(TMagicButton), {
|
|
3366
3634
|
size: "small",
|
|
3367
3635
|
text: "",
|
|
3368
|
-
disabled:
|
|
3636
|
+
disabled: disabled.value
|
|
3369
3637
|
}, {
|
|
3370
3638
|
default: withCtx(() => [
|
|
3371
|
-
|
|
3639
|
+
_ctx.data.icon ? (openBlock(), createBlock(_sfc_main$B, {
|
|
3372
3640
|
key: 0,
|
|
3373
|
-
icon:
|
|
3641
|
+
icon: _ctx.data.icon
|
|
3374
3642
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
3375
|
-
createElementVNode("span", null, toDisplayString(
|
|
3643
|
+
createElementVNode("span", null, toDisplayString(_ctx.data.text), 1)
|
|
3376
3644
|
]),
|
|
3377
3645
|
_: 1
|
|
3378
3646
|
}, 8, ["disabled"])
|
|
@@ -3382,30 +3650,30 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3382
3650
|
key: 1,
|
|
3383
3651
|
size: "small",
|
|
3384
3652
|
text: "",
|
|
3385
|
-
disabled:
|
|
3653
|
+
disabled: disabled.value
|
|
3386
3654
|
}, {
|
|
3387
3655
|
default: withCtx(() => [
|
|
3388
|
-
|
|
3656
|
+
_ctx.data.icon ? (openBlock(), createBlock(_sfc_main$B, {
|
|
3389
3657
|
key: 0,
|
|
3390
|
-
icon:
|
|
3658
|
+
icon: _ctx.data.icon
|
|
3391
3659
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
3392
|
-
createElementVNode("span", null, toDisplayString(
|
|
3660
|
+
createElementVNode("span", null, toDisplayString(_ctx.data.text), 1)
|
|
3393
3661
|
]),
|
|
3394
3662
|
_: 1
|
|
3395
3663
|
}, 8, ["disabled"]))
|
|
3396
|
-
], 64)) :
|
|
3664
|
+
], 64)) : _ctx.data.type === "dropdown" ? (openBlock(), createBlock(unref(TMagicDropdown), {
|
|
3397
3665
|
key: 3,
|
|
3398
3666
|
trigger: "click",
|
|
3399
|
-
disabled:
|
|
3667
|
+
disabled: disabled.value,
|
|
3400
3668
|
onCommand: dropdownHandler
|
|
3401
3669
|
}, {
|
|
3402
3670
|
dropdown: withCtx(() => [
|
|
3403
|
-
|
|
3671
|
+
_ctx.data.items && _ctx.data.items.length ? (openBlock(), createBlock(unref(TMagicDropdownMenu), { key: 0 }, {
|
|
3404
3672
|
default: withCtx(() => [
|
|
3405
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
3673
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.data.items, (subItem, index) => {
|
|
3406
3674
|
return openBlock(), createBlock(unref(TMagicDropdownItem), {
|
|
3407
3675
|
key: index,
|
|
3408
|
-
command: { data:
|
|
3676
|
+
command: { data: _ctx.data, subItem }
|
|
3409
3677
|
}, {
|
|
3410
3678
|
default: withCtx(() => [
|
|
3411
3679
|
createTextVNode(toDisplayString(subItem.text), 1)
|
|
@@ -3418,8 +3686,8 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3418
3686
|
})) : createCommentVNode("", true)
|
|
3419
3687
|
]),
|
|
3420
3688
|
default: withCtx(() => [
|
|
3421
|
-
createElementVNode("span", _hoisted_2$
|
|
3422
|
-
createTextVNode(toDisplayString(
|
|
3689
|
+
createElementVNode("span", _hoisted_2$8, [
|
|
3690
|
+
createTextVNode(toDisplayString(_ctx.data.text), 1),
|
|
3423
3691
|
createVNode(unref(TMagicIcon), { class: "el-icon--right" }, {
|
|
3424
3692
|
default: withCtx(() => [
|
|
3425
3693
|
createVNode(unref(ArrowDown))
|
|
@@ -3429,17 +3697,17 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
|
|
|
3429
3697
|
])
|
|
3430
3698
|
]),
|
|
3431
3699
|
_: 1
|
|
3432
|
-
}, 8, ["disabled"])) :
|
|
3700
|
+
}, 8, ["disabled"])) : _ctx.data.type === "component" ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.data.component), normalizeProps(mergeProps({ key: 4 }, _ctx.data.props || {})), null, 16)) : createCommentVNode("", true)
|
|
3433
3701
|
], 34)) : createCommentVNode("", true);
|
|
3434
3702
|
};
|
|
3435
3703
|
}
|
|
3436
3704
|
});
|
|
3437
3705
|
|
|
3438
|
-
const __default__$j = defineComponent({
|
|
3439
|
-
name: "MEditorNavMenu"
|
|
3440
|
-
});
|
|
3441
3706
|
const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
3442
|
-
...
|
|
3707
|
+
...{
|
|
3708
|
+
name: "MEditorNavMenu"
|
|
3709
|
+
},
|
|
3710
|
+
__name: "NavMenu",
|
|
3443
3711
|
props: {
|
|
3444
3712
|
data: { default: () => ({}) },
|
|
3445
3713
|
height: { default: 35 }
|
|
@@ -3588,15 +3856,15 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
3588
3856
|
return (_ctx, _cache) => {
|
|
3589
3857
|
return openBlock(), createElementBlock("div", {
|
|
3590
3858
|
class: "m-editor-nav-menu",
|
|
3591
|
-
style: normalizeStyle({ height: `${
|
|
3859
|
+
style: normalizeStyle({ height: `${_ctx.height}px` })
|
|
3592
3860
|
}, [
|
|
3593
3861
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(keys), (key) => {
|
|
3594
3862
|
return openBlock(), createElementBlock("div", {
|
|
3595
3863
|
class: normalizeClass(`menu-${key}`),
|
|
3596
3864
|
key,
|
|
3597
|
-
style: normalizeStyle(`width: ${
|
|
3865
|
+
style: normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
3598
3866
|
}, [
|
|
3599
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
3867
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(buttons.value[key], (item, index) => {
|
|
3600
3868
|
return openBlock(), createBlock(_sfc_main$p, {
|
|
3601
3869
|
data: item,
|
|
3602
3870
|
key: index
|
|
@@ -3609,14 +3877,14 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
|
|
|
3609
3877
|
}
|
|
3610
3878
|
});
|
|
3611
3879
|
|
|
3612
|
-
const _hoisted_1$
|
|
3613
|
-
const __default__$i = defineComponent({
|
|
3614
|
-
name: "MEditorPropsPanel"
|
|
3615
|
-
});
|
|
3880
|
+
const _hoisted_1$d = { class: "m-editor-props-panel" };
|
|
3616
3881
|
const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
3617
|
-
...
|
|
3882
|
+
...{
|
|
3883
|
+
name: "MEditorPropsPanel"
|
|
3884
|
+
},
|
|
3885
|
+
__name: "PropsPanel",
|
|
3618
3886
|
emits: ["mounted"],
|
|
3619
|
-
setup(__props, { expose, emit }) {
|
|
3887
|
+
setup(__props, { expose: __expose, emit }) {
|
|
3620
3888
|
const internalInstance = getCurrentInstance();
|
|
3621
3889
|
const values = ref({});
|
|
3622
3890
|
const configForm = ref();
|
|
@@ -3657,16 +3925,16 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
3657
3925
|
tMagicMessage.error(e.message);
|
|
3658
3926
|
}
|
|
3659
3927
|
};
|
|
3660
|
-
|
|
3928
|
+
__expose({ submit });
|
|
3661
3929
|
return (_ctx, _cache) => {
|
|
3662
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3930
|
+
return openBlock(), createElementBlock("div", _hoisted_1$d, [
|
|
3663
3931
|
renderSlot(_ctx.$slots, "props-panel-header"),
|
|
3664
3932
|
createVNode(unref(MForm), {
|
|
3665
3933
|
ref_key: "configForm",
|
|
3666
3934
|
ref: configForm,
|
|
3667
|
-
class: normalizeClass(`m-editor-props-panel ${
|
|
3668
|
-
"popper-class": `m-editor-props-panel-popper ${
|
|
3669
|
-
size:
|
|
3935
|
+
class: normalizeClass(`m-editor-props-panel ${propsPanelSize.value}`),
|
|
3936
|
+
"popper-class": `m-editor-props-panel-popper ${propsPanelSize.value}`,
|
|
3937
|
+
size: propsPanelSize.value,
|
|
3670
3938
|
"init-values": values.value,
|
|
3671
3939
|
config: curFormConfig.value,
|
|
3672
3940
|
onChange: submit
|
|
@@ -3677,6 +3945,9 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
3677
3945
|
});
|
|
3678
3946
|
|
|
3679
3947
|
const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
3948
|
+
...{
|
|
3949
|
+
name: "MEditorSearchInput"
|
|
3950
|
+
},
|
|
3680
3951
|
__name: "SearchInput",
|
|
3681
3952
|
emits: ["search"],
|
|
3682
3953
|
setup(__props, { emit }) {
|
|
@@ -3708,80 +3979,77 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
|
|
|
3708
3979
|
}
|
|
3709
3980
|
});
|
|
3710
3981
|
|
|
3711
|
-
const
|
|
3712
|
-
|
|
3713
|
-
for (const [key, val] of props) {
|
|
3714
|
-
target[key] = val;
|
|
3715
|
-
}
|
|
3716
|
-
return target;
|
|
3717
|
-
};
|
|
3718
|
-
|
|
3719
|
-
const _sfc_main$l = {};
|
|
3720
|
-
|
|
3721
|
-
const _hoisted_1$d = { xmlns: "http://www.w3.org/2000/svg" };
|
|
3722
|
-
const _hoisted_2$8 = /*#__PURE__*/createElementVNode("g", {
|
|
3982
|
+
const _hoisted_1$c = { xmlns: "http://www.w3.org/2000/svg" };
|
|
3983
|
+
const _hoisted_2$7 = /* @__PURE__ */ createElementVNode("g", {
|
|
3723
3984
|
fill: "#7C878E",
|
|
3724
3985
|
"fill-rule": "evenodd"
|
|
3725
3986
|
}, [
|
|
3726
|
-
|
|
3987
|
+
/* @__PURE__ */ createElementVNode("path", {
|
|
3727
3988
|
d: "M15.3,5.5 L8,0 L0.7,5.5 L8,11 L15.3,5.5 Z M8,2.5 L12,5.5 L8,8.5 L4,5.5 L8,2.5 Z",
|
|
3728
3989
|
"fill-rule": "nonzero"
|
|
3729
3990
|
}),
|
|
3730
|
-
|
|
3991
|
+
/* @__PURE__ */ createElementVNode("path", { d: "M8 13.5L2.3 9.2 0.7 10.5 8 16 15.3 10.5 13.7 9.2z" })
|
|
3731
3992
|
], -1);
|
|
3732
|
-
const _hoisted_3$
|
|
3733
|
-
_hoisted_2$
|
|
3993
|
+
const _hoisted_3$3 = [
|
|
3994
|
+
_hoisted_2$7
|
|
3734
3995
|
];
|
|
3996
|
+
const _sfc_main$l = /* @__PURE__ */ defineComponent({
|
|
3997
|
+
...{
|
|
3998
|
+
name: "MEditorAppManageIcon"
|
|
3999
|
+
},
|
|
4000
|
+
__name: "AppManageIcon",
|
|
4001
|
+
setup(__props) {
|
|
4002
|
+
return (_ctx, _cache) => {
|
|
4003
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$c, _hoisted_3$3);
|
|
4004
|
+
};
|
|
4005
|
+
}
|
|
4006
|
+
});
|
|
3735
4007
|
|
|
3736
|
-
|
|
3737
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$d, _hoisted_3$4))
|
|
3738
|
-
}
|
|
3739
|
-
const AppManageIcon = /*#__PURE__*/_export_sfc(_sfc_main$l, [['render',_sfc_render$2]]);
|
|
3740
|
-
|
|
3741
|
-
const _sfc_main$k = {};
|
|
3742
|
-
|
|
3743
|
-
const _hoisted_1$c = {
|
|
4008
|
+
const _hoisted_1$b = {
|
|
3744
4009
|
viewBox: "0 0 32 32",
|
|
3745
4010
|
version: "1.1",
|
|
3746
4011
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3747
4012
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
3748
4013
|
};
|
|
3749
|
-
const _hoisted_2$
|
|
3750
|
-
const _hoisted_4$
|
|
3751
|
-
_hoisted_2$
|
|
4014
|
+
const _hoisted_2$6 = /* @__PURE__ */ createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
|
|
4015
|
+
const _hoisted_4$3 = [
|
|
4016
|
+
_hoisted_2$6
|
|
3752
4017
|
];
|
|
4018
|
+
const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
4019
|
+
...{
|
|
4020
|
+
name: "MEditorCodeIcon"
|
|
4021
|
+
},
|
|
4022
|
+
__name: "CodeIcon",
|
|
4023
|
+
setup(__props) {
|
|
4024
|
+
return (_ctx, _cache) => {
|
|
4025
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$b, _hoisted_4$3);
|
|
4026
|
+
};
|
|
4027
|
+
}
|
|
4028
|
+
});
|
|
3753
4029
|
|
|
3754
|
-
|
|
3755
|
-
return (openBlock(), createElementBlock("svg", _hoisted_1$c, _hoisted_4$4))
|
|
3756
|
-
}
|
|
3757
|
-
const CodeIcon = /*#__PURE__*/_export_sfc(_sfc_main$k, [['render',_sfc_render$1]]);
|
|
3758
|
-
|
|
3759
|
-
const _hoisted_1$b = {
|
|
4030
|
+
const _hoisted_1$a = {
|
|
3760
4031
|
key: 0,
|
|
3761
4032
|
class: "m-editor-content-bottom"
|
|
3762
4033
|
};
|
|
3763
|
-
const _hoisted_2$
|
|
3764
|
-
const _hoisted_3$3 = /* @__PURE__ */ createTextVNode("关闭");
|
|
3765
|
-
const _hoisted_4$3 = {
|
|
4034
|
+
const _hoisted_2$5 = {
|
|
3766
4035
|
key: 1,
|
|
3767
4036
|
class: "m-editor-content-bottom"
|
|
3768
4037
|
};
|
|
3769
|
-
const _hoisted_5$2 = /* @__PURE__ */ createTextVNode("关闭");
|
|
3770
|
-
const __default__$h = defineComponent({
|
|
3771
|
-
name: "MEditorCodeDraftEditor"
|
|
3772
|
-
});
|
|
3773
4038
|
const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
3774
|
-
...
|
|
4039
|
+
...{
|
|
4040
|
+
name: "MEditorCodeDraftEditor"
|
|
4041
|
+
},
|
|
4042
|
+
__name: "CodeDraftEditor",
|
|
3775
4043
|
props: {
|
|
3776
|
-
id:
|
|
3777
|
-
content:
|
|
4044
|
+
id: {},
|
|
4045
|
+
content: {},
|
|
3778
4046
|
editable: { type: Boolean, default: true },
|
|
3779
4047
|
autoSaveDraft: { type: Boolean, default: true },
|
|
3780
|
-
codeOptions:
|
|
3781
|
-
language:
|
|
4048
|
+
codeOptions: {},
|
|
4049
|
+
language: {}
|
|
3782
4050
|
},
|
|
3783
4051
|
emits: ["close", "saveAndClose"],
|
|
3784
|
-
setup(__props, { expose, emit }) {
|
|
4052
|
+
setup(__props, { expose: __expose, emit }) {
|
|
3785
4053
|
const props = __props;
|
|
3786
4054
|
const services = inject("services");
|
|
3787
4055
|
const codeContent = ref("");
|
|
@@ -3846,7 +4114,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3846
4114
|
codeEditor.value.focus();
|
|
3847
4115
|
}
|
|
3848
4116
|
};
|
|
3849
|
-
|
|
4117
|
+
__expose({
|
|
3850
4118
|
saveAndClose,
|
|
3851
4119
|
close
|
|
3852
4120
|
});
|
|
@@ -3860,10 +4128,10 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3860
4128
|
class: "m-editor-container",
|
|
3861
4129
|
"init-values": `${codeContent.value}`,
|
|
3862
4130
|
onSave: saveCodeDraft,
|
|
3863
|
-
language:
|
|
3864
|
-
options:
|
|
4131
|
+
language: _ctx.language,
|
|
4132
|
+
options: codeOptions.value
|
|
3865
4133
|
}, null, 8, ["init-values", "language", "options"]),
|
|
3866
|
-
|
|
4134
|
+
_ctx.editable ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
|
|
3867
4135
|
createVNode(unref(TMagicButton), {
|
|
3868
4136
|
type: "primary",
|
|
3869
4137
|
class: "button",
|
|
@@ -3880,7 +4148,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3880
4148
|
onClick: saveAndClose
|
|
3881
4149
|
}, {
|
|
3882
4150
|
default: withCtx(() => [
|
|
3883
|
-
|
|
4151
|
+
createTextVNode("确认")
|
|
3884
4152
|
]),
|
|
3885
4153
|
_: 1
|
|
3886
4154
|
}),
|
|
@@ -3889,11 +4157,11 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3889
4157
|
onClick: close
|
|
3890
4158
|
}, {
|
|
3891
4159
|
default: withCtx(() => [
|
|
3892
|
-
|
|
4160
|
+
createTextVNode("关闭")
|
|
3893
4161
|
]),
|
|
3894
4162
|
_: 1
|
|
3895
4163
|
})
|
|
3896
|
-
])) : (openBlock(), createElementBlock("div",
|
|
4164
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_2$5, [
|
|
3897
4165
|
createVNode(unref(TMagicButton), {
|
|
3898
4166
|
type: "primary",
|
|
3899
4167
|
class: "button",
|
|
@@ -3909,7 +4177,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3909
4177
|
onClick: close
|
|
3910
4178
|
}, {
|
|
3911
4179
|
default: withCtx(() => [
|
|
3912
|
-
|
|
4180
|
+
createTextVNode("关闭")
|
|
3913
4181
|
]),
|
|
3914
4182
|
_: 1
|
|
3915
4183
|
})
|
|
@@ -3919,25 +4187,25 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
3919
4187
|
}
|
|
3920
4188
|
});
|
|
3921
4189
|
|
|
3922
|
-
const _hoisted_1$
|
|
3923
|
-
const _hoisted_2$
|
|
4190
|
+
const _hoisted_1$9 = { class: "code-name-wrapper" };
|
|
4191
|
+
const _hoisted_2$4 = /* @__PURE__ */ createElementVNode("div", { class: "code-name-label" }, "代码块名称", -1);
|
|
3924
4192
|
const _hoisted_3$2 = { class: "code-name-wrapper" };
|
|
3925
4193
|
const _hoisted_4$2 = /* @__PURE__ */ createElementVNode("div", { class: "code-name-label" }, "参数", -1);
|
|
3926
|
-
const __default__$g = defineComponent({
|
|
3927
|
-
name: "MEditorFunctionEditor"
|
|
3928
|
-
});
|
|
3929
4194
|
const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
3930
|
-
...
|
|
4195
|
+
...{
|
|
4196
|
+
name: "MEditorFunctionEditor"
|
|
4197
|
+
},
|
|
4198
|
+
__name: "FunctionEditor",
|
|
3931
4199
|
props: {
|
|
3932
|
-
id:
|
|
3933
|
-
name:
|
|
3934
|
-
content:
|
|
4200
|
+
id: {},
|
|
4201
|
+
name: {},
|
|
4202
|
+
content: {},
|
|
3935
4203
|
editable: { type: Boolean, default: true },
|
|
3936
4204
|
autoSaveDraft: { type: Boolean, default: true },
|
|
3937
|
-
codeOptions:
|
|
3938
|
-
paramsColConfig:
|
|
4205
|
+
codeOptions: {},
|
|
4206
|
+
paramsColConfig: {}
|
|
3939
4207
|
},
|
|
3940
|
-
setup(__props, { expose }) {
|
|
4208
|
+
setup(__props, { expose: __expose }) {
|
|
3941
4209
|
const props = __props;
|
|
3942
4210
|
const defaultParamColConfig = {
|
|
3943
4211
|
type: "row",
|
|
@@ -4038,20 +4306,20 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
4038
4306
|
services?.codeBlockService.setCodeEditorShowStatus(false);
|
|
4039
4307
|
};
|
|
4040
4308
|
const codeDraftEditor = ref();
|
|
4041
|
-
|
|
4309
|
+
__expose({
|
|
4042
4310
|
codeDraftEditor
|
|
4043
4311
|
});
|
|
4044
4312
|
return (_ctx, _cache) => {
|
|
4045
4313
|
const _component_m_form_table = resolveComponent("m-form-table");
|
|
4046
4314
|
return openBlock(), createBlock(unref(TMagicCard), { shadow: "never" }, {
|
|
4047
4315
|
header: withCtx(() => [
|
|
4048
|
-
createElementVNode("div", _hoisted_1$
|
|
4049
|
-
_hoisted_2$
|
|
4316
|
+
createElementVNode("div", _hoisted_1$9, [
|
|
4317
|
+
_hoisted_2$4,
|
|
4050
4318
|
createVNode(unref(TMagicInput), {
|
|
4051
4319
|
class: "code-name-input",
|
|
4052
4320
|
modelValue: codeName.value,
|
|
4053
4321
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => codeName.value = $event),
|
|
4054
|
-
disabled: !
|
|
4322
|
+
disabled: !_ctx.editable
|
|
4055
4323
|
}, null, 8, ["modelValue", "disabled"])
|
|
4056
4324
|
]),
|
|
4057
4325
|
createElementVNode("div", _hoisted_3$2, [
|
|
@@ -4071,11 +4339,11 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
4071
4339
|
createVNode(_sfc_main$j, {
|
|
4072
4340
|
ref_key: "codeDraftEditor",
|
|
4073
4341
|
ref: codeDraftEditor,
|
|
4074
|
-
id:
|
|
4342
|
+
id: _ctx.id,
|
|
4075
4343
|
content: codeContent.value,
|
|
4076
|
-
editable:
|
|
4077
|
-
autoSaveDraft:
|
|
4078
|
-
codeOptions:
|
|
4344
|
+
editable: _ctx.editable,
|
|
4345
|
+
autoSaveDraft: _ctx.autoSaveDraft,
|
|
4346
|
+
codeOptions: _ctx.codeOptions,
|
|
4079
4347
|
language: "javascript",
|
|
4080
4348
|
onSaveAndClose: saveAndClose,
|
|
4081
4349
|
onClose: close
|
|
@@ -4087,17 +4355,17 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
4087
4355
|
}
|
|
4088
4356
|
});
|
|
4089
4357
|
|
|
4090
|
-
const _hoisted_1$
|
|
4358
|
+
const _hoisted_1$8 = {
|
|
4091
4359
|
key: 0,
|
|
4092
4360
|
class: "m-editor-code-block-editor-panel"
|
|
4093
4361
|
};
|
|
4094
|
-
const __default__$f = defineComponent({
|
|
4095
|
-
name: "MEditorCodeBlockEditor"
|
|
4096
|
-
});
|
|
4097
4362
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
4098
|
-
...
|
|
4363
|
+
...{
|
|
4364
|
+
name: "MEditorCodeBlockEditor"
|
|
4365
|
+
},
|
|
4366
|
+
__name: "CodeBlockEditor",
|
|
4099
4367
|
props: {
|
|
4100
|
-
paramsColConfig:
|
|
4368
|
+
paramsColConfig: {}
|
|
4101
4369
|
},
|
|
4102
4370
|
setup(__props) {
|
|
4103
4371
|
const services = inject("services");
|
|
@@ -4144,7 +4412,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
4144
4412
|
"append-to-body": true,
|
|
4145
4413
|
"show-close": false,
|
|
4146
4414
|
"close-on-click-modal": true,
|
|
4147
|
-
size:
|
|
4415
|
+
size: size.value,
|
|
4148
4416
|
"before-close": handleClose
|
|
4149
4417
|
}, {
|
|
4150
4418
|
default: withCtx(() => [
|
|
@@ -4155,17 +4423,17 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
4155
4423
|
class: "code-editor-layout"
|
|
4156
4424
|
}, {
|
|
4157
4425
|
center: withCtx(() => [
|
|
4158
|
-
!unref(isEmpty)(codeConfig.value) ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
4159
|
-
renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id:
|
|
4426
|
+
!unref(isEmpty)(codeConfig.value) ? (openBlock(), createElementBlock("div", _hoisted_1$8, [
|
|
4427
|
+
renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id: id.value }),
|
|
4160
4428
|
codeConfig.value ? (openBlock(), createBlock(_sfc_main$i, {
|
|
4161
4429
|
key: 0,
|
|
4162
4430
|
ref_key: "functionEditor",
|
|
4163
4431
|
ref: functionEditor,
|
|
4164
|
-
id:
|
|
4432
|
+
id: id.value,
|
|
4165
4433
|
name: codeConfig.value.name,
|
|
4166
4434
|
content: codeConfig.value.content,
|
|
4167
|
-
paramsColConfig:
|
|
4168
|
-
editable: !!
|
|
4435
|
+
paramsColConfig: _ctx.paramsColConfig,
|
|
4436
|
+
editable: !!editable.value,
|
|
4169
4437
|
autoSaveDraft: true,
|
|
4170
4438
|
codeOptions: unref(codeOptions)
|
|
4171
4439
|
}, null, 8, ["id", "name", "content", "paramsColConfig", "editable", "codeOptions"])) : createCommentVNode("", true)
|
|
@@ -4180,22 +4448,21 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
4180
4448
|
}
|
|
4181
4449
|
});
|
|
4182
4450
|
|
|
4183
|
-
const _hoisted_1$
|
|
4184
|
-
const _hoisted_2$
|
|
4185
|
-
const _hoisted_3$1 =
|
|
4186
|
-
const _hoisted_4$1 = {
|
|
4187
|
-
const _hoisted_5$1 = {
|
|
4451
|
+
const _hoisted_1$7 = { class: "search-wrapper" };
|
|
4452
|
+
const _hoisted_2$3 = ["id"];
|
|
4453
|
+
const _hoisted_3$1 = { class: "list-item" };
|
|
4454
|
+
const _hoisted_4$1 = {
|
|
4188
4455
|
key: 2,
|
|
4189
4456
|
class: "right-tool"
|
|
4190
4457
|
};
|
|
4191
|
-
const __default__$e = defineComponent({
|
|
4192
|
-
name: "MEditorCodeBlockList"
|
|
4193
|
-
});
|
|
4194
4458
|
const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
4195
|
-
...
|
|
4459
|
+
...{
|
|
4460
|
+
name: "MEditorCodeBlockList"
|
|
4461
|
+
},
|
|
4462
|
+
__name: "CodeBlockList",
|
|
4196
4463
|
props: {
|
|
4197
|
-
customError:
|
|
4198
|
-
paramsColConfig:
|
|
4464
|
+
customError: { type: Function },
|
|
4465
|
+
paramsColConfig: {}
|
|
4199
4466
|
},
|
|
4200
4467
|
setup(__props) {
|
|
4201
4468
|
const props = __props;
|
|
@@ -4284,9 +4551,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4284
4551
|
return openBlock(), createBlock(unref(TMagicScrollbar), { class: "m-editor-code-block-list m-editor-dep-list-panel" }, {
|
|
4285
4552
|
default: withCtx(() => [
|
|
4286
4553
|
renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
4287
|
-
createElementVNode("div", _hoisted_1$
|
|
4554
|
+
createElementVNode("div", _hoisted_1$7, [
|
|
4288
4555
|
createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
|
|
4289
|
-
|
|
4556
|
+
editable.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
4290
4557
|
key: 0,
|
|
4291
4558
|
class: "create-code-button",
|
|
4292
4559
|
type: "primary",
|
|
@@ -4294,7 +4561,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4294
4561
|
onClick: createCodeBlock
|
|
4295
4562
|
}, {
|
|
4296
4563
|
default: withCtx(() => [
|
|
4297
|
-
|
|
4564
|
+
createTextVNode("新增")
|
|
4298
4565
|
]),
|
|
4299
4566
|
_: 1
|
|
4300
4567
|
})) : createCommentVNode("", true)
|
|
@@ -4306,9 +4573,9 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4306
4573
|
class: "magic-editor-layer-tree",
|
|
4307
4574
|
"node-key": "id",
|
|
4308
4575
|
"empty-text": "暂无代码块",
|
|
4309
|
-
"default-expanded-keys":
|
|
4576
|
+
"default-expanded-keys": expandedKeys.value,
|
|
4310
4577
|
"expand-on-click-node": false,
|
|
4311
|
-
data:
|
|
4578
|
+
data: codeList.value,
|
|
4312
4579
|
props: treeProps,
|
|
4313
4580
|
"highlight-current": true,
|
|
4314
4581
|
"filter-node-method": filterNode,
|
|
@@ -4319,41 +4586,41 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4319
4586
|
id: data.id,
|
|
4320
4587
|
class: "list-container"
|
|
4321
4588
|
}, [
|
|
4322
|
-
createElementVNode("div",
|
|
4323
|
-
data.type === "code" ? (openBlock(), createBlock(
|
|
4589
|
+
createElementVNode("div", _hoisted_3$1, [
|
|
4590
|
+
data.type === "code" ? (openBlock(), createBlock(_sfc_main$k, {
|
|
4324
4591
|
key: 0,
|
|
4325
4592
|
class: "codeIcon"
|
|
4326
4593
|
})) : createCommentVNode("", true),
|
|
4327
|
-
data.type === "node" ? (openBlock(), createBlock(
|
|
4594
|
+
data.type === "node" ? (openBlock(), createBlock(_sfc_main$l, {
|
|
4328
4595
|
key: 1,
|
|
4329
4596
|
class: "compIcon"
|
|
4330
4597
|
})) : createCommentVNode("", true),
|
|
4331
4598
|
createElementVNode("span", {
|
|
4332
4599
|
class: normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
|
|
4333
4600
|
}, toDisplayString(data.name) + " (" + toDisplayString(data.id) + ")", 3),
|
|
4334
|
-
data.type === "code" ? (openBlock(), createElementBlock("div",
|
|
4601
|
+
data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
|
|
4335
4602
|
createVNode(unref(TMagicTooltip), {
|
|
4336
4603
|
effect: "dark",
|
|
4337
|
-
content:
|
|
4604
|
+
content: editable.value ? "编辑" : "查看",
|
|
4338
4605
|
placement: "bottom"
|
|
4339
4606
|
}, {
|
|
4340
4607
|
default: withCtx(() => [
|
|
4341
|
-
createVNode(_sfc_main$
|
|
4342
|
-
icon:
|
|
4608
|
+
createVNode(_sfc_main$B, {
|
|
4609
|
+
icon: editable.value ? unref(Edit) : unref(View),
|
|
4343
4610
|
class: "edit-icon",
|
|
4344
4611
|
onClick: withModifiers(($event) => editCode(`${data.id}`), ["stop"])
|
|
4345
4612
|
}, null, 8, ["icon", "onClick"])
|
|
4346
4613
|
]),
|
|
4347
4614
|
_: 2
|
|
4348
4615
|
}, 1032, ["content"]),
|
|
4349
|
-
|
|
4616
|
+
editable.value ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
4350
4617
|
key: 0,
|
|
4351
4618
|
effect: "dark",
|
|
4352
4619
|
content: "删除",
|
|
4353
4620
|
placement: "bottom"
|
|
4354
4621
|
}, {
|
|
4355
4622
|
default: withCtx(() => [
|
|
4356
|
-
createVNode(_sfc_main$
|
|
4623
|
+
createVNode(_sfc_main$B, {
|
|
4357
4624
|
icon: unref(Close),
|
|
4358
4625
|
class: "edit-icon",
|
|
4359
4626
|
onClick: withModifiers(($event) => deleteCode(`${data.id}`), ["stop"])
|
|
@@ -4367,13 +4634,13 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4367
4634
|
})
|
|
4368
4635
|
])) : createCommentVNode("", true)
|
|
4369
4636
|
])
|
|
4370
|
-
], 8,
|
|
4637
|
+
], 8, _hoisted_2$3)
|
|
4371
4638
|
]),
|
|
4372
4639
|
_: 3
|
|
4373
4640
|
}, 8, ["default-expanded-keys", "data"]),
|
|
4374
|
-
|
|
4641
|
+
isShowCodeBlockEditor.value ? (openBlock(), createBlock(_sfc_main$h, {
|
|
4375
4642
|
key: 0,
|
|
4376
|
-
paramsColConfig:
|
|
4643
|
+
paramsColConfig: _ctx.paramsColConfig
|
|
4377
4644
|
}, {
|
|
4378
4645
|
"code-block-edit-panel-header": withCtx(({ id }) => [
|
|
4379
4646
|
renderSlot(_ctx.$slots, "code-block-edit-panel-header", { id })
|
|
@@ -4387,16 +4654,17 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
4387
4654
|
}
|
|
4388
4655
|
});
|
|
4389
4656
|
|
|
4390
|
-
const _hoisted_1$7 = /* @__PURE__ */ createTextVNode("确定");
|
|
4391
|
-
const _hoisted_2$3 = /* @__PURE__ */ createTextVNode("关闭");
|
|
4392
4657
|
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
4658
|
+
...{
|
|
4659
|
+
name: "MEditorDataSourceConfigPanel"
|
|
4660
|
+
},
|
|
4393
4661
|
__name: "DataSourceConfigPanel",
|
|
4394
4662
|
props: {
|
|
4395
|
-
title:
|
|
4396
|
-
values:
|
|
4663
|
+
title: {},
|
|
4664
|
+
values: {}
|
|
4397
4665
|
},
|
|
4398
4666
|
emits: ["submit"],
|
|
4399
|
-
setup(__props, { expose, emit }) {
|
|
4667
|
+
setup(__props, { expose: __expose, emit }) {
|
|
4400
4668
|
const props = __props;
|
|
4401
4669
|
const type = ref("base");
|
|
4402
4670
|
const services = inject("services");
|
|
@@ -4427,7 +4695,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
4427
4695
|
const hide = () => {
|
|
4428
4696
|
visible.value = false;
|
|
4429
4697
|
};
|
|
4430
|
-
|
|
4698
|
+
__expose({
|
|
4431
4699
|
show() {
|
|
4432
4700
|
visible.value = true;
|
|
4433
4701
|
},
|
|
@@ -4437,12 +4705,12 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
4437
4705
|
return openBlock(), createBlock(unref(TMagicDrawer), {
|
|
4438
4706
|
modelValue: visible.value,
|
|
4439
4707
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => visible.value = $event),
|
|
4440
|
-
title:
|
|
4708
|
+
title: _ctx.title,
|
|
4441
4709
|
"close-on-press-escape": true,
|
|
4442
4710
|
"append-to-body": true,
|
|
4443
4711
|
"show-close": true,
|
|
4444
4712
|
"close-on-click-modal": true,
|
|
4445
|
-
size:
|
|
4713
|
+
size: size.value
|
|
4446
4714
|
}, {
|
|
4447
4715
|
footer: withCtx(() => [
|
|
4448
4716
|
createElementVNode("div", null, [
|
|
@@ -4451,13 +4719,13 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
4451
4719
|
onClick: submitHandler
|
|
4452
4720
|
}, {
|
|
4453
4721
|
default: withCtx(() => [
|
|
4454
|
-
|
|
4722
|
+
createTextVNode("确定")
|
|
4455
4723
|
]),
|
|
4456
4724
|
_: 1
|
|
4457
4725
|
}),
|
|
4458
4726
|
createVNode(unref(TMagicButton), { onClick: hide }, {
|
|
4459
4727
|
default: withCtx(() => [
|
|
4460
|
-
|
|
4728
|
+
createTextVNode("关闭")
|
|
4461
4729
|
]),
|
|
4462
4730
|
_: 1
|
|
4463
4731
|
})
|
|
@@ -4467,7 +4735,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
4467
4735
|
createVNode(unref(MForm), {
|
|
4468
4736
|
ref_key: "form",
|
|
4469
4737
|
ref: form,
|
|
4470
|
-
config:
|
|
4738
|
+
config: dataSourceConfig.value,
|
|
4471
4739
|
"init-values": initValues.value,
|
|
4472
4740
|
onChange: changeHandler
|
|
4473
4741
|
}, null, 8, ["config", "init-values"])
|
|
@@ -4479,18 +4747,17 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
4479
4747
|
});
|
|
4480
4748
|
|
|
4481
4749
|
const _hoisted_1$6 = { class: "search-wrapper" };
|
|
4482
|
-
const _hoisted_2$2 =
|
|
4483
|
-
const _hoisted_3 =
|
|
4484
|
-
const _hoisted_4 = {
|
|
4485
|
-
const _hoisted_5 = {
|
|
4750
|
+
const _hoisted_2$2 = ["id"];
|
|
4751
|
+
const _hoisted_3 = { class: "list-item" };
|
|
4752
|
+
const _hoisted_4 = {
|
|
4486
4753
|
key: 2,
|
|
4487
4754
|
class: "right-tool"
|
|
4488
4755
|
};
|
|
4489
|
-
const __default__$d = defineComponent({
|
|
4490
|
-
name: "MEditorDataSourceListPanel"
|
|
4491
|
-
});
|
|
4492
4756
|
const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
4493
|
-
...
|
|
4757
|
+
...{
|
|
4758
|
+
name: "MEditorDataSourceListPanel"
|
|
4759
|
+
},
|
|
4760
|
+
__name: "DataSourceListPanel",
|
|
4494
4761
|
setup(__props) {
|
|
4495
4762
|
const services = inject("services", {});
|
|
4496
4763
|
const { dataSourceService, depService } = inject("services") || {};
|
|
@@ -4556,7 +4823,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4556
4823
|
onClick: addHandler
|
|
4557
4824
|
}, {
|
|
4558
4825
|
default: withCtx(() => [
|
|
4559
|
-
|
|
4826
|
+
createTextVNode("新增")
|
|
4560
4827
|
]),
|
|
4561
4828
|
_: 1
|
|
4562
4829
|
})
|
|
@@ -4569,7 +4836,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4569
4836
|
"empty-text": "暂无代码块",
|
|
4570
4837
|
"default-expand-all": "",
|
|
4571
4838
|
"expand-on-click-node": false,
|
|
4572
|
-
data:
|
|
4839
|
+
data: list.value,
|
|
4573
4840
|
"highlight-current": true
|
|
4574
4841
|
}, {
|
|
4575
4842
|
default: withCtx(({ data }) => [
|
|
@@ -4577,13 +4844,13 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4577
4844
|
id: data.id,
|
|
4578
4845
|
class: "list-container"
|
|
4579
4846
|
}, [
|
|
4580
|
-
createElementVNode("div",
|
|
4581
|
-
data.type === "code" ? (openBlock(), createBlock(_sfc_main$
|
|
4847
|
+
createElementVNode("div", _hoisted_3, [
|
|
4848
|
+
data.type === "code" ? (openBlock(), createBlock(_sfc_main$B, {
|
|
4582
4849
|
key: 0,
|
|
4583
4850
|
class: "codeIcon",
|
|
4584
4851
|
icon: unref(Coin)
|
|
4585
4852
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
4586
|
-
data.type === "node" ? (openBlock(), createBlock(_sfc_main$
|
|
4853
|
+
data.type === "node" ? (openBlock(), createBlock(_sfc_main$B, {
|
|
4587
4854
|
key: 1,
|
|
4588
4855
|
class: "compIcon",
|
|
4589
4856
|
icon: unref(Aim)
|
|
@@ -4591,14 +4858,14 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4591
4858
|
createElementVNode("span", {
|
|
4592
4859
|
class: normalizeClass(["name", { code: data.type === "code", hook: data.type === "key" }])
|
|
4593
4860
|
}, toDisplayString(data.name) + "(" + toDisplayString(data.id) + ")", 3),
|
|
4594
|
-
data.type === "code" ? (openBlock(), createElementBlock("div",
|
|
4861
|
+
data.type === "code" ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
4595
4862
|
createVNode(unref(TMagicTooltip), {
|
|
4596
4863
|
effect: "dark",
|
|
4597
4864
|
content: "编辑",
|
|
4598
4865
|
placement: "bottom"
|
|
4599
4866
|
}, {
|
|
4600
4867
|
default: withCtx(() => [
|
|
4601
|
-
createVNode(_sfc_main$
|
|
4868
|
+
createVNode(_sfc_main$B, {
|
|
4602
4869
|
class: "edit-icon",
|
|
4603
4870
|
icon: unref(Edit),
|
|
4604
4871
|
onClick: withModifiers(($event) => editHandler(`${data.id}`), ["stop"])
|
|
@@ -4612,7 +4879,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4612
4879
|
placement: "bottom"
|
|
4613
4880
|
}, {
|
|
4614
4881
|
default: withCtx(() => [
|
|
4615
|
-
createVNode(_sfc_main$
|
|
4882
|
+
createVNode(_sfc_main$B, {
|
|
4616
4883
|
icon: unref(Close),
|
|
4617
4884
|
class: "edit-icon",
|
|
4618
4885
|
onClick: withModifiers(($event) => removeHandler(`${data.id}`), ["stop"])
|
|
@@ -4626,7 +4893,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4626
4893
|
})
|
|
4627
4894
|
])) : createCommentVNode("", true)
|
|
4628
4895
|
])
|
|
4629
|
-
], 8,
|
|
4896
|
+
], 8, _hoisted_2$2)
|
|
4630
4897
|
]),
|
|
4631
4898
|
_: 3
|
|
4632
4899
|
}, 8, ["data"]),
|
|
@@ -4645,11 +4912,11 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
|
|
|
4645
4912
|
});
|
|
4646
4913
|
|
|
4647
4914
|
const _hoisted_1$5 = ["onClick", "onDragstart"];
|
|
4648
|
-
const __default__$c = defineComponent({
|
|
4649
|
-
name: "MEditorComponentListPanel"
|
|
4650
|
-
});
|
|
4651
4915
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
4652
|
-
...
|
|
4916
|
+
...{
|
|
4917
|
+
name: "MEditorComponentListPanel"
|
|
4918
|
+
},
|
|
4919
|
+
__name: "ComponentListPanel",
|
|
4653
4920
|
setup(__props) {
|
|
4654
4921
|
const searchText = ref("");
|
|
4655
4922
|
const filterTextChangeHandler = (v) => {
|
|
@@ -4722,18 +4989,18 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4722
4989
|
renderSlot(_ctx.$slots, "component-list-panel-header"),
|
|
4723
4990
|
createVNode(unref(TMagicCollapse), {
|
|
4724
4991
|
class: "ui-component-panel",
|
|
4725
|
-
"model-value":
|
|
4992
|
+
"model-value": collapseValue.value
|
|
4726
4993
|
}, {
|
|
4727
4994
|
default: withCtx(() => [
|
|
4728
4995
|
createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
|
|
4729
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
4996
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(list.value, (group, index) => {
|
|
4730
4997
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
4731
4998
|
group.items && group.items.length ? (openBlock(), createBlock(unref(TMagicCollapseItem), {
|
|
4732
4999
|
key: index,
|
|
4733
5000
|
name: `${index}`
|
|
4734
5001
|
}, {
|
|
4735
5002
|
title: withCtx(() => [
|
|
4736
|
-
createVNode(_sfc_main$
|
|
5003
|
+
createVNode(_sfc_main$B, { icon: unref(Grid) }, null, 8, ["icon"]),
|
|
4737
5004
|
createTextVNode(toDisplayString(group.title), 1)
|
|
4738
5005
|
]),
|
|
4739
5006
|
default: withCtx(() => [
|
|
@@ -4748,7 +5015,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4748
5015
|
onDrag: dragHandler
|
|
4749
5016
|
}, [
|
|
4750
5017
|
renderSlot(_ctx.$slots, "component-list-item", { component: item }, () => [
|
|
4751
|
-
createVNode(_sfc_main$
|
|
5018
|
+
createVNode(_sfc_main$B, {
|
|
4752
5019
|
icon: item.icon
|
|
4753
5020
|
}, null, 8, ["icon"]),
|
|
4754
5021
|
createVNode(unref(TMagicTooltip), {
|
|
@@ -4779,17 +5046,17 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
4779
5046
|
}
|
|
4780
5047
|
});
|
|
4781
5048
|
|
|
4782
|
-
const __default__$b = defineComponent({
|
|
4783
|
-
name: "MEditorContentMenu"
|
|
4784
|
-
});
|
|
4785
5049
|
const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
4786
|
-
...
|
|
5050
|
+
...{
|
|
5051
|
+
name: "MEditorContentMenu"
|
|
5052
|
+
},
|
|
5053
|
+
__name: "ContentMenu",
|
|
4787
5054
|
props: {
|
|
4788
5055
|
menuData: { default: () => [] },
|
|
4789
5056
|
isSubMenu: { type: Boolean, default: false }
|
|
4790
5057
|
},
|
|
4791
5058
|
emits: ["hide", "show"],
|
|
4792
|
-
setup(__props, { expose, emit }) {
|
|
5059
|
+
setup(__props, { expose: __expose, emit }) {
|
|
4793
5060
|
const props = __props;
|
|
4794
5061
|
const menu = ref();
|
|
4795
5062
|
const subMenu = ref();
|
|
@@ -4856,13 +5123,13 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
4856
5123
|
return;
|
|
4857
5124
|
globalThis.removeEventListener("mousedown", hideHandler, true);
|
|
4858
5125
|
});
|
|
4859
|
-
|
|
5126
|
+
__expose({
|
|
4860
5127
|
hide,
|
|
4861
5128
|
show
|
|
4862
5129
|
});
|
|
4863
5130
|
return (_ctx, _cache) => {
|
|
4864
5131
|
const _component_content_menu = resolveComponent("content-menu", true);
|
|
4865
|
-
return
|
|
5132
|
+
return _ctx.menuData.length ? withDirectives((openBlock(), createElementBlock("div", {
|
|
4866
5133
|
key: 0,
|
|
4867
5134
|
class: "magic-editor-content-menu",
|
|
4868
5135
|
ref_key: "menu",
|
|
@@ -4870,7 +5137,7 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
4870
5137
|
style: normalizeStyle(menuStyle.value)
|
|
4871
5138
|
}, [
|
|
4872
5139
|
createElementVNode("div", null, [
|
|
4873
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5140
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.menuData, (item, index) => {
|
|
4874
5141
|
return openBlock(), createBlock(_sfc_main$p, {
|
|
4875
5142
|
"event-type": "mouseup",
|
|
4876
5143
|
data: item,
|
|
@@ -4897,15 +5164,15 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
4897
5164
|
}
|
|
4898
5165
|
});
|
|
4899
5166
|
|
|
4900
|
-
const __default__$a = defineComponent({
|
|
4901
|
-
name: "MEditorLayerMenu"
|
|
4902
|
-
});
|
|
4903
5167
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
4904
|
-
...
|
|
5168
|
+
...{
|
|
5169
|
+
name: "MEditorLayerMenu"
|
|
5170
|
+
},
|
|
5171
|
+
__name: "LayerMenu",
|
|
4905
5172
|
props: {
|
|
4906
|
-
layerContentMenu:
|
|
5173
|
+
layerContentMenu: {}
|
|
4907
5174
|
},
|
|
4908
|
-
setup(__props, { expose }) {
|
|
5175
|
+
setup(__props, { expose: __expose }) {
|
|
4909
5176
|
const props = __props;
|
|
4910
5177
|
const services = inject("services");
|
|
4911
5178
|
const menu = ref();
|
|
@@ -4987,12 +5254,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
4987
5254
|
const show = (e) => {
|
|
4988
5255
|
menu.value?.show(e);
|
|
4989
5256
|
};
|
|
4990
|
-
|
|
5257
|
+
__expose({
|
|
4991
5258
|
show
|
|
4992
5259
|
});
|
|
4993
5260
|
return (_ctx, _cache) => {
|
|
4994
5261
|
return openBlock(), createBlock(_sfc_main$c, {
|
|
4995
|
-
"menu-data":
|
|
5262
|
+
"menu-data": menuData.value,
|
|
4996
5263
|
ref_key: "menu",
|
|
4997
5264
|
ref: menu,
|
|
4998
5265
|
style: { "overflow": "initial" }
|
|
@@ -5002,16 +5269,16 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
5002
5269
|
});
|
|
5003
5270
|
|
|
5004
5271
|
const _hoisted_1$4 = ["id", "onMouseenter"];
|
|
5005
|
-
const
|
|
5006
|
-
name: "MEditorLayerPanel"
|
|
5007
|
-
});
|
|
5272
|
+
const throttleTime = 150;
|
|
5008
5273
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
5009
|
-
...
|
|
5274
|
+
...{
|
|
5275
|
+
name: "MEditorLayerPanel"
|
|
5276
|
+
},
|
|
5277
|
+
__name: "LayerPanel",
|
|
5010
5278
|
props: {
|
|
5011
|
-
layerContentMenu:
|
|
5279
|
+
layerContentMenu: {}
|
|
5012
5280
|
},
|
|
5013
5281
|
setup(__props) {
|
|
5014
|
-
const throttleTime = 150;
|
|
5015
5282
|
const services = inject("services");
|
|
5016
5283
|
const editorService = services?.editorService;
|
|
5017
5284
|
const tree = ref();
|
|
@@ -5205,7 +5472,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5205
5472
|
default: withCtx(() => [
|
|
5206
5473
|
renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
5207
5474
|
createVNode(_sfc_main$m, { onSearch: filterTextChangeHandler }),
|
|
5208
|
-
|
|
5475
|
+
values.value.length ? (openBlock(), createBlock(unref(TMagicTree), {
|
|
5209
5476
|
key: 0,
|
|
5210
5477
|
class: "magic-editor-layer-tree",
|
|
5211
5478
|
ref_key: "tree",
|
|
@@ -5216,14 +5483,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5216
5483
|
"default-expanded-keys": expandedKeys.value,
|
|
5217
5484
|
"default-checked-keys": checkedKeys.value,
|
|
5218
5485
|
"current-node-key": currentNodeKey.value,
|
|
5219
|
-
data:
|
|
5486
|
+
data: values.value,
|
|
5220
5487
|
"expand-on-click-node": false,
|
|
5221
|
-
"highlight-current": !
|
|
5488
|
+
"highlight-current": !isMultiSelect.value,
|
|
5222
5489
|
"check-on-click-node": true,
|
|
5223
5490
|
props: treeProps,
|
|
5224
5491
|
"filter-node-method": filterNode,
|
|
5225
5492
|
"allow-drop": allowDrop,
|
|
5226
|
-
"show-checkbox":
|
|
5493
|
+
"show-checkbox": isMultiSelect.value,
|
|
5227
5494
|
onNodeClick: clickHandler,
|
|
5228
5495
|
onNodeContextmenu: contextmenu,
|
|
5229
5496
|
onNodeDragEnd: handleDragEnd,
|
|
@@ -5253,7 +5520,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
5253
5520
|
createVNode(_sfc_main$b, {
|
|
5254
5521
|
ref_key: "menu",
|
|
5255
5522
|
ref: menu,
|
|
5256
|
-
"layer-content-menu":
|
|
5523
|
+
"layer-content-menu": _ctx.layerContentMenu
|
|
5257
5524
|
}, null, 8, ["layer-content-menu"])
|
|
5258
5525
|
]))
|
|
5259
5526
|
]),
|
|
@@ -5267,19 +5534,19 @@ const _hoisted_1$3 = {
|
|
|
5267
5534
|
key: 1,
|
|
5268
5535
|
class: "magic-editor-tab-panel-title"
|
|
5269
5536
|
};
|
|
5270
|
-
const __default__$8 = defineComponent({
|
|
5271
|
-
name: "MEditorSidebar"
|
|
5272
|
-
});
|
|
5273
5537
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
5274
|
-
...
|
|
5538
|
+
...{
|
|
5539
|
+
name: "MEditorSidebar"
|
|
5540
|
+
},
|
|
5541
|
+
__name: "Sidebar",
|
|
5275
5542
|
props: {
|
|
5276
5543
|
data: { default: () => ({ type: "tabs", status: "组件", items: ["component-list", "layer", "code-block", "data-source"] }) },
|
|
5277
|
-
layerContentMenu:
|
|
5544
|
+
layerContentMenu: {}
|
|
5278
5545
|
},
|
|
5279
|
-
setup(__props, { expose }) {
|
|
5546
|
+
setup(__props, { expose: __expose }) {
|
|
5280
5547
|
const props = __props;
|
|
5281
|
-
const tabPaneComponent = getConfig$1("components")
|
|
5282
|
-
const tabsComponent = getConfig$1("components")
|
|
5548
|
+
const tabPaneComponent = getConfig$1("components")?.tabPane;
|
|
5549
|
+
const tabsComponent = getConfig$1("components")?.tabs;
|
|
5283
5550
|
const activeTabName = ref(props.data?.status);
|
|
5284
5551
|
const getItemConfig = (data) => {
|
|
5285
5552
|
const map = {
|
|
@@ -5328,26 +5595,26 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5328
5595
|
activeTabName.value = status || "0";
|
|
5329
5596
|
}
|
|
5330
5597
|
);
|
|
5331
|
-
|
|
5598
|
+
__expose({
|
|
5332
5599
|
activeTabName
|
|
5333
5600
|
});
|
|
5334
5601
|
return (_ctx, _cache) => {
|
|
5335
|
-
return
|
|
5602
|
+
return _ctx.data.type === "tabs" && _ctx.data.items.length ? (openBlock(), createBlock(resolveDynamicComponent(unref(tabsComponent)?.component || "el-tabs"), mergeProps({
|
|
5336
5603
|
key: 0,
|
|
5337
5604
|
modelValue: activeTabName.value,
|
|
5338
5605
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => activeTabName.value = $event),
|
|
5339
5606
|
class: "m-editor-sidebar tmagic-design-tabs"
|
|
5340
|
-
}, unref(tabsComponent)
|
|
5607
|
+
}, unref(tabsComponent)?.props({ type: "card", tabPosition: "left" }) || {}), {
|
|
5341
5608
|
default: withCtx(() => [
|
|
5342
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5343
|
-
return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)
|
|
5609
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(sideBarItems.value, (config, index) => {
|
|
5610
|
+
return openBlock(), createBlock(resolveDynamicComponent(unref(tabPaneComponent)?.component || "el-tab-pane"), mergeProps(unref(tabPaneComponent)?.props({ name: config.text, lazy: config.lazy }) || {}, {
|
|
5344
5611
|
key: config.$key || index
|
|
5345
5612
|
}), {
|
|
5346
5613
|
label: withCtx(() => [
|
|
5347
5614
|
(openBlock(), createElementBlock("div", {
|
|
5348
5615
|
key: config.text
|
|
5349
5616
|
}, [
|
|
5350
|
-
config.icon ? (openBlock(), createBlock(_sfc_main$
|
|
5617
|
+
config.icon ? (openBlock(), createBlock(_sfc_main$B, {
|
|
5351
5618
|
key: 0,
|
|
5352
5619
|
icon: config.icon
|
|
5353
5620
|
}, null, 8, ["icon"])) : createCommentVNode("", true),
|
|
@@ -5360,7 +5627,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5360
5627
|
name: "component-list-panel-header",
|
|
5361
5628
|
fn: withCtx(() => [
|
|
5362
5629
|
config.$key === "component-list" ? renderSlot(_ctx.$slots, "component-list-panel-header", { key: 0 }) : config.slots?.componentListPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.componentListPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
5363
|
-
])
|
|
5630
|
+
]),
|
|
5631
|
+
key: "0"
|
|
5364
5632
|
} : void 0,
|
|
5365
5633
|
config.$key === "component-list" || config.slots?.componentListItem ? {
|
|
5366
5634
|
name: "component-list-item",
|
|
@@ -5372,19 +5640,22 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5372
5640
|
key: 1,
|
|
5373
5641
|
component
|
|
5374
5642
|
}, null, 8, ["component"])) : createCommentVNode("", true)
|
|
5375
|
-
])
|
|
5643
|
+
]),
|
|
5644
|
+
key: "1"
|
|
5376
5645
|
} : void 0,
|
|
5377
5646
|
config.$key === "layer" || config.slots?.layerPanelHeader ? {
|
|
5378
5647
|
name: "layer-panel-header",
|
|
5379
5648
|
fn: withCtx(() => [
|
|
5380
5649
|
config.$key === "layer" ? renderSlot(_ctx.$slots, "layer-panel-header", { key: 0 }) : config.slots?.layerPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.layerPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
5381
|
-
])
|
|
5650
|
+
]),
|
|
5651
|
+
key: "2"
|
|
5382
5652
|
} : void 0,
|
|
5383
5653
|
config.$key === "code-block" || config.slots?.codeBlockPanelHeader ? {
|
|
5384
5654
|
name: "code-block-panel-header",
|
|
5385
5655
|
fn: withCtx(() => [
|
|
5386
5656
|
config.$key === "code-block" ? renderSlot(_ctx.$slots, "code-block-panel-header", { key: 0 }) : config.slots?.codeBlockPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
5387
|
-
])
|
|
5657
|
+
]),
|
|
5658
|
+
key: "3"
|
|
5388
5659
|
} : void 0,
|
|
5389
5660
|
config.$key === "code-block" || config.slots?.codeBlockPanelTool ? {
|
|
5390
5661
|
name: "code-block-panel-tool",
|
|
@@ -5394,7 +5665,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5394
5665
|
id,
|
|
5395
5666
|
data
|
|
5396
5667
|
}) : config.slots?.codeBlockPanelTool ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockPanelTool), { key: 1 })) : createCommentVNode("", true)
|
|
5397
|
-
])
|
|
5668
|
+
]),
|
|
5669
|
+
key: "4"
|
|
5398
5670
|
} : void 0,
|
|
5399
5671
|
config.$key === "code-block" || config.slots?.codeBlockEditPanelHeader ? {
|
|
5400
5672
|
name: "code-block-edit-panel-header",
|
|
@@ -5403,7 +5675,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5403
5675
|
key: 0,
|
|
5404
5676
|
id
|
|
5405
5677
|
}) : config.slots?.codeBlockEditPanelHeader ? (openBlock(), createBlock(resolveDynamicComponent(config.slots.codeBlockEditPanelHeader), { key: 1 })) : createCommentVNode("", true)
|
|
5406
|
-
])
|
|
5678
|
+
]),
|
|
5679
|
+
key: "5"
|
|
5407
5680
|
} : void 0,
|
|
5408
5681
|
config.$key === "layer" || config.slots?.layerNodeContent ? {
|
|
5409
5682
|
name: "layer-node-content",
|
|
@@ -5417,7 +5690,8 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
5417
5690
|
data: nodeData,
|
|
5418
5691
|
node
|
|
5419
5692
|
}, null, 8, ["data", "node"])) : createCommentVNode("", true)
|
|
5420
|
-
])
|
|
5693
|
+
]),
|
|
5694
|
+
key: "6"
|
|
5421
5695
|
} : void 0
|
|
5422
5696
|
]), 1040)) : createCommentVNode("", true)
|
|
5423
5697
|
]),
|
|
@@ -5436,11 +5710,11 @@ const _hoisted_1$2 = {
|
|
|
5436
5710
|
class: "m-editor-breadcrumb"
|
|
5437
5711
|
};
|
|
5438
5712
|
const _hoisted_2$1 = { key: 0 };
|
|
5439
|
-
const __default__$7 = defineComponent({
|
|
5440
|
-
name: "MEditorBreadcrumb"
|
|
5441
|
-
});
|
|
5442
5713
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
5443
|
-
...
|
|
5714
|
+
...{
|
|
5715
|
+
name: "MEditorBreadcrumb"
|
|
5716
|
+
},
|
|
5717
|
+
__name: "Breadcrumb",
|
|
5444
5718
|
setup(__props) {
|
|
5445
5719
|
const services = inject("services");
|
|
5446
5720
|
const editorService = services?.editorService;
|
|
@@ -5453,14 +5727,14 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
5453
5727
|
editorService?.get("stage")?.select(node2.id);
|
|
5454
5728
|
};
|
|
5455
5729
|
return (_ctx, _cache) => {
|
|
5456
|
-
return
|
|
5457
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5730
|
+
return nodes.value.length === 1 ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
5731
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(path.value, (item, index) => {
|
|
5458
5732
|
return openBlock(), createElementBlock(Fragment, {
|
|
5459
5733
|
key: item.id
|
|
5460
5734
|
}, [
|
|
5461
5735
|
createVNode(unref(TMagicButton), {
|
|
5462
5736
|
text: "",
|
|
5463
|
-
disabled: item.id ===
|
|
5737
|
+
disabled: item.id === node.value?.id,
|
|
5464
5738
|
onClick: ($event) => select(item)
|
|
5465
5739
|
}, {
|
|
5466
5740
|
default: withCtx(() => [
|
|
@@ -5468,7 +5742,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
5468
5742
|
]),
|
|
5469
5743
|
_: 2
|
|
5470
5744
|
}, 1032, ["disabled", "onClick"]),
|
|
5471
|
-
index <
|
|
5745
|
+
index < path.value.length - 1 ? (openBlock(), createElementBlock("span", _hoisted_2$1, "/")) : createCommentVNode("", true)
|
|
5472
5746
|
], 64);
|
|
5473
5747
|
}), 128))
|
|
5474
5748
|
])) : createCommentVNode("", true);
|
|
@@ -5480,11 +5754,11 @@ const _hoisted_1$1 = {
|
|
|
5480
5754
|
key: 1,
|
|
5481
5755
|
style: { "width": "21px" }
|
|
5482
5756
|
};
|
|
5483
|
-
const __default__$6 = defineComponent({
|
|
5484
|
-
name: "MEditorPageBarScrollContainer"
|
|
5485
|
-
});
|
|
5486
5757
|
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
5487
|
-
...
|
|
5758
|
+
...{
|
|
5759
|
+
name: "MEditorPageBarScrollContainer"
|
|
5760
|
+
},
|
|
5761
|
+
__name: "PageBarScrollContainer",
|
|
5488
5762
|
setup(__props) {
|
|
5489
5763
|
const services = inject("services");
|
|
5490
5764
|
const editorService = services?.editorService;
|
|
@@ -5562,22 +5836,22 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5562
5836
|
ref_key: "pageBar",
|
|
5563
5837
|
ref: pageBar
|
|
5564
5838
|
}, [
|
|
5565
|
-
|
|
5839
|
+
showAddPageButton.value ? (openBlock(), createElementBlock("div", {
|
|
5566
5840
|
key: 0,
|
|
5567
5841
|
id: "m-editor-page-bar-add-icon",
|
|
5568
5842
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5569
5843
|
onClick: addPage
|
|
5570
5844
|
}, [
|
|
5571
|
-
createVNode(_sfc_main$
|
|
5845
|
+
createVNode(_sfc_main$B, { icon: unref(Plus) }, null, 8, ["icon"])
|
|
5572
5846
|
])) : (openBlock(), createElementBlock("div", _hoisted_1$1)),
|
|
5573
5847
|
canScroll.value ? (openBlock(), createElementBlock("div", {
|
|
5574
5848
|
key: 2,
|
|
5575
5849
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5576
5850
|
onClick: _cache[0] || (_cache[0] = ($event) => scroll("left"))
|
|
5577
5851
|
}, [
|
|
5578
|
-
createVNode(_sfc_main$
|
|
5852
|
+
createVNode(_sfc_main$B, { icon: unref(ArrowLeftBold) }, null, 8, ["icon"])
|
|
5579
5853
|
])) : createCommentVNode("", true),
|
|
5580
|
-
|
|
5854
|
+
pageLength.value ? (openBlock(), createElementBlock("div", {
|
|
5581
5855
|
key: 3,
|
|
5582
5856
|
class: "m-editor-page-bar-items",
|
|
5583
5857
|
ref_key: "itemsContainer",
|
|
@@ -5591,7 +5865,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5591
5865
|
class: "m-editor-page-bar-item m-editor-page-bar-item-icon",
|
|
5592
5866
|
onClick: _cache[1] || (_cache[1] = ($event) => scroll("right"))
|
|
5593
5867
|
}, [
|
|
5594
|
-
createVNode(_sfc_main$
|
|
5868
|
+
createVNode(_sfc_main$B, { icon: unref(ArrowRightBold) }, null, 8, ["icon"])
|
|
5595
5869
|
])) : createCommentVNode("", true)
|
|
5596
5870
|
], 512);
|
|
5597
5871
|
};
|
|
@@ -5600,11 +5874,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
5600
5874
|
|
|
5601
5875
|
const _hoisted_1 = ["onClick"];
|
|
5602
5876
|
const _hoisted_2 = { class: "m-editor-page-bar-title" };
|
|
5603
|
-
const __default__$5 = defineComponent({
|
|
5604
|
-
name: "MEditorPageBar"
|
|
5605
|
-
});
|
|
5606
5877
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
5607
|
-
...
|
|
5878
|
+
...{
|
|
5879
|
+
name: "MEditorPageBar"
|
|
5880
|
+
},
|
|
5881
|
+
__name: "PageBar",
|
|
5608
5882
|
setup(__props) {
|
|
5609
5883
|
const services = inject("services");
|
|
5610
5884
|
const editorService = services?.editorService;
|
|
@@ -5626,9 +5900,9 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
5626
5900
|
return (_ctx, _cache) => {
|
|
5627
5901
|
return openBlock(), createBlock(_sfc_main$7, null, {
|
|
5628
5902
|
default: withCtx(() => [
|
|
5629
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(
|
|
5903
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(root.value && root.value.items || [], (item) => {
|
|
5630
5904
|
return openBlock(), createElementBlock("div", {
|
|
5631
|
-
class: normalizeClass(["m-editor-page-bar-item", { active:
|
|
5905
|
+
class: normalizeClass(["m-editor-page-bar-item", { active: page.value?.id === item.id }]),
|
|
5632
5906
|
key: item.key,
|
|
5633
5907
|
onClick: ($event) => switchPage(item)
|
|
5634
5908
|
}, [
|
|
@@ -5821,16 +6095,16 @@ class ScrollViewer extends EventEmitter {
|
|
|
5821
6095
|
};
|
|
5822
6096
|
}
|
|
5823
6097
|
|
|
5824
|
-
const __default__$4 = defineComponent({
|
|
5825
|
-
name: "MEditorScrollBar"
|
|
5826
|
-
});
|
|
5827
6098
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
5828
|
-
...
|
|
6099
|
+
...{
|
|
6100
|
+
name: "MEditorScrollBar"
|
|
6101
|
+
},
|
|
6102
|
+
__name: "ScrollBar",
|
|
5829
6103
|
props: {
|
|
5830
|
-
size:
|
|
5831
|
-
scrollSize:
|
|
6104
|
+
size: {},
|
|
6105
|
+
scrollSize: {},
|
|
5832
6106
|
isHorizontal: { type: Boolean },
|
|
5833
|
-
pos:
|
|
6107
|
+
pos: {}
|
|
5834
6108
|
},
|
|
5835
6109
|
emits: ["scroll"],
|
|
5836
6110
|
setup(__props, { emit }) {
|
|
@@ -5895,13 +6169,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
5895
6169
|
return openBlock(), createElementBlock("div", {
|
|
5896
6170
|
ref_key: "bar",
|
|
5897
6171
|
ref: bar,
|
|
5898
|
-
class: normalizeClass(["m-editor-scroll-bar",
|
|
6172
|
+
class: normalizeClass(["m-editor-scroll-bar", _ctx.isHorizontal ? "horizontal" : "vertical"])
|
|
5899
6173
|
}, [
|
|
5900
6174
|
createElementVNode("div", {
|
|
5901
6175
|
ref_key: "thumb",
|
|
5902
6176
|
ref: thumb,
|
|
5903
6177
|
class: "m-editor-scroll-bar-thumb",
|
|
5904
|
-
style: normalizeStyle(
|
|
6178
|
+
style: normalizeStyle(thumbStyle.value)
|
|
5905
6179
|
}, null, 4)
|
|
5906
6180
|
], 2);
|
|
5907
6181
|
};
|
|
@@ -5910,11 +6184,11 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
5910
6184
|
|
|
5911
6185
|
const ScrollBar_vue_vue_type_style_index_0_lang = '';
|
|
5912
6186
|
|
|
5913
|
-
const __default__$3 = defineComponent({
|
|
5914
|
-
name: "MEditorScrollViewer"
|
|
5915
|
-
});
|
|
5916
6187
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
5917
|
-
...
|
|
6188
|
+
...{
|
|
6189
|
+
name: "MEditorScrollViewer"
|
|
6190
|
+
},
|
|
6191
|
+
__name: "ScrollViewer",
|
|
5918
6192
|
props: {
|
|
5919
6193
|
width: { default: 0 },
|
|
5920
6194
|
height: { default: 0 },
|
|
@@ -5926,7 +6200,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
5926
6200
|
height: 0
|
|
5927
6201
|
}) }
|
|
5928
6202
|
},
|
|
5929
|
-
setup(__props, { expose }) {
|
|
6203
|
+
setup(__props, { expose: __expose }) {
|
|
5930
6204
|
const props = __props;
|
|
5931
6205
|
const container = ref();
|
|
5932
6206
|
const el = ref();
|
|
@@ -5980,7 +6254,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
5980
6254
|
left: hOffset.value
|
|
5981
6255
|
});
|
|
5982
6256
|
};
|
|
5983
|
-
|
|
6257
|
+
__expose({
|
|
5984
6258
|
container
|
|
5985
6259
|
});
|
|
5986
6260
|
return (_ctx, _cache) => {
|
|
@@ -5992,23 +6266,23 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
5992
6266
|
createElementVNode("div", {
|
|
5993
6267
|
ref_key: "el",
|
|
5994
6268
|
ref: el,
|
|
5995
|
-
style: normalizeStyle(
|
|
6269
|
+
style: normalizeStyle(style.value)
|
|
5996
6270
|
}, [
|
|
5997
6271
|
renderSlot(_ctx.$slots, "default")
|
|
5998
6272
|
], 4),
|
|
5999
|
-
scrollHeight.value >
|
|
6273
|
+
scrollHeight.value > _ctx.wrapHeight ? (openBlock(), createBlock(_sfc_main$5, {
|
|
6000
6274
|
key: 0,
|
|
6001
6275
|
"scroll-size": scrollHeight.value,
|
|
6002
|
-
size:
|
|
6276
|
+
size: _ctx.wrapHeight,
|
|
6003
6277
|
pos: vOffset.value,
|
|
6004
6278
|
onScroll: vScrollHandler
|
|
6005
6279
|
}, null, 8, ["scroll-size", "size", "pos"])) : createCommentVNode("", true),
|
|
6006
|
-
scrollWidth.value >
|
|
6280
|
+
scrollWidth.value > _ctx.wrapWidth ? (openBlock(), createBlock(_sfc_main$5, {
|
|
6007
6281
|
key: 1,
|
|
6008
6282
|
"is-horizontal": true,
|
|
6009
6283
|
"scroll-size": scrollWidth.value,
|
|
6010
6284
|
pos: hOffset.value,
|
|
6011
|
-
size:
|
|
6285
|
+
size: _ctx.wrapWidth,
|
|
6012
6286
|
onScroll: hScrollHandler
|
|
6013
6287
|
}, null, 8, ["scroll-size", "pos", "size"])) : createCommentVNode("", true)
|
|
6014
6288
|
], 512);
|
|
@@ -6016,16 +6290,16 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
6016
6290
|
}
|
|
6017
6291
|
});
|
|
6018
6292
|
|
|
6019
|
-
const __default__$2 = defineComponent({
|
|
6020
|
-
name: "MEditorViewerMenu"
|
|
6021
|
-
});
|
|
6022
6293
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
6023
|
-
...
|
|
6294
|
+
...{
|
|
6295
|
+
name: "MEditorViewerMenu"
|
|
6296
|
+
},
|
|
6297
|
+
__name: "ViewerMenu",
|
|
6024
6298
|
props: {
|
|
6025
6299
|
isMultiSelect: { type: Boolean, default: false },
|
|
6026
|
-
stageContentMenu:
|
|
6300
|
+
stageContentMenu: {}
|
|
6027
6301
|
},
|
|
6028
|
-
setup(__props, { expose }) {
|
|
6302
|
+
setup(__props, { expose: __expose }) {
|
|
6029
6303
|
const props = __props;
|
|
6030
6304
|
const services = inject("services");
|
|
6031
6305
|
const editorService = services?.editorService;
|
|
@@ -6160,10 +6434,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6160
6434
|
const data = await storageService.getItem(COPY_STORAGE_KEY);
|
|
6161
6435
|
canPaste.value = data !== "undefined" && !!data;
|
|
6162
6436
|
};
|
|
6163
|
-
|
|
6437
|
+
__expose({ show });
|
|
6164
6438
|
return (_ctx, _cache) => {
|
|
6165
6439
|
return openBlock(), createBlock(_sfc_main$c, {
|
|
6166
|
-
"menu-data":
|
|
6440
|
+
"menu-data": menuData.value,
|
|
6167
6441
|
ref_key: "menu",
|
|
6168
6442
|
ref: menu
|
|
6169
6443
|
}, null, 8, ["menu-data"]);
|
|
@@ -6171,13 +6445,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6171
6445
|
}
|
|
6172
6446
|
});
|
|
6173
6447
|
|
|
6174
|
-
const __default__$1 = defineComponent({
|
|
6175
|
-
name: "MEditorStage"
|
|
6176
|
-
});
|
|
6177
6448
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
6178
|
-
...
|
|
6449
|
+
...{
|
|
6450
|
+
name: "MEditorStage"
|
|
6451
|
+
},
|
|
6452
|
+
__name: "Stage",
|
|
6179
6453
|
props: {
|
|
6180
|
-
stageContentMenu:
|
|
6454
|
+
stageContentMenu: {}
|
|
6181
6455
|
},
|
|
6182
6456
|
setup(__props) {
|
|
6183
6457
|
let stage = null;
|
|
@@ -6302,11 +6576,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6302
6576
|
class: "m-editor-stage",
|
|
6303
6577
|
ref_key: "stageWrap",
|
|
6304
6578
|
ref: stageWrap,
|
|
6305
|
-
width:
|
|
6306
|
-
height:
|
|
6307
|
-
"wrap-width":
|
|
6308
|
-
"wrap-height":
|
|
6309
|
-
zoom:
|
|
6579
|
+
width: stageRect.value?.width,
|
|
6580
|
+
height: stageRect.value?.height,
|
|
6581
|
+
"wrap-width": stageContainerRect.value?.width,
|
|
6582
|
+
"wrap-height": stageContainerRect.value?.height,
|
|
6583
|
+
zoom: zoom.value,
|
|
6310
6584
|
"correction-scroll-size": {
|
|
6311
6585
|
width: 60,
|
|
6312
6586
|
height: 50
|
|
@@ -6317,7 +6591,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6317
6591
|
class: "m-editor-stage-container",
|
|
6318
6592
|
ref_key: "stageContainer",
|
|
6319
6593
|
ref: stageContainer,
|
|
6320
|
-
style: normalizeStyle(`transform: scale(${
|
|
6594
|
+
style: normalizeStyle(`transform: scale(${zoom.value});`),
|
|
6321
6595
|
onContextmenu: contextmenuHandler,
|
|
6322
6596
|
onDrop: dropHandler,
|
|
6323
6597
|
onDragover: dragoverHandler
|
|
@@ -6326,8 +6600,8 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6326
6600
|
createVNode(_sfc_main$3, {
|
|
6327
6601
|
ref_key: "menu",
|
|
6328
6602
|
ref: menu,
|
|
6329
|
-
"is-multi-select":
|
|
6330
|
-
"stage-content-menu":
|
|
6603
|
+
"is-multi-select": isMultiSelect.value,
|
|
6604
|
+
"stage-content-menu": _ctx.stageContentMenu
|
|
6331
6605
|
}, null, 8, ["is-multi-select", "stage-content-menu"])
|
|
6332
6606
|
]))
|
|
6333
6607
|
]),
|
|
@@ -6337,13 +6611,13 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
6337
6611
|
}
|
|
6338
6612
|
});
|
|
6339
6613
|
|
|
6340
|
-
const __default__ = defineComponent({
|
|
6341
|
-
name: "MEditorWorkspace"
|
|
6342
|
-
});
|
|
6343
6614
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
6344
|
-
...
|
|
6615
|
+
...{
|
|
6616
|
+
name: "MEditorWorkspace"
|
|
6617
|
+
},
|
|
6618
|
+
__name: "Workspace",
|
|
6345
6619
|
props: {
|
|
6346
|
-
stageContentMenu:
|
|
6620
|
+
stageContentMenu: {}
|
|
6347
6621
|
},
|
|
6348
6622
|
setup(__props) {
|
|
6349
6623
|
const services = inject("services");
|
|
@@ -6455,9 +6729,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
6455
6729
|
}, [
|
|
6456
6730
|
createVNode(_sfc_main$8),
|
|
6457
6731
|
renderSlot(_ctx.$slots, "stage", {}, () => [
|
|
6458
|
-
|
|
6732
|
+
page.value ? (openBlock(), createBlock(_sfc_main$2, {
|
|
6459
6733
|
key: 0,
|
|
6460
|
-
"stage-content-menu":
|
|
6734
|
+
"stage-content-menu": _ctx.stageContentMenu
|
|
6461
6735
|
}, null, 8, ["stage-content-menu"])) : createCommentVNode("", true)
|
|
6462
6736
|
]),
|
|
6463
6737
|
renderSlot(_ctx.$slots, "workspace-content"),
|
|
@@ -7560,7 +7834,7 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
|
|
|
7560
7834
|
};
|
|
7561
7835
|
|
|
7562
7836
|
const _sfc_main = defineComponent({
|
|
7563
|
-
name: "
|
|
7837
|
+
name: "MEditor",
|
|
7564
7838
|
components: {
|
|
7565
7839
|
TMagicNavMenu: _sfc_main$o,
|
|
7566
7840
|
Sidebar: _sfc_main$9,
|
|
@@ -7607,6 +7881,14 @@ const _sfc_main = defineComponent({
|
|
|
7607
7881
|
}
|
|
7608
7882
|
});
|
|
7609
7883
|
|
|
7884
|
+
const _export_sfc = (sfc, props) => {
|
|
7885
|
+
const target = sfc.__vccOpts || sfc;
|
|
7886
|
+
for (const [key, val] of props) {
|
|
7887
|
+
target[key] = val;
|
|
7888
|
+
}
|
|
7889
|
+
return target;
|
|
7890
|
+
};
|
|
7891
|
+
|
|
7610
7892
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
7611
7893
|
const _component_TMagicNavMenu = resolveComponent("TMagicNavMenu");
|
|
7612
7894
|
const _component_Sidebar = resolveComponent("Sidebar");
|
|
@@ -7707,16 +7989,17 @@ const index = {
|
|
|
7707
7989
|
setConfig(option);
|
|
7708
7990
|
app.component(Editor.name, Editor);
|
|
7709
7991
|
app.component("m-fields-ui-select", _sfc_main$v);
|
|
7710
|
-
app.component("m-fields-code-link", _sfc_main$
|
|
7711
|
-
app.component("m-fields-vs-code", _sfc_main$
|
|
7992
|
+
app.component("m-fields-code-link", _sfc_main$D);
|
|
7993
|
+
app.component("m-fields-vs-code", _sfc_main$E);
|
|
7712
7994
|
app.component("magic-code-editor", _sfc_main$u);
|
|
7713
|
-
app.component("m-fields-code-select", _sfc_main$
|
|
7714
|
-
app.component("m-fields-code-select-col", _sfc_main$
|
|
7995
|
+
app.component("m-fields-code-select", _sfc_main$C);
|
|
7996
|
+
app.component("m-fields-code-select-col", _sfc_main$A);
|
|
7715
7997
|
app.component("m-fields-event-select", _sfc_main$x);
|
|
7716
|
-
app.component("m-fields-data-source-fields", _sfc_main$
|
|
7998
|
+
app.component("m-fields-data-source-fields", _sfc_main$z);
|
|
7717
7999
|
app.component("m-fields-key-value", _sfc_main$w);
|
|
8000
|
+
app.component("m-fields-data-source-input", _sfc_main$y);
|
|
7718
8001
|
}
|
|
7719
8002
|
};
|
|
7720
8003
|
|
|
7721
|
-
export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$g as CodeBlockList, CodeDeleteErrorType, _sfc_main$
|
|
8004
|
+
export { CODE_DRAFT_STORAGE_KEY, COPY_STORAGE_KEY, _sfc_main$g as CodeBlockList, CodeDeleteErrorType, _sfc_main$C as CodeSelect, _sfc_main$A as CodeSelectCol, ColumnLayout, _sfc_main$d as ComponentListPanel, _sfc_main$c as ContentMenu, _sfc_main$z as DataSourceFields, _sfc_main$y as DataSourceInput, _sfc_main$x as EventSelect, Fixed2Other, H_GUIDE_LINE_STORAGE_KEY, _sfc_main$B as Icon, _sfc_main$w as KeyValue, Keys, LayerOffset, _sfc_main$a as LayerPanel, Layout, _sfc_main$s as LayoutContainer, _sfc_main$n as PropsPanel, _sfc_main$u as TMagicCodeEditor, Editor as TMagicEditor, _sfc_main$p as ToolButton, V_GUIDE_LINE_STORAGE_KEY, beforePaste, change2Fixed, codeBlockService, dataSourceService, debug, index as default, depService, editorService, error, eventsService, fillConfig$1 as fillConfig, fixNodeLeft, fixNodePosition, generatePageName, generatePageNameByApp, getAddParent, getConfig, getDefaultConfig, getGuideLineFromCache, getInitPositionStyle, getNodeIndex, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, historyService, info, isFixed, log, propsService, serializeConfig, setConfig, setLayout, storageService, uiService, useStage, warn };
|
|
7722
8005
|
//# sourceMappingURL=tmagic-editor.js.map
|