@tmagic/editor 1.8.0-manmanyu.22 → 1.8.0-manmanyu.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/components/CompareForm.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/layouts/history-list/useHistoryRevert.js +7 -3
- package/dist/es/services/ui.js +3 -3
- package/dist/es/style.css +1 -0
- package/dist/es/utils/const.js +2 -2
- package/dist/style.css +1 -0
- package/dist/themes/magic-admin.css +6 -0
- package/dist/tmagic-editor.umd.cjs +22 -12
- package/package.json +7 -7
- package/src/components/CompareForm.vue +7 -0
- package/src/layouts/history-list/HistoryDiffDialog.vue +11 -1
- package/src/layouts/history-list/useHistoryRevert.ts +4 -0
- package/src/services/ui.ts +12 -3
- package/src/theme/themes/magic-admin/index.scss +13 -0
- package/src/type.ts +6 -0
- package/src/utils/const.ts +3 -3
- package/types/index.d.ts +15 -4
|
@@ -21,6 +21,7 @@ var CompareForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
21
21
|
},
|
|
22
22
|
baseFormState: {},
|
|
23
23
|
selfDiffFieldTypes: {},
|
|
24
|
+
size: {},
|
|
24
25
|
loadConfig: {},
|
|
25
26
|
services: {}
|
|
26
27
|
},
|
|
@@ -181,13 +182,15 @@ var CompareForm_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
181
182
|
"label-width": __props.labelWidth,
|
|
182
183
|
"extend-state": mergedExtendState,
|
|
183
184
|
"show-diff": showDiff,
|
|
184
|
-
"self-diff-field-types": __props.selfDiffFieldTypes
|
|
185
|
+
"self-diff-field-types": __props.selfDiffFieldTypes,
|
|
186
|
+
size: __props.size
|
|
185
187
|
}, null, 8, [
|
|
186
188
|
"config",
|
|
187
189
|
"init-values",
|
|
188
190
|
"last-values",
|
|
189
191
|
"label-width",
|
|
190
|
-
"self-diff-field-types"
|
|
192
|
+
"self-diff-field-types",
|
|
193
|
+
"size"
|
|
191
194
|
])) : createCommentVNode("v-if", true)], 4);
|
|
192
195
|
};
|
|
193
196
|
}
|
|
@@ -38,7 +38,7 @@ var Framework_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
|
|
|
38
38
|
watch(() => uiService.get("hideSlideBar"), (hideSlideBar) => {
|
|
39
39
|
uiService.set("columnWidth", {
|
|
40
40
|
...columnWidth.value,
|
|
41
|
-
left: hideSlideBar ? 0 : storageService.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) ||
|
|
41
|
+
left: hideSlideBar ? 0 : storageService.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) || 345
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
const columnWidthChange = (columnW) => {
|
package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js
CHANGED
|
@@ -28,6 +28,7 @@ var HistoryDiffDialog_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
28
28
|
extendState: {},
|
|
29
29
|
loadConfig: {},
|
|
30
30
|
width: { default: "900px" },
|
|
31
|
+
size: {},
|
|
31
32
|
isConfirm: { type: Boolean },
|
|
32
33
|
onConfirm: {},
|
|
33
34
|
selfDiffFieldTypes: {},
|
|
@@ -258,6 +259,7 @@ var HistoryDiffDialog_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
258
259
|
"load-config": __props.loadConfig,
|
|
259
260
|
"self-diff-field-types": __props.selfDiffFieldTypes,
|
|
260
261
|
services: props.services,
|
|
262
|
+
size: props.size,
|
|
261
263
|
height: "70vh"
|
|
262
264
|
}, null, 8, [
|
|
263
265
|
"category",
|
|
@@ -269,7 +271,8 @@ var HistoryDiffDialog_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*
|
|
|
269
271
|
"extend-state",
|
|
270
272
|
"load-config",
|
|
271
273
|
"self-diff-field-types",
|
|
272
|
-
"services"
|
|
274
|
+
"services",
|
|
275
|
+
"size"
|
|
273
276
|
])) : (openBlock(), createBlock(CodeEditor_default, {
|
|
274
277
|
key: 2,
|
|
275
278
|
type: "diff",
|
|
@@ -48,6 +48,7 @@ var mountHistoryDiffDialog = async (options) => {
|
|
|
48
48
|
selfDiffFieldTypes: options.selfDiffFieldTypes,
|
|
49
49
|
compareFormState: options.compareFormState,
|
|
50
50
|
width: options.width,
|
|
51
|
+
size: options.size ?? options.services?.uiService?.get("propsPanelSize"),
|
|
51
52
|
onClose: options.onClose
|
|
52
53
|
});
|
|
53
54
|
if (options.appContext) Object.assign(app._context, options.appContext);
|
|
@@ -148,7 +149,8 @@ var useHistoryRevert = (options = {}, services) => {
|
|
|
148
149
|
extendState,
|
|
149
150
|
services,
|
|
150
151
|
...extra,
|
|
151
|
-
width: extra?.width ?? dialogWidth
|
|
152
|
+
width: extra?.width ?? dialogWidth,
|
|
153
|
+
size: extra?.size
|
|
152
154
|
});
|
|
153
155
|
return confirmRevert();
|
|
154
156
|
};
|
|
@@ -275,7 +277,8 @@ var useHistoryRevert = (options = {}, services) => {
|
|
|
275
277
|
if (!await runRevert(revertOptions.diffPayload ?? null, {
|
|
276
278
|
loadConfig: revertOptions.loadConfig,
|
|
277
279
|
selfDiffFieldTypes: revertOptions.selfDiffFieldTypes,
|
|
278
|
-
width: revertOptions.width
|
|
280
|
+
width: revertOptions.width,
|
|
281
|
+
size: revertOptions.size
|
|
279
282
|
})) return null;
|
|
280
283
|
return await revertOptions.revert();
|
|
281
284
|
};
|
|
@@ -289,7 +292,8 @@ var useHistoryRevert = (options = {}, services) => {
|
|
|
289
292
|
extendState,
|
|
290
293
|
services,
|
|
291
294
|
...extra,
|
|
292
|
-
width: extra?.width ?? dialogWidth
|
|
295
|
+
width: extra?.width ?? dialogWidth,
|
|
296
|
+
size: extra?.size
|
|
293
297
|
});
|
|
294
298
|
};
|
|
295
299
|
return {
|
package/dist/es/services/ui.js
CHANGED
|
@@ -19,11 +19,11 @@ var state = shallowReactive({
|
|
|
19
19
|
height: 817
|
|
20
20
|
},
|
|
21
21
|
columnWidth: {
|
|
22
|
-
left: storage_default.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) ||
|
|
22
|
+
left: Math.max(storage_default.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) || 345, 345),
|
|
23
23
|
center: 0,
|
|
24
|
-
right: storage_default.getItem("$MagicEditorRightColumnWidthData", { protocol: Protocol.NUMBER }) || 480
|
|
24
|
+
right: Math.max(storage_default.getItem("$MagicEditorRightColumnWidthData", { protocol: Protocol.NUMBER }) || 480, 300)
|
|
25
25
|
},
|
|
26
|
-
minLeftColumnWidth:
|
|
26
|
+
minLeftColumnWidth: 345,
|
|
27
27
|
minCenterColumnWidth: 400,
|
|
28
28
|
minRightColumnWidth: 300,
|
|
29
29
|
showGuides: true,
|
package/dist/es/style.css
CHANGED
|
@@ -395,6 +395,7 @@ a.magic-admin-link i {
|
|
|
395
395
|
.m-container-fieldset.fieldset-in-card-fit > fieldset.m-fieldset legend {
|
|
396
396
|
position: relative;
|
|
397
397
|
top: 10px;
|
|
398
|
+
background-color: transparent;
|
|
398
399
|
}
|
|
399
400
|
.m-container-fieldset.fieldset-in-card-fit.fieldset-in-card-fit-last {
|
|
400
401
|
padding-bottom: 0 !important;
|
package/dist/es/utils/const.js
CHANGED
|
@@ -4,9 +4,9 @@ var UI_SELECT_MODE_EVENT_NAME = "ui-select";
|
|
|
4
4
|
var LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
5
5
|
var RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
6
6
|
var PROPS_PANEL_WIDTH_STORAGE_KEY = "$MagicEditorPropsPanelWidthData";
|
|
7
|
-
var DEFAULT_LEFT_COLUMN_WIDTH =
|
|
7
|
+
var DEFAULT_LEFT_COLUMN_WIDTH = 345;
|
|
8
8
|
var DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
9
|
-
var MIN_LEFT_COLUMN_WIDTH =
|
|
9
|
+
var MIN_LEFT_COLUMN_WIDTH = 345;
|
|
10
10
|
var MIN_CENTER_COLUMN_WIDTH = 400;
|
|
11
11
|
var MIN_RIGHT_COLUMN_WIDTH = 300;
|
|
12
12
|
var H_GUIDE_LINE_STORAGE_KEY = "$MagicStageHorizontalGuidelinesData";
|
package/dist/style.css
CHANGED
|
@@ -395,6 +395,7 @@ a.magic-admin-link i {
|
|
|
395
395
|
.m-container-fieldset.fieldset-in-card-fit > fieldset.m-fieldset legend {
|
|
396
396
|
position: relative;
|
|
397
397
|
top: 10px;
|
|
398
|
+
background-color: transparent;
|
|
398
399
|
}
|
|
399
400
|
.m-container-fieldset.fieldset-in-card-fit.fieldset-in-card-fit-last {
|
|
400
401
|
padding-bottom: 0 !important;
|
|
@@ -375,6 +375,7 @@ a.magic-admin-link i {
|
|
|
375
375
|
.m-container-fieldset.fieldset-in-card-fit > fieldset.m-fieldset legend {
|
|
376
376
|
position: relative;
|
|
377
377
|
top: 10px;
|
|
378
|
+
background-color: transparent;
|
|
378
379
|
}
|
|
379
380
|
.m-container-fieldset.fieldset-in-card-fit.fieldset-in-card-fit-last {
|
|
380
381
|
padding-bottom: 0 !important;
|
|
@@ -2788,6 +2789,7 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
2788
2789
|
}
|
|
2789
2790
|
.m-editor.m-editor--magic-admin .m-editor-sidebar .m-editor-sidebar-header .m-editor-sidebar-header-item > i {
|
|
2790
2791
|
color: #84909d;
|
|
2792
|
+
font-size: 20px;
|
|
2791
2793
|
}
|
|
2792
2794
|
.m-editor.m-editor--magic-admin .m-editor-sidebar .m-editor-sidebar-header .m-editor-sidebar-header-item.is-active {
|
|
2793
2795
|
background-color: var(--el-button-hover-bg-color, rgb(230, 238, 253));
|
|
@@ -2887,4 +2889,8 @@ fieldset.m-fieldset .m-form-tip {
|
|
|
2887
2889
|
}
|
|
2888
2890
|
.m-editor.m-theme--magic-admin .magic-right-panel-tabs-top > .el-tabs > .el-tabs__header .el-tabs__nav-wrap.is-top::after {
|
|
2889
2891
|
display: none;
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
.m-editor.m-theme--magic-admin .m-editor-nav-menu .menu-item > button > i {
|
|
2895
|
+
font-size: 16px;
|
|
2890
2896
|
}
|
|
@@ -8180,9 +8180,9 @@
|
|
|
8180
8180
|
var LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
8181
8181
|
var RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
8182
8182
|
var PROPS_PANEL_WIDTH_STORAGE_KEY = "$MagicEditorPropsPanelWidthData";
|
|
8183
|
-
var DEFAULT_LEFT_COLUMN_WIDTH =
|
|
8183
|
+
var DEFAULT_LEFT_COLUMN_WIDTH = 345;
|
|
8184
8184
|
var DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
8185
|
-
var MIN_LEFT_COLUMN_WIDTH =
|
|
8185
|
+
var MIN_LEFT_COLUMN_WIDTH = 345;
|
|
8186
8186
|
var MIN_CENTER_COLUMN_WIDTH = 400;
|
|
8187
8187
|
var MIN_RIGHT_COLUMN_WIDTH = 300;
|
|
8188
8188
|
var H_GUIDE_LINE_STORAGE_KEY = "$MagicStageHorizontalGuidelinesData";
|
|
@@ -8203,11 +8203,11 @@
|
|
|
8203
8203
|
height: 817
|
|
8204
8204
|
},
|
|
8205
8205
|
columnWidth: {
|
|
8206
|
-
left: storage_default.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) ||
|
|
8206
|
+
left: Math.max(storage_default.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) || 345, 345),
|
|
8207
8207
|
center: 0,
|
|
8208
|
-
right: storage_default.getItem("$MagicEditorRightColumnWidthData", { protocol: Protocol.NUMBER }) || 480
|
|
8208
|
+
right: Math.max(storage_default.getItem("$MagicEditorRightColumnWidthData", { protocol: Protocol.NUMBER }) || 480, 300)
|
|
8209
8209
|
},
|
|
8210
|
-
minLeftColumnWidth:
|
|
8210
|
+
minLeftColumnWidth: 345,
|
|
8211
8211
|
minCenterColumnWidth: 400,
|
|
8212
8212
|
minRightColumnWidth: 300,
|
|
8213
8213
|
showGuides: true,
|
|
@@ -10372,7 +10372,7 @@
|
|
|
10372
10372
|
(0, vue.watch)(() => uiService.get("hideSlideBar"), (hideSlideBar) => {
|
|
10373
10373
|
uiService.set("columnWidth", {
|
|
10374
10374
|
...columnWidth.value,
|
|
10375
|
-
left: hideSlideBar ? 0 : storageService.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) ||
|
|
10375
|
+
left: hideSlideBar ? 0 : storageService.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) || 345
|
|
10376
10376
|
});
|
|
10377
10377
|
});
|
|
10378
10378
|
const columnWidthChange = (columnW) => {
|
|
@@ -11309,6 +11309,7 @@
|
|
|
11309
11309
|
},
|
|
11310
11310
|
baseFormState: {},
|
|
11311
11311
|
selfDiffFieldTypes: {},
|
|
11312
|
+
size: {},
|
|
11312
11313
|
loadConfig: {},
|
|
11313
11314
|
services: {}
|
|
11314
11315
|
},
|
|
@@ -11469,13 +11470,15 @@
|
|
|
11469
11470
|
"label-width": __props.labelWidth,
|
|
11470
11471
|
"extend-state": mergedExtendState,
|
|
11471
11472
|
"show-diff": showDiff,
|
|
11472
|
-
"self-diff-field-types": __props.selfDiffFieldTypes
|
|
11473
|
+
"self-diff-field-types": __props.selfDiffFieldTypes,
|
|
11474
|
+
size: __props.size
|
|
11473
11475
|
}, null, 8, [
|
|
11474
11476
|
"config",
|
|
11475
11477
|
"init-values",
|
|
11476
11478
|
"last-values",
|
|
11477
11479
|
"label-width",
|
|
11478
|
-
"self-diff-field-types"
|
|
11480
|
+
"self-diff-field-types",
|
|
11481
|
+
"size"
|
|
11479
11482
|
])) : (0, vue.createCommentVNode)("v-if", true)], 4);
|
|
11480
11483
|
};
|
|
11481
11484
|
}
|
|
@@ -11520,6 +11523,7 @@
|
|
|
11520
11523
|
extendState: {},
|
|
11521
11524
|
loadConfig: {},
|
|
11522
11525
|
width: { default: "900px" },
|
|
11526
|
+
size: {},
|
|
11523
11527
|
isConfirm: { type: Boolean },
|
|
11524
11528
|
onConfirm: {},
|
|
11525
11529
|
selfDiffFieldTypes: {},
|
|
@@ -11750,6 +11754,7 @@
|
|
|
11750
11754
|
"load-config": __props.loadConfig,
|
|
11751
11755
|
"self-diff-field-types": __props.selfDiffFieldTypes,
|
|
11752
11756
|
services: props.services,
|
|
11757
|
+
size: props.size,
|
|
11753
11758
|
height: "70vh"
|
|
11754
11759
|
}, null, 8, [
|
|
11755
11760
|
"category",
|
|
@@ -11761,7 +11766,8 @@
|
|
|
11761
11766
|
"extend-state",
|
|
11762
11767
|
"load-config",
|
|
11763
11768
|
"self-diff-field-types",
|
|
11764
|
-
"services"
|
|
11769
|
+
"services",
|
|
11770
|
+
"size"
|
|
11765
11771
|
])) : ((0, vue.openBlock)(), (0, vue.createBlock)(CodeEditor_default, {
|
|
11766
11772
|
key: 2,
|
|
11767
11773
|
type: "diff",
|
|
@@ -11840,6 +11846,7 @@
|
|
|
11840
11846
|
selfDiffFieldTypes: options.selfDiffFieldTypes,
|
|
11841
11847
|
compareFormState: options.compareFormState,
|
|
11842
11848
|
width: options.width,
|
|
11849
|
+
size: options.size ?? options.services?.uiService?.get("propsPanelSize"),
|
|
11843
11850
|
onClose: options.onClose
|
|
11844
11851
|
});
|
|
11845
11852
|
if (options.appContext) Object.assign(app._context, options.appContext);
|
|
@@ -11940,7 +11947,8 @@
|
|
|
11940
11947
|
extendState,
|
|
11941
11948
|
services,
|
|
11942
11949
|
...extra,
|
|
11943
|
-
width: extra?.width ?? dialogWidth
|
|
11950
|
+
width: extra?.width ?? dialogWidth,
|
|
11951
|
+
size: extra?.size
|
|
11944
11952
|
});
|
|
11945
11953
|
return confirmRevert();
|
|
11946
11954
|
};
|
|
@@ -12067,7 +12075,8 @@
|
|
|
12067
12075
|
if (!await runRevert(revertOptions.diffPayload ?? null, {
|
|
12068
12076
|
loadConfig: revertOptions.loadConfig,
|
|
12069
12077
|
selfDiffFieldTypes: revertOptions.selfDiffFieldTypes,
|
|
12070
|
-
width: revertOptions.width
|
|
12078
|
+
width: revertOptions.width,
|
|
12079
|
+
size: revertOptions.size
|
|
12071
12080
|
})) return null;
|
|
12072
12081
|
return await revertOptions.revert();
|
|
12073
12082
|
};
|
|
@@ -12081,7 +12090,8 @@
|
|
|
12081
12090
|
extendState,
|
|
12082
12091
|
services,
|
|
12083
12092
|
...extra,
|
|
12084
|
-
width: extra?.width ?? dialogWidth
|
|
12093
|
+
width: extra?.width ?? dialogWidth,
|
|
12094
|
+
size: extra?.size
|
|
12085
12095
|
});
|
|
12086
12096
|
};
|
|
12087
12097
|
return {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.0-manmanyu.
|
|
2
|
+
"version": "1.8.0-manmanyu.25",
|
|
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/
|
|
62
|
-
"@tmagic/
|
|
63
|
-
"@tmagic/
|
|
64
|
-
"@tmagic/
|
|
65
|
-
"@tmagic/
|
|
61
|
+
"@tmagic/design": "1.8.0-manmanyu.25",
|
|
62
|
+
"@tmagic/stage": "1.8.0-manmanyu.25",
|
|
63
|
+
"@tmagic/table": "1.8.0-manmanyu.25",
|
|
64
|
+
"@tmagic/form": "1.8.0-manmanyu.25",
|
|
65
|
+
"@tmagic/utils": "1.8.0-manmanyu.25"
|
|
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.38",
|
|
79
|
-
"@tmagic/core": "1.8.0-manmanyu.
|
|
79
|
+
"@tmagic/core": "1.8.0-manmanyu.25"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"typescript": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
:extend-state="mergedExtendState"
|
|
14
14
|
:show-diff="showDiff"
|
|
15
15
|
:self-diff-field-types="selfDiffFieldTypes"
|
|
16
|
+
:size="size"
|
|
16
17
|
></MForm>
|
|
17
18
|
</div>
|
|
18
19
|
</template>
|
|
@@ -22,6 +23,7 @@ import { computed, inject, provide, type Ref, ref, type ShallowRef, useTemplateR
|
|
|
22
23
|
import { isEqual } from 'lodash-es';
|
|
23
24
|
|
|
24
25
|
import { type CodeBlockContent, type DataSourceSchema, HookType, type MNode } from '@tmagic/core';
|
|
26
|
+
import { type FieldSize } from '@tmagic/design';
|
|
25
27
|
import { type FormConfig, type FormState, type FormValue, MForm } from '@tmagic/form';
|
|
26
28
|
|
|
27
29
|
import type { CompareCategory, CompareFormLoadConfig, Services } from '@editor/type';
|
|
@@ -68,6 +70,11 @@ const props = withDefaults(
|
|
|
68
70
|
baseFormState?: FormState;
|
|
69
71
|
/** 需要走 self diff 的字段类型(例如 mod-cond)。 */
|
|
70
72
|
selfDiffFieldTypes?: string[];
|
|
73
|
+
/**
|
|
74
|
+
* 表单内组件的尺寸(透传给 MForm 的 `size`),可选 'large' | 'default' | 'small'。
|
|
75
|
+
* 缺省时使用 MForm 内置默认尺寸。
|
|
76
|
+
*/
|
|
77
|
+
size?: FieldSize;
|
|
71
78
|
/**
|
|
72
79
|
* 自定义 FormConfig 加载逻辑。传入后将接管内置的按 `category`(node/data-source/code-block)
|
|
73
80
|
* 取配置逻辑,调用方可根据业务自行返回(或异步返回)表单配置。可通过
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
:load-config="loadConfig"
|
|
49
49
|
:self-diff-field-types="selfDiffFieldTypes"
|
|
50
50
|
:services="props.services"
|
|
51
|
+
:size="props.size"
|
|
51
52
|
height="70vh"
|
|
52
53
|
/>
|
|
53
54
|
|
|
@@ -77,7 +78,14 @@
|
|
|
77
78
|
import { computed, ref, watch } from 'vue';
|
|
78
79
|
import { isEqual } from 'lodash-es';
|
|
79
80
|
|
|
80
|
-
import {
|
|
81
|
+
import {
|
|
82
|
+
type FieldSize,
|
|
83
|
+
TMagicButton,
|
|
84
|
+
TMagicDialog,
|
|
85
|
+
TMagicRadioButton,
|
|
86
|
+
TMagicRadioGroup,
|
|
87
|
+
TMagicTag,
|
|
88
|
+
} from '@tmagic/design';
|
|
81
89
|
import type { FormState } from '@tmagic/form';
|
|
82
90
|
|
|
83
91
|
import CompareForm from '@editor/components/CompareForm.vue';
|
|
@@ -104,6 +112,8 @@ const props = withDefaults(
|
|
|
104
112
|
*/
|
|
105
113
|
loadConfig?: CompareFormLoadConfig;
|
|
106
114
|
width?: string;
|
|
115
|
+
/** 差异对比表单内组件的尺寸(透传给 CompareForm 的 `size`),可选 'large' | 'default' | 'small'。 */
|
|
116
|
+
size?: FieldSize;
|
|
107
117
|
isConfirm?: boolean;
|
|
108
118
|
onConfirm?: () => void;
|
|
109
119
|
selfDiffFieldTypes?: string[];
|
|
@@ -95,6 +95,7 @@ const mountHistoryDiffDialog = async (
|
|
|
95
95
|
selfDiffFieldTypes: options.selfDiffFieldTypes,
|
|
96
96
|
compareFormState: options.compareFormState,
|
|
97
97
|
width: options.width,
|
|
98
|
+
size: options.size ?? options.services?.uiService?.get('propsPanelSize'),
|
|
98
99
|
onClose: options.onClose,
|
|
99
100
|
});
|
|
100
101
|
if (options.appContext) {
|
|
@@ -223,6 +224,7 @@ export const useHistoryRevert = (options: UseHistoryRevertOptions = {}, services
|
|
|
223
224
|
services,
|
|
224
225
|
...extra,
|
|
225
226
|
width: extra?.width ?? dialogWidth,
|
|
227
|
+
size: extra?.size,
|
|
226
228
|
});
|
|
227
229
|
}
|
|
228
230
|
return confirmRevert();
|
|
@@ -382,6 +384,7 @@ export const useHistoryRevert = (options: UseHistoryRevertOptions = {}, services
|
|
|
382
384
|
loadConfig: revertOptions.loadConfig,
|
|
383
385
|
selfDiffFieldTypes: revertOptions.selfDiffFieldTypes,
|
|
384
386
|
width: revertOptions.width,
|
|
387
|
+
size: revertOptions.size,
|
|
385
388
|
});
|
|
386
389
|
if (!confirmed) return null;
|
|
387
390
|
return await revertOptions.revert();
|
|
@@ -399,6 +402,7 @@ export const useHistoryRevert = (options: UseHistoryRevertOptions = {}, services
|
|
|
399
402
|
services,
|
|
400
403
|
...extra,
|
|
401
404
|
width: extra?.width ?? dialogWidth,
|
|
405
|
+
size: extra?.size,
|
|
402
406
|
});
|
|
403
407
|
};
|
|
404
408
|
|
package/src/services/ui.ts
CHANGED
|
@@ -49,13 +49,22 @@ const state = shallowReactive<UiState>({
|
|
|
49
49
|
width: 375,
|
|
50
50
|
height: 817,
|
|
51
51
|
},
|
|
52
|
+
// 左右两栏宽度初始化:
|
|
53
|
+
// - 优先取 storage 里用户上次拖到的值;storage 空时回落到 DEFAULT_*;
|
|
54
|
+
// - 再用 Math.max 兜底,防止历史 storage 里存的是老版本或用户拖过头留下的
|
|
55
|
+
// "比当前 MIN_* 还小"的数值,避免打开就出现「面板宽度低于最小值」的错乱状态
|
|
56
|
+
// (最小值本身就是 60~62 行同源的 MIN_LEFT/RIGHT_COLUMN_WIDTH)。
|
|
52
57
|
columnWidth: {
|
|
53
|
-
left:
|
|
58
|
+
left: Math.max(
|
|
54
59
|
storageService.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, { protocol: Protocol.NUMBER }) || DEFAULT_LEFT_COLUMN_WIDTH,
|
|
60
|
+
MIN_LEFT_COLUMN_WIDTH,
|
|
61
|
+
),
|
|
55
62
|
center: 0,
|
|
56
|
-
right:
|
|
63
|
+
right: Math.max(
|
|
57
64
|
storageService.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY, { protocol: Protocol.NUMBER }) ||
|
|
58
|
-
|
|
65
|
+
DEFAULT_RIGHT_COLUMN_WIDTH,
|
|
66
|
+
MIN_RIGHT_COLUMN_WIDTH,
|
|
67
|
+
),
|
|
59
68
|
},
|
|
60
69
|
minLeftColumnWidth: MIN_LEFT_COLUMN_WIDTH,
|
|
61
70
|
minCenterColumnWidth: MIN_CENTER_COLUMN_WIDTH,
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
}
|
|
51
51
|
> i {
|
|
52
52
|
color: #84909d;
|
|
53
|
+
font-size: 20px;
|
|
53
54
|
}
|
|
54
55
|
&.is-active {
|
|
55
56
|
background-color: var(--el-button-hover-bg-color, rgb(230, 238, 253));
|
|
@@ -181,3 +182,15 @@
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
}
|
|
185
|
+
|
|
186
|
+
.m-editor.m-theme--magic-admin {
|
|
187
|
+
.m-editor-nav-menu {
|
|
188
|
+
.menu-item {
|
|
189
|
+
> button {
|
|
190
|
+
> i {
|
|
191
|
+
font-size: 16px;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
package/src/type.ts
CHANGED
|
@@ -33,6 +33,7 @@ import type {
|
|
|
33
33
|
MPage,
|
|
34
34
|
MPageFragment,
|
|
35
35
|
} from '@tmagic/core';
|
|
36
|
+
import type { FieldSize } from '@tmagic/design';
|
|
36
37
|
import type { ChangeRecord, FormConfig, FormState, TableColumnConfig, TypeFunction } from '@tmagic/form';
|
|
37
38
|
import type StageCore from '@tmagic/stage';
|
|
38
39
|
import type {
|
|
@@ -1454,6 +1455,11 @@ export interface CustomDiffFormOptions {
|
|
|
1454
1455
|
* 如 `'1200px'` / `'80%'`。缺省时使用弹窗内置默认宽度(900px)。
|
|
1455
1456
|
*/
|
|
1456
1457
|
width?: string;
|
|
1458
|
+
/**
|
|
1459
|
+
* 差异 / 确认回滚弹窗内 form 表单的尺寸(透传给 CompareForm 的 `size`),
|
|
1460
|
+
* 可选 `'large' | 'default' | 'small'`,缺省时使用表单内置默认尺寸。
|
|
1461
|
+
*/
|
|
1462
|
+
size?: FieldSize;
|
|
1457
1463
|
}
|
|
1458
1464
|
|
|
1459
1465
|
/**
|
package/src/utils/const.ts
CHANGED
|
@@ -5,11 +5,11 @@ export const LEFT_COLUMN_WIDTH_STORAGE_KEY = '$MagicEditorLeftColumnWidthData';
|
|
|
5
5
|
export const RIGHT_COLUMN_WIDTH_STORAGE_KEY = '$MagicEditorRightColumnWidthData';
|
|
6
6
|
export const PROPS_PANEL_WIDTH_STORAGE_KEY = '$MagicEditorPropsPanelWidthData';
|
|
7
7
|
|
|
8
|
-
export const DEFAULT_LEFT_COLUMN_WIDTH =
|
|
8
|
+
export const DEFAULT_LEFT_COLUMN_WIDTH = 345;
|
|
9
9
|
export const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
10
10
|
|
|
11
|
-
// 2026-06-11 设计稿修改,固定左侧栏存在时最小宽度为
|
|
12
|
-
export const MIN_LEFT_COLUMN_WIDTH =
|
|
11
|
+
// 2026-06-11 设计稿修改,固定左侧栏存在时最小宽度为 345
|
|
12
|
+
export const MIN_LEFT_COLUMN_WIDTH = 345;
|
|
13
13
|
export const MIN_CENTER_COLUMN_WIDTH = 400;
|
|
14
14
|
export const MIN_RIGHT_COLUMN_WIDTH = 300;
|
|
15
15
|
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import formPlugin, { CascaderOption, ChangeRecord, CodeSelectColConfig, CodeSelectConfig, CondOpSelectConfig, ContainerChangeEventData, DataSourceFieldSelectConfig, DataSourceFieldsConfig, DataSourceInputConfig, DataSourceMethodSelectConfig, DataSourceMethodsConfig, DataSourceMocksConfig, DataSourceSelect, DisplayCondsConfig, EventSelectConfig, FieldProps, FormConfig, FormInstallOptions, FormState, FormValue, KeyValueConfig, MForm, PageFragmentSelectConfig, TabPaneConfig, TableColumnConfig, TypeFunction } from "@tmagic/form";
|
|
2
2
|
import tablePlugin from "@tmagic/table";
|
|
3
3
|
import StageCore, { CanDropIn, ContainerHighlightType, CustomizeMoveableOptions, GuidesOptions, RenderType, UpdateDragEl, default as StageCore$1 } from "@tmagic/stage";
|
|
4
|
-
import designPlugin, { ButtonProps, DesignPluginOptions } from "@tmagic/design";
|
|
4
|
+
import designPlugin, { ButtonProps, DesignPluginOptions, FieldSize } from "@tmagic/design";
|
|
5
5
|
import Gesto, { OnDrag, OnDrag as OnDrag$1 } from "gesto";
|
|
6
6
|
import { CodeBlockContent, CodeBlockDSL, DataSchema, DataSourceFieldType, DataSourceSchema, DepData, DepExtendedData, DepTargetType, DepTargetType as DepTargetType$1, DisplayCond, EventOption, Id, MApp, MContainer, MNode, MPage, MPageFragment, NodeType, Target, TargetOptions } from "@tmagic/core";
|
|
7
7
|
import { App, AppContext, CSSProperties, Component, ComputedRef, Ref, ShallowRef } from "vue";
|
|
@@ -2686,6 +2686,11 @@ interface CustomDiffFormOptions {
|
|
|
2686
2686
|
* 如 `'1200px'` / `'80%'`。缺省时使用弹窗内置默认宽度(900px)。
|
|
2687
2687
|
*/
|
|
2688
2688
|
width?: string;
|
|
2689
|
+
/**
|
|
2690
|
+
* 差异 / 确认回滚弹窗内 form 表单的尺寸(透传给 CompareForm 的 `size`),
|
|
2691
|
+
* 可选 `'large' | 'default' | 'small'`,缺省时使用表单内置默认尺寸。
|
|
2692
|
+
*/
|
|
2693
|
+
size?: FieldSize;
|
|
2689
2694
|
}
|
|
2690
2695
|
/**
|
|
2691
2696
|
* 业务自有历史复用「单步回滚」交互({@link useHistoryRevert} 的 `confirmAndRevert`)的入参。
|
|
@@ -3283,9 +3288,9 @@ declare const UI_SELECT_MODE_EVENT_NAME = "ui-select";
|
|
|
3283
3288
|
declare const LEFT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorLeftColumnWidthData";
|
|
3284
3289
|
declare const RIGHT_COLUMN_WIDTH_STORAGE_KEY = "$MagicEditorRightColumnWidthData";
|
|
3285
3290
|
declare const PROPS_PANEL_WIDTH_STORAGE_KEY = "$MagicEditorPropsPanelWidthData";
|
|
3286
|
-
declare const DEFAULT_LEFT_COLUMN_WIDTH =
|
|
3291
|
+
declare const DEFAULT_LEFT_COLUMN_WIDTH = 345;
|
|
3287
3292
|
declare const DEFAULT_RIGHT_COLUMN_WIDTH = 480;
|
|
3288
|
-
declare const MIN_LEFT_COLUMN_WIDTH =
|
|
3293
|
+
declare const MIN_LEFT_COLUMN_WIDTH = 345;
|
|
3289
3294
|
declare const MIN_CENTER_COLUMN_WIDTH = 400;
|
|
3290
3295
|
declare const MIN_RIGHT_COLUMN_WIDTH = 300;
|
|
3291
3296
|
declare const H_GUIDE_LINE_STORAGE_KEY = "$MagicStageHorizontalGuidelinesData";
|
|
@@ -6123,6 +6128,11 @@ type __VLS_Props$8 = {
|
|
|
6123
6128
|
*/
|
|
6124
6129
|
baseFormState?: FormState; /** 需要走 self diff 的字段类型(例如 mod-cond)。 */
|
|
6125
6130
|
selfDiffFieldTypes?: string[];
|
|
6131
|
+
/**
|
|
6132
|
+
* 表单内组件的尺寸(透传给 MForm 的 `size`),可选 'large' | 'default' | 'small'。
|
|
6133
|
+
* 缺省时使用 MForm 内置默认尺寸。
|
|
6134
|
+
*/
|
|
6135
|
+
size?: FieldSize;
|
|
6126
6136
|
/**
|
|
6127
6137
|
* 自定义 FormConfig 加载逻辑。传入后将接管内置的按 `category`(node/data-source/code-block)
|
|
6128
6138
|
* 取配置逻辑,调用方可根据业务自行返回(或异步返回)表单配置。可通过
|
|
@@ -6267,7 +6277,8 @@ type __VLS_Props$7 = {
|
|
|
6267
6277
|
* 取配置逻辑,可通过 `ctx.defaultLoadConfig()` 复用默认结果再做二次加工。
|
|
6268
6278
|
*/
|
|
6269
6279
|
loadConfig?: CompareFormLoadConfig;
|
|
6270
|
-
width?: string;
|
|
6280
|
+
width?: string; /** 差异对比表单内组件的尺寸(透传给 CompareForm 的 `size`),可选 'large' | 'default' | 'small'。 */
|
|
6281
|
+
size?: FieldSize;
|
|
6271
6282
|
isConfirm?: boolean;
|
|
6272
6283
|
onConfirm?: () => void;
|
|
6273
6284
|
selfDiffFieldTypes?: string[];
|