@hitachivantara/uikit-react-lab 6.1.8 → 6.1.10
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/Blade/Blade.js +134 -173
- package/dist/Blade/Blade.styles.js +54 -69
- package/dist/Blades/Blades.js +70 -101
- package/dist/Blades/Blades.styles.js +7 -10
- package/dist/Dashboard/Dashboard.js +57 -60
- package/dist/Dashboard/Dashboard.styles.js +6 -10
- package/dist/Flow/Background/Background.js +10 -16
- package/dist/Flow/Controls/Controls.js +77 -91
- package/dist/Flow/DroppableFlow.js +135 -200
- package/dist/Flow/Empty/Empty.js +12 -9
- package/dist/Flow/Empty/Empty.styles.js +12 -15
- package/dist/Flow/Flow.js +28 -30
- package/dist/Flow/Flow.styles.js +12 -18
- package/dist/Flow/FlowContext/FlowContext.js +22 -23
- package/dist/Flow/FlowContext/NodeMetaContext.js +36 -39
- package/dist/Flow/Minimap/Minimap.js +15 -28
- package/dist/Flow/Minimap/Minimap.styles.js +4 -9
- package/dist/Flow/Node/BaseNode.js +144 -190
- package/dist/Flow/Node/BaseNode.styles.js +122 -133
- package/dist/Flow/Node/Node.js +90 -108
- package/dist/Flow/Node/Node.styles.js +30 -40
- package/dist/Flow/Node/Parameters/ParamRenderer.js +17 -14
- package/dist/Flow/Node/Parameters/Select.js +33 -38
- package/dist/Flow/Node/Parameters/Slider.js +27 -29
- package/dist/Flow/Node/Parameters/Text.js +17 -17
- package/dist/Flow/Node/utils.js +44 -49
- package/dist/Flow/Sidebar/Sidebar.js +115 -137
- package/dist/Flow/Sidebar/Sidebar.styles.js +21 -22
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroup.js +57 -60
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.js +27 -33
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +27 -47
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js +14 -32
- package/dist/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.js +17 -23
- package/dist/Flow/base.js +5 -5
- package/dist/Flow/hooks/useFlowContext.js +5 -5
- package/dist/Flow/hooks/useFlowInstance.js +5 -4
- package/dist/Flow/hooks/useFlowNode.js +92 -113
- package/dist/Flow/hooks/useFlowNodeMeta.js +7 -7
- package/dist/Flow/hooks/useNode.js +136 -154
- package/dist/Flow/hooks/useNodeId.js +8 -7
- package/dist/Flow/nodes/DashboardNode.js +64 -86
- package/dist/Flow/nodes/DashboardNode.styles.js +8 -14
- package/dist/Flow/nodes/StickyNode.js +370 -435
- package/dist/StepNavigation/DefaultNavigation/DefaultNavigation.js +36 -52
- package/dist/StepNavigation/DefaultNavigation/Step/Step.js +40 -51
- package/dist/StepNavigation/DefaultNavigation/Step/Step.styles.js +22 -33
- package/dist/StepNavigation/DefaultNavigation/utils.js +38 -30
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.js +24 -41
- package/dist/StepNavigation/SimpleNavigation/Dot/Dot.styles.js +13 -16
- package/dist/StepNavigation/SimpleNavigation/SimpleNavigation.js +35 -47
- package/dist/StepNavigation/SimpleNavigation/utils.js +10 -11
- package/dist/StepNavigation/StepNavigation.js +136 -179
- package/dist/StepNavigation/StepNavigation.styles.js +29 -32
- package/dist/Wizard/Wizard.js +81 -104
- package/dist/Wizard/Wizard.styles.js +4 -7
- package/dist/Wizard/WizardActions/WizardActions.js +111 -131
- package/dist/Wizard/WizardActions/WizardActions.styles.js +19 -20
- package/dist/Wizard/WizardContainer/WizardContainer.js +19 -28
- package/dist/Wizard/WizardContainer/WizardContainer.styles.js +8 -14
- package/dist/Wizard/WizardContent/WizardContent.js +103 -120
- package/dist/Wizard/WizardContent/WizardContent.styles.js +33 -36
- package/dist/Wizard/WizardContext/WizardContext.js +10 -13
- package/dist/Wizard/WizardTitle/WizardTitle.js +74 -79
- package/dist/Wizard/WizardTitle/WizardTitle.styles.js +12 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -81
- package/package.json +6 -6
- package/dist/StepNavigation/utils.js +0 -8
|
@@ -1,64 +1,61 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { gridStyles, useClasses } from "./Dashboard.styles.js";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import { WidthProvider, Responsive } from "react-grid-layout";
|
|
4
|
-
import { Global } from "@emotion/react";
|
|
5
3
|
import { useDefaultProps, useTheme } from "@hitachivantara/uikit-react-core";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
children,
|
|
19
|
-
className,
|
|
20
|
-
layout,
|
|
21
|
-
cols: colsProp,
|
|
22
|
-
layouts: layoutsProp,
|
|
23
|
-
classes: classesProp,
|
|
24
|
-
...others
|
|
25
|
-
} = useDefaultProps("HvDashboard", props);
|
|
26
|
-
const { classes, cx } = useClasses(classesProp);
|
|
27
|
-
const { activeTheme } = useTheme();
|
|
28
|
-
const layouts = useMemo(() => {
|
|
29
|
-
if (layoutsProp) return layoutsProp;
|
|
30
|
-
if (!layout) return {};
|
|
31
|
-
return { xs: layout, sm: layout, md: layout, lg: layout, xl: layout };
|
|
32
|
-
}, [layoutsProp, layout]);
|
|
33
|
-
const cols = useMemo(() => {
|
|
34
|
-
if (!colsProp) return defaultCols;
|
|
35
|
-
if (typeof colsProp === "number") {
|
|
36
|
-
return {
|
|
37
|
-
xs: colsProp,
|
|
38
|
-
sm: colsProp,
|
|
39
|
-
md: colsProp,
|
|
40
|
-
lg: colsProp,
|
|
41
|
-
xl: colsProp
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
return colsProp;
|
|
45
|
-
}, [colsProp]);
|
|
46
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
47
|
-
/* @__PURE__ */ jsx(Global, { styles: gridStyles }),
|
|
48
|
-
/* @__PURE__ */ jsx(
|
|
49
|
-
GridLayout,
|
|
50
|
-
{
|
|
51
|
-
className: cx(classes.root, className),
|
|
52
|
-
breakpoints: activeTheme?.breakpoints.values,
|
|
53
|
-
cols,
|
|
54
|
-
layouts,
|
|
55
|
-
...others,
|
|
56
|
-
children
|
|
57
|
-
}
|
|
58
|
-
)
|
|
59
|
-
] });
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Responsive, WidthProvider } from "react-grid-layout";
|
|
6
|
+
import { Global } from "@emotion/react";
|
|
7
|
+
//#region src/Dashboard/Dashboard.tsx
|
|
8
|
+
var GridLayout = WidthProvider(Responsive);
|
|
9
|
+
/** Default column breakpoints. For now, use always 12-column */
|
|
10
|
+
var defaultCols = {
|
|
11
|
+
xs: 12,
|
|
12
|
+
sm: 12,
|
|
13
|
+
md: 12,
|
|
14
|
+
lg: 12,
|
|
15
|
+
xl: 12
|
|
60
16
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
17
|
+
/**
|
|
18
|
+
* A Dashboard grid layout component, based on `react-grid-layout`.
|
|
19
|
+
* The children elements are grid items and must be `key`ed.
|
|
20
|
+
*
|
|
21
|
+
* @see https://github.com/react-grid-layout/react-grid-layout?tab=readme-ov-file#grid-layout-props
|
|
22
|
+
*
|
|
23
|
+
* DISCLAIMER: This component is a work in progress and there might be breaking changes.
|
|
24
|
+
*/
|
|
25
|
+
var HvDashboard = (props) => {
|
|
26
|
+
const { children, className, layout, cols: colsProp, layouts: layoutsProp, classes: classesProp, ...others } = useDefaultProps("HvDashboard", props);
|
|
27
|
+
const { classes, cx } = useClasses(classesProp);
|
|
28
|
+
const { activeTheme } = useTheme();
|
|
29
|
+
const layouts = useMemo(() => {
|
|
30
|
+
if (layoutsProp) return layoutsProp;
|
|
31
|
+
if (!layout) return {};
|
|
32
|
+
return {
|
|
33
|
+
xs: layout,
|
|
34
|
+
sm: layout,
|
|
35
|
+
md: layout,
|
|
36
|
+
lg: layout,
|
|
37
|
+
xl: layout
|
|
38
|
+
};
|
|
39
|
+
}, [layoutsProp, layout]);
|
|
40
|
+
const cols = useMemo(() => {
|
|
41
|
+
if (!colsProp) return defaultCols;
|
|
42
|
+
if (typeof colsProp === "number") return {
|
|
43
|
+
xs: colsProp,
|
|
44
|
+
sm: colsProp,
|
|
45
|
+
md: colsProp,
|
|
46
|
+
lg: colsProp,
|
|
47
|
+
xl: colsProp
|
|
48
|
+
};
|
|
49
|
+
return colsProp;
|
|
50
|
+
}, [colsProp]);
|
|
51
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Global, { styles: gridStyles }), /* @__PURE__ */ jsx(GridLayout, {
|
|
52
|
+
className: cx(classes.root, className),
|
|
53
|
+
breakpoints: activeTheme?.breakpoints.values,
|
|
54
|
+
cols,
|
|
55
|
+
layouts,
|
|
56
|
+
...others,
|
|
57
|
+
children
|
|
58
|
+
})] });
|
|
64
59
|
};
|
|
60
|
+
//#endregion
|
|
61
|
+
export { HvDashboard };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { css } from "@emotion/react";
|
|
2
1
|
import { createClasses, theme } from "@hitachivantara/uikit-react-core";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
2
|
+
import { css } from "@emotion/react";
|
|
3
|
+
//#region src/Dashboard/Dashboard.styles.ts
|
|
4
|
+
var { staticClasses, useClasses } = createClasses("HvDashboard", { root: {} });
|
|
5
|
+
var gridStyles = css`
|
|
7
6
|
.react-grid-layout {
|
|
8
7
|
position: relative;
|
|
9
8
|
transition: height 200ms ease;
|
|
@@ -189,8 +188,5 @@ const gridStyles = css`
|
|
|
189
188
|
transform: rotate(45deg);
|
|
190
189
|
}
|
|
191
190
|
`;
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
staticClasses,
|
|
195
|
-
useClasses
|
|
196
|
-
};
|
|
191
|
+
//#endregion
|
|
192
|
+
export { gridStyles, staticClasses, useClasses };
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
+
import { getColor, theme } from "@hitachivantara/uikit-styles";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { Background } from "reactflow";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
{
|
|
11
|
-
color: getColor(color, theme.colors.textSubtle),
|
|
12
|
-
gap: 16,
|
|
13
|
-
...others
|
|
14
|
-
}
|
|
15
|
-
);
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
HvFlowBackground
|
|
4
|
+
//#region src/Flow/Background/Background.tsx
|
|
5
|
+
var HvFlowBackground = ({ color = "text", ...others }) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(Background, {
|
|
7
|
+
color: getColor(color, theme.colors.textSubtle),
|
|
8
|
+
gap: 16,
|
|
9
|
+
...others
|
|
10
|
+
});
|
|
19
11
|
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { HvFlowBackground };
|
|
@@ -1,96 +1,82 @@
|
|
|
1
|
+
import { useFlowInstance } from "../hooks/useFlowInstance.js";
|
|
2
|
+
import { HvButton, HvMultiButton, useLabels } from "@hitachivantara/uikit-react-core";
|
|
1
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useStore, useStoreApi
|
|
4
|
+
import { Panel, useStore, useStoreApi } from "reactflow";
|
|
3
5
|
import { shallow } from "zustand/shallow";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interactive: "Interactive"
|
|
6
|
+
import { Focus, Lock, Unlock, ZoomIn, ZoomOut } from "@hitachivantara/uikit-react-icons";
|
|
7
|
+
//#region src/Flow/Controls/Controls.tsx
|
|
8
|
+
var DEFAULT_LABELS = {
|
|
9
|
+
fitView: "Fit view",
|
|
10
|
+
zoomIn: "Zoom in",
|
|
11
|
+
zoomOut: "Zoom out",
|
|
12
|
+
interactive: "Interactive"
|
|
12
13
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
var selector = (state) => ({
|
|
15
|
+
isInteractive: state.nodesDraggable || state.nodesConnectable || state.elementsSelectable,
|
|
16
|
+
minZoomReached: state.transform[2] <= state.minZoom,
|
|
17
|
+
maxZoomReached: state.transform[2] >= state.maxZoom
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
!hideFitView && /* @__PURE__ */ jsx(HvButton, { icon: true, title: labels?.fitView, onClick: handleFitView, children: /* @__PURE__ */ jsx(Focus, {}) }),
|
|
82
|
-
!hideInteractive && /* @__PURE__ */ jsx(
|
|
83
|
-
HvButton,
|
|
84
|
-
{
|
|
85
|
-
icon: true,
|
|
86
|
-
title: labels?.interactive,
|
|
87
|
-
onClick: handleInteractive,
|
|
88
|
-
children: isInteractive ? /* @__PURE__ */ jsx(Unlock, {}) : /* @__PURE__ */ jsx(Lock, {})
|
|
89
|
-
}
|
|
90
|
-
),
|
|
91
|
-
children
|
|
92
|
-
] }) });
|
|
93
|
-
};
|
|
94
|
-
export {
|
|
95
|
-
HvFlowControls
|
|
19
|
+
var HvFlowControls = ({ onZoomIn: onZoomInProp, onZoomOut: onZoomOutProp, onFitView: onFitViewProp, labels: labelsProps, hideInteractive, hideFitView, hideZoom, position = "bottom-center", orientation = "horizontal", onInteractiveChange, fitViewOptions, children, ...others }) => {
|
|
20
|
+
const { isInteractive, minZoomReached, maxZoomReached } = useStore(selector, shallow);
|
|
21
|
+
const store = useStoreApi();
|
|
22
|
+
const { zoomIn, zoomOut, fitView } = useFlowInstance();
|
|
23
|
+
const labels = useLabels(DEFAULT_LABELS, labelsProps);
|
|
24
|
+
const handleZoomIn = () => {
|
|
25
|
+
zoomIn();
|
|
26
|
+
onZoomInProp?.();
|
|
27
|
+
};
|
|
28
|
+
const handleZoomOut = () => {
|
|
29
|
+
zoomOut();
|
|
30
|
+
onZoomOutProp?.();
|
|
31
|
+
};
|
|
32
|
+
const handleFitView = () => {
|
|
33
|
+
fitView(fitViewOptions);
|
|
34
|
+
onFitViewProp?.();
|
|
35
|
+
};
|
|
36
|
+
const handleInteractive = () => {
|
|
37
|
+
store.setState({
|
|
38
|
+
nodesDraggable: !isInteractive,
|
|
39
|
+
nodesConnectable: !isInteractive,
|
|
40
|
+
elementsSelectable: !isInteractive
|
|
41
|
+
});
|
|
42
|
+
onInteractiveChange?.(!isInteractive);
|
|
43
|
+
};
|
|
44
|
+
return /* @__PURE__ */ jsx(Panel, {
|
|
45
|
+
position,
|
|
46
|
+
...others,
|
|
47
|
+
children: /* @__PURE__ */ jsxs(HvMultiButton, {
|
|
48
|
+
vertical: orientation === "vertical",
|
|
49
|
+
children: [
|
|
50
|
+
!hideZoom && /* @__PURE__ */ jsx(HvButton, {
|
|
51
|
+
icon: true,
|
|
52
|
+
title: labels?.zoomIn,
|
|
53
|
+
onClick: handleZoomIn,
|
|
54
|
+
disabled: maxZoomReached,
|
|
55
|
+
children: /* @__PURE__ */ jsx(ZoomIn, {})
|
|
56
|
+
}),
|
|
57
|
+
!hideZoom && /* @__PURE__ */ jsx(HvButton, {
|
|
58
|
+
icon: true,
|
|
59
|
+
title: labels?.zoomOut,
|
|
60
|
+
onClick: handleZoomOut,
|
|
61
|
+
disabled: minZoomReached,
|
|
62
|
+
children: /* @__PURE__ */ jsx(ZoomOut, {})
|
|
63
|
+
}),
|
|
64
|
+
!hideFitView && /* @__PURE__ */ jsx(HvButton, {
|
|
65
|
+
icon: true,
|
|
66
|
+
title: labels?.fitView,
|
|
67
|
+
onClick: handleFitView,
|
|
68
|
+
children: /* @__PURE__ */ jsx(Focus, {})
|
|
69
|
+
}),
|
|
70
|
+
!hideInteractive && /* @__PURE__ */ jsx(HvButton, {
|
|
71
|
+
icon: true,
|
|
72
|
+
title: labels?.interactive,
|
|
73
|
+
onClick: handleInteractive,
|
|
74
|
+
children: isInteractive ? /* @__PURE__ */ jsx(Unlock, {}) : /* @__PURE__ */ jsx(Lock, {})
|
|
75
|
+
}),
|
|
76
|
+
children
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
});
|
|
96
80
|
};
|
|
81
|
+
//#endregion
|
|
82
|
+
export { HvFlowControls };
|