@tmagic/editor 1.8.4 → 1.8.6
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 → Editor.vue.js} +9 -9
- package/dist/es/{Editor.js → Editor2.vue.js} +1 -1
- package/dist/es/components/{CodeBlockEditor.vue_vue_type_script_setup_true_lang.js → CodeBlockEditor.vue.js} +5 -5
- package/dist/es/components/{CodeBlockEditor.js → CodeBlockEditor2.vue.js} +1 -1
- package/dist/es/components/{CodeParams.js → CodeParams2.vue.js} +1 -1
- package/dist/es/components/{CompareForm.js → CompareForm2.vue.js} +1 -1
- package/dist/es/components/{ContentMenu.vue_vue_type_script_setup_true_lang.js → ContentMenu.vue.js} +2 -2
- package/dist/es/components/{ContentMenu.js → ContentMenu2.vue.js} +1 -1
- package/dist/es/components/{FloatingBox.vue_vue_type_script_setup_true_lang.js → FloatingBox.vue.js} +2 -2
- package/dist/es/components/{FloatingBox.js → FloatingBox2.vue.js} +1 -1
- package/dist/es/components/{Icon.js → Icon2.vue.js} +1 -1
- package/dist/es/components/{Resizer.js → Resizer2.vue.js} +1 -1
- package/dist/es/components/{ScrollBar.js → ScrollBar2.vue.js} +1 -1
- package/dist/es/components/{ScrollViewer.vue_vue_type_script_setup_true_lang.js → ScrollViewer.vue.js} +3 -3
- package/dist/es/components/{ScrollViewer.js → ScrollViewer2.vue.js} +1 -1
- package/dist/es/components/{SearchInput.js → SearchInput2.vue.js} +1 -1
- package/dist/es/components/{SplitView.vue_vue_type_script_setup_true_lang.js → SplitView.vue.js} +1 -1
- package/dist/es/components/{SplitView.js → SplitView2.vue.js} +1 -1
- package/dist/es/components/{ToolButton.vue_vue_type_script_setup_true_lang.js → ToolButton.vue.js} +3 -3
- package/dist/es/components/{ToolButton.js → ToolButton2.vue.js} +1 -1
- package/dist/es/components/{Tree.vue_vue_type_script_setup_true_lang.js → Tree.vue.js} +1 -1
- package/dist/es/components/{Tree.js → Tree2.vue.js} +1 -1
- package/dist/es/components/{TreeNode.vue_vue_type_script_setup_true_lang.js → TreeNode.vue.js} +2 -2
- package/dist/es/components/{TreeNode.js → TreeNode2.vue.js} +1 -1
- package/dist/es/components/{ViewForm.js → ViewForm2.vue.js} +1 -1
- package/dist/es/fields/{Code.vue_vue_type_script_setup_true_lang.js → Code.vue.js} +1 -1
- package/dist/es/fields/{Code.js → Code2.vue.js} +1 -1
- package/dist/es/fields/{CodeLink.js → CodeLink2.vue.js} +1 -1
- package/dist/es/fields/{CodeSelect.js → CodeSelect2.vue.js} +1 -1
- package/dist/es/fields/{CodeSelectCol.vue_vue_type_script_setup_true_lang.js → CodeSelectCol.vue.js} +7 -7
- package/dist/es/fields/{CodeSelectCol.js → CodeSelectCol2.vue.js} +1 -1
- package/dist/es/fields/{CondOpSelect.js → CondOpSelect2.vue.js} +1 -1
- package/dist/es/fields/DataSourceFieldSelect/{FieldSelect.vue_vue_type_script_setup_true_lang.js → FieldSelect.vue.js} +55 -14
- package/dist/es/fields/DataSourceFieldSelect/{FieldSelect.js → FieldSelect2.vue.js} +1 -1
- package/dist/es/fields/DataSourceFieldSelect/{Index.vue_vue_type_script_setup_true_lang.js → Index.vue.js} +7 -7
- package/dist/es/fields/DataSourceFieldSelect/{Index.js → Index2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceFields.vue_vue_type_script_setup_true_lang.js → DataSourceFields.vue.js} +50 -17
- package/dist/es/fields/{DataSourceFields.js → DataSourceFields2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceInput.vue_vue_type_script_setup_true_lang.js → DataSourceInput.vue.js} +5 -5
- package/dist/es/fields/{DataSourceInput.js → DataSourceInput2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js → DataSourceMethodSelect.vue.js} +7 -7
- package/dist/es/fields/{DataSourceMethodSelect.js → DataSourceMethodSelect2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceMethods.vue_vue_type_script_setup_true_lang.js → DataSourceMethods.vue.js} +3 -3
- package/dist/es/fields/{DataSourceMethods.js → DataSourceMethods2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceMocks.vue_vue_type_script_setup_true_lang.js → DataSourceMocks.vue.js} +8 -8
- package/dist/es/fields/{DataSourceMocks.js → DataSourceMocks2.vue.js} +1 -1
- package/dist/es/fields/{DataSourceSelect.vue_vue_type_script_setup_true_lang.js → DataSourceSelect.vue.js} +5 -5
- package/dist/es/fields/{DataSourceSelect.js → DataSourceSelect2.vue.js} +1 -1
- package/dist/es/fields/{DisplayConds.js → DisplayConds2.vue.js} +1 -1
- package/dist/es/fields/{EventSelect.js → EventSelect2.vue.js} +1 -1
- package/dist/es/fields/{KeyValue.vue_vue_type_script_setup_true_lang.js → KeyValue.vue.js} +3 -3
- package/dist/es/fields/{KeyValue.js → KeyValue2.vue.js} +1 -1
- package/dist/es/fields/{PageFragmentSelect.vue_vue_type_script_setup_true_lang.js → PageFragmentSelect.vue.js} +4 -4
- package/dist/es/fields/{PageFragmentSelect.js → PageFragmentSelect2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/{Index.vue_vue_type_script_setup_true_lang.js → Index.vue.js} +7 -7
- package/dist/es/fields/StyleSetter/{Index.js → Index2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{BackgroundPosition.js → BackgroundPosition2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{Border.js → Border2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{Box.js → Box2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/configs.js +138 -39
- package/dist/es/fields/StyleSetter/icons/align-items/Baseline.vue.js +45 -0
- package/dist/es/fields/StyleSetter/icons/align-items/End.vue.js +42 -0
- package/dist/es/fields/StyleSetter/icons/align-items/Normal.vue.js +33 -0
- package/dist/es/fields/StyleSetter/icons/align-items/Start.vue.js +42 -0
- package/dist/es/fields/StyleSetter/icons/align-items/Stretch.vue.js +37 -0
- package/dist/es/fields/StyleSetter/icons/background-repeat/Round.vue.js +45 -0
- package/dist/es/fields/StyleSetter/icons/background-repeat/Space.vue.js +16 -0
- package/dist/es/fields/StyleSetter/icons/display/Grid.vue.js +13 -0
- package/dist/es/fields/StyleSetter/icons/display/InlineFlex.vue.js +13 -0
- package/dist/es/fields/StyleSetter/icons/display/InlineGrid.vue.js +13 -0
- package/dist/es/fields/StyleSetter/icons/justify-content/SpaceEvenly.vue.js +16 -0
- package/dist/es/fields/StyleSetter/icons/text-align/End.vue.js +13 -0
- package/dist/es/fields/StyleSetter/icons/text-align/Justify.vue.js +13 -0
- package/dist/es/fields/StyleSetter/icons/text-align/MatchParent.vue.js +13 -0
- package/dist/es/fields/StyleSetter/icons/text-align/Start.vue.js +13 -0
- package/dist/es/fields/StyleSetter/pro/{Background.js → Background2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Border.vue_vue_type_script_setup_true_lang.js → Border.vue.js} +3 -3
- package/dist/es/fields/StyleSetter/pro/{Border.js → Border2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Font.js → Font2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Layout.vue_vue_type_script_setup_true_lang.js → Layout.vue.js} +4 -4
- package/dist/es/fields/StyleSetter/pro/{Layout.js → Layout2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Position.js → Position2.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Transform.js → Transform2.vue.js} +1 -1
- package/dist/es/fields/{UISelect.js → UISelect2.vue.js} +1 -1
- package/dist/es/fields/configs/codeSelect.js +2 -2
- package/dist/es/fields/configs/displayConds.js +1 -1
- package/dist/es/fields/configs/eventSelect.js +3 -3
- package/dist/es/fields/headless-validation.js +1 -1
- package/dist/es/hooks/use-code-block-edit.js +1 -1
- package/dist/es/hooks/use-compare-form.js +1 -1
- package/dist/es/hooks/use-editor-content-height.js +1 -1
- package/dist/es/hooks/use-filter.js +2 -2
- package/dist/es/hooks/use-float-box.js +1 -1
- package/dist/es/hooks/use-form-context.js +1 -1
- package/dist/es/hooks/use-node-status.js +1 -1
- package/dist/es/hooks/use-stage.js +28 -3
- package/dist/es/icons/{CenterIcon.js → CenterIcon2.vue.js} +1 -1
- package/dist/es/icons/{CodeIcon.js → CodeIcon2.vue.js} +1 -1
- package/dist/es/icons/{FolderMinusIcon.js → FolderMinusIcon2.vue.js} +1 -1
- package/dist/es/index.js +47 -47
- package/dist/es/initService.js +9 -9
- package/dist/es/layouts/{AddPageBox.vue_vue_type_script_setup_true_lang.js → AddPageBox.vue.js} +4 -4
- package/dist/es/layouts/{AddPageBox.js → AddPageBox2.vue.js} +1 -1
- package/dist/es/layouts/{CodeEditor.vue_vue_type_script_setup_true_lang.js → CodeEditor.vue.js} +5 -5
- package/dist/es/layouts/{CodeEditor.js → CodeEditor2.vue.js} +1 -1
- package/dist/es/layouts/{Framework.vue_vue_type_script_setup_true_lang.js → Framework.vue.js} +5 -5
- package/dist/es/layouts/{Framework.js → Framework2.vue.js} +1 -1
- package/dist/es/layouts/{NavMenu.vue_vue_type_script_setup_true_lang.js → NavMenu.vue.js} +5 -5
- package/dist/es/layouts/{NavMenu.js → NavMenu2.vue.js} +1 -1
- package/dist/es/layouts/{NavMenuColumn.vue_vue_type_script_setup_true_lang.js → NavMenuColumn.vue.js} +14 -6
- package/dist/es/layouts/{NavMenuColumn.js → NavMenuColumn2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{Bucket.vue_vue_type_script_setup_true_lang.js → Bucket.vue.js} +3 -3
- package/dist/es/layouts/history-list/{Bucket.js → Bucket2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{BucketTab.vue_vue_type_script_setup_true_lang.js → BucketTab.vue.js} +2 -2
- package/dist/es/layouts/history-list/{BucketTab.js → BucketTab2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{GroupRow.js → GroupRow2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{HistoryDiffDialog.vue_vue_type_script_setup_true_lang.js → HistoryDiffDialog.vue.js} +3 -3
- package/dist/es/layouts/history-list/{HistoryDiffDialog.js → HistoryDiffDialog2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{HistoryListPanel.vue_vue_type_script_setup_true_lang.js → HistoryListPanel.vue.js} +6 -6
- package/dist/es/layouts/history-list/{HistoryListPanel.js → HistoryListPanel2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{InitialRow.js → InitialRow2.vue.js} +1 -1
- package/dist/es/layouts/history-list/{PageTab.vue_vue_type_script_setup_true_lang.js → PageTab.vue.js} +4 -4
- package/dist/es/layouts/history-list/{PageTab.js → PageTab2.vue.js} +1 -1
- package/dist/es/layouts/history-list/composables.js +1 -1
- package/dist/es/layouts/history-list/useHistoryList.js +1 -1
- package/dist/es/layouts/history-list/useHistoryRevert.js +3 -3
- package/dist/es/layouts/page-bar/{AddButton.vue_vue_type_script_setup_true_lang.js → AddButton.vue.js} +6 -6
- package/dist/es/layouts/page-bar/{AddButton.js → AddButton2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{PageBar.vue_vue_type_script_setup_true_lang.js → PageBar.vue.js} +8 -8
- package/dist/es/layouts/page-bar/{PageBar.js → PageBar2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{PageBarScrollContainer.vue_vue_type_script_setup_true_lang.js → PageBarScrollContainer.vue.js} +2 -2
- package/dist/es/layouts/page-bar/{PageBarScrollContainer.js → PageBarScrollContainer2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{PageList.vue_vue_type_script_setup_true_lang.js → PageList.vue.js} +3 -3
- package/dist/es/layouts/page-bar/{PageList.js → PageList2.vue.js} +1 -1
- package/dist/es/layouts/page-bar/{Search.vue_vue_type_script_setup_true_lang.js → Search.vue.js} +3 -3
- package/dist/es/layouts/page-bar/{Search.js → Search2.vue.js} +1 -1
- package/dist/es/layouts/props-panel/{FormPanel.vue_vue_type_script_setup_true_lang.js → FormPanel.vue.js} +7 -7
- package/dist/es/layouts/props-panel/{FormPanel.js → FormPanel2.vue.js} +1 -1
- package/dist/es/layouts/props-panel/{PropsPanel.vue_vue_type_script_setup_true_lang.js → PropsPanel.vue.js} +7 -7
- package/dist/es/layouts/props-panel/{PropsPanel.js → PropsPanel2.vue.js} +1 -1
- package/dist/es/layouts/props-panel/use-style-panel.js +1 -1
- package/dist/es/layouts/sidebar/{ComponentListPanel.vue_vue_type_script_setup_true_lang.js → ComponentListPanel.vue.js} +7 -7
- package/dist/es/layouts/sidebar/{ComponentListPanel.js → ComponentListPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/{Sidebar.vue_vue_type_script_setup_true_lang.js → Sidebar.vue.js} +8 -8
- package/dist/es/layouts/sidebar/{Sidebar.js → Sidebar2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/code-block/{CodeBlockList.vue_vue_type_script_setup_true_lang.js → CodeBlockList.vue.js} +5 -5
- package/dist/es/layouts/sidebar/code-block/{CodeBlockList.js → CodeBlockList2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/code-block/{CodeBlockListPanel.vue_vue_type_script_setup_true_lang.js → CodeBlockListPanel.vue.js} +6 -6
- package/dist/es/layouts/sidebar/code-block/{CodeBlockListPanel.js → CodeBlockListPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/code-block/useContentMenu.js +1 -1
- package/dist/es/layouts/sidebar/data-source/{DataSourceAddButton.vue_vue_type_script_setup_true_lang.js → DataSourceAddButton.vue.js} +2 -2
- package/dist/es/layouts/sidebar/data-source/{DataSourceAddButton.js → DataSourceAddButton2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/data-source/{DataSourceConfigPanel.vue_vue_type_script_setup_true_lang.js → DataSourceConfigPanel.vue.js} +4 -4
- package/dist/es/layouts/sidebar/data-source/{DataSourceConfigPanel.js → DataSourceConfigPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/data-source/{DataSourceList.vue_vue_type_script_setup_true_lang.js → DataSourceList.vue.js} +5 -5
- package/dist/es/layouts/sidebar/data-source/{DataSourceList.js → DataSourceList2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/data-source/{DataSourceListPanel.vue_vue_type_script_setup_true_lang.js → DataSourceListPanel.vue.js} +8 -8
- package/dist/es/layouts/sidebar/data-source/{DataSourceListPanel.js → DataSourceListPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/data-source/useContentMenu.js +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerMenu.vue_vue_type_script_setup_true_lang.js → LayerMenu.vue.js} +5 -5
- package/dist/es/layouts/sidebar/layer/{LayerMenu.js → LayerMenu2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerNodeContent.vue_vue_type_script_setup_true_lang.js → LayerNodeContent.vue.js} +3 -3
- package/dist/es/layouts/sidebar/layer/{LayerNodeContent.js → LayerNodeContent2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerNodeTool.js → LayerNodeTool2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerPanel.vue_vue_type_script_setup_true_lang.js → LayerPanel.vue.js} +7 -7
- package/dist/es/layouts/sidebar/layer/{LayerPanel.js → LayerPanel2.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/use-click.js +3 -3
- package/dist/es/layouts/sidebar/layer/use-drag.js +1 -1
- package/dist/es/layouts/sidebar/layer/use-keybinding.js +1 -1
- package/dist/es/layouts/sidebar/layer/use-node-status.js +2 -2
- package/dist/es/layouts/workspace/{Breadcrumb.js → Breadcrumb2.vue.js} +1 -1
- package/dist/es/layouts/workspace/{Workspace.vue_vue_type_script_setup_true_lang.js → Workspace.vue.js} +3 -3
- package/dist/es/layouts/workspace/{Workspace.js → Workspace2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{NodeListMenu.vue_vue_type_script_setup_true_lang.js → NodeListMenu.vue.js} +5 -5
- package/dist/es/layouts/workspace/viewer/{NodeListMenu.js → NodeListMenu2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{Stage.vue_vue_type_script_setup_true_lang.js → Stage.vue.js} +70 -55
- package/dist/es/layouts/workspace/viewer/{Stage.js → Stage2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{StageOverlay.vue_vue_type_script_setup_true_lang.js → StageOverlay.vue.js} +3 -3
- package/dist/es/layouts/workspace/viewer/{StageOverlay.js → StageOverlay2.vue.js} +1 -1
- package/dist/es/layouts/workspace/viewer/{ViewerMenu.vue_vue_type_script_setup_true_lang.js → ViewerMenu.vue.js} +6 -6
- package/dist/es/layouts/workspace/viewer/{ViewerMenu.js → ViewerMenu2.vue.js} +1 -1
- package/dist/es/plugin.js +24 -24
- package/dist/es/sdk/index.js +2 -2
- package/dist/es/sdk/services/CodeBlock.js +18 -18
- package/dist/es/sdk/services/DataSource.js +17 -17
- package/dist/es/sdk/services/Dep.js +3 -3
- package/dist/es/sdk/services/Editor.js +60 -58
- package/dist/es/sdk/services/Events.js +2 -2
- package/dist/es/sdk/services/History.js +1 -1
- package/dist/es/sdk/services/Props.js +6 -6
- package/dist/es/sdk/services/WebStorage.js +1 -1
- package/dist/es/sdk/utils/dep.js +2 -2
- package/dist/es/sdk/utils/operator.js +3 -3
- package/dist/es/sdk/validate/index.js +4 -4
- package/dist/es/sdk/wiring.js +2 -2
- package/dist/es/services/keybinding.js +2 -2
- package/dist/es/services/stageOverlay.js +2 -2
- package/dist/es/services/ui.js +2 -2
- package/dist/es/utils/code-block.js +2 -2
- package/dist/es/utils/content-menu.js +3 -3
- package/dist/es/utils/data-source/index.js +88 -5
- package/dist/es/utils/dep/collect-worker-client.js +1 -1
- package/dist/es/utils/dep/idle-task.js +1 -1
- package/dist/es/utils/editor.js +7 -6
- package/dist/es/utils/event.js +1 -1
- package/dist/es/utils/history.js +2 -2
- package/dist/es/utils/operator.js +1 -1
- package/dist/es/utils/page.js +21 -0
- package/dist/es/utils/props.js +1 -1
- package/dist/es/utils/type-match-rules.js +4 -4
- package/dist/tmagic-editor-headless.umd.cjs +606 -175
- package/dist/tmagic-editor-sdk.umd.cjs +41 -38
- package/dist/tmagic-editor.umd.cjs +1200 -421
- package/package.json +8 -8
- package/src/fields/DataSourceFieldSelect/FieldSelect.vue +68 -9
- package/src/fields/DataSourceFields.vue +53 -10
- package/src/fields/DataSourceMocks.vue +2 -2
- package/src/fields/StyleSetter/configs.ts +63 -14
- package/src/fields/StyleSetter/icons/align-items/Baseline.vue +8 -0
- package/src/fields/StyleSetter/icons/align-items/End.vue +8 -0
- package/src/fields/StyleSetter/icons/align-items/Normal.vue +6 -0
- package/src/fields/StyleSetter/icons/align-items/Start.vue +8 -0
- package/src/fields/StyleSetter/icons/align-items/Stretch.vue +7 -0
- package/src/fields/StyleSetter/icons/align-items/index.ts +5 -0
- package/src/fields/StyleSetter/icons/background-repeat/Round.vue +8 -0
- package/src/fields/StyleSetter/icons/background-repeat/Space.vue +9 -0
- package/src/fields/StyleSetter/icons/background-repeat/index.ts +2 -0
- package/src/fields/StyleSetter/icons/display/Grid.vue +7 -0
- package/src/fields/StyleSetter/icons/display/InlineFlex.vue +7 -0
- package/src/fields/StyleSetter/icons/display/InlineGrid.vue +7 -0
- package/src/fields/StyleSetter/icons/display/index.ts +3 -0
- package/src/fields/StyleSetter/icons/justify-content/SpaceEvenly.vue +11 -0
- package/src/fields/StyleSetter/icons/justify-content/index.ts +1 -0
- package/src/fields/StyleSetter/icons/text-align/End.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/Justify.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/MatchParent.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/Start.vue +7 -0
- package/src/fields/StyleSetter/icons/text-align/index.ts +4 -0
- package/src/hooks/use-stage.ts +26 -1
- package/src/layouts/NavMenuColumn.vue +8 -1
- package/src/layouts/workspace/viewer/Stage.vue +77 -57
- package/src/sdk/services/Editor.ts +6 -4
- package/src/type.ts +2 -0
- package/src/utils/data-source/index.ts +151 -6
- package/src/utils/editor.ts +4 -0
- package/src/utils/page.ts +32 -0
- package/types/headless.d.ts +14 -3
- package/types/index.d.ts +137 -298
- package/types/sdk.d.ts +3 -43
- package/dist/es/components/{CodeParams.vue_vue_type_script_setup_true_lang.js → CodeParams.vue.js} +2 -2
- package/dist/es/components/{CompareForm.vue_vue_type_script_setup_true_lang.js → CompareForm.vue.js} +3 -3
- package/dist/es/components/{Icon.vue_vue_type_script_setup_true_lang.js → Icon.vue.js} +1 -1
- package/dist/es/components/{Resizer.vue_vue_type_script_setup_true_lang.js → Resizer.vue.js} +1 -1
- package/dist/es/components/{ScrollBar.vue_vue_type_script_setup_true_lang.js → ScrollBar.vue.js} +0 -0
- package/dist/es/components/{SearchInput.vue_vue_type_script_setup_true_lang.js → SearchInput.vue.js} +1 -1
- package/dist/es/components/{ViewForm.vue_vue_type_script_setup_true_lang.js → ViewForm.vue.js} +2 -2
- package/dist/es/fields/{CodeLink.vue_vue_type_script_setup_true_lang.js → CodeLink.vue.js} +1 -1
- package/dist/es/fields/{CodeSelect.vue_vue_type_script_setup_true_lang.js → CodeSelect.vue.js} +2 -2
- package/dist/es/fields/{CondOpSelect.vue_vue_type_script_setup_true_lang.js → CondOpSelect.vue.js} +3 -3
- package/dist/es/fields/{DisplayConds.vue_vue_type_script_setup_true_lang.js → DisplayConds.vue.js} +2 -2
- package/dist/es/fields/{EventSelect.vue_vue_type_script_setup_true_lang.js → EventSelect.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/components/{BackgroundPosition.vue_vue_type_script_setup_true_lang.js → BackgroundPosition.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/components/{Border.vue_vue_type_script_setup_true_lang.js → Border.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/components/{Box.vue_vue_type_script_setup_true_lang.js → Box.vue.js} +0 -0
- package/dist/es/fields/StyleSetter/icons/align-items/{Center.js → Center.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{FlexEnd.js → FlexEnd.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{FlexStart.js → FlexStart.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{SpaceAround.js → SpaceAround.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/align-items/{SpaceBetween.js → SpaceBetween.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{NoRepeat.js → NoRepeat.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{Repeat.js → Repeat.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{RepeatX.js → RepeatX.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/background-repeat/{RepeatY.js → RepeatY.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{Block.js → Block.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{Flex.js → Flex.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{Inline.js → Inline.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{InlineBlock.js → InlineBlock.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/display/{None.js → None.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{Column.js → Column.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{ColumnReverse.js → ColumnReverse.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{Row.js → Row.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/flex-direction/{RowReverse.js → RowReverse.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{Center.js → Center.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{FlexEnd.js → FlexEnd.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{FlexStart.js → FlexStart.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{SpaceAround.js → SpaceAround.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/justify-content/{SpaceBetween.js → SpaceBetween.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Center.js → Center.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Left.js → Left.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/icons/text-align/{Right.js → Right.vue.js} +1 -1
- package/dist/es/fields/StyleSetter/pro/{Background.vue_vue_type_script_setup_true_lang.js → Background.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/pro/{Font.vue_vue_type_script_setup_true_lang.js → Font.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/pro/{Position.vue_vue_type_script_setup_true_lang.js → Position.vue.js} +2 -2
- package/dist/es/fields/StyleSetter/pro/{Transform.vue_vue_type_script_setup_true_lang.js → Transform.vue.js} +2 -2
- package/dist/es/fields/{UISelect.vue_vue_type_script_setup_true_lang.js → UISelect.vue.js} +5 -5
- package/dist/es/icons/{CenterIcon.vue_vue_type_script_setup_true_lang.js → CenterIcon.vue.js} +0 -0
- package/dist/es/icons/{CodeIcon.vue_vue_type_script_setup_true_lang.js → CodeIcon.vue.js} +0 -0
- package/dist/es/icons/{DatasourceIcon.js → DatasourceIcon.vue.js} +1 -1
- package/dist/es/icons/{FolderMinusIcon.vue_vue_type_script_setup_true_lang.js → FolderMinusIcon.vue.js} +0 -0
- package/dist/es/layouts/history-list/{GroupRow.vue_vue_type_script_setup_true_lang.js → GroupRow.vue.js} +1 -1
- package/dist/es/layouts/history-list/{InitialRow.vue_vue_type_script_setup_true_lang.js → InitialRow.vue.js} +1 -1
- package/dist/es/layouts/sidebar/layer/{LayerNodeTool.vue_vue_type_script_setup_true_lang.js → LayerNodeTool.vue.js} +2 -2
- package/dist/es/layouts/workspace/{Breadcrumb.vue_vue_type_script_setup_true_lang.js → Breadcrumb.vue.js} +2 -2
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.
|
|
2
|
+
"version": "1.8.6",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@element-plus/icons-vue": "^2.3.2",
|
|
61
|
-
"@tmagic/design": "1.8.
|
|
62
|
-
"@tmagic/form": "1.8.
|
|
63
|
-
"@tmagic/stage": "1.8.
|
|
64
|
-
"@tmagic/table": "1.8.
|
|
65
|
-
"@tmagic/utils": "1.8.
|
|
61
|
+
"@tmagic/design": "1.8.6",
|
|
62
|
+
"@tmagic/form": "1.8.6",
|
|
63
|
+
"@tmagic/stage": "1.8.6",
|
|
64
|
+
"@tmagic/table": "1.8.6",
|
|
65
|
+
"@tmagic/utils": "1.8.6",
|
|
66
66
|
"buffer": "^6.0.3",
|
|
67
67
|
"deep-object-diff": "^1.1.9",
|
|
68
68
|
"emmet-monaco-es": "^5.7.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"@vue/test-utils": "^2.5.1"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
|
-
"@tmagic/core": "1.8.
|
|
86
|
-
"monaco-editor": "^0.
|
|
85
|
+
"@tmagic/core": "1.8.6",
|
|
86
|
+
"monaco-editor": "^0.58.0",
|
|
87
87
|
"type-fest": "^5.2.0",
|
|
88
88
|
"typescript": "^6.0.3",
|
|
89
89
|
"vue": "^3.5.44"
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
import { computed, inject, ref, watch } from 'vue';
|
|
88
88
|
import { Edit, View } from '@element-plus/icons-vue';
|
|
89
89
|
|
|
90
|
-
import type { DataSourceFieldType } from '@tmagic/core';
|
|
90
|
+
import type { DataSourceFieldType, DataSourceSchema } from '@tmagic/core';
|
|
91
91
|
import { getDesignConfig, TMagicButton, TMagicCascader, TMagicSelect, TMagicTooltip } from '@tmagic/design';
|
|
92
92
|
import { type FilterFunction, filterFunction, type FormState, type SelectOption } from '@tmagic/form';
|
|
93
93
|
import { DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, removeDataSourceFieldPrefix } from '@tmagic/utils';
|
|
@@ -95,7 +95,7 @@ import { DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX, removeDataSourceFieldPrefix } f
|
|
|
95
95
|
import MIcon from '@editor/components/Icon.vue';
|
|
96
96
|
import { useServices } from '@editor/hooks/use-services';
|
|
97
97
|
import { type EventBus, SideItemKey } from '@editor/type';
|
|
98
|
-
import { getCascaderOptionsFromFields } from '@editor/utils';
|
|
98
|
+
import { ensureSelectedArrayIndices, getCascaderOptionsFromFields, getDataSourceEditorData } from '@editor/utils';
|
|
99
99
|
|
|
100
100
|
const props = defineProps<{
|
|
101
101
|
/**
|
|
@@ -122,7 +122,7 @@ const modelValue = defineModel<string[] | any>('modelValue', { default: () => []
|
|
|
122
122
|
|
|
123
123
|
const optionComponent = getDesignConfig('components')?.option;
|
|
124
124
|
|
|
125
|
-
const { dataSourceService, uiService } = useServices();
|
|
125
|
+
const { dataSourceService, uiService, editorService } = useServices();
|
|
126
126
|
const mForm = inject<FormState | undefined>('mForm');
|
|
127
127
|
const eventBus = inject<EventBus | null>('eventBus', null);
|
|
128
128
|
|
|
@@ -173,21 +173,80 @@ watch(
|
|
|
173
173
|
},
|
|
174
174
|
);
|
|
175
175
|
|
|
176
|
+
/**
|
|
177
|
+
* 与 core `App.iteratorContainerType` 一致:默认包含 `iterator-container`,并包含业务追加的自定义类型。
|
|
178
|
+
* runtime 还没就绪时只能识别默认类型。stage 是 markRaw,runtime 晚到不会让 computed 重算,
|
|
179
|
+
* 所以在 runtime-ready 时把类型集合写进 ref。
|
|
180
|
+
*/
|
|
181
|
+
const iteratorContainerTypes = ref<{ has(_type: string): boolean } | null>(null);
|
|
182
|
+
|
|
183
|
+
const syncIteratorContainerTypes = () => {
|
|
184
|
+
const types = editorService?.get('stage')?.renderer?.runtime?.getApp?.()?.iteratorContainerType;
|
|
185
|
+
// runtime 在 iframe 里创建 Set 时,instanceof 对不上当前窗口的 Set,只认 has。
|
|
186
|
+
iteratorContainerTypes.value = typeof types?.has === 'function' ? types : null;
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
watch(
|
|
190
|
+
() => editorService?.get('stage') ?? null,
|
|
191
|
+
(stage, _, onCleanup) => {
|
|
192
|
+
syncIteratorContainerTypes();
|
|
193
|
+
if (!stage?.on) return;
|
|
194
|
+
stage.on('runtime-ready', syncIteratorContainerTypes);
|
|
195
|
+
onCleanup(() => {
|
|
196
|
+
stage.off('runtime-ready', syncIteratorContainerTypes);
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
{ immediate: true },
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
const isIteratorContainer = (type?: string) => {
|
|
203
|
+
if (!type) return false;
|
|
204
|
+
const types = iteratorContainerTypes.value;
|
|
205
|
+
return types ? types.has(type) : type === 'iterator-container';
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
/** 迭代器容器自身不算子组件,只有放进它里面的节点才同时支持 array.xxx 和下标 */
|
|
209
|
+
const inIteratorChild = computed(() => {
|
|
210
|
+
const nodeId = mForm?.initValues?.id;
|
|
211
|
+
if (!editorService?.getNodeInfo || nodeId === undefined || nodeId === null || nodeId === '') return false;
|
|
212
|
+
|
|
213
|
+
// getNodeInfo 内部只调用一次 getNodePath。path 最后一项是节点自身。
|
|
214
|
+
const { path } = editorService.getNodeInfo(nodeId);
|
|
215
|
+
return path.slice(0, -1).some((node) => isIteratorContainer(node.type));
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
const fieldOptions = (ds: DataSourceSchema) =>
|
|
219
|
+
getCascaderOptionsFromFields(ds.fields, props.dataSourceFieldType, getDataSourceEditorData(ds), {
|
|
220
|
+
directArrayElements: inIteratorChild.value,
|
|
221
|
+
});
|
|
222
|
+
|
|
176
223
|
const fieldsOptions = computed(() => {
|
|
177
224
|
const ds = allDataSources.value.find((ds) => ds.id === removeDataSourceFieldPrefix(selectDataSourceId.value));
|
|
178
225
|
|
|
179
226
|
if (!ds) return [];
|
|
180
227
|
|
|
181
|
-
|
|
228
|
+
const options = fieldOptions(ds);
|
|
229
|
+
ensureSelectedArrayIndices(options, selectFieldsId.value);
|
|
230
|
+
return options;
|
|
182
231
|
});
|
|
183
232
|
|
|
184
233
|
const cascaderOptions = computed(() => {
|
|
234
|
+
const selected = Array.isArray(modelValue.value) ? modelValue.value : [];
|
|
235
|
+
const selectedDsId = `${selected[0] ?? ''}`;
|
|
236
|
+
const selectedFields = selected.slice(1);
|
|
185
237
|
const options =
|
|
186
|
-
dataSources.value?.map((ds) =>
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
238
|
+
dataSources.value?.map((ds) => {
|
|
239
|
+
const value = valueIsKey.value ? ds.id : `${DATA_SOURCE_FIELDS_SELECT_VALUE_PREFIX}${ds.id}`;
|
|
240
|
+
const children = fieldOptions(ds);
|
|
241
|
+
if (value === selectedDsId) {
|
|
242
|
+
ensureSelectedArrayIndices(children, selectedFields);
|
|
243
|
+
}
|
|
244
|
+
return {
|
|
245
|
+
label: ds.title || ds.id,
|
|
246
|
+
value,
|
|
247
|
+
children,
|
|
248
|
+
};
|
|
249
|
+
}) || [];
|
|
191
250
|
return options.filter((option) => option.children.length);
|
|
192
251
|
});
|
|
193
252
|
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
|
|
53
53
|
<script setup lang="ts">
|
|
54
54
|
import { computed, type ComputedRef, inject, onMounted, provide, Ref, ref } from 'vue';
|
|
55
|
+
import { isEqual } from 'lodash-es';
|
|
55
56
|
|
|
56
57
|
import type { DataSchema } from '@tmagic/core';
|
|
57
58
|
import { TMagicButton, tMagicMessage, tMagicMessageBox } from '@tmagic/design';
|
|
@@ -97,6 +98,23 @@ const fieldTitle = ref('');
|
|
|
97
98
|
|
|
98
99
|
const width = defineModel<number>('width', { default: 670 });
|
|
99
100
|
|
|
101
|
+
/** 数组、对象没填默认值时用的空值。每次新建,避免多个字段共用同一个 [] / {} */
|
|
102
|
+
const emptyDefaultByType = (type: string) => {
|
|
103
|
+
if (type === 'array') return [];
|
|
104
|
+
if (type === 'object') return {};
|
|
105
|
+
return undefined;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/** 表单没填时是空字符串;切换类型时自动填上的也是 [] / {} */
|
|
109
|
+
const isPlaceholderDefaultValue = (value: unknown) =>
|
|
110
|
+
value === '' || value === undefined || isEqual(value, []) || isEqual(value, {});
|
|
111
|
+
|
|
112
|
+
const withTypedDefaultValue = <T extends Record<string, any>>(field: T): T => {
|
|
113
|
+
const next = emptyDefaultByType(field.type);
|
|
114
|
+
if (next === undefined || (field.defaultValue !== '' && field.defaultValue !== undefined)) return field;
|
|
115
|
+
return { ...field, defaultValue: next };
|
|
116
|
+
};
|
|
117
|
+
|
|
100
118
|
const newHandler = () => {
|
|
101
119
|
fieldValues.value = {};
|
|
102
120
|
fieldTitle.value = '新增属性';
|
|
@@ -105,10 +123,10 @@ const newHandler = () => {
|
|
|
105
123
|
};
|
|
106
124
|
|
|
107
125
|
const editField = (row: Record<string, any>, index: number) => {
|
|
108
|
-
fieldValues.value = {
|
|
126
|
+
fieldValues.value = withTypedDefaultValue({
|
|
109
127
|
...row,
|
|
110
128
|
index,
|
|
111
|
-
};
|
|
129
|
+
});
|
|
112
130
|
fieldTitle.value = `编辑${row.title}`;
|
|
113
131
|
calcBoxPosition();
|
|
114
132
|
addDialogVisible.value = true;
|
|
@@ -116,23 +134,37 @@ const editField = (row: Record<string, any>, index: number) => {
|
|
|
116
134
|
|
|
117
135
|
const fieldChange = ({ index, ...value }: Record<string, any>, data: ContainerChangeEventData) => {
|
|
118
136
|
addDialogVisible.value = false;
|
|
137
|
+
const normalized = withTypedDefaultValue(value);
|
|
119
138
|
|
|
120
139
|
if (index > -1) {
|
|
121
|
-
|
|
140
|
+
const changeRecords = (data.changeRecords || []).map((item) => ({
|
|
141
|
+
propPath: `${props.prop}.${index}.${item.propPath}`,
|
|
142
|
+
value: item.value,
|
|
143
|
+
}));
|
|
144
|
+
|
|
145
|
+
// 编辑时只回写变更字段。空字符串被收成 [] / {} 后要补进记录,否则原默认值会留在字段上
|
|
146
|
+
if (normalized !== value) {
|
|
147
|
+
const defaultValuePath = `${props.prop}.${index}.defaultValue`;
|
|
148
|
+
const record = changeRecords.find((item) => item.propPath === defaultValuePath);
|
|
149
|
+
if (record) {
|
|
150
|
+
record.value = normalized.defaultValue;
|
|
151
|
+
} else {
|
|
152
|
+
changeRecords.push({ propPath: defaultValuePath, value: normalized.defaultValue });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
emit('change', normalized, {
|
|
122
157
|
modifyKey: index,
|
|
123
|
-
changeRecords
|
|
124
|
-
propPath: `${props.prop}.${index}.${item.propPath}`,
|
|
125
|
-
value: item.value,
|
|
126
|
-
})),
|
|
158
|
+
changeRecords,
|
|
127
159
|
});
|
|
128
160
|
} else {
|
|
129
161
|
const modifyKey = props.model[props.name].length;
|
|
130
|
-
emit('change',
|
|
162
|
+
emit('change', normalized, {
|
|
131
163
|
modifyKey,
|
|
132
164
|
changeRecords: [
|
|
133
165
|
{
|
|
134
166
|
propPath: `${props.prop}.${modifyKey}`,
|
|
135
|
-
value,
|
|
167
|
+
value: normalized,
|
|
136
168
|
},
|
|
137
169
|
],
|
|
138
170
|
});
|
|
@@ -208,10 +240,21 @@ const dataSourceFieldsConfig: FormConfig = [
|
|
|
208
240
|
{ text: 'null', value: 'null' },
|
|
209
241
|
{ text: 'any', value: 'any' },
|
|
210
242
|
],
|
|
211
|
-
onChange: (_formState, v: string, { setModel }) => {
|
|
243
|
+
onChange: (_formState, v: string, { model, setModel }) => {
|
|
212
244
|
if (!['any', 'array', 'object'].includes(v)) {
|
|
213
245
|
setModel('fields', []);
|
|
214
246
|
}
|
|
247
|
+
|
|
248
|
+
const current = model?.defaultValue;
|
|
249
|
+
const next = emptyDefaultByType(v);
|
|
250
|
+
if (next !== undefined) {
|
|
251
|
+
if (isPlaceholderDefaultValue(current) && !isEqual(current, next)) {
|
|
252
|
+
setModel('defaultValue', next);
|
|
253
|
+
}
|
|
254
|
+
} else if (isEqual(current, []) || isEqual(current, {})) {
|
|
255
|
+
// 从数组 / 对象切走时,自动填上的 [] / {} 不能留给字符串等其它类型
|
|
256
|
+
setModel('defaultValue', '');
|
|
257
|
+
}
|
|
215
258
|
return v;
|
|
216
259
|
},
|
|
217
260
|
},
|
|
@@ -36,7 +36,7 @@ import type { MockSchema } from '@tmagic/core';
|
|
|
36
36
|
import { TMagicButton, tMagicMessageBox, TMagicSwitch } from '@tmagic/design';
|
|
37
37
|
import { type DataSourceMocksConfig, type FieldProps, type FormConfig, type FormState, MFormBox } from '@tmagic/form';
|
|
38
38
|
import { type ColumnConfig, MagicTable } from '@tmagic/table';
|
|
39
|
-
import {
|
|
39
|
+
import { getMockDataFromFields } from '@tmagic/utils';
|
|
40
40
|
|
|
41
41
|
import FloatingBox from '@editor/components/FloatingBox.vue';
|
|
42
42
|
import { useNextFloatBoxPosition } from '@editor/hooks/use-next-float-box-position';
|
|
@@ -217,7 +217,7 @@ const displayColumns = computed<ColumnConfig[]>(() =>
|
|
|
217
217
|
const newHandler = () => {
|
|
218
218
|
const isFirstRow = props.model[props.name].length === 0;
|
|
219
219
|
formValues.value = {
|
|
220
|
-
data:
|
|
220
|
+
data: getMockDataFromFields(props.model.fields || []),
|
|
221
221
|
useInEditor: isFirstRow,
|
|
222
222
|
enable: isFirstRow,
|
|
223
223
|
};
|
|
@@ -8,14 +8,35 @@ import type { validateDataSourceFieldSelect } from '@editor/utils/type-match-rul
|
|
|
8
8
|
|
|
9
9
|
import BackgroundPosition from './components/BackgroundPosition.vue';
|
|
10
10
|
import {
|
|
11
|
+
AlignItemsBaseline,
|
|
11
12
|
AlignItemsCenter,
|
|
13
|
+
AlignItemsEnd,
|
|
12
14
|
AlignItemsFlexEnd,
|
|
13
15
|
AlignItemsFlexStart,
|
|
16
|
+
AlignItemsNormal,
|
|
14
17
|
AlignItemsSpaceAround,
|
|
15
18
|
AlignItemsSpaceBetween,
|
|
19
|
+
AlignItemsStart,
|
|
20
|
+
AlignItemsStretch,
|
|
16
21
|
} from './icons/align-items';
|
|
17
|
-
import {
|
|
18
|
-
|
|
22
|
+
import {
|
|
23
|
+
BackgroundNoRepeat,
|
|
24
|
+
BackgroundRepeat,
|
|
25
|
+
BackgroundRepeatRound,
|
|
26
|
+
BackgroundRepeatSpace,
|
|
27
|
+
BackgroundRepeatX,
|
|
28
|
+
BackgroundRepeatY,
|
|
29
|
+
} from './icons/background-repeat';
|
|
30
|
+
import {
|
|
31
|
+
DisplayBlock,
|
|
32
|
+
DisplayFlex,
|
|
33
|
+
DisplayGrid,
|
|
34
|
+
DisplayInline,
|
|
35
|
+
DisplayInlineBlock,
|
|
36
|
+
DisplayInlineFlex,
|
|
37
|
+
DisplayInlineGrid,
|
|
38
|
+
DisplayNone,
|
|
39
|
+
} from './icons/display';
|
|
19
40
|
import {
|
|
20
41
|
FlexDirectionColumn,
|
|
21
42
|
FlexDirectionColumnReverse,
|
|
@@ -28,8 +49,17 @@ import {
|
|
|
28
49
|
JustifyContentFlexStart,
|
|
29
50
|
JustifyContentSpaceAround,
|
|
30
51
|
JustifyContentSpaceBetween,
|
|
52
|
+
JustifyContentSpaceEvenly,
|
|
31
53
|
} from './icons/justify-content';
|
|
32
|
-
import {
|
|
54
|
+
import {
|
|
55
|
+
AlignCenter,
|
|
56
|
+
AlignEnd,
|
|
57
|
+
AlignJustify,
|
|
58
|
+
AlignLeft,
|
|
59
|
+
AlignMatchParent,
|
|
60
|
+
AlignRight,
|
|
61
|
+
AlignStart,
|
|
62
|
+
} from './icons/text-align';
|
|
33
63
|
|
|
34
64
|
/**
|
|
35
65
|
* 「布局」面板配置。
|
|
@@ -71,6 +101,9 @@ export const createLayoutConfig = (theme: string): FormConfig => [
|
|
|
71
101
|
icon: markRaw(DisplayNone),
|
|
72
102
|
tooltip: '隐藏 none',
|
|
73
103
|
},
|
|
104
|
+
{ value: 'inline-flex', icon: markRaw(DisplayInlineFlex), tooltip: '内联弹性布局 inline-flex' },
|
|
105
|
+
{ value: 'grid', icon: markRaw(DisplayGrid), tooltip: '网格布局 grid' },
|
|
106
|
+
{ value: 'inline-grid', icon: markRaw(DisplayInlineGrid), tooltip: '内联网格布局 inline-grid' },
|
|
74
107
|
],
|
|
75
108
|
}),
|
|
76
109
|
defineFormItem({
|
|
@@ -121,6 +154,7 @@ export const createLayoutConfig = (theme: string): FormConfig => [
|
|
|
121
154
|
icon: markRaw(JustifyContentSpaceAround),
|
|
122
155
|
tooltip: '横向平分 space-around',
|
|
123
156
|
},
|
|
157
|
+
{ value: 'space-evenly', icon: markRaw(JustifyContentSpaceEvenly), tooltip: '等间距分布 space-evenly' },
|
|
124
158
|
],
|
|
125
159
|
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
126
160
|
}),
|
|
@@ -145,6 +179,11 @@ export const createLayoutConfig = (theme: string): FormConfig => [
|
|
|
145
179
|
icon: markRaw(AlignItemsSpaceAround),
|
|
146
180
|
tooltip: '横向平分 space-around',
|
|
147
181
|
},
|
|
182
|
+
{ value: 'stretch', icon: markRaw(AlignItemsStretch), tooltip: '拉伸填满 stretch' },
|
|
183
|
+
{ value: 'baseline', icon: markRaw(AlignItemsBaseline), tooltip: '基线对齐 baseline' },
|
|
184
|
+
{ value: 'normal', icon: markRaw(AlignItemsNormal), tooltip: '默认 normal' },
|
|
185
|
+
{ value: 'start', icon: markRaw(AlignItemsStart), tooltip: '起始对齐 start' },
|
|
186
|
+
{ value: 'end', icon: markRaw(AlignItemsEnd), tooltip: '结束对齐 end' },
|
|
148
187
|
],
|
|
149
188
|
display: (_mForm, { model }: { model: Record<any, any> }) => model.display === 'flex',
|
|
150
189
|
}),
|
|
@@ -222,9 +261,9 @@ export const createLayoutConfig = (theme: string): FormConfig => [
|
|
|
222
261
|
items: [
|
|
223
262
|
{
|
|
224
263
|
type: 'data-source-field-select',
|
|
225
|
-
text: '
|
|
264
|
+
text: '透明度(0-1)',
|
|
226
265
|
name: 'opacity',
|
|
227
|
-
labelWidth: '
|
|
266
|
+
labelWidth: '100px',
|
|
228
267
|
dataSourceFieldType: ['string', 'number'],
|
|
229
268
|
fieldConfig: {
|
|
230
269
|
type: 'text',
|
|
@@ -445,6 +484,8 @@ export const createBackgroundConfig = (): FormConfig => [
|
|
|
445
484
|
icon: markRaw(BackgroundRepeat),
|
|
446
485
|
tooltip: '垂直和水平方向重复 repeat',
|
|
447
486
|
},
|
|
487
|
+
{ value: 'space', icon: markRaw(BackgroundRepeatSpace), tooltip: '不裁剪、均匀留白 space' },
|
|
488
|
+
{ value: 'round', icon: markRaw(BackgroundRepeatRound), tooltip: '缩放铺满 round' },
|
|
448
489
|
],
|
|
449
490
|
}),
|
|
450
491
|
defineFormItem({
|
|
@@ -502,9 +543,9 @@ export const createFontConfig = (validateDataSourceField: typeof validateDataSou
|
|
|
502
543
|
fieldConfig: {
|
|
503
544
|
type: 'select',
|
|
504
545
|
allowCreate: true,
|
|
505
|
-
options: ['normal', 'bold']
|
|
546
|
+
options: ['normal', 'bold', 'bolder', 'lighter']
|
|
506
547
|
.concat(
|
|
507
|
-
Array(
|
|
548
|
+
Array(9)
|
|
508
549
|
.fill(1)
|
|
509
550
|
.map((x, i) => `${i + 1}00`),
|
|
510
551
|
)
|
|
@@ -575,10 +616,16 @@ export const createFontConfig = (validateDataSourceField: typeof validateDataSou
|
|
|
575
616
|
type: 'radioGroup',
|
|
576
617
|
childType: 'button',
|
|
577
618
|
labelWidth: '68px',
|
|
619
|
+
// 7 个值统一用图标按钮:带中文文案会因字数不同撑出不同宽度,换行后列线和边框错开。
|
|
620
|
+
// 中文说明放在 tooltip 里,与 display / justifyContent 等布局选项保持一致。
|
|
578
621
|
options: [
|
|
579
|
-
{ value: 'left', icon: markRaw(AlignLeft), tooltip: '左对齐
|
|
580
|
-
{ value: 'center', icon: markRaw(AlignCenter), tooltip: '居中对齐 center'
|
|
581
|
-
{ value: 'right', icon: markRaw(AlignRight), tooltip: '右对齐 right'
|
|
622
|
+
{ value: 'left', icon: markRaw(AlignLeft), tooltip: '左对齐 left' },
|
|
623
|
+
{ value: 'center', icon: markRaw(AlignCenter), tooltip: '居中对齐 center' },
|
|
624
|
+
{ value: 'right', icon: markRaw(AlignRight), tooltip: '右对齐 right' },
|
|
625
|
+
{ value: 'start', icon: markRaw(AlignStart), tooltip: '起始对齐 start' },
|
|
626
|
+
{ value: 'end', icon: markRaw(AlignEnd), tooltip: '结束对齐 end' },
|
|
627
|
+
{ value: 'justify', icon: markRaw(AlignJustify), tooltip: '两端对齐 justify' },
|
|
628
|
+
{ value: 'match-parent', icon: markRaw(AlignMatchParent), tooltip: '按父级方向对齐 match-parent' },
|
|
582
629
|
],
|
|
583
630
|
}),
|
|
584
631
|
];
|
|
@@ -680,10 +727,12 @@ export const createBorderDirectionConfig = (direction: string) =>
|
|
|
680
727
|
type: 'data-source-field-select',
|
|
681
728
|
fieldConfig: {
|
|
682
729
|
type: 'select',
|
|
683
|
-
options: ['
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
730
|
+
options: ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'].map(
|
|
731
|
+
(item) => ({
|
|
732
|
+
value: item,
|
|
733
|
+
text: item,
|
|
734
|
+
}),
|
|
735
|
+
),
|
|
687
736
|
},
|
|
688
737
|
},
|
|
689
738
|
],
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="2" y="3" width="2.5" height="8" rx="0.5" />
|
|
4
|
+
<rect x="6.75" y="6" width="2.5" height="5" rx="0.5" />
|
|
5
|
+
<rect x="11.5" y="1" width="2.5" height="10" rx="0.5" />
|
|
6
|
+
<rect x="0.75" y="11.25" width="14.5" height="0.75" rx="0.375" />
|
|
7
|
+
</svg>
|
|
8
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="2" y="2" width="9" height="1" rx="0.5" />
|
|
4
|
+
<path d="M11 0.75L14 2.5 11 4.25Z" />
|
|
5
|
+
<rect x="3" y="10" width="10" height="4" rx="0.5" fill="none" stroke="currentColor" />
|
|
6
|
+
<rect x="1" y="14.5" width="14" height="0.5" rx="0.25" fill-opacity="0.3" />
|
|
7
|
+
</svg>
|
|
8
|
+
</template>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="1" y="1" width="14" height="14" rx="1" fill="none" stroke="currentColor" stroke-opacity="0.3" />
|
|
4
|
+
<rect x="3" y="5.5" width="10" height="5" rx="0.5" fill="none" stroke="currentColor" />
|
|
5
|
+
</svg>
|
|
6
|
+
</template>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="2" y="2" width="9" height="1" rx="0.5" />
|
|
4
|
+
<path d="M11 0.75L14 2.5 11 4.25Z" />
|
|
5
|
+
<rect x="3" y="6" width="10" height="4" rx="0.5" fill="none" stroke="currentColor" />
|
|
6
|
+
<rect x="1" y="5" width="14" height="0.5" rx="0.25" fill-opacity="0.3" />
|
|
7
|
+
</svg>
|
|
8
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="1" y="1" width="14" height="14" rx="1" fill="none" stroke="currentColor" stroke-opacity="0.3" />
|
|
4
|
+
<rect x="3" y="2" width="10" height="12" rx="0.5" fill="none" stroke="currentColor" />
|
|
5
|
+
<path d="M8 4.5L9.75 6.5H8.75V9.5H9.75L8 11.5 6.25 9.5H7.25V6.5H6.25Z" />
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export { default as AlignItemsBaseline } from './Baseline.vue';
|
|
1
2
|
export { default as AlignItemsCenter } from './Center.vue';
|
|
3
|
+
export { default as AlignItemsEnd } from './End.vue';
|
|
2
4
|
export { default as AlignItemsFlexEnd } from './FlexEnd.vue';
|
|
3
5
|
export { default as AlignItemsFlexStart } from './FlexStart.vue';
|
|
6
|
+
export { default as AlignItemsNormal } from './Normal.vue';
|
|
4
7
|
export { default as AlignItemsSpaceAround } from './SpaceAround.vue';
|
|
5
8
|
export { default as AlignItemsSpaceBetween } from './SpaceBetween.vue';
|
|
9
|
+
export { default as AlignItemsStart } from './Start.vue';
|
|
10
|
+
export { default as AlignItemsStretch } from './Stretch.vue';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="1" y="1" width="6.5" height="6.5" rx="0.5" />
|
|
4
|
+
<rect x="8.5" y="1" width="6.5" height="6.5" rx="0.5" />
|
|
5
|
+
<rect x="1" y="8.5" width="6.5" height="6.5" rx="0.5" />
|
|
6
|
+
<rect x="8.5" y="8.5" width="6.5" height="6.5" rx="0.5" />
|
|
7
|
+
</svg>
|
|
8
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="0.5" y="0.5" width="15" height="15" rx="1" fill="none" stroke="currentColor" stroke-opacity="0.3" />
|
|
4
|
+
<rect x="3.5" y="3.5" width="3" height="3" rx="0.5" />
|
|
5
|
+
<rect x="9.5" y="3.5" width="3" height="3" rx="0.5" />
|
|
6
|
+
<rect x="3.5" y="9.5" width="3" height="3" rx="0.5" />
|
|
7
|
+
<rect x="9.5" y="9.5" width="3" height="3" rx="0.5" />
|
|
8
|
+
</svg>
|
|
9
|
+
</template>
|
|
@@ -2,3 +2,5 @@ export { default as BackgroundRepeat } from './Repeat.vue';
|
|
|
2
2
|
export { default as BackgroundRepeatX } from './RepeatX.vue';
|
|
3
3
|
export { default as BackgroundRepeatY } from './RepeatY.vue';
|
|
4
4
|
export { default as BackgroundNoRepeat } from './NoRepeat.vue';
|
|
5
|
+
export { default as BackgroundRepeatRound } from './Round.vue';
|
|
6
|
+
export { default as BackgroundRepeatSpace } from './Space.vue';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
|
+
<path
|
|
4
|
+
d="M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192zM416 256v512H368V256h48zM656 256v512H608V256h48zM768 368v48H256V368h512zM768 608v48H256V608h512z"
|
|
5
|
+
></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
|
+
<path
|
|
4
|
+
d="M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192zM288 400v48H128V400h160zM288 576v48H128V576h160zM896 400v48H736V400h160zM896 576v48H736V576h160zM704 320v384H320V320h384zM656 368H368v288h288V368zM448 416v192H384V416h64zM544 416v192H480V416h64zM640 416v192H576V416h64z"
|
|
5
|
+
></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
|
+
<path
|
|
4
|
+
d="M960 128a64 64 0 0 1 64 64v640a64 64 0 0 1-64 64H64a64 64 0 0 1-64-64V192a64 64 0 0 1 64-64h896z m0 64H64v640h896V192zM288 400v48H128V400h160zM288 576v48H128V576h160zM896 400v48H736V400h160zM896 576v48H736V576h160zM704 320v384H320V320h384zM656 368H368v288h288V368zM496 384v112H384V384h112zM640 384v112H528V384h112zM496 528v112H384V528h112zM640 528v112H528V528h112z"
|
|
5
|
+
></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { default as DisplayBlock } from './Block.vue';
|
|
2
2
|
export { default as DisplayFlex } from './Flex.vue';
|
|
3
|
+
export { default as DisplayGrid } from './Grid.vue';
|
|
3
4
|
export { default as DisplayInline } from './Inline.vue';
|
|
4
5
|
export { default as DisplayInlineBlock } from './InlineBlock.vue';
|
|
6
|
+
export { default as DisplayInlineFlex } from './InlineFlex.vue';
|
|
7
|
+
export { default as DisplayInlineGrid } from './InlineGrid.vue';
|
|
5
8
|
export { default as DisplayNone } from './None.vue';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
|
|
3
|
+
<rect x="3" y="4.5" width="1.5" height="7" rx="0.25" fill="none" stroke="currentColor" />
|
|
4
|
+
<rect x="7.5" y="4.5" width="1.5" height="7" rx="0.25" fill="none" stroke="currentColor" />
|
|
5
|
+
<rect x="12" y="4.5" width="1.5" height="7" rx="0.25" fill="none" stroke="currentColor" />
|
|
6
|
+
<rect x="1.25" y="2" width="0.5" height="12" rx="0.25" fill-opacity="0.3" />
|
|
7
|
+
<rect x="6" y="2" width="0.5" height="12" rx="0.25" fill-opacity="0.3" />
|
|
8
|
+
<rect x="10.5" y="2" width="0.5" height="12" rx="0.25" fill-opacity="0.3" />
|
|
9
|
+
<rect x="15" y="2" width="0.5" height="12" rx="0.25" fill-opacity="0.3" />
|
|
10
|
+
</svg>
|
|
11
|
+
</template>
|
|
@@ -3,3 +3,4 @@ export { default as JustifyContentFlexEnd } from './FlexEnd.vue';
|
|
|
3
3
|
export { default as JustifyContentFlexStart } from './FlexStart.vue';
|
|
4
4
|
export { default as JustifyContentSpaceAround } from './SpaceAround.vue';
|
|
5
5
|
export { default as JustifyContentSpaceBetween } from './SpaceBetween.vue';
|
|
6
|
+
export { default as JustifyContentSpaceEvenly } from './SpaceEvenly.vue';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
|
+
<path
|
|
4
|
+
d="M128 96h64v192H128zM224 160h544v64H224zM768 96L896 192 768 288zM256 384h640v64H256zM128 512h768v64H128zM384 640h512v64H384zM192 768h704v64H192z"
|
|
5
|
+
></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
|
+
<path
|
|
4
|
+
d="M128 128h768v85.333333H128z m0 170.666667h768v85.333333H128z m0 170.666666h768v85.333334H128z m0 170.666667h768v85.333333H128z m0 170.666667h768v85.333333H128z"
|
|
5
|
+
></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
|
+
<path
|
|
4
|
+
d="M64 64h896v48H64z m0 848h896v48H64z m0-800h48v800H64z m848 0h48v800h-48zM192 208h416v64H192z m416-48L768 240 608 320zM464 368h96v96h-96z m-64 96h224l-112 128zM192 608h640v56H192z m0 112h512v56H192z m0 112h576v56H192z"
|
|
5
|
+
></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
|
|
3
|
+
<path
|
|
4
|
+
d="M128 96h64v192H128zM224 160h544v64H224zM768 96L896 192 768 288zM128 384h640v64H128zM128 512h768v64H128zM128 640h512v64H128zM128 768h704v64H128z"
|
|
5
|
+
></path>
|
|
6
|
+
</svg>
|
|
7
|
+
</template>
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { default as AlignLeft } from './Left.vue';
|
|
2
2
|
export { default as AlignCenter } from './Center.vue';
|
|
3
3
|
export { default as AlignRight } from './Right.vue';
|
|
4
|
+
export { default as AlignEnd } from './End.vue';
|
|
5
|
+
export { default as AlignJustify } from './Justify.vue';
|
|
6
|
+
export { default as AlignMatchParent } from './MatchParent.vue';
|
|
7
|
+
export { default as AlignStart } from './Start.vue';
|