@tmagic/editor 1.4.1 → 1.4.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 +244 -187
- package/dist/tmagic-editor.umd.cjs +263 -206
- package/package.json +11 -11
- package/src/components/SplitView.vue +5 -0
- package/src/fields/CodeSelect.vue +11 -2
- package/src/fields/DataSourceFieldSelect.vue +50 -14
- package/src/hooks/use-data-source-edit.ts +46 -0
- package/src/layouts/Framework.vue +4 -1
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +3 -29
- package/src/services/editor.ts +5 -1
- package/types/hooks/use-data-source-edit.d.ts +81 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('lodash-es'), require('serialize-javascript'), require('@tmagic/design'), require('emmet-monaco-es'), require('monaco-editor'), require('@tmagic/
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', 'lodash-es', 'serialize-javascript', '@tmagic/design', 'emmet-monaco-es', 'monaco-editor', '@tmagic/
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.iconsVue, global.lodashEs, global.serialize, global.design, global.emmetMonacoEs, global.monaco, global.
|
|
5
|
-
})(this, (function (exports, vue, iconsVue, lodashEs, serialize, design, emmetMonacoEs, monaco,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('@element-plus/icons-vue'), require('lodash-es'), require('serialize-javascript'), require('@tmagic/design'), require('emmet-monaco-es'), require('monaco-editor'), require('@tmagic/form'), require('@tmagic/schema'), require('moveable'), require('@tmagic/table'), require('@tmagic/utils'), require('@tmagic/dep'), require('gesto'), require('@tmagic/stage'), require('events'), require('@tmagic/core'), require('keycon')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', '@element-plus/icons-vue', 'lodash-es', 'serialize-javascript', '@tmagic/design', 'emmet-monaco-es', 'monaco-editor', '@tmagic/form', '@tmagic/schema', 'moveable', '@tmagic/table', '@tmagic/utils', '@tmagic/dep', 'gesto', '@tmagic/stage', 'events', '@tmagic/core', 'keycon'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.iconsVue, global.lodashEs, global.serialize, global.design, global.emmetMonacoEs, global.monaco, global.form, global.schema, global.VanillaMoveable, global.table, global.utils, global.dep, global.Gesto, global.StageCore, global.events, global.core, global.KeyController));
|
|
5
|
+
})(this, (function (exports, vue, iconsVue, lodashEs, serialize, design, emmetMonacoEs, monaco, form, schema, VanillaMoveable, table, utils, dep, Gesto, StageCore, events, core, KeyController) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
|
|
@@ -488,17 +488,20 @@
|
|
|
488
488
|
emit("change", props.model[props.name]);
|
|
489
489
|
};
|
|
490
490
|
return (_ctx, _cache) => {
|
|
491
|
-
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
492
491
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
493
492
|
class: vue.normalizeClass(["m-fields-code-select", _ctx.config.className])
|
|
494
493
|
}, [
|
|
495
494
|
vue.createVNode(vue.unref(design.TMagicCard), null, {
|
|
496
495
|
default: vue.withCtx(() => [
|
|
497
|
-
vue.createVNode(
|
|
496
|
+
vue.createVNode(vue.unref(form.MContainer), {
|
|
498
497
|
config: codeConfig.value,
|
|
498
|
+
size: _ctx.size,
|
|
499
|
+
prop: _ctx.prop,
|
|
500
|
+
disabled: _ctx.disabled,
|
|
501
|
+
lastValues: _ctx.lastValues,
|
|
499
502
|
model: _ctx.model[_ctx.name],
|
|
500
503
|
onChange: changeHandler
|
|
501
|
-
}, null, 8, ["config", "model"])
|
|
504
|
+
}, null, 8, ["config", "size", "prop", "disabled", "lastValues", "model"])
|
|
502
505
|
]),
|
|
503
506
|
_: 1
|
|
504
507
|
})
|
|
@@ -3170,7 +3173,10 @@
|
|
|
3170
3173
|
throw new Error(`获取不到id为${config.id}的节点`);
|
|
3171
3174
|
const node = lodashEs.cloneDeep(vue.toRaw(info.node));
|
|
3172
3175
|
let newConfig = await this.toggleFixedPosition(vue.toRaw(config), node, root);
|
|
3173
|
-
newConfig = lodashEs.mergeWith(lodashEs.cloneDeep(node), newConfig, (objValue, srcValue) => {
|
|
3176
|
+
newConfig = lodashEs.mergeWith(lodashEs.cloneDeep(node), newConfig, (objValue, srcValue, key) => {
|
|
3177
|
+
if (typeof srcValue === "undefined" && Object.hasOwn(newConfig, key)) {
|
|
3178
|
+
return "";
|
|
3179
|
+
}
|
|
3174
3180
|
if (lodashEs.isObject(srcValue) && Array.isArray(objValue)) {
|
|
3175
3181
|
return srcValue;
|
|
3176
3182
|
}
|
|
@@ -4598,8 +4604,115 @@
|
|
|
4598
4604
|
}
|
|
4599
4605
|
});
|
|
4600
4606
|
|
|
4601
|
-
const
|
|
4607
|
+
const useDataSourceEdit = (dataSourceService) => {
|
|
4608
|
+
const dialogTitle = vue.ref("");
|
|
4609
|
+
const editDialog = vue.ref();
|
|
4610
|
+
const dataSourceValues = vue.ref({});
|
|
4611
|
+
const editable = vue.computed(() => dataSourceService?.get("editable") ?? true);
|
|
4612
|
+
const editHandler = (id) => {
|
|
4613
|
+
if (!editDialog.value)
|
|
4614
|
+
return;
|
|
4615
|
+
dataSourceValues.value = {
|
|
4616
|
+
...dataSourceService?.getDataSourceById(id)
|
|
4617
|
+
};
|
|
4618
|
+
dialogTitle.value = `编辑${dataSourceValues.value.title || ""}`;
|
|
4619
|
+
editDialog.value.show();
|
|
4620
|
+
};
|
|
4621
|
+
const submitDataSourceHandler = (value) => {
|
|
4622
|
+
if (value.id) {
|
|
4623
|
+
dataSourceService?.update(value);
|
|
4624
|
+
} else {
|
|
4625
|
+
dataSourceService?.add(value);
|
|
4626
|
+
}
|
|
4627
|
+
editDialog.value?.hide();
|
|
4628
|
+
};
|
|
4629
|
+
return {
|
|
4630
|
+
dialogTitle,
|
|
4631
|
+
editDialog,
|
|
4632
|
+
dataSourceValues,
|
|
4633
|
+
editable,
|
|
4634
|
+
editHandler,
|
|
4635
|
+
submitDataSourceHandler
|
|
4636
|
+
};
|
|
4637
|
+
};
|
|
4638
|
+
|
|
4602
4639
|
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
4640
|
+
...{
|
|
4641
|
+
name: "MEditorDataSourceConfigPanel"
|
|
4642
|
+
},
|
|
4643
|
+
__name: "DataSourceConfigPanel",
|
|
4644
|
+
props: /* @__PURE__ */ vue.mergeModels({
|
|
4645
|
+
title: {},
|
|
4646
|
+
values: {},
|
|
4647
|
+
disabled: { type: Boolean }
|
|
4648
|
+
}, {
|
|
4649
|
+
"visible": { type: Boolean, ...{ default: false } },
|
|
4650
|
+
"visibleModifiers": {},
|
|
4651
|
+
"width": { default: 670 },
|
|
4652
|
+
"widthModifiers": {}
|
|
4653
|
+
}),
|
|
4654
|
+
emits: /* @__PURE__ */ vue.mergeModels(["submit"], ["update:visible", "update:width"]),
|
|
4655
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
4656
|
+
const props = __props;
|
|
4657
|
+
const boxVisible = vue.useModel(__props, "visible");
|
|
4658
|
+
const width = vue.useModel(__props, "width");
|
|
4659
|
+
const emit = __emit;
|
|
4660
|
+
const services = vue.inject("services");
|
|
4661
|
+
const initValues = vue.ref({});
|
|
4662
|
+
const dataSourceConfig = vue.ref([]);
|
|
4663
|
+
const { height: editorHeight } = useEditorContentHeight();
|
|
4664
|
+
const parentFloating = vue.inject("parentFloating", vue.ref(null));
|
|
4665
|
+
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
4666
|
+
vue.watchEffect(() => {
|
|
4667
|
+
initValues.value = props.values;
|
|
4668
|
+
dataSourceConfig.value = services?.dataSourceService.getFormConfig(initValues.value.type) || [];
|
|
4669
|
+
});
|
|
4670
|
+
const submitHandler = (values) => {
|
|
4671
|
+
emit("submit", values);
|
|
4672
|
+
};
|
|
4673
|
+
const errorHandler = (error) => {
|
|
4674
|
+
design.tMagicMessage.error(error.message);
|
|
4675
|
+
};
|
|
4676
|
+
__expose({
|
|
4677
|
+
show() {
|
|
4678
|
+
calcBoxPosition();
|
|
4679
|
+
boxVisible.value = true;
|
|
4680
|
+
},
|
|
4681
|
+
hide() {
|
|
4682
|
+
boxVisible.value = false;
|
|
4683
|
+
}
|
|
4684
|
+
});
|
|
4685
|
+
return (_ctx, _cache) => {
|
|
4686
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
4687
|
+
visible: boxVisible.value,
|
|
4688
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => boxVisible.value = $event),
|
|
4689
|
+
width: width.value,
|
|
4690
|
+
"onUpdate:width": _cache[1] || (_cache[1] = ($event) => width.value = $event),
|
|
4691
|
+
height: vue.unref(editorHeight),
|
|
4692
|
+
"onUpdate:height": _cache[2] || (_cache[2] = ($event) => vue.isRef(editorHeight) ? editorHeight.value = $event : null),
|
|
4693
|
+
title: _ctx.title,
|
|
4694
|
+
position: vue.unref(boxPosition)
|
|
4695
|
+
}, {
|
|
4696
|
+
body: vue.withCtx(() => [
|
|
4697
|
+
vue.createVNode(vue.unref(form.MFormBox), {
|
|
4698
|
+
"label-width": "80px",
|
|
4699
|
+
title: _ctx.title,
|
|
4700
|
+
config: dataSourceConfig.value,
|
|
4701
|
+
values: initValues.value,
|
|
4702
|
+
disabled: _ctx.disabled,
|
|
4703
|
+
style: { "height": "100%" },
|
|
4704
|
+
onSubmit: submitHandler,
|
|
4705
|
+
onError: errorHandler
|
|
4706
|
+
}, null, 8, ["title", "config", "values", "disabled"])
|
|
4707
|
+
]),
|
|
4708
|
+
_: 1
|
|
4709
|
+
}, 8, ["visible", "width", "height", "title", "position"]);
|
|
4710
|
+
};
|
|
4711
|
+
}
|
|
4712
|
+
});
|
|
4713
|
+
|
|
4714
|
+
const _hoisted_1$o = { style: { "width": "100%", "display": "flex", "align-items": "center" } };
|
|
4715
|
+
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
4603
4716
|
...{
|
|
4604
4717
|
name: "MFieldsDataSourceFieldSelect"
|
|
4605
4718
|
},
|
|
@@ -4620,6 +4733,13 @@
|
|
|
4620
4733
|
const services = vue.inject("services");
|
|
4621
4734
|
const emit = __emit;
|
|
4622
4735
|
const props = __props;
|
|
4736
|
+
const selectedDataSourceId = vue.computed(() => {
|
|
4737
|
+
const value = props.model[props.name];
|
|
4738
|
+
if (!Array.isArray(value) || !value.length) {
|
|
4739
|
+
return "";
|
|
4740
|
+
}
|
|
4741
|
+
return value[0].replace(utils.DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, "");
|
|
4742
|
+
});
|
|
4623
4743
|
const dataSources = vue.computed(() => services?.dataSourceService.get("dataSources"));
|
|
4624
4744
|
const getOptionChildren = (fields = [], dataSourceFieldType = ["any"]) => {
|
|
4625
4745
|
const child = [];
|
|
@@ -4638,7 +4758,7 @@
|
|
|
4638
4758
|
child.push(item);
|
|
4639
4759
|
return;
|
|
4640
4760
|
}
|
|
4641
|
-
if (!dataSourceFieldType.includes(fieldType) &&
|
|
4761
|
+
if (!dataSourceFieldType.includes(fieldType) && !["array", "object", "any"].includes(fieldType)) {
|
|
4642
4762
|
return;
|
|
4643
4763
|
}
|
|
4644
4764
|
if (!children.length && ["object", "array", "any"].includes(field.type || "")) {
|
|
@@ -4665,12 +4785,19 @@
|
|
|
4665
4785
|
};
|
|
4666
4786
|
});
|
|
4667
4787
|
const showDataSourceFieldSelect = vue.ref(false);
|
|
4668
|
-
vue.
|
|
4669
|
-
|
|
4670
|
-
|
|
4671
|
-
|
|
4788
|
+
vue.watch(
|
|
4789
|
+
() => props.model[props.name],
|
|
4790
|
+
(value) => {
|
|
4791
|
+
if (Array.isArray(value) && typeof value[0] === "string" && value[0].startsWith(utils.DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX)) {
|
|
4792
|
+
showDataSourceFieldSelect.value = true;
|
|
4793
|
+
} else {
|
|
4794
|
+
showDataSourceFieldSelect.value = false;
|
|
4795
|
+
}
|
|
4796
|
+
},
|
|
4797
|
+
{
|
|
4798
|
+
immediate: true
|
|
4672
4799
|
}
|
|
4673
|
-
|
|
4800
|
+
);
|
|
4674
4801
|
const mForm = vue.inject("mForm");
|
|
4675
4802
|
const type = vue.computed(() => {
|
|
4676
4803
|
let type2 = props.config.fieldConfig?.type;
|
|
@@ -4697,6 +4824,9 @@
|
|
|
4697
4824
|
const onChangeHandler = (value) => {
|
|
4698
4825
|
emit("change", value);
|
|
4699
4826
|
};
|
|
4827
|
+
const { editDialog, dataSourceValues, dialogTitle, editable, editHandler, submitDataSourceHandler } = useDataSourceEdit(
|
|
4828
|
+
services?.dataSourceService
|
|
4829
|
+
);
|
|
4700
4830
|
return (_ctx, _cache) => {
|
|
4701
4831
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$o, [
|
|
4702
4832
|
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tagName.value), {
|
|
@@ -4712,19 +4842,37 @@
|
|
|
4712
4842
|
prop: `${_ctx.prop}${_ctx.prop ? "." : ""}${_ctx.name}`,
|
|
4713
4843
|
onChange: onChangeHandler
|
|
4714
4844
|
}, null, 40, ["config", "model", "name", "disabled", "size", "last-values", "init-values", "values", "prop"])),
|
|
4715
|
-
_ctx.config.fieldConfig ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
4845
|
+
(showDataSourceFieldSelect.value || !_ctx.config.fieldConfig) && selectedDataSourceId.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
4716
4846
|
key: 0,
|
|
4717
4847
|
style: { "margin-left": "5px" },
|
|
4718
|
-
|
|
4848
|
+
size: _ctx.size,
|
|
4849
|
+
onClick: _cache[0] || (_cache[0] = ($event) => vue.unref(editHandler)(selectedDataSourceId.value))
|
|
4850
|
+
}, {
|
|
4851
|
+
default: vue.withCtx(() => [
|
|
4852
|
+
vue.createVNode(_sfc_main$U, { icon: vue.unref(iconsVue.Edit) }, null, 8, ["icon"])
|
|
4853
|
+
]),
|
|
4854
|
+
_: 1
|
|
4855
|
+
}, 8, ["size"])) : vue.createCommentVNode("", true),
|
|
4856
|
+
_ctx.config.fieldConfig ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
4857
|
+
key: 1,
|
|
4858
|
+
style: { "margin-left": "5px" },
|
|
4719
4859
|
type: showDataSourceFieldSelect.value ? "primary" : "default",
|
|
4720
4860
|
size: _ctx.size,
|
|
4721
|
-
onClick: _cache[
|
|
4861
|
+
onClick: _cache[1] || (_cache[1] = ($event) => showDataSourceFieldSelect.value = !showDataSourceFieldSelect.value)
|
|
4722
4862
|
}, {
|
|
4723
4863
|
default: vue.withCtx(() => [
|
|
4724
4864
|
vue.createVNode(_sfc_main$U, { icon: vue.unref(iconsVue.Coin) }, null, 8, ["icon"])
|
|
4725
4865
|
]),
|
|
4726
4866
|
_: 1
|
|
4727
|
-
}, 8, ["type", "size"])) : vue.createCommentVNode("", true)
|
|
4867
|
+
}, 8, ["type", "size"])) : vue.createCommentVNode("", true),
|
|
4868
|
+
vue.createVNode(_sfc_main$K, {
|
|
4869
|
+
ref_key: "editDialog",
|
|
4870
|
+
ref: editDialog,
|
|
4871
|
+
disabled: !vue.unref(editable),
|
|
4872
|
+
values: vue.unref(dataSourceValues),
|
|
4873
|
+
title: vue.unref(dialogTitle),
|
|
4874
|
+
onSubmit: vue.unref(submitDataSourceHandler)
|
|
4875
|
+
}, null, 8, ["disabled", "values", "title", "onSubmit"])
|
|
4728
4876
|
]);
|
|
4729
4877
|
};
|
|
4730
4878
|
}
|
|
@@ -4733,7 +4881,7 @@
|
|
|
4733
4881
|
const _hoisted_1$n = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
4734
4882
|
const _hoisted_2$h = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
4735
4883
|
const _hoisted_3$7 = { class: "el-input__inner t-input__inner" };
|
|
4736
|
-
const _sfc_main$
|
|
4884
|
+
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
4737
4885
|
...{
|
|
4738
4886
|
name: "MFieldsDataSourceInput"
|
|
4739
4887
|
},
|
|
@@ -4971,7 +5119,7 @@
|
|
|
4971
5119
|
|
|
4972
5120
|
const _hoisted_1$m = { class: "m-editor-data-source-methods" };
|
|
4973
5121
|
const _hoisted_2$g = { class: "m-editor-data-source-methods-footer" };
|
|
4974
|
-
const _sfc_main$
|
|
5122
|
+
const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
|
|
4975
5123
|
...{
|
|
4976
5124
|
name: "MFieldsDataSourceMethods"
|
|
4977
5125
|
},
|
|
@@ -5077,7 +5225,7 @@
|
|
|
5077
5225
|
|
|
5078
5226
|
const _hoisted_1$l = { class: "m-fields-data-source-method-select" };
|
|
5079
5227
|
const _hoisted_2$f = { class: "data-source-method-select-container" };
|
|
5080
|
-
const _sfc_main$
|
|
5228
|
+
const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
|
|
5081
5229
|
...{
|
|
5082
5230
|
name: "MFieldsDataSourceMethodSelect"
|
|
5083
5231
|
},
|
|
@@ -5207,7 +5355,7 @@
|
|
|
5207
5355
|
|
|
5208
5356
|
const _hoisted_1$k = { class: "m-editor-data-source-fields" };
|
|
5209
5357
|
const _hoisted_2$e = { class: "m-editor-data-source-fields-footer" };
|
|
5210
|
-
const _sfc_main$
|
|
5358
|
+
const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
|
|
5211
5359
|
...{
|
|
5212
5360
|
name: "MFieldsDataSourceMocks"
|
|
5213
5361
|
},
|
|
@@ -5460,7 +5608,7 @@
|
|
|
5460
5608
|
}
|
|
5461
5609
|
});
|
|
5462
5610
|
|
|
5463
|
-
const _sfc_main$
|
|
5611
|
+
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
5464
5612
|
...{
|
|
5465
5613
|
name: "MFieldsDataSourceSelect"
|
|
5466
5614
|
},
|
|
@@ -5522,7 +5670,7 @@
|
|
|
5522
5670
|
key: 1,
|
|
5523
5671
|
class: "fullWidth"
|
|
5524
5672
|
};
|
|
5525
|
-
const _sfc_main$
|
|
5673
|
+
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
5526
5674
|
...{
|
|
5527
5675
|
name: "MFieldsEventSelect"
|
|
5528
5676
|
},
|
|
@@ -5796,7 +5944,7 @@
|
|
|
5796
5944
|
const _hoisted_4$6 = [
|
|
5797
5945
|
_hoisted_2$c
|
|
5798
5946
|
];
|
|
5799
|
-
const _sfc_main$
|
|
5947
|
+
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
5800
5948
|
...{
|
|
5801
5949
|
name: "MEditorCodeIcon"
|
|
5802
5950
|
},
|
|
@@ -5811,7 +5959,7 @@
|
|
|
5811
5959
|
const _hoisted_1$h = { class: "m-fields-key-value" };
|
|
5812
5960
|
const _hoisted_2$b = { key: 0 };
|
|
5813
5961
|
const _hoisted_3$6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
5814
|
-
const _sfc_main$
|
|
5962
|
+
const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
|
|
5815
5963
|
...{
|
|
5816
5964
|
name: "MFieldsKeyValue"
|
|
5817
5965
|
},
|
|
@@ -5935,7 +6083,7 @@
|
|
|
5935
6083
|
size: "default",
|
|
5936
6084
|
disabled: _ctx.disabled,
|
|
5937
6085
|
link: "",
|
|
5938
|
-
icon: _sfc_main$
|
|
6086
|
+
icon: _sfc_main$C,
|
|
5939
6087
|
onClick: _cache[0] || (_cache[0] = ($event) => showCode.value = !showCode.value)
|
|
5940
6088
|
}, null, 8, ["disabled"])) : vue.createCommentVNode("", true)
|
|
5941
6089
|
]);
|
|
@@ -5945,7 +6093,7 @@
|
|
|
5945
6093
|
|
|
5946
6094
|
const _hoisted_1$g = { class: "m-fields-page-fragment-select" };
|
|
5947
6095
|
const _hoisted_2$a = { class: "page-fragment-select-container" };
|
|
5948
|
-
const _sfc_main$
|
|
6096
|
+
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
5949
6097
|
...{
|
|
5950
6098
|
name: "MFieldsPageFragmentSelect"
|
|
5951
6099
|
},
|
|
@@ -6017,7 +6165,7 @@
|
|
|
6017
6165
|
class: "m-fields-ui-select",
|
|
6018
6166
|
style: { "display": "flex" }
|
|
6019
6167
|
};
|
|
6020
|
-
const _sfc_main$
|
|
6168
|
+
const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
|
|
6021
6169
|
...{
|
|
6022
6170
|
name: "MFieldsUISelect"
|
|
6023
6171
|
},
|
|
@@ -6205,7 +6353,7 @@
|
|
|
6205
6353
|
};
|
|
6206
6354
|
};
|
|
6207
6355
|
|
|
6208
|
-
const _sfc_main$
|
|
6356
|
+
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
6209
6357
|
...{
|
|
6210
6358
|
name: "MEditorResizer"
|
|
6211
6359
|
},
|
|
@@ -6227,7 +6375,7 @@
|
|
|
6227
6375
|
}
|
|
6228
6376
|
});
|
|
6229
6377
|
|
|
6230
|
-
const _sfc_main$
|
|
6378
|
+
const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
|
|
6231
6379
|
...{
|
|
6232
6380
|
name: "MEditorSplitView"
|
|
6233
6381
|
},
|
|
@@ -6343,6 +6491,9 @@
|
|
|
6343
6491
|
__expose({
|
|
6344
6492
|
updateWidth() {
|
|
6345
6493
|
clientWidth = props.width ?? el.value?.clientWidth ?? clientWidth;
|
|
6494
|
+
if (clientWidth <= 0) {
|
|
6495
|
+
return;
|
|
6496
|
+
}
|
|
6346
6497
|
const columnWidth = getCenterWidth(props.left, props.right);
|
|
6347
6498
|
emit("change", {
|
|
6348
6499
|
left: columnWidth.left,
|
|
@@ -6365,7 +6516,7 @@
|
|
|
6365
6516
|
}, [
|
|
6366
6517
|
vue.renderSlot(_ctx.$slots, "left")
|
|
6367
6518
|
], 6),
|
|
6368
|
-
vue.createVNode(_sfc_main$
|
|
6519
|
+
vue.createVNode(_sfc_main$y, { onChange: changeLeft })
|
|
6369
6520
|
], 64)) : vue.createCommentVNode("", true),
|
|
6370
6521
|
vue.createElementVNode("div", {
|
|
6371
6522
|
class: vue.normalizeClass(["m-editor-layout-center", _ctx.centerClass]),
|
|
@@ -6374,7 +6525,7 @@
|
|
|
6374
6525
|
vue.renderSlot(_ctx.$slots, "center")
|
|
6375
6526
|
], 6),
|
|
6376
6527
|
hasRight.value && _ctx.$slots.right ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
|
|
6377
|
-
vue.createVNode(_sfc_main$
|
|
6528
|
+
vue.createVNode(_sfc_main$y, { onChange: changeRight }),
|
|
6378
6529
|
vue.createElementVNode("div", {
|
|
6379
6530
|
class: vue.normalizeClass(["m-editor-layout-right", _ctx.rightClass]),
|
|
6380
6531
|
style: vue.normalizeStyle(`width: ${_ctx.right}px`)
|
|
@@ -6392,7 +6543,7 @@
|
|
|
6392
6543
|
class: "menu-item-text"
|
|
6393
6544
|
};
|
|
6394
6545
|
const _hoisted_2$9 = { class: "el-dropdown-link menubar-menu-button" };
|
|
6395
|
-
const _sfc_main$
|
|
6546
|
+
const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
|
|
6396
6547
|
...{
|
|
6397
6548
|
name: "MEditorToolButton"
|
|
6398
6549
|
},
|
|
@@ -6557,7 +6708,7 @@
|
|
|
6557
6708
|
key: 1,
|
|
6558
6709
|
style: { "width": "21px" }
|
|
6559
6710
|
};
|
|
6560
|
-
const _sfc_main$
|
|
6711
|
+
const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
|
|
6561
6712
|
...{
|
|
6562
6713
|
name: "MEditorPageBarAddButton"
|
|
6563
6714
|
},
|
|
@@ -6597,7 +6748,7 @@
|
|
|
6597
6748
|
}
|
|
6598
6749
|
});
|
|
6599
6750
|
|
|
6600
|
-
const _sfc_main$
|
|
6751
|
+
const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
|
|
6601
6752
|
...{
|
|
6602
6753
|
name: "MEditorPageBarScrollContainer"
|
|
6603
6754
|
},
|
|
@@ -6726,7 +6877,7 @@
|
|
|
6726
6877
|
}
|
|
6727
6878
|
});
|
|
6728
6879
|
|
|
6729
|
-
const _sfc_main$
|
|
6880
|
+
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
6730
6881
|
...{
|
|
6731
6882
|
name: "MEditorPageBarSwitchTypeButton"
|
|
6732
6883
|
},
|
|
@@ -6774,7 +6925,7 @@
|
|
|
6774
6925
|
const _hoisted_2$8 = ["onClick"];
|
|
6775
6926
|
const _hoisted_3$5 = { class: "m-editor-page-bar-title" };
|
|
6776
6927
|
const _hoisted_4$5 = ["title"];
|
|
6777
|
-
const _sfc_main$
|
|
6928
|
+
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
6778
6929
|
...{
|
|
6779
6930
|
name: "MEditorPageBar"
|
|
6780
6931
|
},
|
|
@@ -6853,14 +7004,14 @@
|
|
|
6853
7004
|
};
|
|
6854
7005
|
return (_ctx, _cache) => {
|
|
6855
7006
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$c, [
|
|
6856
|
-
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7007
|
+
!_ctx.disabledPageFragment ? (vue.openBlock(), vue.createBlock(_sfc_main$t, {
|
|
6857
7008
|
key: 0,
|
|
6858
7009
|
modelValue: active.value,
|
|
6859
7010
|
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => active.value = $event)
|
|
6860
7011
|
}, null, 8, ["modelValue"])) : vue.createCommentVNode("", true),
|
|
6861
|
-
vue.createVNode(_sfc_main$
|
|
7012
|
+
vue.createVNode(_sfc_main$u, { type: active.value }, {
|
|
6862
7013
|
prepend: vue.withCtx(() => [
|
|
6863
|
-
vue.createVNode(_sfc_main$
|
|
7014
|
+
vue.createVNode(_sfc_main$v, { type: active.value }, null, 8, ["type"])
|
|
6864
7015
|
]),
|
|
6865
7016
|
default: vue.withCtx(() => [
|
|
6866
7017
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (item) => {
|
|
@@ -6893,7 +7044,7 @@
|
|
|
6893
7044
|
default: vue.withCtx(() => [
|
|
6894
7045
|
vue.createElementVNode("div", null, [
|
|
6895
7046
|
vue.renderSlot(_ctx.$slots, "page-bar-popover", { page: item }, () => [
|
|
6896
|
-
vue.createVNode(_sfc_main$
|
|
7047
|
+
vue.createVNode(_sfc_main$w, {
|
|
6897
7048
|
data: {
|
|
6898
7049
|
type: "button",
|
|
6899
7050
|
text: "复制",
|
|
@@ -6901,7 +7052,7 @@
|
|
|
6901
7052
|
handler: () => copy(item)
|
|
6902
7053
|
}
|
|
6903
7054
|
}, null, 8, ["data"]),
|
|
6904
|
-
vue.createVNode(_sfc_main$
|
|
7055
|
+
vue.createVNode(_sfc_main$w, {
|
|
6905
7056
|
data: {
|
|
6906
7057
|
type: "button",
|
|
6907
7058
|
text: "删除",
|
|
@@ -6928,7 +7079,7 @@
|
|
|
6928
7079
|
const _hoisted_2$7 = { class: "m-editor-empty-content" };
|
|
6929
7080
|
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
6930
7081
|
const _hoisted_4$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面片", -1);
|
|
6931
|
-
const _sfc_main$
|
|
7082
|
+
const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
|
|
6932
7083
|
...{
|
|
6933
7084
|
name: "MEditorAddPageBox"
|
|
6934
7085
|
},
|
|
@@ -6983,7 +7134,7 @@
|
|
|
6983
7134
|
const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
6984
7135
|
const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
6985
7136
|
const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
6986
|
-
const _sfc_main$
|
|
7137
|
+
const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
|
|
6987
7138
|
...{
|
|
6988
7139
|
name: "MEditorFramework"
|
|
6989
7140
|
},
|
|
@@ -7002,10 +7153,11 @@
|
|
|
7002
7153
|
const stageLoading = vue.computed(() => editorService?.get("stageLoading") || false);
|
|
7003
7154
|
const showSrc = vue.computed(() => uiService?.get("showSrc"));
|
|
7004
7155
|
const getLeftColumnWidthCacheData = () => Number(globalThis.localStorage.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_LEFT_COLUMN_WIDTH;
|
|
7156
|
+
const getRightColumnWidthCacheData = () => Number(globalThis.localStorage.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY)) || DEFAULT_RIGHT_COLUMN_WIDTH;
|
|
7005
7157
|
const columnWidth = vue.ref({
|
|
7006
7158
|
left: getLeftColumnWidthCacheData(),
|
|
7007
7159
|
center: 0,
|
|
7008
|
-
right:
|
|
7160
|
+
right: getRightColumnWidthCacheData()
|
|
7009
7161
|
});
|
|
7010
7162
|
vue.watch(pageLength, () => {
|
|
7011
7163
|
splitView.value?.updateWidth();
|
|
@@ -7066,7 +7218,7 @@
|
|
|
7066
7218
|
options: vue.unref(codeOptions),
|
|
7067
7219
|
onSave: saveCode
|
|
7068
7220
|
}, null, 8, ["init-values", "options"])
|
|
7069
|
-
]) : vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7221
|
+
]) : vue.withDirectives((vue.openBlock(), vue.createBlock(_sfc_main$x, {
|
|
7070
7222
|
key: 1,
|
|
7071
7223
|
"element-loading-text": "Runtime 加载中...",
|
|
7072
7224
|
ref_key: "splitView",
|
|
@@ -7090,10 +7242,10 @@
|
|
|
7090
7242
|
]),
|
|
7091
7243
|
center: vue.withCtx(() => [
|
|
7092
7244
|
page.value ? vue.renderSlot(_ctx.$slots, "workspace", { key: 0 }) : vue.renderSlot(_ctx.$slots, "empty", { key: 1 }, () => [
|
|
7093
|
-
vue.createVNode(_sfc_main$
|
|
7245
|
+
vue.createVNode(_sfc_main$r, { "disabled-page-fragment": _ctx.disabledPageFragment }, null, 8, ["disabled-page-fragment"])
|
|
7094
7246
|
]),
|
|
7095
7247
|
vue.renderSlot(_ctx.$slots, "page-bar", {}, () => [
|
|
7096
|
-
vue.createVNode(_sfc_main$
|
|
7248
|
+
vue.createVNode(_sfc_main$s, { "disabled-page-fragment": _ctx.disabledPageFragment }, {
|
|
7097
7249
|
"page-bar-title": vue.withCtx(({ page: page2 }) => [
|
|
7098
7250
|
vue.renderSlot(_ctx.$slots, "page-bar-title", { page: page2 })
|
|
7099
7251
|
]),
|
|
@@ -7128,7 +7280,7 @@
|
|
|
7128
7280
|
}
|
|
7129
7281
|
});
|
|
7130
7282
|
|
|
7131
|
-
const _sfc_main$
|
|
7283
|
+
const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
|
|
7132
7284
|
...{
|
|
7133
7285
|
name: "MEditorNavMenu"
|
|
7134
7286
|
},
|
|
@@ -7310,7 +7462,7 @@
|
|
|
7310
7462
|
style: vue.normalizeStyle(`width: ${columnWidth.value?.[key]}px`)
|
|
7311
7463
|
}, [
|
|
7312
7464
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(buttons.value[key], (item, index) => {
|
|
7313
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7465
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$w, {
|
|
7314
7466
|
data: item,
|
|
7315
7467
|
key: index
|
|
7316
7468
|
}, null, 8, ["data"]);
|
|
@@ -7323,7 +7475,7 @@
|
|
|
7323
7475
|
});
|
|
7324
7476
|
|
|
7325
7477
|
const _hoisted_1$a = { class: "m-editor-props-panel" };
|
|
7326
|
-
const _sfc_main$
|
|
7478
|
+
const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
|
|
7327
7479
|
...{
|
|
7328
7480
|
name: "MEditorPropsPanel"
|
|
7329
7481
|
},
|
|
@@ -7426,7 +7578,7 @@
|
|
|
7426
7578
|
}
|
|
7427
7579
|
});
|
|
7428
7580
|
|
|
7429
|
-
const _sfc_main$
|
|
7581
|
+
const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
|
|
7430
7582
|
...{
|
|
7431
7583
|
name: "MEditorSearchInput"
|
|
7432
7584
|
},
|
|
@@ -7484,7 +7636,7 @@
|
|
|
7484
7636
|
key: 0,
|
|
7485
7637
|
class: "m-editor-tree-node-children"
|
|
7486
7638
|
};
|
|
7487
|
-
const _sfc_main$
|
|
7639
|
+
const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
|
|
7488
7640
|
...{
|
|
7489
7641
|
name: "MEditorTreeNode"
|
|
7490
7642
|
},
|
|
@@ -7605,7 +7757,7 @@
|
|
|
7605
7757
|
key: 1,
|
|
7606
7758
|
class: "m-editor-tree-empty"
|
|
7607
7759
|
};
|
|
7608
|
-
const _sfc_main$
|
|
7760
|
+
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
7609
7761
|
...{
|
|
7610
7762
|
name: "MEditorTree"
|
|
7611
7763
|
},
|
|
@@ -7629,7 +7781,7 @@
|
|
|
7629
7781
|
onDragover: handleDragOver
|
|
7630
7782
|
}, [
|
|
7631
7783
|
_ctx.data?.length ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(_ctx.data, (item) => {
|
|
7632
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7784
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$m, {
|
|
7633
7785
|
key: item.id,
|
|
7634
7786
|
data: item,
|
|
7635
7787
|
indent: _ctx.indent,
|
|
@@ -7726,7 +7878,7 @@
|
|
|
7726
7878
|
};
|
|
7727
7879
|
};
|
|
7728
7880
|
|
|
7729
|
-
const _sfc_main$
|
|
7881
|
+
const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
|
|
7730
7882
|
...{
|
|
7731
7883
|
name: "MEditorCodeBlockList"
|
|
7732
7884
|
},
|
|
@@ -7808,7 +7960,7 @@
|
|
|
7808
7960
|
filter: filterTextChangeHandler
|
|
7809
7961
|
});
|
|
7810
7962
|
return (_ctx, _cache) => {
|
|
7811
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
7963
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$l, {
|
|
7812
7964
|
data: codeList.value,
|
|
7813
7965
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
7814
7966
|
onNodeClick: clickHandler
|
|
@@ -7865,7 +8017,7 @@
|
|
|
7865
8017
|
});
|
|
7866
8018
|
|
|
7867
8019
|
const _hoisted_1$7 = { class: "search-wrapper" };
|
|
7868
|
-
const _sfc_main$
|
|
8020
|
+
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
7869
8021
|
...{
|
|
7870
8022
|
name: "MEditorCodeBlockListPanel"
|
|
7871
8023
|
},
|
|
@@ -7887,7 +8039,7 @@
|
|
|
7887
8039
|
default: vue.withCtx(() => [
|
|
7888
8040
|
vue.renderSlot(_ctx.$slots, "code-block-panel-header", {}, () => [
|
|
7889
8041
|
vue.createElementVNode("div", _hoisted_1$7, [
|
|
7890
|
-
vue.createVNode(_sfc_main$
|
|
8042
|
+
vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
7891
8043
|
editable.value ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicButton), {
|
|
7892
8044
|
key: 0,
|
|
7893
8045
|
class: "create-code-button",
|
|
@@ -7903,7 +8055,7 @@
|
|
|
7903
8055
|
vue.renderSlot(_ctx.$slots, "code-block-panel-search")
|
|
7904
8056
|
])
|
|
7905
8057
|
]),
|
|
7906
|
-
vue.createVNode(_sfc_main$
|
|
8058
|
+
vue.createVNode(_sfc_main$k, {
|
|
7907
8059
|
ref_key: "codeBlockList",
|
|
7908
8060
|
ref: codeBlockList,
|
|
7909
8061
|
"custom-error": _ctx.customError,
|
|
@@ -7934,81 +8086,6 @@
|
|
|
7934
8086
|
}
|
|
7935
8087
|
});
|
|
7936
8088
|
|
|
7937
|
-
const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
|
|
7938
|
-
...{
|
|
7939
|
-
name: "MEditorDataSourceConfigPanel"
|
|
7940
|
-
},
|
|
7941
|
-
__name: "DataSourceConfigPanel",
|
|
7942
|
-
props: /* @__PURE__ */ vue.mergeModels({
|
|
7943
|
-
title: {},
|
|
7944
|
-
values: {},
|
|
7945
|
-
disabled: { type: Boolean }
|
|
7946
|
-
}, {
|
|
7947
|
-
"visible": { type: Boolean, ...{ default: false } },
|
|
7948
|
-
"visibleModifiers": {},
|
|
7949
|
-
"width": { default: 670 },
|
|
7950
|
-
"widthModifiers": {}
|
|
7951
|
-
}),
|
|
7952
|
-
emits: /* @__PURE__ */ vue.mergeModels(["submit"], ["update:visible", "update:width"]),
|
|
7953
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
7954
|
-
const props = __props;
|
|
7955
|
-
const boxVisible = vue.useModel(__props, "visible");
|
|
7956
|
-
const width = vue.useModel(__props, "width");
|
|
7957
|
-
const emit = __emit;
|
|
7958
|
-
const services = vue.inject("services");
|
|
7959
|
-
const initValues = vue.ref({});
|
|
7960
|
-
const dataSourceConfig = vue.ref([]);
|
|
7961
|
-
const { height: editorHeight } = useEditorContentHeight();
|
|
7962
|
-
const parentFloating = vue.inject("parentFloating", vue.ref(null));
|
|
7963
|
-
const { boxPosition, calcBoxPosition } = useNextFloatBoxPosition(services?.uiService, parentFloating);
|
|
7964
|
-
vue.watchEffect(() => {
|
|
7965
|
-
initValues.value = props.values;
|
|
7966
|
-
dataSourceConfig.value = services?.dataSourceService.getFormConfig(initValues.value.type) || [];
|
|
7967
|
-
});
|
|
7968
|
-
const submitHandler = (values) => {
|
|
7969
|
-
emit("submit", values);
|
|
7970
|
-
};
|
|
7971
|
-
const errorHandler = (error) => {
|
|
7972
|
-
design.tMagicMessage.error(error.message);
|
|
7973
|
-
};
|
|
7974
|
-
__expose({
|
|
7975
|
-
show() {
|
|
7976
|
-
calcBoxPosition();
|
|
7977
|
-
boxVisible.value = true;
|
|
7978
|
-
},
|
|
7979
|
-
hide() {
|
|
7980
|
-
boxVisible.value = false;
|
|
7981
|
-
}
|
|
7982
|
-
});
|
|
7983
|
-
return (_ctx, _cache) => {
|
|
7984
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$P, {
|
|
7985
|
-
visible: boxVisible.value,
|
|
7986
|
-
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => boxVisible.value = $event),
|
|
7987
|
-
width: width.value,
|
|
7988
|
-
"onUpdate:width": _cache[1] || (_cache[1] = ($event) => width.value = $event),
|
|
7989
|
-
height: vue.unref(editorHeight),
|
|
7990
|
-
"onUpdate:height": _cache[2] || (_cache[2] = ($event) => vue.isRef(editorHeight) ? editorHeight.value = $event : null),
|
|
7991
|
-
title: _ctx.title,
|
|
7992
|
-
position: vue.unref(boxPosition)
|
|
7993
|
-
}, {
|
|
7994
|
-
body: vue.withCtx(() => [
|
|
7995
|
-
vue.createVNode(vue.unref(form.MFormBox), {
|
|
7996
|
-
"label-width": "80px",
|
|
7997
|
-
title: _ctx.title,
|
|
7998
|
-
config: dataSourceConfig.value,
|
|
7999
|
-
values: initValues.value,
|
|
8000
|
-
disabled: _ctx.disabled,
|
|
8001
|
-
style: { "height": "100%" },
|
|
8002
|
-
onSubmit: submitHandler,
|
|
8003
|
-
onError: errorHandler
|
|
8004
|
-
}, null, 8, ["title", "config", "values", "disabled"])
|
|
8005
|
-
]),
|
|
8006
|
-
_: 1
|
|
8007
|
-
}, 8, ["visible", "width", "height", "title", "position"]);
|
|
8008
|
-
};
|
|
8009
|
-
}
|
|
8010
|
-
});
|
|
8011
|
-
|
|
8012
8089
|
const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
|
|
8013
8090
|
...{
|
|
8014
8091
|
name: "MEditorDataSourceList"
|
|
@@ -8098,7 +8175,7 @@
|
|
|
8098
8175
|
filter: filterTextChangeHandler
|
|
8099
8176
|
});
|
|
8100
8177
|
return (_ctx, _cache) => {
|
|
8101
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8178
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$l, {
|
|
8102
8179
|
data: list.value,
|
|
8103
8180
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
8104
8181
|
onNodeClick: clickHandler
|
|
@@ -8160,10 +8237,7 @@
|
|
|
8160
8237
|
__name: "DataSourceListPanel",
|
|
8161
8238
|
setup(__props) {
|
|
8162
8239
|
const { dataSourceService } = vue.inject("services") || {};
|
|
8163
|
-
const editDialog =
|
|
8164
|
-
const dataSourceValues = vue.ref({});
|
|
8165
|
-
const dialogTitle = vue.ref("");
|
|
8166
|
-
const editable = vue.computed(() => dataSourceService?.get("editable") ?? true);
|
|
8240
|
+
const { editDialog, dataSourceValues, dialogTitle, editable, editHandler, submitDataSourceHandler } = useDataSourceEdit(dataSourceService);
|
|
8167
8241
|
const datasourceTypeList = vue.computed(
|
|
8168
8242
|
() => [
|
|
8169
8243
|
{ text: "基础", type: "base" },
|
|
@@ -8186,26 +8260,9 @@
|
|
|
8186
8260
|
dialogTitle.value = `新增${datasourceType?.text || ""}`;
|
|
8187
8261
|
editDialog.value.show();
|
|
8188
8262
|
};
|
|
8189
|
-
const editHandler = (id) => {
|
|
8190
|
-
if (!editDialog.value)
|
|
8191
|
-
return;
|
|
8192
|
-
dataSourceValues.value = {
|
|
8193
|
-
...dataSourceService?.getDataSourceById(id)
|
|
8194
|
-
};
|
|
8195
|
-
dialogTitle.value = `编辑${dataSourceValues.value.title || ""}`;
|
|
8196
|
-
editDialog.value.show();
|
|
8197
|
-
};
|
|
8198
8263
|
const removeHandler = (id) => {
|
|
8199
8264
|
dataSourceService?.remove(id);
|
|
8200
8265
|
};
|
|
8201
|
-
const submitDataSourceHandler = (value) => {
|
|
8202
|
-
if (value.id) {
|
|
8203
|
-
dataSourceService?.update(value);
|
|
8204
|
-
} else {
|
|
8205
|
-
dataSourceService?.add(value);
|
|
8206
|
-
}
|
|
8207
|
-
editDialog.value?.hide();
|
|
8208
|
-
};
|
|
8209
8266
|
const dataSourceList = vue.ref();
|
|
8210
8267
|
const filterTextChangeHandler = (val) => {
|
|
8211
8268
|
dataSourceList.value?.filter(val);
|
|
@@ -8215,8 +8272,8 @@
|
|
|
8215
8272
|
vue.createVNode(vue.unref(design.TMagicScrollbar), { class: "data-source-list-panel m-editor-layer-panel" }, {
|
|
8216
8273
|
default: vue.withCtx(() => [
|
|
8217
8274
|
vue.createElementVNode("div", _hoisted_1$6, [
|
|
8218
|
-
vue.createVNode(_sfc_main$
|
|
8219
|
-
editable
|
|
8275
|
+
vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
8276
|
+
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
8220
8277
|
key: 0,
|
|
8221
8278
|
placement: "right"
|
|
8222
8279
|
}, {
|
|
@@ -8234,7 +8291,7 @@
|
|
|
8234
8291
|
default: vue.withCtx(() => [
|
|
8235
8292
|
vue.createElementVNode("div", _hoisted_2$5, [
|
|
8236
8293
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(datasourceTypeList.value, (item, index) => {
|
|
8237
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8294
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$w, {
|
|
8238
8295
|
data: {
|
|
8239
8296
|
type: "button",
|
|
8240
8297
|
text: item.text,
|
|
@@ -8254,20 +8311,20 @@
|
|
|
8254
8311
|
vue.createVNode(_sfc_main$i, {
|
|
8255
8312
|
ref_key: "dataSourceList",
|
|
8256
8313
|
ref: dataSourceList,
|
|
8257
|
-
onEdit: editHandler,
|
|
8314
|
+
onEdit: vue.unref(editHandler),
|
|
8258
8315
|
onRemove: removeHandler
|
|
8259
|
-
}, null,
|
|
8316
|
+
}, null, 8, ["onEdit"])
|
|
8260
8317
|
]),
|
|
8261
8318
|
_: 3
|
|
8262
8319
|
}),
|
|
8263
|
-
vue.createVNode(_sfc_main$
|
|
8320
|
+
vue.createVNode(_sfc_main$K, {
|
|
8264
8321
|
ref_key: "editDialog",
|
|
8265
8322
|
ref: editDialog,
|
|
8266
|
-
disabled: !editable
|
|
8267
|
-
values: dataSourceValues
|
|
8268
|
-
title: dialogTitle
|
|
8269
|
-
onSubmit: submitDataSourceHandler
|
|
8270
|
-
}, null, 8, ["disabled", "values", "title"])
|
|
8323
|
+
disabled: !vue.unref(editable),
|
|
8324
|
+
values: vue.unref(dataSourceValues),
|
|
8325
|
+
title: vue.unref(dialogTitle),
|
|
8326
|
+
onSubmit: vue.unref(submitDataSourceHandler)
|
|
8327
|
+
}, null, 8, ["disabled", "values", "title", "onSubmit"])
|
|
8271
8328
|
], 64);
|
|
8272
8329
|
};
|
|
8273
8330
|
}
|
|
@@ -8404,7 +8461,7 @@
|
|
|
8404
8461
|
vue.renderSlot(_ctx.$slots, "title"),
|
|
8405
8462
|
vue.createElementVNode("div", null, [
|
|
8406
8463
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.menuData, (item, index) => {
|
|
8407
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
8464
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$w, {
|
|
8408
8465
|
"event-type": "mouseup",
|
|
8409
8466
|
ref_for: true,
|
|
8410
8467
|
ref_key: "buttons",
|
|
@@ -9180,8 +9237,8 @@
|
|
|
9180
9237
|
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "m-editor-layer-panel" }, {
|
|
9181
9238
|
default: vue.withCtx(() => [
|
|
9182
9239
|
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
9183
|
-
vue.createVNode(_sfc_main$
|
|
9184
|
-
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$
|
|
9240
|
+
vue.createVNode(_sfc_main$n, { onSearch: vue.unref(filterTextChangeHandler) }, null, 8, ["onSearch"]),
|
|
9241
|
+
page.value && vue.unref(nodeStatusMap) ? (vue.openBlock(), vue.createBlock(_sfc_main$l, {
|
|
9185
9242
|
key: 0,
|
|
9186
9243
|
tabindex: "-1",
|
|
9187
9244
|
ref_key: "tree",
|
|
@@ -9307,7 +9364,7 @@
|
|
|
9307
9364
|
"model-value": collapseValue.value
|
|
9308
9365
|
}, {
|
|
9309
9366
|
default: vue.withCtx(() => [
|
|
9310
|
-
vue.createVNode(_sfc_main$
|
|
9367
|
+
vue.createVNode(_sfc_main$n, { onSearch: filterTextChangeHandler }),
|
|
9311
9368
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(list.value, (group, index) => {
|
|
9312
9369
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
9313
9370
|
group.items && group.items.length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicCollapseItem), {
|
|
@@ -9417,7 +9474,7 @@
|
|
|
9417
9474
|
type: "component",
|
|
9418
9475
|
icon: iconsVue.EditPen,
|
|
9419
9476
|
text: "代码编辑",
|
|
9420
|
-
component: _sfc_main$
|
|
9477
|
+
component: _sfc_main$j,
|
|
9421
9478
|
slots: {}
|
|
9422
9479
|
},
|
|
9423
9480
|
"data-source": {
|
|
@@ -10051,7 +10108,7 @@
|
|
|
10051
10108
|
position: menuPosition.value
|
|
10052
10109
|
}, {
|
|
10053
10110
|
body: vue.withCtx(() => [
|
|
10054
|
-
vue.createVNode(_sfc_main$
|
|
10111
|
+
vue.createVNode(_sfc_main$l, {
|
|
10055
10112
|
class: "m-editor-node-list-menu magic-editor-layer-tree",
|
|
10056
10113
|
data: nodeData.value,
|
|
10057
10114
|
"node-status-map": vue.unref(nodeStatusMap),
|
|
@@ -11633,13 +11690,13 @@
|
|
|
11633
11690
|
vue.provide("stageOptions", stageOptions);
|
|
11634
11691
|
__expose(services);
|
|
11635
11692
|
return (_ctx, _cache) => {
|
|
11636
|
-
return vue.openBlock(), vue.createBlock(_sfc_main$
|
|
11693
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$q, { "disabled-page-fragment": _ctx.disabledPageFragment }, {
|
|
11637
11694
|
header: vue.withCtx(() => [
|
|
11638
11695
|
vue.renderSlot(_ctx.$slots, "header")
|
|
11639
11696
|
]),
|
|
11640
11697
|
nav: vue.withCtx(() => [
|
|
11641
11698
|
vue.renderSlot(_ctx.$slots, "nav", { editorService: vue.unref(editorService) }, () => [
|
|
11642
|
-
vue.createVNode(_sfc_main$
|
|
11699
|
+
vue.createVNode(_sfc_main$p, { data: _ctx.menu }, null, 8, ["data"])
|
|
11643
11700
|
])
|
|
11644
11701
|
]),
|
|
11645
11702
|
"content-before": vue.withCtx(() => [
|
|
@@ -11714,7 +11771,7 @@
|
|
|
11714
11771
|
]),
|
|
11715
11772
|
"props-panel": vue.withCtx(() => [
|
|
11716
11773
|
vue.renderSlot(_ctx.$slots, "props-panel", {}, () => [
|
|
11717
|
-
vue.createVNode(_sfc_main$
|
|
11774
|
+
vue.createVNode(_sfc_main$o, {
|
|
11718
11775
|
"extend-state": _ctx.extendFormState,
|
|
11719
11776
|
onMounted: _cache[0] || (_cache[0] = (instance) => _ctx.$emit("props-panel-mounted", instance)),
|
|
11720
11777
|
onFormError: _cache[1] || (_cache[1] = (e) => _ctx.$emit("props-form-error", e)),
|
|
@@ -11762,21 +11819,21 @@
|
|
|
11762
11819
|
setConfig(option);
|
|
11763
11820
|
app.component(`${_sfc_main.name || "MEditor"}`, _sfc_main);
|
|
11764
11821
|
app.component("magic-code-editor", _sfc_main$T);
|
|
11765
|
-
app.component("m-fields-ui-select", _sfc_main$
|
|
11822
|
+
app.component("m-fields-ui-select", _sfc_main$z);
|
|
11766
11823
|
app.component("m-fields-code-link", _sfc_main$R);
|
|
11767
11824
|
app.component("m-fields-vs-code", _sfc_main$S);
|
|
11768
11825
|
app.component("m-fields-code-select", _sfc_main$Q);
|
|
11769
11826
|
app.component("m-fields-code-select-col", _sfc_main$M);
|
|
11770
|
-
app.component("m-fields-event-select", _sfc_main$
|
|
11827
|
+
app.component("m-fields-event-select", _sfc_main$D);
|
|
11771
11828
|
app.component("m-fields-data-source-fields", _sfc_main$L);
|
|
11772
|
-
app.component("m-fields-data-source-mocks", _sfc_main$
|
|
11773
|
-
app.component("m-fields-key-value", _sfc_main$
|
|
11774
|
-
app.component("m-fields-data-source-input", _sfc_main$
|
|
11775
|
-
app.component("m-fields-data-source-select", _sfc_main$
|
|
11776
|
-
app.component("m-fields-data-source-methods", _sfc_main$
|
|
11777
|
-
app.component("m-fields-data-source-method-select", _sfc_main$
|
|
11778
|
-
app.component("m-fields-data-source-field-select", _sfc_main$
|
|
11779
|
-
app.component("m-fields-page-fragment-select", _sfc_main$
|
|
11829
|
+
app.component("m-fields-data-source-mocks", _sfc_main$F);
|
|
11830
|
+
app.component("m-fields-key-value", _sfc_main$B);
|
|
11831
|
+
app.component("m-fields-data-source-input", _sfc_main$I);
|
|
11832
|
+
app.component("m-fields-data-source-select", _sfc_main$E);
|
|
11833
|
+
app.component("m-fields-data-source-methods", _sfc_main$H);
|
|
11834
|
+
app.component("m-fields-data-source-method-select", _sfc_main$G);
|
|
11835
|
+
app.component("m-fields-data-source-field-select", _sfc_main$J);
|
|
11836
|
+
app.component("m-fields-page-fragment-select", _sfc_main$A);
|
|
11780
11837
|
}
|
|
11781
11838
|
};
|
|
11782
11839
|
|
|
@@ -11787,41 +11844,41 @@
|
|
|
11787
11844
|
exports.CODE_DRAFT_STORAGE_KEY = CODE_DRAFT_STORAGE_KEY;
|
|
11788
11845
|
exports.COPY_STORAGE_KEY = COPY_STORAGE_KEY;
|
|
11789
11846
|
exports.CodeBlockEditor = _sfc_main$O;
|
|
11790
|
-
exports.CodeBlockList = _sfc_main$
|
|
11791
|
-
exports.CodeBlockListPanel = _sfc_main$
|
|
11847
|
+
exports.CodeBlockList = _sfc_main$k;
|
|
11848
|
+
exports.CodeBlockListPanel = _sfc_main$j;
|
|
11792
11849
|
exports.CodeDeleteErrorType = CodeDeleteErrorType;
|
|
11793
11850
|
exports.CodeSelect = _sfc_main$Q;
|
|
11794
11851
|
exports.CodeSelectCol = _sfc_main$M;
|
|
11795
11852
|
exports.ColumnLayout = ColumnLayout;
|
|
11796
11853
|
exports.ComponentListPanel = _sfc_main$b;
|
|
11797
11854
|
exports.ContentMenu = _sfc_main$g;
|
|
11798
|
-
exports.DataSourceConfigPanel = _sfc_main$
|
|
11799
|
-
exports.DataSourceFieldSelect = _sfc_main$
|
|
11855
|
+
exports.DataSourceConfigPanel = _sfc_main$K;
|
|
11856
|
+
exports.DataSourceFieldSelect = _sfc_main$J;
|
|
11800
11857
|
exports.DataSourceFields = _sfc_main$L;
|
|
11801
|
-
exports.DataSourceInput = _sfc_main$
|
|
11802
|
-
exports.DataSourceMethodSelect = _sfc_main$
|
|
11803
|
-
exports.DataSourceMethods = _sfc_main$
|
|
11804
|
-
exports.DataSourceMocks = _sfc_main$
|
|
11805
|
-
exports.DataSourceSelect = _sfc_main$
|
|
11858
|
+
exports.DataSourceInput = _sfc_main$I;
|
|
11859
|
+
exports.DataSourceMethodSelect = _sfc_main$G;
|
|
11860
|
+
exports.DataSourceMethods = _sfc_main$H;
|
|
11861
|
+
exports.DataSourceMocks = _sfc_main$F;
|
|
11862
|
+
exports.DataSourceSelect = _sfc_main$E;
|
|
11806
11863
|
exports.DragType = DragType;
|
|
11807
|
-
exports.EventSelect = _sfc_main$
|
|
11864
|
+
exports.EventSelect = _sfc_main$D;
|
|
11808
11865
|
exports.Fixed2Other = Fixed2Other;
|
|
11809
11866
|
exports.H_GUIDE_LINE_STORAGE_KEY = H_GUIDE_LINE_STORAGE_KEY;
|
|
11810
11867
|
exports.Icon = _sfc_main$U;
|
|
11811
11868
|
exports.KeyBindingCommand = KeyBindingCommand;
|
|
11812
|
-
exports.KeyValue = _sfc_main$
|
|
11869
|
+
exports.KeyValue = _sfc_main$B;
|
|
11813
11870
|
exports.Keys = Keys;
|
|
11814
11871
|
exports.LayerOffset = LayerOffset;
|
|
11815
11872
|
exports.LayerPanel = _sfc_main$c;
|
|
11816
11873
|
exports.Layout = Layout;
|
|
11817
|
-
exports.LayoutContainer = _sfc_main$
|
|
11818
|
-
exports.PageFragmentSelect = _sfc_main$
|
|
11819
|
-
exports.PropsPanel = _sfc_main$
|
|
11820
|
-
exports.Resizer = _sfc_main$
|
|
11821
|
-
exports.SplitView = _sfc_main$
|
|
11874
|
+
exports.LayoutContainer = _sfc_main$x;
|
|
11875
|
+
exports.PageFragmentSelect = _sfc_main$A;
|
|
11876
|
+
exports.PropsPanel = _sfc_main$o;
|
|
11877
|
+
exports.Resizer = _sfc_main$y;
|
|
11878
|
+
exports.SplitView = _sfc_main$x;
|
|
11822
11879
|
exports.TMagicCodeEditor = _sfc_main$T;
|
|
11823
11880
|
exports.TMagicEditor = _sfc_main;
|
|
11824
|
-
exports.ToolButton = _sfc_main$
|
|
11881
|
+
exports.ToolButton = _sfc_main$w;
|
|
11825
11882
|
exports.UI_SELECT_MODE_EVENT_NAME = UI_SELECT_MODE_EVENT_NAME;
|
|
11826
11883
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
11827
11884
|
exports.advancedTabConfig = advancedTabConfig;
|