@riil-frontend/component-topology 6.0.0-alpha.2 → 6.0.0-alpha.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/build/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +28 -28
- package/es/components/ColorPanel/components/ColorBlock/index.js +37 -0
- package/es/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
- package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
- package/es/components/ColorPanel/components/FontColorRange/index.module.scss +22 -0
- package/es/components/ColorPanel/index.js +199 -0
- package/es/components/ColorPanel/index.module.scss +37 -0
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +7 -2
- package/es/components/collapse/Collapse.module.scss +12 -1
- package/es/core/common/hooks/useHtElements.js +21 -0
- package/es/core/common/icons/useIcons.js +7 -1
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +15 -13
- package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +6 -2
- package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +74 -20
- package/es/core/components/TopoView/TopoGraphViewPanel.js +20 -0
- package/es/core/components/TopoView/editor.module.scss +1 -0
- package/es/core/components/TopoView/topoView.js +39 -18
- package/es/core/editor/components/Sidebar/Sidebar.js +26 -50
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
- package/es/core/editor/components/Sidebar/panes.js +32 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +96 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -33
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +42 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +42 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
- package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
- package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/es/core/editor/components/Toolbar/buttons.js +20 -18
- package/es/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +35 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +56 -7
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +10 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.js +33 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.module.scss +26 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +184 -3
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +53 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +59 -6
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +36 -4
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +12 -2
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +12 -2
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -2
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -4
- package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +109 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/constant.js +64 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +101 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +127 -14
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +28 -22
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +14 -4
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +37 -6
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +90 -12
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +9 -21
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
- package/es/core/editor/components/settings/Settings.js +0 -23
- package/es/core/editor/components/settings/Settings.module.scss +1 -2
- package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +76 -0
- package/es/core/editor/components/settings/common/AlignSetting/index.js +18 -72
- package/es/core/editor/components/settings/common/LineType/index.js +12 -119
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -21
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +48 -0
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +12 -18
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +13 -46
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
- package/es/core/editor/hooks/useLayerAddResource.js +28 -0
- package/es/core/{store/models → editor/store}/background.js +0 -0
- package/es/core/{store/models → editor/store}/historyManager.js +0 -0
- package/es/core/{store/models → editor/store}/topoEdit.js +8 -1
- package/es/core/editor/utils/edgeTypeStyleUtil.js +96 -0
- package/es/core/hooks/useCanvasTheme.js +35 -0
- package/es/core/hooks/useTopoEdit.js +36 -58
- package/es/core/models/HistoryManager.js +10 -3
- package/es/core/models/SelectionManager.js +16 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/TopoGraphView.js +8 -2
- package/es/core/models/utils/linkUtils.js +1 -1
- package/es/core/store/coreModels.js +6 -7
- package/es/core/store/models/selection.js +2 -1
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
- package/es/networkTopo/createTopo.js +2 -0
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoTreeMod.js +6 -7
- package/es/style.js +1 -0
- package/es/utils/topoData.js +1 -0
- package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
- package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +22 -0
- package/lib/components/ColorPanel/index.js +217 -0
- package/lib/components/ColorPanel/index.module.scss +37 -0
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +7 -2
- package/lib/components/collapse/Collapse.module.scss +12 -1
- package/lib/core/common/hooks/useHtElements.js +27 -0
- package/lib/core/common/icons/useIcons.js +7 -1
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +15 -13
- package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +7 -2
- package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +74 -20
- package/lib/core/components/TopoView/TopoGraphViewPanel.js +30 -0
- package/lib/core/components/TopoView/editor.module.scss +1 -0
- package/lib/core/components/TopoView/topoView.js +41 -19
- package/lib/core/editor/components/Sidebar/Sidebar.js +25 -52
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
- package/lib/core/editor/components/Sidebar/panes.js +45 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +109 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -32
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +55 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +55 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +3 -1
- package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
- package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/lib/core/editor/components/Toolbar/buttons.js +21 -20
- package/lib/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +50 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +63 -7
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +11 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.js +47 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.module.scss +26 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +194 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +71 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -5
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +39 -4
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +4 -2
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -3
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +126 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/constant.js +69 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +117 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +61 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +132 -15
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +30 -23
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +20 -4
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +36 -5
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +91 -11
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +11 -24
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
- package/lib/core/editor/components/settings/Settings.js +0 -23
- package/lib/core/editor/components/settings/Settings.module.scss +1 -2
- package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +93 -0
- package/lib/core/editor/components/settings/common/AlignSetting/index.js +19 -80
- package/lib/core/editor/components/settings/common/LineType/index.js +13 -126
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -23
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +63 -0
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +13 -22
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +12 -50
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +7 -5
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
- package/lib/core/editor/hooks/useLayerAddResource.js +34 -0
- package/lib/core/{store/models → editor/store}/background.js +0 -0
- package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
- package/lib/core/{store/models → editor/store}/topoEdit.js +8 -1
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +109 -0
- package/lib/core/hooks/useCanvasTheme.js +49 -0
- package/lib/core/hooks/useTopoEdit.js +36 -60
- package/lib/core/models/HistoryManager.js +10 -3
- package/lib/core/models/SelectionManager.js +17 -1
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/TopoGraphView.js +8 -2
- package/lib/core/models/utils/linkUtils.js +1 -1
- package/lib/core/store/coreModels.js +5 -7
- package/lib/core/store/models/selection.js +2 -1
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
- package/lib/networkTopo/createTopo.js +3 -0
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoTreeMod.js +6 -8
- package/lib/style.js +1 -0
- package/lib/utils/topoData.js +1 -0
- package/package.json +2 -2
- package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -4
- package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -17
- package/es/core/store/models/topoView.js +0 -36
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -12
- package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -27
- package/lib/core/store/models/topoView.js +0 -47
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, { useEffect, useRef } from 'react';
|
|
1
|
+
import React, { useEffect, useRef, useMemo } from 'react';
|
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
3
|
import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
|
|
4
|
+
import HtCustomImagePanel from "./HtCustomImagePanel";
|
|
4
5
|
/**
|
|
5
6
|
* 组件面板
|
|
6
7
|
* @param {*} props
|
|
@@ -8,38 +9,12 @@ import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
|
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
export default function CustomImagePanel(props) {
|
|
11
|
-
var topo = props.topo;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var divRef = useRef();
|
|
16
|
-
useEffect(function () {
|
|
17
|
-
// 初始化
|
|
18
|
-
var icons = getUserCustomIconsForHt(topo);
|
|
19
|
-
var htTopo = topo.getHtTopo();
|
|
20
|
-
var container = divRef.current;
|
|
21
|
-
|
|
22
|
-
try {
|
|
23
|
-
viewRef.current = htTopo.createUploadImagePalette(container, {
|
|
24
|
-
icons: icons
|
|
25
|
-
});
|
|
26
|
-
} catch (error) {
|
|
27
|
-
rlog.error('初始化资源面板失败', error);
|
|
28
|
-
} // 注销组件
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return function () {
|
|
32
|
-
if (viewRef.current) {
|
|
33
|
-
viewRef.current.destroy();
|
|
34
|
-
viewRef.current = null;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
12
|
+
var topo = props.topo;
|
|
13
|
+
var icons = useMemo(function () {
|
|
14
|
+
return getUserCustomIconsForHt(topo);
|
|
37
15
|
}, []);
|
|
38
|
-
return /*#__PURE__*/React.createElement(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
width: '100%',
|
|
42
|
-
height: '100%'
|
|
43
|
-
}
|
|
16
|
+
return /*#__PURE__*/React.createElement(HtCustomImagePanel, {
|
|
17
|
+
icons: icons,
|
|
18
|
+
topo: topo
|
|
44
19
|
});
|
|
45
20
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
+
import styles from "./HtImagePalette.module.scss";
|
|
4
|
+
/**
|
|
5
|
+
* 组件面板
|
|
6
|
+
* @param {*} props
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export default function HtCustomImagePanel(props) {
|
|
11
|
+
var topo = props.topo,
|
|
12
|
+
icons = props.icons; // 组件
|
|
13
|
+
|
|
14
|
+
var viewRef = useRef(null); // div容器
|
|
15
|
+
|
|
16
|
+
var divRef = useRef();
|
|
17
|
+
useEffect(function () {
|
|
18
|
+
// 初始化
|
|
19
|
+
var htTopo = topo.getHtTopo();
|
|
20
|
+
var container = divRef.current;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
viewRef.current = htTopo.createUploadImagePalette(container, {
|
|
24
|
+
icons: icons
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
rlog.error('初始化资源面板失败', error);
|
|
28
|
+
} // 注销组件
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
return function () {
|
|
32
|
+
if (viewRef.current) {
|
|
33
|
+
viewRef.current.destroy();
|
|
34
|
+
viewRef.current = null;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
ref: divRef,
|
|
40
|
+
className: styles.container
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
+
import styles from "./HtImagePalette.module.scss";
|
|
4
|
+
/**
|
|
5
|
+
* 组件面板
|
|
6
|
+
* @param {*} props
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export default function HtImagePalette(props) {
|
|
11
|
+
var topo = props.topo,
|
|
12
|
+
icons = props.icons; // 组件
|
|
13
|
+
|
|
14
|
+
var viewRef = useRef(null); // div容器
|
|
15
|
+
|
|
16
|
+
var divRef = useRef();
|
|
17
|
+
useEffect(function () {
|
|
18
|
+
// 初始化
|
|
19
|
+
var htTopo = topo.getHtTopo();
|
|
20
|
+
var container = divRef.current;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
viewRef.current = htTopo.createImagePalette(container, {
|
|
24
|
+
icons: icons
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
rlog.error('初始化资源面板失败', error);
|
|
28
|
+
} // 注销组件
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
return function () {
|
|
32
|
+
if (viewRef.current) {
|
|
33
|
+
viewRef.current.destroy();
|
|
34
|
+
viewRef.current = null;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
ref: divRef,
|
|
40
|
+
className: styles.container
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -2,6 +2,7 @@ import _Collapse from "@alifd/next/es/collapse";
|
|
|
2
2
|
import _Button from "@alifd/next/es/button";
|
|
3
3
|
import _Icon from "@alifd/next/es/icon";
|
|
4
4
|
import React from 'react';
|
|
5
|
+
import classNames from 'classnames';
|
|
5
6
|
import CollapsePanel from "../../../../../../components/collapse/Panel";
|
|
6
7
|
import CollapseStyles from "../../../../../../components/collapse/Collapse.module.scss";
|
|
7
8
|
import CiTypeImagePanel from "./CiTypeImagePanel";
|
|
@@ -12,7 +13,7 @@ export default function ImagePanel(props) {
|
|
|
12
13
|
style: {
|
|
13
14
|
border: 'none'
|
|
14
15
|
},
|
|
15
|
-
className: CollapseStyles.collapse
|
|
16
|
+
className: classNames(CollapseStyles.collapse, CollapseStyles.contentNoPadding)
|
|
16
17
|
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
|
17
18
|
key: "\u8D44\u6E90\u56FE\u7247",
|
|
18
19
|
title: "\u8D44\u6E90\u56FE\u7247"
|
|
@@ -1,35 +1,45 @@
|
|
|
1
1
|
import _Button from "@alifd/next/es/button";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import React, { useMemo, useState } from 'react';
|
|
5
|
+
import getButtons from "./buttons";
|
|
5
6
|
import Toolbar from "./Toolbar";
|
|
6
7
|
import styles from "./Toolbar.module.scss";
|
|
7
8
|
|
|
8
9
|
function EditorToolbar(props) {
|
|
10
|
+
var _topo$viewProps, _topo$viewProps$topoC, _classNames;
|
|
11
|
+
|
|
12
|
+
var topo = props.topo;
|
|
13
|
+
|
|
9
14
|
var _useState = useState(true),
|
|
10
|
-
|
|
11
|
-
|
|
15
|
+
expanded = _useState[0],
|
|
16
|
+
setExpanded = _useState[1];
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
var isNetworkTopo = (_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$topoC = _topo$viewProps.topoContext) === null || _topo$viewProps$topoC === void 0 ? void 0 : _topo$viewProps$topoC.isNetworkTopo;
|
|
19
|
+
var buttons = useMemo(function () {
|
|
20
|
+
return getButtons(isNetworkTopo);
|
|
21
|
+
}, [isNetworkTopo]);
|
|
22
|
+
var buttonInstances = buttons.map(function (ToolbarButton, index) {
|
|
18
23
|
return /*#__PURE__*/React.createElement(ToolbarButton, _extends({
|
|
19
24
|
key: index
|
|
20
25
|
}, props, {
|
|
21
|
-
showLabel:
|
|
26
|
+
showLabel: expanded
|
|
22
27
|
}));
|
|
23
|
-
})
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
className: classNames(styles.toolbarWrap, (_classNames = {}, _classNames[styles.normal] = expanded, _classNames[styles.expanded] = !expanded, _classNames))
|
|
31
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: styles.content
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Toolbar, null, buttonInstances)), /*#__PURE__*/React.createElement("div", {
|
|
24
34
|
className: styles.right
|
|
25
35
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
26
36
|
type: "normal",
|
|
27
37
|
text: true,
|
|
28
38
|
onClick: function onClick() {
|
|
29
|
-
|
|
39
|
+
setExpanded(!expanded);
|
|
30
40
|
}
|
|
31
41
|
}, /*#__PURE__*/React.createElement("img", {
|
|
32
|
-
src:
|
|
42
|
+
src: expanded ? '/img/topo/editor/toolbar/ToolbarNarrowed/Normal.svg' : '/img/topo/editor/toolbar/ToolbbbarExpand/Normal.svg',
|
|
33
43
|
alt: "",
|
|
34
44
|
style: {
|
|
35
45
|
verticalAlign: 'middle'
|
|
@@ -1,19 +1,30 @@
|
|
|
1
|
-
.
|
|
2
|
-
height: 54px;
|
|
1
|
+
.toolbarWrap {
|
|
3
2
|
display: flex;
|
|
4
3
|
align-items: center;
|
|
5
4
|
justify-content: center;
|
|
5
|
+
transition: all .1s linear;
|
|
6
|
+
|
|
7
|
+
&.normal {
|
|
8
|
+
height: 54px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
&.expanded {
|
|
12
|
+
height: 40px;
|
|
13
|
+
}
|
|
6
14
|
}
|
|
7
15
|
|
|
8
16
|
.content {
|
|
17
|
+
height: 100%;
|
|
9
18
|
flex: 1;
|
|
10
19
|
display: flex;
|
|
11
20
|
align-items: center;
|
|
12
21
|
justify-content: center;
|
|
22
|
+
overflow-x: auto;
|
|
13
23
|
}
|
|
14
24
|
|
|
15
|
-
.
|
|
25
|
+
.toolbarContainer {
|
|
16
26
|
display: flex;
|
|
27
|
+
min-width: 1060px;
|
|
17
28
|
}
|
|
18
29
|
|
|
19
30
|
.right {
|
|
@@ -16,21 +16,23 @@ import BoxBackgroundButton from "./widgets/BoxBackgroundButton";
|
|
|
16
16
|
import EdgeColorButton from "./widgets/EdgeColorButton";
|
|
17
17
|
import NodeImageButton from "./widgets/NodeImageButton";
|
|
18
18
|
import NodeSizeButton from "./widgets/NodeSizeButton";
|
|
19
|
-
export default
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
Divider,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
19
|
+
export default function getButtons(isNetworkTopo) {
|
|
20
|
+
return [].concat(isNetworkTopo ? [AddResourceButton, // 添加资源
|
|
21
|
+
Divider] : [], [CanvasSelectWidget, // 选择
|
|
22
|
+
CanvasMoveWidget, // 移动
|
|
23
|
+
Divider], isNetworkTopo ? [HistoryUndoButton, // 撤销
|
|
24
|
+
// HistoryRedoButton, // 恢复
|
|
25
|
+
Divider] : [], [FontFamilyWidget, // 字体
|
|
26
|
+
FontSizeWidget, // 字号
|
|
27
|
+
FontStyleButton, // 文字样式
|
|
28
|
+
FontColorButton, // 文字颜色
|
|
29
|
+
Divider, BoxBackgroundButton, // 框背景
|
|
30
|
+
Divider, EdgeColorButton, // 线条颜色
|
|
31
|
+
EdgeTypeButton, // 线形
|
|
32
|
+
Divider, NodeImageButton, // 替换图片
|
|
33
|
+
NodeSizeButton, // 图片尺寸
|
|
34
|
+
Divider, Layout, // 布局方式
|
|
35
|
+
NodeAlignWidget, // 对齐方式
|
|
36
|
+
SearchWidget // 搜索
|
|
37
|
+
]);
|
|
38
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import { isText } from "../../../../../utils/htElementDataUtil";
|
|
4
|
+
import { isGroup, isLayer, isNode } from "../../../../../utils/htElementUtils";
|
|
5
|
+
|
|
6
|
+
function useFontStyleSetting(props) {
|
|
7
|
+
var topo = props.topo;
|
|
8
|
+
var selectionElements = topo.selectionManager.useHtSelection();
|
|
9
|
+
var buttonEnabled = true; // 全局配置
|
|
10
|
+
|
|
11
|
+
var _topo$store$useModel = topo.store.useModel('displayConfig'),
|
|
12
|
+
nodeLabelStyle = _topo$store$useModel[0].nodeLabelStyle,
|
|
13
|
+
displayConfigDispatchers = _topo$store$useModel[1];
|
|
14
|
+
|
|
15
|
+
var setStyle = function setStyle(styleData) {
|
|
16
|
+
// 全局调整(资源和链路):无选择时,按钮亮起,即可修改全局资源和链路的标注,不影响“文本”、框名称、区域名称、分层名称的格式。
|
|
17
|
+
if (!selectionElements.length) {
|
|
18
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(styleData);
|
|
19
|
+
displayConfigDispatchers.update({
|
|
20
|
+
nodeLabelStyle: _extends({}, nodeLabelStyle, styleData)
|
|
21
|
+
});
|
|
22
|
+
} else {
|
|
23
|
+
selectionElements.forEach(function (element) {
|
|
24
|
+
if (isNode(element)) {} else if (isGroup(element)) {} else if (isText(element)) {} else if (isLayer(element)) {}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return {
|
|
30
|
+
buttonEnabled: buttonEnabled,
|
|
31
|
+
setStyle: setStyle
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default useFontStyleSetting;
|
|
@@ -1,23 +1,72 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { isGroup, isLayer } from "../../../../../utils/htElementDataUtil";
|
|
3
|
+
import useLayerAddResource from "../../../hooks/useLayerAddResource";
|
|
4
|
+
import LayerAddResourceDrawer from "../../settings/propertyViews/layer/DataTab/LayerAddResourceDrawer";
|
|
2
5
|
import ButtonBox from "./components/ButtonBox";
|
|
3
6
|
import WidgetBox from "./WidgetBox";
|
|
4
7
|
|
|
8
|
+
function getAddType(selection) {
|
|
9
|
+
if (selection.length === 1) {
|
|
10
|
+
var data = selection[0];
|
|
11
|
+
|
|
12
|
+
if (isLayer(data)) {
|
|
13
|
+
return 'layer';
|
|
14
|
+
} else if (isGroup(data)) {
|
|
15
|
+
return 'group';
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
5
20
|
function AddResourceButton(props) {
|
|
6
21
|
var showLabel = props.showLabel,
|
|
7
22
|
topo = props.topo,
|
|
8
|
-
topoEdit = props.topoEdit
|
|
9
|
-
|
|
23
|
+
topoEdit = props.topoEdit,
|
|
24
|
+
editorProps = props.editorProps; // 选中的元素
|
|
25
|
+
|
|
26
|
+
var selection = topo.selectionManager.useSelection();
|
|
27
|
+
|
|
28
|
+
var _useState = useState(getAddType(selection)),
|
|
29
|
+
addType = _useState[0],
|
|
30
|
+
setAddType = _useState[1];
|
|
31
|
+
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
setAddType(getAddType(selection));
|
|
34
|
+
}, [selection]); // 选中分层添加
|
|
35
|
+
|
|
36
|
+
var layerAddResource = useLayerAddResource({
|
|
37
|
+
topo: topo,
|
|
38
|
+
topoEdit: topoEdit
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var handleClick = function handleClick() {
|
|
42
|
+
if (!addType) {
|
|
43
|
+
// 未选中分层、分区添加资源
|
|
44
|
+
topoEdit.showGlobalAddResourceDrawer();
|
|
45
|
+
} else if (addType === 'layer') {
|
|
46
|
+
// 选中分层添加资源
|
|
47
|
+
layerAddResource.open();
|
|
48
|
+
} else if (addType === 'group') {
|
|
49
|
+
// 选中区域添加资源
|
|
50
|
+
var group = selection[0];
|
|
51
|
+
var htGroup = topo.getHtTopo().getGraphView().getDataModel().getDataById(group.id);
|
|
52
|
+
topoEdit.groupAddResource.open(htGroup);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(WidgetBox, {
|
|
10
57
|
label: "\u6DFB\u52A0\u8D44\u6E90",
|
|
11
58
|
tooltip: "\u6DFB\u52A0\u8D44\u6E90",
|
|
12
59
|
showLabel: showLabel
|
|
13
60
|
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
|
14
|
-
onClick:
|
|
15
|
-
topoEdit.showGlobalAddResourceDrawer();
|
|
16
|
-
}
|
|
61
|
+
onClick: handleClick
|
|
17
62
|
}, /*#__PURE__*/React.createElement("img", {
|
|
18
63
|
src: "/img/topo/editor/toolbar/add/Normal.svg",
|
|
19
64
|
alt: ""
|
|
20
|
-
})))
|
|
65
|
+
}))), addType === 'layer' && /*#__PURE__*/React.createElement(LayerAddResourceDrawer, {
|
|
66
|
+
layer: selection[0],
|
|
67
|
+
editorProps: editorProps,
|
|
68
|
+
layerAddResource: layerAddResource
|
|
69
|
+
}));
|
|
21
70
|
}
|
|
22
71
|
|
|
23
72
|
export default AddResourceButton;
|
|
@@ -3,12 +3,23 @@ import WidgetBox from "./WidgetBox";
|
|
|
3
3
|
import ButtonBox from "./components/ButtonBox";
|
|
4
4
|
|
|
5
5
|
function CanvasMoveWidget(props) {
|
|
6
|
-
var
|
|
6
|
+
var topo = props.topo,
|
|
7
|
+
showLabel = props.showLabel,
|
|
8
|
+
topoEdit = props.topoEdit;
|
|
9
|
+
|
|
10
|
+
var _topo$store$useModelS = topo.store.useModelState('topoEdit'),
|
|
11
|
+
viewMouseMode = _topo$store$useModelS.viewMouseMode;
|
|
12
|
+
|
|
7
13
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
8
14
|
label: "\u79FB\u52A8",
|
|
9
15
|
tooltip: "\u79FB\u52A8",
|
|
10
16
|
showLabel: showLabel
|
|
11
|
-
}, /*#__PURE__*/React.createElement(ButtonBox,
|
|
17
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
|
18
|
+
active: viewMouseMode === 'move',
|
|
19
|
+
onClick: function onClick() {
|
|
20
|
+
topoEdit.setViewMouseMode('move');
|
|
21
|
+
}
|
|
22
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
12
23
|
src: "/img/topo/editor/toolbar/drag/Normal.svg",
|
|
13
24
|
alt: ""
|
|
14
25
|
})));
|
|
@@ -3,13 +3,22 @@ import WidgetBox from "./WidgetBox";
|
|
|
3
3
|
import ButtonBox from "./components/ButtonBox";
|
|
4
4
|
|
|
5
5
|
function CanvasSelectWidget(props) {
|
|
6
|
-
var
|
|
6
|
+
var topo = props.topo,
|
|
7
|
+
showLabel = props.showLabel,
|
|
8
|
+
topoEdit = props.topoEdit;
|
|
9
|
+
|
|
10
|
+
var _topo$store$useModelS = topo.store.useModelState('topoEdit'),
|
|
11
|
+
viewMouseMode = _topo$store$useModelS.viewMouseMode;
|
|
12
|
+
|
|
7
13
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
8
14
|
label: "\u9009\u62E9",
|
|
9
15
|
tooltip: "\u9009\u62E9",
|
|
10
16
|
showLabel: showLabel
|
|
11
17
|
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
|
12
|
-
active:
|
|
18
|
+
active: viewMouseMode === 'select',
|
|
19
|
+
onClick: function onClick() {
|
|
20
|
+
topoEdit.setViewMouseMode('select');
|
|
21
|
+
}
|
|
13
22
|
}, /*#__PURE__*/React.createElement("img", {
|
|
14
23
|
src: "/img/topo/editor/toolbar/select/Normal.svg",
|
|
15
24
|
alt: ""
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import EdgeWidthRange from "./EdgeWidthRange";
|
|
2
3
|
|
|
3
4
|
function Content(props) {
|
|
4
5
|
// const { } = props
|
|
5
|
-
return /*#__PURE__*/React.createElement("div", null, "
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, "\u7EBF"), /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
style: {
|
|
8
|
+
width: 200
|
|
9
|
+
}
|
|
10
|
+
}, /*#__PURE__*/React.createElement(EdgeWidthRange, {
|
|
11
|
+
defaultValue: 2,
|
|
12
|
+
min: 1,
|
|
13
|
+
max: 10
|
|
14
|
+
})), /*#__PURE__*/React.createElement("div", null));
|
|
6
15
|
}
|
|
7
16
|
|
|
8
17
|
export default Content;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _Range from "@alifd/next/es/range";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import styles from "./EdgeWidthRange.module.scss";
|
|
4
|
+
|
|
5
|
+
function EdgeWidthRange(props) {
|
|
6
|
+
var onChange = props.onChange,
|
|
7
|
+
_props$unit = props.unit,
|
|
8
|
+
unit = _props$unit === void 0 ? 'px' : _props$unit;
|
|
9
|
+
|
|
10
|
+
var _useState = useState(2),
|
|
11
|
+
value = _useState[0],
|
|
12
|
+
setValue = _useState[1];
|
|
13
|
+
|
|
14
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
15
|
+
className: styles.rangeWrapper
|
|
16
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
className: styles.range
|
|
18
|
+
}, /*#__PURE__*/React.createElement(_Range, {
|
|
19
|
+
defaultValue: value,
|
|
20
|
+
min: 1,
|
|
21
|
+
max: 10,
|
|
22
|
+
marks: [2, 3, 4, 5, 6, 7, 8, 9],
|
|
23
|
+
hasTip: false,
|
|
24
|
+
onChange: onChange,
|
|
25
|
+
onProcess: setValue
|
|
26
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: styles.value
|
|
28
|
+
}, value), /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: styles.unit
|
|
30
|
+
}, unit));
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default EdgeWidthRange;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import '~@alifd/next/variables.scss';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
.rangeWrapper {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: row;
|
|
7
|
+
|
|
8
|
+
.range {
|
|
9
|
+
flex: 1;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.value {
|
|
13
|
+
margin-left: 8px;
|
|
14
|
+
width: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.unit {
|
|
18
|
+
margin-left: 4px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
:global {
|
|
22
|
+
.#{$css-prefix}range .#{$css-prefix}range-mark {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|