@hitachivantara/uikit-react-lab 5.46.13 → 6.0.0-next.1

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.
Files changed (135) hide show
  1. package/dist/{esm/Flow → Flow}/Background/Background.js +1 -1
  2. package/dist/{esm/Flow → Flow}/Controls/Controls.js +1 -1
  3. package/dist/{esm/Flow → Flow}/DroppableFlow.js +1 -1
  4. package/dist/{esm/Flow → Flow}/Empty/Empty.js +1 -1
  5. package/dist/{esm/Flow → Flow}/Empty/Empty.styles.js +1 -1
  6. package/dist/{esm/Flow → Flow}/Flow.js +1 -1
  7. package/dist/{esm/Flow → Flow}/Flow.styles.js +1 -1
  8. package/dist/{esm/Flow → Flow}/Minimap/Minimap.js +1 -1
  9. package/dist/{esm/Flow → Flow}/Node/BaseNode.js +1 -1
  10. package/dist/{esm/Flow → Flow}/Node/Node.js +0 -3
  11. package/dist/{esm/Flow → Flow}/Sidebar/Sidebar.js +1 -1
  12. package/dist/Flow/base.js +732 -0
  13. package/dist/{esm/Flow → Flow}/hooks/useFlowInstance.js +1 -1
  14. package/dist/{esm/Flow → Flow}/hooks/useFlowNode.js +4 -4
  15. package/dist/{esm/Flow → Flow}/hooks/useNodeId.js +1 -1
  16. package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/DefaultNavigation.js +1 -3
  17. package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/SimpleNavigation.js +1 -3
  18. package/dist/{esm/StepNavigation → StepNavigation}/StepNavigation.js +2 -7
  19. package/dist/{esm/Wizard → Wizard}/WizardTitle/WizardTitle.js +31 -47
  20. package/dist/{esm/Wizard → Wizard}/WizardTitle/WizardTitle.styles.js +0 -10
  21. package/dist/{types/index.d.ts → index.d.ts} +63 -178
  22. package/dist/{esm/index.js → index.js} +12 -18
  23. package/package.json +15 -15
  24. package/dist/cjs/Blade/Blade.cjs +0 -174
  25. package/dist/cjs/Blade/Blade.styles.cjs +0 -71
  26. package/dist/cjs/Blades/Blades.cjs +0 -104
  27. package/dist/cjs/Blades/Blades.styles.cjs +0 -11
  28. package/dist/cjs/Dashboard/Dashboard.cjs +0 -63
  29. package/dist/cjs/Dashboard/Dashboard.styles.cjs +0 -196
  30. package/dist/cjs/Flow/Background/Background.cjs +0 -19
  31. package/dist/cjs/Flow/Controls/Controls.cjs +0 -96
  32. package/dist/cjs/Flow/DroppableFlow.cjs +0 -204
  33. package/dist/cjs/Flow/Empty/Empty.cjs +0 -12
  34. package/dist/cjs/Flow/Empty/Empty.styles.cjs +0 -16
  35. package/dist/cjs/Flow/Flow.cjs +0 -33
  36. package/dist/cjs/Flow/Flow.styles.cjs +0 -19
  37. package/dist/cjs/Flow/FlowContext/FlowContext.cjs +0 -25
  38. package/dist/cjs/Flow/FlowContext/NodeMetaContext.cjs +0 -43
  39. package/dist/cjs/Flow/Minimap/Minimap.cjs +0 -30
  40. package/dist/cjs/Flow/Minimap/Minimap.styles.cjs +0 -10
  41. package/dist/cjs/Flow/Node/BaseNode.cjs +0 -192
  42. package/dist/cjs/Flow/Node/BaseNode.styles.cjs +0 -135
  43. package/dist/cjs/Flow/Node/Node.cjs +0 -115
  44. package/dist/cjs/Flow/Node/Node.styles.cjs +0 -42
  45. package/dist/cjs/Flow/Node/Parameters/ParamRenderer.cjs +0 -19
  46. package/dist/cjs/Flow/Node/Parameters/Select.cjs +0 -41
  47. package/dist/cjs/Flow/Node/Parameters/Slider.cjs +0 -33
  48. package/dist/cjs/Flow/Node/Parameters/Text.cjs +0 -19
  49. package/dist/cjs/Flow/Node/utils.cjs +0 -54
  50. package/dist/cjs/Flow/Sidebar/Sidebar.cjs +0 -141
  51. package/dist/cjs/Flow/Sidebar/Sidebar.styles.cjs +0 -24
  52. package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroup.cjs +0 -62
  53. package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroup.styles.cjs +0 -34
  54. package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs +0 -51
  55. package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs +0 -35
  56. package/dist/cjs/Flow/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.cjs +0 -23
  57. package/dist/cjs/Flow/base.cjs +0 -411
  58. package/dist/cjs/Flow/hooks/useFlowContext.cjs +0 -6
  59. package/dist/cjs/Flow/hooks/useFlowInstance.cjs +0 -7
  60. package/dist/cjs/Flow/hooks/useFlowNode.cjs +0 -134
  61. package/dist/cjs/Flow/hooks/useFlowNodeMeta.cjs +0 -10
  62. package/dist/cjs/Flow/hooks/useNode.cjs +0 -159
  63. package/dist/cjs/Flow/hooks/useNodeId.cjs +0 -8
  64. package/dist/cjs/Flow/nodes/DashboardNode.cjs +0 -88
  65. package/dist/cjs/Flow/nodes/DashboardNode.styles.cjs +0 -16
  66. package/dist/cjs/Flow/nodes/StickyNode.cjs +0 -441
  67. package/dist/cjs/StepNavigation/DefaultNavigation/DefaultNavigation.cjs +0 -56
  68. package/dist/cjs/StepNavigation/DefaultNavigation/Step/Step.cjs +0 -78
  69. package/dist/cjs/StepNavigation/DefaultNavigation/Step/Step.styles.cjs +0 -35
  70. package/dist/cjs/StepNavigation/DefaultNavigation/utils.cjs +0 -34
  71. package/dist/cjs/StepNavigation/SimpleNavigation/Dot/Dot.cjs +0 -43
  72. package/dist/cjs/StepNavigation/SimpleNavigation/Dot/Dot.styles.cjs +0 -18
  73. package/dist/cjs/StepNavigation/SimpleNavigation/SimpleNavigation.cjs +0 -52
  74. package/dist/cjs/StepNavigation/SimpleNavigation/utils.cjs +0 -13
  75. package/dist/cjs/StepNavigation/StepNavigation.cjs +0 -188
  76. package/dist/cjs/StepNavigation/StepNavigation.styles.cjs +0 -34
  77. package/dist/cjs/StepNavigation/utils.cjs +0 -8
  78. package/dist/cjs/Wizard/Wizard.cjs +0 -108
  79. package/dist/cjs/Wizard/Wizard.styles.cjs +0 -8
  80. package/dist/cjs/Wizard/WizardActions/WizardActions.cjs +0 -132
  81. package/dist/cjs/Wizard/WizardActions/WizardActions.styles.cjs +0 -22
  82. package/dist/cjs/Wizard/WizardContainer/WizardContainer.cjs +0 -31
  83. package/dist/cjs/Wizard/WizardContainer/WizardContainer.styles.cjs +0 -15
  84. package/dist/cjs/Wizard/WizardContent/WizardContent.cjs +0 -121
  85. package/dist/cjs/Wizard/WizardContent/WizardContent.styles.cjs +0 -38
  86. package/dist/cjs/Wizard/WizardContext/WizardContext.cjs +0 -15
  87. package/dist/cjs/Wizard/WizardTitle/WizardTitle.cjs +0 -97
  88. package/dist/cjs/Wizard/WizardTitle/WizardTitle.styles.cjs +0 -27
  89. package/dist/cjs/index.cjs +0 -93
  90. package/dist/esm/Flow/base.js +0 -411
  91. package/dist/esm/Flow/nodes/DashboardNode.js +0 -89
  92. package/dist/esm/Flow/nodes/DashboardNode.styles.js +0 -16
  93. package/dist/esm/Flow/nodes/StickyNode.js +0 -439
  94. /package/dist/{esm/Blade → Blade}/Blade.js +0 -0
  95. /package/dist/{esm/Blade → Blade}/Blade.styles.js +0 -0
  96. /package/dist/{esm/Blades → Blades}/Blades.js +0 -0
  97. /package/dist/{esm/Blades → Blades}/Blades.styles.js +0 -0
  98. /package/dist/{esm/Dashboard → Dashboard}/Dashboard.js +0 -0
  99. /package/dist/{esm/Dashboard → Dashboard}/Dashboard.styles.js +0 -0
  100. /package/dist/{esm/Flow → Flow}/FlowContext/FlowContext.js +0 -0
  101. /package/dist/{esm/Flow → Flow}/FlowContext/NodeMetaContext.js +0 -0
  102. /package/dist/{esm/Flow → Flow}/Minimap/Minimap.styles.js +0 -0
  103. /package/dist/{esm/Flow → Flow}/Node/BaseNode.styles.js +0 -0
  104. /package/dist/{esm/Flow → Flow}/Node/Node.styles.js +0 -0
  105. /package/dist/{esm/Flow → Flow}/Node/Parameters/ParamRenderer.js +0 -0
  106. /package/dist/{esm/Flow → Flow}/Node/Parameters/Select.js +0 -0
  107. /package/dist/{esm/Flow → Flow}/Node/Parameters/Slider.js +0 -0
  108. /package/dist/{esm/Flow → Flow}/Node/Parameters/Text.js +0 -0
  109. /package/dist/{esm/Flow → Flow}/Node/utils.js +0 -0
  110. /package/dist/{esm/Flow → Flow}/Sidebar/Sidebar.styles.js +0 -0
  111. /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroup.js +0 -0
  112. /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroup.styles.js +0 -0
  113. /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.js +0 -0
  114. /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.js +0 -0
  115. /package/dist/{esm/Flow → Flow}/Sidebar/SidebarGroup/SidebarGroupItem/SidebarGroupItem.styles.js +0 -0
  116. /package/dist/{esm/Flow → Flow}/hooks/useFlowContext.js +0 -0
  117. /package/dist/{esm/Flow → Flow}/hooks/useFlowNodeMeta.js +0 -0
  118. /package/dist/{esm/Flow → Flow}/hooks/useNode.js +0 -0
  119. /package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/Step/Step.js +0 -0
  120. /package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/Step/Step.styles.js +0 -0
  121. /package/dist/{esm/StepNavigation → StepNavigation}/DefaultNavigation/utils.js +0 -0
  122. /package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/Dot/Dot.js +0 -0
  123. /package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/Dot/Dot.styles.js +0 -0
  124. /package/dist/{esm/StepNavigation → StepNavigation}/SimpleNavigation/utils.js +0 -0
  125. /package/dist/{esm/StepNavigation → StepNavigation}/StepNavigation.styles.js +0 -0
  126. /package/dist/{esm/StepNavigation → StepNavigation}/utils.js +0 -0
  127. /package/dist/{esm/Wizard → Wizard}/Wizard.js +0 -0
  128. /package/dist/{esm/Wizard → Wizard}/Wizard.styles.js +0 -0
  129. /package/dist/{esm/Wizard → Wizard}/WizardActions/WizardActions.js +0 -0
  130. /package/dist/{esm/Wizard → Wizard}/WizardActions/WizardActions.styles.js +0 -0
  131. /package/dist/{esm/Wizard → Wizard}/WizardContainer/WizardContainer.js +0 -0
  132. /package/dist/{esm/Wizard → Wizard}/WizardContainer/WizardContainer.styles.js +0 -0
  133. /package/dist/{esm/Wizard → Wizard}/WizardContent/WizardContent.js +0 -0
  134. /package/dist/{esm/Wizard → Wizard}/WizardContent/WizardContent.styles.js +0 -0
  135. /package/dist/{esm/Wizard → Wizard}/WizardContext/WizardContext.js +0 -0
