@tmagic/editor 1.8.0-beta.12 → 1.8.0-beta.14
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/Editor.vue_vue_type_script_setup_true_lang.js +15 -3
- package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +13 -121
- package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +11 -4
- package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +7 -2
- package/dist/es/components/ViewForm.js +5 -0
- package/dist/es/components/ViewForm.vue_vue_type_script_setup_true_lang.js +58 -0
- package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +80 -55
- package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +5 -1
- package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +10 -7
- package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +4 -1
- package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +99 -64
- package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/Center.js +31 -0
- package/dist/es/fields/StyleSetter/icons/align-items/FlexEnd.js +31 -0
- package/dist/es/fields/StyleSetter/icons/align-items/FlexStart.js +31 -0
- package/dist/es/fields/StyleSetter/icons/align-items/SpaceAround.js +50 -0
- package/dist/es/fields/StyleSetter/icons/align-items/SpaceBetween.js +50 -0
- package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +6 -6
- package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +5 -2
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +28 -5
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +31 -5
- package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +10 -2
- package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +10 -2
- package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +10 -2
- package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +10 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +16 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +18 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +18 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +36 -2
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +32 -2
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +6 -3
- package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +47 -25
- package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +4 -1
- package/dist/es/hooks/use-compare-form.js +119 -0
- package/dist/es/icons/DatasourceIcon.js +17 -0
- package/dist/es/index.js +6 -4
- package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +14 -10
- package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +10 -1
- package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/plugin.js +2 -1
- package/dist/es/services/codeBlock.js +1 -1
- package/dist/es/services/editor.js +54 -13
- package/dist/es/services/history.js +1 -1
- package/dist/es/services/props.js +1 -1
- package/dist/es/services/storage.js +1 -1
- package/dist/es/services/ui.js +5 -3
- package/dist/es/style.css +303 -40
- package/dist/es/utils/config.js +4 -1
- package/dist/es/utils/const.js +2 -2
- package/dist/es/utils/props.js +69 -30
- package/dist/style.css +303 -40
- package/dist/themes/magic-admin.css +3000 -0
- package/dist/tmagic-editor.umd.cjs +1748 -1079
- package/package.json +7 -7
- package/src/Editor.vue +22 -1
- package/src/components/CompareForm.vue +15 -202
- package/src/components/ContentMenu.vue +10 -2
- package/src/components/FloatingBox.vue +8 -2
- package/src/components/ViewForm.vue +55 -0
- package/src/editorProps.ts +4 -0
- package/src/fields/CodeSelect.vue +54 -43
- package/src/fields/CodeSelectCol.vue +1 -0
- package/src/fields/DataSourceFieldSelect/Index.vue +14 -5
- package/src/fields/DisplayConds.vue +4 -1
- package/src/fields/EventSelect.vue +56 -32
- package/src/fields/StyleSetter/Index.vue +1 -4
- package/src/fields/StyleSetter/components/Border.vue +1 -1
- package/src/fields/StyleSetter/icons/align-items/Center.vue +19 -0
- package/src/fields/StyleSetter/icons/align-items/FlexEnd.vue +19 -0
- package/src/fields/StyleSetter/icons/align-items/FlexStart.vue +19 -0
- package/src/fields/StyleSetter/icons/align-items/SpaceAround.vue +34 -0
- package/src/fields/StyleSetter/icons/align-items/SpaceBetween.vue +34 -0
- package/src/fields/StyleSetter/icons/align-items/index.ts +5 -0
- package/src/fields/StyleSetter/icons/background-repeat/NoRepeat.vue +20 -4
- package/src/fields/StyleSetter/icons/background-repeat/Repeat.vue +10 -28
- package/src/fields/StyleSetter/icons/background-repeat/RepeatX.vue +4 -5
- package/src/fields/StyleSetter/icons/background-repeat/RepeatY.vue +4 -5
- package/src/fields/StyleSetter/icons/flex-direction/Column.vue +4 -3
- package/src/fields/StyleSetter/icons/flex-direction/ColumnReverse.vue +4 -3
- package/src/fields/StyleSetter/icons/flex-direction/Row.vue +4 -3
- package/src/fields/StyleSetter/icons/flex-direction/RowReverse.vue +4 -3
- package/src/fields/StyleSetter/icons/justify-content/Center.vue +5 -2
- package/src/fields/StyleSetter/icons/justify-content/FlexEnd.vue +15 -2
- package/src/fields/StyleSetter/icons/justify-content/FlexStart.vue +15 -2
- package/src/fields/StyleSetter/icons/justify-content/SpaceAround.vue +28 -3
- package/src/fields/StyleSetter/icons/justify-content/SpaceBetween.vue +28 -2
- package/src/fields/StyleSetter/pro/Background.vue +7 -2
- package/src/fields/StyleSetter/pro/Font.vue +3 -3
- package/src/fields/StyleSetter/pro/Layout.vue +98 -28
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-compare-form.ts +187 -0
- package/src/icons/DatasourceIcon.vue +7 -0
- package/src/index.ts +4 -0
- package/src/layouts/Framework.vue +7 -1
- package/src/layouts/props-panel/PropsPanel.vue +19 -1
- package/src/layouts/sidebar/Sidebar.vue +3 -3
- package/src/plugin.ts +3 -2
- package/src/services/editor.ts +54 -11
- package/src/services/ui.ts +20 -5
- package/src/theme/code-block.scss +37 -0
- package/src/theme/common/var.scss +1 -1
- package/src/theme/component-list-panel.scss +2 -2
- package/src/theme/data-source-field.scss +4 -0
- package/src/theme/display-conds.scss +11 -0
- package/src/theme/event.scss +58 -4
- package/src/theme/framework.scss +4 -1
- package/src/theme/history-list-panel.scss +9 -9
- package/src/theme/nav-menu.scss +5 -1
- package/src/theme/props-panel.scss +2 -1
- package/src/theme/style-setter/border.scss +14 -5
- package/src/theme/theme.scss +1 -0
- package/src/theme/themes/magic-admin/index.scss +214 -0
- package/src/theme/ui-select.scss +1 -1
- package/src/type.ts +79 -6
- package/src/utils/config.ts +9 -1
- package/src/utils/const.ts +3 -2
- package/src/utils/props.ts +51 -9
- package/types/index.d.ts +314 -203
package/src/services/editor.ts
CHANGED
|
@@ -550,6 +550,8 @@ class Editor extends BaseService {
|
|
|
550
550
|
this.emit('change', {
|
|
551
551
|
type: 'add',
|
|
552
552
|
data: newNodes.map((node) => ({ node, page: this.getPageOfNode(node.id) })),
|
|
553
|
+
historySource,
|
|
554
|
+
doNotPushHistory,
|
|
553
555
|
});
|
|
554
556
|
|
|
555
557
|
return Array.isArray(addNode) ? newNodes : newNodes[0];
|
|
@@ -692,7 +694,7 @@ class Editor extends BaseService {
|
|
|
692
694
|
}
|
|
693
695
|
|
|
694
696
|
this.emit('remove', nodes);
|
|
695
|
-
this.emit('change', { type: 'remove', data: changeItems });
|
|
697
|
+
this.emit('change', { type: 'remove', data: changeItems, historySource, doNotPushHistory });
|
|
696
698
|
}
|
|
697
699
|
|
|
698
700
|
public async doUpdate(
|
|
@@ -846,6 +848,8 @@ class Editor extends BaseService {
|
|
|
846
848
|
this.emit('change', {
|
|
847
849
|
type: 'update',
|
|
848
850
|
data: updateData.map((node) => ({ node, page: this.getPageOfNode(node.newNode.id) })),
|
|
851
|
+
historySource,
|
|
852
|
+
doNotPushHistory,
|
|
849
853
|
});
|
|
850
854
|
return Array.isArray(config) ? updateData.map((item) => item.newNode) : updateData[0].newNode;
|
|
851
855
|
}
|
|
@@ -1092,6 +1096,8 @@ class Editor extends BaseService {
|
|
|
1092
1096
|
type: 'move-layer',
|
|
1093
1097
|
data: [{ node, page: this.getPageOfNode(node.id) }],
|
|
1094
1098
|
offset,
|
|
1099
|
+
historySource,
|
|
1100
|
+
doNotPushHistory,
|
|
1095
1101
|
});
|
|
1096
1102
|
}
|
|
1097
1103
|
|
|
@@ -1277,6 +1283,8 @@ class Editor extends BaseService {
|
|
|
1277
1283
|
data: configs.map((node) => ({ node, page: this.getPageOfNode(node.id) })),
|
|
1278
1284
|
targetIndex,
|
|
1279
1285
|
targetParent,
|
|
1286
|
+
historySource,
|
|
1287
|
+
doNotPushHistory,
|
|
1280
1288
|
});
|
|
1281
1289
|
}
|
|
1282
1290
|
|
|
@@ -1878,10 +1886,12 @@ class Editor extends BaseService {
|
|
|
1878
1886
|
/**
|
|
1879
1887
|
* 应用历史操作(撤销 / 重做)
|
|
1880
1888
|
*
|
|
1881
|
-
*
|
|
1882
|
-
* `doNotSelect / doNotSwitchPage`
|
|
1889
|
+
* 删除 / 更新类修改走 `editor.remove / update`,并通过 `doNotPushHistory` 阻止再次入栈、
|
|
1890
|
+
* `doNotSelect / doNotSwitchPage` 让选区由方法末尾的统一逻辑兜底;
|
|
1891
|
+
* 「重新插回节点」(撤销 remove / 重做 add)需按 step 记录的 parentId / index 精确还原,
|
|
1892
|
+
* 不走 this.add,由手工 splice + stage.add 完成后补发等价的 add / change 事件(见 emitHistoryInsertEvents)。
|
|
1883
1893
|
*
|
|
1884
|
-
*
|
|
1894
|
+
* 注意:这些路径都会发出 add / remove / update / change 事件,业务侧若需要区分"用户操作"与"撤销重做触发",
|
|
1885
1895
|
* 请监听 `history-change` 事件配合判断。
|
|
1886
1896
|
*
|
|
1887
1897
|
* @param step 操作记录
|
|
@@ -1894,7 +1904,14 @@ class Editor extends BaseService {
|
|
|
1894
1904
|
const stage = this.get('stage');
|
|
1895
1905
|
if (!root) return;
|
|
1896
1906
|
|
|
1897
|
-
|
|
1907
|
+
// 撤销/重做内部复用 add/remove/update,透传被应用 step 上记录的 source,
|
|
1908
|
+
// 使其触发的 change 事件同样携带「历史来源」
|
|
1909
|
+
const commonOpts = {
|
|
1910
|
+
doNotSelect: true,
|
|
1911
|
+
doNotSwitchPage: true,
|
|
1912
|
+
doNotPushHistory: true,
|
|
1913
|
+
historySource: step.source,
|
|
1914
|
+
} as const;
|
|
1898
1915
|
|
|
1899
1916
|
switch (step.opType) {
|
|
1900
1917
|
case 'add': {
|
|
@@ -1910,17 +1927,22 @@ class Editor extends BaseService {
|
|
|
1910
1927
|
}
|
|
1911
1928
|
} else {
|
|
1912
1929
|
// 重做 add:按记录的 parentId / index 把节点重新插回父容器。
|
|
1913
|
-
// 按目标 index
|
|
1930
|
+
// 按目标 index 升序逐个插入,先小后大避免索引漂移。
|
|
1931
|
+
// 不走 this.add:doAdd 依赖当前选中节点(无选区时直接抛错),且只能插到选中节点之后 / 末尾,
|
|
1932
|
+
// 无法按 step 记录的 parentId / index 精确还原,还会重算 style 破坏已记录的终态位置。
|
|
1914
1933
|
const sorted = [...items].sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
|
|
1934
|
+
const addedNodes: MNode[] = [];
|
|
1915
1935
|
for (const { newSchema, parentId, index } of sorted) {
|
|
1916
1936
|
if (!newSchema || parentId === undefined) continue;
|
|
1917
1937
|
const parent = this.getNodeById(parentId, false) as MContainer | null;
|
|
1918
1938
|
if (parent?.items) {
|
|
1939
|
+
const addedNode = cloneDeep(newSchema);
|
|
1919
1940
|
if (typeof index === 'number' && index >= 0 && index < parent.items.length) {
|
|
1920
|
-
parent.items.splice(index, 0,
|
|
1941
|
+
parent.items.splice(index, 0, addedNode);
|
|
1921
1942
|
} else {
|
|
1922
|
-
parent.items.push(
|
|
1943
|
+
parent.items.push(addedNode);
|
|
1923
1944
|
}
|
|
1945
|
+
addedNodes.push(addedNode);
|
|
1924
1946
|
await stage?.add({
|
|
1925
1947
|
config: cloneDeep(newSchema),
|
|
1926
1948
|
parent: cloneDeep(parent),
|
|
@@ -1929,19 +1951,23 @@ class Editor extends BaseService {
|
|
|
1929
1951
|
});
|
|
1930
1952
|
}
|
|
1931
1953
|
}
|
|
1954
|
+
this.emitHistoryInsertEvents(addedNodes, step.source);
|
|
1932
1955
|
}
|
|
1933
1956
|
break;
|
|
1934
1957
|
}
|
|
1935
1958
|
case 'remove': {
|
|
1936
1959
|
const items = step.diff ?? [];
|
|
1937
1960
|
if (reverse) {
|
|
1938
|
-
// 撤销 remove:按原 index
|
|
1961
|
+
// 撤销 remove:按原 index 升序逐个插回(先小后大避免索引漂移);不走 this.add 的原因同上
|
|
1939
1962
|
const sorted = [...items].sort((a, b) => (a.index ?? 0) - (b.index ?? 0));
|
|
1963
|
+
const addedNodes: MNode[] = [];
|
|
1940
1964
|
for (const { oldSchema, parentId, index } of sorted) {
|
|
1941
1965
|
if (!oldSchema || parentId === undefined) continue;
|
|
1942
1966
|
const parent = this.getNodeById(parentId, false) as MContainer | null;
|
|
1943
1967
|
if (parent?.items) {
|
|
1944
|
-
|
|
1968
|
+
const addedNode = cloneDeep(oldSchema);
|
|
1969
|
+
parent.items.splice(index ?? parent.items.length, 0, addedNode);
|
|
1970
|
+
addedNodes.push(addedNode);
|
|
1945
1971
|
await stage?.add({
|
|
1946
1972
|
config: cloneDeep(oldSchema),
|
|
1947
1973
|
parent: cloneDeep(parent),
|
|
@@ -1950,6 +1976,7 @@ class Editor extends BaseService {
|
|
|
1950
1976
|
});
|
|
1951
1977
|
}
|
|
1952
1978
|
}
|
|
1979
|
+
this.emitHistoryInsertEvents(addedNodes, step.source);
|
|
1953
1980
|
} else {
|
|
1954
1981
|
// 重做 remove:再删一次
|
|
1955
1982
|
for (const { oldSchema } of items) {
|
|
@@ -1989,7 +2016,7 @@ class Editor extends BaseService {
|
|
|
1989
2016
|
return cloneDeep(reverse ? oldNode : newNode);
|
|
1990
2017
|
});
|
|
1991
2018
|
if (configs.length) {
|
|
1992
|
-
await this.update(configs, { doNotPushHistory: true });
|
|
2019
|
+
await this.update(configs, { doNotPushHistory: true, historySource: step.source });
|
|
1993
2020
|
}
|
|
1994
2021
|
break;
|
|
1995
2022
|
}
|
|
@@ -2028,6 +2055,22 @@ class Editor extends BaseService {
|
|
|
2028
2055
|
private selectedConfigExceptionHandler(config: MNode | Id): EditorNodeInfo {
|
|
2029
2056
|
return resolveSelectedNode(config, (id) => this.getNodeInfo(id), this.state.root?.id);
|
|
2030
2057
|
}
|
|
2058
|
+
|
|
2059
|
+
/**
|
|
2060
|
+
* 撤销 remove / 重做 add 通过手工 splice 按 step 记录的 parentId / index 精确还原节点(不走 this.add,原因见调用处注释),
|
|
2061
|
+
* 这里补齐与 this.add 等价的 add / change 事件,保证撤销/重做路径的事件行为与正向操作一致。
|
|
2062
|
+
*/
|
|
2063
|
+
private emitHistoryInsertEvents(nodes: MNode[], source?: HistoryOpSource) {
|
|
2064
|
+
if (!nodes.length) return;
|
|
2065
|
+
this.emit('add', nodes);
|
|
2066
|
+
this.emit('change', {
|
|
2067
|
+
type: 'add',
|
|
2068
|
+
data: nodes.map((node) => ({ node, page: this.getPageOfNode(node.id) })),
|
|
2069
|
+
historySource: source,
|
|
2070
|
+
// 撤销/重做本身不再写入历史记录
|
|
2071
|
+
doNotPushHistory: true,
|
|
2072
|
+
});
|
|
2073
|
+
}
|
|
2031
2074
|
}
|
|
2032
2075
|
|
|
2033
2076
|
export type EditorService = Editor;
|
package/src/services/ui.ts
CHANGED
|
@@ -49,13 +49,14 @@ const state = shallowReactive<UiState>({
|
|
|
49
49
|
width: 375,
|
|
50
50
|
height: 817,
|
|
51
51
|
},
|
|
52
|
+
// 先给 columnWidth 留占位,真正的 clamp 逻辑在 state 创建完成后
|
|
53
|
+
// 用 state.minLeftColumnWidth / state.minRightColumnWidth 作为下限重新赋值 —
|
|
54
|
+
// 这样以后从外部(比如 uiService.set('minLeftColumnWidth', ...))动态改最小宽度,
|
|
55
|
+
// 只改一处 state 字段即可,不用同步 MIN_* 常量。
|
|
52
56
|
columnWidth: {
|
|
53
|
-
left:
|
|
54
|
-
storageService.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, { protocol: Protocol.NUMBER }) || DEFAULT_LEFT_COLUMN_WIDTH,
|
|
57
|
+
left: 0,
|
|
55
58
|
center: 0,
|
|
56
|
-
right:
|
|
57
|
-
storageService.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY, { protocol: Protocol.NUMBER }) ||
|
|
58
|
-
DEFAULT_RIGHT_COLUMN_WIDTH,
|
|
59
|
+
right: 0,
|
|
59
60
|
},
|
|
60
61
|
minLeftColumnWidth: MIN_LEFT_COLUMN_WIDTH,
|
|
61
62
|
minCenterColumnWidth: MIN_CENTER_COLUMN_WIDTH,
|
|
@@ -83,6 +84,20 @@ const state = shallowReactive<UiState>({
|
|
|
83
84
|
},
|
|
84
85
|
});
|
|
85
86
|
|
|
87
|
+
// 左右两栏宽度延后初始化:
|
|
88
|
+
// - 优先取 storage 里用户上次拖到的值;storage 空时回落到 DEFAULT_*;
|
|
89
|
+
// - 再用 state.min*ColumnWidth 兜底,防止历史 storage 里存的是老版本或用户拖过头
|
|
90
|
+
// 留下的"比当前 min 还小"的数值。放到 state 之后写是因为初始化时无法在同一个
|
|
91
|
+
// 对象字面量里读到自己的其它字段。
|
|
92
|
+
state.columnWidth.left = Math.max(
|
|
93
|
+
storageService.getItem(LEFT_COLUMN_WIDTH_STORAGE_KEY, { protocol: Protocol.NUMBER }) || DEFAULT_LEFT_COLUMN_WIDTH,
|
|
94
|
+
state.minLeftColumnWidth,
|
|
95
|
+
);
|
|
96
|
+
state.columnWidth.right = Math.max(
|
|
97
|
+
storageService.getItem(RIGHT_COLUMN_WIDTH_STORAGE_KEY, { protocol: Protocol.NUMBER }) || DEFAULT_RIGHT_COLUMN_WIDTH,
|
|
98
|
+
state.minRightColumnWidth,
|
|
99
|
+
);
|
|
100
|
+
|
|
86
101
|
const canUsePluginMethods = {
|
|
87
102
|
async: ['zoom', 'calcZoom'] as const,
|
|
88
103
|
sync: [] as const,
|
|
@@ -1,3 +1,40 @@
|
|
|
1
1
|
.m-fields-code-select {
|
|
2
2
|
width: 100%;
|
|
3
|
+
> .el-card.tmagic-design-card--flat {
|
|
4
|
+
background-color: transparent;
|
|
5
|
+
margin-bottom: 10px;
|
|
6
|
+
> .el-card__body {
|
|
7
|
+
padding-left: 0;
|
|
8
|
+
.code-select-content {
|
|
9
|
+
> .m-fields-group-list {
|
|
10
|
+
> .tmagic-design-card--flat.el-card {
|
|
11
|
+
padding-left: 16px;
|
|
12
|
+
padding-right: 16px;
|
|
13
|
+
margin-bottom: 10px;
|
|
14
|
+
border: 0 !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.el-card__body {
|
|
21
|
+
.tmagic-design-form-item {
|
|
22
|
+
margin-bottom: 18px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.code-select-content {
|
|
26
|
+
> .m-fields-group-list {
|
|
27
|
+
> .tmagic-design-card--flat {
|
|
28
|
+
> .el-card__header {
|
|
29
|
+
padding: 16px 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.create-button {
|
|
35
|
+
&.fullWidth {
|
|
36
|
+
width: 100%;
|
|
37
|
+
margin: 0 0 16px 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
3
40
|
}
|
package/src/theme/event.scss
CHANGED
|
@@ -2,8 +2,29 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
.fullWidth {
|
|
4
4
|
width: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|
|
7
|
+
.event-select-container {
|
|
8
|
+
padding: 0 16px;
|
|
9
|
+
> .el-card.tmagic-design-card--flat {
|
|
10
|
+
> .el-card__header {
|
|
11
|
+
border-bottom: 1px solid #ebeef5;
|
|
12
|
+
}
|
|
13
|
+
> .el-card__body {
|
|
14
|
+
padding-bottom: 16px;
|
|
15
|
+
.m-fields-group-list-footer {
|
|
16
|
+
div {
|
|
17
|
+
justify-content: flex-start !important;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.el-card.tmagic-design-card--flat {
|
|
21
|
+
> .el-card__header {
|
|
22
|
+
padding: 16px 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
5
27
|
}
|
|
6
|
-
|
|
7
28
|
.event-select-code {
|
|
8
29
|
margin-left: 20px;
|
|
9
30
|
width: auto;
|
|
@@ -36,10 +57,43 @@
|
|
|
36
57
|
}
|
|
37
58
|
}
|
|
38
59
|
|
|
39
|
-
.
|
|
60
|
+
.event-select-container {
|
|
61
|
+
padding: 0 16px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.event-select-header {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
margin-bottom: 8px;
|
|
69
|
+
.event-select-title {
|
|
70
|
+
color: #0f1113;
|
|
71
|
+
font-size: 16px;
|
|
72
|
+
font-weight: 500;
|
|
73
|
+
line-height: 24px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
.event-item-header {
|
|
77
|
+
position: relative;
|
|
78
|
+
width: 100%;
|
|
79
|
+
.event-item-title {
|
|
80
|
+
color: #0f1113;
|
|
81
|
+
font-size: 16px;
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
line-height: 24px;
|
|
84
|
+
margin-bottom: 16px;
|
|
85
|
+
}
|
|
86
|
+
.event-item-delete-button {
|
|
87
|
+
position: absolute;
|
|
88
|
+
right: 0;
|
|
89
|
+
top: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
40
92
|
.el-form-item {
|
|
41
|
-
|
|
42
|
-
|
|
93
|
+
.el-form-item {
|
|
94
|
+
&.is-error {
|
|
95
|
+
margin-bottom: 18px;
|
|
96
|
+
}
|
|
43
97
|
}
|
|
44
98
|
}
|
|
45
99
|
}
|
package/src/theme/framework.scss
CHANGED
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
width: 100%;
|
|
7
7
|
|
|
8
8
|
&-content {
|
|
9
|
-
|
|
9
|
+
// 与 nav-menu.scss 的 `--editor-nav-height` 联动:默认 fallback 到 SCSS
|
|
10
|
+
// `$nav-height`(35px),主题覆盖时两处会同时切成同一个高度,保证 nav 和
|
|
11
|
+
// 主内容区总高度 = 100%。
|
|
12
|
+
height: calc(100% - var(--editor-nav-height, #{$nav-height}));
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
&-framework-center {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
color: #909399;
|
|
22
22
|
|
|
23
23
|
&:hover {
|
|
24
|
-
color: #409eff;
|
|
24
|
+
color: var(--el-color-primary, #409eff);
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
// 故这里仅作用于「非合并组」的单步条目,避免与卡片样式互相干扰。
|
|
97
97
|
&.is-current:not(.m-editor-history-list-group.is-merged) {
|
|
98
98
|
background-color: rgba(64, 158, 255, 0.1);
|
|
99
|
-
box-shadow: inset 2px 0 0 #409eff;
|
|
99
|
+
box-shadow: inset 2px 0 0 var(--el-color-primary, #409eff);
|
|
100
100
|
|
|
101
101
|
&:hover {
|
|
102
102
|
background-color: rgba(64, 158, 255, 0.16);
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
|
|
105
105
|
.m-editor-history-list-item-desc {
|
|
106
106
|
font-weight: 600;
|
|
107
|
-
color: #409eff;
|
|
107
|
+
color: var(--el-color-primary, #409eff);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
}
|
|
@@ -177,11 +177,11 @@
|
|
|
177
177
|
&.is-current {
|
|
178
178
|
background-color: rgba(64, 158, 255, 0.08);
|
|
179
179
|
border-color: rgba(64, 158, 255, 0.3);
|
|
180
|
-
border-left-color: #409eff;
|
|
180
|
+
border-left-color: var(--el-color-primary, #409eff);
|
|
181
181
|
box-shadow: none; // 覆盖 .is-current 公共的 inset 阴影
|
|
182
182
|
|
|
183
183
|
.m-editor-history-list-group-head {
|
|
184
|
-
color: #409eff;
|
|
184
|
+
color: var(--el-color-primary, #409eff);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
&.is-current {
|
|
219
|
-
color: #409eff;
|
|
219
|
+
color: var(--el-color-primary, #409eff);
|
|
220
220
|
font-weight: 600;
|
|
221
221
|
background-color: rgba(64, 158, 255, 0.08);
|
|
222
222
|
border-radius: 3px;
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
font-size: 10px;
|
|
232
232
|
line-height: 16px;
|
|
233
233
|
color: #fff;
|
|
234
|
-
background-color: #409eff;
|
|
234
|
+
background-color: var(--el-color-primary, #409eff);
|
|
235
235
|
font-weight: 500;
|
|
236
236
|
}
|
|
237
237
|
|
|
@@ -395,7 +395,7 @@
|
|
|
395
395
|
border-radius: 2px;
|
|
396
396
|
font-size: 10px;
|
|
397
397
|
line-height: 16px;
|
|
398
|
-
color: #409eff;
|
|
398
|
+
color: var(--el-color-primary, #409eff);
|
|
399
399
|
background-color: rgba(64, 158, 255, 0.1);
|
|
400
400
|
cursor: pointer;
|
|
401
401
|
user-select: none;
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
flex: 1 1 auto;
|
|
472
472
|
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
473
473
|
font-size: 11px;
|
|
474
|
-
color: #409eff;
|
|
474
|
+
color: var(--el-color-primary, #409eff);
|
|
475
475
|
overflow: hidden;
|
|
476
476
|
text-overflow: ellipsis;
|
|
477
477
|
white-space: nowrap;
|
package/src/theme/nav-menu.scss
CHANGED
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
font-weight: 400;
|
|
14
14
|
box-sizing: border-box;
|
|
15
15
|
margin: 0px;
|
|
16
|
-
|
|
16
|
+
// 用 CSS 变量做主题化开关:默认没设 `--editor-nav-height` 时回落到
|
|
17
|
+
// SCSS 变量 `$nav-height`(common/var.scss,35px);主题(如 magic-admin)
|
|
18
|
+
// 只需在祖先节点声明 `--editor-nav-height: 40px` 即可运行时覆盖,避免
|
|
19
|
+
// 走 `@use with` 那条对加载顺序极敏感的 SCSS 模块配置路径。
|
|
20
|
+
flex: 0 0 var(--editor-nav-height, #{$nav-height});
|
|
17
21
|
border-bottom: 1px solid #d8dee8;
|
|
18
22
|
|
|
19
23
|
> div {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.border-box-container {
|
|
2
2
|
display: flex;
|
|
3
|
+
--unuse-border-style: dashed;
|
|
3
4
|
.border-icon-container {
|
|
4
5
|
display: flex;
|
|
5
6
|
flex-direction: column;
|
|
@@ -28,24 +29,32 @@
|
|
|
28
29
|
border-color: var(--el-color-success, var(--td-success-color, #2ba471));
|
|
29
30
|
}
|
|
30
31
|
&.active {
|
|
32
|
+
border-color: var(--el-color-primary);
|
|
33
|
+
border-width: 1px;
|
|
34
|
+
// border-color: var(--el-color-primary, var(--td-brand-color, #0052d9));
|
|
35
|
+
}
|
|
36
|
+
&.center {
|
|
31
37
|
border-width: 1px;
|
|
32
|
-
border-color: var(--el-color-primary, var(--td-brand-color, #0052d9));
|
|
33
38
|
}
|
|
34
39
|
&.border-icon-top {
|
|
35
40
|
border-top-width: 2px;
|
|
36
|
-
border-style: solid
|
|
41
|
+
border-style: solid var(--unuse-border-style) var(--unuse-border-style)
|
|
42
|
+
var(--unuse-border-style);
|
|
37
43
|
}
|
|
38
44
|
&.border-icon-right {
|
|
39
45
|
border-right-width: 2px;
|
|
40
|
-
border-style:
|
|
46
|
+
border-style: var(--unuse-border-style) solid var(--unuse-border-style)
|
|
47
|
+
var(--unuse-border-style);
|
|
41
48
|
}
|
|
42
49
|
&.border-icon-bottom {
|
|
43
50
|
border-bottom-width: 2px;
|
|
44
|
-
border-style:
|
|
51
|
+
border-style: var(--unuse-border-style) var(--unuse-border-style) solid
|
|
52
|
+
var(--unuse-border-style);
|
|
45
53
|
}
|
|
46
54
|
&.border-icon-left {
|
|
47
55
|
border-left-width: 2px;
|
|
48
|
-
border-style:
|
|
56
|
+
border-style: var(--unuse-border-style) var(--unuse-border-style)
|
|
57
|
+
var(--unuse-border-style) solid;
|
|
49
58
|
}
|
|
50
59
|
}
|
|
51
60
|
}
|
package/src/theme/theme.scss
CHANGED