@tmagic/editor 1.8.0-beta.21 → 1.8.0-beta.22
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/StyleSetter/components/Box.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +6 -1
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +35 -3
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +26 -5
- package/dist/es/index.js +2 -2
- package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +23 -12
- package/dist/es/layouts/sidebar/ComponentListPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/layer/LayerPanel.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/services/editor.js +12 -8
- package/dist/es/utils/type-match-rules.js +17 -9
- package/dist/tmagic-editor.umd.cjs +119 -41
- package/package.json +7 -7
- package/src/fields/StyleSetter/components/Box.vue +1 -1
- package/src/fields/StyleSetter/components/Position.vue +1 -1
- package/src/fields/StyleSetter/pro/Background.vue +7 -0
- package/src/fields/StyleSetter/pro/Font.vue +57 -0
- package/src/fields/StyleSetter/pro/Position.vue +31 -0
- package/src/layouts/props-panel/PropsPanel.vue +30 -16
- package/src/layouts/sidebar/ComponentListPanel.vue +5 -1
- package/src/layouts/sidebar/layer/LayerPanel.vue +1 -1
- package/src/services/editor.ts +27 -8
- package/src/utils/type-match-rules.ts +37 -4
- package/types/index.d.ts +22 -2
|
@@ -7,7 +7,7 @@ var _hoisted_2 = {
|
|
|
7
7
|
};
|
|
8
8
|
var _hoisted_3 = { class: "next-input" };
|
|
9
9
|
var _hoisted_4 = [
|
|
10
|
-
"
|
|
10
|
+
"value",
|
|
11
11
|
"title",
|
|
12
12
|
"disabled",
|
|
13
13
|
"onChange"
|
|
@@ -69,7 +69,7 @@ var Box_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompon
|
|
|
69
69
|
key: index,
|
|
70
70
|
class: normalizeClass(item.class)
|
|
71
71
|
}, [item.text ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(item.text), 1)) : createCommentVNode("v-if", true), createElementVNode("span", _hoisted_3, [createElementVNode("input", {
|
|
72
|
-
|
|
72
|
+
value: __props.model[item.name],
|
|
73
73
|
placeholder: "0",
|
|
74
74
|
title: __props.model[item.name],
|
|
75
75
|
disabled: __props.disabled,
|
|
@@ -4,6 +4,7 @@ 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
6
|
import { MContainer, defineFormConfig } from "@tmagic/form";
|
|
7
|
+
import { appendValidateSuggestion } from "@tmagic/design";
|
|
7
8
|
import { Fragment, createBlock, createElementBlock, defineComponent, markRaw, openBlock, renderList, unref } from "vue";
|
|
8
9
|
//#region packages/editor/src/fields/StyleSetter/pro/Background.vue?vue&type=script&setup=true&lang.ts
|
|
9
10
|
var Background_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -26,7 +27,11 @@ var Background_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
26
27
|
text: "背景色",
|
|
27
28
|
labelWidth: "68px",
|
|
28
29
|
type: "data-source-field-select",
|
|
29
|
-
fieldConfig: { type: "colorPicker" }
|
|
30
|
+
fieldConfig: { type: "colorPicker" },
|
|
31
|
+
rules: [{
|
|
32
|
+
typeMatch: true,
|
|
33
|
+
message: appendValidateSuggestion("背景色应为字符串", "请参考以下示例值:\"#000000\"")
|
|
34
|
+
}]
|
|
30
35
|
},
|
|
31
36
|
{
|
|
32
37
|
name: "backgroundImage",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { validateDataSourceFieldSelectValue } from "../../../utils/type-match-rules.js";
|
|
1
2
|
import Left_default from "../icons/text-align/Left.js";
|
|
2
3
|
import Center_default from "../icons/text-align/Center.js";
|
|
3
4
|
import Right_default from "../icons/text-align/Right.js";
|
|
4
5
|
import { MContainer, defineFormConfig } from "@tmagic/form";
|
|
6
|
+
import { appendValidateSuggestion } from "@tmagic/design";
|
|
5
7
|
import { Fragment, createBlock, createElementBlock, defineComponent, markRaw, openBlock, renderList, unref } from "vue";
|
|
6
8
|
//#region packages/editor/src/fields/StyleSetter/pro/Font.vue?vue&type=script&setup=true&lang.ts
|
|
7
9
|
var Font_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -25,7 +27,11 @@ var Font_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
25
27
|
name: "fontSize",
|
|
26
28
|
text: "字号",
|
|
27
29
|
type: "data-source-field-select",
|
|
28
|
-
fieldConfig: { type: "text" }
|
|
30
|
+
fieldConfig: { type: "text" },
|
|
31
|
+
rules: [{
|
|
32
|
+
typeMatch: true,
|
|
33
|
+
message: appendValidateSuggestion("字号应为字符串或数字", "请参考以下示例值:24 或 \"24\"")
|
|
34
|
+
}]
|
|
29
35
|
}, {
|
|
30
36
|
labelWidth: "68px",
|
|
31
37
|
name: "lineHeight",
|
|
@@ -39,20 +45,46 @@ var Font_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCompo
|
|
|
39
45
|
text: "字重",
|
|
40
46
|
labelWidth: "68px",
|
|
41
47
|
type: "data-source-field-select",
|
|
48
|
+
dataSourceFieldType: ["string", "number"],
|
|
42
49
|
fieldConfig: {
|
|
43
50
|
type: "select",
|
|
51
|
+
allowCreate: true,
|
|
44
52
|
options: ["normal", "bold"].concat(Array(7).fill(1).map((x, i) => `${i + 1}00`)).map((item) => ({
|
|
45
53
|
value: item,
|
|
46
54
|
text: item
|
|
47
55
|
}))
|
|
48
|
-
}
|
|
56
|
+
},
|
|
57
|
+
rules: [{ typeMatch: false }, { validator: ({ value, callback }, { config, model, prop }, mForm) => {
|
|
58
|
+
if (value === "" || value === null || value === void 0) return callback();
|
|
59
|
+
const result = validateDataSourceFieldSelectValue(value, {
|
|
60
|
+
fieldType: "data-source-field-select",
|
|
61
|
+
mForm,
|
|
62
|
+
props: {
|
|
63
|
+
config,
|
|
64
|
+
model,
|
|
65
|
+
prop
|
|
66
|
+
}
|
|
67
|
+
}, { validatePlainValue: (plainValue) => {
|
|
68
|
+
if (typeof plainValue === "string" || typeof plainValue === "number" && !Number.isNaN(plainValue)) return;
|
|
69
|
+
return "字重应为字符串或数字";
|
|
70
|
+
} });
|
|
71
|
+
if (result && typeof result.then === "function") {
|
|
72
|
+
result.then((error) => callback(error), (error) => callback(error));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
return callback(result);
|
|
76
|
+
} }]
|
|
49
77
|
},
|
|
50
78
|
{
|
|
51
79
|
labelWidth: "68px",
|
|
52
80
|
name: "color",
|
|
53
81
|
text: "颜色",
|
|
54
82
|
type: "data-source-field-select",
|
|
55
|
-
fieldConfig: { type: "colorPicker" }
|
|
83
|
+
fieldConfig: { type: "colorPicker" },
|
|
84
|
+
rules: [{
|
|
85
|
+
typeMatch: true,
|
|
86
|
+
message: appendValidateSuggestion("颜色应为字符串", "请参考以下示例值:\"#000000\"")
|
|
87
|
+
}]
|
|
56
88
|
},
|
|
57
89
|
{
|
|
58
90
|
name: "textAlign",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MContainer, defineFormConfig } from "@tmagic/form";
|
|
2
|
+
import { appendValidateSuggestion } from "@tmagic/design";
|
|
2
3
|
import { Fragment, createBlock, createElementBlock, defineComponent, openBlock, renderList, unref } from "vue";
|
|
3
4
|
//#region packages/editor/src/fields/StyleSetter/pro/Position.vue?vue&type=script&setup=true&lang.ts
|
|
4
5
|
var Position_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
|
|
@@ -44,12 +45,20 @@ var Position_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
44
45
|
name: "left",
|
|
45
46
|
type: "data-source-field-select",
|
|
46
47
|
text: "left",
|
|
47
|
-
fieldConfig: { type: "text" }
|
|
48
|
+
fieldConfig: { type: "text" },
|
|
49
|
+
rules: [{
|
|
50
|
+
typeMatch: true,
|
|
51
|
+
message: appendValidateSuggestion("left 应为字符串", "请参考以下示例值:\"10\"")
|
|
52
|
+
}]
|
|
48
53
|
}, {
|
|
49
54
|
name: "top",
|
|
50
55
|
type: "data-source-field-select",
|
|
51
56
|
text: "top",
|
|
52
|
-
fieldConfig: { type: "text" }
|
|
57
|
+
fieldConfig: { type: "text" },
|
|
58
|
+
rules: [{
|
|
59
|
+
typeMatch: true,
|
|
60
|
+
message: appendValidateSuggestion("top 应为字符串", "请参考以下示例值:\"10\"")
|
|
61
|
+
}]
|
|
53
62
|
}]
|
|
54
63
|
},
|
|
55
64
|
{
|
|
@@ -60,12 +69,20 @@ var Position_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
60
69
|
name: "right",
|
|
61
70
|
type: "data-source-field-select",
|
|
62
71
|
text: "right",
|
|
63
|
-
fieldConfig: { type: "text" }
|
|
72
|
+
fieldConfig: { type: "text" },
|
|
73
|
+
rules: [{
|
|
74
|
+
typeMatch: true,
|
|
75
|
+
message: appendValidateSuggestion("right 应为字符串", "请参考以下示例值:\"10\"")
|
|
76
|
+
}]
|
|
64
77
|
}, {
|
|
65
78
|
name: "bottom",
|
|
66
79
|
type: "data-source-field-select",
|
|
67
80
|
text: "bottom",
|
|
68
|
-
fieldConfig: { type: "text" }
|
|
81
|
+
fieldConfig: { type: "text" },
|
|
82
|
+
rules: [{
|
|
83
|
+
typeMatch: true,
|
|
84
|
+
message: appendValidateSuggestion("bottom 应为字符串", "请参考以下示例值:\"10\"")
|
|
85
|
+
}]
|
|
69
86
|
}]
|
|
70
87
|
},
|
|
71
88
|
{
|
|
@@ -73,7 +90,11 @@ var Position_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
|
|
|
73
90
|
name: "zIndex",
|
|
74
91
|
text: "zIndex",
|
|
75
92
|
type: "data-source-field-select",
|
|
76
|
-
fieldConfig: { type: "text" }
|
|
93
|
+
fieldConfig: { type: "text" },
|
|
94
|
+
rules: [{
|
|
95
|
+
typeMatch: true,
|
|
96
|
+
message: appendValidateSuggestion("zIndex 应为数字", "请参考以下示例值:10")
|
|
97
|
+
}]
|
|
77
98
|
}
|
|
78
99
|
]);
|
|
79
100
|
const change = (value, eventData) => {
|
package/dist/es/index.js
CHANGED
|
@@ -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 } from "./utils/type-match-rules.js";
|
|
34
|
+
import { ALL_COND_OPS, editorTypeMatchRules, validateDataSourceFieldSelectValue } 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, removeStyleDisplayConfig, 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, warn };
|
|
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, removeStyleDisplayConfig, 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, validateDataSourceFieldSelectValue, warn };
|
|
@@ -68,22 +68,33 @@ var PropsPanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
68
68
|
const submit = async (v, eventData, error, source = "props") => {
|
|
69
69
|
try {
|
|
70
70
|
if (!v.id) v.id = values.value.id;
|
|
71
|
-
const newValue = {
|
|
72
|
-
...v,
|
|
73
|
-
style: {}
|
|
74
|
-
};
|
|
75
|
-
if (v.style) if (eventData) {
|
|
76
|
-
Object.entries(v.style).forEach(([key, value]) => {
|
|
77
|
-
if (value !== "" && newValue.style) newValue.style[key] = value;
|
|
78
|
-
});
|
|
79
|
-
eventData.changeRecords?.forEach((record) => {
|
|
80
|
-
if (record.propPath?.startsWith("style") && record.value === "") setValueByKeyPath(record.propPath, record.value, newValue);
|
|
81
|
-
});
|
|
82
|
-
} else newValue.style = { ...v.style };
|
|
83
71
|
const historySource = eventData ? "props" : "code";
|
|
72
|
+
const replace = historySource === "code";
|
|
73
|
+
let newValue;
|
|
74
|
+
if (replace) if (source === "style") newValue = {
|
|
75
|
+
...values.value,
|
|
76
|
+
id: v.id || values.value.id,
|
|
77
|
+
style: { ...v.style || {} }
|
|
78
|
+
};
|
|
79
|
+
else newValue = { ...v };
|
|
80
|
+
else {
|
|
81
|
+
newValue = {
|
|
82
|
+
...v,
|
|
83
|
+
style: {}
|
|
84
|
+
};
|
|
85
|
+
if (v.style) {
|
|
86
|
+
Object.entries(v.style).forEach(([key, value]) => {
|
|
87
|
+
if (value !== "" && newValue.style) newValue.style[key] = value;
|
|
88
|
+
});
|
|
89
|
+
eventData?.changeRecords?.forEach((record) => {
|
|
90
|
+
if (record.propPath?.startsWith("style") && record.value === "") setValueByKeyPath(record.propPath, record.value, newValue);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
84
94
|
editorService.update(newValue, {
|
|
85
95
|
changeRecords: eventData?.changeRecords,
|
|
86
96
|
historySource,
|
|
97
|
+
replace,
|
|
87
98
|
...enablePropsFormValidate && error ? { invalidInfo: {
|
|
88
99
|
id: newValue.id,
|
|
89
100
|
source,
|
|
@@ -23,7 +23,7 @@ var ComponentListPanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__
|
|
|
23
23
|
const stage = computed(() => editorService.get("stage"));
|
|
24
24
|
const list = computed(() => componentListService.getList().map((group) => ({
|
|
25
25
|
...group,
|
|
26
|
-
items: group.items.filter((item) => item.text.includes(searchText.value))
|
|
26
|
+
items: group.items.filter((item) => `${item.text || ""}${item.desc || ""}${item.type}`.toLocaleLowerCase().includes(searchText.value.toLocaleLowerCase()))
|
|
27
27
|
})));
|
|
28
28
|
const collapseValue = ref();
|
|
29
29
|
watch(list, () => {
|
|
@@ -39,7 +39,7 @@ var LayerPanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
|
|
|
39
39
|
let name = "";
|
|
40
40
|
if (data.name) name = data.name;
|
|
41
41
|
else if (data.items) name = "container";
|
|
42
|
-
return `${data.id}${name}${data.type}`.includes(v);
|
|
42
|
+
return `${data.id}${name}${data.type || ""}`.toLocaleLowerCase().includes(v.toLocaleLowerCase());
|
|
43
43
|
};
|
|
44
44
|
const { filterTextChangeHandler } = useFilter(nodeData, nodeStatusMap, filterNodeMethod);
|
|
45
45
|
const collapseAllHandler = () => {
|
|
@@ -467,14 +467,14 @@ var Editor = class extends BaseService {
|
|
|
467
467
|
remove: removedPages
|
|
468
468
|
});
|
|
469
469
|
}
|
|
470
|
-
async doUpdate(config, { changeRecords = [], historySource } = {}) {
|
|
470
|
+
async doUpdate(config, { changeRecords = [], historySource, replace = false } = {}) {
|
|
471
471
|
if (!this.get("root")) throw new Error("root为空");
|
|
472
472
|
if (!config?.id) throw new Error("没有配置或者配置缺少id值");
|
|
473
473
|
const info = this.getNodeInfo(config.id, false);
|
|
474
474
|
if (!info.node) throw new Error(`获取不到id为${config.id}的节点`);
|
|
475
475
|
const node = toRaw(info.node);
|
|
476
|
-
let newConfig = await toggleFixedPosition(toRaw(config), node, info.path, this.getLayout);
|
|
477
|
-
newConfig = mergeWith(cloneDeep$1(node), newConfig, editorNodeMergeCustomizer);
|
|
476
|
+
let newConfig = replace ? cloneDeep$1(toRaw(config)) : await toggleFixedPosition(toRaw(config), node, info.path, this.getLayout);
|
|
477
|
+
if (!replace) newConfig = mergeWith(cloneDeep$1(node), newConfig, editorNodeMergeCustomizer);
|
|
478
478
|
if (!newConfig.type) throw new Error("配置缺少type值");
|
|
479
479
|
if (newConfig.type === NodeType.ROOT) {
|
|
480
480
|
this.set("root", newConfig, { historySource });
|
|
@@ -489,9 +489,11 @@ var Editor = class extends BaseService {
|
|
|
489
489
|
const parentNodeItems = parent.items;
|
|
490
490
|
const index = getNodeIndex(newConfig.id, parent);
|
|
491
491
|
if (!parentNodeItems || typeof index === "undefined" || index === -1) throw new Error("更新的节点未找到");
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
492
|
+
if (!replace) {
|
|
493
|
+
const newLayout = await this.getLayout(newConfig);
|
|
494
|
+
const layout = await this.getLayout(node);
|
|
495
|
+
if (Array.isArray(newConfig.items) && newLayout !== layout) newConfig = setChildrenLayout(newConfig, newLayout);
|
|
496
|
+
}
|
|
495
497
|
parentNodeItems[index] = newConfig;
|
|
496
498
|
const selectedNodes = this.get("nodes");
|
|
497
499
|
const targetIndex = selectedNodes.findIndex((nodeItem) => `${nodeItem.id}` === `${newConfig.id}`);
|
|
@@ -519,17 +521,19 @@ var Editor = class extends BaseService {
|
|
|
519
521
|
* @param data.changeRecordList 多节点 form 端变更记录列表,按 config 数组同序对应每个节点;优先级高于 changeRecords
|
|
520
522
|
* @param data.doNotPushHistory 是否不写入历史记录(默认 false)
|
|
521
523
|
* @param data.historyDescription 入栈时附带的人类可读描述,用于历史面板展示(不影响 undo/redo 行为)
|
|
524
|
+
* @param data.replace 是否整节点替换:为 true 时跳过 mergeWith / toggleFixedPosition / setChildrenLayout,直接用传入配置覆盖(默认 false)
|
|
522
525
|
* @returns 更新后的节点配置
|
|
523
526
|
*/
|
|
524
527
|
async update(config, data = {}) {
|
|
525
528
|
this.captureSelectionBeforeOp();
|
|
526
|
-
const { doNotPushHistory = false, changeRecordList, changeRecords, historyDescription, historySource, invalidInfo } = data;
|
|
529
|
+
const { doNotPushHistory = false, changeRecordList, changeRecords, historyDescription, historySource, replace = false, invalidInfo } = data;
|
|
527
530
|
const nodes = Array.isArray(config) ? config : [config];
|
|
528
531
|
const updateData = await Promise.all(nodes.map((node, index) => {
|
|
529
532
|
const recordsForNode = changeRecordList ? changeRecordList[index] ?? [] : changeRecords ?? [];
|
|
530
533
|
return this.doUpdate(node, {
|
|
531
534
|
changeRecords: recordsForNode,
|
|
532
|
-
historySource
|
|
535
|
+
historySource,
|
|
536
|
+
replace
|
|
533
537
|
});
|
|
534
538
|
}));
|
|
535
539
|
this.applyInvalidInfo(config, invalidInfo);
|
|
@@ -268,15 +268,22 @@ var isDataSourceFieldPathValue = (value, config) => {
|
|
|
268
268
|
if (config.value === "key") return true;
|
|
269
269
|
return `${value[0]}`.startsWith(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);
|
|
270
270
|
};
|
|
271
|
-
|
|
271
|
+
/**
|
|
272
|
+
* data-source-field-select 的 typeMatch 校验逻辑,可供自定义 rules.validator 复用。
|
|
273
|
+
*/
|
|
274
|
+
var validateDataSourceFieldSelectValue = (value, context, options) => {
|
|
275
|
+
const { mForm, message, props } = context;
|
|
272
276
|
const config = props.config || {};
|
|
273
|
-
if (
|
|
274
|
-
|
|
275
|
-
config
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
if (!isDataSourceFieldPathValue(value, config)) {
|
|
278
|
+
if (options?.validatePlainValue) return options.validatePlainValue(value, context);
|
|
279
|
+
if (config.fieldConfig) return validateTypeMatch(value, mForm, {
|
|
280
|
+
...props,
|
|
281
|
+
config: {
|
|
282
|
+
name: config.name,
|
|
283
|
+
...config.fieldConfig
|
|
284
|
+
}
|
|
285
|
+
}, message);
|
|
286
|
+
}
|
|
280
287
|
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) return defaultMessage(message, `${value}类型应为字符串数组`, dataSourceFieldPathSuggestion());
|
|
281
288
|
return validateDataSourceFieldPath(value, {
|
|
282
289
|
dataSourceId: config.dataSourceId,
|
|
@@ -285,6 +292,7 @@ var validateDataSourceFieldSelect = (value, { mForm, message, props }) => {
|
|
|
285
292
|
message
|
|
286
293
|
});
|
|
287
294
|
};
|
|
295
|
+
var validateDataSourceFieldSelect = (value, context) => validateDataSourceFieldSelectValue(value, context);
|
|
288
296
|
var validateDataSourceSelect = (value, { message, props }) => {
|
|
289
297
|
const config = props.config || {};
|
|
290
298
|
const dataSources = getDataSources();
|
|
@@ -364,4 +372,4 @@ var editorTypeMatchRules = {
|
|
|
364
372
|
"display-conds": validateDisplayConds
|
|
365
373
|
};
|
|
366
374
|
//#endregion
|
|
367
|
-
export { ALL_COND_OPS, editorTypeMatchRules };
|
|
375
|
+
export { ALL_COND_OPS, editorTypeMatchRules, validateDataSourceFieldSelectValue };
|
|
@@ -7818,14 +7818,14 @@
|
|
|
7818
7818
|
remove: removedPages
|
|
7819
7819
|
});
|
|
7820
7820
|
}
|
|
7821
|
-
async doUpdate(config, { changeRecords = [], historySource } = {}) {
|
|
7821
|
+
async doUpdate(config, { changeRecords = [], historySource, replace = false } = {}) {
|
|
7822
7822
|
if (!this.get("root")) throw new Error("root为空");
|
|
7823
7823
|
if (!config?.id) throw new Error("没有配置或者配置缺少id值");
|
|
7824
7824
|
const info = this.getNodeInfo(config.id, false);
|
|
7825
7825
|
if (!info.node) throw new Error(`获取不到id为${config.id}的节点`);
|
|
7826
7826
|
const node = (0, vue.toRaw)(info.node);
|
|
7827
|
-
let newConfig = await toggleFixedPosition((0, vue.toRaw)(config), node, info.path, this.getLayout);
|
|
7828
|
-
newConfig = mergeWith(cloneDeep$1(node), newConfig, editorNodeMergeCustomizer);
|
|
7827
|
+
let newConfig = replace ? cloneDeep$1((0, vue.toRaw)(config)) : await toggleFixedPosition((0, vue.toRaw)(config), node, info.path, this.getLayout);
|
|
7828
|
+
if (!replace) newConfig = mergeWith(cloneDeep$1(node), newConfig, editorNodeMergeCustomizer);
|
|
7829
7829
|
if (!newConfig.type) throw new Error("配置缺少type值");
|
|
7830
7830
|
if (newConfig.type === _tmagic_core.NodeType.ROOT) {
|
|
7831
7831
|
this.set("root", newConfig, { historySource });
|
|
@@ -7840,9 +7840,11 @@
|
|
|
7840
7840
|
const parentNodeItems = parent.items;
|
|
7841
7841
|
const index = getNodeIndex(newConfig.id, parent);
|
|
7842
7842
|
if (!parentNodeItems || typeof index === "undefined" || index === -1) throw new Error("更新的节点未找到");
|
|
7843
|
-
|
|
7844
|
-
|
|
7845
|
-
|
|
7843
|
+
if (!replace) {
|
|
7844
|
+
const newLayout = await this.getLayout(newConfig);
|
|
7845
|
+
const layout = await this.getLayout(node);
|
|
7846
|
+
if (Array.isArray(newConfig.items) && newLayout !== layout) newConfig = setChildrenLayout(newConfig, newLayout);
|
|
7847
|
+
}
|
|
7846
7848
|
parentNodeItems[index] = newConfig;
|
|
7847
7849
|
const selectedNodes = this.get("nodes");
|
|
7848
7850
|
const targetIndex = selectedNodes.findIndex((nodeItem) => `${nodeItem.id}` === `${newConfig.id}`);
|
|
@@ -7870,17 +7872,19 @@
|
|
|
7870
7872
|
* @param data.changeRecordList 多节点 form 端变更记录列表,按 config 数组同序对应每个节点;优先级高于 changeRecords
|
|
7871
7873
|
* @param data.doNotPushHistory 是否不写入历史记录(默认 false)
|
|
7872
7874
|
* @param data.historyDescription 入栈时附带的人类可读描述,用于历史面板展示(不影响 undo/redo 行为)
|
|
7875
|
+
* @param data.replace 是否整节点替换:为 true 时跳过 mergeWith / toggleFixedPosition / setChildrenLayout,直接用传入配置覆盖(默认 false)
|
|
7873
7876
|
* @returns 更新后的节点配置
|
|
7874
7877
|
*/
|
|
7875
7878
|
async update(config, data = {}) {
|
|
7876
7879
|
this.captureSelectionBeforeOp();
|
|
7877
|
-
const { doNotPushHistory = false, changeRecordList, changeRecords, historyDescription, historySource, invalidInfo } = data;
|
|
7880
|
+
const { doNotPushHistory = false, changeRecordList, changeRecords, historyDescription, historySource, replace = false, invalidInfo } = data;
|
|
7878
7881
|
const nodes = Array.isArray(config) ? config : [config];
|
|
7879
7882
|
const updateData = await Promise.all(nodes.map((node, index) => {
|
|
7880
7883
|
const recordsForNode = changeRecordList ? changeRecordList[index] ?? [] : changeRecords ?? [];
|
|
7881
7884
|
return this.doUpdate(node, {
|
|
7882
7885
|
changeRecords: recordsForNode,
|
|
7883
|
-
historySource
|
|
7886
|
+
historySource,
|
|
7887
|
+
replace
|
|
7884
7888
|
});
|
|
7885
7889
|
}));
|
|
7886
7890
|
this.applyInvalidInfo(config, invalidInfo);
|
|
@@ -11089,15 +11093,22 @@
|
|
|
11089
11093
|
if (config.value === "key") return true;
|
|
11090
11094
|
return `${value[0]}`.startsWith(_tmagic_utils.DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);
|
|
11091
11095
|
};
|
|
11092
|
-
|
|
11096
|
+
/**
|
|
11097
|
+
* data-source-field-select 的 typeMatch 校验逻辑,可供自定义 rules.validator 复用。
|
|
11098
|
+
*/
|
|
11099
|
+
var validateDataSourceFieldSelectValue = (value, context, options) => {
|
|
11100
|
+
const { mForm, message, props } = context;
|
|
11093
11101
|
const config = props.config || {};
|
|
11094
|
-
if (
|
|
11095
|
-
|
|
11096
|
-
config
|
|
11097
|
-
|
|
11098
|
-
|
|
11099
|
-
|
|
11100
|
-
|
|
11102
|
+
if (!isDataSourceFieldPathValue(value, config)) {
|
|
11103
|
+
if (options?.validatePlainValue) return options.validatePlainValue(value, context);
|
|
11104
|
+
if (config.fieldConfig) return (0, _tmagic_form.validateTypeMatch)(value, mForm, {
|
|
11105
|
+
...props,
|
|
11106
|
+
config: {
|
|
11107
|
+
name: config.name,
|
|
11108
|
+
...config.fieldConfig
|
|
11109
|
+
}
|
|
11110
|
+
}, message);
|
|
11111
|
+
}
|
|
11101
11112
|
if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) return defaultMessage(message, `${value}类型应为字符串数组`, dataSourceFieldPathSuggestion());
|
|
11102
11113
|
return validateDataSourceFieldPath(value, {
|
|
11103
11114
|
dataSourceId: config.dataSourceId,
|
|
@@ -11106,6 +11117,7 @@
|
|
|
11106
11117
|
message
|
|
11107
11118
|
});
|
|
11108
11119
|
};
|
|
11120
|
+
var validateDataSourceFieldSelect = (value, context) => validateDataSourceFieldSelectValue(value, context);
|
|
11109
11121
|
var validateDataSourceSelect = (value, { message, props }) => {
|
|
11110
11122
|
const config = props.config || {};
|
|
11111
11123
|
const dataSources = getDataSources();
|
|
@@ -15148,22 +15160,33 @@
|
|
|
15148
15160
|
const submit = async (v, eventData, error, source = "props") => {
|
|
15149
15161
|
try {
|
|
15150
15162
|
if (!v.id) v.id = values.value.id;
|
|
15151
|
-
const newValue = {
|
|
15152
|
-
...v,
|
|
15153
|
-
style: {}
|
|
15154
|
-
};
|
|
15155
|
-
if (v.style) if (eventData) {
|
|
15156
|
-
Object.entries(v.style).forEach(([key, value]) => {
|
|
15157
|
-
if (value !== "" && newValue.style) newValue.style[key] = value;
|
|
15158
|
-
});
|
|
15159
|
-
eventData.changeRecords?.forEach((record) => {
|
|
15160
|
-
if (record.propPath?.startsWith("style") && record.value === "") (0, _tmagic_utils.setValueByKeyPath)(record.propPath, record.value, newValue);
|
|
15161
|
-
});
|
|
15162
|
-
} else newValue.style = { ...v.style };
|
|
15163
15163
|
const historySource = eventData ? "props" : "code";
|
|
15164
|
+
const replace = historySource === "code";
|
|
15165
|
+
let newValue;
|
|
15166
|
+
if (replace) if (source === "style") newValue = {
|
|
15167
|
+
...values.value,
|
|
15168
|
+
id: v.id || values.value.id,
|
|
15169
|
+
style: { ...v.style || {} }
|
|
15170
|
+
};
|
|
15171
|
+
else newValue = { ...v };
|
|
15172
|
+
else {
|
|
15173
|
+
newValue = {
|
|
15174
|
+
...v,
|
|
15175
|
+
style: {}
|
|
15176
|
+
};
|
|
15177
|
+
if (v.style) {
|
|
15178
|
+
Object.entries(v.style).forEach(([key, value]) => {
|
|
15179
|
+
if (value !== "" && newValue.style) newValue.style[key] = value;
|
|
15180
|
+
});
|
|
15181
|
+
eventData?.changeRecords?.forEach((record) => {
|
|
15182
|
+
if (record.propPath?.startsWith("style") && record.value === "") (0, _tmagic_utils.setValueByKeyPath)(record.propPath, record.value, newValue);
|
|
15183
|
+
});
|
|
15184
|
+
}
|
|
15185
|
+
}
|
|
15164
15186
|
editorService.update(newValue, {
|
|
15165
15187
|
changeRecords: eventData?.changeRecords,
|
|
15166
15188
|
historySource,
|
|
15189
|
+
replace,
|
|
15167
15190
|
...enablePropsFormValidate && error ? { invalidInfo: {
|
|
15168
15191
|
id: newValue.id,
|
|
15169
15192
|
source,
|
|
@@ -17806,7 +17829,7 @@
|
|
|
17806
17829
|
let name = "";
|
|
17807
17830
|
if (data.name) name = data.name;
|
|
17808
17831
|
else if (data.items) name = "container";
|
|
17809
|
-
return `${data.id}${name}${data.type}`.includes(v);
|
|
17832
|
+
return `${data.id}${name}${data.type || ""}`.toLocaleLowerCase().includes(v.toLocaleLowerCase());
|
|
17810
17833
|
};
|
|
17811
17834
|
const { filterTextChangeHandler } = useFilter(nodeData, nodeStatusMap, filterNodeMethod);
|
|
17812
17835
|
const collapseAllHandler = () => {
|
|
@@ -17901,7 +17924,7 @@
|
|
|
17901
17924
|
const stage = (0, vue.computed)(() => editorService.get("stage"));
|
|
17902
17925
|
const list = (0, vue.computed)(() => componentListService.getList().map((group) => ({
|
|
17903
17926
|
...group,
|
|
17904
|
-
items: group.items.filter((item) => item.text.includes(searchText.value))
|
|
17927
|
+
items: group.items.filter((item) => `${item.text || ""}${item.desc || ""}${item.type}`.toLocaleLowerCase().includes(searchText.value.toLocaleLowerCase()))
|
|
17905
17928
|
})));
|
|
17906
17929
|
const collapseValue = (0, vue.ref)();
|
|
17907
17930
|
(0, vue.watch)(list, () => {
|
|
@@ -24054,7 +24077,11 @@
|
|
|
24054
24077
|
text: "背景色",
|
|
24055
24078
|
labelWidth: "68px",
|
|
24056
24079
|
type: "data-source-field-select",
|
|
24057
|
-
fieldConfig: { type: "colorPicker" }
|
|
24080
|
+
fieldConfig: { type: "colorPicker" },
|
|
24081
|
+
rules: [{
|
|
24082
|
+
typeMatch: true,
|
|
24083
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("背景色应为字符串", "请参考以下示例值:\"#000000\"")
|
|
24084
|
+
}]
|
|
24058
24085
|
},
|
|
24059
24086
|
{
|
|
24060
24087
|
name: "backgroundImage",
|
|
@@ -24232,7 +24259,11 @@
|
|
|
24232
24259
|
name: "fontSize",
|
|
24233
24260
|
text: "字号",
|
|
24234
24261
|
type: "data-source-field-select",
|
|
24235
|
-
fieldConfig: { type: "text" }
|
|
24262
|
+
fieldConfig: { type: "text" },
|
|
24263
|
+
rules: [{
|
|
24264
|
+
typeMatch: true,
|
|
24265
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("字号应为字符串或数字", "请参考以下示例值:24 或 \"24\"")
|
|
24266
|
+
}]
|
|
24236
24267
|
}, {
|
|
24237
24268
|
labelWidth: "68px",
|
|
24238
24269
|
name: "lineHeight",
|
|
@@ -24246,20 +24277,46 @@
|
|
|
24246
24277
|
text: "字重",
|
|
24247
24278
|
labelWidth: "68px",
|
|
24248
24279
|
type: "data-source-field-select",
|
|
24280
|
+
dataSourceFieldType: ["string", "number"],
|
|
24249
24281
|
fieldConfig: {
|
|
24250
24282
|
type: "select",
|
|
24283
|
+
allowCreate: true,
|
|
24251
24284
|
options: ["normal", "bold"].concat(Array(7).fill(1).map((x, i) => `${i + 1}00`)).map((item) => ({
|
|
24252
24285
|
value: item,
|
|
24253
24286
|
text: item
|
|
24254
24287
|
}))
|
|
24255
|
-
}
|
|
24288
|
+
},
|
|
24289
|
+
rules: [{ typeMatch: false }, { validator: ({ value, callback }, { config, model, prop }, mForm) => {
|
|
24290
|
+
if (value === "" || value === null || value === void 0) return callback();
|
|
24291
|
+
const result = validateDataSourceFieldSelectValue(value, {
|
|
24292
|
+
fieldType: "data-source-field-select",
|
|
24293
|
+
mForm,
|
|
24294
|
+
props: {
|
|
24295
|
+
config,
|
|
24296
|
+
model,
|
|
24297
|
+
prop
|
|
24298
|
+
}
|
|
24299
|
+
}, { validatePlainValue: (plainValue) => {
|
|
24300
|
+
if (typeof plainValue === "string" || typeof plainValue === "number" && !Number.isNaN(plainValue)) return;
|
|
24301
|
+
return "字重应为字符串或数字";
|
|
24302
|
+
} });
|
|
24303
|
+
if (result && typeof result.then === "function") {
|
|
24304
|
+
result.then((error) => callback(error), (error) => callback(error));
|
|
24305
|
+
return;
|
|
24306
|
+
}
|
|
24307
|
+
return callback(result);
|
|
24308
|
+
} }]
|
|
24256
24309
|
},
|
|
24257
24310
|
{
|
|
24258
24311
|
labelWidth: "68px",
|
|
24259
24312
|
name: "color",
|
|
24260
24313
|
text: "颜色",
|
|
24261
24314
|
type: "data-source-field-select",
|
|
24262
|
-
fieldConfig: { type: "colorPicker" }
|
|
24315
|
+
fieldConfig: { type: "colorPicker" },
|
|
24316
|
+
rules: [{
|
|
24317
|
+
typeMatch: true,
|
|
24318
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("颜色应为字符串", "请参考以下示例值:\"#000000\"")
|
|
24319
|
+
}]
|
|
24263
24320
|
},
|
|
24264
24321
|
{
|
|
24265
24322
|
name: "textAlign",
|
|
@@ -24331,7 +24388,7 @@
|
|
|
24331
24388
|
};
|
|
24332
24389
|
var _hoisted_3$1 = { class: "next-input" };
|
|
24333
24390
|
var _hoisted_4$1 = [
|
|
24334
|
-
"
|
|
24391
|
+
"value",
|
|
24335
24392
|
"title",
|
|
24336
24393
|
"disabled",
|
|
24337
24394
|
"onChange"
|
|
@@ -24393,7 +24450,7 @@
|
|
|
24393
24450
|
key: index,
|
|
24394
24451
|
class: (0, vue.normalizeClass)(item.class)
|
|
24395
24452
|
}, [item.text ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_2$1, (0, vue.toDisplayString)(item.text), 1)) : (0, vue.createCommentVNode)("v-if", true), (0, vue.createElementVNode)("span", _hoisted_3$1, [(0, vue.createElementVNode)("input", {
|
|
24396
|
-
|
|
24453
|
+
value: __props.model[item.name],
|
|
24397
24454
|
placeholder: "0",
|
|
24398
24455
|
title: __props.model[item.name],
|
|
24399
24456
|
disabled: __props.disabled,
|
|
@@ -25232,12 +25289,20 @@
|
|
|
25232
25289
|
name: "left",
|
|
25233
25290
|
type: "data-source-field-select",
|
|
25234
25291
|
text: "left",
|
|
25235
|
-
fieldConfig: { type: "text" }
|
|
25292
|
+
fieldConfig: { type: "text" },
|
|
25293
|
+
rules: [{
|
|
25294
|
+
typeMatch: true,
|
|
25295
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("left 应为字符串", "请参考以下示例值:\"10\"")
|
|
25296
|
+
}]
|
|
25236
25297
|
}, {
|
|
25237
25298
|
name: "top",
|
|
25238
25299
|
type: "data-source-field-select",
|
|
25239
25300
|
text: "top",
|
|
25240
|
-
fieldConfig: { type: "text" }
|
|
25301
|
+
fieldConfig: { type: "text" },
|
|
25302
|
+
rules: [{
|
|
25303
|
+
typeMatch: true,
|
|
25304
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("top 应为字符串", "请参考以下示例值:\"10\"")
|
|
25305
|
+
}]
|
|
25241
25306
|
}]
|
|
25242
25307
|
},
|
|
25243
25308
|
{
|
|
@@ -25248,12 +25313,20 @@
|
|
|
25248
25313
|
name: "right",
|
|
25249
25314
|
type: "data-source-field-select",
|
|
25250
25315
|
text: "right",
|
|
25251
|
-
fieldConfig: { type: "text" }
|
|
25316
|
+
fieldConfig: { type: "text" },
|
|
25317
|
+
rules: [{
|
|
25318
|
+
typeMatch: true,
|
|
25319
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("right 应为字符串", "请参考以下示例值:\"10\"")
|
|
25320
|
+
}]
|
|
25252
25321
|
}, {
|
|
25253
25322
|
name: "bottom",
|
|
25254
25323
|
type: "data-source-field-select",
|
|
25255
25324
|
text: "bottom",
|
|
25256
|
-
fieldConfig: { type: "text" }
|
|
25325
|
+
fieldConfig: { type: "text" },
|
|
25326
|
+
rules: [{
|
|
25327
|
+
typeMatch: true,
|
|
25328
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("bottom 应为字符串", "请参考以下示例值:\"10\"")
|
|
25329
|
+
}]
|
|
25257
25330
|
}]
|
|
25258
25331
|
},
|
|
25259
25332
|
{
|
|
@@ -25261,7 +25334,11 @@
|
|
|
25261
25334
|
name: "zIndex",
|
|
25262
25335
|
text: "zIndex",
|
|
25263
25336
|
type: "data-source-field-select",
|
|
25264
|
-
fieldConfig: { type: "text" }
|
|
25337
|
+
fieldConfig: { type: "text" },
|
|
25338
|
+
rules: [{
|
|
25339
|
+
typeMatch: true,
|
|
25340
|
+
message: (0, _tmagic_design.appendValidateSuggestion)("zIndex 应为数字", "请参考以下示例值:10")
|
|
25341
|
+
}]
|
|
25265
25342
|
}
|
|
25266
25343
|
]);
|
|
25267
25344
|
const change = (value, eventData) => {
|
|
@@ -26226,6 +26303,7 @@
|
|
|
26226
26303
|
exports.useServices = useServices;
|
|
26227
26304
|
exports.useStage = useStage;
|
|
26228
26305
|
exports.useWindowRect = useWindowRect;
|
|
26306
|
+
exports.validateDataSourceFieldSelectValue = validateDataSourceFieldSelectValue;
|
|
26229
26307
|
exports.warn = warn;
|
|
26230
26308
|
Object.keys(_tmagic_form).forEach(function(k) {
|
|
26231
26309
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.0-beta.
|
|
2
|
+
"version": "1.8.0-beta.22",
|
|
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.8.0-beta.
|
|
62
|
-
"@tmagic/form": "1.8.0-beta.
|
|
63
|
-
"@tmagic/
|
|
64
|
-
"@tmagic/table": "1.8.0-beta.
|
|
65
|
-
"@tmagic/
|
|
61
|
+
"@tmagic/design": "1.8.0-beta.22",
|
|
62
|
+
"@tmagic/form": "1.8.0-beta.22",
|
|
63
|
+
"@tmagic/utils": "1.8.0-beta.22",
|
|
64
|
+
"@tmagic/table": "1.8.0-beta.22",
|
|
65
|
+
"@tmagic/stage": "1.8.0-beta.22"
|
|
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": "^6.0.3",
|
|
78
78
|
"vue": "^3.5.40",
|
|
79
|
-
"@tmagic/core": "1.8.0-beta.
|
|
79
|
+
"@tmagic/core": "1.8.0-beta.22"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"typescript": {
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
<script lang="ts" setup>
|
|
18
18
|
import { markRaw } from 'vue';
|
|
19
19
|
|
|
20
|
+
import { appendValidateSuggestion } from '@tmagic/design';
|
|
20
21
|
import { type ContainerChangeEventData, defineFormConfig, MContainer } from '@tmagic/form';
|
|
21
22
|
import type { StyleSchema } from '@tmagic/schema';
|
|
22
23
|
|
|
@@ -47,6 +48,12 @@ const formConfig = defineFormConfig([
|
|
|
47
48
|
fieldConfig: {
|
|
48
49
|
type: 'colorPicker',
|
|
49
50
|
},
|
|
51
|
+
rules: [
|
|
52
|
+
{
|
|
53
|
+
typeMatch: true,
|
|
54
|
+
message: appendValidateSuggestion('背景色应为字符串', '请参考以下示例值:"#000000"'),
|
|
55
|
+
},
|
|
56
|
+
],
|
|
50
57
|
},
|
|
51
58
|
{
|
|
52
59
|
name: 'backgroundImage',
|
|
@@ -17,9 +17,12 @@
|
|
|
17
17
|
<script lang="ts" setup>
|
|
18
18
|
import { markRaw } from 'vue';
|
|
19
19
|
|
|
20
|
+
import { appendValidateSuggestion } from '@tmagic/design';
|
|
20
21
|
import { type ContainerChangeEventData, defineFormConfig, MContainer } from '@tmagic/form';
|
|
21
22
|
import type { StyleSchema } from '@tmagic/schema';
|
|
22
23
|
|
|
24
|
+
import { validateDataSourceFieldSelectValue } from '@editor/utils/type-match-rules';
|
|
25
|
+
|
|
23
26
|
import { AlignCenter, AlignLeft, AlignRight } from '../icons/text-align';
|
|
24
27
|
|
|
25
28
|
defineProps<{
|
|
@@ -48,6 +51,12 @@ const formConfig = defineFormConfig([
|
|
|
48
51
|
fieldConfig: {
|
|
49
52
|
type: 'text',
|
|
50
53
|
},
|
|
54
|
+
rules: [
|
|
55
|
+
{
|
|
56
|
+
typeMatch: true,
|
|
57
|
+
message: appendValidateSuggestion('字号应为字符串或数字', '请参考以下示例值:24 或 "24"'),
|
|
58
|
+
},
|
|
59
|
+
],
|
|
51
60
|
},
|
|
52
61
|
{
|
|
53
62
|
labelWidth: '68px',
|
|
@@ -65,8 +74,10 @@ const formConfig = defineFormConfig([
|
|
|
65
74
|
text: '字重',
|
|
66
75
|
labelWidth: '68px',
|
|
67
76
|
type: 'data-source-field-select',
|
|
77
|
+
dataSourceFieldType: ['string', 'number'],
|
|
68
78
|
fieldConfig: {
|
|
69
79
|
type: 'select',
|
|
80
|
+
allowCreate: true,
|
|
70
81
|
options: ['normal', 'bold']
|
|
71
82
|
.concat(
|
|
72
83
|
Array(7)
|
|
@@ -78,6 +89,46 @@ const formConfig = defineFormConfig([
|
|
|
78
89
|
text: item,
|
|
79
90
|
})),
|
|
80
91
|
},
|
|
92
|
+
rules: [
|
|
93
|
+
{
|
|
94
|
+
typeMatch: false,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
validator: ({ value, callback }, { config, model, prop }, mForm) => {
|
|
98
|
+
if (value === '' || value === null || value === undefined) {
|
|
99
|
+
return callback();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const result = validateDataSourceFieldSelectValue(
|
|
103
|
+
value,
|
|
104
|
+
{
|
|
105
|
+
fieldType: 'data-source-field-select',
|
|
106
|
+
mForm,
|
|
107
|
+
props: { config, model, prop },
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
// 字重允许 string(含可创建项)与 number(如 700)
|
|
111
|
+
validatePlainValue: (plainValue) => {
|
|
112
|
+
if (typeof plainValue === 'string' || (typeof plainValue === 'number' && !Number.isNaN(plainValue))) {
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
return '字重应为字符串或数字';
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
if (result && typeof (result as Promise<string | undefined>).then === 'function') {
|
|
121
|
+
(result as Promise<string | undefined>).then(
|
|
122
|
+
(error) => callback(error),
|
|
123
|
+
(error) => callback(error),
|
|
124
|
+
);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return callback(result);
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
],
|
|
81
132
|
},
|
|
82
133
|
{
|
|
83
134
|
labelWidth: '68px',
|
|
@@ -87,6 +138,12 @@ const formConfig = defineFormConfig([
|
|
|
87
138
|
fieldConfig: {
|
|
88
139
|
type: 'colorPicker',
|
|
89
140
|
},
|
|
141
|
+
rules: [
|
|
142
|
+
{
|
|
143
|
+
typeMatch: true,
|
|
144
|
+
message: appendValidateSuggestion('颜色应为字符串', '请参考以下示例值:"#000000"'),
|
|
145
|
+
},
|
|
146
|
+
],
|
|
90
147
|
},
|
|
91
148
|
{
|
|
92
149
|
name: 'textAlign',
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
|
|
17
17
|
<script lang="ts" setup>
|
|
18
|
+
import { appendValidateSuggestion } from '@tmagic/design';
|
|
18
19
|
import { type ContainerChangeEventData, defineFormConfig, MContainer } from '@tmagic/form';
|
|
19
20
|
import type { StyleSchema } from '@tmagic/schema';
|
|
20
21
|
|
|
@@ -66,6 +67,12 @@ const formConfig = defineFormConfig([
|
|
|
66
67
|
fieldConfig: {
|
|
67
68
|
type: 'text',
|
|
68
69
|
},
|
|
70
|
+
rules: [
|
|
71
|
+
{
|
|
72
|
+
typeMatch: true,
|
|
73
|
+
message: appendValidateSuggestion('left 应为字符串', '请参考以下示例值:"10"'),
|
|
74
|
+
},
|
|
75
|
+
],
|
|
69
76
|
},
|
|
70
77
|
{
|
|
71
78
|
name: 'top',
|
|
@@ -74,6 +81,12 @@ const formConfig = defineFormConfig([
|
|
|
74
81
|
fieldConfig: {
|
|
75
82
|
type: 'text',
|
|
76
83
|
},
|
|
84
|
+
rules: [
|
|
85
|
+
{
|
|
86
|
+
typeMatch: true,
|
|
87
|
+
message: appendValidateSuggestion('top 应为字符串', '请参考以下示例值:"10"'),
|
|
88
|
+
},
|
|
89
|
+
],
|
|
77
90
|
},
|
|
78
91
|
],
|
|
79
92
|
},
|
|
@@ -89,6 +102,12 @@ const formConfig = defineFormConfig([
|
|
|
89
102
|
fieldConfig: {
|
|
90
103
|
type: 'text',
|
|
91
104
|
},
|
|
105
|
+
rules: [
|
|
106
|
+
{
|
|
107
|
+
typeMatch: true,
|
|
108
|
+
message: appendValidateSuggestion('right 应为字符串', '请参考以下示例值:"10"'),
|
|
109
|
+
},
|
|
110
|
+
],
|
|
92
111
|
},
|
|
93
112
|
{
|
|
94
113
|
name: 'bottom',
|
|
@@ -97,6 +116,12 @@ const formConfig = defineFormConfig([
|
|
|
97
116
|
fieldConfig: {
|
|
98
117
|
type: 'text',
|
|
99
118
|
},
|
|
119
|
+
rules: [
|
|
120
|
+
{
|
|
121
|
+
typeMatch: true,
|
|
122
|
+
message: appendValidateSuggestion('bottom 应为字符串', '请参考以下示例值:"10"'),
|
|
123
|
+
},
|
|
124
|
+
],
|
|
100
125
|
},
|
|
101
126
|
],
|
|
102
127
|
},
|
|
@@ -108,6 +133,12 @@ const formConfig = defineFormConfig([
|
|
|
108
133
|
fieldConfig: {
|
|
109
134
|
type: 'text',
|
|
110
135
|
},
|
|
136
|
+
rules: [
|
|
137
|
+
{
|
|
138
|
+
typeMatch: true,
|
|
139
|
+
message: appendValidateSuggestion('zIndex 应为数字', '请参考以下示例值:10'),
|
|
140
|
+
},
|
|
141
|
+
],
|
|
111
142
|
},
|
|
112
143
|
]);
|
|
113
144
|
|
|
@@ -158,14 +158,34 @@ const submit = async (
|
|
|
158
158
|
v.id = values.value.id;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
161
|
+
// 区分操作途径:表单字段编辑(MForm @change)会带上 eventData(含 changeRecords);
|
|
162
|
+
// 源码编辑器(CodeEditor @save → saveCode)保存时不带 eventData,据此标记为「源码编辑器」。
|
|
163
|
+
const historySource = eventData ? 'props' : 'code';
|
|
164
|
+
// 源码编辑统一走整节点 replace,避免 merge 保留已删除字段。
|
|
165
|
+
const replace = historySource === 'code';
|
|
166
|
+
|
|
167
|
+
let newValue: MNode;
|
|
168
|
+
|
|
169
|
+
if (replace) {
|
|
170
|
+
if (source === 'style') {
|
|
171
|
+
// 样式面板源码仅提交 { style }:先把新 style 替换到原节点上,再整节点覆盖。
|
|
172
|
+
newValue = {
|
|
173
|
+
...values.value,
|
|
174
|
+
id: v.id || values.value.id,
|
|
175
|
+
style: { ...(v.style || {}) },
|
|
176
|
+
};
|
|
177
|
+
} else {
|
|
178
|
+
// 属性面板源码提交完整节点 DSL
|
|
179
|
+
newValue = { ...v };
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
newValue = {
|
|
183
|
+
...v,
|
|
184
|
+
style: {},
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
if (v.style) {
|
|
188
|
+
// 空字符串样式值表示「清除该样式」,需保留才能在 doUpdate 的 mergeWith 中覆盖旧值。
|
|
169
189
|
// 表单编辑:先过滤掉空字符串(避免表单默认空值污染 DSL),
|
|
170
190
|
// 再按 changeRecords 恢复被主动清空的字段。
|
|
171
191
|
Object.entries(v.style).forEach(([key, value]) => {
|
|
@@ -174,24 +194,18 @@ const submit = async (
|
|
|
174
194
|
}
|
|
175
195
|
});
|
|
176
196
|
|
|
177
|
-
eventData
|
|
197
|
+
eventData?.changeRecords?.forEach((record) => {
|
|
178
198
|
if (record.propPath?.startsWith('style') && record.value === '') {
|
|
179
199
|
setValueByKeyPath(record.propPath, record.value, newValue);
|
|
180
200
|
}
|
|
181
201
|
});
|
|
182
|
-
} else {
|
|
183
|
-
// 源码编辑器保存(无 eventData):style 原样保留,其中的空字符串视为用户主动清除该样式。
|
|
184
|
-
newValue.style = { ...v.style };
|
|
185
202
|
}
|
|
186
203
|
}
|
|
187
204
|
|
|
188
|
-
// 区分操作途径:表单字段编辑(MForm @change)会带上 eventData(含 changeRecords);
|
|
189
|
-
// 源码编辑器(CodeEditor @save → saveCode)保存时不带 eventData,据此标记为「源码编辑器」。
|
|
190
|
-
const historySource = eventData ? 'props' : 'code';
|
|
191
|
-
|
|
192
205
|
editorService.update(newValue, {
|
|
193
206
|
changeRecords: eventData?.changeRecords,
|
|
194
207
|
historySource,
|
|
208
|
+
replace,
|
|
195
209
|
// 启用校验联动时,仅校验失败(error 存在)才把错误信息随更新传入 editorService 记录;
|
|
196
210
|
// 其余情况(含表单校验成功、CodeEditor 源码保存)不携带 invalidInfo,由 editorService 在执行 update 时统一清除该节点错误。
|
|
197
211
|
...(enablePropsFormValidate && error ? { invalidInfo: { id: newValue.id, source, error: error?.message } } : {}),
|
|
@@ -71,7 +71,11 @@ const stage = computed(() => editorService.get('stage'));
|
|
|
71
71
|
const list = computed<ComponentGroup[]>(() =>
|
|
72
72
|
componentListService.getList().map((group: ComponentGroup) => ({
|
|
73
73
|
...group,
|
|
74
|
-
items: group.items.filter((item: ComponentItem) =>
|
|
74
|
+
items: group.items.filter((item: ComponentItem) =>
|
|
75
|
+
`${item.text || ''}${item.desc || ''}${item.type}`
|
|
76
|
+
.toLocaleLowerCase()
|
|
77
|
+
.includes(searchText.value.toLocaleLowerCase()),
|
|
78
|
+
),
|
|
75
79
|
})),
|
|
76
80
|
);
|
|
77
81
|
|
|
@@ -120,7 +120,7 @@ const filterNodeMethod = (v: string, data: MNode): boolean => {
|
|
|
120
120
|
name = 'container';
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
return `${data.id}${name}${data.type}`.includes(v);
|
|
123
|
+
return `${data.id}${name}${data.type || ''}`.toLocaleLowerCase().includes(v.toLocaleLowerCase());
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
const { filterTextChangeHandler } = useFilter(nodeData, nodeStatusMap, filterNodeMethod);
|
package/src/services/editor.ts
CHANGED
|
@@ -720,7 +720,11 @@ class Editor extends BaseService {
|
|
|
720
720
|
|
|
721
721
|
public async doUpdate(
|
|
722
722
|
config: MNode,
|
|
723
|
-
{
|
|
723
|
+
{
|
|
724
|
+
changeRecords = [],
|
|
725
|
+
historySource,
|
|
726
|
+
replace = false,
|
|
727
|
+
}: { changeRecords?: ChangeRecord[]; historySource?: HistoryOpSource; replace?: boolean } = {},
|
|
724
728
|
): Promise<{ newNode: MNode; oldNode: MNode; changeRecords?: ChangeRecord[] }> {
|
|
725
729
|
const root = this.get('root');
|
|
726
730
|
if (!root) throw new Error('root为空');
|
|
@@ -733,9 +737,14 @@ class Editor extends BaseService {
|
|
|
733
737
|
|
|
734
738
|
const node = toRaw(info.node);
|
|
735
739
|
|
|
736
|
-
|
|
740
|
+
// replace=true 时跳过 toggleFixedPosition / mergeWith / setChildrenLayout,直接用传入配置整节点替换
|
|
741
|
+
let newConfig = replace
|
|
742
|
+
? cloneDeep(toRaw(config))
|
|
743
|
+
: await toggleFixedPosition(toRaw(config), node, info.path, this.getLayout);
|
|
737
744
|
|
|
738
|
-
|
|
745
|
+
if (!replace) {
|
|
746
|
+
newConfig = mergeWith(cloneDeep(node), newConfig, editorNodeMergeCustomizer);
|
|
747
|
+
}
|
|
739
748
|
|
|
740
749
|
if (!newConfig.type) throw new Error('配置缺少type值');
|
|
741
750
|
|
|
@@ -756,10 +765,12 @@ class Editor extends BaseService {
|
|
|
756
765
|
|
|
757
766
|
if (!parentNodeItems || typeof index === 'undefined' || index === -1) throw new Error('更新的节点未找到');
|
|
758
767
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
768
|
+
if (!replace) {
|
|
769
|
+
const newLayout = await this.getLayout(newConfig);
|
|
770
|
+
const layout = await this.getLayout(node);
|
|
771
|
+
if (Array.isArray(newConfig.items) && newLayout !== layout) {
|
|
772
|
+
newConfig = setChildrenLayout(newConfig as MContainer, newLayout);
|
|
773
|
+
}
|
|
763
774
|
}
|
|
764
775
|
|
|
765
776
|
parentNodeItems[index] = newConfig;
|
|
@@ -798,6 +809,7 @@ class Editor extends BaseService {
|
|
|
798
809
|
* @param data.changeRecordList 多节点 form 端变更记录列表,按 config 数组同序对应每个节点;优先级高于 changeRecords
|
|
799
810
|
* @param data.doNotPushHistory 是否不写入历史记录(默认 false)
|
|
800
811
|
* @param data.historyDescription 入栈时附带的人类可读描述,用于历史面板展示(不影响 undo/redo 行为)
|
|
812
|
+
* @param data.replace 是否整节点替换:为 true 时跳过 mergeWith / toggleFixedPosition / setChildrenLayout,直接用传入配置覆盖(默认 false)
|
|
801
813
|
* @returns 更新后的节点配置
|
|
802
814
|
*/
|
|
803
815
|
public async update(
|
|
@@ -808,6 +820,11 @@ class Editor extends BaseService {
|
|
|
808
820
|
doNotPushHistory?: boolean;
|
|
809
821
|
historyDescription?: string;
|
|
810
822
|
historySource?: HistoryOpSource;
|
|
823
|
+
/**
|
|
824
|
+
* 为 true 时不做深合并等变换,直接用传入配置整节点替换现有节点。
|
|
825
|
+
* 适用于源码编辑、历史整节点快照回放等「完整 DSL」场景;默认 false(局部属性更新走 merge)。
|
|
826
|
+
*/
|
|
827
|
+
replace?: boolean;
|
|
811
828
|
/**
|
|
812
829
|
* 属性面板提交时携带的校验错误信息,在写入历史记录之前落库,
|
|
813
830
|
* 使历史快照与本次变更对齐,从而 undo/redo 能正确还原错误标记。
|
|
@@ -823,6 +840,7 @@ class Editor extends BaseService {
|
|
|
823
840
|
changeRecords,
|
|
824
841
|
historyDescription,
|
|
825
842
|
historySource,
|
|
843
|
+
replace = false,
|
|
826
844
|
invalidInfo,
|
|
827
845
|
} = data;
|
|
828
846
|
|
|
@@ -833,7 +851,7 @@ class Editor extends BaseService {
|
|
|
833
851
|
const updateData = await Promise.all(
|
|
834
852
|
nodes.map((node, index) => {
|
|
835
853
|
const recordsForNode = changeRecordList ? (changeRecordList[index] ?? []) : (changeRecords ?? []);
|
|
836
|
-
return this.doUpdate(node, { changeRecords: recordsForNode, historySource });
|
|
854
|
+
return this.doUpdate(node, { changeRecords: recordsForNode, historySource, replace });
|
|
837
855
|
}),
|
|
838
856
|
);
|
|
839
857
|
|
|
@@ -1348,6 +1366,7 @@ class Editor extends BaseService {
|
|
|
1348
1366
|
doNotPushHistory?: boolean;
|
|
1349
1367
|
historyDescription?: string;
|
|
1350
1368
|
historySource?: HistoryOpSource;
|
|
1369
|
+
replace?: boolean;
|
|
1351
1370
|
} = {},
|
|
1352
1371
|
): Promise<DslOpWithHistoryIdsResult<MNode | MNode[]>> {
|
|
1353
1372
|
this.lastPushedHistoryId = null;
|
|
@@ -476,12 +476,42 @@ const isDataSourceFieldPathValue = (value: any, config: any): value is string[]
|
|
|
476
476
|
return `${value[0]}`.startsWith(DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX);
|
|
477
477
|
};
|
|
478
478
|
|
|
479
|
-
|
|
479
|
+
export type ValidateDataSourceFieldSelectOptions = {
|
|
480
|
+
/**
|
|
481
|
+
* 覆盖「非数据源字段路径」时的校验。
|
|
482
|
+
* 不传则按 fieldConfig 走内置 typeMatch(与表单项自身 typeMatch 行为一致)。
|
|
483
|
+
*/
|
|
484
|
+
validatePlainValue?: (
|
|
485
|
+
value: any,
|
|
486
|
+
context: TypeMatchValidateContext,
|
|
487
|
+
) => string | undefined | Promise<string | undefined>;
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* data-source-field-select 的 typeMatch 校验逻辑,可供自定义 rules.validator 复用。
|
|
492
|
+
*/
|
|
493
|
+
export const validateDataSourceFieldSelectValue = (
|
|
494
|
+
value: any,
|
|
495
|
+
context: TypeMatchValidateContext,
|
|
496
|
+
options?: ValidateDataSourceFieldSelectOptions,
|
|
497
|
+
): string | undefined | Promise<string | undefined> => {
|
|
498
|
+
const { mForm, message, props } = context;
|
|
480
499
|
const config = props.config || {};
|
|
481
500
|
|
|
482
|
-
if (
|
|
483
|
-
|
|
484
|
-
|
|
501
|
+
if (!isDataSourceFieldPathValue(value, config)) {
|
|
502
|
+
if (options?.validatePlainValue) {
|
|
503
|
+
return options.validatePlainValue(value, context);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
if (config.fieldConfig) {
|
|
507
|
+
// 值不是数据源字段路径时,按 fieldConfig 的类型校验(与表单项自身 typeMatch 行为一致)
|
|
508
|
+
return validateTypeMatch(
|
|
509
|
+
value,
|
|
510
|
+
mForm,
|
|
511
|
+
{ ...props, config: { name: config.name, ...config.fieldConfig } },
|
|
512
|
+
message,
|
|
513
|
+
);
|
|
514
|
+
}
|
|
485
515
|
}
|
|
486
516
|
|
|
487
517
|
if (!Array.isArray(value) || value.some((item) => typeof item !== 'string')) {
|
|
@@ -496,6 +526,9 @@ const validateDataSourceFieldSelect: TypeMatchValidator = (value, { mForm, messa
|
|
|
496
526
|
});
|
|
497
527
|
};
|
|
498
528
|
|
|
529
|
+
const validateDataSourceFieldSelect: TypeMatchValidator = (value, context) =>
|
|
530
|
+
validateDataSourceFieldSelectValue(value, context);
|
|
531
|
+
|
|
499
532
|
const validateDataSourceSelect: TypeMatchValidator = (value, { message, props }) => {
|
|
500
533
|
const config = props.config || {};
|
|
501
534
|
const dataSources = getDataSources();
|
package/types/index.d.ts
CHANGED
|
@@ -713,10 +713,12 @@ declare class Editor extends BaseService {
|
|
|
713
713
|
}?: DslOpOptions): Promise<void>;
|
|
714
714
|
doUpdate(config: MNode, {
|
|
715
715
|
changeRecords,
|
|
716
|
-
historySource
|
|
716
|
+
historySource,
|
|
717
|
+
replace
|
|
717
718
|
}?: {
|
|
718
719
|
changeRecords?: ChangeRecord[];
|
|
719
720
|
historySource?: HistoryOpSource;
|
|
721
|
+
replace?: boolean;
|
|
720
722
|
}): Promise<{
|
|
721
723
|
newNode: MNode;
|
|
722
724
|
oldNode: MNode;
|
|
@@ -731,6 +733,7 @@ declare class Editor extends BaseService {
|
|
|
731
733
|
* @param data.changeRecordList 多节点 form 端变更记录列表,按 config 数组同序对应每个节点;优先级高于 changeRecords
|
|
732
734
|
* @param data.doNotPushHistory 是否不写入历史记录(默认 false)
|
|
733
735
|
* @param data.historyDescription 入栈时附带的人类可读描述,用于历史面板展示(不影响 undo/redo 行为)
|
|
736
|
+
* @param data.replace 是否整节点替换:为 true 时跳过 mergeWith / toggleFixedPosition / setChildrenLayout,直接用传入配置覆盖(默认 false)
|
|
734
737
|
* @returns 更新后的节点配置
|
|
735
738
|
*/
|
|
736
739
|
update(config: MNode | MNode[], data?: {
|
|
@@ -739,6 +742,11 @@ declare class Editor extends BaseService {
|
|
|
739
742
|
doNotPushHistory?: boolean;
|
|
740
743
|
historyDescription?: string;
|
|
741
744
|
historySource?: HistoryOpSource;
|
|
745
|
+
/**
|
|
746
|
+
* 为 true 时不做深合并等变换,直接用传入配置整节点替换现有节点。
|
|
747
|
+
* 适用于源码编辑、历史整节点快照回放等「完整 DSL」场景;默认 false(局部属性更新走 merge)。
|
|
748
|
+
*/
|
|
749
|
+
replace?: boolean;
|
|
742
750
|
/**
|
|
743
751
|
* 属性面板提交时携带的校验错误信息,在写入历史记录之前落库,
|
|
744
752
|
* 使历史快照与本次变更对齐,从而 undo/redo 能正确还原错误标记。
|
|
@@ -865,6 +873,7 @@ declare class Editor extends BaseService {
|
|
|
865
873
|
doNotPushHistory?: boolean;
|
|
866
874
|
historyDescription?: string;
|
|
867
875
|
historySource?: HistoryOpSource;
|
|
876
|
+
replace?: boolean;
|
|
868
877
|
}): Promise<DslOpWithHistoryIdsResult<MNode | MNode[]>>;
|
|
869
878
|
/** 等价于 {@link moveLayer},并额外返回本次写入历史记录的 uuid 列表(未入栈时 historyIds 为 `[]`)。 */
|
|
870
879
|
moveLayerAndGetHistoryId(offset: number | LayerOffset, options?: DslOpOptions): Promise<DslOpWithHistoryIdsResult<void>>;
|
|
@@ -3583,6 +3592,17 @@ declare const V_GUIDE_LINE_STORAGE_KEY = "$MagicStageVerticalGuidelinesData";
|
|
|
3583
3592
|
//#endregion
|
|
3584
3593
|
//#region temp/packages/editor/src/utils/type-match-rules.d.ts
|
|
3585
3594
|
declare const ALL_COND_OPS: Set<string>;
|
|
3595
|
+
type ValidateDataSourceFieldSelectOptions = {
|
|
3596
|
+
/**
|
|
3597
|
+
* 覆盖「非数据源字段路径」时的校验。
|
|
3598
|
+
* 不传则按 fieldConfig 走内置 typeMatch(与表单项自身 typeMatch 行为一致)。
|
|
3599
|
+
*/
|
|
3600
|
+
validatePlainValue?: (value: any, context: TypeMatchValidateContext) => string | undefined | Promise<string | undefined>;
|
|
3601
|
+
};
|
|
3602
|
+
/**
|
|
3603
|
+
* data-source-field-select 的 typeMatch 校验逻辑,可供自定义 rules.validator 复用。
|
|
3604
|
+
*/
|
|
3605
|
+
declare const validateDataSourceFieldSelectValue: (value: any, context: TypeMatchValidateContext, options?: ValidateDataSourceFieldSelectOptions) => string | undefined | Promise<string | undefined>;
|
|
3586
3606
|
declare const editorTypeMatchRules: Record<string, TypeMatchValidator>;
|
|
3587
3607
|
//#endregion
|
|
3588
3608
|
//#region temp/packages/editor/src/utils/event.d.ts
|
|
@@ -6949,4 +6969,4 @@ declare const _default$43: {
|
|
|
6949
6969
|
install: (app: App, opt?: Partial<EditorInstallOptions | DesignPluginOptions | FormInstallOptions>) => void;
|
|
6950
6970
|
};
|
|
6951
6971
|
//#endregion
|
|
6952
|
-
export { ALL_COND_OPS, AddMNode, AddPrefixToObject, AsyncAfterHook, AsyncBeforeHook, AsyncHookPlugin, AsyncMethodName, BaseStepValue, BeforeAdd, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CanDropInFunction, CanDropInScene, _default as CodeBlockEditor, _default$1 as CodeBlockList, _default$2 as CodeBlockListPanel, CodeBlockListPanelSlots, CodeBlockListSlots, CodeBlockStepValue, CodeDeleteErrorType, CodeDslItem, CodeParamStatement, CodeRelation, _default$3 as CodeSelect, _default$4 as CodeSelectCol, CodeState, ColumnLayout, CombineInfo, CompareCategory, _default$5 as CompareForm, CompareFormBaseProps, CompareFormLoadConfig, CompareFormLoadConfigContext, ComponentGroup, ComponentGroupState, ComponentItem, _default$6 as ComponentListPanel, ComponentListPanelSlots, _default$7 as CondOpSelect, ConfirmAndRevertOptions, _default$8 as ContentMenu, ContentMenuTarget, ContentMenuType, CustomContentMenuFunction, CustomDiffFormOptions, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, _default$9 as DataSourceAddButton, _default$10 as DataSourceConfigPanel, _default$11 as DataSourceFieldSelect, _default$12 as DataSourceFields, _default$13 as DataSourceInput, DataSourceListSlots, _default$14 as DataSourceMethodSelect, _default$15 as DataSourceMethods, _default$16 as DataSourceMocks, _default$17 as DataSourceSelect, DataSourceStepValue, DatasourceTypeOption, DepTargetType, DiffDialogPayload, _default$18 as DisplayConds, DragClassification, DragType, DslOpOptions, DslOpWithHistoryIdsResult, EVENT_NAME_VALUE_SEPARATOR, EditorChangeEvent, EditorChangeEventHistoryMeta, EditorChangeItem, EditorEvents, EditorInstallOptions, EditorNodeInfo, EditorSlots, EditorUpdateChangeItem, EventBus, EventBusEvent, EventNameOption, EventNameSelectOption, _default$19 as EventSelect, Fixed2Other, _default$20 as FloatingBox, FrameworkSlots, GetCodeBlockFormConfigOptions, GetColumnWidth, GetConfig, H_GUIDE_LINE_STORAGE_KEY, HistoryBucketConfig, _default$21 as HistoryDiffDialog, HistoryEvents, HistoryGroup, _default$22 as HistoryListBucket, _default$23 as HistoryListBucketTab, HistoryListExtraTab, HistoryOpOptions, HistoryOpOptionsWithChangeRecords, HistoryOpSource, HistoryOpType, HistoryPersistOptions, HistoryRowDescriptor, HistoryState, HistoryStepEntry, HistoryStepType, HistorySteps, _default$24 as Icon, IdleTask, IdleTaskEvents, IsExpandableFunction, KeyBindingCacheItem, KeyBindingCommand, KeyBindingItem, _default$25 as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, _default$26 as LayerNodeContent, LayerNodeSlots, LayerNodeStatus, LayerOffset, _default$27 as LayerPanel, LayerPanelSlots, Layout, _default$28 as LayoutContainer, _default$28 as SplitView, ListState, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, MenuBarData, MenuButton, MenuComponent, MenuItem, NodeInvalidInfo, NodeInvalidSource, type OnDrag, PROPS_PANEL_WIDTH_STORAGE_KEY, PageBarSortOptions, _default$29 as PageFragmentSelect, PartSortableOptions, PastePosition, PersistedHistoryState, PropsFormConfigFunction, _default$30 as PropsFormPanel, PropsFormValueFunction, _default$31 as PropsPanel, PropsPanelSlots, PropsState, RIGHT_COLUMN_WIDTH_STORAGE_KEY, _default$32 as Resizer, ScrollViewer, ScrollViewerEvent, ScrollViewerSlots, SerializedUndoRedo, Services, SetColumnWidth, SideBarData, SideComponent, SideItem, SideItemKey, SidebarSlots, StageCore, StageOptions, StageOverlayState, StageRect, StageSlots, StepDiffItem, StepExtra, StepValue, StoreState, StoreStateKey, _default$33 as StyleSetter, SyncAfterHook, SyncBeforeHook, SyncHookPlugin, _default$34 as TMagicCodeEditor, _default$35 as TMagicEditor, _default$36 as ToolButton, _default$37 as Tree, _default$38 as TreeNode, TreeNodeData, type TypeMatchValidateContext, UI_SELECT_MODE_EVENT_NAME, UiState, UndoRedo, UseCompareFormReturn, UseHistoryRevertOptions, V_GUIDE_LINE_STORAGE_KEY, _default$39 as ViewForm, WorkspaceSlots, advancedTabConfig, arrayOptions, beforePaste, booleanOptions, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, _default$40 as codeBlockService, collectEventNameOptionValues, collectRelatedNodes, _default$41 as componentListService, confirmHistoryAction, createStackStep, _default$42 as dataSourceService, debug, _default$43 as default, defaultIsExpandable, _default$44 as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectStackOpType, detectTargetId, detectTargetName, displayTabConfig, editorNodeMergeCustomizer, _default$45 as editorService, editorTypeMatchRules, eqOptions, error, eventTabConfig, _default$46 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, _default$47 as historyService, idbDelete, idbGet, idbSet, info, isEventNameCheckStrictly, isGlobalFlat, isIncludeDataSource, isIndexedDBSupported, _default$48 as keybindingService, _default$49 as loadMonaco, log, markStackSaved, mergeSteps, moveItemsInContainer, normalizeCompActionValue, numberOptions, openIndexedDB, _default$50 as propsService, removeStyleDisplayConfig, resolveFieldByPath, resolveSelectedNode, serializeConfig, serializeStacks, setChildrenLayout, setEditorConfig, setLayout, _default$51 as stageOverlayService, _default$52 as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, _default$53 as uiService, undoFloor, updateStatus, useCodeBlockEdit, useCompareForm, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useHistoryRevert, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, warn };
|
|
6972
|
+
export { ALL_COND_OPS, AddMNode, AddPrefixToObject, AsyncAfterHook, AsyncBeforeHook, AsyncHookPlugin, AsyncMethodName, BaseStepValue, BeforeAdd, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CanDropInFunction, CanDropInScene, _default as CodeBlockEditor, _default$1 as CodeBlockList, _default$2 as CodeBlockListPanel, CodeBlockListPanelSlots, CodeBlockListSlots, CodeBlockStepValue, CodeDeleteErrorType, CodeDslItem, CodeParamStatement, CodeRelation, _default$3 as CodeSelect, _default$4 as CodeSelectCol, CodeState, ColumnLayout, CombineInfo, CompareCategory, _default$5 as CompareForm, CompareFormBaseProps, CompareFormLoadConfig, CompareFormLoadConfigContext, ComponentGroup, ComponentGroupState, ComponentItem, _default$6 as ComponentListPanel, ComponentListPanelSlots, _default$7 as CondOpSelect, ConfirmAndRevertOptions, _default$8 as ContentMenu, ContentMenuTarget, ContentMenuType, CustomContentMenuFunction, CustomDiffFormOptions, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, _default$9 as DataSourceAddButton, _default$10 as DataSourceConfigPanel, _default$11 as DataSourceFieldSelect, _default$12 as DataSourceFields, _default$13 as DataSourceInput, DataSourceListSlots, _default$14 as DataSourceMethodSelect, _default$15 as DataSourceMethods, _default$16 as DataSourceMocks, _default$17 as DataSourceSelect, DataSourceStepValue, DatasourceTypeOption, DepTargetType, DiffDialogPayload, _default$18 as DisplayConds, DragClassification, DragType, DslOpOptions, DslOpWithHistoryIdsResult, EVENT_NAME_VALUE_SEPARATOR, EditorChangeEvent, EditorChangeEventHistoryMeta, EditorChangeItem, EditorEvents, EditorInstallOptions, EditorNodeInfo, EditorSlots, EditorUpdateChangeItem, EventBus, EventBusEvent, EventNameOption, EventNameSelectOption, _default$19 as EventSelect, Fixed2Other, _default$20 as FloatingBox, FrameworkSlots, GetCodeBlockFormConfigOptions, GetColumnWidth, GetConfig, H_GUIDE_LINE_STORAGE_KEY, HistoryBucketConfig, _default$21 as HistoryDiffDialog, HistoryEvents, HistoryGroup, _default$22 as HistoryListBucket, _default$23 as HistoryListBucketTab, HistoryListExtraTab, HistoryOpOptions, HistoryOpOptionsWithChangeRecords, HistoryOpSource, HistoryOpType, HistoryPersistOptions, HistoryRowDescriptor, HistoryState, HistoryStepEntry, HistoryStepType, HistorySteps, _default$24 as Icon, IdleTask, IdleTaskEvents, IsExpandableFunction, KeyBindingCacheItem, KeyBindingCommand, KeyBindingItem, _default$25 as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, _default$26 as LayerNodeContent, LayerNodeSlots, LayerNodeStatus, LayerOffset, _default$27 as LayerPanel, LayerPanelSlots, Layout, _default$28 as LayoutContainer, _default$28 as SplitView, ListState, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, MenuBarData, MenuButton, MenuComponent, MenuItem, NodeInvalidInfo, NodeInvalidSource, type OnDrag, PROPS_PANEL_WIDTH_STORAGE_KEY, PageBarSortOptions, _default$29 as PageFragmentSelect, PartSortableOptions, PastePosition, PersistedHistoryState, PropsFormConfigFunction, _default$30 as PropsFormPanel, PropsFormValueFunction, _default$31 as PropsPanel, PropsPanelSlots, PropsState, RIGHT_COLUMN_WIDTH_STORAGE_KEY, _default$32 as Resizer, ScrollViewer, ScrollViewerEvent, ScrollViewerSlots, SerializedUndoRedo, Services, SetColumnWidth, SideBarData, SideComponent, SideItem, SideItemKey, SidebarSlots, StageCore, StageOptions, StageOverlayState, StageRect, StageSlots, StepDiffItem, StepExtra, StepValue, StoreState, StoreStateKey, _default$33 as StyleSetter, SyncAfterHook, SyncBeforeHook, SyncHookPlugin, _default$34 as TMagicCodeEditor, _default$35 as TMagicEditor, _default$36 as ToolButton, _default$37 as Tree, _default$38 as TreeNode, TreeNodeData, type TypeMatchValidateContext, UI_SELECT_MODE_EVENT_NAME, UiState, UndoRedo, UseCompareFormReturn, UseHistoryRevertOptions, V_GUIDE_LINE_STORAGE_KEY, ValidateDataSourceFieldSelectOptions, _default$39 as ViewForm, WorkspaceSlots, advancedTabConfig, arrayOptions, beforePaste, booleanOptions, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, _default$40 as codeBlockService, collectEventNameOptionValues, collectRelatedNodes, _default$41 as componentListService, confirmHistoryAction, createStackStep, _default$42 as dataSourceService, debug, _default$43 as default, defaultIsExpandable, _default$44 as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectStackOpType, detectTargetId, detectTargetName, displayTabConfig, editorNodeMergeCustomizer, _default$45 as editorService, editorTypeMatchRules, eqOptions, error, eventTabConfig, _default$46 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, _default$47 as historyService, idbDelete, idbGet, idbSet, info, isEventNameCheckStrictly, isGlobalFlat, isIncludeDataSource, isIndexedDBSupported, _default$48 as keybindingService, _default$49 as loadMonaco, log, markStackSaved, mergeSteps, moveItemsInContainer, normalizeCompActionValue, numberOptions, openIndexedDB, _default$50 as propsService, removeStyleDisplayConfig, resolveFieldByPath, resolveSelectedNode, serializeConfig, serializeStacks, setChildrenLayout, setEditorConfig, setLayout, _default$51 as stageOverlayService, _default$52 as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, _default$53 as uiService, undoFloor, updateStatus, useCodeBlockEdit, useCompareForm, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useHistoryRevert, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, validateDataSourceFieldSelectValue, warn };
|