@@ -1,135 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
4
- const { staticClasses, useClasses } = uikitReactCore.createClasses("HvFlowBaseNode", {
5
- root: {
6
- borderRadius: uikitReactCore.theme.radii.round,
7
- backgroundColor: uikitReactCore.theme.colors.bgContainer,
8
- boxShadow: uikitReactCore.theme.colors.shadow,
9
- minWidth: "250px",
10
- border: "1px solid var(--node-color)"
11
- },
12
- headerContainer: {
13
- padding: uikitReactCore.theme.spacing(0.5, 1),
14
- display: "flex",
15
- flexDirection: "row",
16
- justifyContent: "space-between",
17
- alignItems: "center",
18
- borderTopLeftRadius: "inherit",
19
- borderTopRightRadius: "inherit",
20
- backgroundColor: "var(--node-color)"
21
- },
22
- titleContainer: {
23
- display: "flex",
24
- flexDirection: "row",
25
- alignItems: "center",
26
- "& svg *.color0": { fill: "var(--icon-color)" }
27
- },
28
- title: {
29
- color: uikitReactCore.theme.colors.textDark
30
- },
31
- inputsTitleContainer: {
32
- display: "flex",
33
- justifyContent: "center",
34
- padding: uikitReactCore.theme.space.xs,
35
- backgroundColor: uikitReactCore.theme.colors.bgPage,
36
- borderTop: `1px solid ${uikitReactCore.theme.colors.borderSubtle}`,
37
- borderBottom: `1px solid ${uikitReactCore.theme.colors.borderSubtle}`
38
- },
39
- outputsTitleContainer: {
40
- display: "flex",
41
- justifyContent: "center",
42
- padding: uikitReactCore.theme.space.xs,
43
- backgroundColor: uikitReactCore.theme.colors.bgPage,
44
- borderTop: `1px solid ${uikitReactCore.theme.colors.borderSubtle}`,
45
- borderBottom: `1px solid ${uikitReactCore.theme.colors.borderSubtle}`
46
- },
47
- contentContainer: {},
48
- inputsContainer: {
49
- display: "flex",
50
- flexDirection: "column",
51
- padding: uikitReactCore.theme.space.sm,
52
- gap: uikitReactCore.theme.space.xs,
53
- alignItems: "flex-start"
54
- },
55
- outputsContainer: {
56
- display: "flex",
57
- flexDirection: "column",
58
- padding: uikitReactCore.theme.space.sm,
59
- gap: uikitReactCore.theme.space.xs,
60
- alignItems: "flex-end"
61
- },
62
- inputGroupContainer: {
63
- display: "flex",
64
- flexDirection: "column",
65
- gap: uikitReactCore.theme.space.xs,
66
- alignItems: "flex-start"
67
- },
68
- outputGroupContainer: {
69
- display: "flex",
70
- flexDirection: "column",
71
- gap: uikitReactCore.theme.space.xs,
72
- alignItems: "flex-end"
73
- },
74
- inputContainer: {
75
- display: "flex",
76
- flexDirection: "row",
77
- alignItems: "center",
78
- position: "relative"
79
- },
80
- outputContainer: {
81
- display: "flex",
82
- flexDirection: "row",
83
- alignItems: "center",
84
- position: "relative"
85
- },
86
- handle: {
87
- zIndex: uikitReactCore.theme.zIndices.overlay,
88
- marginLeft: 2,
89
- backgroundColor: uikitReactCore.theme.colors.bgContainer,
90
- height: 10,
91
- width: 10,
92
- border: `1px solid ${uikitReactCore.theme.colors.textDisabled}`,
93
- "&.react-flow__handle-left": {
94
- left: -23
95
- },
96
- "&.react-flow__handle-right": {
97
- right: -21
98
- },
99
- "&.react-flow__handle-connecting": {
100
- backgroundColor: uikitReactCore.theme.colors.negativeDimmed
101
- },
102
- "&.react-flow__handle-valid": {
103
- backgroundColor: uikitReactCore.theme.colors.positiveDimmed
104
- },
105
- "::before": {
106
- fontSize: 14,
107
- color: uikitReactCore.theme.colors.textDisabled,
108
- content: '"+"',
109
- marginTop: -7,
110
- position: "absolute"
111
- }
112
- },
113
- handleConnected: {
114
- backgroundColor: uikitReactCore.theme.colors.textDisabled,
115
- width: 8,
116
- height: 8,
117
- "::before": {
118
- fontSize: 11,
119
- marginTop: -8
120
- }
121
- },
122
- mandatory: {
123
- width: 10,
124
- height: 10,
125
- margin: uikitReactCore.theme.spacing(0, uikitReactCore.theme.space.xs),
126
- borderRadius: uikitReactCore.theme.radii.full,
127
- backgroundColor: uikitReactCore.theme.colors.negativeDimmed
128
- },
129
- footerContainer: {
130
- padding: uikitReactCore.theme.space.sm,
131
- borderTop: `1px solid ${uikitReactCore.theme.colors.borderSubtle}`
132
- }
133
- });
134
- exports.staticClasses = staticClasses;
135
- exports.useClasses = useClasses;
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
6
- const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
7
- const BaseNode = require("./BaseNode.cjs");
8
- const Node_styles = require("./Node.styles.cjs");
9
- const useFlowNode = require("../hooks/useFlowNode.cjs");
10
- const ParamRenderer = require("./Parameters/ParamRenderer.cjs");
11
- const useFlowContext = require("../hooks/useFlowContext.cjs");
12
- const DEFAULT_LABELS = {
13
- collapseLabel: "Collapse",
14
- expandLabel: "Expand"
15
- };
16
- const HvFlowNode = ({
17
- id,
18
- type,
19
- headerItems,
20
- actions,
21
- actionCallback,
22
- // TODO - remove in v6
23
- onAction,
24
- maxVisibleActions = 1,
25
- expanded = false,
26
- actionsIconOnly = true,
27
- params,
28
- classes: classesProp,
29
- labels: labelsProps,
30
- children,
31
- expandParamsButtonProps,
32
- disableInlineEdit,
33
- title: titleProp,
34
- subtitle: subtitleProp,
35
- description,
36
- groupId,
37
- color: colorProp,
38
- icon: iconProp,
39
- ...props
40
- }) => {
41
- const { classes } = Node_styles.useClasses(classesProp);
42
- const [showParams, setShowParams] = react.useState(expanded);
43
- const { nodeGroups, defaultActions } = useFlowContext.useFlowContext();
44
- const labels = uikitReactCore.useLabels(DEFAULT_LABELS, labelsProps);
45
- const node = useFlowNode.useFlowNode();
46
- const { setNodeData } = useFlowNode.useFlowNodeUtils();
47
- const inlineEditorWidth = actions === void 0 || Array.isArray(actions) && actions.length === 0 || maxVisibleActions === 0 ? "100%" : `calc(200px - calc(${maxVisibleActions} * 32px + ${uikitReactCore.theme.spacing(2)}))`;
48
- const nodeGroup = groupId && nodeGroups && nodeGroups[groupId] || void 0;
49
- const title = titleProp || nodeGroup?.label;
50
- const icon = iconProp || nodeGroup?.icon;
51
- const color = colorProp || nodeGroup?.color;
52
- const subtitle = subtitleProp || node?.data.nodeLabel;
53
- const hasParams = !!(params && params.length > 0);
54
- return /* @__PURE__ */ jsxRuntime.jsxs(
55
- BaseNode.HvFlowBaseNode,
56
- {
57
- id,
58
- type,
59
- title,
60
- icon,
61
- color,
62
- nodeActions: defaultActions,
63
- classes,
64
- headerItems: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
65
- headerItems,
66
- description && /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTooltip, { title: description, children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Info, { color: "textDark" }) }),
67
- hasParams && /* @__PURE__ */ jsxRuntime.jsx(
68
- uikitReactCore.HvButton,
69
- {
70
- icon: true,
71
- onClick: () => setShowParams((p) => !p),
72
- "aria-label": showParams ? labels?.collapseLabel : labels?.expandLabel,
73
- ...expandParamsButtonProps,
74
- children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.DropDownXS, { rotate: showParams, color: "textDark" })
75
- }
76
- )
77
- ] }),
78
- labels,
79
- ...props,
80
- children: [
81
- (subtitle || actions) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.subtitleContainer, children: [
82
- subtitle && (disableInlineEdit ? /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { className: classes.subtitle, children: subtitle }) : /* @__PURE__ */ jsxRuntime.jsx(
83
- uikitReactCore.HvInlineEditor,
84
- {
85
- defaultValue: subtitle,
86
- showIcon: true,
87
- style: { width: inlineEditorWidth },
88
- classes: {
89
- root: classes.inlineEditRoot,
90
- button: classes.inlineEditButton
91
- },
92
- onBlur: (evt, value) => setNodeData((prev) => ({ ...prev, nodeLabel: value }))
93
- }
94
- )),
95
- actions && /* @__PURE__ */ jsxRuntime.jsx(
96
- uikitReactCore.HvActionsGeneric,
97
- {
98
- className: classes.actions,
99
- classes: { button: classes.actionsButton },
100
- actions,
101
- actionsCallback: actionCallback,
102
- onAction,
103
- maxVisibleActions,
104
- iconOnly: actionsIconOnly
105
- }
106
- )
107
- ] }),
108
- children,
109
- showParams && params && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.paramsContainer, children: /* @__PURE__ */ jsxRuntime.jsx(ParamRenderer.ParamRenderer, { params, data: node?.data }) })
110
- ]
111
- }
112
- );
113
- };
114
- exports.flowNodeClasses = Node_styles.staticClasses;
115
- exports.HvFlowNode = HvFlowNode;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
4
- const BaseNode_styles = require("./BaseNode.styles.cjs");
5
- const baseClasses = Object.fromEntries(
6
- Object.keys(BaseNode_styles.staticClasses).map((key) => [key, {}])
7
- );
8
- const { staticClasses, useClasses } = uikitReactCore.createClasses("HvFlowNode", {
9
- subtitleContainer: {
10
- minHeight: 48,
11
- padding: uikitReactCore.theme.spacing("xs"),
12
- display: "flex",
13
- flexDirection: "row",
14
- justifyContent: "space-between",
15
- alignItems: "center"
16
- },
17
- subtitle: {
18
- paddingLeft: uikitReactCore.theme.spacing("xs")
19
- },
20
- inlineEditRoot: {
21
- display: "inline-flex",
22
- flexGrow: 1
23
- },
24
- inlineEditButton: {
25
- justifyContent: "space-between"
26
- },
27
- actions: {},
28
- actionsButton: {
29
- gap: 0
30
- },
31
- paramsContainer: {
32
- borderTop: `1px solid ${uikitReactCore.theme.colors.border}`,
33
- display: "flex",
34
- flexDirection: "column",
35
- gap: uikitReactCore.theme.space.xs,
36
- padding: uikitReactCore.theme.space.sm
37
- },
38
- // Spread here to know if we are overriding classes from parents
39
- ...baseClasses
40
- });
41
- exports.staticClasses = staticClasses;
42
- exports.useClasses = useClasses;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const Select = require("./Select.cjs");
5
- const Slider = require("./Slider.cjs");
6
- const Text = require("./Text.cjs");
7
- const renderers = {
8
- text: Text.default,
9
- select: Select.default,
10
- slider: Slider.default
11
- };
12
- const ParamRenderer = ({ params, data }) => {
13
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: params.map((param) => {
14
- const Renderer = renderers[param.type];
15
- if (!Renderer) return null;
16
- return /* @__PURE__ */ jsxRuntime.jsx(Renderer, { param, data }, param.id);
17
- }) });
18
- };
19
- exports.ParamRenderer = ParamRenderer;
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
6
- const useFlowNode = require("../../hooks/useFlowNode.cjs");
7
- const Select = ({ param, data }) => {
8
- const { id, label, multiple = false, options } = param;
9
- const { setNodeData } = useFlowNode.useFlowNodeUtils();
10
- const [opts, setOpts] = react.useState(
11
- data[id] ? Array.isArray(data[id]) ? data[id] : [data[id]] : void 0
12
- );
13
- const handleChange = (item) => {
14
- const newOpts = Array.isArray(item) ? item.map((x) => x.id) : item?.id ?? void 0;
15
- setNodeData((prev) => ({ ...prev, [id]: newOpts }));
16
- setOpts(
17
- newOpts ? Array.isArray(newOpts) ? newOpts : [newOpts] : void 0
18
- );
19
- };
20
- return /* @__PURE__ */ jsxRuntime.jsx(
21
- uikitReactCore.HvDropdown,
22
- {
23
- className: "nodrag",
24
- disablePortal: true,
25
- label,
26
- values: options?.map((option) => {
27
- const optionId = typeof option === "string" ? option : option.id;
28
- const optionLabel = typeof option === "string" ? option : option.label;
29
- return {
30
- id: optionId,
31
- label: optionLabel,
32
- selected: !!opts?.find((opt) => opt === optionId)
33
- };
34
- }),
35
- onChange: handleChange,
36
- maxHeight: 100,
37
- multiSelect: multiple
38
- }
39
- );
40
- };
41
- exports.default = Select;
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const css = require("@emotion/css");
5
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
6
- const useFlowNode = require("../../hooks/useFlowNode.cjs");
7
- const classes = {
8
- labelContainer: css.css({
9
- marginRight: 0,
10
- marginLeft: 0
11
- }),
12
- sliderBase: css.css({
13
- padding: 0
14
- })
15
- };
16
- const Slider = ({ param, data }) => {
17
- const { id } = param;
18
- const { setNodeData } = useFlowNode.useFlowNodeUtils();
19
- return /* @__PURE__ */ jsxRuntime.jsx(
20
- uikitReactCore.HvSlider,
21
- {
22
- className: "nodrag",
23
- defaultValues: data[id],
24
- onChange: (val) => setNodeData((prev) => ({ ...prev, [id]: val })),
25
- classes: {
26
- labelContainer: classes.labelContainer,
27
- sliderBase: classes.sliderBase
28
- },
29
- ...param
30
- }
31
- );
32
- };
33
- exports.default = Slider;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
5
- const useFlowNode = require("../../hooks/useFlowNode.cjs");
6
- const Text = ({ param, data }) => {
7
- const { id, label } = param;
8
- const { setNodeData } = useFlowNode.useFlowNodeUtils();
9
- return /* @__PURE__ */ jsxRuntime.jsx(
10
- uikitReactCore.HvInput,
11
- {
12
- className: "nodrag",
13
- label,
14
- defaultValue: data[id],
15
- onChange: (evt, val) => setNodeData((prev) => ({ ...prev, [id]: val }))
16
- }
17
- );
18
- };
19
- exports.default = Text;
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const react = require("react");
4
- const isInputGroup = (input) => {
5
- return "inputs" in input;
6
- };
7
- const isOutputGroup = (output) => {
8
- return "outputs" in output;
9
- };
10
- const isConnected = (id, type, handleId, edges) => {
11
- if (type === "target") {
12
- return edges.some((e) => e.target === id && e.targetHandle === handleId);
13
- }
14
- if (type === "source") {
15
- return edges.some((e) => e.source === id && e.sourceHandle === handleId);
16
- }
17
- return false;
18
- };
19
- const renderedIcon = (actionIcon) => react.isValidElement(actionIcon) ? actionIcon : actionIcon?.();
20
- const identifyHandles = (handles) => {
21
- let idx = 0;
22
- return handles?.map(
23
- (handle) => {
24
- if (isInputGroup(handle)) {
25
- return {
26
- ...handle,
27
- inputs: handle.inputs.map((x) => {
28
- const identifiedHandle2 = x.id != null ? x : { ...x, id: String(idx) };
29
- idx += 1;
30
- return identifiedHandle2;
31
- })
32
- };
33
- }
34
- if (isOutputGroup(handle)) {
35
- return {
36
- ...handle,
37
- outputs: handle.outputs.map((x) => {
38
- const identifiedHandle2 = x.id != null ? x : { ...x, id: String(idx) };
39
- idx += 1;
40
- return identifiedHandle2;
41
- })
42
- };
43
- }
44
- const identifiedHandle = handle.id != null ? handle : { ...handle, id: String(idx) };
45
- idx += 1;
46
- return identifiedHandle;
47
- }
48
- );
49
- };
50
- exports.identifyHandles = identifyHandles;
51
- exports.isConnected = isConnected;
52
- exports.isInputGroup = isInputGroup;
53
- exports.isOutputGroup = isOutputGroup;
54
- exports.renderedIcon = renderedIcon;
@@ -1,141 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const react = require("react");
5
- const core = require("@dnd-kit/core");
6
- const modifiers = require("@dnd-kit/modifiers");
7
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
8
- const uikitReactIcons = require("@hitachivantara/uikit-react-icons");
9
- const Sidebar_styles = require("./Sidebar.styles.cjs");
10
- const SidebarGroup = require("./SidebarGroup/SidebarGroup.cjs");
11
- const SidebarGroupItem = require("./SidebarGroup/SidebarGroupItem/SidebarGroupItem.cjs");
12
- const useFlowContext = require("../hooks/useFlowContext.cjs");
13
- const DraggableSidebarGroupItem = require("./SidebarGroup/SidebarGroupItem/DraggableSidebarGroupItem.cjs");
14
- const DEFAULT_LABELS = {
15
- itemAriaRoleDescription: "Draggable",
16
- expandGroupButtonAriaLabel: "Expand group",
17
- searchPlaceholder: "Search node...",
18
- searchAriaLabel: "Search node..."
19
- };
20
- const HvFlowSidebar = ({
21
- id,
22
- title,
23
- description,
24
- anchor = "right",
25
- buttonTitle = "Close",
26
- flatten = false,
27
- classes: classesProp,
28
- labels: labelsProps,
29
- dragOverlayProps,
30
- ...others
31
- }) => {
32
- const { classes } = Sidebar_styles.useClasses(classesProp);
33
- const { nodeGroups, setExpandedNodeGroups } = useFlowContext.useFlowContext();
34
- const [filterValue, setFilterValue] = react.useState("");
35
- const [draggingLabel, setDraggingLabel] = react.useState();
36
- const labels = uikitReactCore.useLabels(DEFAULT_LABELS, labelsProps);
37
- const drawerElementId = uikitReactCore.useUniqueId(id);
38
- const groupsElementId = uikitReactCore.useUniqueId();
39
- const { setNodeRef } = core.useDroppable({ id: drawerElementId });
40
- const handleDragStart = (event) => {
41
- if (event.active.data.current?.hvFlow) {
42
- setDraggingLabel(event.active.data.current.hvFlow?.label);
43
- }
44
- };
45
- const handleDragEnd = () => {
46
- setDraggingLabel(void 0);
47
- };
48
- core.useDndMonitor({
49
- onDragEnd: handleDragEnd,
50
- onDragStart: handleDragStart
51
- });
52
- const filteredGroups = react.useMemo(() => {
53
- if (!filterValue || !nodeGroups) return nodeGroups || {};
54
- return filterValue ? Object.entries(nodeGroups).reduce(
55
- (acc, [groupId, group]) => {
56
- const filteredItems = (group.items || []).filter(
57
- (item) => item.label.toLowerCase().includes(filterValue.toLowerCase())
58
- );
59
- const itemsCount = Object.keys(filteredItems).length;
60
- if (itemsCount > 0) {
61
- acc[groupId] = {
62
- ...group,
63
- items: filteredItems
64
- };
65
- }
66
- return acc;
67
- },
68
- {}
69
- ) : nodeGroups;
70
- }, [filterValue, nodeGroups]);
71
- react.useEffect(() => {
72
- setExpandedNodeGroups?.(filterValue ? Object.keys(filteredGroups) : []);
73
- }, [filterValue, filteredGroups, setExpandedNodeGroups]);
74
- return /* @__PURE__ */ jsxRuntime.jsxs(
75
- uikitReactCore.HvDrawer,
76
- {
77
- BackdropComponent: void 0,
78
- variant: "persistent",
79
- classes: {
80
- paper: classes.drawerPaper
81
- },
82
- showBackdrop: false,
83
- anchor,
84
- buttonTitle,
85
- ...others,
86
- children: [
87
- /* @__PURE__ */ jsxRuntime.jsxs("div", { id: drawerElementId, ref: setNodeRef, children: [
88
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.titleContainer, children: [
89
- /* @__PURE__ */ jsxRuntime.jsx(uikitReactIcons.Add, {}),
90
- /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { component: "p", variant: "title3", children: title })
91
- ] }),
92
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.contentContainer, children: [
93
- /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { className: classes.description, children: description }),
94
- /* @__PURE__ */ jsxRuntime.jsx(
95
- uikitReactCore.HvInput,
96
- {
97
- className: classes.searchRoot,
98
- type: "search",
99
- placeholder: labels?.searchPlaceholder,
100
- "aria-label": labels?.searchAriaLabel,
101
- "aria-controls": groupsElementId,
102
- "aria-owns": groupsElementId,
103
- onChange: (evt, val) => setFilterValue(val.trim()),
104
- inputProps: { autoComplete: "off" }
105
- }
106
- ),
107
- /* @__PURE__ */ jsxRuntime.jsx("ul", { id: groupsElementId, className: classes.groupsContainer, children: Object.entries(filteredGroups).map(([groupId, group]) => {
108
- if (flatten) {
109
- return (group.items || []).map((item, i) => /* @__PURE__ */ jsxRuntime.jsx(
110
- DraggableSidebarGroupItem.HvFlowDraggableSidebarGroupItem,
111
- {
112
- "aria-roledescription": labels?.itemAriaRoleDescription,
113
- ...item
114
- },
115
- `${item.nodeType}-${i}`
116
- ));
117
- }
118
- return /* @__PURE__ */ jsxRuntime.jsx(
119
- SidebarGroup.HvFlowSidebarGroup,
120
- {
121
- id: groupId,
122
- expandButtonProps: {
123
- "aria-label": labels?.expandGroupButtonAriaLabel
124
- },
125
- itemProps: {
126
- "aria-roledescription": labels?.itemAriaRoleDescription
127
- },
128
- ...group
129
- },
130
- groupId
131
- );
132
- }) })
133
- ] })
134
- ] }),
135
- /* @__PURE__ */ jsxRuntime.jsx(core.DragOverlay, { modifiers: [modifiers.restrictToWindowEdges], ...dragOverlayProps, children: draggingLabel ? /* @__PURE__ */ jsxRuntime.jsx(SidebarGroupItem.HvFlowSidebarGroupItem, { label: draggingLabel, isDragging: true }) : null })
136
- ]
137
- }
138
- );
139
- };
140
- exports.flowSidebarClasses = Sidebar_styles.staticClasses;
141
- exports.HvFlowSidebar = HvFlowSidebar;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const uikitReactCore = require("@hitachivantara/uikit-react-core");
4
- const { staticClasses, useClasses } = uikitReactCore.createClasses("HvFlowSidebar", {
5
- drawerPaper: { width: "360px" },
6
- titleContainer: {
7
- display: "flex",
8
- padding: uikitReactCore.theme.spacing("sm", "lg", "xs", "sm")
9
- },
10
- contentContainer: { padding: uikitReactCore.theme.spacing(0, "lg", "sm", "lg") },
11
- description: { color: uikitReactCore.theme.colors.textSubtle },
12
- searchRoot: {
13
- paddingTop: uikitReactCore.theme.space.sm,
14
- paddingBottom: uikitReactCore.theme.space.sm
15
- },
16
- groupsContainer: {
17
- display: "flex",
18
- flexDirection: "column",
19
- gap: uikitReactCore.theme.space.sm,
20
- listStyleType: "none"
21
- }
22
- });
23
- exports.staticClasses = staticClasses;
24
- exports.useClasses = useClasses;