@hitachivantara/uikit-react-lab 5.19.0 → 5.19.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/dist/cjs/components/Dashboard/Dashboard.cjs +14 -15
- package/dist/cjs/components/Dashboard/Dashboard.cjs.map +1 -1
- package/dist/cjs/components/Dashboard/Dashboard.styles.cjs +187 -5
- package/dist/cjs/components/Dashboard/Dashboard.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Background/Background.cjs.map +1 -1
- package/dist/cjs/components/Flow/Controls/Controls.cjs +34 -13
- package/dist/cjs/components/Flow/Controls/Controls.cjs.map +1 -1
- package/dist/cjs/components/Flow/DroppableFlow.cjs +101 -66
- package/dist/cjs/components/Flow/DroppableFlow.cjs.map +1 -1
- package/dist/cjs/components/Flow/Empty/Empty.cjs +2 -8
- package/dist/cjs/components/Flow/Empty/Empty.cjs.map +1 -1
- package/dist/cjs/components/Flow/Empty/Empty.styles.cjs +1 -4
- package/dist/cjs/components/Flow/Empty/Empty.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Flow.cjs +24 -5
- package/dist/cjs/components/Flow/Flow.cjs.map +1 -1
- package/dist/cjs/components/Flow/Flow.styles.cjs +1 -4
- package/dist/cjs/components/Flow/Flow.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs +10 -7
- package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs.map +1 -1
- package/dist/cjs/components/Flow/FlowContext/NodeMetaContext.cjs +11 -6
- package/dist/cjs/components/Flow/FlowContext/NodeMetaContext.cjs.map +1 -1
- package/dist/cjs/components/Flow/Minimap/Minimap.cjs +12 -5
- package/dist/cjs/components/Flow/Minimap/Minimap.cjs.map +1 -1
- package/dist/cjs/components/Flow/Minimap/Minimap.styles.cjs +2 -7
- package/dist/cjs/components/Flow/Minimap/Minimap.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Node/BaseNode.cjs +139 -105
- package/dist/cjs/components/Flow/Node/BaseNode.cjs.map +1 -1
- package/dist/cjs/components/Flow/Node/BaseNode.styles.cjs +1 -4
- package/dist/cjs/components/Flow/Node/BaseNode.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Node/Node.cjs +65 -30
- package/dist/cjs/components/Flow/Node/Node.cjs.map +1 -1
- package/dist/cjs/components/Flow/Node/Node.styles.cjs +7 -5
- package/dist/cjs/components/Flow/Node/Node.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Node/Parameters/ParamRenderer.cjs +1 -5
- package/dist/cjs/components/Flow/Node/Parameters/ParamRenderer.cjs.map +1 -1
- package/dist/cjs/components/Flow/Node/Parameters/Select.cjs +9 -18
- package/dist/cjs/components/Flow/Node/Parameters/Select.cjs.map +1 -1
- package/dist/cjs/components/Flow/Node/Parameters/Text.cjs +3 -13
- package/dist/cjs/components/Flow/Node/Parameters/Text.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/Sidebar.cjs +78 -39
- package/dist/cjs/components/Flow/Sidebar/Sidebar.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/Sidebar.styles.cjs +4 -13
- package/dist/cjs/components/Flow/Sidebar/Sidebar.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs +28 -16
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.cjs +28 -30
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs +13 -8
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs +27 -18
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.cjs +17 -19
- package/dist/cjs/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.cjs.map +1 -1
- package/dist/cjs/components/Flow/Sidebar/utils.cjs.map +1 -1
- package/dist/cjs/components/Flow/base.cjs +406 -1
- package/dist/cjs/components/Flow/base.cjs.map +1 -1
- package/dist/cjs/components/Flow/hooks/useFlowContext.cjs.map +1 -1
- package/dist/cjs/components/Flow/hooks/useFlowNode.cjs +22 -7
- package/dist/cjs/components/Flow/hooks/useFlowNode.cjs.map +1 -1
- package/dist/cjs/components/Flow/hooks/useFlowNodeMeta.cjs +1 -3
- package/dist/cjs/components/Flow/hooks/useFlowNodeMeta.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/DefaultNavigation/DefaultNavigation.cjs +27 -30
- package/dist/cjs/components/StepNavigation/DefaultNavigation/DefaultNavigation.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/DefaultNavigation/Step/Step.cjs +45 -9
- package/dist/cjs/components/StepNavigation/DefaultNavigation/Step/Step.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/DefaultNavigation/Step/Step.styles.cjs +2 -7
- package/dist/cjs/components/StepNavigation/DefaultNavigation/Step/Step.styles.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/DefaultNavigation/utils.cjs +5 -20
- package/dist/cjs/components/StepNavigation/DefaultNavigation/utils.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/SimpleNavigation/Dot/Dot.cjs +27 -15
- package/dist/cjs/components/StepNavigation/SimpleNavigation/Dot/Dot.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/SimpleNavigation/Dot/Dot.styles.cjs +2 -8
- package/dist/cjs/components/StepNavigation/SimpleNavigation/Dot/Dot.styles.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/SimpleNavigation/SimpleNavigation.cjs +22 -26
- package/dist/cjs/components/StepNavigation/SimpleNavigation/SimpleNavigation.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/SimpleNavigation/utils.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/StepNavigation.cjs +131 -92
- package/dist/cjs/components/StepNavigation/StepNavigation.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/StepNavigation.styles.cjs +1 -4
- package/dist/cjs/components/StepNavigation/StepNavigation.styles.cjs.map +1 -1
- package/dist/cjs/components/StepNavigation/utils.cjs.map +1 -1
- package/dist/cjs/components/Wizard/Wizard.cjs +65 -30
- package/dist/cjs/components/Wizard/Wizard.cjs.map +1 -1
- package/dist/cjs/components/Wizard/Wizard.styles.cjs +1 -4
- package/dist/cjs/components/Wizard/Wizard.styles.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardActions/WizardActions.cjs +72 -27
- package/dist/cjs/components/Wizard/WizardActions/WizardActions.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardActions/WizardActions.styles.cjs +1 -4
- package/dist/cjs/components/Wizard/WizardActions/WizardActions.styles.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContainer/WizardContainer.cjs +16 -7
- package/dist/cjs/components/Wizard/WizardContainer/WizardContainer.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContainer/WizardContainer.styles.cjs +13 -13
- package/dist/cjs/components/Wizard/WizardContainer/WizardContainer.styles.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContent/LoadingContainer.cjs +24 -17
- package/dist/cjs/components/Wizard/WizardContent/LoadingContainer.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContent/LoadingContainer.styles.cjs +17 -18
- package/dist/cjs/components/Wizard/WizardContent/LoadingContainer.styles.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContent/WizardContent.cjs +70 -61
- package/dist/cjs/components/Wizard/WizardContent/WizardContent.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContent/WizardContent.styles.cjs +1 -4
- package/dist/cjs/components/Wizard/WizardContent/WizardContent.styles.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardContext/WizardContext.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardTitle/WizardTitle.cjs +53 -31
- package/dist/cjs/components/Wizard/WizardTitle/WizardTitle.cjs.map +1 -1
- package/dist/cjs/components/Wizard/WizardTitle/WizardTitle.styles.cjs +1 -4
- package/dist/cjs/components/Wizard/WizardTitle/WizardTitle.styles.cjs.map +1 -1
- package/dist/esm/components/Dashboard/Dashboard.js +14 -15
- package/dist/esm/components/Dashboard/Dashboard.js.map +1 -1
- package/dist/esm/components/Dashboard/Dashboard.styles.js +187 -5
- package/dist/esm/components/Dashboard/Dashboard.styles.js.map +1 -1
- package/dist/esm/components/Flow/Background/Background.js.map +1 -1
- package/dist/esm/components/Flow/Controls/Controls.js +34 -13
- package/dist/esm/components/Flow/Controls/Controls.js.map +1 -1
- package/dist/esm/components/Flow/DroppableFlow.js +101 -66
- package/dist/esm/components/Flow/DroppableFlow.js.map +1 -1
- package/dist/esm/components/Flow/Empty/Empty.js +2 -8
- package/dist/esm/components/Flow/Empty/Empty.js.map +1 -1
- package/dist/esm/components/Flow/Empty/Empty.styles.js +1 -4
- package/dist/esm/components/Flow/Empty/Empty.styles.js.map +1 -1
- package/dist/esm/components/Flow/Flow.js +24 -5
- package/dist/esm/components/Flow/Flow.js.map +1 -1
- package/dist/esm/components/Flow/Flow.styles.js +1 -4
- package/dist/esm/components/Flow/Flow.styles.js.map +1 -1
- package/dist/esm/components/Flow/FlowContext/FlowContext.js +10 -7
- package/dist/esm/components/Flow/FlowContext/FlowContext.js.map +1 -1
- package/dist/esm/components/Flow/FlowContext/NodeMetaContext.js +11 -6
- package/dist/esm/components/Flow/FlowContext/NodeMetaContext.js.map +1 -1
- package/dist/esm/components/Flow/Minimap/Minimap.js +12 -5
- package/dist/esm/components/Flow/Minimap/Minimap.js.map +1 -1
- package/dist/esm/components/Flow/Minimap/Minimap.styles.js +2 -7
- package/dist/esm/components/Flow/Minimap/Minimap.styles.js.map +1 -1
- package/dist/esm/components/Flow/Node/BaseNode.js +139 -105
- package/dist/esm/components/Flow/Node/BaseNode.js.map +1 -1
- package/dist/esm/components/Flow/Node/BaseNode.styles.js +1 -4
- package/dist/esm/components/Flow/Node/BaseNode.styles.js.map +1 -1
- package/dist/esm/components/Flow/Node/Node.js +65 -30
- package/dist/esm/components/Flow/Node/Node.js.map +1 -1
- package/dist/esm/components/Flow/Node/Node.styles.js +7 -5
- package/dist/esm/components/Flow/Node/Node.styles.js.map +1 -1
- package/dist/esm/components/Flow/Node/Parameters/ParamRenderer.js +1 -5
- package/dist/esm/components/Flow/Node/Parameters/ParamRenderer.js.map +1 -1
- package/dist/esm/components/Flow/Node/Parameters/Select.js +9 -18
- package/dist/esm/components/Flow/Node/Parameters/Select.js.map +1 -1
- package/dist/esm/components/Flow/Node/Parameters/Text.js +3 -13
- package/dist/esm/components/Flow/Node/Parameters/Text.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/Sidebar.js +78 -39
- package/dist/esm/components/Flow/Sidebar/Sidebar.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/Sidebar.styles.js +4 -13
- package/dist/esm/components/Flow/Sidebar/Sidebar.styles.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.js +28 -16
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.js +28 -30
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +13 -8
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js +27 -18
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.js +17 -19
- package/dist/esm/components/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.js.map +1 -1
- package/dist/esm/components/Flow/Sidebar/utils.js.map +1 -1
- package/dist/esm/components/Flow/base.js +406 -1
- package/dist/esm/components/Flow/base.js.map +1 -1
- package/dist/esm/components/Flow/hooks/useFlowContext.js.map +1 -1
- package/dist/esm/components/Flow/hooks/useFlowNode.js +22 -7
- package/dist/esm/components/Flow/hooks/useFlowNode.js.map +1 -1
- package/dist/esm/components/Flow/hooks/useFlowNodeMeta.js +1 -3
- package/dist/esm/components/Flow/hooks/useFlowNodeMeta.js.map +1 -1
- package/dist/esm/components/StepNavigation/DefaultNavigation/DefaultNavigation.js +27 -30
- package/dist/esm/components/StepNavigation/DefaultNavigation/DefaultNavigation.js.map +1 -1
- package/dist/esm/components/StepNavigation/DefaultNavigation/Step/Step.js +45 -9
- package/dist/esm/components/StepNavigation/DefaultNavigation/Step/Step.js.map +1 -1
- package/dist/esm/components/StepNavigation/DefaultNavigation/Step/Step.styles.js +2 -7
- package/dist/esm/components/StepNavigation/DefaultNavigation/Step/Step.styles.js.map +1 -1
- package/dist/esm/components/StepNavigation/DefaultNavigation/utils.js +5 -20
- package/dist/esm/components/StepNavigation/DefaultNavigation/utils.js.map +1 -1
- package/dist/esm/components/StepNavigation/SimpleNavigation/Dot/Dot.js +27 -15
- package/dist/esm/components/StepNavigation/SimpleNavigation/Dot/Dot.js.map +1 -1
- package/dist/esm/components/StepNavigation/SimpleNavigation/Dot/Dot.styles.js +2 -8
- package/dist/esm/components/StepNavigation/SimpleNavigation/Dot/Dot.styles.js.map +1 -1
- package/dist/esm/components/StepNavigation/SimpleNavigation/SimpleNavigation.js +22 -26
- package/dist/esm/components/StepNavigation/SimpleNavigation/SimpleNavigation.js.map +1 -1
- package/dist/esm/components/StepNavigation/SimpleNavigation/utils.js.map +1 -1
- package/dist/esm/components/StepNavigation/StepNavigation.js +130 -91
- package/dist/esm/components/StepNavigation/StepNavigation.js.map +1 -1
- package/dist/esm/components/StepNavigation/StepNavigation.styles.js +1 -4
- package/dist/esm/components/StepNavigation/StepNavigation.styles.js.map +1 -1
- package/dist/esm/components/StepNavigation/utils.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.js +65 -30
- package/dist/esm/components/Wizard/Wizard.js.map +1 -1
- package/dist/esm/components/Wizard/Wizard.styles.js +1 -4
- package/dist/esm/components/Wizard/Wizard.styles.js.map +1 -1
- package/dist/esm/components/Wizard/WizardActions/WizardActions.js +72 -27
- package/dist/esm/components/Wizard/WizardActions/WizardActions.js.map +1 -1
- package/dist/esm/components/Wizard/WizardActions/WizardActions.styles.js +1 -4
- package/dist/esm/components/Wizard/WizardActions/WizardActions.styles.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContainer/WizardContainer.js +16 -7
- package/dist/esm/components/Wizard/WizardContainer/WizardContainer.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContainer/WizardContainer.styles.js +13 -13
- package/dist/esm/components/Wizard/WizardContainer/WizardContainer.styles.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContent/LoadingContainer.js +24 -17
- package/dist/esm/components/Wizard/WizardContent/LoadingContainer.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContent/LoadingContainer.styles.js +18 -19
- package/dist/esm/components/Wizard/WizardContent/LoadingContainer.styles.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContent/WizardContent.js +70 -61
- package/dist/esm/components/Wizard/WizardContent/WizardContent.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContent/WizardContent.styles.js +1 -4
- package/dist/esm/components/Wizard/WizardContent/WizardContent.styles.js.map +1 -1
- package/dist/esm/components/Wizard/WizardContext/WizardContext.js.map +1 -1
- package/dist/esm/components/Wizard/WizardTitle/WizardTitle.js +53 -31
- package/dist/esm/components/Wizard/WizardTitle/WizardTitle.js.map +1 -1
- package/dist/esm/components/Wizard/WizardTitle/WizardTitle.styles.js +1 -4
- package/dist/esm/components/Wizard/WizardTitle/WizardTitle.styles.js.map +1 -1
- package/package.json +11 -11
|
@@ -1,12 +1,194 @@
|
|
|
1
1
|
import { css } from "@emotion/react";
|
|
2
2
|
import { createClasses, theme } from "@hitachivantara/uikit-react-core";
|
|
3
|
-
const {
|
|
4
|
-
staticClasses,
|
|
5
|
-
useClasses
|
|
6
|
-
} = createClasses("HvDashboard", {
|
|
3
|
+
const { staticClasses, useClasses } = createClasses("HvDashboard", {
|
|
7
4
|
root: {}
|
|
8
5
|
});
|
|
9
|
-
const gridStyles = /* @__PURE__ */ css(".react-grid-layout{position:relative;transition:height 200ms ease;}.react-grid-item{transition:all 200ms ease;transition-property:left,top,width,height;}.react-grid-item img{pointer-events:none;user-select:none;}.react-grid-item.cssTransforms{transition-property:transform,width,height;}.react-grid-item.resizing{transition:none;z-index:1;will-change:width,height;}.react-grid-item.react-draggable-dragging{transition:none;z-index:3;will-change:transform;}.react-grid-item.dropping{visibility:hidden;}.react-grid-item.react-grid-placeholder{background:", theme.colors.primary_20, ';transition-duration:100ms;z-index:2;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;}.react-grid-item.react-grid-placeholder.placeholder-resizing{transition:none;}.react-grid-item>.react-resizable-handle{position:absolute;width:20px;height:20px;}.react-grid-item>.react-resizable-handle::after{content:"";position:absolute;right:3px;bottom:3px;width:5px;height:5px;border-right:2px solid rgba(0, 0, 0, 0.4);border-bottom:2px solid rgba(0, 0, 0, 0.4);}.react-resizable-hide>.react-resizable-handle{display:none;}.react-grid-item>.react-resizable-handle.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg);}.react-grid-item>.react-resizable-handle.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize;}.react-grid-item>.react-resizable-handle.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg);}.react-grid-item>.react-resizable-handle.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg);}.react-grid-item>.react-resizable-handle.react-resizable-handle-w,.react-grid-item>.react-resizable-handle.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize;}.react-grid-item>.react-resizable-handle.react-resizable-handle-w{left:0;transform:rotate(135deg);}.react-grid-item>.react-resizable-handle.react-resizable-handle-e{right:0;transform:rotate(315deg);}.react-grid-item>.react-resizable-handle.react-resizable-handle-n,.react-grid-item>.react-resizable-handle.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize;}.react-grid-item>.react-resizable-handle.react-resizable-handle-n{top:0;transform:rotate(225deg);}.react-grid-item>.react-resizable-handle.react-resizable-handle-s{bottom:0;transform:rotate(45deg);}.react-resizable{position:relative;}.react-resizable-handle{position:absolute;width:20px;height:20px;background-repeat:no-repeat;background-origin:content-box;box-sizing:border-box;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+");background-position:bottom right;padding:0 3px 3px 0;}.react-resizable-handle-sw{bottom:0;left:0;cursor:sw-resize;transform:rotate(90deg);}.react-resizable-handle-se{bottom:0;right:0;cursor:se-resize;}.react-resizable-handle-nw{top:0;left:0;cursor:nw-resize;transform:rotate(180deg);}.react-resizable-handle-ne{top:0;right:0;cursor:ne-resize;transform:rotate(270deg);}.react-resizable-handle-w,.react-resizable-handle-e{top:50%;margin-top:-10px;cursor:ew-resize;}.react-resizable-handle-w{left:0;transform:rotate(135deg);}.react-resizable-handle-e{right:0;transform:rotate(315deg);}.react-resizable-handle-n,.react-resizable-handle-s{left:50%;margin-left:-10px;cursor:ns-resize;}.react-resizable-handle-n{top:0;transform:rotate(225deg);}.react-resizable-handle-s{bottom:0;transform:rotate(45deg);}' + (process.env.NODE_ENV === "production" ? "" : ";label:gridStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9ob21lL3J1bm5lci93b3JrL2h2LXVpa2l0LXJlYWN0L2h2LXVpa2l0LXJlYWN0L3BhY2thZ2VzL2xhYi9zcmMvY29tcG9uZW50cy9EYXNoYm9hcmQvRGFzaGJvYXJkLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPNkIiLCJmaWxlIjoiL2hvbWUvcnVubmVyL3dvcmsvaHYtdWlraXQtcmVhY3QvaHYtdWlraXQtcmVhY3QvcGFja2FnZXMvbGFiL3NyYy9jb21wb25lbnRzL0Rhc2hib2FyZC9EYXNoYm9hcmQuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL3JlYWN0XCI7XG5pbXBvcnQgeyBjcmVhdGVDbGFzc2VzLCB0aGVtZSB9IGZyb20gXCJAaGl0YWNoaXZhbnRhcmEvdWlraXQtcmVhY3QtY29yZVwiO1xuXG5leHBvcnQgY29uc3QgeyBzdGF0aWNDbGFzc2VzLCB1c2VDbGFzc2VzIH0gPSBjcmVhdGVDbGFzc2VzKFwiSHZEYXNoYm9hcmRcIiwge1xuICByb290OiB7fSxcbn0pO1xu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206IDA7XG4gICAgdHJhbnNmb3JtOiByb3RhdGUoNDVkZWcpO1xuICB9XG5gO1xuIl19 */");
|
|
6
|
+
const gridStyles = css`
|
|
7
|
+
.react-grid-layout {
|
|
8
|
+
position: relative;
|
|
9
|
+
transition: height 200ms ease;
|
|
10
|
+
}
|
|
11
|
+
.react-grid-item {
|
|
12
|
+
transition: all 200ms ease;
|
|
13
|
+
transition-property: left, top, width, height;
|
|
14
|
+
}
|
|
15
|
+
.react-grid-item img {
|
|
16
|
+
pointer-events: none;
|
|
17
|
+
user-select: none;
|
|
18
|
+
}
|
|
19
|
+
.react-grid-item.cssTransforms {
|
|
20
|
+
transition-property: transform, width, height;
|
|
21
|
+
}
|
|
22
|
+
.react-grid-item.resizing {
|
|
23
|
+
transition: none;
|
|
24
|
+
z-index: 1;
|
|
25
|
+
will-change: width, height;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.react-grid-item.react-draggable-dragging {
|
|
29
|
+
transition: none;
|
|
30
|
+
z-index: 3;
|
|
31
|
+
will-change: transform;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.react-grid-item.dropping {
|
|
35
|
+
visibility: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.react-grid-item.react-grid-placeholder {
|
|
39
|
+
background: ${theme.colors.primary_20};
|
|
40
|
+
transition-duration: 100ms;
|
|
41
|
+
z-index: 2;
|
|
42
|
+
-webkit-user-select: none;
|
|
43
|
+
-moz-user-select: none;
|
|
44
|
+
-ms-user-select: none;
|
|
45
|
+
-o-user-select: none;
|
|
46
|
+
user-select: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.react-grid-item.react-grid-placeholder.placeholder-resizing {
|
|
50
|
+
transition: none;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.react-grid-item > .react-resizable-handle {
|
|
54
|
+
position: absolute;
|
|
55
|
+
width: 20px;
|
|
56
|
+
height: 20px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.react-grid-item > .react-resizable-handle::after {
|
|
60
|
+
content: "";
|
|
61
|
+
position: absolute;
|
|
62
|
+
right: 3px;
|
|
63
|
+
bottom: 3px;
|
|
64
|
+
width: 5px;
|
|
65
|
+
height: 5px;
|
|
66
|
+
border-right: 2px solid rgba(0, 0, 0, 0.4);
|
|
67
|
+
border-bottom: 2px solid rgba(0, 0, 0, 0.4);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.react-resizable-hide > .react-resizable-handle {
|
|
71
|
+
display: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
|
|
75
|
+
bottom: 0;
|
|
76
|
+
left: 0;
|
|
77
|
+
cursor: sw-resize;
|
|
78
|
+
transform: rotate(90deg);
|
|
79
|
+
}
|
|
80
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-se {
|
|
81
|
+
bottom: 0;
|
|
82
|
+
right: 0;
|
|
83
|
+
cursor: se-resize;
|
|
84
|
+
}
|
|
85
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
|
|
86
|
+
top: 0;
|
|
87
|
+
left: 0;
|
|
88
|
+
cursor: nw-resize;
|
|
89
|
+
transform: rotate(180deg);
|
|
90
|
+
}
|
|
91
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
|
|
92
|
+
top: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
cursor: ne-resize;
|
|
95
|
+
transform: rotate(270deg);
|
|
96
|
+
}
|
|
97
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-w,
|
|
98
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
|
|
99
|
+
top: 50%;
|
|
100
|
+
margin-top: -10px;
|
|
101
|
+
cursor: ew-resize;
|
|
102
|
+
}
|
|
103
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-w {
|
|
104
|
+
left: 0;
|
|
105
|
+
transform: rotate(135deg);
|
|
106
|
+
}
|
|
107
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-e {
|
|
108
|
+
right: 0;
|
|
109
|
+
transform: rotate(315deg);
|
|
110
|
+
}
|
|
111
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-n,
|
|
112
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
|
|
113
|
+
left: 50%;
|
|
114
|
+
margin-left: -10px;
|
|
115
|
+
cursor: ns-resize;
|
|
116
|
+
}
|
|
117
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-n {
|
|
118
|
+
top: 0;
|
|
119
|
+
transform: rotate(225deg);
|
|
120
|
+
}
|
|
121
|
+
.react-grid-item > .react-resizable-handle.react-resizable-handle-s {
|
|
122
|
+
bottom: 0;
|
|
123
|
+
transform: rotate(45deg);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.react-resizable {
|
|
127
|
+
position: relative;
|
|
128
|
+
}
|
|
129
|
+
.react-resizable-handle {
|
|
130
|
+
position: absolute;
|
|
131
|
+
width: 20px;
|
|
132
|
+
height: 20px;
|
|
133
|
+
background-repeat: no-repeat;
|
|
134
|
+
background-origin: content-box;
|
|
135
|
+
box-sizing: border-box;
|
|
136
|
+
background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+");
|
|
137
|
+
background-position: bottom right;
|
|
138
|
+
padding: 0 3px 3px 0;
|
|
139
|
+
}
|
|
140
|
+
.react-resizable-handle-sw {
|
|
141
|
+
bottom: 0;
|
|
142
|
+
left: 0;
|
|
143
|
+
cursor: sw-resize;
|
|
144
|
+
transform: rotate(90deg);
|
|
145
|
+
}
|
|
146
|
+
.react-resizable-handle-se {
|
|
147
|
+
bottom: 0;
|
|
148
|
+
right: 0;
|
|
149
|
+
cursor: se-resize;
|
|
150
|
+
}
|
|
151
|
+
.react-resizable-handle-nw {
|
|
152
|
+
top: 0;
|
|
153
|
+
left: 0;
|
|
154
|
+
cursor: nw-resize;
|
|
155
|
+
transform: rotate(180deg);
|
|
156
|
+
}
|
|
157
|
+
.react-resizable-handle-ne {
|
|
158
|
+
top: 0;
|
|
159
|
+
right: 0;
|
|
160
|
+
cursor: ne-resize;
|
|
161
|
+
transform: rotate(270deg);
|
|
162
|
+
}
|
|
163
|
+
.react-resizable-handle-w,
|
|
164
|
+
.react-resizable-handle-e {
|
|
165
|
+
top: 50%;
|
|
166
|
+
margin-top: -10px;
|
|
167
|
+
cursor: ew-resize;
|
|
168
|
+
}
|
|
169
|
+
.react-resizable-handle-w {
|
|
170
|
+
left: 0;
|
|
171
|
+
transform: rotate(135deg);
|
|
172
|
+
}
|
|
173
|
+
.react-resizable-handle-e {
|
|
174
|
+
right: 0;
|
|
175
|
+
transform: rotate(315deg);
|
|
176
|
+
}
|
|
177
|
+
.react-resizable-handle-n,
|
|
178
|
+
.react-resizable-handle-s {
|
|
179
|
+
left: 50%;
|
|
180
|
+
margin-left: -10px;
|
|
181
|
+
cursor: ns-resize;
|
|
182
|
+
}
|
|
183
|
+
.react-resizable-handle-n {
|
|
184
|
+
top: 0;
|
|
185
|
+
transform: rotate(225deg);
|
|
186
|
+
}
|
|
187
|
+
.react-resizable-handle-s {
|
|
188
|
+
bottom: 0;
|
|
189
|
+
transform: rotate(45deg);
|
|
190
|
+
}
|
|
191
|
+
`;
|
|
10
192
|
export {
|
|
11
193
|
gridStyles,
|
|
12
194
|
staticClasses,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dashboard.styles.js","sources":["../../../../src/components/Dashboard/Dashboard.styles.ts"],"sourcesContent":["import { css } from \"@emotion/react\";\nimport { createClasses, theme } from \"@hitachivantara/uikit-react-core\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDashboard\", {\n root: {},\n});\n\nexport const gridStyles = css`\n .react-grid-layout {\n position: relative;\n transition: height 200ms ease;\n }\n .react-grid-item {\n transition: all 200ms ease;\n transition-property: left, top, width, height;\n }\n .react-grid-item img {\n pointer-events: none;\n user-select: none;\n }\n .react-grid-item.cssTransforms {\n transition-property: transform, width, height;\n }\n .react-grid-item.resizing {\n transition: none;\n z-index: 1;\n will-change: width, height;\n }\n\n .react-grid-item.react-draggable-dragging {\n transition: none;\n z-index: 3;\n will-change: transform;\n }\n\n .react-grid-item.dropping {\n visibility: hidden;\n }\n\n .react-grid-item.react-grid-placeholder {\n background: ${theme.colors.primary_20};\n transition-duration: 100ms;\n z-index: 2;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n }\n\n .react-grid-item.react-grid-placeholder.placeholder-resizing {\n transition: none;\n }\n\n .react-grid-item > .react-resizable-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n }\n\n .react-grid-item > .react-resizable-handle::after {\n content: \"\";\n position: absolute;\n right: 3px;\n bottom: 3px;\n width: 5px;\n height: 5px;\n border-right: 2px solid rgba(0, 0, 0, 0.4);\n border-bottom: 2px solid rgba(0, 0, 0, 0.4);\n }\n\n .react-resizable-hide > .react-resizable-handle {\n display: none;\n }\n\n .react-grid-item > .react-resizable-handle.react-resizable-handle-sw {\n bottom: 0;\n left: 0;\n cursor: sw-resize;\n transform: rotate(90deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-se {\n bottom: 0;\n right: 0;\n cursor: se-resize;\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-nw {\n top: 0;\n left: 0;\n cursor: nw-resize;\n transform: rotate(180deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-ne {\n top: 0;\n right: 0;\n cursor: ne-resize;\n transform: rotate(270deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-w,\n .react-grid-item > .react-resizable-handle.react-resizable-handle-e {\n top: 50%;\n margin-top: -10px;\n cursor: ew-resize;\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-w {\n left: 0;\n transform: rotate(135deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-e {\n right: 0;\n transform: rotate(315deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-n,\n .react-grid-item > .react-resizable-handle.react-resizable-handle-s {\n left: 50%;\n margin-left: -10px;\n cursor: ns-resize;\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-n {\n top: 0;\n transform: rotate(225deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-s {\n bottom: 0;\n transform: rotate(45deg);\n }\n\n .react-resizable {\n position: relative;\n }\n .react-resizable-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-repeat: no-repeat;\n background-origin: content-box;\n box-sizing: border-box;\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+\");\n background-position: bottom right;\n padding: 0 3px 3px 0;\n }\n .react-resizable-handle-sw {\n bottom: 0;\n left: 0;\n cursor: sw-resize;\n transform: rotate(90deg);\n }\n .react-resizable-handle-se {\n bottom: 0;\n right: 0;\n cursor: se-resize;\n }\n .react-resizable-handle-nw {\n top: 0;\n left: 0;\n cursor: nw-resize;\n transform: rotate(180deg);\n }\n .react-resizable-handle-ne {\n top: 0;\n right: 0;\n cursor: ne-resize;\n transform: rotate(270deg);\n }\n .react-resizable-handle-w,\n .react-resizable-handle-e {\n top: 50%;\n margin-top: -10px;\n cursor: ew-resize;\n }\n .react-resizable-handle-w {\n left: 0;\n transform: rotate(135deg);\n }\n .react-resizable-handle-e {\n right: 0;\n transform: rotate(315deg);\n }\n .react-resizable-handle-n,\n .react-resizable-handle-s {\n left: 50%;\n margin-left: -10px;\n cursor: ns-resize;\n }\n .react-resizable-handle-n {\n top: 0;\n transform: rotate(225deg);\n }\n .react-resizable-handle-s {\n bottom: 0;\n transform: rotate(45deg);\n }\n`;\n"],"names":[
|
|
1
|
+
{"version":3,"file":"Dashboard.styles.js","sources":["../../../../src/components/Dashboard/Dashboard.styles.ts"],"sourcesContent":["import { css } from \"@emotion/react\";\nimport { createClasses, theme } from \"@hitachivantara/uikit-react-core\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvDashboard\", {\n root: {},\n});\n\nexport const gridStyles = css`\n .react-grid-layout {\n position: relative;\n transition: height 200ms ease;\n }\n .react-grid-item {\n transition: all 200ms ease;\n transition-property: left, top, width, height;\n }\n .react-grid-item img {\n pointer-events: none;\n user-select: none;\n }\n .react-grid-item.cssTransforms {\n transition-property: transform, width, height;\n }\n .react-grid-item.resizing {\n transition: none;\n z-index: 1;\n will-change: width, height;\n }\n\n .react-grid-item.react-draggable-dragging {\n transition: none;\n z-index: 3;\n will-change: transform;\n }\n\n .react-grid-item.dropping {\n visibility: hidden;\n }\n\n .react-grid-item.react-grid-placeholder {\n background: ${theme.colors.primary_20};\n transition-duration: 100ms;\n z-index: 2;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n }\n\n .react-grid-item.react-grid-placeholder.placeholder-resizing {\n transition: none;\n }\n\n .react-grid-item > .react-resizable-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n }\n\n .react-grid-item > .react-resizable-handle::after {\n content: \"\";\n position: absolute;\n right: 3px;\n bottom: 3px;\n width: 5px;\n height: 5px;\n border-right: 2px solid rgba(0, 0, 0, 0.4);\n border-bottom: 2px solid rgba(0, 0, 0, 0.4);\n }\n\n .react-resizable-hide > .react-resizable-handle {\n display: none;\n }\n\n .react-grid-item > .react-resizable-handle.react-resizable-handle-sw {\n bottom: 0;\n left: 0;\n cursor: sw-resize;\n transform: rotate(90deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-se {\n bottom: 0;\n right: 0;\n cursor: se-resize;\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-nw {\n top: 0;\n left: 0;\n cursor: nw-resize;\n transform: rotate(180deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-ne {\n top: 0;\n right: 0;\n cursor: ne-resize;\n transform: rotate(270deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-w,\n .react-grid-item > .react-resizable-handle.react-resizable-handle-e {\n top: 50%;\n margin-top: -10px;\n cursor: ew-resize;\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-w {\n left: 0;\n transform: rotate(135deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-e {\n right: 0;\n transform: rotate(315deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-n,\n .react-grid-item > .react-resizable-handle.react-resizable-handle-s {\n left: 50%;\n margin-left: -10px;\n cursor: ns-resize;\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-n {\n top: 0;\n transform: rotate(225deg);\n }\n .react-grid-item > .react-resizable-handle.react-resizable-handle-s {\n bottom: 0;\n transform: rotate(45deg);\n }\n\n .react-resizable {\n position: relative;\n }\n .react-resizable-handle {\n position: absolute;\n width: 20px;\n height: 20px;\n background-repeat: no-repeat;\n background-origin: content-box;\n box-sizing: border-box;\n background-image: url(\"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+\");\n background-position: bottom right;\n padding: 0 3px 3px 0;\n }\n .react-resizable-handle-sw {\n bottom: 0;\n left: 0;\n cursor: sw-resize;\n transform: rotate(90deg);\n }\n .react-resizable-handle-se {\n bottom: 0;\n right: 0;\n cursor: se-resize;\n }\n .react-resizable-handle-nw {\n top: 0;\n left: 0;\n cursor: nw-resize;\n transform: rotate(180deg);\n }\n .react-resizable-handle-ne {\n top: 0;\n right: 0;\n cursor: ne-resize;\n transform: rotate(270deg);\n }\n .react-resizable-handle-w,\n .react-resizable-handle-e {\n top: 50%;\n margin-top: -10px;\n cursor: ew-resize;\n }\n .react-resizable-handle-w {\n left: 0;\n transform: rotate(135deg);\n }\n .react-resizable-handle-e {\n right: 0;\n transform: rotate(315deg);\n }\n .react-resizable-handle-n,\n .react-resizable-handle-s {\n left: 50%;\n margin-left: -10px;\n cursor: ns-resize;\n }\n .react-resizable-handle-n {\n top: 0;\n transform: rotate(225deg);\n }\n .react-resizable-handle-s {\n bottom: 0;\n transform: rotate(45deg);\n }\n`;\n"],"names":[],"mappings":";;AAGO,MAAM,EAAE,eAAe,eAAe,cAAc,eAAe;AAAA,EACxE,MAAM,CAAC;AACT,CAAC;AAEM,MAAM,aAAa;AA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Content":["import { Background, BackgroundProps } from \"reactflow\";\n\nimport { HvColorAny, getColor, theme } from \"@hitachivantara/uikit-styles\";\n\nexport interface HvFlowBackgroundProps extends Omit<BackgroundProps, \"color\"> {\n /** Color for the background dots. Defaults to `secondary`. */\n color?: HvColorAny;\n}\n\nexport const HvFlowBackground = ({\n color = \"secondary\",\n ...others\n}: HvFlowBackgroundProps) => {\n return (\n <Background color={getColor(color, theme.colors.secondary)} {...others} />\n );\n};\n"],"names":[
|
|
1
|
+
{"version":3,"file":"Background.js","sources":["../../../../../src/components/Flow/Background/Background.tsx"],"sourcesContent":["import { Background, BackgroundProps } from \"reactflow\";\n\nimport { HvColorAny, getColor, theme } from \"@hitachivantara/uikit-styles\";\n\nexport interface HvFlowBackgroundProps extends Omit<BackgroundProps, \"color\"> {\n /** Color for the background dots. Defaults to `secondary`. */\n color?: HvColorAny;\n}\n\nexport const HvFlowBackground = ({\n color = \"secondary\",\n ...others\n}: HvFlowBackgroundProps) => {\n return (\n <Background color={getColor(color, theme.colors.secondary)} {...others} />\n );\n};\n"],"names":[],"mappings":";;;AASO,MAAM,mBAAmB,CAAC;AAAA,EAC/B,QAAQ;AAAA,EACR,GAAG;AACL,MAA6B;AAEzB,SAAA,oBAAC,YAAW,EAAA,OAAO,SAAS,OAAO,MAAM,OAAO,SAAS,GAAI,GAAG,OAAQ,CAAA;AAE5E;"}
|
|
@@ -29,17 +29,12 @@ const HvFlowControls = ({
|
|
|
29
29
|
children,
|
|
30
30
|
...others
|
|
31
31
|
}) => {
|
|
32
|
-
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = useStore(selector, shallow);
|
|
32
|
+
const { isInteractive, minZoomReached, maxZoomReached } = useStore(
|
|
33
|
+
selector,
|
|
34
|
+
shallow
|
|
35
|
+
);
|
|
37
36
|
const store = useStoreApi();
|
|
38
|
-
const {
|
|
39
|
-
zoomIn,
|
|
40
|
-
zoomOut,
|
|
41
|
-
fitView
|
|
42
|
-
} = useReactFlow();
|
|
37
|
+
const { zoomIn, zoomOut, fitView } = useReactFlow();
|
|
43
38
|
const labels = useLabels(DEFAULT_LABELS, labelsProps);
|
|
44
39
|
const handleZoomIn = () => {
|
|
45
40
|
zoomIn();
|
|
@@ -62,10 +57,36 @@ const HvFlowControls = ({
|
|
|
62
57
|
onInteractiveChange?.(!isInteractive);
|
|
63
58
|
};
|
|
64
59
|
return /* @__PURE__ */ jsx(Panel, { position, ...others, children: /* @__PURE__ */ jsxs(HvMultiButton, { vertical: orientation === "vertical", children: [
|
|
65
|
-
!hideZoom && /* @__PURE__ */ jsx(
|
|
66
|
-
|
|
60
|
+
!hideZoom && /* @__PURE__ */ jsx(
|
|
61
|
+
HvButton,
|
|
62
|
+
{
|
|
63
|
+
icon: true,
|
|
64
|
+
title: labels?.zoomIn,
|
|
65
|
+
onClick: handleZoomIn,
|
|
66
|
+
disabled: maxZoomReached,
|
|
67
|
+
children: /* @__PURE__ */ jsx(ZoomIn, { role: "none" })
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
!hideZoom && /* @__PURE__ */ jsx(
|
|
71
|
+
HvButton,
|
|
72
|
+
{
|
|
73
|
+
icon: true,
|
|
74
|
+
title: labels?.zoomOut,
|
|
75
|
+
onClick: handleZoomOut,
|
|
76
|
+
disabled: minZoomReached,
|
|
77
|
+
children: /* @__PURE__ */ jsx(ZoomOut, { role: "none" })
|
|
78
|
+
}
|
|
79
|
+
),
|
|
67
80
|
!hideFitView && /* @__PURE__ */ jsx(HvButton, { icon: true, title: labels?.fitView, onClick: handleFitView, children: /* @__PURE__ */ jsx(Focus, { role: "none" }) }),
|
|
68
|
-
!hideInteractive && /* @__PURE__ */ jsx(
|
|
81
|
+
!hideInteractive && /* @__PURE__ */ jsx(
|
|
82
|
+
HvButton,
|
|
83
|
+
{
|
|
84
|
+
icon: true,
|
|
85
|
+
title: labels?.interactive,
|
|
86
|
+
onClick: handleInteractive,
|
|
87
|
+
children: isInteractive ? /* @__PURE__ */ jsx(Unlock, { role: "none" }) : /* @__PURE__ */ jsx(Lock, { role: "none" })
|
|
88
|
+
}
|
|
89
|
+
),
|
|
69
90
|
children
|
|
70
91
|
] }) });
|
|
71
92
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Controls.js","sources":["../../../../../src/components/Flow/Controls/Controls.tsx"],"sourcesContent":["import {\n ControlProps,\n Panel,\n PanelPosition,\n ReactFlowState,\n useReactFlow,\n useStore,\n useStoreApi,\n} from \"reactflow\";\n\nimport { shallow } from \"zustand/shallow\";\n\nimport {\n HvButton,\n HvMultiButton,\n useLabels,\n} from \"@hitachivantara/uikit-react-core\";\nimport {\n Focus,\n Lock,\n Unlock,\n ZoomIn,\n ZoomOut,\n} from \"@hitachivantara/uikit-react-icons\";\n\nexport type HvFlowControlsPosition = PanelPosition;\n\nexport interface HvFlowControlsProps\n extends Omit<\n ControlProps,\n \"position\" | \"showFitView\" | \"showInteractive\" | \"showZoom\"\n > {\n /** Controls position. Defaults to `bottom-center`. */\n position?: HvFlowControlsPosition;\n /** Controls orientation. Defaults to `horizontal`. */\n orientation?: \"vertical\" | \"horizontal\";\n /** Labels used on the controls buttons. */\n labels?: {\n zoomIn?: string;\n zoomOut?: string;\n fitView?: string;\n interactive?: string;\n };\n /** Whether to hide the zoom controls. */\n hideZoom?: boolean;\n /** Whether to hide the fit view controls. */\n hideFitView?: boolean;\n /** Whether to hide the interactive controls. */\n hideInteractive?: boolean;\n}\n\nconst DEFAULT_LABELS: HvFlowControlsProps[\"labels\"] = {\n fitView: \"Fit view\",\n zoomIn: \"Zoom in\",\n zoomOut: \"Zoom out\",\n interactive: \"Interactive\",\n};\n\nconst selector = (state: ReactFlowState) => ({\n isInteractive:\n state.nodesDraggable || state.nodesConnectable || state.elementsSelectable,\n minZoomReached: state.transform[2] <= state.minZoom,\n maxZoomReached: state.transform[2] >= state.maxZoom,\n});\n\nexport const HvFlowControls = ({\n onZoomIn: onZoomInProp,\n onZoomOut: onZoomOutProp,\n onFitView: onFitViewProp,\n labels: labelsProps,\n hideInteractive,\n hideFitView,\n hideZoom,\n position = \"bottom-center\",\n orientation = \"horizontal\",\n onInteractiveChange,\n fitViewOptions,\n children,\n ...others\n}: HvFlowControlsProps) => {\n const { isInteractive, minZoomReached, maxZoomReached } = useStore(\n selector,\n shallow\n );\n const store = useStoreApi();\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n\n const labels = useLabels(DEFAULT_LABELS, labelsProps);\n\n const handleZoomIn = () => {\n zoomIn();\n onZoomInProp?.();\n };\n\n const handleZoomOut = () => {\n zoomOut();\n onZoomOutProp?.();\n };\n\n const handleFitView = () => {\n fitView(fitViewOptions);\n onFitViewProp?.();\n };\n\n const handleInteractive = () => {\n store.setState({\n nodesDraggable: !isInteractive,\n nodesConnectable: !isInteractive,\n elementsSelectable: !isInteractive,\n });\n\n onInteractiveChange?.(!isInteractive);\n };\n\n return (\n <Panel position={position} {...others}>\n <HvMultiButton vertical={orientation === \"vertical\"}>\n {!hideZoom && (\n <HvButton\n icon\n title={labels?.zoomIn}\n onClick={handleZoomIn}\n disabled={maxZoomReached}\n >\n <ZoomIn role=\"none\" />\n </HvButton>\n )}\n {!hideZoom && (\n <HvButton\n icon\n title={labels?.zoomOut}\n onClick={handleZoomOut}\n disabled={minZoomReached}\n >\n <ZoomOut role=\"none\" />\n </HvButton>\n )}\n {!hideFitView && (\n <HvButton icon title={labels?.fitView} onClick={handleFitView}>\n <Focus role=\"none\" />\n </HvButton>\n )}\n {!hideInteractive && (\n <HvButton\n icon\n title={labels?.interactive}\n onClick={handleInteractive}\n >\n {isInteractive ? <Unlock role=\"none\" /> : <Lock role=\"none\" />}\n </HvButton>\n )}\n {children}\n </HvMultiButton>\n </Panel>\n );\n};\n"],"names":[
|
|
1
|
+
{"version":3,"file":"Controls.js","sources":["../../../../../src/components/Flow/Controls/Controls.tsx"],"sourcesContent":["import {\n ControlProps,\n Panel,\n PanelPosition,\n ReactFlowState,\n useReactFlow,\n useStore,\n useStoreApi,\n} from \"reactflow\";\n\nimport { shallow } from \"zustand/shallow\";\n\nimport {\n HvButton,\n HvMultiButton,\n useLabels,\n} from \"@hitachivantara/uikit-react-core\";\nimport {\n Focus,\n Lock,\n Unlock,\n ZoomIn,\n ZoomOut,\n} from \"@hitachivantara/uikit-react-icons\";\n\nexport type HvFlowControlsPosition = PanelPosition;\n\nexport interface HvFlowControlsProps\n extends Omit<\n ControlProps,\n \"position\" | \"showFitView\" | \"showInteractive\" | \"showZoom\"\n > {\n /** Controls position. Defaults to `bottom-center`. */\n position?: HvFlowControlsPosition;\n /** Controls orientation. Defaults to `horizontal`. */\n orientation?: \"vertical\" | \"horizontal\";\n /** Labels used on the controls buttons. */\n labels?: {\n zoomIn?: string;\n zoomOut?: string;\n fitView?: string;\n interactive?: string;\n };\n /** Whether to hide the zoom controls. */\n hideZoom?: boolean;\n /** Whether to hide the fit view controls. */\n hideFitView?: boolean;\n /** Whether to hide the interactive controls. */\n hideInteractive?: boolean;\n}\n\nconst DEFAULT_LABELS: HvFlowControlsProps[\"labels\"] = {\n fitView: \"Fit view\",\n zoomIn: \"Zoom in\",\n zoomOut: \"Zoom out\",\n interactive: \"Interactive\",\n};\n\nconst selector = (state: ReactFlowState) => ({\n isInteractive:\n state.nodesDraggable || state.nodesConnectable || state.elementsSelectable,\n minZoomReached: state.transform[2] <= state.minZoom,\n maxZoomReached: state.transform[2] >= state.maxZoom,\n});\n\nexport const HvFlowControls = ({\n onZoomIn: onZoomInProp,\n onZoomOut: onZoomOutProp,\n onFitView: onFitViewProp,\n labels: labelsProps,\n hideInteractive,\n hideFitView,\n hideZoom,\n position = \"bottom-center\",\n orientation = \"horizontal\",\n onInteractiveChange,\n fitViewOptions,\n children,\n ...others\n}: HvFlowControlsProps) => {\n const { isInteractive, minZoomReached, maxZoomReached } = useStore(\n selector,\n shallow\n );\n const store = useStoreApi();\n const { zoomIn, zoomOut, fitView } = useReactFlow();\n\n const labels = useLabels(DEFAULT_LABELS, labelsProps);\n\n const handleZoomIn = () => {\n zoomIn();\n onZoomInProp?.();\n };\n\n const handleZoomOut = () => {\n zoomOut();\n onZoomOutProp?.();\n };\n\n const handleFitView = () => {\n fitView(fitViewOptions);\n onFitViewProp?.();\n };\n\n const handleInteractive = () => {\n store.setState({\n nodesDraggable: !isInteractive,\n nodesConnectable: !isInteractive,\n elementsSelectable: !isInteractive,\n });\n\n onInteractiveChange?.(!isInteractive);\n };\n\n return (\n <Panel position={position} {...others}>\n <HvMultiButton vertical={orientation === \"vertical\"}>\n {!hideZoom && (\n <HvButton\n icon\n title={labels?.zoomIn}\n onClick={handleZoomIn}\n disabled={maxZoomReached}\n >\n <ZoomIn role=\"none\" />\n </HvButton>\n )}\n {!hideZoom && (\n <HvButton\n icon\n title={labels?.zoomOut}\n onClick={handleZoomOut}\n disabled={minZoomReached}\n >\n <ZoomOut role=\"none\" />\n </HvButton>\n )}\n {!hideFitView && (\n <HvButton icon title={labels?.fitView} onClick={handleFitView}>\n <Focus role=\"none\" />\n </HvButton>\n )}\n {!hideInteractive && (\n <HvButton\n icon\n title={labels?.interactive}\n onClick={handleInteractive}\n >\n {isInteractive ? <Unlock role=\"none\" /> : <Lock role=\"none\" />}\n </HvButton>\n )}\n {children}\n </HvMultiButton>\n </Panel>\n );\n};\n"],"names":[],"mappings":";;;;;AAmDA,MAAM,iBAAgD;AAAA,EACpD,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,aAAa;AACf;AAEA,MAAM,WAAW,CAAC,WAA2B;AAAA,EAC3C,eACE,MAAM,kBAAkB,MAAM,oBAAoB,MAAM;AAAA,EAC1D,gBAAgB,MAAM,UAAU,CAAC,KAAK,MAAM;AAAA,EAC5C,gBAAgB,MAAM,UAAU,CAAC,KAAK,MAAM;AAC9C;AAEO,MAAM,iBAAiB,CAAC;AAAA,EAC7B,UAAU;AAAA,EACV,WAAW;AAAA,EACX,WAAW;AAAA,EACX,QAAQ;AAAA,EACR;AAAA,EACA;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AK,OAAO,CAAA,GACrB;AAAA,IAED,CAAC,mBACA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAI;AAAA,QACJ,OAAO,QAAQ;AAAA,QACf,SAAS;AAAA,QAER,UAAA,oCAAiB,QAAO,EAAA,MAAK,QAAO,IAAK,oBAAC,MAAK,EAAA,MAAK,OAAO,CAAA;AAAA,MAAA;AAAA,IAC9D;AAAA,IAED;AAAA,EAAA,EACH,CAAA,EACF,CAAA;AAEJ;"}
|
|
@@ -32,11 +32,15 @@ const validateEdge = (nodes, edges, edge, nodeMetaRegistry) => {
|
|
|
32
32
|
const targetMaxConnections = inputs[edge.targetHandle]?.maxConnections;
|
|
33
33
|
let isValid = targetAccepts.length === 0 || targetAccepts.includes(sourceProvides);
|
|
34
34
|
if (isValid && targetMaxConnections != null) {
|
|
35
|
-
const targetConnections = edges.filter(
|
|
35
|
+
const targetConnections = edges.filter(
|
|
36
|
+
(edg) => edg.target === edge.target && edg.targetHandle === edge.targetHandle
|
|
37
|
+
).length;
|
|
36
38
|
isValid = targetConnections < targetMaxConnections;
|
|
37
39
|
}
|
|
38
40
|
if (isValid && sourceMaxConnections != null) {
|
|
39
|
-
const sourceConnections = edges.filter(
|
|
41
|
+
const sourceConnections = edges.filter(
|
|
42
|
+
(edg) => edg.source === edge.source && edg.sourceHandle === edge.sourceHandle
|
|
43
|
+
).length;
|
|
40
44
|
isValid = sourceConnections < sourceMaxConnections;
|
|
41
45
|
}
|
|
42
46
|
return isValid;
|
|
@@ -56,77 +60,83 @@ const HvDroppableFlow = ({
|
|
|
56
60
|
defaultEdgeOptions: defaultEdgeOptionsProp,
|
|
57
61
|
...others
|
|
58
62
|
}) => {
|
|
59
|
-
const {
|
|
60
|
-
classes,
|
|
61
|
-
cx
|
|
62
|
-
} = useClasses(classesProp);
|
|
63
|
+
const { classes, cx } = useClasses(classesProp);
|
|
63
64
|
const elementId = useUniqueId(id, "hvFlow");
|
|
64
65
|
const reactFlowInstance = useReactFlow();
|
|
65
|
-
const {
|
|
66
|
-
nodeTypes
|
|
67
|
-
} = useFlowContext();
|
|
66
|
+
const { nodeTypes } = useFlowContext();
|
|
68
67
|
const [nodes, setNodes] = useState(initialNodes);
|
|
69
68
|
const [edges, setEdges] = useState(initialEdges);
|
|
70
|
-
const {
|
|
71
|
-
setNodeRef
|
|
72
|
-
} = useDroppable({
|
|
69
|
+
const { setNodeRef } = useDroppable({
|
|
73
70
|
id: elementId
|
|
74
71
|
});
|
|
75
|
-
const handleDragEnd = useCallback(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
onDndDrop
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
72
|
+
const handleDragEnd = useCallback(
|
|
73
|
+
(event) => {
|
|
74
|
+
if (event.over?.id !== elementId)
|
|
75
|
+
return;
|
|
76
|
+
const hvFlow = event.active.data.current?.hvFlow;
|
|
77
|
+
const type = hvFlow?.type;
|
|
78
|
+
if (!type || !nodeTypes?.[type]) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const position = reactFlowInstance.project({
|
|
82
|
+
x: (hvFlow?.x || 0) - event.over.rect.left,
|
|
83
|
+
y: (hvFlow?.y || 0) - event.over.rect.top
|
|
84
|
+
});
|
|
85
|
+
const data = hvFlow?.data || {};
|
|
86
|
+
const newNode = {
|
|
87
|
+
id: uid(),
|
|
88
|
+
position,
|
|
89
|
+
data,
|
|
90
|
+
type
|
|
91
|
+
};
|
|
92
|
+
if (onDndDrop) {
|
|
93
|
+
onDndDrop(event, newNode);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
setNodes((nds) => nds.concat(newNode));
|
|
97
|
+
},
|
|
98
|
+
[elementId, nodeTypes, onDndDrop, reactFlowInstance]
|
|
99
|
+
);
|
|
100
100
|
useDndMonitor({
|
|
101
101
|
onDragEnd: handleDragEnd
|
|
102
102
|
});
|
|
103
|
-
const handleFlowChange = useCallback(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
103
|
+
const handleFlowChange = useCallback(
|
|
104
|
+
(nds, eds) => {
|
|
105
|
+
const isDragging = nds.find((node) => node.dragging);
|
|
106
|
+
if (!isDragging) {
|
|
107
|
+
onFlowChange?.(nds, eds);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
[onFlowChange]
|
|
111
|
+
);
|
|
112
|
+
const handleConnect = useCallback(
|
|
113
|
+
(connection) => {
|
|
114
|
+
const eds = addEdge(connection, edges);
|
|
115
|
+
setEdges(eds);
|
|
116
|
+
handleFlowChange(nodes, eds);
|
|
117
|
+
onConnectProp?.(connection);
|
|
118
|
+
},
|
|
119
|
+
[edges, handleFlowChange, nodes, onConnectProp]
|
|
120
|
+
);
|
|
121
|
+
const handleNodesChange = useCallback(
|
|
122
|
+
(changes) => {
|
|
123
|
+
const nds = applyNodeChanges(changes, nodes);
|
|
124
|
+
setNodes(nds);
|
|
125
|
+
handleFlowChange(nds, edges);
|
|
126
|
+
onNodesChangeProp?.(changes);
|
|
127
|
+
},
|
|
128
|
+
[edges, handleFlowChange, nodes, onNodesChangeProp]
|
|
129
|
+
);
|
|
130
|
+
const handleEdgesChange = useCallback(
|
|
131
|
+
(changes) => {
|
|
132
|
+
const eds = applyEdgeChanges(changes, edges);
|
|
133
|
+
setEdges(eds);
|
|
134
|
+
handleFlowChange(nodes, eds);
|
|
135
|
+
onEdgesChangeProp?.(changes);
|
|
136
|
+
},
|
|
137
|
+
[edges, handleFlowChange, nodes, onEdgesChangeProp]
|
|
138
|
+
);
|
|
139
|
+
const { registry } = useNodeMetaRegistry();
|
|
130
140
|
const isValidConnection = (connection) => validateEdge(nodes, edges, connection, registry);
|
|
131
141
|
const defaultEdgeOptions = {
|
|
132
142
|
markerEnd: {
|
|
@@ -142,8 +152,33 @@ const HvDroppableFlow = ({
|
|
|
142
152
|
};
|
|
143
153
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
144
154
|
/* @__PURE__ */ jsx(Global, { styles: flowStyles }),
|
|
145
|
-
/* @__PURE__ */ jsx(
|
|
146
|
-
|
|
155
|
+
/* @__PURE__ */ jsx(
|
|
156
|
+
"div",
|
|
157
|
+
{
|
|
158
|
+
id: elementId,
|
|
159
|
+
ref: setNodeRef,
|
|
160
|
+
className: cx(classes.root, className),
|
|
161
|
+
children: /* @__PURE__ */ jsx(
|
|
162
|
+
ReactFlow,
|
|
163
|
+
{
|
|
164
|
+
nodes,
|
|
165
|
+
edges,
|
|
166
|
+
nodeTypes,
|
|
167
|
+
onNodesChange: handleNodesChange,
|
|
168
|
+
onEdgesChange: handleEdgesChange,
|
|
169
|
+
onConnect: handleConnect,
|
|
170
|
+
isValidConnection,
|
|
171
|
+
defaultEdgeOptions,
|
|
172
|
+
snapGrid: [1, 1],
|
|
173
|
+
snapToGrid: true,
|
|
174
|
+
onError: (code, message) => {
|
|
175
|
+
},
|
|
176
|
+
...others,
|
|
177
|
+
children
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
)
|
|
147
182
|
] });
|
|
148
183
|
};
|
|
149
184
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DroppableFlow.js","sources":["../../../../src/components/Flow/DroppableFlow.tsx"],"sourcesContent":["import { useCallback, useState } from \"react\";\n\nimport ReactFlow, {\n Connection,\n EdgeChange,\n NodeChange,\n ReactFlowProps,\n addEdge,\n applyEdgeChanges,\n applyNodeChanges,\n useReactFlow,\n MarkerType,\n Edge,\n Node,\n} from \"reactflow\";\n\nimport { Global } from \"@emotion/react\";\n\nimport { DragEndEvent, useDndMonitor, useDroppable } from \"@dnd-kit/core\";\n\nimport { uid } from \"uid\";\n\nimport { ExtractNames, useUniqueId } from \"@hitachivantara/uikit-react-core\";\n\nimport { HvFlowNodeMetaRegistry } from \"./types\";\nimport { staticClasses, useClasses } from \"./Flow.styles\";\nimport { useFlowContext } from \"./hooks\";\nimport { flowStyles } from \"./base\";\nimport { useNodeMetaRegistry } from \"./FlowContext/NodeMetaContext\";\n\nexport { staticClasses as flowClasses };\n\nexport type HvFlowClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDroppableFlowProps<\n NodeType extends string | undefined = string | undefined,\n NodeData = any\n> extends Omit<ReactFlowProps, \"nodes\" | \"edges\" | \"nodeTypes\"> {\n /** Flow content: background, controls, and minimap. */\n children?: React.ReactNode;\n /** Flow nodes. */\n nodes?: Node<NodeData, NodeType>[];\n /** Flow edges. */\n edges?: Edge[];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowClasses;\n /** Callback called when the flow changes. Returns the updated nodes and edges. */\n onFlowChange?: (nodes: Node<NodeData, NodeType>[], edges: Edge[]) => void;\n /**\n * Callback called when a node is dropped in the flow.\n *\n * This callback should be used to override the custom UI Kit drop event.\n * Thus, when defined, the user is responsible for adding nodes to the flow.\n *\n * This callback is called when `HvFlowSidebar` is used or a custom sidebar was created using Dnd Kit.\n * When a custom sidebar was created using the native HTML drag and drop API, refer to the `onDrop` callback.\n *\n * Returns the event and the node to be added to the flow.\n */\n onDndDrop?: (event: DragEndEvent, node: Node) => void;\n}\n\nexport const getNode = (nodes: Node[], nodeId: string) => {\n return nodes.find((n) => n.id === nodeId);\n};\n\nconst validateEdge = (\n nodes: Node[],\n edges: Edge[],\n edge: Edge,\n nodeMetaRegistry: HvFlowNodeMetaRegistry\n) => {\n if (!edge.sourceHandle || !edge.targetHandle) return false;\n\n const sourceNode = getNode(nodes, edge.source);\n const targetNode = getNode(nodes, edge.target);\n\n if (!sourceNode || !targetNode) return false;\n\n const sourceType = sourceNode.type;\n const targetType = targetNode.type;\n\n if (!sourceType || !targetType) return false;\n\n const inputs = nodeMetaRegistry[edge.target]?.inputs || [];\n const outputs = nodeMetaRegistry[edge.source]?.outputs || [];\n\n const sourceProvides = outputs[edge.sourceHandle]?.provides || \"\";\n const targetAccepts = inputs[edge.targetHandle]?.accepts || [];\n const sourceMaxConnections = outputs[edge.sourceHandle]?.maxConnections;\n const targetMaxConnections = inputs[edge.targetHandle]?.maxConnections;\n\n let isValid =\n targetAccepts.length === 0 || targetAccepts.includes(sourceProvides);\n\n if (isValid && targetMaxConnections != null) {\n const targetConnections = edges.filter(\n (edg) =>\n edg.target === edge.target && edg.targetHandle === edge.targetHandle\n ).length;\n\n isValid = targetConnections < targetMaxConnections;\n }\n\n if (isValid && sourceMaxConnections != null) {\n const sourceConnections = edges.filter(\n (edg) =>\n edg.source === edge.source && edg.sourceHandle === edge.sourceHandle\n ).length;\n\n isValid = sourceConnections < sourceMaxConnections;\n }\n\n return isValid;\n};\n\nexport const HvDroppableFlow = ({\n id,\n className,\n children,\n onFlowChange,\n onDndDrop,\n classes: classesProp,\n nodes: initialNodes = [],\n edges: initialEdges = [],\n onConnect: onConnectProp,\n onNodesChange: onNodesChangeProp,\n onEdgesChange: onEdgesChangeProp,\n defaultEdgeOptions: defaultEdgeOptionsProp,\n ...others\n}: HvDroppableFlowProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const elementId = useUniqueId(id, \"hvFlow\");\n\n const reactFlowInstance = useReactFlow();\n\n const { nodeTypes } = useFlowContext();\n\n const [nodes, setNodes] = useState(initialNodes);\n const [edges, setEdges] = useState(initialEdges);\n\n const { setNodeRef } = useDroppable({\n id: elementId,\n });\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n if (event.over?.id !== elementId) return;\n\n const hvFlow = event.active.data.current?.hvFlow;\n const type = hvFlow?.type;\n\n // Only known node types can be dropped in the canvas\n if (!type || !nodeTypes?.[type]) {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(\n `Could not add node to the flow because of unknown type ${type}. Use nodeTypes to define all the node types.`\n );\n }\n return;\n }\n\n // Converts the coordinates to the react flow coordinate system\n const position = reactFlowInstance.project({\n x: (hvFlow?.x || 0) - event.over.rect.left,\n y: (hvFlow?.y || 0) - event.over.rect.top,\n });\n\n // Node data\n const data = hvFlow?.data || {};\n\n // Node to add\n const newNode: Node = {\n id: uid(),\n position,\n data,\n type,\n };\n\n // Drop override\n if (onDndDrop) {\n onDndDrop(event, newNode);\n return;\n }\n\n setNodes((nds) => nds.concat(newNode));\n },\n [elementId, nodeTypes, onDndDrop, reactFlowInstance]\n );\n\n useDndMonitor({\n onDragEnd: handleDragEnd,\n });\n\n const handleFlowChange = useCallback(\n (\n nds: NonNullable<HvDroppableFlowProps[\"nodes\"]>,\n eds: NonNullable<HvDroppableFlowProps[\"edges\"]>\n ) => {\n // The new flow is returned if the user is not dragging nodes\n // This avoids triggering this handler too many times\n const isDragging = nds.find((node) => node.dragging);\n if (!isDragging) {\n onFlowChange?.(nds, eds);\n }\n },\n [onFlowChange]\n );\n\n const handleConnect = useCallback(\n (connection: Connection) => {\n const eds = addEdge(connection, edges);\n setEdges(eds);\n\n handleFlowChange(nodes, eds);\n onConnectProp?.(connection);\n },\n [edges, handleFlowChange, nodes, onConnectProp]\n );\n\n const handleNodesChange = useCallback(\n (changes: NodeChange[]) => {\n const nds = applyNodeChanges(changes, nodes);\n setNodes(nds);\n\n handleFlowChange(nds, edges);\n onNodesChangeProp?.(changes);\n },\n [edges, handleFlowChange, nodes, onNodesChangeProp]\n );\n\n const handleEdgesChange = useCallback(\n (changes: EdgeChange[]) => {\n const eds = applyEdgeChanges(changes, edges);\n setEdges(eds);\n\n handleFlowChange(nodes, eds);\n onEdgesChangeProp?.(changes);\n },\n [edges, handleFlowChange, nodes, onEdgesChangeProp]\n );\n\n const { registry } = useNodeMetaRegistry();\n const isValidConnection = (connection) =>\n validateEdge(nodes, edges, connection, registry);\n\n const defaultEdgeOptions = {\n markerEnd: {\n type: MarkerType.ArrowClosed,\n height: 20,\n width: 20,\n },\n type: \"smoothstep\",\n pathOptions: {\n borderRadius: 40,\n },\n ...defaultEdgeOptionsProp,\n };\n\n return (\n <>\n <Global styles={flowStyles} />\n <div\n id={elementId}\n ref={setNodeRef}\n className={cx(classes.root, className)}\n >\n <ReactFlow\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n onNodesChange={handleNodesChange}\n onEdgesChange={handleEdgesChange}\n onConnect={handleConnect}\n isValidConnection={isValidConnection}\n defaultEdgeOptions={defaultEdgeOptions}\n snapGrid={[1, 1]}\n snapToGrid\n onError={(code, message) => {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(message);\n }\n }}\n {...others}\n >\n {children}\n </ReactFlow>\n </div>\n </>\n );\n};\n"],"names":["getNode","nodes","nodeId","find","n","id","validateEdge","edges","edge","nodeMetaRegistry","sourceHandle","targetHandle","sourceNode","source","targetNode","target","sourceType","type","targetType","inputs","outputs","sourceProvides","provides","targetAccepts","accepts","sourceMaxConnections","maxConnections","targetMaxConnections","isValid","length","includes","targetConnections","filter","edg","sourceConnections","HvDroppableFlow","className","children","onFlowChange","onDndDrop","classes","classesProp","initialNodes","initialEdges","onConnect","onConnectProp","onNodesChange","onNodesChangeProp","onEdgesChange","onEdgesChangeProp","defaultEdgeOptions","defaultEdgeOptionsProp","others","cx","useClasses","elementId","useUniqueId","reactFlowInstance","useReactFlow","nodeTypes","useFlowContext","setNodes","useState","setEdges","setNodeRef","useDroppable","handleDragEnd","useCallback","event","over","hvFlow","active","data","current","position","project","x","rect","left","y","top","newNode","uid","nds","concat","onDragEnd","handleFlowChange","eds","isDragging","node","dragging","handleConnect","connection","addEdge","handleNodesChange","changes","applyNodeChanges","handleEdgesChange","applyEdgeChanges","registry","useNodeMetaRegistry","isValidConnection","markerEnd","MarkerType","ArrowClosed","height","width","pathOptions","borderRadius","flowStyles","root","code","message"],"mappings":";;;;;;;;;;;;AA8DaA,MAAAA,UAAUA,CAACC,OAAeC,WAAmB;AACxD,SAAOD,MAAME,KAAMC,CAAMA,MAAAA,EAAEC,OAAOH,MAAM;AAC1C;AAEA,MAAMI,eAAeA,CACnBL,OACAM,OACAC,MACAC,qBACG;AACH,MAAI,CAACD,KAAKE,gBAAgB,CAACF,KAAKG;AAAqB,WAAA;AAErD,QAAMC,aAAaZ,QAAQC,OAAOO,KAAKK,MAAM;AAC7C,QAAMC,aAAad,QAAQC,OAAOO,KAAKO,MAAM;AAEzC,MAAA,CAACH,cAAc,CAACE;AAAmB,WAAA;AAEvC,QAAME,aAAaJ,WAAWK;AAC9B,QAAMC,aAAaJ,WAAWG;AAE1B,MAAA,CAACD,cAAc,CAACE;AAAmB,WAAA;AAEvC,QAAMC,SAASV,iBAAiBD,KAAKO,MAAM,GAAGI,UAAU;AACxD,QAAMC,UAAUX,iBAAiBD,KAAKK,MAAM,GAAGO,WAAW;AAE1D,QAAMC,iBAAiBD,QAAQZ,KAAKE,YAAY,GAAGY,YAAY;AAC/D,QAAMC,gBAAgBJ,OAAOX,KAAKG,YAAY,GAAGa,WAAW;AAC5D,QAAMC,uBAAuBL,QAAQZ,KAAKE,YAAY,GAAGgB;AACzD,QAAMC,uBAAuBR,OAAOX,KAAKG,YAAY,GAAGe;AAExD,MAAIE,UACFL,cAAcM,WAAW,KAAKN,cAAcO,SAAST,cAAc;AAEjEO,MAAAA,WAAWD,wBAAwB,MAAM;AAC3C,UAAMI,oBAAoBxB,MAAMyB,OAC7BC,CAAAA,QACCA,IAAIlB,WAAWP,KAAKO,UAAUkB,IAAItB,iBAAiBH,KAAKG,YAC5D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MkD,QAAAA,oBAAoB9B,YACxB,CAAC4B,YAA0B;AACnBR,UAAAA,MAAMW,iBAAiBH,SAASxF,KAAK;AAC3CwD,aAASwB,GAAG;AAEZD,qBAAiBrF,OAAOsF,GAAG;AAC3BtC,wBAAoB8C,OAAO;AAAA,KAE7B,CAACxF,OAAO+E,kBAAkBrF,OAAOgD,iBAAiB,CACpD;AAEM,QAAA;AAAA,IAAEkD;AAAAA,MAAaC,oBAAoB;AACzC,QAAMC,oBAAqBT,CACzBtF,eAAAA,aAAaL,OAAOM,OAAOqF,YAAYO,QAAQ;AAEjD,QAAMjD,qBAAqB;AAAA,IACzBoD,WAAW;AAAA,MACTrF,MAAMsF,WAAWC;AAAAA,MACjBC,QAAQ;AAAA,MACRC,OAAO;AAAA,IACT;AAAA,IACAzF,MAAM;AAAA,IACN0F,aAAa;AAAA,MACXC,cAAc;AAAA,IAChB;AAAA,IACA,GAAGzD;AAAAA,EAAAA;AAGL,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAC,oBAAA,QAAA,EAAO,QAAQ0D,WAAW,CAAA;AAAA,IAC1B,oBAAA,OAAA,EACC,IAAItD,WACJ,KAAKS,YACL,WAAWX,GAAGb,QAAQsE,MAAM1E,SAAS,GAErC,UAAC,oBAAA,WAAA,EACC,OACA,OACA,WACA,eAAe0D,mBACf,eAAeG,mBACf,WAAWN,eACX,mBACA,oBACA,UAAU,CAAC,GAAG,CAAC,GACf,YAAU,MACV,SAAS,CAACoB,MAAMC,YAAY;AAAA,IAMxB5D,GAAAA,GAAAA,QAEHf,SACH,CAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"DroppableFlow.js","sources":["../../../../src/components/Flow/DroppableFlow.tsx"],"sourcesContent":["import { useCallback, useState } from \"react\";\n\nimport ReactFlow, {\n Connection,\n EdgeChange,\n NodeChange,\n ReactFlowProps,\n addEdge,\n applyEdgeChanges,\n applyNodeChanges,\n useReactFlow,\n MarkerType,\n Edge,\n Node,\n} from \"reactflow\";\n\nimport { Global } from \"@emotion/react\";\n\nimport { DragEndEvent, useDndMonitor, useDroppable } from \"@dnd-kit/core\";\n\nimport { uid } from \"uid\";\n\nimport { ExtractNames, useUniqueId } from \"@hitachivantara/uikit-react-core\";\n\nimport { HvFlowNodeMetaRegistry } from \"./types\";\nimport { staticClasses, useClasses } from \"./Flow.styles\";\nimport { useFlowContext } from \"./hooks\";\nimport { flowStyles } from \"./base\";\nimport { useNodeMetaRegistry } from \"./FlowContext/NodeMetaContext\";\n\nexport { staticClasses as flowClasses };\n\nexport type HvFlowClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvDroppableFlowProps<\n NodeType extends string | undefined = string | undefined,\n NodeData = any\n> extends Omit<ReactFlowProps, \"nodes\" | \"edges\" | \"nodeTypes\"> {\n /** Flow content: background, controls, and minimap. */\n children?: React.ReactNode;\n /** Flow nodes. */\n nodes?: Node<NodeData, NodeType>[];\n /** Flow edges. */\n edges?: Edge[];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowClasses;\n /** Callback called when the flow changes. Returns the updated nodes and edges. */\n onFlowChange?: (nodes: Node<NodeData, NodeType>[], edges: Edge[]) => void;\n /**\n * Callback called when a node is dropped in the flow.\n *\n * This callback should be used to override the custom UI Kit drop event.\n * Thus, when defined, the user is responsible for adding nodes to the flow.\n *\n * This callback is called when `HvFlowSidebar` is used or a custom sidebar was created using Dnd Kit.\n * When a custom sidebar was created using the native HTML drag and drop API, refer to the `onDrop` callback.\n *\n * Returns the event and the node to be added to the flow.\n */\n onDndDrop?: (event: DragEndEvent, node: Node) => void;\n}\n\nexport const getNode = (nodes: Node[], nodeId: string) => {\n return nodes.find((n) => n.id === nodeId);\n};\n\nconst validateEdge = (\n nodes: Node[],\n edges: Edge[],\n edge: Edge,\n nodeMetaRegistry: HvFlowNodeMetaRegistry\n) => {\n if (!edge.sourceHandle || !edge.targetHandle) return false;\n\n const sourceNode = getNode(nodes, edge.source);\n const targetNode = getNode(nodes, edge.target);\n\n if (!sourceNode || !targetNode) return false;\n\n const sourceType = sourceNode.type;\n const targetType = targetNode.type;\n\n if (!sourceType || !targetType) return false;\n\n const inputs = nodeMetaRegistry[edge.target]?.inputs || [];\n const outputs = nodeMetaRegistry[edge.source]?.outputs || [];\n\n const sourceProvides = outputs[edge.sourceHandle]?.provides || \"\";\n const targetAccepts = inputs[edge.targetHandle]?.accepts || [];\n const sourceMaxConnections = outputs[edge.sourceHandle]?.maxConnections;\n const targetMaxConnections = inputs[edge.targetHandle]?.maxConnections;\n\n let isValid =\n targetAccepts.length === 0 || targetAccepts.includes(sourceProvides);\n\n if (isValid && targetMaxConnections != null) {\n const targetConnections = edges.filter(\n (edg) =>\n edg.target === edge.target && edg.targetHandle === edge.targetHandle\n ).length;\n\n isValid = targetConnections < targetMaxConnections;\n }\n\n if (isValid && sourceMaxConnections != null) {\n const sourceConnections = edges.filter(\n (edg) =>\n edg.source === edge.source && edg.sourceHandle === edge.sourceHandle\n ).length;\n\n isValid = sourceConnections < sourceMaxConnections;\n }\n\n return isValid;\n};\n\nexport const HvDroppableFlow = ({\n id,\n className,\n children,\n onFlowChange,\n onDndDrop,\n classes: classesProp,\n nodes: initialNodes = [],\n edges: initialEdges = [],\n onConnect: onConnectProp,\n onNodesChange: onNodesChangeProp,\n onEdgesChange: onEdgesChangeProp,\n defaultEdgeOptions: defaultEdgeOptionsProp,\n ...others\n}: HvDroppableFlowProps) => {\n const { classes, cx } = useClasses(classesProp);\n\n const elementId = useUniqueId(id, \"hvFlow\");\n\n const reactFlowInstance = useReactFlow();\n\n const { nodeTypes } = useFlowContext();\n\n const [nodes, setNodes] = useState(initialNodes);\n const [edges, setEdges] = useState(initialEdges);\n\n const { setNodeRef } = useDroppable({\n id: elementId,\n });\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n if (event.over?.id !== elementId) return;\n\n const hvFlow = event.active.data.current?.hvFlow;\n const type = hvFlow?.type;\n\n // Only known node types can be dropped in the canvas\n if (!type || !nodeTypes?.[type]) {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(\n `Could not add node to the flow because of unknown type ${type}. Use nodeTypes to define all the node types.`\n );\n }\n return;\n }\n\n // Converts the coordinates to the react flow coordinate system\n const position = reactFlowInstance.project({\n x: (hvFlow?.x || 0) - event.over.rect.left,\n y: (hvFlow?.y || 0) - event.over.rect.top,\n });\n\n // Node data\n const data = hvFlow?.data || {};\n\n // Node to add\n const newNode: Node = {\n id: uid(),\n position,\n data,\n type,\n };\n\n // Drop override\n if (onDndDrop) {\n onDndDrop(event, newNode);\n return;\n }\n\n setNodes((nds) => nds.concat(newNode));\n },\n [elementId, nodeTypes, onDndDrop, reactFlowInstance]\n );\n\n useDndMonitor({\n onDragEnd: handleDragEnd,\n });\n\n const handleFlowChange = useCallback(\n (\n nds: NonNullable<HvDroppableFlowProps[\"nodes\"]>,\n eds: NonNullable<HvDroppableFlowProps[\"edges\"]>\n ) => {\n // The new flow is returned if the user is not dragging nodes\n // This avoids triggering this handler too many times\n const isDragging = nds.find((node) => node.dragging);\n if (!isDragging) {\n onFlowChange?.(nds, eds);\n }\n },\n [onFlowChange]\n );\n\n const handleConnect = useCallback(\n (connection: Connection) => {\n const eds = addEdge(connection, edges);\n setEdges(eds);\n\n handleFlowChange(nodes, eds);\n onConnectProp?.(connection);\n },\n [edges, handleFlowChange, nodes, onConnectProp]\n );\n\n const handleNodesChange = useCallback(\n (changes: NodeChange[]) => {\n const nds = applyNodeChanges(changes, nodes);\n setNodes(nds);\n\n handleFlowChange(nds, edges);\n onNodesChangeProp?.(changes);\n },\n [edges, handleFlowChange, nodes, onNodesChangeProp]\n );\n\n const handleEdgesChange = useCallback(\n (changes: EdgeChange[]) => {\n const eds = applyEdgeChanges(changes, edges);\n setEdges(eds);\n\n handleFlowChange(nodes, eds);\n onEdgesChangeProp?.(changes);\n },\n [edges, handleFlowChange, nodes, onEdgesChangeProp]\n );\n\n const { registry } = useNodeMetaRegistry();\n const isValidConnection = (connection) =>\n validateEdge(nodes, edges, connection, registry);\n\n const defaultEdgeOptions = {\n markerEnd: {\n type: MarkerType.ArrowClosed,\n height: 20,\n width: 20,\n },\n type: \"smoothstep\",\n pathOptions: {\n borderRadius: 40,\n },\n ...defaultEdgeOptionsProp,\n };\n\n return (\n <>\n <Global styles={flowStyles} />\n <div\n id={elementId}\n ref={setNodeRef}\n className={cx(classes.root, className)}\n >\n <ReactFlow\n nodes={nodes}\n edges={edges}\n nodeTypes={nodeTypes}\n onNodesChange={handleNodesChange}\n onEdgesChange={handleEdgesChange}\n onConnect={handleConnect}\n isValidConnection={isValidConnection}\n defaultEdgeOptions={defaultEdgeOptions}\n snapGrid={[1, 1]}\n snapToGrid\n onError={(code, message) => {\n if (import.meta.env.DEV) {\n // eslint-disable-next-line no-console\n console.error(message);\n }\n }}\n {...others}\n >\n {children}\n </ReactFlow>\n </div>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA8Da,MAAA,UAAU,CAAC,OAAe,WAAmB;AACxD,SAAO,MAAM,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM;AAC1C;AAEA,MAAM,eAAe,CACnB,OACA,OACA,MACA,qBACG;AACH,MAAI,CAAC,KAAK,gBAAgB,CAAC,KAAK;AAAqB,WAAA;AAErD,QAAM,aAAa,QAAQ,OAAO,KAAK,MAAM;AAC7C,QAAM,aAAa,QAAQ,OAAO,KAAK,MAAM;AAEzC,MAAA,CAAC,cAAc,CAAC;AAAmB,WAAA;AAEvC,QAAM,aAAa,WAAW;AAC9B,QAAM,aAAa,WAAW;AAE1B,MAAA,CAAC,cAAc,CAAC;AAAmB,WAAA;AAEvC,QAAM,SAAS,iBAAiB,KAAK,MAAM,GAAG,UAAU;AACxD,QAAM,UAAU,iBAAiB,KAAK,MAAM,GAAG,WAAW;AAE1D,QAAM,iBAAiB,QAAQ,KAAK,YAAY,GAAG,YAAY;AAC/D,QAAM,gBAAgB,OAAO,KAAK,YAAY,G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iB;AAAA,EAAA;AAGpD,QAAM,oBAAoB;AAAA,IACxB,CAAC,YAA0B;AACnB,YAAA,MAAM,iBAAiB,SAAS,KAAK;AAC3C,eAAS,GAAG;AAEZ,uBAAiB,OAAO,GAAG;AAC3B,0BAAoB,OAAO;AAAA,IAC7B;AAAA,IACA,CAAC,OAAO,kBAAkB,OAAO,iBAAiB;AAAA,EAAA;AAG9C,QAAA,EAAE,aAAa;AACrB,QAAM,oBAAoB,CAAC,eACzB,aAAa,OAAO,OAAO,YAAY,QAAQ;AAEjD,QAAM,qBAAqB;AAAA,IACzB,WAAW;AAAA,MACT,MAAM,WAAW;AAAA,MACjB,QAAQ;AAAA,MACR,OAAO;AAAA,IACT;AAAA,IACA,MAAM;AAAA,IACN,aAAa;AAAA,MACX,cAAc;AAAA,IAChB;AAAA,IACA,GAAG;AAAA,EAAA;AAGL,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAC,oBAAA,QAAA,EAAO,QAAQ,WAAY,CAAA;AAAA,IAC5B;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,IAAI;AAAA,QACJ,KAAK;AAAA,QACL,WAAW,GAAG,QAAQ,MAAM,SAAS;AAAA,QAErC,UAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA,eAAe;AAAA,YACf,eAAe;AAAA,YACf,WAAW;AAAA,YACX;AAAA,YACA;AAAA,YACA,UAAU,CAAC,GAAG,CAAC;AAAA,YACf,YAAU;AAAA,YACV,SAAS,CAAC,MAAM,YAAY;AAAA,YAK5B;AAAA,YACC,GAAG;AAAA,YAEH;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -2,14 +2,8 @@ import { jsx } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { useNodes } from "reactflow";
|
|
3
3
|
import { HvEmptyState } from "@hitachivantara/uikit-react-core";
|
|
4
4
|
import { useClasses } from "./Empty.styles.js";
|
|
5
|
-
const HvFlowEmpty = ({
|
|
6
|
-
|
|
7
|
-
...others
|
|
8
|
-
}) => {
|
|
9
|
-
const {
|
|
10
|
-
classes,
|
|
11
|
-
cx
|
|
12
|
-
} = useClasses();
|
|
5
|
+
const HvFlowEmpty = ({ className, ...others }) => {
|
|
6
|
+
const { classes, cx } = useClasses();
|
|
13
7
|
const nodes = useNodes();
|
|
14
8
|
return !nodes || (nodes.length === 0 ? /* @__PURE__ */ jsx(HvEmptyState, { className: cx(classes.root, className), ...others }) : null);
|
|
15
9
|
};
|