@tmagic/editor 1.7.8-beta.2 → 1.7.8-beta.4
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/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +2 -1
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/es/utils/data-source/index.js +4 -3
- package/dist/tmagic-editor.umd.cjs +41 -31
- package/package.json +7 -7
- package/src/components/CodeBlockEditor.vue +76 -66
- package/src/components/CodeParams.vue +3 -3
- package/src/fields/CodeSelectCol.vue +4 -1
- package/src/fields/DataSourceFieldSelect/Index.vue +3 -1
- package/src/fields/DataSourceMethodSelect.vue +4 -1
- package/src/fields/EventSelect.vue +65 -58
- package/src/fields/StyleSetter/components/Border.vue +35 -33
- package/src/fields/StyleSetter/pro/Background.vue +4 -4
- package/src/fields/StyleSetter/pro/Border.vue +3 -3
- package/src/fields/StyleSetter/pro/Font.vue +3 -3
- package/src/fields/StyleSetter/pro/Layout.vue +2 -2
- package/src/fields/StyleSetter/pro/Position.vue +3 -3
- package/src/utils/data-source/formConfigs/base.ts +2 -2
- package/src/utils/data-source/index.ts +6 -6
- package/src/utils/props.ts +2 -2
- package/types/index.d.ts +20 -20
|
@@ -5,7 +5,7 @@ import { useEditorContentHeight } from "../hooks/use-editor-content-height.js";
|
|
|
5
5
|
import { useNextFloatBoxPosition } from "../hooks/use-next-float-box-position.js";
|
|
6
6
|
import CodeEditor_default from "../layouts/CodeEditor.js";
|
|
7
7
|
import FloatingBox_default from "./FloatingBox.js";
|
|
8
|
-
import { MFormBox } from "@tmagic/form";
|
|
8
|
+
import { MFormBox, defineFormConfig, defineFormItem } from "@tmagic/form";
|
|
9
9
|
import { TMagicButton, TMagicDialog, TMagicTag, tMagicMessage, tMagicMessageBox } from "@tmagic/design";
|
|
10
10
|
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, isRef, mergeModels, nextTick, openBlock, ref, unref, useModel, useTemplateRef, watch, withCtx } from "vue";
|
|
11
11
|
//#region packages/editor/src/components/CodeBlockEditor.vue?vue&type=script&setup=true&lang.ts
|
|
@@ -53,7 +53,7 @@ var CodeBlockEditor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
53
53
|
formBox.value.form.values.content = magicVsEditorRef.value.getEditorValue();
|
|
54
54
|
difVisible.value = false;
|
|
55
55
|
};
|
|
56
|
-
const defaultParamColConfig = {
|
|
56
|
+
const defaultParamColConfig = defineFormItem({
|
|
57
57
|
type: "row",
|
|
58
58
|
label: "参数类型",
|
|
59
59
|
items: [{
|
|
@@ -79,8 +79,8 @@ var CodeBlockEditor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
79
79
|
}
|
|
80
80
|
]
|
|
81
81
|
}]
|
|
82
|
-
};
|
|
83
|
-
const functionConfig = computed(() => [
|
|
82
|
+
});
|
|
83
|
+
const functionConfig = computed(() => defineFormConfig([
|
|
84
84
|
{
|
|
85
85
|
text: "名称",
|
|
86
86
|
name: "name",
|
|
@@ -150,7 +150,7 @@ var CodeBlockEditor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
150
150
|
minRows: 10,
|
|
151
151
|
maxRows: 30
|
|
152
152
|
},
|
|
153
|
-
onChange: (
|
|
153
|
+
onChange: (_formState, code) => {
|
|
154
154
|
try {
|
|
155
155
|
getEditorConfig("parseDSL")(code);
|
|
156
156
|
return code;
|
|
@@ -160,7 +160,7 @@ var CodeBlockEditor_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ *
|
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
]);
|
|
163
|
+
]));
|
|
164
164
|
const parseContent = (content) => {
|
|
165
165
|
if (typeof content === "string") return getEditorConfig("parseDSL")(content);
|
|
166
166
|
return content;
|
|
@@ -40,7 +40,8 @@ var Index_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCo
|
|
|
40
40
|
const dataSources = computed(() => dataSourceService.get("dataSources") || []);
|
|
41
41
|
const disabledDataSource = computed(() => propsService.getDisabledDataSource());
|
|
42
42
|
const type = computed(() => {
|
|
43
|
-
|
|
43
|
+
if (!props.config.fieldConfig) return "";
|
|
44
|
+
let type = "type" in props.config.fieldConfig ? props.config.fieldConfig.type : "";
|
|
44
45
|
if (typeof type === "function") type = type(mForm, { model: props.model });
|
|
45
46
|
if (type === "form") return "";
|
|
46
47
|
if (type === "container") return "";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useServices } from "../hooks/use-services.js";
|
|
2
2
|
import { getCascaderOptionsFromFields } from "../utils/data-source/index.js";
|
|
3
|
-
import { MContainer, MPanel, MTable } from "@tmagic/form";
|
|
3
|
+
import { MContainer, MPanel, MTable, defineFormItem } from "@tmagic/form";
|
|
4
4
|
import { TMagicButton } from "@tmagic/design";
|
|
5
5
|
import { DATA_SOURCE_FIELDS_CHANGE_EVENT_PREFIX, traverseNode } from "@tmagic/utils";
|
|
6
6
|
import { ActionType } from "@tmagic/core";
|
|
@@ -121,8 +121,8 @@ var EventSelect_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
121
121
|
name: "to",
|
|
122
122
|
text: "联动组件",
|
|
123
123
|
type: "ui-select",
|
|
124
|
-
display: (
|
|
125
|
-
onChange: (
|
|
124
|
+
display: (_mForm, { model }) => model.actionType === ActionType.COMP,
|
|
125
|
+
onChange: (_MForm, _v, { setModel }) => {
|
|
126
126
|
setModel("method", "");
|
|
127
127
|
},
|
|
128
128
|
...props.config.targetCompConfig
|
|
@@ -189,7 +189,7 @@ var EventSelect_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
189
189
|
...props.config.dataSourceActionConfig
|
|
190
190
|
};
|
|
191
191
|
});
|
|
192
|
-
const tableConfig = computed(() => ({
|
|
192
|
+
const tableConfig = computed(() => defineFormItem({
|
|
193
193
|
type: "table",
|
|
194
194
|
name: "events",
|
|
195
195
|
items: [
|
|
@@ -222,7 +222,7 @@ var EventSelect_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ de
|
|
|
222
222
|
}
|
|
223
223
|
]
|
|
224
224
|
}));
|
|
225
|
-
const actionsConfig = computed(() => ({
|
|
225
|
+
const actionsConfig = computed(() => defineFormItem({
|
|
226
226
|
type: "panel",
|
|
227
227
|
items: [{
|
|
228
228
|
type: "group-list",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref,
|
|
1
|
+
import { defineFormItem } from "@tmagic/form";
|
|
2
|
+
import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, normalizeClass, openBlock, ref, resolveComponent } from "vue";
|
|
3
3
|
//#region packages/editor/src/fields/StyleSetter/components/Border.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var _hoisted_1 = { class: "border-box-container" };
|
|
5
5
|
var _hoisted_2 = { class: "border-icon-container" };
|
|
@@ -17,7 +17,7 @@ var Border_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
17
17
|
emits: ["change"],
|
|
18
18
|
setup(__props, { emit: __emit }) {
|
|
19
19
|
const direction = ref("");
|
|
20
|
-
const config = computed(() => ({ items: [
|
|
20
|
+
const config = computed(() => defineFormItem({ items: [
|
|
21
21
|
{
|
|
22
22
|
name: `border${direction.value}Width`,
|
|
23
23
|
text: "边框宽度",
|
|
@@ -58,6 +58,7 @@ var Border_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
58
58
|
});
|
|
59
59
|
};
|
|
60
60
|
return (_ctx, _cache) => {
|
|
61
|
+
const _component_MContainer = resolveComponent("MContainer");
|
|
61
62
|
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [
|
|
62
63
|
createElementVNode("div", _hoisted_3, [createElementVNode("div", {
|
|
63
64
|
class: normalizeClass(["border-icon border-icon-top", { active: direction.value === "Top" }]),
|
|
@@ -81,7 +82,7 @@ var Border_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
81
82
|
class: normalizeClass(["border-icon border-icon-bottom", { active: direction.value === "Bottom" }]),
|
|
82
83
|
onClick: _cache[4] || (_cache[4] = ($event) => selectDirection("Bottom"))
|
|
83
84
|
}, null, 2)])
|
|
84
|
-
]), createElementVNode("div", _hoisted_6, [createVNode(
|
|
85
|
+
]), createElementVNode("div", _hoisted_6, [createVNode(_component_MContainer, {
|
|
85
86
|
config: config.value,
|
|
86
87
|
model: __props.model,
|
|
87
88
|
size: __props.size,
|
|
@@ -3,8 +3,8 @@ import Repeat_default from "../icons/background-repeat/Repeat.js";
|
|
|
3
3
|
import RepeatX_default from "../icons/background-repeat/RepeatX.js";
|
|
4
4
|
import RepeatY_default from "../icons/background-repeat/RepeatY.js";
|
|
5
5
|
import NoRepeat_default from "../icons/background-repeat/NoRepeat.js";
|
|
6
|
-
import {
|
|
7
|
-
import { createBlock, defineComponent, markRaw, openBlock, unref } from "vue";
|
|
6
|
+
import { defineFormItem } from "@tmagic/form";
|
|
7
|
+
import { createBlock, defineComponent, markRaw, openBlock, resolveComponent, unref } from "vue";
|
|
8
8
|
//#region packages/editor/src/fields/StyleSetter/pro/Background.vue?vue&type=script&setup=true&lang.ts
|
|
9
9
|
var Background_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
10
10
|
__name: "Background",
|
|
@@ -16,7 +16,7 @@ var Background_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
16
16
|
emits: ["change"],
|
|
17
17
|
setup(__props, { emit: __emit }) {
|
|
18
18
|
const emit = __emit;
|
|
19
|
-
const config = { items: [
|
|
19
|
+
const config = defineFormItem({ items: [
|
|
20
20
|
{
|
|
21
21
|
name: "backgroundColor",
|
|
22
22
|
text: "背景色",
|
|
@@ -91,18 +91,20 @@ var Background_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ def
|
|
|
91
91
|
component: BackgroundPosition_default,
|
|
92
92
|
labelWidth: "68px"
|
|
93
93
|
}
|
|
94
|
-
] };
|
|
94
|
+
] });
|
|
95
95
|
const change = (value, eventData) => {
|
|
96
96
|
emit("change", value, eventData);
|
|
97
97
|
};
|
|
98
98
|
return (_ctx, _cache) => {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
const _component_MContainer = resolveComponent("MContainer");
|
|
100
|
+
return openBlock(), createBlock(_component_MContainer, {
|
|
101
|
+
config: unref(config),
|
|
101
102
|
model: __props.values,
|
|
102
103
|
size: __props.size,
|
|
103
104
|
disabled: __props.disabled,
|
|
104
105
|
onChange: change
|
|
105
106
|
}, null, 8, [
|
|
107
|
+
"config",
|
|
106
108
|
"model",
|
|
107
109
|
"size",
|
|
108
110
|
"disabled"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Border_default from "../components/Border.js";
|
|
2
|
-
import {
|
|
3
|
-
import { Fragment, createElementBlock, createVNode, defineComponent, openBlock, unref } from "vue";
|
|
2
|
+
import { defineFormItem } from "@tmagic/form";
|
|
3
|
+
import { Fragment, createElementBlock, createVNode, defineComponent, openBlock, resolveComponent, unref } from "vue";
|
|
4
4
|
//#region packages/editor/src/fields/StyleSetter/pro/Border.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var Border_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
6
6
|
__name: "Border",
|
|
@@ -12,24 +12,26 @@ var Border_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineC
|
|
|
12
12
|
emits: ["change"],
|
|
13
13
|
setup(__props, { emit: __emit }) {
|
|
14
14
|
const emit = __emit;
|
|
15
|
-
const config = { items: [{
|
|
15
|
+
const config = defineFormItem({ items: [{
|
|
16
16
|
labelWidth: "68px",
|
|
17
17
|
name: "borderRadius",
|
|
18
18
|
text: "圆角",
|
|
19
19
|
type: "data-source-field-select",
|
|
20
20
|
fieldConfig: { type: "text" }
|
|
21
|
-
}] };
|
|
21
|
+
}] });
|
|
22
22
|
const change = (value, eventData) => {
|
|
23
23
|
emit("change", value, eventData);
|
|
24
24
|
};
|
|
25
25
|
return (_ctx, _cache) => {
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const _component_MContainer = resolveComponent("MContainer");
|
|
27
|
+
return openBlock(), createElementBlock(Fragment, null, [createVNode(_component_MContainer, {
|
|
28
|
+
config: unref(config),
|
|
28
29
|
model: __props.values,
|
|
29
30
|
size: __props.size,
|
|
30
31
|
disabled: __props.disabled,
|
|
31
32
|
onChange: change
|
|
32
33
|
}, null, 8, [
|
|
34
|
+
"config",
|
|
33
35
|
"model",
|
|
34
36
|
"size",
|
|
35
37
|
"disabled"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Left_default from "../icons/text-align/Left.js";
|
|
2
2
|
import Center_default from "../icons/text-align/Center.js";
|
|
3
3
|
import Right_default from "../icons/text-align/Right.js";
|
|
4
|
-
import {
|
|
5
|
-
import { createBlock, defineComponent, markRaw, openBlock, unref } from "vue";
|
|
4
|
+
import { defineFormItem } from "@tmagic/form";
|
|
5
|
+
import { createBlock, defineComponent, markRaw, openBlock, resolveComponent, unref } from "vue";
|
|
6
6
|
//#region packages/editor/src/fields/StyleSetter/pro/Font.vue?vue&type=script&setup=true&lang.ts
|
|
7
7
|
var Font_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
8
8
|
__name: "Font",
|
|
@@ -14,7 +14,7 @@ var Font_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
14
14
|
emits: ["change"],
|
|
15
15
|
setup(__props, { emit: __emit }) {
|
|
16
16
|
const emit = __emit;
|
|
17
|
-
const config = { items: [
|
|
17
|
+
const config = defineFormItem({ items: [
|
|
18
18
|
{
|
|
19
19
|
type: "row",
|
|
20
20
|
items: [{
|
|
@@ -75,18 +75,20 @@ var Font_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineCom
|
|
|
75
75
|
}
|
|
76
76
|
]
|
|
77
77
|
}
|
|
78
|
-
] };
|
|
78
|
+
] });
|
|
79
79
|
const change = (value, eventData) => {
|
|
80
80
|
emit("change", value, eventData);
|
|
81
81
|
};
|
|
82
82
|
return (_ctx, _cache) => {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
const _component_MContainer = resolveComponent("MContainer");
|
|
84
|
+
return openBlock(), createBlock(_component_MContainer, {
|
|
85
|
+
config: unref(config),
|
|
85
86
|
model: __props.values,
|
|
86
87
|
size: __props.size,
|
|
87
88
|
disabled: __props.disabled,
|
|
88
89
|
onChange: change
|
|
89
90
|
}, null, 8, [
|
|
91
|
+
"config",
|
|
90
92
|
"model",
|
|
91
93
|
"size",
|
|
92
94
|
"disabled"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createBlock, defineComponent, openBlock, unref } from "vue";
|
|
1
|
+
import { defineFormItem } from "@tmagic/form";
|
|
2
|
+
import { createBlock, defineComponent, openBlock, resolveComponent, unref } from "vue";
|
|
3
3
|
//#region packages/editor/src/fields/StyleSetter/pro/Position.vue?vue&type=script&setup=true&lang.ts
|
|
4
4
|
var Position_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
5
5
|
__name: "Position",
|
|
@@ -19,7 +19,7 @@ var Position_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
19
19
|
fixed: "固定定位",
|
|
20
20
|
sticky: "粘性定位"
|
|
21
21
|
};
|
|
22
|
-
const config = { items: [
|
|
22
|
+
const config = defineFormItem({ items: [
|
|
23
23
|
{
|
|
24
24
|
name: "position",
|
|
25
25
|
text: "定位",
|
|
@@ -72,18 +72,20 @@ var Position_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defin
|
|
|
72
72
|
type: "data-source-field-select",
|
|
73
73
|
fieldConfig: { type: "text" }
|
|
74
74
|
}
|
|
75
|
-
] };
|
|
75
|
+
] });
|
|
76
76
|
const change = (value, eventData) => {
|
|
77
77
|
emit("change", value, eventData);
|
|
78
78
|
};
|
|
79
79
|
return (_ctx, _cache) => {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
const _component_MContainer = resolveComponent("MContainer");
|
|
81
|
+
return openBlock(), createBlock(_component_MContainer, {
|
|
82
|
+
config: unref(config),
|
|
82
83
|
model: __props.values,
|
|
83
84
|
size: __props.size,
|
|
84
85
|
disabled: __props.disabled,
|
|
85
86
|
onChange: change
|
|
86
87
|
}, null, 8, [
|
|
88
|
+
"config",
|
|
87
89
|
"model",
|
|
88
90
|
"size",
|
|
89
91
|
"disabled"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import base_default from "./formConfigs/base.js";
|
|
2
2
|
import http_default from "./formConfigs/http.js";
|
|
3
|
+
import { defineFormItem } from "@tmagic/form";
|
|
3
4
|
import { dataSourceTemplateRegExp, getKeysArray, isNumber } from "@tmagic/utils";
|
|
4
5
|
//#region packages/editor/src/utils/data-source/index.ts
|
|
5
|
-
var dataSourceFormConfig = {
|
|
6
|
+
var dataSourceFormConfig = defineFormItem({
|
|
6
7
|
type: "tab",
|
|
7
8
|
items: [
|
|
8
9
|
{
|
|
@@ -52,7 +53,7 @@ var dataSourceFormConfig = {
|
|
|
52
53
|
},
|
|
53
54
|
{
|
|
54
55
|
title: "响应数据裁剪",
|
|
55
|
-
display: (
|
|
56
|
+
display: (_formStat, { model }) => model.type === "http",
|
|
56
57
|
items: [{
|
|
57
58
|
name: "afterResponse",
|
|
58
59
|
type: "vs-code",
|
|
@@ -64,7 +65,7 @@ var dataSourceFormConfig = {
|
|
|
64
65
|
}]
|
|
65
66
|
}
|
|
66
67
|
]
|
|
67
|
-
};
|
|
68
|
+
});
|
|
68
69
|
var fillConfig = (config) => [
|
|
69
70
|
...base_default(),
|
|
70
71
|
...config,
|
|
@@ -6782,7 +6782,7 @@
|
|
|
6782
6782
|
]);
|
|
6783
6783
|
//#endregion
|
|
6784
6784
|
//#region packages/editor/src/utils/data-source/index.ts
|
|
6785
|
-
var dataSourceFormConfig = {
|
|
6785
|
+
var dataSourceFormConfig = (0, _tmagic_form.defineFormItem)({
|
|
6786
6786
|
type: "tab",
|
|
6787
6787
|
items: [
|
|
6788
6788
|
{
|
|
@@ -6832,7 +6832,7 @@
|
|
|
6832
6832
|
},
|
|
6833
6833
|
{
|
|
6834
6834
|
title: "响应数据裁剪",
|
|
6835
|
-
display: (
|
|
6835
|
+
display: (_formStat, { model }) => model.type === "http",
|
|
6836
6836
|
items: [{
|
|
6837
6837
|
name: "afterResponse",
|
|
6838
6838
|
type: "vs-code",
|
|
@@ -6844,7 +6844,7 @@
|
|
|
6844
6844
|
}]
|
|
6845
6845
|
}
|
|
6846
6846
|
]
|
|
6847
|
-
};
|
|
6847
|
+
});
|
|
6848
6848
|
var fillConfig$1 = (config) => [
|
|
6849
6849
|
...base_default(),
|
|
6850
6850
|
...config,
|
|
@@ -9033,7 +9033,7 @@
|
|
|
9033
9033
|
formBox.value.form.values.content = magicVsEditorRef.value.getEditorValue();
|
|
9034
9034
|
difVisible.value = false;
|
|
9035
9035
|
};
|
|
9036
|
-
const defaultParamColConfig = {
|
|
9036
|
+
const defaultParamColConfig = (0, _tmagic_form.defineFormItem)({
|
|
9037
9037
|
type: "row",
|
|
9038
9038
|
label: "参数类型",
|
|
9039
9039
|
items: [{
|
|
@@ -9059,8 +9059,8 @@
|
|
|
9059
9059
|
}
|
|
9060
9060
|
]
|
|
9061
9061
|
}]
|
|
9062
|
-
};
|
|
9063
|
-
const functionConfig = (0, vue.computed)(() => [
|
|
9062
|
+
});
|
|
9063
|
+
const functionConfig = (0, vue.computed)(() => (0, _tmagic_form.defineFormConfig)([
|
|
9064
9064
|
{
|
|
9065
9065
|
text: "名称",
|
|
9066
9066
|
name: "name",
|
|
@@ -9130,7 +9130,7 @@
|
|
|
9130
9130
|
minRows: 10,
|
|
9131
9131
|
maxRows: 30
|
|
9132
9132
|
},
|
|
9133
|
-
onChange: (
|
|
9133
|
+
onChange: (_formState, code) => {
|
|
9134
9134
|
try {
|
|
9135
9135
|
getEditorConfig("parseDSL")(code);
|
|
9136
9136
|
return code;
|
|
@@ -9140,7 +9140,7 @@
|
|
|
9140
9140
|
}
|
|
9141
9141
|
}
|
|
9142
9142
|
}
|
|
9143
|
-
]);
|
|
9143
|
+
]));
|
|
9144
9144
|
const parseContent = (content) => {
|
|
9145
9145
|
if (typeof content === "string") return getEditorConfig("parseDSL")(content);
|
|
9146
9146
|
return content;
|
|
@@ -15773,7 +15773,8 @@
|
|
|
15773
15773
|
const dataSources = (0, vue.computed)(() => dataSourceService.get("dataSources") || []);
|
|
15774
15774
|
const disabledDataSource = (0, vue.computed)(() => propsService.getDisabledDataSource());
|
|
15775
15775
|
const type = (0, vue.computed)(() => {
|
|
15776
|
-
|
|
15776
|
+
if (!props.config.fieldConfig) return "";
|
|
15777
|
+
let type = "type" in props.config.fieldConfig ? props.config.fieldConfig.type : "";
|
|
15777
15778
|
if (typeof type === "function") type = type(mForm, { model: props.model });
|
|
15778
15779
|
if (type === "form") return "";
|
|
15779
15780
|
if (type === "container") return "";
|
|
@@ -16002,8 +16003,8 @@
|
|
|
16002
16003
|
name: "to",
|
|
16003
16004
|
text: "联动组件",
|
|
16004
16005
|
type: "ui-select",
|
|
16005
|
-
display: (
|
|
16006
|
-
onChange: (
|
|
16006
|
+
display: (_mForm, { model }) => model.actionType === _tmagic_core.ActionType.COMP,
|
|
16007
|
+
onChange: (_MForm, _v, { setModel }) => {
|
|
16007
16008
|
setModel("method", "");
|
|
16008
16009
|
},
|
|
16009
16010
|
...props.config.targetCompConfig
|
|
@@ -16070,7 +16071,7 @@
|
|
|
16070
16071
|
...props.config.dataSourceActionConfig
|
|
16071
16072
|
};
|
|
16072
16073
|
});
|
|
16073
|
-
const tableConfig = (0, vue.computed)(() => ({
|
|
16074
|
+
const tableConfig = (0, vue.computed)(() => (0, _tmagic_form.defineFormItem)({
|
|
16074
16075
|
type: "table",
|
|
16075
16076
|
name: "events",
|
|
16076
16077
|
items: [
|
|
@@ -16103,7 +16104,7 @@
|
|
|
16103
16104
|
}
|
|
16104
16105
|
]
|
|
16105
16106
|
}));
|
|
16106
|
-
const actionsConfig = (0, vue.computed)(() => ({
|
|
16107
|
+
const actionsConfig = (0, vue.computed)(() => (0, _tmagic_form.defineFormItem)({
|
|
16107
16108
|
type: "panel",
|
|
16108
16109
|
items: [{
|
|
16109
16110
|
type: "group-list",
|
|
@@ -16870,7 +16871,7 @@
|
|
|
16870
16871
|
emits: ["change"],
|
|
16871
16872
|
setup(__props, { emit: __emit }) {
|
|
16872
16873
|
const emit = __emit;
|
|
16873
|
-
const config = { items: [
|
|
16874
|
+
const config = (0, _tmagic_form.defineFormItem)({ items: [
|
|
16874
16875
|
{
|
|
16875
16876
|
name: "backgroundColor",
|
|
16876
16877
|
text: "背景色",
|
|
@@ -16945,18 +16946,20 @@
|
|
|
16945
16946
|
component: BackgroundPosition_default,
|
|
16946
16947
|
labelWidth: "68px"
|
|
16947
16948
|
}
|
|
16948
|
-
] };
|
|
16949
|
+
] });
|
|
16949
16950
|
const change = (value, eventData) => {
|
|
16950
16951
|
emit("change", value, eventData);
|
|
16951
16952
|
};
|
|
16952
16953
|
return (_ctx, _cache) => {
|
|
16953
|
-
|
|
16954
|
-
|
|
16954
|
+
const _component_MContainer = (0, vue.resolveComponent)("MContainer");
|
|
16955
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(_component_MContainer, {
|
|
16956
|
+
config: (0, vue.unref)(config),
|
|
16955
16957
|
model: __props.values,
|
|
16956
16958
|
size: __props.size,
|
|
16957
16959
|
disabled: __props.disabled,
|
|
16958
16960
|
onChange: change
|
|
16959
16961
|
}, null, 8, [
|
|
16962
|
+
"config",
|
|
16960
16963
|
"model",
|
|
16961
16964
|
"size",
|
|
16962
16965
|
"disabled"
|
|
@@ -17012,7 +17015,7 @@
|
|
|
17012
17015
|
emits: ["change"],
|
|
17013
17016
|
setup(__props, { emit: __emit }) {
|
|
17014
17017
|
const emit = __emit;
|
|
17015
|
-
const config = { items: [
|
|
17018
|
+
const config = (0, _tmagic_form.defineFormItem)({ items: [
|
|
17016
17019
|
{
|
|
17017
17020
|
type: "row",
|
|
17018
17021
|
items: [{
|
|
@@ -17073,18 +17076,20 @@
|
|
|
17073
17076
|
}
|
|
17074
17077
|
]
|
|
17075
17078
|
}
|
|
17076
|
-
] };
|
|
17079
|
+
] });
|
|
17077
17080
|
const change = (value, eventData) => {
|
|
17078
17081
|
emit("change", value, eventData);
|
|
17079
17082
|
};
|
|
17080
17083
|
return (_ctx, _cache) => {
|
|
17081
|
-
|
|
17082
|
-
|
|
17084
|
+
const _component_MContainer = (0, vue.resolveComponent)("MContainer");
|
|
17085
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(_component_MContainer, {
|
|
17086
|
+
config: (0, vue.unref)(config),
|
|
17083
17087
|
model: __props.values,
|
|
17084
17088
|
size: __props.size,
|
|
17085
17089
|
disabled: __props.disabled,
|
|
17086
17090
|
onChange: change
|
|
17087
17091
|
}, null, 8, [
|
|
17092
|
+
"config",
|
|
17088
17093
|
"model",
|
|
17089
17094
|
"size",
|
|
17090
17095
|
"disabled"
|
|
@@ -17624,7 +17629,7 @@
|
|
|
17624
17629
|
fixed: "固定定位",
|
|
17625
17630
|
sticky: "粘性定位"
|
|
17626
17631
|
};
|
|
17627
|
-
const config = { items: [
|
|
17632
|
+
const config = (0, _tmagic_form.defineFormItem)({ items: [
|
|
17628
17633
|
{
|
|
17629
17634
|
name: "position",
|
|
17630
17635
|
text: "定位",
|
|
@@ -17677,18 +17682,20 @@
|
|
|
17677
17682
|
type: "data-source-field-select",
|
|
17678
17683
|
fieldConfig: { type: "text" }
|
|
17679
17684
|
}
|
|
17680
|
-
] };
|
|
17685
|
+
] });
|
|
17681
17686
|
const change = (value, eventData) => {
|
|
17682
17687
|
emit("change", value, eventData);
|
|
17683
17688
|
};
|
|
17684
17689
|
return (_ctx, _cache) => {
|
|
17685
|
-
|
|
17686
|
-
|
|
17690
|
+
const _component_MContainer = (0, vue.resolveComponent)("MContainer");
|
|
17691
|
+
return (0, vue.openBlock)(), (0, vue.createBlock)(_component_MContainer, {
|
|
17692
|
+
config: (0, vue.unref)(config),
|
|
17687
17693
|
model: __props.values,
|
|
17688
17694
|
size: __props.size,
|
|
17689
17695
|
disabled: __props.disabled,
|
|
17690
17696
|
onChange: change
|
|
17691
17697
|
}, null, 8, [
|
|
17698
|
+
"config",
|
|
17692
17699
|
"model",
|
|
17693
17700
|
"size",
|
|
17694
17701
|
"disabled"
|
|
@@ -17717,7 +17724,7 @@
|
|
|
17717
17724
|
emits: ["change"],
|
|
17718
17725
|
setup(__props, { emit: __emit }) {
|
|
17719
17726
|
const direction = (0, vue.ref)("");
|
|
17720
|
-
const config = (0, vue.computed)(() => ({ items: [
|
|
17727
|
+
const config = (0, vue.computed)(() => (0, _tmagic_form.defineFormItem)({ items: [
|
|
17721
17728
|
{
|
|
17722
17729
|
name: `border${direction.value}Width`,
|
|
17723
17730
|
text: "边框宽度",
|
|
@@ -17758,6 +17765,7 @@
|
|
|
17758
17765
|
});
|
|
17759
17766
|
};
|
|
17760
17767
|
return (_ctx, _cache) => {
|
|
17768
|
+
const _component_MContainer = (0, vue.resolveComponent)("MContainer");
|
|
17761
17769
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$1, [(0, vue.createElementVNode)("div", _hoisted_2, [
|
|
17762
17770
|
(0, vue.createElementVNode)("div", _hoisted_3, [(0, vue.createElementVNode)("div", {
|
|
17763
17771
|
class: (0, vue.normalizeClass)(["border-icon border-icon-top", { active: direction.value === "Top" }]),
|
|
@@ -17781,7 +17789,7 @@
|
|
|
17781
17789
|
class: (0, vue.normalizeClass)(["border-icon border-icon-bottom", { active: direction.value === "Bottom" }]),
|
|
17782
17790
|
onClick: _cache[4] || (_cache[4] = ($event) => selectDirection("Bottom"))
|
|
17783
17791
|
}, null, 2)])
|
|
17784
|
-
]), (0, vue.createElementVNode)("div", _hoisted_6, [(0, vue.createVNode)(
|
|
17792
|
+
]), (0, vue.createElementVNode)("div", _hoisted_6, [(0, vue.createVNode)(_component_MContainer, {
|
|
17785
17793
|
config: config.value,
|
|
17786
17794
|
model: __props.model,
|
|
17787
17795
|
size: __props.size,
|
|
@@ -17811,24 +17819,26 @@
|
|
|
17811
17819
|
emits: ["change"],
|
|
17812
17820
|
setup(__props, { emit: __emit }) {
|
|
17813
17821
|
const emit = __emit;
|
|
17814
|
-
const config = { items: [{
|
|
17822
|
+
const config = (0, _tmagic_form.defineFormItem)({ items: [{
|
|
17815
17823
|
labelWidth: "68px",
|
|
17816
17824
|
name: "borderRadius",
|
|
17817
17825
|
text: "圆角",
|
|
17818
17826
|
type: "data-source-field-select",
|
|
17819
17827
|
fieldConfig: { type: "text" }
|
|
17820
|
-
}] };
|
|
17828
|
+
}] });
|
|
17821
17829
|
const change = (value, eventData) => {
|
|
17822
17830
|
emit("change", value, eventData);
|
|
17823
17831
|
};
|
|
17824
17832
|
return (_ctx, _cache) => {
|
|
17825
|
-
|
|
17826
|
-
|
|
17833
|
+
const _component_MContainer = (0, vue.resolveComponent)("MContainer");
|
|
17834
|
+
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createVNode)(_component_MContainer, {
|
|
17835
|
+
config: (0, vue.unref)(config),
|
|
17827
17836
|
model: __props.values,
|
|
17828
17837
|
size: __props.size,
|
|
17829
17838
|
disabled: __props.disabled,
|
|
17830
17839
|
onChange: change
|
|
17831
17840
|
}, null, 8, [
|
|
17841
|
+
"config",
|
|
17832
17842
|
"model",
|
|
17833
17843
|
"size",
|
|
17834
17844
|
"disabled"
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.7.8-beta.
|
|
2
|
+
"version": "1.7.8-beta.4",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"moveable": "^0.53.0",
|
|
59
59
|
"serialize-javascript": "^7.0.0",
|
|
60
60
|
"sortablejs": "^1.15.6",
|
|
61
|
-
"@tmagic/design": "1.7.8-beta.
|
|
62
|
-
"@tmagic/form": "1.7.8-beta.
|
|
63
|
-
"@tmagic/utils": "1.7.8-beta.
|
|
64
|
-
"@tmagic/stage": "1.7.8-beta.
|
|
65
|
-
"@tmagic/table": "1.7.8-beta.
|
|
61
|
+
"@tmagic/design": "1.7.8-beta.4",
|
|
62
|
+
"@tmagic/form": "1.7.8-beta.4",
|
|
63
|
+
"@tmagic/utils": "1.7.8-beta.4",
|
|
64
|
+
"@tmagic/stage": "1.7.8-beta.4",
|
|
65
|
+
"@tmagic/table": "1.7.8-beta.4"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/events": "^3.0.3",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"type-fest": "^5.2.0",
|
|
77
77
|
"typescript": "^5.9.3",
|
|
78
78
|
"vue": "^3.5.24",
|
|
79
|
-
"@tmagic/core": "1.7.8-beta.
|
|
79
|
+
"@tmagic/core": "1.7.8-beta.4"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"typescript": {
|