@tmagic/editor 1.8.0-beta.2 → 1.8.0-beta.21
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 +43 -9
- package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/es/components/CodeParams.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +22 -98
- package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +32 -9
- package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +68 -17
- 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 +1 -1
- package/dist/es/components/ScrollBar.js +0 -1
- package/dist/es/components/ScrollBar.vue_vue_type_script_setup_true_lang.js +1 -1
- 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 +7 -7
- 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 +58 -0
- package/dist/es/editorProps.js +9 -1
- package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +16 -5
- package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +81 -44
- package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +10 -3
- 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 +13 -6
- package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +11 -8
- package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +39 -12
- package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +11 -20
- package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +11 -6
- package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +30 -14
- package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +11 -4
- package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +38 -6
- package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +156 -155
- package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +8 -10
- package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +28 -6
- package/dist/es/fields/StyleSetter/components/Box.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 +7 -7
- package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +6 -3
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +29 -6
- package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +32 -6
- 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 +11 -3
- package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +11 -3
- package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +11 -3
- package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +11 -3
- package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +17 -3
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +19 -3
- package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +19 -3
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +37 -3
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +33 -3
- 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 +56 -30
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +35 -26
- package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +76 -48
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +29 -23
- package/dist/es/fields/StyleSetter/pro/Transform.vue_vue_type_script_setup_true_lang.js +7 -4
- package/dist/es/fields/UISelect.js +0 -1
- package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +5 -2
- package/dist/es/hooks/use-code-block-edit.js +6 -3
- package/dist/es/hooks/use-compare-form.js +119 -0
- package/dist/es/hooks/use-data-source-edit.js +5 -2
- package/dist/es/hooks/use-stage.js +9 -4
- 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 +17 -0
- package/dist/es/icons/FolderMinusIcon.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/es/index.js +24 -10
- package/dist/es/initService.js +19 -13
- 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 +24 -12
- package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +25 -18
- package/dist/es/layouts/NavMenu.vue_vue_type_script_setup_true_lang.js +4 -4
- 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 +25 -38
- package/dist/es/layouts/history-list/BucketTab.js +5 -0
- package/dist/es/layouts/history-list/BucketTab.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/es/layouts/history-list/GroupRow.vue_vue_type_script_setup_true_lang.js +177 -88
- package/dist/es/layouts/history-list/HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js +139 -37
- package/dist/es/layouts/history-list/HistoryListPanel.vue_vue_type_script_setup_true_lang.js +164 -107
- package/dist/es/layouts/history-list/InitialRow.vue_vue_type_script_setup_true_lang.js +44 -9
- package/dist/es/layouts/history-list/PageTab.vue_vue_type_script_setup_true_lang.js +49 -53
- package/dist/es/layouts/history-list/composables.js +138 -108
- package/dist/es/layouts/history-list/useHistoryList.js +56 -0
- package/dist/es/layouts/history-list/useHistoryRevert.js +317 -0
- 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 +5 -3
- 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 -7
- package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +33 -13
- 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 +26 -38
- package/dist/es/layouts/sidebar/code-block/CodeBlockList.vue_vue_type_script_setup_true_lang.js +4 -4
- 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 +23 -6
- 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 +27 -5
- 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 +8 -8
- 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 +2 -2
- package/dist/es/layouts/sidebar/layer/LayerPanel.vue_vue_type_script_setup_true_lang.js +3 -2
- package/dist/es/layouts/sidebar/layer/use-click.js +3 -3
- 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 +2 -2
- 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 +16 -16
- package/dist/es/plugin.js +5 -2
- package/dist/es/services/codeBlock.js +137 -56
- package/dist/es/services/dataSource.js +122 -52
- package/dist/es/services/dep.js +162 -41
- package/dist/es/services/editor.js +613 -179
- package/dist/es/services/events.js +2 -2
- package/dist/es/services/history.js +350 -386
- package/dist/es/services/keybinding.js +6 -6
- package/dist/es/services/props.js +3 -2
- package/dist/es/services/storage.js +2 -2
- package/dist/es/services/ui.js +10 -2
- package/dist/es/style.css +549 -113
- package/dist/es/utils/config.js +4 -1
- package/dist/es/utils/const.js +2 -2
- package/dist/es/utils/content-menu.js +19 -11
- package/dist/es/utils/data-source/index.js +34 -11
- package/dist/es/utils/dep/collect-worker-client.js +114 -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 +103 -49
- package/dist/es/utils/event.js +135 -0
- package/dist/es/utils/history.js +220 -0
- package/dist/es/utils/indexed-db.js +86 -0
- package/dist/es/utils/monaco-editor.js +22 -6
- package/dist/es/utils/operator.js +2 -2
- package/dist/es/utils/props.js +114 -33
- package/dist/es/utils/type-match-rules.js +367 -0
- package/dist/es/utils/undo-redo.js +60 -1
- package/dist/style.css +549 -113
- package/dist/themes/magic-admin.css +3028 -0
- package/dist/tmagic-editor.umd.cjs +14403 -10121
- package/package.json +8 -8
- package/src/Editor.vue +43 -2
- package/src/components/CodeBlockEditor.vue +3 -0
- package/src/components/CompareForm.vue +18 -146
- package/src/components/ContentMenu.vue +44 -8
- package/src/components/FloatingBox.vue +84 -9
- package/src/components/ScrollBar.vue +0 -67
- package/src/components/ToolButton.vue +2 -2
- package/src/components/ViewForm.vue +55 -0
- package/src/editorProps.ts +30 -0
- package/src/fields/Code.vue +10 -2
- package/src/fields/CodeLink.vue +2 -5
- package/src/fields/CodeSelect.vue +54 -40
- package/src/fields/CodeSelectCol.vue +8 -1
- package/src/fields/CondOpSelect.vue +2 -24
- package/src/fields/DataSourceFieldSelect/FieldSelect.vue +16 -2
- package/src/fields/DataSourceFieldSelect/Index.vue +14 -5
- package/src/fields/DataSourceFields.vue +42 -8
- package/src/fields/DataSourceInput.vue +10 -28
- package/src/fields/DataSourceMethodSelect.vue +9 -4
- package/src/fields/DataSourceMethods.vue +42 -21
- package/src/fields/DataSourceMocks.vue +3 -0
- package/src/fields/DisplayConds.vue +18 -1
- package/src/fields/EventSelect.vue +152 -166
- package/src/fields/StyleSetter/Index.vue +3 -12
- package/src/fields/StyleSetter/components/Border.vue +15 -6
- 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 +99 -55
- package/src/fields/StyleSetter/pro/Border.vue +9 -11
- package/src/fields/StyleSetter/pro/Font.vue +66 -64
- package/src/fields/StyleSetter/pro/Layout.vue +211 -139
- package/src/fields/StyleSetter/pro/Position.vue +69 -67
- package/src/fields/StyleSetter/pro/Transform.vue +23 -25
- package/src/fields/UISelect.vue +0 -12
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-code-block-edit.ts +4 -3
- package/src/hooks/use-compare-form.ts +187 -0
- package/src/hooks/use-data-source-edit.ts +2 -2
- package/src/hooks/use-stage.ts +5 -3
- package/src/icons/DatasourceIcon.vue +7 -0
- package/src/index.ts +12 -0
- package/src/initService.ts +26 -16
- package/src/layouts/CodeEditor.vue +34 -11
- package/src/layouts/Framework.vue +15 -8
- package/src/layouts/NavMenu.vue +3 -3
- package/src/layouts/history-list/Bucket.vue +33 -41
- package/src/layouts/history-list/BucketTab.vue +72 -0
- package/src/layouts/history-list/GroupRow.vue +190 -93
- package/src/layouts/history-list/HistoryDiffDialog.vue +169 -90
- package/src/layouts/history-list/HistoryListPanel.vue +191 -95
- package/src/layouts/history-list/InitialRow.vue +38 -8
- package/src/layouts/history-list/PageTab.vue +67 -43
- package/src/layouts/history-list/composables.ts +239 -125
- package/src/layouts/history-list/useHistoryList.ts +60 -0
- package/src/layouts/history-list/useHistoryRevert.ts +425 -0
- package/src/layouts/page-bar/PageBar.vue +4 -2
- package/src/layouts/props-panel/FormPanel.vue +72 -6
- package/src/layouts/props-panel/PropsPanel.vue +62 -18
- package/src/layouts/props-panel/use-style-panel.ts +4 -3
- package/src/layouts/sidebar/ComponentListPanel.vue +10 -6
- package/src/layouts/sidebar/Sidebar.vue +13 -6
- package/src/layouts/sidebar/code-block/CodeBlockList.vue +5 -5
- 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 +34 -2
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +29 -4
- package/src/layouts/sidebar/data-source/useContentMenu.ts +14 -2
- package/src/layouts/sidebar/layer/LayerMenu.vue +21 -13
- package/src/layouts/sidebar/layer/LayerNodeContent.vue +57 -0
- package/src/layouts/sidebar/layer/LayerNodeTool.vue +7 -4
- package/src/layouts/sidebar/layer/LayerPanel.vue +4 -1
- 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 +1 -1
- package/src/layouts/workspace/viewer/ViewerMenu.vue +15 -15
- package/src/plugin.ts +6 -3
- package/src/services/codeBlock.ts +152 -47
- package/src/services/dataSource.ts +120 -41
- package/src/services/dep.ts +292 -47
- package/src/services/editor.ts +820 -224
- package/src/services/events.ts +3 -3
- package/src/services/history.ts +449 -412
- package/src/services/keybinding.ts +6 -6
- package/src/services/ui.ts +33 -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 +70 -1
- package/src/theme/floating-box.scss +9 -1
- package/src/theme/framework.scss +4 -1
- package/src/theme/history-list-panel.scss +157 -23
- package/src/theme/layer-node-content.scss +14 -0
- package/src/theme/nav-menu.scss +5 -1
- package/src/theme/page-bar.scss +0 -4
- package/src/theme/props-panel.scss +5 -4
- package/src/theme/scroll-bar.scss +64 -0
- package/src/theme/style-setter/border.scss +17 -5
- package/src/theme/theme.scss +4 -0
- package/src/theme/themes/magic-admin/index.scss +214 -0
- package/src/theme/ui-select.scss +9 -0
- package/src/type.ts +668 -124
- package/src/utils/config.ts +9 -1
- package/src/utils/const.ts +3 -2
- package/src/utils/content-menu.ts +20 -11
- package/src/utils/data-source/index.ts +32 -12
- package/src/utils/dep/collect-worker-client.ts +149 -0
- package/src/utils/dep/idle-task.ts +104 -35
- package/src/utils/dep/worker.ts +113 -9
- package/src/utils/editor.ts +166 -60
- package/src/utils/event.ts +237 -0
- package/src/utils/history.ts +286 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/indexed-db.ts +122 -0
- package/src/utils/monaco-editor.ts +27 -0
- package/src/utils/operator.ts +2 -2
- package/src/utils/props.ts +114 -11
- package/src/utils/type-match-rules.ts +684 -0
- package/src/utils/undo-redo.ts +88 -0
- package/types/index.d.ts +1990 -517
- package/dist/es/layouts/history-list/CodeBlockTab.js +0 -5
- package/dist/es/layouts/history-list/CodeBlockTab.vue_vue_type_script_setup_true_lang.js +0 -62
- package/dist/es/layouts/history-list/DataSourceTab.js +0 -5
- package/dist/es/layouts/history-list/DataSourceTab.vue_vue_type_script_setup_true_lang.js +0 -62
- package/src/layouts/history-list/CodeBlockTab.vue +0 -61
- package/src/layouts/history-list/DataSourceTab.vue +0 -61
|
@@ -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"
|
|
@@ -14,7 +17,7 @@
|
|
|
14
17
|
<script lang="ts" setup>
|
|
15
18
|
import { markRaw } from 'vue';
|
|
16
19
|
|
|
17
|
-
import { type ContainerChangeEventData,
|
|
20
|
+
import { type ContainerChangeEventData, defineFormConfig, MContainer } from '@tmagic/form';
|
|
18
21
|
import type { StyleSchema } from '@tmagic/schema';
|
|
19
22
|
|
|
20
23
|
import { AlignCenter, AlignLeft, AlignRight } from '../icons/text-align';
|
|
@@ -25,6 +28,7 @@ defineProps<{
|
|
|
25
28
|
isCompare?: boolean;
|
|
26
29
|
disabled?: boolean;
|
|
27
30
|
size?: 'large' | 'default' | 'small';
|
|
31
|
+
prop?: string;
|
|
28
32
|
}>();
|
|
29
33
|
|
|
30
34
|
const emit = defineEmits<{
|
|
@@ -32,73 +36,71 @@ const emit = defineEmits<{
|
|
|
32
36
|
addDiffCount: [];
|
|
33
37
|
}>();
|
|
34
38
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
type: 'text',
|
|
47
|
-
},
|
|
39
|
+
const formConfig = defineFormConfig([
|
|
40
|
+
{
|
|
41
|
+
type: 'row',
|
|
42
|
+
items: [
|
|
43
|
+
{
|
|
44
|
+
labelWidth: '68px',
|
|
45
|
+
name: 'fontSize',
|
|
46
|
+
text: '字号',
|
|
47
|
+
type: 'data-source-field-select',
|
|
48
|
+
fieldConfig: {
|
|
49
|
+
type: 'text',
|
|
48
50
|
},
|
|
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
51
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
52
|
+
{
|
|
53
|
+
labelWidth: '68px',
|
|
54
|
+
name: 'lineHeight',
|
|
55
|
+
text: '行高',
|
|
56
|
+
type: 'data-source-field-select',
|
|
57
|
+
fieldConfig: {
|
|
58
|
+
type: 'text',
|
|
59
|
+
},
|
|
86
60
|
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'fontWeight',
|
|
65
|
+
text: '字重',
|
|
66
|
+
labelWidth: '68px',
|
|
67
|
+
type: 'data-source-field-select',
|
|
68
|
+
fieldConfig: {
|
|
69
|
+
type: 'select',
|
|
70
|
+
options: ['normal', 'bold']
|
|
71
|
+
.concat(
|
|
72
|
+
Array(7)
|
|
73
|
+
.fill(1)
|
|
74
|
+
.map((x, i) => `${i + 1}00`),
|
|
75
|
+
)
|
|
76
|
+
.map((item) => ({
|
|
77
|
+
value: item,
|
|
78
|
+
text: item,
|
|
79
|
+
})),
|
|
87
80
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
{ value: 'center', icon: markRaw(AlignCenter), tooltip: '居中对齐 center' },
|
|
97
|
-
{ value: 'right', icon: markRaw(AlignRight), tooltip: '右对齐 right' },
|
|
98
|
-
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
labelWidth: '68px',
|
|
84
|
+
name: 'color',
|
|
85
|
+
text: '颜色',
|
|
86
|
+
type: 'data-source-field-select',
|
|
87
|
+
fieldConfig: {
|
|
88
|
+
type: 'colorPicker',
|
|
99
89
|
},
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
name: 'textAlign',
|
|
93
|
+
text: '对齐',
|
|
94
|
+
type: 'radioGroup',
|
|
95
|
+
childType: 'button',
|
|
96
|
+
labelWidth: '68px',
|
|
97
|
+
options: [
|
|
98
|
+
{ value: 'left', icon: markRaw(AlignLeft), tooltip: '左对齐 row', text: '左对齐' },
|
|
99
|
+
{ value: 'center', icon: markRaw(AlignCenter), tooltip: '居中对齐 center', text: '居中对齐' },
|
|
100
|
+
{ value: 'right', icon: markRaw(AlignRight), tooltip: '右对齐 right', text: '右对齐' },
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
]);
|
|
102
104
|
|
|
103
105
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
104
106
|
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"
|
|
@@ -23,11 +26,19 @@
|
|
|
23
26
|
<script lang="ts" setup>
|
|
24
27
|
import { markRaw } from 'vue';
|
|
25
28
|
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
29
|
+
import { useTheme } from '@tmagic/design';
|
|
30
|
+
import type { ContainerChangeEventData } from '@tmagic/form';
|
|
31
|
+
import { defineFormConfig, MContainer } from '@tmagic/form';
|
|
28
32
|
import type { StyleSchema } from '@tmagic/schema';
|
|
29
33
|
|
|
30
34
|
import Box from '../components/Box.vue';
|
|
35
|
+
import {
|
|
36
|
+
AlignItemsCenter,
|
|
37
|
+
AlignItemsFlexEnd,
|
|
38
|
+
AlignItemsFlexStart,
|
|
39
|
+
AlignItemsSpaceAround,
|
|
40
|
+
AlignItemsSpaceBetween,
|
|
41
|
+
} from '../icons/align-items';
|
|
31
42
|
import { DisplayBlock, DisplayFlex, DisplayInline, DisplayInlineBlock, DisplayNone } from '../icons/display';
|
|
32
43
|
import {
|
|
33
44
|
FlexDirectionColumn,
|
|
@@ -43,12 +54,14 @@ import {
|
|
|
43
54
|
JustifyContentSpaceBetween,
|
|
44
55
|
} from '../icons/justify-content';
|
|
45
56
|
|
|
46
|
-
defineProps<{
|
|
57
|
+
const props = defineProps<{
|
|
47
58
|
values: Partial<StyleSchema>;
|
|
48
59
|
lastValues?: Partial<StyleSchema>;
|
|
49
60
|
isCompare?: boolean;
|
|
50
61
|
disabled?: boolean;
|
|
51
62
|
size?: 'large' | 'default' | 'small';
|
|
63
|
+
theme?: string;
|
|
64
|
+
prop?: string;
|
|
52
65
|
}>();
|
|
53
66
|
|
|
54
67
|
const emit = defineEmits<{
|
|
@@ -56,145 +69,204 @@ const emit = defineEmits<{
|
|
|
56
69
|
addDiffCount: [];
|
|
57
70
|
}>();
|
|
58
71
|
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
72
|
+
const displayTheme = useTheme(props);
|
|
73
|
+
|
|
74
|
+
const formConfig = defineFormConfig([
|
|
75
|
+
{
|
|
76
|
+
name: 'display',
|
|
77
|
+
text: '模式',
|
|
78
|
+
type: 'radioGroup',
|
|
79
|
+
childType: 'button',
|
|
80
|
+
labelWidth: '90px',
|
|
81
|
+
iconSize: '24px',
|
|
82
|
+
options: [
|
|
83
|
+
{
|
|
84
|
+
value: 'inline',
|
|
85
|
+
icon: markRaw(DisplayInline),
|
|
86
|
+
tooltip: '内联布局 inline',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
value: 'flex',
|
|
90
|
+
icon: markRaw(DisplayFlex),
|
|
91
|
+
tooltip: '弹性布局 flex',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
value: 'block',
|
|
95
|
+
icon: markRaw(DisplayBlock),
|
|
96
|
+
tooltip: '块级布局 block',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
value: 'inline-block',
|
|
100
|
+
icon: markRaw(DisplayInlineBlock),
|
|
101
|
+
tooltip: '内联块布局 inline-block',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
value: 'none',
|
|
105
|
+
icon: markRaw(DisplayNone),
|
|
106
|
+
tooltip: '隐藏 none',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'flexDirection',
|
|
112
|
+
text: '主轴方向',
|
|
113
|
+
type: 'radioGroup',
|
|
114
|
+
childType: 'button',
|
|
115
|
+
labelWidth: '90px',
|
|
116
|
+
iconSize: '24px',
|
|
117
|
+
options: [
|
|
118
|
+
{ value: 'row', icon: markRaw(FlexDirectionRow), tooltip: '水平方向 起点在左侧 row' },
|
|
119
|
+
{
|
|
120
|
+
value: 'row-reverse',
|
|
121
|
+
icon: markRaw(FlexDirectionRowReverse),
|
|
122
|
+
tooltip: '水平方向 起点在右侧 row-reverse',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
value: 'column',
|
|
126
|
+
icon: markRaw(FlexDirectionColumn),
|
|
127
|
+
tooltip: '垂直方向 起点在上沿 column',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
value: 'column-reverse',
|
|
131
|
+
icon: markRaw(FlexDirectionColumnReverse),
|
|
132
|
+
tooltip: '垂直方向 起点在下沿 column-reverse',
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: 'justifyContent',
|
|
139
|
+
text: '主轴对齐',
|
|
140
|
+
type: 'radioGroup',
|
|
141
|
+
childType: 'button',
|
|
142
|
+
labelWidth: '90px',
|
|
143
|
+
iconSize: '24px',
|
|
144
|
+
options: [
|
|
145
|
+
{ value: 'flex-start', icon: markRaw(JustifyContentFlexStart), tooltip: '左对齐 flex-start' },
|
|
146
|
+
{ value: 'flex-end', icon: markRaw(JustifyContentFlexEnd), tooltip: '右对齐 flex-end' },
|
|
147
|
+
{ value: 'center', icon: markRaw(JustifyContentCenter), tooltip: '居中 center' },
|
|
148
|
+
{
|
|
149
|
+
value: 'space-between',
|
|
150
|
+
icon: markRaw(JustifyContentSpaceBetween),
|
|
151
|
+
tooltip: '两端对齐 space-between',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
value: 'space-around',
|
|
155
|
+
icon: markRaw(JustifyContentSpaceAround),
|
|
156
|
+
tooltip: '横向平分 space-around',
|
|
157
|
+
},
|
|
158
|
+
],
|
|
159
|
+
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'alignItems',
|
|
163
|
+
text: '辅轴对齐',
|
|
164
|
+
type: 'radioGroup',
|
|
165
|
+
childType: 'button',
|
|
166
|
+
labelWidth: '90px',
|
|
167
|
+
iconSize: '24px',
|
|
168
|
+
options: [
|
|
169
|
+
{ value: 'flex-start', icon: markRaw(AlignItemsFlexStart), tooltip: '左对齐 flex-start' },
|
|
170
|
+
{ value: 'flex-end', icon: markRaw(AlignItemsFlexEnd), tooltip: '右对齐 flex-end' },
|
|
171
|
+
{ value: 'center', icon: markRaw(AlignItemsCenter), tooltip: '居中 center' },
|
|
172
|
+
{
|
|
173
|
+
value: 'space-between',
|
|
174
|
+
icon: markRaw(AlignItemsSpaceBetween),
|
|
175
|
+
tooltip: '两端对齐 space-between',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
value: 'space-around',
|
|
179
|
+
icon: markRaw(AlignItemsSpaceAround),
|
|
180
|
+
tooltip: '横向平分 space-around',
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'flexWrap',
|
|
187
|
+
text: '换行',
|
|
188
|
+
type: 'radioGroup',
|
|
189
|
+
childType: displayTheme.value !== 'magic-admin' ? 'button' : 'default',
|
|
190
|
+
labelWidth: '90px',
|
|
191
|
+
iconSize: '24px',
|
|
192
|
+
options: [
|
|
193
|
+
{ value: 'nowrap', text: '不换行', tooltip: '不换行 nowrap' },
|
|
194
|
+
{ value: 'wrap', text: '正换行', tooltip: '第一行在上方 wrap' },
|
|
195
|
+
{ value: 'wrap-reverse', text: '逆换行', tooltip: '第一行在下方 wrap-reverse' },
|
|
196
|
+
],
|
|
197
|
+
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
type: 'row',
|
|
201
|
+
items: [
|
|
202
|
+
{
|
|
203
|
+
name: 'width',
|
|
204
|
+
text: '宽度(px)',
|
|
205
|
+
labelWidth: '90px',
|
|
206
|
+
type: 'data-source-field-select',
|
|
207
|
+
fieldConfig: {
|
|
208
|
+
type: 'text',
|
|
147
209
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
210
|
+
},
|
|
211
|
+
],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
type: 'row',
|
|
215
|
+
items: [
|
|
216
|
+
{
|
|
217
|
+
name: 'height',
|
|
218
|
+
text: '高度(px)',
|
|
219
|
+
labelWidth: '90px',
|
|
220
|
+
type: 'data-source-field-select',
|
|
221
|
+
fieldConfig: {
|
|
222
|
+
type: 'text',
|
|
156
223
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
type: 'row',
|
|
229
|
+
items: [
|
|
230
|
+
{
|
|
231
|
+
type: 'data-source-field-select',
|
|
232
|
+
text: 'overflow',
|
|
233
|
+
name: 'overflow',
|
|
234
|
+
labelWidth: '90px',
|
|
235
|
+
checkStrictly: false,
|
|
236
|
+
dataSourceFieldType: ['string'],
|
|
237
|
+
fieldConfig: {
|
|
238
|
+
type: 'select',
|
|
239
|
+
clearable: true,
|
|
240
|
+
allowCreate: true,
|
|
241
|
+
options: [
|
|
242
|
+
{ text: 'visible', value: 'visible' },
|
|
243
|
+
{ text: 'hidden', value: 'hidden' },
|
|
244
|
+
{ text: 'clip', value: 'clip' },
|
|
245
|
+
{ text: 'scroll', value: 'scroll' },
|
|
246
|
+
{ text: 'auto', value: 'auto' },
|
|
247
|
+
{ text: 'overlay', value: 'overlay' },
|
|
248
|
+
{ text: 'initial', value: 'initial' },
|
|
249
|
+
],
|
|
183
250
|
},
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
251
|
+
},
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
type: 'row',
|
|
256
|
+
items: [
|
|
257
|
+
{
|
|
258
|
+
type: 'data-source-field-select',
|
|
259
|
+
text: '透明度(%)',
|
|
260
|
+
name: 'opacity',
|
|
261
|
+
labelWidth: '90px',
|
|
262
|
+
dataSourceFieldType: ['string', 'number'],
|
|
263
|
+
fieldConfig: {
|
|
264
|
+
type: 'text',
|
|
193
265
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
},
|
|
269
|
+
]);
|
|
198
270
|
|
|
199
271
|
const change = (value: string | StyleSchema, eventData: ContainerChangeEventData) => {
|
|
200
272
|
emit('change', value, eventData);
|