@tmagic/editor 1.8.0-manmanyu.8 → 1.8.0
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 +22 -13
- package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +10 -5
- package/dist/es/components/CodeParams.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +21 -119
- package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +21 -5
- package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +62 -16
- package/dist/es/components/Icon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/Resizer.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/es/components/ScrollBar.js +0 -1
- package/dist/es/components/ScrollBar.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/es/components/ScrollViewer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/SearchInput.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/SplitView.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ToolButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/Tree.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/TreeNode.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/components/ViewForm.js +5 -0
- package/dist/es/components/ViewForm.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/es/editorProps.js +7 -1
- package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +30 -113
- package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +7 -19
- package/dist/es/fields/DataSourceFieldSelect/FieldSelect.vue_vue_type_script_setup_true_lang.js +7 -6
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +12 -4
- package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +9 -20
- package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +2 -2
- package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +5 -3
- package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +10 -110
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +52 -363
- package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +3 -6
- package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +4 -35
- package/dist/es/fields/StyleSetter/components/Box.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/fields/StyleSetter/configs.js +663 -0
- package/dist/es/fields/StyleSetter/icons/align-items/Center.js +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/FlexEnd.js +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/FlexStart.js +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/SpaceAround.js +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/SpaceBetween.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Block.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Flex.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/Inline.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/InlineBlock.js +1 -1
- package/dist/es/fields/StyleSetter/icons/display/None.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Center.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Left.js +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/Right.js +1 -1
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +29 -106
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +8 -11
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +30 -89
- package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +29 -297
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +29 -82
- package/dist/es/fields/StyleSetter/pro/Transform.vue_vue_type_script_setup_true_lang.js +8 -24
- package/dist/es/fields/UISelect.js +0 -1
- package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/fields/configs/codeSelect.js +98 -0
- package/dist/es/fields/configs/displayConds.js +158 -0
- package/dist/es/fields/configs/eventSelect.js +225 -0
- package/dist/es/fields/configs/stickyAddButton.js +21 -0
- package/dist/es/fields/headless-validation.js +139 -0
- package/dist/es/headless.js +2 -0
- package/dist/es/hooks/use-code-block-edit.js +4 -2
- package/dist/es/hooks/use-compare-form.js +101 -0
- package/dist/es/hooks/use-form-context.js +29 -0
- package/dist/es/hooks/use-stage.js +1 -0
- package/dist/es/icons/CenterIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/icons/CodeIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/icons/DatasourceIcon.js +1 -1
- package/dist/es/icons/FolderMinusIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/index.js +17 -9
- package/dist/es/initService.js +52 -16
- package/dist/es/layouts/AddPageBox.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/CodeEditor.vue_vue_type_script_setup_true_lang.js +26 -10
- package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +11 -8
- package/dist/es/layouts/NavMenu.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/layouts/NavMenuColumn.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/Bucket.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/BucketTab.vue_vue_type_script_setup_true_lang.js +8 -5
- package/dist/es/layouts/history-list/GroupRow.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 +26 -10
- package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +36 -28
- package/dist/es/layouts/history-list/InitialRow.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/PageTab.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/history-list/composables.js +1 -1
- package/dist/es/layouts/history-list/useHistoryList.js +4 -4
- package/dist/es/layouts/history-list/useHistoryRevert.js +38 -33
- package/dist/es/layouts/page-bar/AddButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageBarScrollContainer.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/PageList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/page-bar/Search.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/es/layouts/props-panel/FormPanel.vue_vue_type_script_setup_true_lang.js +50 -20
- package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +53 -35
- package/dist/es/layouts/props-panel/use-style-panel.js +3 -2
- package/dist/es/layouts/sidebar/ComponentListPanel.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +21 -36
- package/dist/es/layouts/sidebar/code-block/CodeBlockList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/code-block/CodeBlockListPanel.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/es/layouts/sidebar/code-block/useContentMenu.js +19 -4
- package/dist/es/layouts/sidebar/data-source/DataSourceAddButton.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceConfigPanel.vue_vue_type_script_setup_true_lang.js +9 -4
- package/dist/es/layouts/sidebar/data-source/DataSourceList.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/sidebar/data-source/DataSourceListPanel.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/es/layouts/sidebar/data-source/useContentMenu.js +19 -4
- package/dist/es/layouts/sidebar/layer/LayerMenu.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/es/layouts/sidebar/layer/LayerNodeContent.js +5 -0
- package/dist/es/layouts/sidebar/layer/LayerNodeContent.vue_vue_type_script_setup_true_lang.js +46 -0
- package/dist/es/layouts/sidebar/layer/LayerNodeTool.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 +6 -4
- package/dist/es/layouts/sidebar/layer/use-click.js +3 -3
- package/dist/es/layouts/sidebar/layer/use-drag.js +11 -10
- package/dist/es/layouts/sidebar/layer/use-node-status.js +2 -2
- package/dist/es/layouts/workspace/Breadcrumb.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/Workspace.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/NodeListMenu.vue_vue_type_script_setup_true_lang.js +9 -3
- package/dist/es/layouts/workspace/viewer/Stage.vue_vue_type_script_setup_true_lang.js +55 -9
- package/dist/es/layouts/workspace/viewer/StageOverlay.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/layouts/workspace/viewer/ViewerMenu.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/es/plugin.js +35 -23
- package/dist/es/services/codeBlock.js +40 -31
- package/dist/es/services/dataSource.js +46 -34
- package/dist/es/services/dep.js +162 -41
- package/dist/es/services/editor.js +373 -137
- package/dist/es/services/events.js +4 -4
- package/dist/es/services/history.js +275 -392
- package/dist/es/services/keybinding.js +3 -3
- package/dist/es/services/props.js +2 -1
- package/dist/es/services/storage.js +2 -2
- package/dist/es/services/ui.js +7 -2
- package/dist/es/style.css +277 -114
- package/dist/es/utils/code-block.js +14 -7
- package/dist/es/utils/config.js +4 -1
- package/dist/es/utils/const.js +2 -2
- package/dist/es/utils/content-menu.js +2 -2
- package/dist/es/utils/data-source/index.js +34 -12
- package/dist/es/utils/dep/collect-worker-client.js +154 -0
- package/dist/es/utils/dep/idle-task.js +70 -22
- package/dist/es/utils/dep/worker.js +1 -1
- package/dist/es/utils/editor.js +4 -2
- package/dist/es/utils/event.js +135 -0
- package/dist/es/utils/history.js +35 -47
- package/dist/es/utils/monaco-editor.js +22 -6
- package/dist/es/utils/operator.js +2 -2
- package/dist/es/utils/props.js +50 -106
- package/dist/es/utils/type-match-rules.js +356 -0
- package/dist/style.css +277 -114
- package/dist/themes/magic-admin.css +978 -175
- package/dist/tmagic-editor-headless.umd.cjs +10880 -0
- package/dist/tmagic-editor.umd.cjs +13047 -11363
- package/package.json +18 -13
- package/src/Editor.vue +23 -6
- package/src/components/CodeBlockEditor.vue +3 -0
- package/src/components/CodeParams.vue +10 -4
- package/src/components/CompareForm.vue +20 -190
- package/src/components/ContentMenu.vue +34 -6
- package/src/components/FloatingBox.vue +71 -7
- package/src/components/ScrollBar.vue +0 -67
- package/src/components/ViewForm.vue +54 -0
- package/src/editorProps.ts +23 -10
- package/src/fields/Code.vue +1 -1
- package/src/fields/CodeSelect.vue +20 -113
- package/src/fields/CodeSelectCol.vue +1 -1
- package/src/fields/CondOpSelect.vue +5 -26
- package/src/fields/DataSourceFieldSelect/FieldSelect.vue +2 -2
- package/src/fields/DataSourceFieldSelect/Index.vue +4 -1
- package/src/fields/DataSourceFields.vue +5 -1
- package/src/fields/DataSourceInput.vue +10 -28
- package/src/fields/DataSourceMethodSelect.vue +1 -1
- package/src/fields/DataSourceMethods.vue +6 -2
- package/src/fields/DataSourceMocks.vue +3 -0
- package/src/fields/DataSourceSelect.vue +1 -1
- package/src/fields/DisplayConds.vue +17 -139
- package/src/fields/EventSelect.vue +29 -416
- package/src/fields/KeyValue.vue +1 -1
- package/src/fields/StyleSetter/Index.vue +2 -8
- package/src/fields/StyleSetter/components/Border.vue +4 -38
- package/src/fields/StyleSetter/components/Box.vue +1 -1
- package/src/fields/StyleSetter/components/Position.vue +1 -1
- package/src/fields/StyleSetter/configs.ts +690 -0
- package/src/fields/StyleSetter/pro/Background.vue +9 -64
- package/src/fields/StyleSetter/pro/Border.vue +5 -16
- package/src/fields/StyleSetter/pro/Font.vue +11 -71
- package/src/fields/StyleSetter/pro/Layout.vue +10 -230
- package/src/fields/StyleSetter/pro/Position.vue +11 -82
- package/src/fields/StyleSetter/pro/Transform.vue +6 -34
- package/src/fields/UISelect.vue +0 -12
- package/src/fields/configs/codeSelect.ts +127 -0
- package/src/fields/configs/displayConds.ts +184 -0
- package/src/fields/configs/eventSelect.ts +309 -0
- package/src/fields/configs/stickyAddButton.ts +32 -0
- package/src/fields/headless-validation.ts +177 -0
- package/src/headless.ts +33 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-compare-form.ts +166 -0
- package/src/hooks/use-form-context.ts +56 -0
- package/src/hooks/use-stage.ts +1 -0
- package/src/index.ts +9 -0
- package/src/initService.ts +73 -18
- package/src/layouts/CodeEditor.vue +32 -6
- package/src/layouts/Framework.vue +7 -6
- package/src/layouts/history-list/BucketTab.vue +2 -2
- package/src/layouts/history-list/HistoryDiffDialog.vue +33 -15
- package/src/layouts/history-list/HistoryListPanel.vue +16 -18
- package/src/layouts/history-list/useHistoryRevert.ts +57 -41
- package/src/layouts/props-panel/FormPanel.vue +75 -20
- package/src/layouts/props-panel/PropsPanel.vue +81 -30
- package/src/layouts/props-panel/use-style-panel.ts +4 -3
- package/src/layouts/sidebar/ComponentListPanel.vue +6 -2
- package/src/layouts/sidebar/Sidebar.vue +5 -3
- package/src/layouts/sidebar/code-block/CodeBlockListPanel.vue +5 -2
- package/src/layouts/sidebar/code-block/useContentMenu.ts +14 -2
- package/src/layouts/sidebar/data-source/DataSourceConfigPanel.vue +3 -0
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +3 -3
- package/src/layouts/sidebar/data-source/useContentMenu.ts +14 -2
- package/src/layouts/sidebar/layer/LayerMenu.vue +2 -2
- package/src/layouts/sidebar/layer/LayerNodeContent.vue +57 -0
- package/src/layouts/sidebar/layer/LayerPanel.vue +5 -2
- package/src/layouts/sidebar/layer/use-click.ts +3 -3
- package/src/layouts/sidebar/layer/use-node-status.ts +2 -2
- package/src/layouts/workspace/viewer/NodeListMenu.vue +4 -1
- package/src/layouts/workspace/viewer/Stage.vue +80 -10
- package/src/layouts/workspace/viewer/ViewerMenu.vue +7 -7
- package/src/plugin.ts +35 -25
- package/src/services/codeBlock.ts +4 -0
- package/src/services/dataSource.ts +3 -0
- package/src/services/dep.ts +292 -47
- package/src/services/editor.ts +383 -120
- package/src/services/events.ts +8 -7
- package/src/services/history.ts +22 -1
- package/src/services/keybinding.ts +3 -3
- package/src/services/ui.ts +26 -5
- package/src/theme/code-block.scss +0 -37
- package/src/theme/display-conds.scss +4 -0
- package/src/theme/event.scss +25 -33
- package/src/theme/floating-box.scss +9 -1
- package/src/theme/framework.scss +4 -1
- package/src/theme/layer-node-content.scss +14 -0
- package/src/theme/nav-menu.scss +5 -1
- package/src/theme/props-panel.scss +17 -3
- package/src/theme/scroll-bar.scss +64 -0
- package/src/theme/theme.scss +3 -0
- package/src/theme/themes/magic-admin/index.scss +109 -9
- package/src/theme/ui-select.scss +9 -0
- package/src/type.ts +216 -6
- package/src/utils/code-block.ts +1 -0
- package/src/utils/config.ts +9 -1
- package/src/utils/const.ts +3 -3
- package/src/utils/content-menu.ts +2 -2
- package/src/utils/data-source/index.ts +31 -12
- package/src/utils/dep/collect-worker-client.ts +215 -0
- package/src/utils/dep/idle-task.ts +104 -35
- package/src/utils/dep/worker.ts +113 -9
- package/src/utils/event.ts +237 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/monaco-editor.ts +27 -0
- package/src/utils/operator.ts +2 -2
- package/src/utils/props.ts +61 -122
- package/src/utils/type-match-rules.ts +697 -0
- package/types/headless.d.ts +17 -0
- package/types/index.d.ts +1494 -978
- package/src/fields/StyleSetter/icons/align-items/index copy.ts +0 -5
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<MContainer
|
|
3
|
-
|
|
3
|
+
v-for="item in formConfig"
|
|
4
|
+
:prop="prop"
|
|
5
|
+
:key="item.name"
|
|
6
|
+
:config="item"
|
|
4
7
|
:model="values"
|
|
5
8
|
:last-values="lastValues"
|
|
6
9
|
:is-compare="isCompare"
|
|
@@ -12,13 +15,12 @@
|
|
|
12
15
|
</template>
|
|
13
16
|
|
|
14
17
|
<script lang="ts" setup>
|
|
15
|
-
import {
|
|
18
|
+
import { computed } from 'vue';
|
|
16
19
|
|
|
17
|
-
import { type ContainerChangeEventData,
|
|
20
|
+
import { type ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
18
21
|
import type { StyleSchema } from '@tmagic/schema';
|
|
19
22
|
|
|
20
|
-
import
|
|
21
|
-
import { BackgroundNoRepeat, BackgroundRepeat, BackgroundRepeatX, BackgroundRepeatY } from '../icons/background-repeat';
|
|
23
|
+
import { createBackgroundConfig } from '../configs';
|
|
22
24
|
|
|
23
25
|
defineProps<{
|
|
24
26
|
values: Partial<StyleSchema>;
|
|
@@ -27,6 +29,7 @@ defineProps<{
|
|
|
27
29
|
disabled?: boolean;
|
|
28
30
|
size?: 'large' | 'default' | 'small';
|
|
29
31
|
theme?: string;
|
|
32
|
+
prop?: string;
|
|
30
33
|
}>();
|
|
31
34
|
|
|
32
35
|
const emit = defineEmits<{
|
|
@@ -34,65 +37,7 @@ const emit = defineEmits<{
|
|
|
34
37
|
addDiffCount: [];
|
|
35
38
|
}>();
|
|
36
39
|
|
|
37
|
-
const
|
|
38
|
-
items: [
|
|
39
|
-
{
|
|
40
|
-
name: 'backgroundColor',
|
|
41
|
-
text: '背景色',
|
|
42
|
-
labelWidth: '68px',
|
|
43
|
-
type: 'data-source-field-select',
|
|
44
|
-
fieldConfig: {
|
|
45
|
-
type: 'colorPicker',
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: 'backgroundImage',
|
|
50
|
-
text: '背景图',
|
|
51
|
-
labelWidth: '68px',
|
|
52
|
-
type: 'data-source-field-select',
|
|
53
|
-
fieldConfig: {
|
|
54
|
-
type: 'img-upload',
|
|
55
|
-
} as any,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'backgroundSize',
|
|
59
|
-
text: '背景尺寸',
|
|
60
|
-
type: 'radioGroup',
|
|
61
|
-
childType: 'default',
|
|
62
|
-
labelWidth: '68px',
|
|
63
|
-
options: [
|
|
64
|
-
{ value: 'auto', text: '默认', tooltip: '默认 auto' },
|
|
65
|
-
{ value: 'contain', text: '等比填充', tooltip: '等比填充 contain' },
|
|
66
|
-
{ value: 'cover', text: '等比覆盖', tooltip: '等比覆盖 cover' },
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'backgroundRepeat',
|
|
71
|
-
text: '重复显示',
|
|
72
|
-
type: 'radioGroup',
|
|
73
|
-
childType: 'button',
|
|
74
|
-
labelWidth: '68px',
|
|
75
|
-
options: [
|
|
76
|
-
{
|
|
77
|
-
value: 'repeat',
|
|
78
|
-
icon: markRaw(BackgroundRepeat),
|
|
79
|
-
tooltip: '垂直和水平方向重复 repeat',
|
|
80
|
-
text: '垂直与水平重复',
|
|
81
|
-
},
|
|
82
|
-
{ value: 'repeat-x', icon: markRaw(BackgroundRepeatX), tooltip: '水平方向重复 repeat-x', text: '水平方向重复' },
|
|
83
|
-
{ value: 'repeat-y', icon: markRaw(BackgroundRepeatY), tooltip: '垂直方向重复 repeat-y', text: '垂直方向重复' },
|
|
84
|
-
{ value: 'no-repeat', icon: markRaw(BackgroundNoRepeat), tooltip: '不重复 no-repeat', text: '不重复' },
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'backgroundPosition',
|
|
89
|
-
text: '背景定位',
|
|
90
|
-
type: 'component',
|
|
91
|
-
component: BackgroundPosition,
|
|
92
|
-
labelWidth: '68px',
|
|
93
|
-
},
|
|
94
|
-
],
|
|
95
|
-
});
|
|
40
|
+
const formConfig = computed(() => createBackgroundConfig());
|
|
96
41
|
|
|
97
42
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
98
43
|
emit('change', value, eventData);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<MContainer
|
|
3
|
-
:
|
|
3
|
+
:prop="prop"
|
|
4
|
+
:config="borderRadiusConfig"
|
|
4
5
|
:model="values"
|
|
5
6
|
:last-values="lastValues"
|
|
6
7
|
:is-compare="isCompare"
|
|
@@ -21,10 +22,11 @@
|
|
|
21
22
|
</template>
|
|
22
23
|
|
|
23
24
|
<script lang="ts" setup>
|
|
24
|
-
import { type ContainerChangeEventData,
|
|
25
|
+
import { type ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
25
26
|
import type { StyleSchema } from '@tmagic/schema';
|
|
26
27
|
|
|
27
28
|
import Border from '../components/Border.vue';
|
|
29
|
+
import { borderRadiusConfig } from '../configs';
|
|
28
30
|
|
|
29
31
|
defineProps<{
|
|
30
32
|
values: Partial<StyleSchema>;
|
|
@@ -32,6 +34,7 @@ defineProps<{
|
|
|
32
34
|
isCompare?: boolean;
|
|
33
35
|
disabled?: boolean;
|
|
34
36
|
size?: 'large' | 'default' | 'small';
|
|
37
|
+
prop?: string;
|
|
35
38
|
}>();
|
|
36
39
|
|
|
37
40
|
const emit = defineEmits<{
|
|
@@ -39,20 +42,6 @@ const emit = defineEmits<{
|
|
|
39
42
|
addDiffCount: [];
|
|
40
43
|
}>();
|
|
41
44
|
|
|
42
|
-
const config = defineFormItem({
|
|
43
|
-
items: [
|
|
44
|
-
{
|
|
45
|
-
labelWidth: '68px',
|
|
46
|
-
name: 'borderRadius',
|
|
47
|
-
text: '圆角',
|
|
48
|
-
type: 'data-source-field-select',
|
|
49
|
-
fieldConfig: {
|
|
50
|
-
type: 'text',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
});
|
|
55
|
-
|
|
56
45
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
57
46
|
emit('change', value, eventData);
|
|
58
47
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<MContainer
|
|
3
|
-
|
|
3
|
+
v-for="(item, index) in formConfig"
|
|
4
|
+
:prop="prop"
|
|
5
|
+
:key="index"
|
|
6
|
+
:config="item"
|
|
4
7
|
:model="values"
|
|
5
8
|
:last-values="lastValues"
|
|
6
9
|
:is-compare="isCompare"
|
|
@@ -12,12 +15,14 @@
|
|
|
12
15
|
</template>
|
|
13
16
|
|
|
14
17
|
<script lang="ts" setup>
|
|
15
|
-
import {
|
|
18
|
+
import { computed } from 'vue';
|
|
16
19
|
|
|
17
|
-
import { type ContainerChangeEventData,
|
|
20
|
+
import { type ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
18
21
|
import type { StyleSchema } from '@tmagic/schema';
|
|
19
22
|
|
|
20
|
-
import {
|
|
23
|
+
import { validateDataSourceFieldSelect } from '@editor/utils/type-match-rules';
|
|
24
|
+
|
|
25
|
+
import { createFontConfig } from '../configs';
|
|
21
26
|
|
|
22
27
|
defineProps<{
|
|
23
28
|
values: Partial<StyleSchema>;
|
|
@@ -25,6 +30,7 @@ defineProps<{
|
|
|
25
30
|
isCompare?: boolean;
|
|
26
31
|
disabled?: boolean;
|
|
27
32
|
size?: 'large' | 'default' | 'small';
|
|
33
|
+
prop?: string;
|
|
28
34
|
}>();
|
|
29
35
|
|
|
30
36
|
const emit = defineEmits<{
|
|
@@ -32,73 +38,7 @@ const emit = defineEmits<{
|
|
|
32
38
|
addDiffCount: [];
|
|
33
39
|
}>();
|
|
34
40
|
|
|
35
|
-
const
|
|
36
|
-
items: [
|
|
37
|
-
{
|
|
38
|
-
type: 'row',
|
|
39
|
-
items: [
|
|
40
|
-
{
|
|
41
|
-
labelWidth: '68px',
|
|
42
|
-
name: 'fontSize',
|
|
43
|
-
text: '字号',
|
|
44
|
-
type: 'data-source-field-select',
|
|
45
|
-
fieldConfig: {
|
|
46
|
-
type: 'text',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
labelWidth: '68px',
|
|
51
|
-
name: 'lineHeight',
|
|
52
|
-
text: '行高',
|
|
53
|
-
type: 'data-source-field-select',
|
|
54
|
-
fieldConfig: {
|
|
55
|
-
type: 'text',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'fontWeight',
|
|
62
|
-
text: '字重',
|
|
63
|
-
labelWidth: '68px',
|
|
64
|
-
type: 'data-source-field-select',
|
|
65
|
-
fieldConfig: {
|
|
66
|
-
type: 'select',
|
|
67
|
-
options: ['normal', 'bold']
|
|
68
|
-
.concat(
|
|
69
|
-
Array(7)
|
|
70
|
-
.fill(1)
|
|
71
|
-
.map((x, i) => `${i + 1}00`),
|
|
72
|
-
)
|
|
73
|
-
.map((item) => ({
|
|
74
|
-
value: item,
|
|
75
|
-
text: item,
|
|
76
|
-
})),
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
labelWidth: '68px',
|
|
81
|
-
name: 'color',
|
|
82
|
-
text: '颜色',
|
|
83
|
-
type: 'data-source-field-select',
|
|
84
|
-
fieldConfig: {
|
|
85
|
-
type: 'colorPicker',
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: 'textAlign',
|
|
90
|
-
text: '对齐',
|
|
91
|
-
type: 'radioGroup',
|
|
92
|
-
childType: 'button',
|
|
93
|
-
labelWidth: '68px',
|
|
94
|
-
options: [
|
|
95
|
-
{ value: 'left', icon: markRaw(AlignLeft), tooltip: '左对齐 row', text: '左对齐' },
|
|
96
|
-
{ value: 'center', icon: markRaw(AlignCenter), tooltip: '居中对齐 center', text: '居中对齐' },
|
|
97
|
-
{ value: 'right', icon: markRaw(AlignRight), tooltip: '右对齐 right', text: '右对齐' },
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
],
|
|
101
|
-
});
|
|
41
|
+
const formConfig = computed(() => createFontConfig(validateDataSourceFieldSelect));
|
|
102
42
|
|
|
103
43
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
104
44
|
emit('change', value, eventData);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<MContainer
|
|
3
|
-
|
|
3
|
+
v-for="item in formConfig"
|
|
4
|
+
:prop="prop"
|
|
5
|
+
:key="item.name"
|
|
6
|
+
:config="item"
|
|
4
7
|
:model="values"
|
|
5
8
|
:last-values="lastValues"
|
|
6
9
|
:is-compare="isCompare"
|
|
@@ -21,35 +24,15 @@
|
|
|
21
24
|
</template>
|
|
22
25
|
|
|
23
26
|
<script lang="ts" setup>
|
|
24
|
-
import {
|
|
27
|
+
import { computed } from 'vue';
|
|
25
28
|
|
|
26
29
|
import { useTheme } from '@tmagic/design';
|
|
27
|
-
import type {
|
|
28
|
-
import {
|
|
30
|
+
import type { ContainerChangeEventData } from '@tmagic/form';
|
|
31
|
+
import { MContainer } from '@tmagic/form';
|
|
29
32
|
import type { StyleSchema } from '@tmagic/schema';
|
|
30
33
|
|
|
31
34
|
import Box from '../components/Box.vue';
|
|
32
|
-
import {
|
|
33
|
-
AlignItemsCenter,
|
|
34
|
-
AlignItemsFlexEnd,
|
|
35
|
-
AlignItemsFlexStart,
|
|
36
|
-
AlignItemsSpaceAround,
|
|
37
|
-
AlignItemsSpaceBetween,
|
|
38
|
-
} from '../icons/align-items';
|
|
39
|
-
import { DisplayBlock, DisplayFlex, DisplayInline, DisplayInlineBlock, DisplayNone } from '../icons/display';
|
|
40
|
-
import {
|
|
41
|
-
FlexDirectionColumn,
|
|
42
|
-
FlexDirectionColumnReverse,
|
|
43
|
-
FlexDirectionRow,
|
|
44
|
-
FlexDirectionRowReverse,
|
|
45
|
-
} from '../icons/flex-direction';
|
|
46
|
-
import {
|
|
47
|
-
JustifyContentCenter,
|
|
48
|
-
JustifyContentFlexEnd,
|
|
49
|
-
JustifyContentFlexStart,
|
|
50
|
-
JustifyContentSpaceAround,
|
|
51
|
-
JustifyContentSpaceBetween,
|
|
52
|
-
} from '../icons/justify-content';
|
|
35
|
+
import { createLayoutConfig } from '../configs';
|
|
53
36
|
|
|
54
37
|
const props = defineProps<{
|
|
55
38
|
values: Partial<StyleSchema>;
|
|
@@ -58,6 +41,7 @@ const props = defineProps<{
|
|
|
58
41
|
disabled?: boolean;
|
|
59
42
|
size?: 'large' | 'default' | 'small';
|
|
60
43
|
theme?: string;
|
|
44
|
+
prop?: string;
|
|
61
45
|
}>();
|
|
62
46
|
|
|
63
47
|
const emit = defineEmits<{
|
|
@@ -67,211 +51,7 @@ const emit = defineEmits<{
|
|
|
67
51
|
|
|
68
52
|
const displayTheme = useTheme(props);
|
|
69
53
|
|
|
70
|
-
const
|
|
71
|
-
items: [
|
|
72
|
-
{
|
|
73
|
-
name: 'display',
|
|
74
|
-
text: '模式',
|
|
75
|
-
type: 'radioGroup',
|
|
76
|
-
childType: displayTheme.value !== 'magic-admin' ? 'button' : 'default',
|
|
77
|
-
labelWidth: '68px',
|
|
78
|
-
options: [
|
|
79
|
-
{
|
|
80
|
-
value: 'inline',
|
|
81
|
-
icon: displayTheme.value !== 'magic-admin' ? markRaw(DisplayInline) : undefined,
|
|
82
|
-
tooltip: '内联布局 inline',
|
|
83
|
-
text: '内联布局\n inline',
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
value: 'flex',
|
|
87
|
-
icon: displayTheme.value !== 'magic-admin' ? markRaw(DisplayFlex) : undefined,
|
|
88
|
-
tooltip: '弹性布局 flex',
|
|
89
|
-
text: '弹性布局\n flex',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
value: 'block',
|
|
93
|
-
icon: displayTheme.value !== 'magic-admin' ? markRaw(DisplayBlock) : undefined,
|
|
94
|
-
tooltip: '块级布局 block',
|
|
95
|
-
text: '块级布局\n block',
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
value: 'inline-block',
|
|
99
|
-
icon: displayTheme.value !== 'magic-admin' ? markRaw(DisplayInlineBlock) : undefined,
|
|
100
|
-
tooltip: '内联块布局 inline-block',
|
|
101
|
-
text: '内联块布局\n inline-block',
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
value: 'none',
|
|
105
|
-
icon: displayTheme.value !== 'magic-admin' ? markRaw(DisplayNone) : undefined,
|
|
106
|
-
tooltip: '隐藏 none',
|
|
107
|
-
text: '隐藏\n none',
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: 'flexDirection',
|
|
113
|
-
text: '主轴方向',
|
|
114
|
-
type: 'radioGroup',
|
|
115
|
-
childType: 'button',
|
|
116
|
-
labelWidth: '68px',
|
|
117
|
-
options: [
|
|
118
|
-
{ value: 'row', icon: markRaw(FlexDirectionRow), tooltip: '水平方向 起点在左侧 row', text: '左起点' },
|
|
119
|
-
{
|
|
120
|
-
value: 'row-reverse',
|
|
121
|
-
icon: markRaw(FlexDirectionRowReverse),
|
|
122
|
-
tooltip: '水平方向 起点在右侧 row-reverse',
|
|
123
|
-
text: '右起点',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
value: 'column',
|
|
127
|
-
icon: markRaw(FlexDirectionColumn),
|
|
128
|
-
tooltip: '垂直方向 起点在上沿 column',
|
|
129
|
-
text: '顶部起点',
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
value: 'column-reverse',
|
|
133
|
-
icon: markRaw(FlexDirectionColumnReverse),
|
|
134
|
-
tooltip: '垂直方向 起点在下沿 column-reverse',
|
|
135
|
-
text: '底部起点',
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: 'justifyContent',
|
|
142
|
-
text: '主轴对齐',
|
|
143
|
-
type: 'radioGroup',
|
|
144
|
-
childType: 'button',
|
|
145
|
-
labelWidth: '68px',
|
|
146
|
-
options: [
|
|
147
|
-
{ value: 'flex-start', icon: markRaw(JustifyContentFlexStart), tooltip: '左对齐 flex-start', text: '左对齐' },
|
|
148
|
-
{ value: 'flex-end', icon: markRaw(JustifyContentFlexEnd), tooltip: '右对齐 flex-end', text: '右对齐' },
|
|
149
|
-
{ value: 'center', icon: markRaw(JustifyContentCenter), tooltip: '居中 center', text: '居中' },
|
|
150
|
-
{
|
|
151
|
-
value: 'space-between',
|
|
152
|
-
icon: markRaw(JustifyContentSpaceBetween),
|
|
153
|
-
tooltip: '两端对齐 space-between',
|
|
154
|
-
text: '左右对齐',
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
value: 'space-around',
|
|
158
|
-
icon: markRaw(JustifyContentSpaceAround),
|
|
159
|
-
tooltip: '横向平分 space-around',
|
|
160
|
-
text: '横向等分',
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: 'alignItems',
|
|
167
|
-
text: '辅轴对齐',
|
|
168
|
-
type: 'radioGroup',
|
|
169
|
-
childType: 'button',
|
|
170
|
-
labelWidth: '68px',
|
|
171
|
-
options: [
|
|
172
|
-
{ value: 'flex-start', icon: markRaw(AlignItemsFlexStart), tooltip: '左对齐 flex-start', text: '上对齐' },
|
|
173
|
-
{ value: 'flex-end', icon: markRaw(AlignItemsFlexEnd), tooltip: '右对齐 flex-end', text: '下对齐' },
|
|
174
|
-
{ value: 'center', icon: markRaw(AlignItemsCenter), tooltip: '居中 center', text: '居中' },
|
|
175
|
-
{
|
|
176
|
-
value: 'space-between',
|
|
177
|
-
icon: markRaw(AlignItemsSpaceBetween),
|
|
178
|
-
tooltip: '两端对齐 space-between',
|
|
179
|
-
text: '上下对齐',
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
value: 'space-around',
|
|
183
|
-
icon: markRaw(AlignItemsSpaceAround),
|
|
184
|
-
tooltip: '横向平分 space-around',
|
|
185
|
-
text: '纵向等分',
|
|
186
|
-
},
|
|
187
|
-
],
|
|
188
|
-
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: 'flexWrap',
|
|
192
|
-
text: '换行',
|
|
193
|
-
type: 'radioGroup',
|
|
194
|
-
childType: displayTheme.value !== 'magic-admin' ? 'button' : 'default',
|
|
195
|
-
labelWidth: '68px',
|
|
196
|
-
options: [
|
|
197
|
-
{ value: 'nowrap', text: '不换行', tooltip: '不换行 nowrap' },
|
|
198
|
-
{ value: 'wrap', text: '正换行', tooltip: '第一行在上方 wrap' },
|
|
199
|
-
{ value: 'wrap-reverse', text: '逆换行', tooltip: '第一行在下方 wrap-reverse' },
|
|
200
|
-
],
|
|
201
|
-
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
type: 'row',
|
|
205
|
-
items: [
|
|
206
|
-
{
|
|
207
|
-
name: 'width',
|
|
208
|
-
text: '宽度(px)',
|
|
209
|
-
labelWidth: '90px',
|
|
210
|
-
type: 'data-source-field-select',
|
|
211
|
-
fieldConfig: {
|
|
212
|
-
type: 'text',
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
],
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
type: 'row',
|
|
219
|
-
items: [
|
|
220
|
-
{
|
|
221
|
-
name: 'height',
|
|
222
|
-
text: '高度(px)',
|
|
223
|
-
labelWidth: '90px',
|
|
224
|
-
type: 'data-source-field-select',
|
|
225
|
-
fieldConfig: {
|
|
226
|
-
type: 'text',
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
],
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
type: 'row',
|
|
233
|
-
items: [
|
|
234
|
-
{
|
|
235
|
-
type: 'data-source-field-select',
|
|
236
|
-
text: 'overflow',
|
|
237
|
-
name: 'overflow',
|
|
238
|
-
labelWidth: '90px',
|
|
239
|
-
checkStrictly: false,
|
|
240
|
-
dataSourceFieldType: ['string'],
|
|
241
|
-
fieldConfig: {
|
|
242
|
-
type: 'select',
|
|
243
|
-
clearable: true,
|
|
244
|
-
allowCreate: true,
|
|
245
|
-
options: [
|
|
246
|
-
{ text: 'visible', value: 'visible' },
|
|
247
|
-
{ text: 'hidden', value: 'hidden' },
|
|
248
|
-
{ text: 'clip', value: 'clip' },
|
|
249
|
-
{ text: 'scroll', value: 'scroll' },
|
|
250
|
-
{ text: 'auto', value: 'auto' },
|
|
251
|
-
{ text: 'overlay', value: 'overlay' },
|
|
252
|
-
{ text: 'initial', value: 'initial' },
|
|
253
|
-
],
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
],
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
type: 'row',
|
|
260
|
-
items: [
|
|
261
|
-
{
|
|
262
|
-
type: 'data-source-field-select',
|
|
263
|
-
text: '透明度(%)',
|
|
264
|
-
name: 'opacity',
|
|
265
|
-
labelWidth: '90px',
|
|
266
|
-
dataSourceFieldType: ['string', 'number'],
|
|
267
|
-
fieldConfig: {
|
|
268
|
-
type: 'text',
|
|
269
|
-
},
|
|
270
|
-
},
|
|
271
|
-
],
|
|
272
|
-
},
|
|
273
|
-
],
|
|
274
|
-
}) as ChildConfig;
|
|
54
|
+
const formConfig = computed(() => createLayoutConfig(displayTheme.value));
|
|
275
55
|
|
|
276
56
|
const change = (value: string | StyleSchema, eventData: ContainerChangeEventData) => {
|
|
277
57
|
emit('change', value, eventData);
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<MContainer
|
|
3
|
-
|
|
3
|
+
v-for="(item, index) in formConfig"
|
|
4
|
+
:prop="prop"
|
|
5
|
+
:key="index"
|
|
6
|
+
:config="item"
|
|
4
7
|
:model="values"
|
|
5
8
|
:last-values="lastValues"
|
|
6
9
|
:is-compare="isCompare"
|
|
@@ -12,15 +15,20 @@
|
|
|
12
15
|
</template>
|
|
13
16
|
|
|
14
17
|
<script lang="ts" setup>
|
|
15
|
-
import {
|
|
18
|
+
import { computed } from 'vue';
|
|
19
|
+
|
|
20
|
+
import { type ContainerChangeEventData, MContainer } from '@tmagic/form';
|
|
16
21
|
import type { StyleSchema } from '@tmagic/schema';
|
|
17
22
|
|
|
23
|
+
import { createPositionConfig } from '../configs';
|
|
24
|
+
|
|
18
25
|
const props = defineProps<{
|
|
19
26
|
values: Partial<StyleSchema>;
|
|
20
27
|
lastValues?: Partial<StyleSchema>;
|
|
21
28
|
isCompare?: boolean;
|
|
22
29
|
disabled?: boolean;
|
|
23
30
|
size?: 'large' | 'default' | 'small';
|
|
31
|
+
prop?: string;
|
|
24
32
|
}>();
|
|
25
33
|
|
|
26
34
|
const emit = defineEmits<{
|
|
@@ -28,86 +36,7 @@ const emit = defineEmits<{
|
|
|
28
36
|
addDiffCount: [];
|
|
29
37
|
}>();
|
|
30
38
|
|
|
31
|
-
const
|
|
32
|
-
static: '不定位',
|
|
33
|
-
relative: '相对定位',
|
|
34
|
-
absolute: '绝对定位',
|
|
35
|
-
fixed: '固定定位',
|
|
36
|
-
sticky: '粘性定位',
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const config = defineFormItem({
|
|
40
|
-
items: [
|
|
41
|
-
{
|
|
42
|
-
name: 'position',
|
|
43
|
-
text: '定位',
|
|
44
|
-
labelWidth: '68px',
|
|
45
|
-
type: 'data-source-field-select',
|
|
46
|
-
fieldConfig: {
|
|
47
|
-
type: 'select',
|
|
48
|
-
options: Object.keys(positionText).map((item) => ({
|
|
49
|
-
value: item,
|
|
50
|
-
text: `${item}(${positionText[item]})`,
|
|
51
|
-
})),
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: 'row',
|
|
56
|
-
labelWidth: '68px',
|
|
57
|
-
display: () => props.values.position !== 'static',
|
|
58
|
-
items: [
|
|
59
|
-
{
|
|
60
|
-
name: 'left',
|
|
61
|
-
type: 'data-source-field-select',
|
|
62
|
-
text: 'left',
|
|
63
|
-
fieldConfig: {
|
|
64
|
-
type: 'text',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'top',
|
|
69
|
-
type: 'data-source-field-select',
|
|
70
|
-
text: 'top',
|
|
71
|
-
fieldConfig: {
|
|
72
|
-
type: 'text',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
type: 'row',
|
|
79
|
-
labelWidth: '68px',
|
|
80
|
-
display: () => props.values.position !== 'static',
|
|
81
|
-
items: [
|
|
82
|
-
{
|
|
83
|
-
name: 'right',
|
|
84
|
-
type: 'data-source-field-select',
|
|
85
|
-
text: 'right',
|
|
86
|
-
fieldConfig: {
|
|
87
|
-
type: 'text',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'bottom',
|
|
92
|
-
type: 'data-source-field-select',
|
|
93
|
-
text: 'bottom',
|
|
94
|
-
fieldConfig: {
|
|
95
|
-
type: 'text',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
labelWidth: '68px',
|
|
102
|
-
name: 'zIndex',
|
|
103
|
-
text: 'zIndex',
|
|
104
|
-
type: 'data-source-field-select',
|
|
105
|
-
fieldConfig: {
|
|
106
|
-
type: 'text',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
});
|
|
39
|
+
const formConfig = computed(() => createPositionConfig(props.values));
|
|
111
40
|
|
|
112
41
|
const change = (value: string | StyleSchema, eventData: ContainerChangeEventData) => {
|
|
113
42
|
emit('change', value, eventData);
|