@riil-frontend/component-topology 5.0.18 → 6.0.0-alpha.2
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 +29 -29
- package/es/components/VerticalIconTab/VerticalIconTab.js +58 -0
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
- package/es/components/VerticalIconTab/index.js +2 -0
- package/es/components/collapse/Collapse.js +7 -0
- package/es/components/collapse/Collapse.module.scss +33 -0
- package/es/components/collapse/CollapseFullheight.module.scss +20 -0
- package/es/components/collapse/Panel.js +3 -0
- package/es/core/common/icons/icon.js +18 -5
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +41 -10
- package/es/core/components/AlarmListPanel/components/index.module.scss +26 -0
- package/es/core/components/AlarmListPanel/index.js +9 -5
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
- package/es/core/components/TopoView/TopoView.module.scss +0 -4
- package/es/core/components/TopoView/editor.module.scss +3 -0
- package/es/core/components/TopoView/topoView.js +67 -33
- package/es/core/editor/components/Sidebar/Sidebar.js +75 -0
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +10 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +4 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +41 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +20 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +45 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +44 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +28 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +43 -0
- package/es/core/editor/components/Toolbar/EditorToolbar.js +40 -0
- package/es/core/editor/components/Toolbar/Toolbar.js +10 -0
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
- package/es/core/editor/components/Toolbar/buttons.js +36 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +23 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +17 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +17 -0
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +19 -0
- package/es/core/editor/components/Toolbar/widgets/Divider.js +10 -0
- package/es/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
- package/es/core/editor/components/Toolbar/widgets/Dropdown.js +14 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +44 -0
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +44 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +40 -0
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +35 -0
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +62 -0
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +22 -0
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +28 -0
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +47 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +42 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/SearchWidget.js +40 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.js +19 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +27 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +34 -0
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +47 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +30 -0
- package/es/core/editor/components/Toolbar/widgets/components/MenuSelect.js +20 -0
- package/es/core/editor/components/Toolbar/widgets.js +0 -0
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +24 -8
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
- package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +4 -2
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -15
- package/es/core/models/HistoryManager.js +32 -6
- package/es/core/models/SelectionManager.js +7 -0
- package/es/core/models/TopoApp.js +4 -2
- package/es/core/store/coreModels.js +5 -5
- package/es/core/store/models/displayConfig.js +2 -2
- package/es/core/store/models/historyManager.js +31 -0
- package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
- package/es/networkTopo/components/TopoView.js +2 -98
- package/es/networkTopo/components/Topology.js +3 -33
- package/es/networkTopo/components/editor/useEditorProps.js +34 -0
- package/es/networkTopo/hooks/useLinkDynamicStyle.js +1 -1
- package/es/style.js +1 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.js +74 -0
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
- package/lib/components/VerticalIconTab/index.js +11 -0
- package/lib/components/collapse/Collapse.js +15 -0
- package/lib/components/collapse/Collapse.module.scss +33 -0
- package/lib/components/collapse/CollapseFullheight.module.scss +20 -0
- package/lib/components/collapse/Panel.js +3 -0
- package/lib/core/common/icons/icon.js +20 -5
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +40 -9
- package/lib/core/components/AlarmListPanel/components/index.module.scss +26 -0
- package/lib/core/components/AlarmListPanel/index.js +10 -6
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
- package/lib/core/components/TopoView/TopoView.module.scss +0 -4
- package/lib/core/components/TopoView/editor.module.scss +3 -0
- package/lib/core/components/TopoView/topoView.js +69 -32
- package/lib/core/editor/components/Sidebar/Sidebar.js +95 -0
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +19 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +12 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +53 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +34 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +58 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +56 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +43 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +56 -0
- package/lib/{networkTopo/components/viewer/titlebar/MoreButtonMenu.js → core/editor/components/Toolbar/EditorToolbar.js} +36 -29
- package/lib/core/editor/components/Toolbar/Toolbar.js +19 -0
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
- package/lib/core/editor/components/Toolbar/buttons.js +62 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +33 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +27 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +27 -0
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +29 -0
- package/lib/core/editor/components/Toolbar/widgets/Divider.js +19 -0
- package/lib/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
- package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +26 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -0
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +58 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +54 -0
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +49 -0
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +76 -0
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +31 -0
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +38 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +40 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +64 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +59 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/SearchWidget.js +53 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.js +31 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +40 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +48 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +64 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +41 -0
- package/lib/core/editor/components/Toolbar/widgets/components/MenuSelect.js +30 -0
- package/lib/core/editor/components/Toolbar/widgets.js +1 -0
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +25 -8
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
- package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +5 -2
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -11
- package/lib/core/models/HistoryManager.js +32 -5
- package/lib/core/models/SelectionManager.js +7 -0
- package/lib/core/models/TopoApp.js +4 -1
- package/lib/core/store/coreModels.js +6 -6
- package/lib/core/store/models/displayConfig.js +2 -3
- package/lib/core/store/models/historyManager.js +41 -0
- package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
- package/lib/networkTopo/components/TopoView.js +2 -104
- package/lib/networkTopo/components/Topology.js +3 -41
- package/lib/networkTopo/components/editor/useEditorProps.js +49 -0
- package/lib/networkTopo/hooks/useLinkDynamicStyle.js +2 -2
- package/lib/style.js +1 -1
- package/package.json +3 -3
- package/es/core/components/DisplaySettingDrawer/LinkTip.js +0 -41
- package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -59
- package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -24
- package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
- package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -93
- package/es/networkTopo/components/viewer/titlebar/MoreButtonMenu.js +0 -32
- package/es/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -9
- package/es/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -30
- package/lib/core/components/DisplaySettingDrawer/LinkTip.js +0 -55
- package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -76
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -35
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -108
- package/lib/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -19
- package/lib/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -40
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _Dropdown from "@alifd/next/es/dropdown";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ArrowButton from "./ArrowButton";
|
|
4
|
+
import styles from "./ArrowPopup.module.scss";
|
|
5
|
+
/**
|
|
6
|
+
* 箭头按钮浮层
|
|
7
|
+
* @param {*} props
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
function ArrowPopup(props) {
|
|
12
|
+
var label = props.label,
|
|
13
|
+
children = props.children;
|
|
14
|
+
var trigger = /*#__PURE__*/React.createElement(ArrowButton, null, label);
|
|
15
|
+
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
16
|
+
trigger: trigger,
|
|
17
|
+
triggerType: "click"
|
|
18
|
+
}, children);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
ArrowPopup.Content = function (props) {
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
className: styles.card
|
|
24
|
+
}, props.children);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default ArrowPopup;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
min-width: 100px;
|
|
3
|
+
padding: 8px;
|
|
4
|
+
border: 1px solid var(--popup-local-border-color);
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
box-shadow: 0px 0px 10px 0px rgba(209,209,209,0.5);
|
|
7
|
+
background: var(--menu-background);
|
|
8
|
+
animation-duration: 300ms;
|
|
9
|
+
animation-timing-function: ease;
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _Icon from "@alifd/next/es/icon";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
4
|
+
var _excluded = ["active", "disabled", "showArrow", "children"];
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import classNames from 'classnames';
|
|
8
|
+
import styles from "./ButtonBox.module.scss";
|
|
9
|
+
|
|
10
|
+
function ButtonBox(props) {
|
|
11
|
+
var _classNames, _classNames2;
|
|
12
|
+
|
|
13
|
+
var active = props.active,
|
|
14
|
+
disabled = props.disabled,
|
|
15
|
+
showArrow = props.showArrow,
|
|
16
|
+
children = props.children,
|
|
17
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
18
|
+
|
|
19
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
20
|
+
className: classNames(styles.ButtonBox, (_classNames = {}, _classNames[styles.ButtonBoxActive] = active, _classNames[styles.ButtonBoxDisabled] = disabled, _classNames))
|
|
21
|
+
}, otherProps), children, showArrow && /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0", /*#__PURE__*/React.createElement(_Icon, {
|
|
22
|
+
type: "tree_fold_arrow",
|
|
23
|
+
size: "xxs",
|
|
24
|
+
className: classNames(styles.icon, (_classNames2 = {}, _classNames2[styles.active] = active, _classNames2))
|
|
25
|
+
})));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
ButtonBox.propTypes = {
|
|
29
|
+
showArrow: PropTypes.bool
|
|
30
|
+
};
|
|
31
|
+
ButtonBox.defaultProps = {
|
|
32
|
+
showArrow: false
|
|
33
|
+
};
|
|
34
|
+
export default ButtonBox;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.ButtonBox {
|
|
2
|
+
height: 24px;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
padding: 0 4px;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
|
|
9
|
+
&.ButtonBoxActive,
|
|
10
|
+
&:hover {
|
|
11
|
+
background: rgba(76, 137, 255, 0.1);
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.ButtonBoxDisabled:hover {
|
|
16
|
+
background: transparent;
|
|
17
|
+
cursor: not-allowed;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 箭头图标
|
|
23
|
+
.icon {
|
|
24
|
+
color: #909090;
|
|
25
|
+
margin-left: 4px;
|
|
26
|
+
|
|
27
|
+
&.active {
|
|
28
|
+
transform: rotate(180deg) scale(0.5) !important;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _Dropdown from "@alifd/next/es/dropdown";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import ButtonBox from "./ButtonBox";
|
|
5
|
+
import styles from "./DropdownButton.module.scss";
|
|
6
|
+
|
|
7
|
+
function DropdownButton(props) {
|
|
8
|
+
var trigger = props.trigger,
|
|
9
|
+
_props$showArrow = props.showArrow,
|
|
10
|
+
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
|
11
|
+
_props$showContainer = props.showContainer,
|
|
12
|
+
showContainer = _props$showContainer === void 0 ? true : _props$showContainer,
|
|
13
|
+
children = props.children;
|
|
14
|
+
|
|
15
|
+
var _useState = useState(false),
|
|
16
|
+
visible = _useState[0],
|
|
17
|
+
setVisible = _useState[1];
|
|
18
|
+
|
|
19
|
+
var button = /*#__PURE__*/React.createElement(ButtonBox, {
|
|
20
|
+
active: visible,
|
|
21
|
+
showArrow: showArrow
|
|
22
|
+
}, trigger);
|
|
23
|
+
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
24
|
+
visible: visible,
|
|
25
|
+
trigger: button,
|
|
26
|
+
triggerType: "click",
|
|
27
|
+
onVisibleChange: setVisible
|
|
28
|
+
}, !showContainer ? children : /*#__PURE__*/React.createElement(PopupCard, null, children));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
DropdownButton.propTypes = {
|
|
32
|
+
showArrow: PropTypes.bool,
|
|
33
|
+
showContainer: PropTypes.bool
|
|
34
|
+
};
|
|
35
|
+
DropdownButton.defaultProps = {
|
|
36
|
+
showArrow: true,
|
|
37
|
+
showContainer: true
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function PopupCard(props) {
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: styles.card
|
|
43
|
+
}, props.children);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
DropdownButton.PopupCard = PopupCard;
|
|
47
|
+
export default DropdownButton;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
.card {
|
|
2
|
+
min-width: 100px;
|
|
3
|
+
padding: 8px;
|
|
4
|
+
border: 1px solid var(--popup-local-border-color);
|
|
5
|
+
border-radius: 4px;
|
|
6
|
+
box-shadow: 0px 0px 10px 0px rgba(209,209,209,0.5);
|
|
7
|
+
background: var(--menu-background);
|
|
8
|
+
animation-duration: 300ms;
|
|
9
|
+
animation-timing-function: ease;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import _Menu from "@alifd/next/es/menu";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import DropdownButton from "./DropdownButton";
|
|
5
|
+
|
|
6
|
+
function DropdownMenu(props) {
|
|
7
|
+
var value = props.value,
|
|
8
|
+
children = props.children,
|
|
9
|
+
onChange = props.onChange,
|
|
10
|
+
valueRender = props.valueRender;
|
|
11
|
+
var selectedKeys = Array.isArray(value) ? value : [value];
|
|
12
|
+
var valueDisplay = valueRender ? valueRender(value) : value;
|
|
13
|
+
return /*#__PURE__*/React.createElement(DropdownButton, {
|
|
14
|
+
trigger: valueDisplay,
|
|
15
|
+
showContainer: false
|
|
16
|
+
}, /*#__PURE__*/React.createElement(_Menu, {
|
|
17
|
+
selectMode: "single",
|
|
18
|
+
selectedKeys: selectedKeys,
|
|
19
|
+
onSelect: onChange
|
|
20
|
+
}, children));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
DropdownButton.propTypes = {
|
|
24
|
+
valueRender: PropTypes.func
|
|
25
|
+
};
|
|
26
|
+
DropdownButton.defaultProps = {
|
|
27
|
+
valueRender: undefined
|
|
28
|
+
};
|
|
29
|
+
DropdownMenu.Item = _Menu.Item;
|
|
30
|
+
export default DropdownMenu;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import _Menu from "@alifd/next/es/menu";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import ArrowPopup from "./ArrowPopup";
|
|
4
|
+
|
|
5
|
+
function MenuSelect(props) {
|
|
6
|
+
var value = props.value,
|
|
7
|
+
children = props.children,
|
|
8
|
+
onChange = props.onChange;
|
|
9
|
+
var selectedKeys = Array.isArray(value) ? value : [value];
|
|
10
|
+
return /*#__PURE__*/React.createElement(ArrowPopup, {
|
|
11
|
+
label: value
|
|
12
|
+
}, /*#__PURE__*/React.createElement(_Menu, {
|
|
13
|
+
selectMode: "single",
|
|
14
|
+
selectedKeys: selectedKeys,
|
|
15
|
+
onSelect: onChange
|
|
16
|
+
}, children));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
MenuSelect.Option = _Menu.Item;
|
|
20
|
+
export default MenuSelect;
|
|
File without changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _Box from "@alifd/next/es/box";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _Grid from "@alifd/next/es/grid";
|
|
3
4
|
import _Form from "@alifd/next/es/form";
|
|
@@ -22,7 +23,10 @@ function SizeInput(props) {
|
|
|
22
23
|
step = props.step,
|
|
23
24
|
onChange = props.onChange,
|
|
24
25
|
lock = props.lock,
|
|
25
|
-
onLockChange = props.onLockChange
|
|
26
|
+
onLockChange = props.onLockChange,
|
|
27
|
+
_props$showLabel = props.showLabel,
|
|
28
|
+
showLabel = _props$showLabel === void 0 ? true : _props$showLabel,
|
|
29
|
+
size = props.size;
|
|
26
30
|
|
|
27
31
|
var handleChange = function handleChange(name, attrValue) {
|
|
28
32
|
var _extends2;
|
|
@@ -43,14 +47,19 @@ function SizeInput(props) {
|
|
|
43
47
|
|
|
44
48
|
return /*#__PURE__*/React.createElement(_Form, {
|
|
45
49
|
labelAlign: "top",
|
|
46
|
-
component: "div"
|
|
50
|
+
component: "div",
|
|
51
|
+
size: size
|
|
47
52
|
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
|
48
53
|
style: {
|
|
49
54
|
marginBottom: 0
|
|
50
55
|
}
|
|
51
|
-
}, /*#__PURE__*/React.createElement(
|
|
52
|
-
|
|
53
|
-
}, /*#__PURE__*/React.createElement(
|
|
56
|
+
}, /*#__PURE__*/React.createElement(_Box, {
|
|
57
|
+
direction: "row"
|
|
58
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
59
|
+
style: {
|
|
60
|
+
flex: 1
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/React.createElement(FormItem, {
|
|
54
63
|
required: true,
|
|
55
64
|
requiredTrigger: "onBlur",
|
|
56
65
|
style: {
|
|
@@ -58,11 +67,12 @@ function SizeInput(props) {
|
|
|
58
67
|
}
|
|
59
68
|
}, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
|
|
60
69
|
value: parseValue(value.width),
|
|
61
|
-
label:
|
|
70
|
+
label: showLabel ? '宽:' : '',
|
|
62
71
|
min: 1,
|
|
63
72
|
max: max,
|
|
64
73
|
step: step,
|
|
65
74
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
75
|
+
size: size,
|
|
66
76
|
style: {
|
|
67
77
|
width: '100%'
|
|
68
78
|
},
|
|
@@ -75,7 +85,11 @@ function SizeInput(props) {
|
|
|
75
85
|
}, /*#__PURE__*/React.createElement("img", {
|
|
76
86
|
src: require(lock ? './img/icon_锁.svg' : './img/icon_解锁.svg'),
|
|
77
87
|
alt: ""
|
|
78
|
-
})), /*#__PURE__*/React.createElement(
|
|
88
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
style: {
|
|
90
|
+
flex: 1
|
|
91
|
+
}
|
|
92
|
+
}, /*#__PURE__*/React.createElement(FormItem, {
|
|
79
93
|
required: true,
|
|
80
94
|
requiredTrigger: "onBlur",
|
|
81
95
|
style: {
|
|
@@ -83,11 +97,13 @@ function SizeInput(props) {
|
|
|
83
97
|
}
|
|
84
98
|
}, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
|
|
85
99
|
value: parseValue(value.height),
|
|
86
|
-
label:
|
|
100
|
+
label: showLabel ? '高:' : '' // addonTextAfter="H"
|
|
101
|
+
,
|
|
87
102
|
min: 1,
|
|
88
103
|
max: max,
|
|
89
104
|
step: step,
|
|
90
105
|
placeholder: "\u8BF7\u8F93\u5165",
|
|
106
|
+
size: size,
|
|
91
107
|
style: {
|
|
92
108
|
width: '100%'
|
|
93
109
|
},
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
|
2
3
|
import SizeInput from "../../common/SizeInput";
|
|
3
4
|
export default function BatchSetNodeSize(props) {
|
|
4
|
-
|
|
5
|
+
var size = props.size;
|
|
6
|
+
return /*#__PURE__*/React.createElement(SizeInput, _extends({}, props, {
|
|
5
7
|
value: {}
|
|
6
|
-
});
|
|
8
|
+
}));
|
|
7
9
|
}
|
|
8
10
|
;
|
|
@@ -3,19 +3,19 @@ import _Dialog from "@alifd/next/es/dialog";
|
|
|
3
3
|
import _Button from "@alifd/next/es/button";
|
|
4
4
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
-
import React from
|
|
7
|
-
import classnames from
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import classnames from 'classnames';
|
|
8
8
|
import TitleWidget from "../../../components/titlebar/widgets/TitleWidget";
|
|
9
9
|
import styles from "../../../components/titlebar/TitleBar.module.scss";
|
|
10
|
-
import { useState } from
|
|
11
|
-
import { useEffect } from
|
|
10
|
+
import { useState } from 'react';
|
|
11
|
+
import { useEffect } from 'react';
|
|
12
12
|
import DebugTools from "./widgets/DebugTools";
|
|
13
13
|
export default function TopoEditorTitleBar(props) {
|
|
14
14
|
var topo = props.topo,
|
|
15
15
|
topoEditApi = props.topoEditApi;
|
|
16
16
|
var store = topo.store;
|
|
17
17
|
|
|
18
|
-
var _store$useModel = store.useModel(
|
|
18
|
+
var _store$useModel = store.useModel('topoEdit'),
|
|
19
19
|
topoEditState = _store$useModel[0],
|
|
20
20
|
topoEditDispatchers = _store$useModel[1];
|
|
21
21
|
|
|
@@ -69,12 +69,6 @@ export default function TopoEditorTitleBar(props) {
|
|
|
69
69
|
}, /*#__PURE__*/React.createElement(DebugTools, {
|
|
70
70
|
topo: topo
|
|
71
71
|
}), /*#__PURE__*/React.createElement(_Button, {
|
|
72
|
-
type: "primary",
|
|
73
|
-
className: styles.button,
|
|
74
|
-
onClick: function onClick() {
|
|
75
|
-
topoEditApi.showGlobalAddResourceDrawer();
|
|
76
|
-
}
|
|
77
|
-
}, "\u6DFB\u52A0\u8D44\u6E90"), /*#__PURE__*/React.createElement(_Button, {
|
|
78
72
|
className: styles.button,
|
|
79
73
|
onClick: function onClick() {
|
|
80
74
|
setExitFlag(false);
|
|
@@ -84,8 +78,8 @@ export default function TopoEditorTitleBar(props) {
|
|
|
84
78
|
className: styles.button,
|
|
85
79
|
onClick: function onClick() {
|
|
86
80
|
_Dialog.confirm({
|
|
87
|
-
title:
|
|
88
|
-
content:
|
|
81
|
+
title: '提示',
|
|
82
|
+
content: '若直接退出,图上修改的内容将不会保存!',
|
|
89
83
|
onOk: function () {
|
|
90
84
|
var _onOk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
91
85
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -131,10 +125,10 @@ export default function TopoEditorTitleBar(props) {
|
|
|
131
125
|
return onCancel;
|
|
132
126
|
}(),
|
|
133
127
|
cancelProps: {
|
|
134
|
-
children:
|
|
128
|
+
children: '退出'
|
|
135
129
|
},
|
|
136
130
|
okProps: {
|
|
137
|
-
children:
|
|
131
|
+
children: '保存并退出'
|
|
138
132
|
}
|
|
139
133
|
});
|
|
140
134
|
}
|
|
@@ -10,18 +10,38 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
|
10
10
|
this.topo = topo;
|
|
11
11
|
this.htHistoryManager = htHistoryManager;
|
|
12
12
|
rlog.info('HistoryManager 初始化', htHistoryManager);
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
this.updateStore = this.updateStore.bind(this);
|
|
14
|
+
this.init();
|
|
15
|
+
}
|
|
15
16
|
|
|
16
17
|
var _proto = HistoryManager.prototype;
|
|
17
18
|
|
|
18
|
-
_proto.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
_proto.init = function init() {
|
|
20
|
+
this.htHistoryManager.addPropertyChangeListener(this.updateStore);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
_proto.destroy = function destroy() {
|
|
24
|
+
this.htHistoryManager.removePropertyChangeListener(this.updateStore);
|
|
25
|
+
this.topo.store.getModelDispatchers('historyManager').reset();
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
_proto.updateStore = function updateStore(e) {
|
|
29
|
+
var property = e.property;
|
|
30
|
+
|
|
31
|
+
if (['histories', 'historyIndex'].indexOf(property) === -1) {
|
|
22
32
|
return;
|
|
23
33
|
}
|
|
24
34
|
|
|
35
|
+
var histories = this.getHistories();
|
|
36
|
+
var historyIndex = this.getHistoryIndex();
|
|
37
|
+
var undoable = historyIndex !== -1;
|
|
38
|
+
this.topo.store.getModelDispatchers('historyManager').update({
|
|
39
|
+
undoable: undoable
|
|
40
|
+
});
|
|
41
|
+
} // 增加快捷键支持
|
|
42
|
+
;
|
|
43
|
+
|
|
44
|
+
_proto.handleKeyDown = function handleKeyDown(e) {
|
|
25
45
|
var isCtrlDown = ht.Default.isCtrlDown;
|
|
26
46
|
|
|
27
47
|
if (isCtrlDown(e)) {
|
|
@@ -138,6 +158,12 @@ var HistoryManager = /*#__PURE__*/function () {
|
|
|
138
158
|
_proto.undo = function undo() {
|
|
139
159
|
var _this3 = this;
|
|
140
160
|
|
|
161
|
+
// 事务中禁用回退
|
|
162
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
163
|
+
if (this.htHistoryManager._betweenTransaction) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
141
167
|
rlog.debug('HistoryManager.undo', this.getHistories(), this.getHistoryIndex());
|
|
142
168
|
var storeHistory = this.getCurrentStoreHistory(true);
|
|
143
169
|
|
|
@@ -51,6 +51,13 @@ var SelectionManager = /*#__PURE__*/function () {
|
|
|
51
51
|
this.removeListener();
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
+
_proto.useSelection = function useSelection() {
|
|
55
|
+
var _this$topo$store$useM = this.topo.store.useModelState('selection'),
|
|
56
|
+
selection = _this$topo$store$useM.selection;
|
|
57
|
+
|
|
58
|
+
return selection;
|
|
59
|
+
};
|
|
60
|
+
|
|
54
61
|
_proto.handleSelectionChange = function handleSelectionChange(e) {
|
|
55
62
|
rlog.info('Selection handleSelectionChange', e);
|
|
56
63
|
this.updateSelection();
|
|
@@ -19,9 +19,10 @@ import GraphDataModel from "./GraphDataModel";
|
|
|
19
19
|
import { updateEdgeExpanded } from "../utils/edgeUtil";
|
|
20
20
|
import PluginManager from "./PluginManager";
|
|
21
21
|
import topoFactory from "./topoFactory";
|
|
22
|
-
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
22
|
+
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
23
|
+
import SelectionManager from "./SelectionManager"; // eslint-disable-next-line no-undef
|
|
23
24
|
|
|
24
|
-
var version = typeof "
|
|
25
|
+
var version = typeof "6.0.0-alpha.2" === 'string' ? "6.0.0-alpha.2" : null;
|
|
25
26
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
|
26
27
|
/**
|
|
27
28
|
* 拓扑显示和编辑
|
|
@@ -77,6 +78,7 @@ var Topo = /*#__PURE__*/function () {
|
|
|
77
78
|
|
|
78
79
|
this.test = new Test(this);
|
|
79
80
|
this.uid = topoFactory.add(options.name, this);
|
|
81
|
+
this.selectionManager = new SelectionManager(this);
|
|
80
82
|
};
|
|
81
83
|
|
|
82
84
|
_proto.destroy = function destroy() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import topoMod from "./models/topoMod";
|
|
2
2
|
import customIcon from "./models/customIcon";
|
|
3
3
|
import ciModel from "./models/ciModel";
|
|
4
|
-
import selection from "./models/selection";
|
|
5
4
|
import topoBizMod from "./models/topoBizMod";
|
|
6
5
|
import topoConfig from "./models/topoConfig";
|
|
7
6
|
import topoEdit from "./models/topoEdit";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import background from "./models/background";
|
|
8
|
+
import selection from "./models/selection";
|
|
9
|
+
import historyManager from "./models/historyManager";
|
|
10
|
+
import topoGraphView from "./models/topoGraphView"; // 显示模式
|
|
11
11
|
|
|
12
12
|
import topoAlarm from "./models/topoAlarm";
|
|
13
13
|
import displayConfig from "./models/displayConfig";
|
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
selection: selection,
|
|
20
20
|
topoBizMod: topoBizMod,
|
|
21
21
|
topoConfig: topoConfig,
|
|
22
|
-
|
|
22
|
+
historyManager: historyManager,
|
|
23
23
|
background: background,
|
|
24
24
|
topoGraphView: topoGraphView,
|
|
25
25
|
ciModel: ciModel,
|
|
@@ -5,9 +5,9 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
/**
|
|
6
6
|
* 动态设置链路样式 Model
|
|
7
7
|
*/
|
|
8
|
-
import _ from 'lodash';
|
|
8
|
+
// import _ from 'lodash';
|
|
9
9
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
10
|
-
export default function (
|
|
10
|
+
export default function (topo) {
|
|
11
11
|
return {
|
|
12
12
|
// 定义 model 的初始 state
|
|
13
13
|
state: {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 动态设置链路样式 Model
|
|
5
|
+
*/
|
|
6
|
+
// import _ from 'lodash';
|
|
7
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
8
|
+
var defaultState = {
|
|
9
|
+
undoable: false,
|
|
10
|
+
redoable: false
|
|
11
|
+
};
|
|
12
|
+
export default function (topo) {
|
|
13
|
+
return {
|
|
14
|
+
// 定义 model 的初始 state
|
|
15
|
+
state: _extends({}, defaultState),
|
|
16
|
+
// 定义改变该模型状态的纯函数
|
|
17
|
+
reducers: {
|
|
18
|
+
update: function update(prevState, payload) {
|
|
19
|
+
return _extends({}, prevState, payload);
|
|
20
|
+
},
|
|
21
|
+
reset: function reset() {
|
|
22
|
+
return defaultState;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
// 定义处理该模型副作用的函数
|
|
26
|
+
effects: function effects(dispatch) {
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
;
|
|
@@ -13,7 +13,8 @@ var searchTypes = [{
|
|
|
13
13
|
function SearchWidget(props) {
|
|
14
14
|
var _topo$view$topoClient;
|
|
15
15
|
|
|
16
|
-
var topo = props.topo
|
|
16
|
+
var topo = props.topo,
|
|
17
|
+
filterProps = props.filterProps;
|
|
17
18
|
|
|
18
19
|
var _useState = useState('name'),
|
|
19
20
|
searchType = _useState[0],
|
|
@@ -60,6 +61,7 @@ function SearchWidget(props) {
|
|
|
60
61
|
onFilterChange: setSearchType,
|
|
61
62
|
onSearch: onSearch,
|
|
62
63
|
hasClear: true,
|
|
64
|
+
filterProps: filterProps,
|
|
63
65
|
style: {
|
|
64
66
|
width: '270px'
|
|
65
67
|
}
|