@tmagic/editor 1.8.0-beta.23 → 1.8.0-beta.25
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/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +8 -5
- package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +10 -6
- package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +6 -4
- package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +6 -4
- package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +12 -7
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/hooks/use-compare-form.js +1 -2
- package/dist/es/index.js +3 -3
- package/dist/es/plugin.js +9 -1
- package/dist/es/services/editor.js +43 -37
- package/dist/es/services/props.js +1 -1
- package/dist/es/style.css +4 -0
- package/dist/es/utils/event.js +1 -1
- package/dist/es/utils/props.js +1 -29
- package/dist/es/utils/type-match-rules.js +21 -20
- package/dist/style.css +4 -0
- package/dist/themes/magic-admin.css +4 -0
- package/dist/tmagic-editor.umd.cjs +412 -398
- package/package.json +8 -8
- package/src/fields/CodeSelectCol.vue +4 -2
- package/src/fields/CondOpSelect.vue +3 -2
- package/src/fields/DataSourceFieldSelect/Index.vue +9 -4
- package/src/fields/DataSourceFields.vue +6 -0
- package/src/fields/DataSourceMethodSelect.vue +4 -1
- package/src/fields/DataSourceMethods.vue +11 -2
- package/src/fields/DataSourceMocks.vue +10 -1
- package/src/fields/DisplayConds.vue +11 -7
- package/src/fields/EventSelect.vue +3 -3
- package/src/fields/KeyValue.vue +4 -3
- package/src/fields/StyleSetter/pro/Font.vue +2 -2
- package/src/hooks/use-compare-form.ts +1 -4
- package/src/plugin.ts +9 -1
- package/src/services/editor.ts +53 -85
- package/src/type.ts +23 -0
- package/src/utils/event.ts +2 -2
- package/src/utils/props.ts +0 -32
- package/src/utils/type-match-rules.ts +29 -28
- package/types/index.d.ts +39 -61
|
@@ -2,7 +2,7 @@ import { SideItemKey } from "../type.js";
|
|
|
2
2
|
import { useServices } from "../hooks/use-services.js";
|
|
3
3
|
import Icon_default from "../components/Icon.js";
|
|
4
4
|
import CodeParams_default from "../components/CodeParams.js";
|
|
5
|
-
import { MContainer, MSelect, createValues, filterFunction } from "@tmagic/form";
|
|
5
|
+
import { FORM_SILENT_MODE_KEY, MContainer, MSelect, createValues, filterFunction } from "@tmagic/form";
|
|
6
6
|
import { TMagicButton } from "@tmagic/design";
|
|
7
7
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, openBlock, ref, unref, watch, withCtx } from "vue";
|
|
8
8
|
import { isEmpty, map } from "lodash-es";
|
|
@@ -34,6 +34,7 @@ var CodeSelectCol_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
34
34
|
emits: ["change"],
|
|
35
35
|
setup(__props, { emit: __emit }) {
|
|
36
36
|
const mForm = inject("mForm");
|
|
37
|
+
const silentMode = inject(FORM_SILENT_MODE_KEY, false);
|
|
37
38
|
const { codeBlockService, uiService } = useServices();
|
|
38
39
|
const eventBus = inject("eventBus");
|
|
39
40
|
const emit = __emit;
|
|
@@ -130,7 +131,7 @@ var CodeSelectCol_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
130
131
|
"last-values",
|
|
131
132
|
"size",
|
|
132
133
|
"prop"
|
|
133
|
-
])) : (openBlock(), createBlock(unref(MSelect), {
|
|
134
|
+
])) : !unref(silentMode) ? (openBlock(), createBlock(unref(MSelect), {
|
|
134
135
|
key: 1,
|
|
135
136
|
class: "select",
|
|
136
137
|
config: selectConfig,
|
|
@@ -144,9 +145,9 @@ var CodeSelectCol_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ de
|
|
|
144
145
|
"model",
|
|
145
146
|
"size",
|
|
146
147
|
"prop"
|
|
147
|
-
])),
|
|
148
|
+
])) : createCommentVNode("v-if", true),
|
|
148
149
|
createCommentVNode(" 查看/编辑按钮:对比模式为只读,不展示 "),
|
|
149
|
-
!isCompareMode.value && __props.model[__props.name] && hasCodeBlockSidePanel.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
150
|
+
!isCompareMode.value && !unref(silentMode) && __props.model[__props.name] && hasCodeBlockSidePanel.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
150
151
|
key: 2,
|
|
151
152
|
class: "m-fields-select-action-button",
|
|
152
153
|
size: __props.size,
|
|
@@ -2,6 +2,7 @@ import { getCondOpOptionsByFieldType } from "../utils/props.js";
|
|
|
2
2
|
import { useServices } from "../hooks/use-services.js";
|
|
3
3
|
import { getFieldType } from "../utils/data-source/index.js";
|
|
4
4
|
import { TMagicSelect, getDesignConfig } from "@tmagic/design";
|
|
5
|
+
import { removeDataSourceFieldPrefix } from "@tmagic/utils";
|
|
5
6
|
import { Fragment, computed, createBlock, createElementBlock, defineComponent, mergeProps, openBlock, renderList, resolveDynamicComponent, unref, withCtx } from "vue";
|
|
6
7
|
//#region packages/editor/src/fields/CondOpSelect.vue?vue&type=script&setup=true&lang.ts
|
|
7
8
|
var CondOpSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -29,8 +30,8 @@ var CondOpSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
29
30
|
const props = __props;
|
|
30
31
|
const optionComponent = getDesignConfig("components")?.option;
|
|
31
32
|
const options = computed(() => {
|
|
32
|
-
const [id, ...fieldNames] = [...props.config.parentFields || [], ...props.model.field];
|
|
33
|
-
const ds = dataSourceService.getDataSourceById(id);
|
|
33
|
+
const [id, ...fieldNames] = [...props.config.parentFields || [], ...props.model.field || []];
|
|
34
|
+
const ds = id ? dataSourceService.getDataSourceById(removeDataSourceFieldPrefix(id)) : void 0;
|
|
34
35
|
const type = getFieldType(ds, fieldNames);
|
|
35
36
|
return getCondOpOptionsByFieldType(type);
|
|
36
37
|
});
|
|
@@ -2,7 +2,7 @@ import { useServices } from "../../hooks/use-services.js";
|
|
|
2
2
|
import Icon_default from "../../components/Icon.js";
|
|
3
3
|
import DatasourceIcon_default from "../../icons/DatasourceIcon.js";
|
|
4
4
|
import FieldSelect_default from "./FieldSelect.js";
|
|
5
|
-
import { getFormField } from "@tmagic/form";
|
|
5
|
+
import { FORM_SILENT_MODE_KEY, getFormField } from "@tmagic/form";
|
|
6
6
|
import { TMagicButton, TMagicTooltip, tMagicMessage } from "@tmagic/design";
|
|
7
7
|
import { DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, removeDataSourceFieldPrefix } from "@tmagic/utils";
|
|
8
8
|
import { computed, createBlock, createCommentVNode, createElementBlock, createVNode, defineComponent, inject, normalizeClass, openBlock, ref, resolveComponent, resolveDynamicComponent, unref, watch, withCtx } from "vue";
|
|
@@ -40,6 +40,7 @@ var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
40
40
|
}, { immediate: true });
|
|
41
41
|
const { dataSourceService, propsService } = useServices();
|
|
42
42
|
const mForm = inject("mForm");
|
|
43
|
+
const silentMode = inject(FORM_SILENT_MODE_KEY, false);
|
|
43
44
|
const dataSources = computed(() => dataSourceService.get("dataSources") || []);
|
|
44
45
|
const disabledDataSource = computed(() => propsService.getDisabledDataSource());
|
|
45
46
|
const type = computed(() => {
|
|
@@ -59,7 +60,9 @@ var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
59
60
|
let value;
|
|
60
61
|
if (typeof props.config.checkStrictly !== "function") value = props.config.checkStrictly;
|
|
61
62
|
else {
|
|
62
|
-
const
|
|
63
|
+
const fieldValue = props.model[props.name];
|
|
64
|
+
const rawDsId = props.config.dataSourceId ?? (Array.isArray(fieldValue) ? fieldValue[0] : fieldValue);
|
|
65
|
+
const dsId = removeDataSourceFieldPrefix(`${rawDsId}`);
|
|
63
66
|
const dataSource = dataSources.value.find((ds) => ds.id === dsId);
|
|
64
67
|
value = props.config.checkStrictly(mForm, {
|
|
65
68
|
values: mForm?.initValues || {},
|
|
@@ -103,7 +106,7 @@ var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
103
106
|
showDataSourceFieldSelect.value = !showDataSourceFieldSelect.value;
|
|
104
107
|
};
|
|
105
108
|
return (_ctx, _cache) => {
|
|
106
|
-
return openBlock(), createElementBlock("div", { class: normalizeClass(["m-fields-data-source-field-select", { [`data-source-field-${type.value}`]: !isSelectValid.value }]) }, [isSelectValid.value ? (openBlock(), createBlock(FieldSelect_default, {
|
|
109
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(["m-fields-data-source-field-select", { [`data-source-field-${type.value}`]: !isSelectValid.value }]) }, [isSelectValid.value && !unref(silentMode) ? (openBlock(), createBlock(FieldSelect_default, {
|
|
107
110
|
key: 0,
|
|
108
111
|
"model-value": __props.model[__props.name],
|
|
109
112
|
disabled: __props.disabled,
|
|
@@ -121,7 +124,7 @@ var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
121
124
|
"checkStrictly",
|
|
122
125
|
"dataSourceFieldType",
|
|
123
126
|
"dataSourceId"
|
|
124
|
-
])) : (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
127
|
+
])) : !unref(silentMode) ? (openBlock(), createBlock(resolveDynamicComponent(tagName.value), {
|
|
125
128
|
key: 1,
|
|
126
129
|
config: __props.config.fieldConfig,
|
|
127
130
|
model: __props.model,
|
|
@@ -143,7 +146,7 @@ var Index_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComp
|
|
|
143
146
|
"init-values",
|
|
144
147
|
"values",
|
|
145
148
|
"prop"
|
|
146
|
-
])), __props.config.fieldConfig && !disabledDataSource.value && !unref(mForm)?.isCompare ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
149
|
+
])) : createCommentVNode("v-if", true), !unref(silentMode) && __props.config.fieldConfig && !disabledDataSource.value && !unref(mForm)?.isCompare ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
147
150
|
key: 2,
|
|
148
151
|
disabled: showDataSourceFieldSelect.value,
|
|
149
152
|
content: "选择数据源"
|
|
@@ -3,11 +3,11 @@ import { useEditorContentHeight } from "../hooks/use-editor-content-height.js";
|
|
|
3
3
|
import { useNextFloatBoxPosition } from "../hooks/use-next-float-box-position.js";
|
|
4
4
|
import { error } from "../utils/logger.js";
|
|
5
5
|
import FloatingBox_default from "../components/FloatingBox.js";
|
|
6
|
-
import { MFormBox } from "@tmagic/form";
|
|
6
|
+
import { FORM_SILENT_MODE_KEY, MFormBox } from "@tmagic/form";
|
|
7
7
|
import { MagicTable } from "@tmagic/table";
|
|
8
8
|
import { TMagicButton, tMagicMessage, tMagicMessageBox } from "@tmagic/design";
|
|
9
9
|
import { getDefaultValueFromFields } from "@tmagic/utils";
|
|
10
|
-
import { computed, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, inject, isRef, mergeModels, onMounted, openBlock, provide, ref, unref, useModel, withCtx } from "vue";
|
|
10
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, inject, isRef, mergeModels, onMounted, openBlock, provide, ref, unref, useModel, withCtx } from "vue";
|
|
11
11
|
//#region packages/editor/src/fields/DataSourceFields.vue?vue&type=script&setup=true&lang.ts
|
|
12
12
|
var _hoisted_1 = { class: "m-editor-data-source-fields" };
|
|
13
13
|
var _hoisted_2 = {
|
|
@@ -58,6 +58,7 @@ var DataSourceFields_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
58
58
|
const emit = __emit;
|
|
59
59
|
const { uiService } = useServices();
|
|
60
60
|
const mForm = inject("mForm");
|
|
61
|
+
const silentMode = inject(FORM_SILENT_MODE_KEY, false);
|
|
61
62
|
/** 对比模式下隐藏新增/编辑/删除等操作按钮,仅保留只读展示。 */
|
|
62
63
|
const isCompare = computed(() => Boolean(mForm?.isCompare));
|
|
63
64
|
const fieldValues = ref({});
|
|
@@ -325,6 +326,7 @@ var DataSourceFields_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
325
326
|
const editingFieldPath = inject("editingDataSourceFieldPath", computed(() => []));
|
|
326
327
|
provide("editingDataSourceFieldPath", computed(() => editingFieldPath.value.slice(1)));
|
|
327
328
|
onMounted(() => {
|
|
329
|
+
if (silentMode) return;
|
|
328
330
|
const path = editingFieldPath.value;
|
|
329
331
|
if (!path.length) return;
|
|
330
332
|
const fields = props.model[props.name] || [];
|
|
@@ -357,7 +359,8 @@ var DataSourceFields_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
357
359
|
default: withCtx(() => [..._cache[9] || (_cache[9] = [createTextVNode("添加", -1)])]),
|
|
358
360
|
_: 1
|
|
359
361
|
}, 8, ["disabled"])])) : createCommentVNode("v-if", true),
|
|
360
|
-
|
|
362
|
+
!unref(silentMode) ? (openBlock(), createBlock(FloatingBox_default, {
|
|
363
|
+
key: 1,
|
|
361
364
|
"body-style": { padding: "0 16px" },
|
|
362
365
|
visible: addDialogVisible.value,
|
|
363
366
|
"onUpdate:visible": _cache[2] || (_cache[2] = ($event) => addDialogVisible.value = $event),
|
|
@@ -391,8 +394,9 @@ var DataSourceFields_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
391
394
|
"title",
|
|
392
395
|
"framework-width",
|
|
393
396
|
"position"
|
|
394
|
-
]),
|
|
395
|
-
|
|
397
|
+
])) : createCommentVNode("v-if", true),
|
|
398
|
+
!unref(silentMode) ? (openBlock(), createBlock(FloatingBox_default, {
|
|
399
|
+
key: 2,
|
|
396
400
|
"body-style": { padding: "0 16px" },
|
|
397
401
|
visible: addFromJsonDialogVisible.value,
|
|
398
402
|
"onUpdate:visible": _cache[5] || (_cache[5] = ($event) => addFromJsonDialogVisible.value = $event),
|
|
@@ -417,7 +421,7 @@ var DataSourceFields_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
417
421
|
"height",
|
|
418
422
|
"framework-width",
|
|
419
423
|
"position"
|
|
420
|
-
])
|
|
424
|
+
])) : createCommentVNode("v-if", true)
|
|
421
425
|
]);
|
|
422
426
|
};
|
|
423
427
|
}
|
package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useServices } from "../hooks/use-services.js";
|
|
|
3
3
|
import { getFieldType } from "../utils/data-source/index.js";
|
|
4
4
|
import Icon_default from "../components/Icon.js";
|
|
5
5
|
import CodeParams_default from "../components/CodeParams.js";
|
|
6
|
-
import { MCascader, createValues, filterFunction } from "@tmagic/form";
|
|
6
|
+
import { FORM_SILENT_MODE_KEY, MCascader, createValues, filterFunction } from "@tmagic/form";
|
|
7
7
|
import { TMagicButton, TMagicTooltip } from "@tmagic/design";
|
|
8
8
|
import { DATA_SOURCE_SET_DATA_METHOD_NAME } from "@tmagic/utils";
|
|
9
9
|
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, inject, openBlock, ref, unref, withCtx } from "vue";
|
|
@@ -36,6 +36,7 @@ var DataSourceMethodSelect_vue_vue_type_script_setup_true_name_true_lang_default
|
|
|
36
36
|
setup(__props, { emit: __emit }) {
|
|
37
37
|
const { dataSourceService, uiService } = useServices();
|
|
38
38
|
const mForm = inject("mForm");
|
|
39
|
+
const silentMode = inject(FORM_SILENT_MODE_KEY, false);
|
|
39
40
|
const eventBus = inject("eventBus");
|
|
40
41
|
const emit = __emit;
|
|
41
42
|
const props = __props;
|
|
@@ -134,7 +135,8 @@ var DataSourceMethodSelect_vue_vue_type_script_setup_true_name_true_lang_default
|
|
|
134
135
|
eventBus?.emit("edit-data-source-method", id, methodName);
|
|
135
136
|
};
|
|
136
137
|
return (_ctx, _cache) => {
|
|
137
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [
|
|
138
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [createElementVNode("div", _hoisted_2, [!unref(silentMode) ? (openBlock(), createBlock(unref(MCascader), {
|
|
139
|
+
key: 0,
|
|
138
140
|
class: "select",
|
|
139
141
|
config: cascaderConfig.value,
|
|
140
142
|
model: __props.model,
|
|
@@ -150,8 +152,8 @@ var DataSourceMethodSelect_vue_vue_type_script_setup_true_name_true_lang_default
|
|
|
150
152
|
"size",
|
|
151
153
|
"disabled",
|
|
152
154
|
"prop"
|
|
153
|
-
]), __props.model[__props.name] && isCustomMethod.value && dataSourceSidePanel.value && !isCompare.value ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
154
|
-
key:
|
|
155
|
+
])) : createCommentVNode("v-if", true), !unref(silentMode) && __props.model[__props.name] && isCustomMethod.value && dataSourceSidePanel.value && !isCompare.value ? (openBlock(), createBlock(unref(TMagicTooltip), {
|
|
156
|
+
key: 1,
|
|
155
157
|
content: notEditable.value ? "查看" : "编辑"
|
|
156
158
|
}, {
|
|
157
159
|
default: withCtx(() => [createVNode(unref(TMagicButton), {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import CodeBlockEditor_default from "../components/CodeBlockEditor.js";
|
|
2
|
+
import { FORM_SILENT_MODE_KEY } from "@tmagic/form";
|
|
2
3
|
import { MagicTable } from "@tmagic/table";
|
|
3
4
|
import { TMagicButton, tMagicMessageBox } from "@tmagic/design";
|
|
4
5
|
import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, inject, nextTick, onMounted, openBlock, ref, unref, useTemplateRef, withCtx } from "vue";
|
|
@@ -35,6 +36,7 @@ var DataSourceMethods_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
35
36
|
const props = __props;
|
|
36
37
|
const emit = __emit;
|
|
37
38
|
const mForm = inject("mForm");
|
|
39
|
+
const silentMode = inject(FORM_SILENT_MODE_KEY, false);
|
|
38
40
|
/** 对比模式下隐藏新增/编辑/删除等操作按钮,仅保留只读展示。 */
|
|
39
41
|
const isCompare = computed(() => Boolean(mForm?.isCompare));
|
|
40
42
|
const codeConfig = ref();
|
|
@@ -128,6 +130,7 @@ var DataSourceMethods_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
128
130
|
/** 由 DataSourceConfigPanel 注入:打开数据源详情后需要直接打开的方法名 */
|
|
129
131
|
const editingMethodName = inject("editingDataSourceMethodName", computed(() => ""));
|
|
130
132
|
onMounted(() => {
|
|
133
|
+
if (silentMode) return;
|
|
131
134
|
const methodName = editingMethodName.value;
|
|
132
135
|
if (!methodName) return;
|
|
133
136
|
const methods = props.model[props.name] || [];
|
|
@@ -152,7 +155,7 @@ var DataSourceMethods_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
152
155
|
default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("添加", -1)])]),
|
|
153
156
|
_: 1
|
|
154
157
|
}, 8, ["disabled"])])) : createCommentVNode("v-if", true),
|
|
155
|
-
codeConfig.value ? (openBlock(), createBlock(CodeBlockEditor_default, {
|
|
158
|
+
codeConfig.value && !unref(silentMode) ? (openBlock(), createBlock(CodeBlockEditor_default, {
|
|
156
159
|
key: 1,
|
|
157
160
|
ref: "codeBlockEditor",
|
|
158
161
|
disabled: __props.disabled,
|
|
@@ -3,11 +3,11 @@ import { useEditorContentHeight } from "../hooks/use-editor-content-height.js";
|
|
|
3
3
|
import { useNextFloatBoxPosition } from "../hooks/use-next-float-box-position.js";
|
|
4
4
|
import CodeEditor_default from "../layouts/CodeEditor.js";
|
|
5
5
|
import FloatingBox_default from "../components/FloatingBox.js";
|
|
6
|
-
import { MFormBox } from "@tmagic/form";
|
|
6
|
+
import { FORM_SILENT_MODE_KEY, MFormBox } from "@tmagic/form";
|
|
7
7
|
import { MagicTable } from "@tmagic/table";
|
|
8
8
|
import { TMagicButton, TMagicSwitch, tMagicMessageBox } from "@tmagic/design";
|
|
9
9
|
import { getDefaultValueFromFields } from "@tmagic/utils";
|
|
10
|
-
import { computed, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, inject, isRef, mergeModels, openBlock, ref, unref, useModel, withCtx } from "vue";
|
|
10
|
+
import { computed, createBlock, createCommentVNode, createElementBlock, createTextVNode, createVNode, defineComponent, inject, isRef, mergeModels, openBlock, ref, unref, useModel, withCtx } from "vue";
|
|
11
11
|
//#region packages/editor/src/fields/DataSourceMocks.vue?vue&type=script&setup=true&lang.ts
|
|
12
12
|
var _hoisted_1 = { class: "m-editor-data-source-fields" };
|
|
13
13
|
var _hoisted_2 = {
|
|
@@ -49,6 +49,7 @@ var DataSourceMocks_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
49
49
|
const emit = __emit;
|
|
50
50
|
const { uiService } = useServices();
|
|
51
51
|
const mForm = inject("mForm");
|
|
52
|
+
const silentMode = inject(FORM_SILENT_MODE_KEY, false);
|
|
52
53
|
/** 对比模式下隐藏新增/编辑/删除等操作按钮,仅保留只读展示。 */
|
|
53
54
|
const isCompare = computed(() => Boolean(mForm?.isCompare));
|
|
54
55
|
const width = useModel(__props, "width");
|
|
@@ -234,7 +235,8 @@ var DataSourceMocks_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
234
235
|
default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode("添加", -1)])]),
|
|
235
236
|
_: 1
|
|
236
237
|
}, 8, ["disabled"])])) : createCommentVNode("v-if", true),
|
|
237
|
-
|
|
238
|
+
!unref(silentMode) ? (openBlock(), createBlock(FloatingBox_default, {
|
|
239
|
+
key: 1,
|
|
238
240
|
"body-style": { padding: "0 16px" },
|
|
239
241
|
visible: addDialogVisible.value,
|
|
240
242
|
"onUpdate:visible": _cache[1] || (_cache[1] = ($event) => addDialogVisible.value = $event),
|
|
@@ -266,7 +268,7 @@ var DataSourceMocks_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
|
|
|
266
268
|
"title",
|
|
267
269
|
"framework-width",
|
|
268
270
|
"position"
|
|
269
|
-
])
|
|
271
|
+
])) : createCommentVNode("v-if", true)
|
|
270
272
|
]);
|
|
271
273
|
};
|
|
272
274
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useServices } from "../hooks/use-services.js";
|
|
2
2
|
import { getCascaderOptionsFromFields, getFieldType } from "../utils/data-source/index.js";
|
|
3
3
|
import { MGroupList, filterFunction } from "@tmagic/form";
|
|
4
|
+
import { removeDataSourceFieldPrefix } from "@tmagic/utils";
|
|
4
5
|
import { computed, createBlock, defineComponent, inject, openBlock, unref } from "vue";
|
|
5
6
|
//#region packages/editor/src/fields/DisplayConds.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var DisplayConds_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -31,9 +32,15 @@ var DisplayConds_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
31
32
|
const { dataSourceService } = useServices();
|
|
32
33
|
const mForm = inject("mForm");
|
|
33
34
|
const parentFields = computed(() => filterFunction(mForm, props.config.parentFields, props) || []);
|
|
35
|
+
const resolveFieldPath = (path) => {
|
|
36
|
+
const [id, ...fieldNames] = path;
|
|
37
|
+
return {
|
|
38
|
+
ds: id ? dataSourceService.getDataSourceById(removeDataSourceFieldPrefix(`${id}`)) : void 0,
|
|
39
|
+
fieldNames
|
|
40
|
+
};
|
|
41
|
+
};
|
|
34
42
|
const fieldOnChange = (_formState, v, { model }) => {
|
|
35
|
-
const
|
|
36
|
-
const ds = dataSourceService.getDataSourceById(id);
|
|
43
|
+
const { ds, fieldNames } = resolveFieldPath([...parentFields.value, ...v]);
|
|
37
44
|
const type = getFieldType(ds, fieldNames);
|
|
38
45
|
if (type === "number") model.value = Number(model.value);
|
|
39
46
|
else if (type === "boolean") model.value = Boolean(model.value);
|
|
@@ -59,11 +66,10 @@ var DisplayConds_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
59
66
|
parentFields.value.length ? {
|
|
60
67
|
type: "cascader",
|
|
61
68
|
options: () => {
|
|
62
|
-
const
|
|
63
|
-
const ds = dataSourceService.getDataSourceById(dsId);
|
|
69
|
+
const { ds, fieldNames } = resolveFieldPath(parentFields.value);
|
|
64
70
|
if (!ds) return [];
|
|
65
71
|
let fields = ds.fields || [];
|
|
66
|
-
|
|
72
|
+
fieldNames.forEach((key) => {
|
|
67
73
|
fields = fields.find((f) => f.name === key)?.fields || [];
|
|
68
74
|
});
|
|
69
75
|
return getCascaderOptionsFromFields(fields, [
|
|
@@ -131,8 +137,7 @@ var DisplayConds_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ def
|
|
|
131
137
|
items: [{
|
|
132
138
|
name: "value",
|
|
133
139
|
type: (_mForm, { model }) => {
|
|
134
|
-
const
|
|
135
|
-
const ds = dataSourceService.getDataSourceById(id);
|
|
140
|
+
const { ds, fieldNames } = resolveFieldPath([...parentFields.value, ...model.field || []]);
|
|
136
141
|
const type = getFieldType(ds, fieldNames);
|
|
137
142
|
if (type === "number") return "number";
|
|
138
143
|
if (type === "boolean") return "select";
|
|
@@ -187,8 +187,8 @@ var EventSelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
187
187
|
name: "method",
|
|
188
188
|
label: "动作",
|
|
189
189
|
type: compActionConfig.value.type,
|
|
190
|
-
options: (mForm, { model }) => {
|
|
191
|
-
const node = editorService.getNodeById(model.to);
|
|
190
|
+
options: (mForm, { model, formValue }) => {
|
|
191
|
+
const node = editorService.getNodeById(model.to) || formValue;
|
|
192
192
|
if (!node?.type) return [];
|
|
193
193
|
return eventsService.getMethod(node.type, {
|
|
194
194
|
targetId: model.to,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import CodeEditor_default from "../layouts/CodeEditor.js";
|
|
2
2
|
import CodeIcon_default from "../icons/CodeIcon.js";
|
|
3
|
+
import { FORM_SILENT_MODE_KEY } from "@tmagic/form";
|
|
3
4
|
import { TMagicButton, TMagicInput } from "@tmagic/design";
|
|
4
5
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, inject, openBlock, ref, renderList, unref, watchEffect, withCtx } from "vue";
|
|
5
6
|
import { Delete, Plus } from "@element-plus/icons-vue";
|
|
@@ -32,6 +33,7 @@ var KeyValue_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
32
33
|
const props = __props;
|
|
33
34
|
const emit = __emit;
|
|
34
35
|
const mForm = inject("mForm");
|
|
36
|
+
const silentMode = inject(FORM_SILENT_MODE_KEY, false);
|
|
35
37
|
/** 对比模式下隐藏增删/代码切换等操作按钮,仅保留只读展示。 */
|
|
36
38
|
const isCompare = computed(() => Boolean(mForm?.isCompare));
|
|
37
39
|
const records = ref([]);
|
|
@@ -137,7 +139,7 @@ var KeyValue_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
137
139
|
"disabled",
|
|
138
140
|
"icon"
|
|
139
141
|
])) : createCommentVNode("v-if", true)])) : createCommentVNode("v-if", true),
|
|
140
|
-
__props.config.advanced && showCode.value ? (openBlock(), createBlock(CodeEditor_default, {
|
|
142
|
+
__props.config.advanced && showCode.value && !unref(silentMode) ? (openBlock(), createBlock(CodeEditor_default, {
|
|
141
143
|
key: 1,
|
|
142
144
|
"editor-custom-type": "m-fields-key-value",
|
|
143
145
|
language: "javascript",
|
|
@@ -150,7 +152,7 @@ var KeyValue_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
150
152
|
parse: true,
|
|
151
153
|
onSave: save
|
|
152
154
|
}, null, 8, ["init-values", "options"])) : createCommentVNode("v-if", true),
|
|
153
|
-
__props.config.advanced && !isCompare.value ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
155
|
+
__props.config.advanced && !isCompare.value && !unref(silentMode) ? (openBlock(), createBlock(unref(TMagicButton), {
|
|
154
156
|
key: 2,
|
|
155
157
|
size: "default",
|
|
156
158
|
disabled: __props.disabled,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { validateDataSourceFieldSelect } from "../../../utils/type-match-rules.js";
|
|
2
2
|
import Left_default from "../icons/text-align/Left.js";
|
|
3
3
|
import Center_default from "../icons/text-align/Center.js";
|
|
4
4
|
import Right_default from "../icons/text-align/Right.js";
|
|
@@ -56,7 +56,7 @@ var Font_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
56
56
|
},
|
|
57
57
|
rules: [{ typeMatch: false }, { validator: ({ value, callback }, { config, model, prop }, mForm) => {
|
|
58
58
|
if (value === "" || value === null || value === void 0) return callback();
|
|
59
|
-
const result =
|
|
59
|
+
const result = validateDataSourceFieldSelect(value, {
|
|
60
60
|
fieldType: "data-source-field-select",
|
|
61
61
|
mForm,
|
|
62
62
|
props: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { getCodeBlockFormConfig } from "../utils/code-block.js";
|
|
2
|
-
import { removeStyleDisplayConfig } from "../utils/props.js";
|
|
3
2
|
import { computed, inject, provide, ref, useTemplateRef, watch, watchEffect } from "vue";
|
|
4
3
|
//#region packages/editor/src/hooks/use-compare-form.ts
|
|
5
4
|
/**
|
|
@@ -54,7 +53,7 @@ var useCompareForm = (props) => {
|
|
|
54
53
|
switch (props.category) {
|
|
55
54
|
case "node":
|
|
56
55
|
if (!props.type) return [];
|
|
57
|
-
return
|
|
56
|
+
return props.services.propsService.getPropsConfig(props.type, { node: props.value });
|
|
58
57
|
case "data-source": return props.services.dataSourceService.getFormConfig(props.type || "base").map((item) => "type" in item && item.type === "tab" ? {
|
|
59
58
|
...item,
|
|
60
59
|
active: "fields"
|
package/dist/es/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import { CODE_DRAFT_STORAGE_KEY, CodeDeleteErrorType, ColumnLayout, DragType, Ke
|
|
|
2
2
|
import { useCodeBlockEdit } from "./hooks/use-code-block-edit.js";
|
|
3
3
|
import { getEditorConfig, isGlobalFlat, setEditorConfig } from "./utils/config.js";
|
|
4
4
|
import { getCodeBlockFormConfig } from "./utils/code-block.js";
|
|
5
|
-
import { advancedTabConfig, arrayOptions, booleanOptions, displayTabConfig, eqOptions, eventTabConfig, fillConfig, getCondOpOptionsByFieldType, numberOptions, removeStyleDisplayConfig, styleTabConfig } from "./utils/props.js";
|
|
6
5
|
import { useCompareForm } from "./hooks/use-compare-form.js";
|
|
6
|
+
import { advancedTabConfig, arrayOptions, booleanOptions, displayTabConfig, eqOptions, eventTabConfig, fillConfig, getCondOpOptionsByFieldType, numberOptions, styleTabConfig } from "./utils/props.js";
|
|
7
7
|
import props_default from "./services/props.js";
|
|
8
8
|
import { UndoRedo } from "./utils/undo-redo.js";
|
|
9
9
|
import { createStackStep, describeRevertStep, deserializeStacks, detectStackOpType, detectTargetId, detectTargetName, getLastPushedHistoryIds, getOrCreateStack, markStackSaved, mergeSteps, serializeStacks, undoFloor } from "./utils/history.js";
|
|
@@ -31,7 +31,7 @@ import { IdleTask } from "./utils/dep/idle-task.js";
|
|
|
31
31
|
import { ScrollViewer } from "./utils/scroll-viewer.js";
|
|
32
32
|
import codeBlock_default from "./services/codeBlock.js";
|
|
33
33
|
import dataSource_default from "./services/dataSource.js";
|
|
34
|
-
import { ALL_COND_OPS, editorTypeMatchRules,
|
|
34
|
+
import { ALL_COND_OPS, editorTypeMatchRules, validateDataSourceFieldSelect } from "./utils/type-match-rules.js";
|
|
35
35
|
import events_default from "./services/events.js";
|
|
36
36
|
import { EVENT_NAME_VALUE_SEPARATOR, collectEventNameOptionValues, getCompActionAllowedValues, getCompActionOptions, getEventNameAllowedValues, getEventNameOptions, isEventNameCheckStrictly, normalizeCompActionValue } from "./utils/event.js";
|
|
37
37
|
import monaco_editor_default from "./utils/monaco-editor.js";
|
|
@@ -92,4 +92,4 @@ export * from "@tmagic/table";
|
|
|
92
92
|
export * from "@tmagic/stage";
|
|
93
93
|
export * from "@tmagic/design";
|
|
94
94
|
export * from "@tmagic/utils";
|
|
95
|
-
export { ALL_COND_OPS, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CodeBlockEditor_default as CodeBlockEditor, CodeBlockList_default as CodeBlockList, CodeBlockListPanel_default as CodeBlockListPanel, CodeDeleteErrorType, CodeSelect_default as CodeSelect, CodeSelectCol_default as CodeSelectCol, ColumnLayout, CompareForm_default as CompareForm, ComponentListPanel_default as ComponentListPanel, CondOpSelect_default as CondOpSelect, ContentMenu_default as ContentMenu, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, DataSourceAddButton_default as DataSourceAddButton, DataSourceConfigPanel_default as DataSourceConfigPanel, Index_default as DataSourceFieldSelect, DataSourceFields_default as DataSourceFields, DataSourceInput_default as DataSourceInput, DataSourceMethodSelect_default as DataSourceMethodSelect, DataSourceMethods_default as DataSourceMethods, DataSourceMocks_default as DataSourceMocks, DataSourceSelect_default as DataSourceSelect, DepTargetType, DisplayConds_default as DisplayConds, DragType, EVENT_NAME_VALUE_SEPARATOR, EventSelect_default as EventSelect, Fixed2Other, FloatingBox_default as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, HistoryDiffDialog_default as HistoryDiffDialog, Bucket_default as HistoryListBucket, BucketTab_default as HistoryListBucketTab, Icon_default as Icon, IdleTask, KeyBindingCommand, KeyValue_default as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeContent_default as LayerNodeContent, LayerOffset, LayerPanel_default as LayerPanel, Layout, SplitView_default as LayoutContainer, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, PROPS_PANEL_WIDTH_STORAGE_KEY, PageFragmentSelect_default as PageFragmentSelect, FormPanel_default as PropsFormPanel, PropsPanel_default as PropsPanel, RIGHT_COLUMN_WIDTH_STORAGE_KEY, Resizer_default as Resizer, ScrollViewer, SideItemKey, SplitView_default as SplitView, StageCore, Index_default$1 as StyleSetter, CodeEditor_default as TMagicCodeEditor, Editor_default as TMagicEditor, ToolButton_default as ToolButton, Tree_default as Tree, TreeNode_default as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, ViewForm_default as ViewForm, advancedTabConfig, arrayOptions, beforePaste, booleanOptions, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, codeBlock_default as codeBlockService, collectEventNameOptionValues, collectRelatedNodes, componentList_default as componentListService, confirmHistoryAction, createStackStep, dataSource_default as dataSourceService, debug, plugin_default as default, defaultIsExpandable, dep_default as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectStackOpType, detectTargetId, detectTargetName, displayTabConfig, editorNodeMergeCustomizer, editor_default as editorService, editorTypeMatchRules, eqOptions, error, eventTabConfig, events_default as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getCompActionAllowedValues, getCompActionOptions, getCondOpOptionsByFieldType, getDefaultConfig, getDisplayField, getEditorConfig, getEventNameAllowedValues, getEventNameOptions, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getLastPushedHistoryIds, getNodeIndex, getOrCreateStack, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, history_default as historyService, idbDelete, idbGet, idbSet, info, isEventNameCheckStrictly, isGlobalFlat, isIncludeDataSource, isIndexedDBSupported, keybinding_default as keybindingService, monaco_editor_default as loadMonaco, log, markStackSaved, mergeSteps, moveItemsInContainer, normalizeCompActionValue, numberOptions, openIndexedDB, props_default as propsService,
|
|
95
|
+
export { ALL_COND_OPS, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CodeBlockEditor_default as CodeBlockEditor, CodeBlockList_default as CodeBlockList, CodeBlockListPanel_default as CodeBlockListPanel, CodeDeleteErrorType, CodeSelect_default as CodeSelect, CodeSelectCol_default as CodeSelectCol, ColumnLayout, CompareForm_default as CompareForm, ComponentListPanel_default as ComponentListPanel, CondOpSelect_default as CondOpSelect, ContentMenu_default as ContentMenu, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, DataSourceAddButton_default as DataSourceAddButton, DataSourceConfigPanel_default as DataSourceConfigPanel, Index_default as DataSourceFieldSelect, DataSourceFields_default as DataSourceFields, DataSourceInput_default as DataSourceInput, DataSourceMethodSelect_default as DataSourceMethodSelect, DataSourceMethods_default as DataSourceMethods, DataSourceMocks_default as DataSourceMocks, DataSourceSelect_default as DataSourceSelect, DepTargetType, DisplayConds_default as DisplayConds, DragType, EVENT_NAME_VALUE_SEPARATOR, EventSelect_default as EventSelect, Fixed2Other, FloatingBox_default as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, HistoryDiffDialog_default as HistoryDiffDialog, Bucket_default as HistoryListBucket, BucketTab_default as HistoryListBucketTab, Icon_default as Icon, IdleTask, KeyBindingCommand, KeyValue_default as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeContent_default as LayerNodeContent, LayerOffset, LayerPanel_default as LayerPanel, Layout, SplitView_default as LayoutContainer, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, PROPS_PANEL_WIDTH_STORAGE_KEY, PageFragmentSelect_default as PageFragmentSelect, FormPanel_default as PropsFormPanel, PropsPanel_default as PropsPanel, RIGHT_COLUMN_WIDTH_STORAGE_KEY, Resizer_default as Resizer, ScrollViewer, SideItemKey, SplitView_default as SplitView, StageCore, Index_default$1 as StyleSetter, CodeEditor_default as TMagicCodeEditor, Editor_default as TMagicEditor, ToolButton_default as ToolButton, Tree_default as Tree, TreeNode_default as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, ViewForm_default as ViewForm, advancedTabConfig, arrayOptions, beforePaste, booleanOptions, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, codeBlock_default as codeBlockService, collectEventNameOptionValues, collectRelatedNodes, componentList_default as componentListService, confirmHistoryAction, createStackStep, dataSource_default as dataSourceService, debug, plugin_default as default, defaultIsExpandable, dep_default as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectStackOpType, detectTargetId, detectTargetName, displayTabConfig, editorNodeMergeCustomizer, editor_default as editorService, editorTypeMatchRules, eqOptions, error, eventTabConfig, events_default as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getCompActionAllowedValues, getCompActionOptions, getCondOpOptionsByFieldType, getDefaultConfig, getDisplayField, getEditorConfig, getEventNameAllowedValues, getEventNameOptions, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getLastPushedHistoryIds, getNodeIndex, getOrCreateStack, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, history_default as historyService, idbDelete, idbGet, idbSet, info, isEventNameCheckStrictly, isGlobalFlat, isIncludeDataSource, isIndexedDBSupported, keybinding_default as keybindingService, monaco_editor_default as loadMonaco, log, markStackSaved, mergeSteps, moveItemsInContainer, normalizeCompActionValue, numberOptions, openIndexedDB, props_default as propsService, resolveFieldByPath, resolveSelectedNode, serializeConfig, serializeStacks, setChildrenLayout, setEditorConfig, setLayout, stageOverlay_default as stageOverlayService, storage_default as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, ui_default as uiService, undoFloor, updateStatus, useCodeBlockEdit, useCompareForm, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useHistoryRevert, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, validateDataSourceFieldSelect, warn };
|
package/dist/es/plugin.js
CHANGED
|
@@ -21,7 +21,7 @@ import Code_default from "./fields/Code.js";
|
|
|
21
21
|
import CodeLink_default from "./fields/CodeLink.js";
|
|
22
22
|
import UISelect_default from "./fields/UISelect.js";
|
|
23
23
|
/* empty css */
|
|
24
|
-
import formPlugin, { registerTypeMatchRules } from "@tmagic/form";
|
|
24
|
+
import formPlugin, { registerSilentLeafFieldTypes, registerTypeMatchRules } from "@tmagic/form";
|
|
25
25
|
import tablePlugin from "@tmagic/table";
|
|
26
26
|
import designPlugin from "@tmagic/design";
|
|
27
27
|
//#region packages/editor/src/plugin.ts
|
|
@@ -37,6 +37,14 @@ var plugin_default = { install: (app, opt) => {
|
|
|
37
37
|
app.use(formPlugin, opt || {});
|
|
38
38
|
app.use(tablePlugin);
|
|
39
39
|
registerTypeMatchRules(editorTypeMatchRules);
|
|
40
|
+
registerSilentLeafFieldTypes([
|
|
41
|
+
"vs-code",
|
|
42
|
+
"ui-select",
|
|
43
|
+
"cond-op-select",
|
|
44
|
+
"page-fragment-select",
|
|
45
|
+
"data-source-select",
|
|
46
|
+
"data-source-input"
|
|
47
|
+
]);
|
|
40
48
|
app.config.globalProperties.$TMAGIC_EDITOR = option;
|
|
41
49
|
setEditorConfig(option);
|
|
42
50
|
app.component(`${Editor_default.name || "MEditor"}`, Editor_default);
|