@hitachivantara/uikit-react-lab 5.14.0 → 5.16.0

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 (34) hide show
  1. package/dist/cjs/components/Flow/DroppableFlow.cjs +1 -1
  2. package/dist/cjs/components/Flow/DroppableFlow.cjs.map +1 -1
  3. package/dist/cjs/components/Flow/Empty/Empty.cjs +1 -1
  4. package/dist/cjs/components/Flow/Empty/Empty.cjs.map +1 -1
  5. package/dist/cjs/components/Flow/Flow.styles.cjs +1 -0
  6. package/dist/cjs/components/Flow/Flow.styles.cjs.map +1 -1
  7. package/dist/cjs/components/Flow/Node/BaseNode.cjs +19 -7
  8. package/dist/cjs/components/Flow/Node/BaseNode.cjs.map +1 -1
  9. package/dist/cjs/components/Flow/Node/Node.cjs +2 -2
  10. package/dist/cjs/components/Flow/Node/Node.cjs.map +1 -1
  11. package/dist/cjs/components/Flow/Node/Parameters/Select.cjs +28 -10
  12. package/dist/cjs/components/Flow/Node/Parameters/Select.cjs.map +1 -1
  13. package/dist/cjs/components/Flow/Node/Parameters/Text.cjs +16 -4
  14. package/dist/cjs/components/Flow/Node/Parameters/Text.cjs.map +1 -1
  15. package/dist/cjs/components/Flow/hooks/useFlowNode.cjs +4 -4
  16. package/dist/cjs/components/Flow/hooks/useFlowNode.cjs.map +1 -1
  17. package/dist/esm/components/Flow/DroppableFlow.js +1 -1
  18. package/dist/esm/components/Flow/DroppableFlow.js.map +1 -1
  19. package/dist/esm/components/Flow/Empty/Empty.js +2 -2
  20. package/dist/esm/components/Flow/Empty/Empty.js.map +1 -1
  21. package/dist/esm/components/Flow/Flow.styles.js +1 -0
  22. package/dist/esm/components/Flow/Flow.styles.js.map +1 -1
  23. package/dist/esm/components/Flow/Node/BaseNode.js +20 -8
  24. package/dist/esm/components/Flow/Node/BaseNode.js.map +1 -1
  25. package/dist/esm/components/Flow/Node/Node.js +2 -2
  26. package/dist/esm/components/Flow/Node/Node.js.map +1 -1
  27. package/dist/esm/components/Flow/Node/Parameters/Select.js +28 -10
  28. package/dist/esm/components/Flow/Node/Parameters/Select.js.map +1 -1
  29. package/dist/esm/components/Flow/Node/Parameters/Text.js +16 -4
  30. package/dist/esm/components/Flow/Node/Parameters/Text.js.map +1 -1
  31. package/dist/esm/components/Flow/hooks/useFlowNode.js +5 -5
  32. package/dist/esm/components/Flow/hooks/useFlowNode.js.map +1 -1
  33. package/dist/types/index.d.ts +47 -38
  34. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"Empty.js","sources":["../../../../../src/components/Flow/Empty/Empty.tsx"],"sourcesContent":["import { useStore } from \"reactflow\";\nimport {\n HvEmptyState,\n HvEmptyStateProps,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { useClasses } from \"./Empty.styles\";\n\nexport interface HvFlowEmptyProps extends HvEmptyStateProps {}\n\nexport const HvFlowEmpty = ({ className, ...others }: HvFlowEmptyProps) => {\n const { classes, cx } = useClasses();\n const nodes = useStore((state) => state.getNodes());\n return (\n !nodes ||\n (nodes.length === 0 ? (\n <HvEmptyState className={cx(classes.root, className)} {...others} />\n ) : null)\n );\n};\n"],"names":["HvFlowEmpty","className","others","classes","cx","useClasses","nodes","useStore","state","getNodes","length","root"],"mappings":";;;;AAUO,MAAMA,cAAcA,CAAC;AAAA,EAAEC;AAAAA,EAAW,GAAGC;AAAyB,MAAM;AACnE,QAAA;AAAA,IAAEC;AAAAA,IAASC;AAAAA,MAAOC,WAAW;AACnC,QAAMC,QAAQC,SAAUC,CAAUA,UAAAA,MAAMC,UAAU;AAClD,SACE,CAACH,UACAA,MAAMI,WAAW,IACf,oBAAA,cAAA,EAAa,WAAWN,GAAGD,QAAQQ,MAAMV,SAAS,GAAG,GAAIC,OAAU,CAAA,IAClE;AAER;"}
1
+ {"version":3,"file":"Empty.js","sources":["../../../../../src/components/Flow/Empty/Empty.tsx"],"sourcesContent":["import { useNodes } from \"reactflow\";\nimport {\n HvEmptyState,\n HvEmptyStateProps,\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { useClasses } from \"./Empty.styles\";\n\nexport interface HvFlowEmptyProps extends HvEmptyStateProps {}\n\nexport const HvFlowEmpty = ({ className, ...others }: HvFlowEmptyProps) => {\n const { classes, cx } = useClasses();\n const nodes = useNodes();\n return (\n !nodes ||\n (nodes.length === 0 ? (\n <HvEmptyState className={cx(classes.root, className)} {...others} />\n ) : null)\n );\n};\n"],"names":["HvFlowEmpty","className","others","classes","cx","useClasses","nodes","useNodes","length","root"],"mappings":";;;;AAUO,MAAMA,cAAcA,CAAC;AAAA,EAAEC;AAAAA,EAAW,GAAGC;AAAyB,MAAM;AACnE,QAAA;AAAA,IAAEC;AAAAA,IAASC;AAAAA,MAAOC,WAAW;AACnC,QAAMC,QAAQC;AACd,SACE,CAACD,UACAA,MAAME,WAAW,IACf,oBAAA,cAAA,EAAa,WAAWJ,GAAGD,QAAQM,MAAMR,SAAS,GAAG,GAAIC,OAAU,CAAA,IAClE;AAER;"}
@@ -3,6 +3,7 @@ import { staticClasses as staticClasses$1 } from "./Node/BaseNode.styles.js";
3
3
  import "@emotion/react/jsx-runtime";
4
4
  import "react";
5
5
  import "reactflow";
6
+ import "uid";
6
7
  import "@hitachivantara/uikit-react-icons";
7
8
  import "@hitachivantara/uikit-styles";
8
9
  const {
@@ -1 +1 @@
1
- {"version":3,"file":"Flow.styles.js","sources":["../../../../src/components/Flow/Flow.styles.tsx"],"sourcesContent":["import { createClasses, theme } from \"@hitachivantara/uikit-react-core\";\n\nimport { flowBaseNodeClasses } from \"./Node\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFlow\", {\n root: {\n height: \"100%\",\n \"& .react-flow__handle\": {\n backgroundColor: theme.colors.secondary_60,\n width: 8,\n height: 8,\n zIndex: theme.zIndices.overlay,\n },\n \"& .react-flow__handle-connecting\": {\n backgroundColor: theme.colors.negative_20,\n width: 12,\n height: 12,\n \"&.react-flow__handle-left\": {\n translate: \"0 4px\",\n },\n },\n \"& .react-flow__handle-valid\": {\n backgroundColor: theme.colors.positive_20,\n width: 12,\n height: 12,\n \"&.react-flow__handle-left\": {\n translate: \"0 4px\",\n },\n },\n [`& .selected > .${flowBaseNodeClasses.root}`]: {\n border: `1px solid ${theme.colors.secondary_60}`,\n borderRadius: theme.radii.round,\n boxSizing: \"border-box\",\n },\n },\n});\n"],"names":["staticClasses","useClasses","createClasses","root","height","backgroundColor","theme","colors","secondary_60","width","zIndex","zIndices","overlay","negative_20","translate","positive_20","flowBaseNodeClasses","border","borderRadius","radii","round","boxSizing"],"mappings":";;;;;;;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAeC;AAAW,IAAIC,cAAc,UAAU;AAAA,EACnEC,MAAM;AAAA,IACJC,QAAQ;AAAA,IACR,yBAAyB;AAAA,MACvBC,iBAAiBC,MAAMC,OAAOC;AAAAA,MAC9BC,OAAO;AAAA,MACPL,QAAQ;AAAA,MACRM,QAAQJ,MAAMK,SAASC;AAAAA,IACzB;AAAA,IACA,oCAAoC;AAAA,MAClCP,iBAAiBC,MAAMC,OAAOM;AAAAA,MAC9BJ,OAAO;AAAA,MACPL,QAAQ;AAAA,MACR,6BAA6B;AAAA,QAC3BU,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,+BAA+B;AAAA,MAC7BT,iBAAiBC,MAAMC,OAAOQ;AAAAA,MAC9BN,OAAO;AAAA,MACPL,QAAQ;AAAA,MACR,6BAA6B;AAAA,QAC3BU,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAE,kBAAiBE,gBAAoBb,IAAK,EAAC,GAAG;AAAA,MAC9Cc,QAAS,aAAYX,MAAMC,OAAOC,YAAa;AAAA,MAC/CU,cAAcZ,MAAMa,MAAMC;AAAAA,MAC1BC,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;"}
1
+ {"version":3,"file":"Flow.styles.js","sources":["../../../../src/components/Flow/Flow.styles.tsx"],"sourcesContent":["import { createClasses, theme } from \"@hitachivantara/uikit-react-core\";\n\nimport { flowBaseNodeClasses } from \"./Node\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFlow\", {\n root: {\n height: \"100%\",\n \"& .react-flow__handle\": {\n backgroundColor: theme.colors.secondary_60,\n width: 8,\n height: 8,\n zIndex: theme.zIndices.overlay,\n },\n \"& .react-flow__handle-connecting\": {\n backgroundColor: theme.colors.negative_20,\n width: 12,\n height: 12,\n \"&.react-flow__handle-left\": {\n translate: \"0 4px\",\n },\n },\n \"& .react-flow__handle-valid\": {\n backgroundColor: theme.colors.positive_20,\n width: 12,\n height: 12,\n \"&.react-flow__handle-left\": {\n translate: \"0 4px\",\n },\n },\n [`& .selected > .${flowBaseNodeClasses.root}`]: {\n border: `1px solid ${theme.colors.secondary_60}`,\n borderRadius: theme.radii.round,\n boxSizing: \"border-box\",\n },\n },\n});\n"],"names":["staticClasses","useClasses","createClasses","root","height","backgroundColor","theme","colors","secondary_60","width","zIndex","zIndices","overlay","negative_20","translate","positive_20","flowBaseNodeClasses","border","borderRadius","radii","round","boxSizing"],"mappings":";;;;;;;;AAIa,MAAA;AAAA,EAAEA;AAAAA,EAAeC;AAAW,IAAIC,cAAc,UAAU;AAAA,EACnEC,MAAM;AAAA,IACJC,QAAQ;AAAA,IACR,yBAAyB;AAAA,MACvBC,iBAAiBC,MAAMC,OAAOC;AAAAA,MAC9BC,OAAO;AAAA,MACPL,QAAQ;AAAA,MACRM,QAAQJ,MAAMK,SAASC;AAAAA,IACzB;AAAA,IACA,oCAAoC;AAAA,MAClCP,iBAAiBC,MAAMC,OAAOM;AAAAA,MAC9BJ,OAAO;AAAA,MACPL,QAAQ;AAAA,MACR,6BAA6B;AAAA,QAC3BU,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,+BAA+B;AAAA,MAC7BT,iBAAiBC,MAAMC,OAAOQ;AAAAA,MAC9BN,OAAO;AAAA,MACPL,QAAQ;AAAA,MACR,6BAA6B;AAAA,QAC3BU,WAAW;AAAA,MACb;AAAA,IACF;AAAA,IACA,CAAE,kBAAiBE,gBAAoBb,IAAK,EAAC,GAAG;AAAA,MAC9Cc,QAAS,aAAYX,MAAMC,OAAOC,YAAa;AAAA,MAC/CU,cAAcZ,MAAMa,MAAMC;AAAAA,MAC1BC,WAAW;AAAA,IACb;AAAA,EACF;AACF,CAAC;"}
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx, Fragment } from "@emotion/react/jsx-runtime";
2
2
  import { useEffect, useState, useCallback, isValidElement } from "react";
3
- import { useReactFlow, useStore, NodeToolbar, Handle, Position } from "reactflow";
3
+ import { useReactFlow, useEdges, useNodes, NodeToolbar, Handle, Position } from "reactflow";
4
+ import { uid } from "uid";
4
5
  import { HvButton, HvTypography } from "@hitachivantara/uikit-react-core";
5
6
  import { Delete, Duplicate } from "@hitachivantara/uikit-react-icons";
6
7
  import { theme, getColor } from "@hitachivantara/uikit-styles";
@@ -58,8 +59,8 @@ const HvFlowBaseNode = ({
58
59
  cx,
59
60
  css
60
61
  } = useClasses(classesProp);
61
- const edges = useStore((s) => s.edges);
62
- const nodes = useStore((s) => s.getNodes());
62
+ const edges = useEdges();
63
+ const nodes = useNodes();
63
64
  const node = nodes.find((n) => n.id === id);
64
65
  const handleDefaultAction = useCallback((action) => {
65
66
  if (!node)
@@ -77,7 +78,7 @@ const HvFlowBaseNode = ({
77
78
  case "duplicate":
78
79
  reactFlowInstance.addNodes([{
79
80
  ...node,
80
- id: `${reactFlowInstance.getNodes().length + 1}`,
81
+ id: uid(),
81
82
  position: {
82
83
  x: node.position.x,
83
84
  y: node.position.y + (node.height || 0) + 20
@@ -91,14 +92,25 @@ const HvFlowBaseNode = ({
91
92
  if (!node)
92
93
  return null;
93
94
  const color = getColor(colorProp);
94
- return /* @__PURE__ */ jsxs("div", { className: cx(css({
95
- border: `1px solid ${color}`
96
- }), classes.root, className), onMouseEnter: () => setShowActions(true), onMouseLeave: () => setShowActions(false), children: [
95
+ const iconColor = isValidElement(icon) ? getColor(icon.props.color || "base_dark") : getColor("base_dark");
96
+ return /* @__PURE__ */ jsxs("div", { className: cx(
97
+ "nowheel",
98
+ // Disables the default canvas pan behaviour when scrolling inside the node
99
+ css({
100
+ border: `1px solid ${color}`
101
+ }),
102
+ classes.root,
103
+ className
104
+ ), onMouseEnter: () => setShowActions(true), onMouseLeave: () => setShowActions(false), children: [
97
105
  /* @__PURE__ */ jsx(NodeToolbar, { isVisible: showActions, offset: 0, children: nodeActions?.map((action) => /* @__PURE__ */ jsx(HvButton, { icon: true, onClick: () => handleDefaultAction(action), children: renderedIcon(action.icon) }, action.id)) }),
98
106
  /* @__PURE__ */ jsxs("div", { className: cx(css({
99
107
  backgroundColor: color
100
108
  }), classes.headerContainer), children: [
101
- /* @__PURE__ */ jsxs("div", { className: classes.titleContainer, children: [
109
+ /* @__PURE__ */ jsxs("div", { className: cx(classes.titleContainer, css({
110
+ "& svg *.color0": {
111
+ fill: iconColor
112
+ }
113
+ })), children: [
102
114
  icon,
103
115
  /* @__PURE__ */ jsx(HvTypography, { variant: "title4", className: classes.title, children: title })
104
116
  ] }),
@@ -1 +1 @@
1
- {"version":3,"file":"BaseNode.js","sources":["../../../../../src/components/Flow/Node/BaseNode.tsx"],"sourcesContent":["import { isValidElement, useCallback, useEffect, useState } from \"react\";\n\nimport {\n Edge,\n Handle,\n NodeProps,\n NodeToolbar,\n Position,\n useReactFlow,\n useStore,\n} from \"reactflow\";\n\nimport {\n ExtractNames,\n HvActionGeneric,\n HvBaseProps,\n HvButton,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { Delete, Duplicate } from \"@hitachivantara/uikit-react-icons\";\nimport { HvColorAny, getColor, theme } from \"@hitachivantara/uikit-styles\";\n\nimport {\n HvFlowNodeAction,\n HvFlowBuiltInActions,\n HvFlowNodeInput,\n HvFlowNodeOutput,\n} from \"../types/index\";\nimport { useNodeMetaRegistry } from \"../FlowContext/NodeMetaContext\";\nimport { staticClasses, useClasses } from \"./BaseNode.styles\";\n\nexport { staticClasses as flowBaseNodeClasses };\n\nexport type HvFlowBaseNodeClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFlowBaseNodeProps<T = any>\n extends Omit<HvBaseProps, \"id\">,\n NodeProps<T> {\n /** Header title */\n title?: string;\n /** Header icon */\n icon?: React.ReactNode;\n /** Header color */\n color?: HvColorAny;\n /** Header items */\n headerItems?: React.ReactNode;\n /** Node inputs */\n inputs?: HvFlowNodeInput[];\n /** Node outputs */\n outputs?: HvFlowNodeOutput[];\n /** Node actions */\n nodeActions?: HvFlowNodeAction[];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowBaseNodeClasses;\n}\n\nconst isInputConnected = (\n id: string,\n type: \"target\" | \"source\",\n idx: number,\n edges: Edge[]\n) => {\n if (type === \"target\") {\n return edges.some(\n (e) => e.target === id && e.targetHandle === idx.toString()\n );\n }\n if (type === \"source\") {\n return edges.some(\n (e) => e.source === id && e.sourceHandle === idx.toString()\n );\n }\n\n return false;\n};\n\nconst defaultActions: HvFlowBuiltInActions[] = [\n { id: \"delete\", label: \"Delete\", icon: <Delete /> },\n { id: \"duplicate\", label: \"Duplicate\", icon: <Duplicate /> },\n];\n\nconst renderedIcon = (actionIcon: HvActionGeneric[\"icon\"]) =>\n isValidElement(actionIcon) ? actionIcon : (actionIcon as Function)?.();\n\nexport const HvFlowBaseNode = ({\n id,\n title,\n headerItems,\n icon,\n color: colorProp,\n inputs,\n outputs,\n nodeActions = defaultActions,\n classes: classesProp,\n className,\n children,\n}: HvFlowBaseNodeProps<unknown>) => {\n const { registerNode, unregisterNode } = useNodeMetaRegistry();\n useEffect(() => {\n registerNode(id, { label: title || \"\", inputs, outputs });\n return () => unregisterNode(id);\n }, [id, title, inputs, outputs, registerNode, unregisterNode]);\n\n const [showActions, setShowActions] = useState(false);\n const reactFlowInstance = useReactFlow();\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const edges = useStore((s) => s.edges);\n const nodes = useStore((s) => s.getNodes());\n\n const node = nodes.find((n) => n.id === id);\n\n const handleDefaultAction = useCallback(\n (action: HvFlowNodeAction) => {\n if (!node) return;\n\n if (action.callback) {\n action.callback(node);\n return;\n }\n\n // built-in actions\n switch (action.id) {\n case \"delete\":\n reactFlowInstance.deleteElements({ nodes: [node] });\n break;\n case \"duplicate\":\n reactFlowInstance.addNodes([\n {\n ...node,\n id: `${reactFlowInstance.getNodes().length + 1}`,\n position: {\n x: node.position.x,\n y: node.position.y + (node.height || 0) + 20,\n },\n selected: false,\n zIndex: Number(theme.zIndices.overlay),\n },\n ]);\n break;\n default:\n break;\n }\n },\n [node, reactFlowInstance]\n );\n\n if (!node) return null;\n\n const color = getColor(colorProp);\n\n return (\n <div\n className={cx(\n css({ border: `1px solid ${color}` }),\n classes.root,\n className\n )}\n onMouseEnter={() => setShowActions(true)}\n onMouseLeave={() => setShowActions(false)}\n >\n <NodeToolbar isVisible={showActions} offset={0}>\n {nodeActions?.map((action) => (\n <HvButton\n key={action.id}\n icon\n onClick={() => handleDefaultAction(action)}\n >\n {renderedIcon(action.icon)}\n </HvButton>\n ))}\n </NodeToolbar>\n <div\n className={cx(css({ backgroundColor: color }), classes.headerContainer)}\n >\n <div className={classes.titleContainer}>\n {icon}\n <HvTypography variant=\"title4\" className={classes.title}>\n {title}\n </HvTypography>\n </div>\n {headerItems && <div style={{ display: \"flex\" }}>{headerItems}</div>}\n </div>\n {children && <div className={classes.contentContainer}>{children}</div>}\n {inputs && inputs.length > 0 && (\n <>\n <div className={classes.inputsTitleContainer}>\n <HvTypography>Inputs</HvTypography>\n </div>\n\n <div className={classes.inputsContainer}>\n {inputs?.map((input, idx) => (\n <div className={classes.inputContainer} key={idx}>\n <Handle\n type=\"target\"\n isConnectableStart={false}\n id={`${idx}`}\n position={Position.Left}\n style={{\n top: \"auto\",\n bottom:\n (outputs?.length ? 80 : 18) +\n (outputs?.length || 0) * 29 +\n 29 * idx,\n }}\n />\n <HvTypography>{input.label}</HvTypography>\n {input.isMandatory &&\n !isInputConnected(id, \"target\", idx, edges) && (\n <div className={classes.mandatory} />\n )}\n </div>\n ))}\n </div>\n </>\n )}\n {outputs && outputs.length > 0 && (\n <>\n <div className={classes.outputsTitleContainer}>\n <HvTypography>Outputs</HvTypography>\n </div>\n <div className={classes.outputsContainer}>\n {outputs?.map((output, idx) => (\n <div className={classes.outputContainer} key={idx}>\n <Handle\n type=\"source\"\n isConnectableEnd={false}\n id={`${idx}`}\n position={Position.Right}\n style={{\n bottom: -10 + 29 * (outputs.length - idx),\n top: \"auto\",\n }}\n />\n {output.isMandatory &&\n !isInputConnected(id, \"source\", idx, edges) && (\n <div className={classes.mandatory} />\n )}\n <HvTypography>{output.label}</HvTypography>\n </div>\n ))}\n </div>\n </>\n )}\n </div>\n );\n};\n"],"names":["isInputConnected","id","type","idx","edges","some","e","target","targetHandle","toString","source","sourceHandle","defaultActions","label","icon","renderedIcon","actionIcon","isValidElement","HvFlowBaseNode","title","headerItems","color","colorProp","inputs","outputs","nodeActions","classes","classesProp","className","children","registerNode","unregisterNode","useNodeMetaRegistry","useEffect","showActions","setShowActions","useState","reactFlowInstance","useReactFlow","cx","css","useClasses","useStore","s","nodes","getNodes","node","find","n","handleDefaultAction","useCallback","action","callback","deleteElements","addNodes","length","position","x","y","height","selected","zIndex","Number","theme","zIndices","overlay","getColor","border","root","map","backgroundColor","headerContainer","titleContainer","display","contentContainer","inputsTitleContainer","inputsContainer","input","inputContainer","Position","Left","top","bottom","isMandatory","mandatory","outputsTitleContainer","outputsContainer","output","outputContainer","Right"],"mappings":";;;;;;;;;AAwDA,MAAMA,mBAAmBA,CACvBC,IACAC,MACAC,KACAC,UACG;AACH,MAAIF,SAAS,UAAU;AACdE,WAAAA,MAAMC,KACVC,CAAAA,MAAMA,EAAEC,WAAWN,MAAMK,EAAEE,iBAAiBL,IAAIM,SACnD,CAAA;AAAA,EACF;AACA,MAAIP,SAAS,UAAU;AACdE,WAAAA,MAAMC,KACVC,CAAAA,MAAMA,EAAEI,WAAWT,MAAMK,EAAEK,iBAAiB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A,MAAA,oBAAC,SAAI,WAAW7B,QAAQ2D,uBACtB,UAAC,oBAAA,cAAA,EAAa,qBAAO,EACvB,CAAA;AAAA,MACC,oBAAA,OAAA,EAAI,WAAW3D,QAAQ4D,kBACrB9D,UAAS6C,SAAAA,IAAI,CAACkB,QAAQpF,QACrB,qBAAC,OAAI,EAAA,WAAWuB,QAAQ8D,iBACtB,UAAA;AAAA,QAAA,oBAAC,QACC,EAAA,MAAK,UACL,kBAAkB,OAClB,IAAK,GAAErF,GAAI,IACX,UAAU4E,SAASU,OACnB,OAAO;AAAA,UACLP,QAAQ,MAAM,MAAM1D,QAAQ+B,SAASpD;AAAAA,UACrC8E,KAAK;AAAA,QAAA,GACL;AAAA,QAEHM,OAAOJ,eACN,CAACnF,iBAAiBC,IAAI,UAAUE,KAAKC,KAAK,KACxC,oBAAC,OAAI,EAAA,WAAWsB,QAAQ0D,UACzB,CAAA;AAAA,QACH,oBAAC,cAAcG,EAAAA,UAAAA,OAAO1E,MAAM,CAAA;AAAA,MAAA,KAfgBV,GAgB9C,CACD,GACH;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"BaseNode.js","sources":["../../../../../src/components/Flow/Node/BaseNode.tsx"],"sourcesContent":["import { isValidElement, useCallback, useEffect, useState } from \"react\";\nimport {\n Edge,\n Handle,\n NodeProps,\n NodeToolbar,\n Position,\n useEdges,\n useNodes,\n useReactFlow,\n} from \"reactflow\";\nimport { uid } from \"uid\";\nimport {\n ExtractNames,\n HvActionGeneric,\n HvBaseProps,\n HvButton,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { Delete, Duplicate } from \"@hitachivantara/uikit-react-icons\";\nimport { HvColorAny, getColor, theme } from \"@hitachivantara/uikit-styles\";\n\nimport {\n HvFlowNodeAction,\n HvFlowBuiltInActions,\n HvFlowNodeInput,\n HvFlowNodeOutput,\n} from \"../types\";\nimport { useNodeMetaRegistry } from \"../FlowContext/NodeMetaContext\";\nimport { staticClasses, useClasses } from \"./BaseNode.styles\";\n\nexport { staticClasses as flowBaseNodeClasses };\n\nexport type HvFlowBaseNodeClasses = ExtractNames<typeof useClasses>;\n\nexport interface HvFlowBaseNodeProps<T = any>\n extends Omit<HvBaseProps, \"id\">,\n NodeProps<T> {\n /** Header title */\n title?: string;\n /** Header icon */\n icon?: React.ReactNode;\n /** Header color */\n color?: HvColorAny;\n /** Header items */\n headerItems?: React.ReactNode;\n /** Node inputs */\n inputs?: HvFlowNodeInput[];\n /** Node outputs */\n outputs?: HvFlowNodeOutput[];\n /** Node actions */\n nodeActions?: HvFlowNodeAction[];\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowBaseNodeClasses;\n}\n\nconst isInputConnected = (\n id: string,\n type: \"target\" | \"source\",\n idx: number,\n edges: Edge[]\n) => {\n if (type === \"target\") {\n return edges.some(\n (e) => e.target === id && e.targetHandle === idx.toString()\n );\n }\n if (type === \"source\") {\n return edges.some(\n (e) => e.source === id && e.sourceHandle === idx.toString()\n );\n }\n\n return false;\n};\n\nconst defaultActions: HvFlowBuiltInActions[] = [\n { id: \"delete\", label: \"Delete\", icon: <Delete /> },\n { id: \"duplicate\", label: \"Duplicate\", icon: <Duplicate /> },\n];\n\nconst renderedIcon = (actionIcon: HvActionGeneric[\"icon\"]) =>\n isValidElement(actionIcon) ? actionIcon : (actionIcon as Function)?.();\n\nexport const HvFlowBaseNode = ({\n id,\n title,\n headerItems,\n icon,\n color: colorProp,\n inputs,\n outputs,\n nodeActions = defaultActions,\n classes: classesProp,\n className,\n children,\n}: HvFlowBaseNodeProps<unknown>) => {\n const { registerNode, unregisterNode } = useNodeMetaRegistry();\n useEffect(() => {\n registerNode(id, { label: title || \"\", inputs, outputs });\n return () => unregisterNode(id);\n }, [id, title, inputs, outputs, registerNode, unregisterNode]);\n\n const [showActions, setShowActions] = useState(false);\n const reactFlowInstance = useReactFlow();\n\n const { classes, cx, css } = useClasses(classesProp);\n\n const edges = useEdges();\n const nodes = useNodes();\n\n const node = nodes.find((n) => n.id === id);\n\n const handleDefaultAction = useCallback(\n (action: HvFlowNodeAction) => {\n if (!node) return;\n\n if (action.callback) {\n action.callback(node);\n return;\n }\n\n // built-in actions\n switch (action.id) {\n case \"delete\":\n reactFlowInstance.deleteElements({ nodes: [node] });\n break;\n case \"duplicate\":\n reactFlowInstance.addNodes([\n {\n ...node,\n id: uid(),\n position: {\n x: node.position.x,\n y: node.position.y + (node.height || 0) + 20,\n },\n selected: false,\n zIndex: Number(theme.zIndices.overlay),\n },\n ]);\n break;\n default:\n break;\n }\n },\n [node, reactFlowInstance]\n );\n\n if (!node) return null;\n\n const color = getColor(colorProp);\n const iconColor = isValidElement(icon)\n ? getColor(icon.props.color || \"base_dark\")\n : getColor(\"base_dark\");\n\n return (\n <div\n className={cx(\n \"nowheel\", // Disables the default canvas pan behaviour when scrolling inside the node\n css({ border: `1px solid ${color}` }),\n classes.root,\n className\n )}\n onMouseEnter={() => setShowActions(true)}\n onMouseLeave={() => setShowActions(false)}\n >\n <NodeToolbar isVisible={showActions} offset={0}>\n {nodeActions?.map((action) => (\n <HvButton\n key={action.id}\n icon\n onClick={() => handleDefaultAction(action)}\n >\n {renderedIcon(action.icon)}\n </HvButton>\n ))}\n </NodeToolbar>\n <div\n className={cx(css({ backgroundColor: color }), classes.headerContainer)}\n >\n <div\n className={cx(\n classes.titleContainer,\n css({ \"& svg *.color0\": { fill: iconColor } })\n )}\n >\n {icon}\n <HvTypography variant=\"title4\" className={classes.title}>\n {title}\n </HvTypography>\n </div>\n {headerItems && <div style={{ display: \"flex\" }}>{headerItems}</div>}\n </div>\n {children && <div className={classes.contentContainer}>{children}</div>}\n {inputs && inputs.length > 0 && (\n <>\n <div className={classes.inputsTitleContainer}>\n <HvTypography>Inputs</HvTypography>\n </div>\n\n <div className={classes.inputsContainer}>\n {inputs?.map((input, idx) => (\n <div className={classes.inputContainer} key={idx}>\n <Handle\n type=\"target\"\n isConnectableStart={false}\n id={`${idx}`}\n position={Position.Left}\n style={{\n top: \"auto\",\n bottom:\n (outputs?.length ? 80 : 18) +\n (outputs?.length || 0) * 29 +\n 29 * idx,\n }}\n />\n <HvTypography>{input.label}</HvTypography>\n {input.isMandatory &&\n !isInputConnected(id, \"target\", idx, edges) && (\n <div className={classes.mandatory} />\n )}\n </div>\n ))}\n </div>\n </>\n )}\n {outputs && outputs.length > 0 && (\n <>\n <div className={classes.outputsTitleContainer}>\n <HvTypography>Outputs</HvTypography>\n </div>\n <div className={classes.outputsContainer}>\n {outputs?.map((output, idx) => (\n <div className={classes.outputContainer} key={idx}>\n <Handle\n type=\"source\"\n isConnectableEnd={false}\n id={`${idx}`}\n position={Position.Right}\n style={{\n bottom: -10 + 29 * (outputs.length - idx),\n top: \"auto\",\n }}\n />\n {output.isMandatory &&\n !isInputConnected(id, \"source\", idx, edges) && (\n <div className={classes.mandatory} />\n )}\n <HvTypography>{output.label}</HvTypography>\n </div>\n ))}\n </div>\n </>\n )}\n </div>\n );\n};\n"],"names":["isInputConnected","id","type","idx","edges","some","e","target","targetHandle","toString","source","sourceHandle","defaultActions","label","icon","renderedIcon","actionIcon","isValidElement","HvFlowBaseNode","title","headerItems","color","colorProp","inputs","outputs","nodeActions","classes","classesProp","className","children","registerNode","unregisterNode","useNodeMetaRegistry","useEffect","showActions","setShowActions","useState","reactFlowInstance","useReactFlow","cx","css","useClasses","useEdges","nodes","useNodes","node","find","n","handleDefaultAction","useCallback","action","callback","deleteElements","addNodes","uid","position","x","y","height","selected","zIndex","Number","theme","zIndices","overlay","getColor","iconColor","props","border","root","map","backgroundColor","headerContainer","titleContainer","fill","display","contentContainer","length","inputsTitleContainer","inputsContainer","input","inputContainer","Position","Left","top","bottom","isMandatory","mandatory","outputsTitleContainer","outputsContainer","output","outputContainer","Right"],"mappings":";;;;;;;;;;AAwDA,MAAMA,mBAAmBA,CACvBC,IACAC,MACAC,KACAC,UACG;AACH,MAAIF,SAAS,UAAU;AACdE,WAAAA,MAAMC,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,QAEJ,oBAAC,cAAc6E,EAAAA,UAAAA,MAAMnE,MAAM,CAAA;AAAA,QAC1BmE,MAAMM,eACL,CAACtF,iBAAiBC,IAAI,UAAUE,KAAKC,KAAK,KACxC,oBAAC,OAAI,EAAA,WAAWsB,QAAQ6D,UACzB,CAAA;AAAA,MAAA,KAlBwCpF,GAmB7C,CACD,GACH;AAAA,IAAA,GACF;AAAA,IAEDqB,WAAWA,QAAQqD,SAAS,KAEzB,qBAAA,UAAA,EAAA,UAAA;AAAA,MAAA,oBAAC,SAAI,WAAWnD,QAAQ8D,uBACtB,UAAC,oBAAA,cAAA,EAAa,qBAAO,EACvB,CAAA;AAAA,MACC,oBAAA,OAAA,EAAI,WAAW9D,QAAQ+D,kBACrBjE,UAAS8C,SAAAA,IAAI,CAACoB,QAAQvF,QACrB,qBAAC,OAAI,EAAA,WAAWuB,QAAQiE,iBACtB,UAAA;AAAA,QAAA,oBAAC,QACC,EAAA,MAAK,UACL,kBAAkB,OAClB,IAAK,GAAExF,GAAI,IACX,UAAU+E,SAASU,OACnB,OAAO;AAAA,UACLP,QAAQ,MAAM,MAAM7D,QAAQqD,SAAS1E;AAAAA,UACrCiF,KAAK;AAAA,QAAA,GACL;AAAA,QAEHM,OAAOJ,eACN,CAACtF,iBAAiBC,IAAI,UAAUE,KAAKC,KAAK,KACxC,oBAAC,OAAI,EAAA,WAAWsB,QAAQ6D,UACzB,CAAA;AAAA,QACH,oBAAC,cAAcG,EAAAA,UAAAA,OAAO7E,MAAM,CAAA;AAAA,MAAA,KAfgBV,GAgB9C,CACD,GACH;AAAA,IAAA,GACF;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
@@ -50,8 +50,8 @@ const HvFlowNode = ({
50
50
  const hasParams = !!(params && params.length > 0);
51
51
  return /* @__PURE__ */ jsxs(HvFlowBaseNode, { id, type, title: groupLabel, icon, color, inputs, outputs, nodeActions: defaultActions, classes: classesProp, headerItems: /* @__PURE__ */ jsxs(Fragment, { children: [
52
52
  headerItems,
53
- description && /* @__PURE__ */ jsx(HvTooltip, { title: /* @__PURE__ */ jsx(HvTypography, { children: description }), children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Info, {}) }) }),
54
- hasParams && /* @__PURE__ */ jsx(HvButton, { icon: true, onClick: () => setShowParams((p) => !p), children: showParams ? /* @__PURE__ */ jsx(Up, {}) : /* @__PURE__ */ jsx(Down, {}) })
53
+ description && /* @__PURE__ */ jsx(HvTooltip, { title: /* @__PURE__ */ jsx(HvTypography, { children: description }), children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Info, { color: "base_dark" }) }) }),
54
+ hasParams && /* @__PURE__ */ jsx(HvButton, { icon: true, overrideIconColors: false, onClick: () => setShowParams((p) => !p), children: showParams ? /* @__PURE__ */ jsx(Up, { color: "base_dark" }) : /* @__PURE__ */ jsx(Down, { color: "base_dark" }) })
55
55
  ] }), ...props, children: [
56
56
  (subtitle || actsVisible?.length || actsDropdown?.length) && /* @__PURE__ */ jsxs("div", { className: classes.subtitleContainer, children: [
57
57
  subtitle && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(HvTypography, { children: subtitle }) }),
@@ -1 +1 @@
1
- {"version":3,"file":"Node.js","sources":["../../../../../src/components/Flow/Node/Node.tsx"],"sourcesContent":["import React, { SyntheticEvent, isValidElement, useState } from \"react\";\n\nimport {\n ExtractNames,\n HvActionGeneric,\n HvActionsGenericProps,\n HvButton,\n HvDropDownMenu,\n HvTooltip,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { getColor } from \"@hitachivantara/uikit-styles\";\nimport { Down, Info, Up } from \"@hitachivantara/uikit-react-icons\";\n\nimport { useFlowContext, useFlowNode } from \"../hooks/index\";\nimport { HvFlowNodeParam } from \"../types/index\";\nimport { staticClasses, useClasses } from \"./Node.styles\";\nimport ParamRenderer from \"./Parameters/ParamRenderer\";\nimport { HvFlowBaseNode, HvFlowBaseNodeProps } from \"./BaseNode\";\n\nexport { staticClasses as flowNodeClasses };\n// TODO How to include here the types from the parent component?\nexport type HvFlowNodeClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFlowNodeDefaults = {\n title?: string;\n subTitle?: string;\n color?: string;\n icon?: React.ReactNode;\n};\n\nexport interface HvFlowNodeProps<T = any>\n extends Omit<HvFlowBaseNodeProps<T>, \"classes\"> {\n /** Node description */\n description?: string;\n /** Node actions */\n actions?: HvActionGeneric[]; // HvFlowNodeActions[];\n /** Node action callback */\n actionCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** Node maximum number of actions visible */\n maxVisibleActions?: number;\n /** Node expanded */\n expanded?: boolean;\n /** Node parameters */\n params?: HvFlowNodeParam[];\n /** A set of node default values for when there are no groups to fetch this data from. */\n nodeDefaults?: HvFlowNodeDefaults;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowNodeClasses | HvFlowBaseNodeProps<T>[\"classes\"];\n}\n\nconst renderedIcon = (actionIcon: HvActionGeneric[\"icon\"]) =>\n isValidElement(actionIcon) ? actionIcon : (actionIcon as Function)?.();\n\nexport const HvFlowNode = ({\n id,\n type,\n headerItems,\n description,\n actions,\n actionCallback,\n maxVisibleActions = 1,\n expanded = false,\n params,\n nodeDefaults,\n classes: classesProp,\n children,\n ...props\n}: HvFlowNodeProps<unknown>) => {\n const { classes } = useClasses(classesProp as HvFlowNodeClasses);\n const [showParams, setShowParams] = useState(expanded);\n const { node } = useFlowNode(id);\n\n const { nodeGroups, nodeTypes, defaultActions } = useFlowContext();\n const groupId = nodeTypes?.[type].meta?.groupId;\n const subtitle = nodeTypes?.[type].meta?.label || nodeDefaults?.subTitle;\n const groupLabel =\n (groupId && nodeGroups && nodeGroups[groupId].label) || nodeDefaults?.title;\n\n const inputs = nodeTypes?.[type]?.meta?.inputs;\n const outputs = nodeTypes?.[type]?.meta?.outputs;\n const icon =\n (groupId && nodeGroups && nodeGroups[groupId].icon) || nodeDefaults?.icon;\n const colorProp =\n (groupId && nodeGroups && nodeGroups[groupId].color) || nodeDefaults?.color;\n const color = getColor(colorProp);\n\n const actsVisible = actions?.slice(0, maxVisibleActions);\n const actsDropdown = actions?.slice(maxVisibleActions);\n\n const hasParams = !!(params && params.length > 0);\n\n return (\n <HvFlowBaseNode\n id={id}\n type={type}\n title={groupLabel}\n icon={icon}\n color={color}\n inputs={inputs}\n outputs={outputs}\n nodeActions={defaultActions}\n classes={classesProp as HvFlowBaseNodeProps<unknown>[\"classes\"]}\n headerItems={\n <>\n {headerItems}\n {description && (\n <HvTooltip title={<HvTypography>{description}</HvTypography>}>\n <div>\n <Info />\n </div>\n </HvTooltip>\n )}\n {hasParams && (\n <HvButton icon onClick={() => setShowParams((p) => !p)}>\n {showParams ? <Up /> : <Down />}\n </HvButton>\n )}\n </>\n }\n {...props}\n >\n {(subtitle || actsVisible?.length || actsDropdown?.length) && (\n <div className={classes.subtitleContainer}>\n {subtitle && (\n <div>\n <HvTypography>{subtitle}</HvTypography>\n </div>\n )}\n <div className={classes.actions}>\n {actions?.length && actions?.length > 0 && (\n <>\n {actsVisible?.map((action) => (\n <HvTooltip\n key={action.id}\n title={<HvTypography>{action.label}</HvTypography>}\n >\n <div>\n <HvButton\n icon\n onClick={(event: SyntheticEvent<Element, Event>) => {\n actionCallback?.(event, id, action);\n }}\n aria-label={action.label}\n >\n {renderedIcon(action.icon)}\n </HvButton>\n </div>\n </HvTooltip>\n ))}\n\n {actsDropdown && actsDropdown.length > 0 && (\n <HvDropDownMenu\n keepOpened={false}\n dataList={actsDropdown?.map((action) => ({\n id: action.id,\n label: action.label,\n }))}\n onClick={(event, action) => {\n actionCallback?.(event, id, action as HvActionGeneric);\n }}\n />\n )}\n </>\n )}\n </div>\n </div>\n )}\n {children}\n {showParams && params && (\n <div className={classes.paramsContainer}>\n <ParamRenderer nodeId={id} params={params} data={node?.data} />\n </div>\n )}\n </HvFlowBaseNode>\n );\n};\n"],"names":["renderedIcon","actionIcon","isValidElement","HvFlowNode","id","type","headerItems","description","actions","actionCallback","maxVisibleActions","expanded","params","nodeDefaults","classes","classesProp","children","props","useClasses","showParams","setShowParams","useState","node","useFlowNode","nodeGroups","nodeTypes","defaultActions","useFlowContext","groupId","meta","subtitle","label","subTitle","groupLabel","title","inputs","outputs","icon","colorProp","color","getColor","actsVisible","slice","actsDropdown","hasParams","length","p","subtitleContainer","map","action","event","paramsContainer","data"],"mappings":";;;;;;;;;;;AAmDA,MAAMA,eAAeA,CAACC,eACpBC,eAAeD,UAAU,IAAIA,aAAcA;AAEtC,MAAME,aAAaA,CAAC;AAAA,EACzBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,oBAAoB;AAAA,EACpBC,WAAW;AAAA,EACXC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AAAAA,EACA,GAAGC;AACqB,MAAM;AACxB,QAAA;AAAA,IAAEH;AAAAA,EAAAA,IAAYI,WAAWH,WAAiC;AAChE,QAAM,CAACI,YAAYC,aAAa,IAAIC,SAASV,QAAQ;AAC/C,QAAA;AAAA,IAAEW;AAAAA,EAAAA,IAASC,YAAYnB,EAAE;AAEzB,QAAA;AAAA,IAAEoB;AAAAA,IAAYC;AAAAA,IAAWC;AAAAA,MAAmBC,eAAe;AACjE,QAAMC,UAAUH,YAAYpB,IAAI,EAAEwB,MAAMD;AACxC,QAAME,WAAWL,YAAYpB,IAAI,EAAEwB,MAAME,SAASlB,cAAcmB;AAChE,QAAMC,aACHL,WAAWJ,cAAcA,WAAWI,OAAO,EAAEG,SAAUlB,cAAcqB;AAExE,QAAMC,SAASV,YAAYpB,IAAI,GAAGwB,MAAMM;AACxC,QAAMC,UAAUX,YAAYpB,IAAI,GAAGwB,MAAMO;AACzC,QAAMC,OACHT,WAAWJ,cAAcA,WAAWI,OAAO,EAAES,QAASxB,cAAcwB;AACvE,QAAMC,YACHV,WAAWJ,cAAcA,WAAWI,OAAO,EAAEW,SAAU1B,cAAc0B;AAClEA,Q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AEpC,GAAA,cAAYA,OAAOlB,OAElB/B,UAAaiD,aAAAA,OAAOZ,IAAI,EAC3B,CAAA,EACF,CAAA,EAAA,GAbKY,OAAO7C,EAcd,CACD;AAAA,QAEAuC,gBAAgBA,aAAaE,SAAS,KACrC,oBAAC,gBACC,EAAA,YAAY,OACZ,UAAUF,cAAcK,IAAKC,CAAY,YAAA;AAAA,UACvC7C,IAAI6C,OAAO7C;AAAAA,UACX2B,OAAOkB,OAAOlB;AAAAA,QACd,EAAA,GACF,SAAS,CAACmB,OAAOD,WAAW;AACTC,2BAAAA,OAAO9C,IAAI6C,MAA0B;AAAA,QAAA,GAG3D;AAAA,MAAA,EAAA,CACH,EAEJ,CAAA;AAAA,IAAA,GACF;AAAA,IAEDjC;AAAAA,IACAG,cAAcP,UACZ,oBAAA,OAAA,EAAI,WAAWE,QAAQqC,iBACtB,UAAC,oBAAA,eAAA,EAAc,QAAQ/C,IAAI,QAAgB,MAAMkB,MAAM8B,KAAK,CAAA,GAC9D;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
1
+ {"version":3,"file":"Node.js","sources":["../../../../../src/components/Flow/Node/Node.tsx"],"sourcesContent":["import React, { SyntheticEvent, isValidElement, useState } from \"react\";\n\nimport {\n ExtractNames,\n HvActionGeneric,\n HvActionsGenericProps,\n HvButton,\n HvDropDownMenu,\n HvTooltip,\n HvTypography,\n} from \"@hitachivantara/uikit-react-core\";\nimport { getColor } from \"@hitachivantara/uikit-styles\";\nimport { Down, Info, Up } from \"@hitachivantara/uikit-react-icons\";\n\nimport { useFlowContext, useFlowNode } from \"../hooks/index\";\nimport { HvFlowNodeParam } from \"../types/index\";\nimport { staticClasses, useClasses } from \"./Node.styles\";\nimport ParamRenderer from \"./Parameters/ParamRenderer\";\nimport { HvFlowBaseNode, HvFlowBaseNodeProps } from \"./BaseNode\";\n\nexport { staticClasses as flowNodeClasses };\n// TODO How to include here the types from the parent component?\nexport type HvFlowNodeClasses = ExtractNames<typeof useClasses>;\n\nexport type HvFlowNodeDefaults = {\n title?: string;\n subTitle?: string;\n color?: string;\n icon?: React.ReactNode;\n};\n\nexport interface HvFlowNodeProps<T = any>\n extends Omit<HvFlowBaseNodeProps<T>, \"classes\"> {\n /** Node description */\n description?: string;\n /** Node actions */\n actions?: HvActionGeneric[]; // HvFlowNodeActions[];\n /** Node action callback */\n actionCallback?: HvActionsGenericProps[\"actionsCallback\"];\n /** Node maximum number of actions visible */\n maxVisibleActions?: number;\n /** Node expanded */\n expanded?: boolean;\n /** Node parameters */\n params?: HvFlowNodeParam[];\n /** A set of node default values for when there are no groups to fetch this data from. */\n nodeDefaults?: HvFlowNodeDefaults;\n /** A Jss Object used to override or extend the styles applied to the component. */\n classes?: HvFlowNodeClasses | HvFlowBaseNodeProps<T>[\"classes\"];\n}\n\nconst renderedIcon = (actionIcon: HvActionGeneric[\"icon\"]) =>\n isValidElement(actionIcon) ? actionIcon : (actionIcon as Function)?.();\n\nexport const HvFlowNode = ({\n id,\n type,\n headerItems,\n description,\n actions,\n actionCallback,\n maxVisibleActions = 1,\n expanded = false,\n params,\n nodeDefaults,\n classes: classesProp,\n children,\n ...props\n}: HvFlowNodeProps<unknown>) => {\n const { classes } = useClasses(classesProp as HvFlowNodeClasses);\n const [showParams, setShowParams] = useState(expanded);\n const { node } = useFlowNode(id);\n\n const { nodeGroups, nodeTypes, defaultActions } = useFlowContext();\n const groupId = nodeTypes?.[type].meta?.groupId;\n const subtitle = nodeTypes?.[type].meta?.label || nodeDefaults?.subTitle;\n const groupLabel =\n (groupId && nodeGroups && nodeGroups[groupId].label) || nodeDefaults?.title;\n\n const inputs = nodeTypes?.[type]?.meta?.inputs;\n const outputs = nodeTypes?.[type]?.meta?.outputs;\n const icon =\n (groupId && nodeGroups && nodeGroups[groupId].icon) || nodeDefaults?.icon;\n const colorProp =\n (groupId && nodeGroups && nodeGroups[groupId].color) || nodeDefaults?.color;\n const color = getColor(colorProp);\n\n const actsVisible = actions?.slice(0, maxVisibleActions);\n const actsDropdown = actions?.slice(maxVisibleActions);\n\n const hasParams = !!(params && params.length > 0);\n\n return (\n <HvFlowBaseNode\n id={id}\n type={type}\n title={groupLabel}\n icon={icon}\n color={color}\n inputs={inputs}\n outputs={outputs}\n nodeActions={defaultActions}\n classes={classesProp as HvFlowBaseNodeProps<unknown>[\"classes\"]}\n headerItems={\n <>\n {headerItems}\n {description && (\n <HvTooltip title={<HvTypography>{description}</HvTypography>}>\n <div>\n <Info color=\"base_dark\" />\n </div>\n </HvTooltip>\n )}\n {hasParams && (\n <HvButton\n icon\n overrideIconColors={false}\n onClick={() => setShowParams((p) => !p)}\n >\n {showParams ? (\n <Up color=\"base_dark\" />\n ) : (\n <Down color=\"base_dark\" />\n )}\n </HvButton>\n )}\n </>\n }\n {...props}\n >\n {(subtitle || actsVisible?.length || actsDropdown?.length) && (\n <div className={classes.subtitleContainer}>\n {subtitle && (\n <div>\n <HvTypography>{subtitle}</HvTypography>\n </div>\n )}\n <div className={classes.actions}>\n {actions?.length && actions?.length > 0 && (\n <>\n {actsVisible?.map((action) => (\n <HvTooltip\n key={action.id}\n title={<HvTypography>{action.label}</HvTypography>}\n >\n <div>\n <HvButton\n icon\n onClick={(event: SyntheticEvent<Element, Event>) => {\n actionCallback?.(event, id, action);\n }}\n aria-label={action.label}\n >\n {renderedIcon(action.icon)}\n </HvButton>\n </div>\n </HvTooltip>\n ))}\n\n {actsDropdown && actsDropdown.length > 0 && (\n <HvDropDownMenu\n keepOpened={false}\n dataList={actsDropdown?.map((action) => ({\n id: action.id,\n label: action.label,\n }))}\n onClick={(event, action) => {\n actionCallback?.(event, id, action as HvActionGeneric);\n }}\n />\n )}\n </>\n )}\n </div>\n </div>\n )}\n {children}\n {showParams && params && (\n <div className={classes.paramsContainer}>\n <ParamRenderer nodeId={id} params={params} data={node?.data} />\n </div>\n )}\n </HvFlowBaseNode>\n );\n};\n"],"names":["renderedIcon","actionIcon","isValidElement","HvFlowNode","id","type","headerItems","description","actions","actionCallback","maxVisibleActions","expanded","params","nodeDefaults","classes","classesProp","children","props","useClasses","showParams","setShowParams","useState","node","useFlowNode","nodeGroups","nodeTypes","defaultActions","useFlowContext","groupId","meta","subtitle","label","subTitle","groupLabel","title","inputs","outputs","icon","colorProp","color","getColor","actsVisible","slice","actsDropdown","hasParams","length","p","subtitleContainer","map","action","event","paramsContainer","data"],"mappings":";;;;;;;;;;;AAmDA,MAAMA,eAAeA,CAACC,eACpBC,eAAeD,UAAU,IAAIA,aAAcA;AAEtC,MAAME,aAAaA,CAAC;AAAA,EACzBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC,oBAAoB;AAAA,EACpBC,WAAW;AAAA,EACXC;AAAAA,EACAC;AAAAA,EACAC,SAASC;AAAAA,EACTC;AAAAA,EACA,GAAGC;AACqB,MAAM;AACxB,QAAA;AAAA,IAAEH;AAAAA,EAAAA,IAAYI,WAAWH,WAAiC;AAChE,QAAM,CAACI,YAAYC,aAAa,IAAIC,SAASV,QAAQ;AAC/C,QAAA;AAAA,IAAEW;AAAAA,EAAAA,IAASC,YAAYnB,EAAE;AAEzB,QAAA;AAAA,IAAEoB;AAAAA,IAAYC;AAAAA,IAAWC;AAAAA,MAAmBC,eAAe;AACjE,QAAMC,UAAUH,YAAYpB,IAAI,EAAEwB,MAAMD;AACxC,QAAME,WAAWL,YAAYpB,IAAI,EAAEwB,MAAME,SAASlB,cAAcmB;AAChE,QAAMC,aACHL,WAAWJ,cAAcA,WAAWI,OAAO,EAAEG,SAAUlB,cAAcqB;AAExE,QAAMC,SAASV,YAAYpB,IAAI,GAAGwB,MAAMM;AACxC,QAAMC,UAAUX,YAAYpB,IAAI,GAAGwB,MAAMO;AACzC,QAAMC,OACHT,WAAWJ,cAAcA,WAAWI,OAAO,EAAES,QAASxB,cAAcwB;AACvE,QAAMC,YACHV,WAAWJ,cAAcA,WAAWI,OAAO,EAAEW,SAAU1B,cAAc0B;AAClEA,QAAAA,QAAQC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AA0C;AACjCA,2BAAAA,OAAO9C,IAAI6C,MAAM;AAAA,QAEpC,GAAA,cAAYA,OAAOlB,OAElB/B,UAAaiD,aAAAA,OAAOZ,IAAI,EAC3B,CAAA,EACF,CAAA,EAAA,GAbKY,OAAO7C,EAcd,CACD;AAAA,QAEAuC,gBAAgBA,aAAaE,SAAS,KACrC,oBAAC,gBACC,EAAA,YAAY,OACZ,UAAUF,cAAcK,IAAKC,CAAY,YAAA;AAAA,UACvC7C,IAAI6C,OAAO7C;AAAAA,UACX2B,OAAOkB,OAAOlB;AAAAA,QACd,EAAA,GACF,SAAS,CAACmB,OAAOD,WAAW;AACTC,2BAAAA,OAAO9C,IAAI6C,MAA0B;AAAA,QAAA,GAG3D;AAAA,MAAA,EAAA,CACH,EAEJ,CAAA;AAAA,IAAA,GACF;AAAA,IAEDjC;AAAAA,IACAG,cAAcP,UACZ,oBAAA,OAAA,EAAI,WAAWE,QAAQqC,iBACtB,UAAC,oBAAA,eAAA,EAAc,QAAQ/C,IAAI,QAAgB,MAAMkB,MAAM8B,KAAK,CAAA,GAC9D;AAAA,EAEJ,EAAA,CAAA;AAEJ;"}
@@ -7,29 +7,47 @@ const Select = ({
7
7
  param,
8
8
  data
9
9
  }) => {
10
+ const {
11
+ id,
12
+ label,
13
+ multiple = false,
14
+ options
15
+ } = param;
10
16
  const reactFlowInstance = useReactFlow();
11
- const [option, setOption] = useState(data[param.id]);
17
+ const [opts, setOpts] = useState(data[id] ? Array.isArray(data[id]) ? data[id] : [data[id]] : void 0);
12
18
  const onSelectChange = (item) => {
13
19
  const nodes = reactFlowInstance.getNodes();
20
+ const newOpts = Array.isArray(item) ? item.map((x) => x.label) : item?.label ? [item.label] : void 0;
14
21
  const newNodes = nodes.map((node) => {
15
22
  if (node.id === nodeId) {
16
23
  node.data = {
17
24
  ...node.data,
18
- [param.id]: item.label
25
+ [id]: newOpts
19
26
  };
20
27
  }
21
28
  return node;
22
29
  });
23
30
  reactFlowInstance.setNodes(newNodes);
24
- setOption(item.label);
31
+ setOpts(newOpts);
25
32
  };
26
- return /* @__PURE__ */ jsx(HvDropdown, { disablePortal: true, label: param.label, values: param.options?.map((o) => {
27
- return {
28
- id: o,
29
- label: o,
30
- selected: o === option
31
- };
32
- }), onChange: (item) => onSelectChange(item) });
33
+ return /* @__PURE__ */ jsx(
34
+ HvDropdown,
35
+ {
36
+ className: "nodrag",
37
+ disablePortal: true,
38
+ label,
39
+ values: options?.map((o) => {
40
+ return {
41
+ id: o,
42
+ label: o,
43
+ selected: !!opts?.find((opt) => opt === o)
44
+ };
45
+ }),
46
+ onChange: onSelectChange,
47
+ maxHeight: 100,
48
+ multiSelect: multiple
49
+ }
50
+ );
33
51
  };
34
52
  const Select$1 = Select;
35
53
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Select.js","sources":["../../../../../../src/components/Flow/Node/Parameters/Select.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { HvDropdown } from \"@hitachivantara/uikit-react-core\";\nimport { useReactFlow } from \"reactflow\";\n\nconst Select = ({ nodeId, param, data }) => {\n const reactFlowInstance = useReactFlow();\n const [option, setOption] = useState(data[param.id]);\n\n const onSelectChange = (item) => {\n const nodes = reactFlowInstance.getNodes();\n const newNodes = nodes.map((node) => {\n if (node.id === nodeId) {\n node.data = { ...node.data, [param.id]: item.label };\n }\n return node;\n });\n reactFlowInstance.setNodes(newNodes);\n setOption(item.label);\n };\n\n return (\n <HvDropdown\n disablePortal\n label={param.label}\n values={param.options?.map((o) => {\n return { id: o, label: o, selected: o === option };\n })}\n onChange={(item) => onSelectChange(item)}\n />\n );\n};\n\nexport default Select;\n"],"names":["Select","nodeId","param","data","reactFlowInstance","useReactFlow","option","setOption","useState","id","onSelectChange","item","nodes","getNodes","newNodes","map","node","label","setNodes","options","o","selected"],"mappings":";;;;AAIA,MAAMA,SAASA,CAAC;AAAA,EAAEC;AAAAA,EAAQC;AAAAA,EAAOC;AAAK,MAAM;AAC1C,QAAMC,oBAAoBC;AACpB,QAAA,CAACC,QAAQC,SAAS,IAAIC,SAASL,KAAKD,MAAMO,EAAE,CAAC;AAEnD,QAAMC,iBAAkBC,CAAS,SAAA;AACzBC,UAAAA,QAAQR,kBAAkBS;AAC1BC,UAAAA,WAAWF,MAAMG,IAAKC,CAAS,SAAA;AAC/BA,UAAAA,KAAKP,OAAOR,QAAQ;AACtBe,aAAKb,OAAO;AAAA,UAAE,GAAGa,KAAKb;AAAAA,UAAM,CAACD,MAAMO,EAAE,GAAGE,KAAKM;AAAAA,QAAAA;AAAAA,MAC/C;AACOD,aAAAA;AAAAA,IAAAA,CACR;AACDZ,sBAAkBc,SAASJ,QAAQ;AACnCP,cAAUI,KAAKM,KAAK;AAAA,EAAA;AAIpB,SAAA,oBAAC,YACC,EAAA,eAAa,MACb,OAAOf,MAAMe,OACb,QAAQf,MAAMiB,SAASJ,IAAKK,CAAM,MAAA;AACzB,WAAA;AAAA,MAAEX,IAAIW;AAAAA,MAAGH,OAAOG;AAAAA,MAAGC,UAAUD,MAAMd;AAAAA,IAAAA;AAAAA,EAAO,CAClD,GACD,UAAWK,CAASD,SAAAA,eAAeC,IAAI,EACvC,CAAA;AAEN;AAEA,MAAA,WAAeX;"}
1
+ {"version":3,"file":"Select.js","sources":["../../../../../../src/components/Flow/Node/Parameters/Select.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { HvDropdown, HvDropdownProps } from \"@hitachivantara/uikit-react-core\";\nimport { useReactFlow } from \"reactflow\";\n\nimport { HvFlowNodeSelectParam } from \"../../types\";\n\ninterface SelectProps {\n nodeId: string;\n param: Omit<HvFlowNodeSelectParam, \"type\">;\n data: any;\n}\n\nconst Select = ({ nodeId, param, data }: SelectProps) => {\n const { id, label, multiple = false, options } = param;\n\n const reactFlowInstance = useReactFlow();\n\n const [opts, setOpts] = useState<string[] | undefined>(\n data[id] ? (Array.isArray(data[id]) ? data[id] : [data[id]]) : undefined\n );\n\n const onSelectChange: HvDropdownProps[\"onChange\"] = (item) => {\n const nodes = reactFlowInstance.getNodes();\n\n const newOpts = Array.isArray(item)\n ? item.map((x) => x.label as string)\n : item?.label\n ? [item.label as string]\n : undefined;\n\n const newNodes = nodes.map((node) => {\n if (node.id === nodeId) {\n node.data = {\n ...node.data,\n [id]: newOpts,\n };\n }\n return node;\n });\n\n reactFlowInstance.setNodes(newNodes);\n setOpts(newOpts);\n };\n\n return (\n <HvDropdown\n className=\"nodrag\" // Prevents dragging within the select field\n disablePortal\n label={label}\n values={options?.map((o) => {\n return { id: o, label: o, selected: !!opts?.find((opt) => opt === o) };\n })}\n onChange={onSelectChange}\n maxHeight={100}\n multiSelect={multiple}\n />\n );\n};\n\nexport default Select;\n"],"names":["Select","nodeId","param","data","id","label","multiple","options","reactFlowInstance","useReactFlow","opts","setOpts","useState","Array","isArray","undefined","onSelectChange","item","nodes","getNodes","newOpts","map","x","newNodes","node","setNodes","o","selected","find","opt"],"mappings":";;;;AAYA,MAAMA,SAASA,CAAC;AAAA,EAAEC;AAAAA,EAAQC;AAAAA,EAAOC;AAAkB,MAAM;AACjD,QAAA;AAAA,IAAEC;AAAAA,IAAIC;AAAAA,IAAOC,WAAW;AAAA,IAAOC;AAAAA,EAAYL,IAAAA;AAEjD,QAAMM,oBAAoBC;AAEpB,QAAA,CAACC,MAAMC,OAAO,IAAIC,SACtBT,KAAKC,EAAE,IAAKS,MAAMC,QAAQX,KAAKC,EAAE,CAAC,IAAID,KAAKC,EAAE,IAAI,CAACD,KAAKC,EAAE,CAAC,IAAKW,MACjE;AAEA,QAAMC,iBAA+CC,CAAS,SAAA;AACtDC,UAAAA,QAAQV,kBAAkBW;AAEhC,UAAMC,UAAUP,MAAMC,QAAQG,IAAI,IAC9BA,KAAKI,IAAKC,CAAAA,MAAMA,EAAEjB,KAAe,IACjCY,MAAMZ,QACN,CAACY,KAAKZ,KAAe,IACrBU;AAEEQ,UAAAA,WAAWL,MAAMG,IAAKG,CAAS,SAAA;AAC/BA,UAAAA,KAAKpB,OAAOH,QAAQ;AACtBuB,aAAKrB,OAAO;AAAA,UACV,GAAGqB,KAAKrB;AAAAA,UACR,CAACC,EAAE,GAAGgB;AAAAA,QAAAA;AAAAA,MAEV;AACOI,aAAAA;AAAAA,IAAAA,CACR;AAEDhB,sBAAkBiB,SAASF,QAAQ;AACnCZ,YAAQS,OAAO;AAAA,EAAA;AAIf,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,eAAa;AAAA,MACb;AAAA,MACA,QAAQb,SAASc,IAAKK,CAAM,MAAA;AACnB,eAAA;AAAA,UAAEtB,IAAIsB;AAAAA,UAAGrB,OAAOqB;AAAAA,UAAGC,UAAU,CAAC,CAACjB,MAAMkB,KAAMC,CAAAA,QAAQA,QAAQH,CAAC;AAAA,QAAA;AAAA,MAAE,CACtE;AAAA,MACD,UAAUV;AAAAA,MACV,WAAW;AAAA,MACX,aAAaV;AAAAA,IAAAA;AAAAA,EAAAA;AAGnB;AAEA,MAAA,WAAeN;"}
@@ -7,15 +7,19 @@ const Text = ({
7
7
  param,
8
8
  data
9
9
  }) => {
10
+ const {
11
+ id,
12
+ label
13
+ } = param;
10
14
  const reactFlowInstance = useReactFlow();
11
- const [text, setText] = useState(data[param.id]);
12
- const onTextChange = (val) => {
15
+ const [text, setText] = useState(data[id]);
16
+ const onTextChange = (event, val) => {
13
17
  const nodes = reactFlowInstance.getNodes();
14
18
  const newNodes = nodes.map((node) => {
15
19
  if (node.id === nodeId) {
16
20
  node.data = {
17
21
  ...node.data,
18
- [param.id]: val
22
+ [id]: val
19
23
  };
20
24
  }
21
25
  return node;
@@ -23,7 +27,15 @@ const Text = ({
23
27
  reactFlowInstance.setNodes(newNodes);
24
28
  setText(val);
25
29
  };
26
- return /* @__PURE__ */ jsx(HvInput, { label: param.label, value: text, onChange: (evt, val) => onTextChange(val) });
30
+ return /* @__PURE__ */ jsx(
31
+ HvInput,
32
+ {
33
+ className: "nodrag",
34
+ label,
35
+ value: text,
36
+ onChange: onTextChange
37
+ }
38
+ );
27
39
  };
28
40
  const Text$1 = Text;
29
41
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sources":["../../../../../../src/components/Flow/Node/Parameters/Text.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { HvInput } from \"@hitachivantara/uikit-react-core\";\nimport { useReactFlow } from \"reactflow\";\n\nconst Text = ({ nodeId, param, data }) => {\n const reactFlowInstance = useReactFlow();\n const [text, setText] = useState(data[param.id]);\n\n const onTextChange = (val) => {\n const nodes = reactFlowInstance.getNodes();\n const newNodes = nodes.map((node) => {\n if (node.id === nodeId) {\n node.data = { ...node.data, [param.id]: val };\n }\n return node;\n });\n reactFlowInstance.setNodes(newNodes);\n setText(val);\n };\n\n return (\n <HvInput\n label={param.label}\n value={text}\n onChange={(evt, val) => onTextChange(val)}\n />\n );\n};\n\nexport default Text;\n"],"names":["Text","nodeId","param","data","reactFlowInstance","useReactFlow","text","setText","useState","id","onTextChange","val","nodes","getNodes","newNodes","map","node","setNodes","label","evt"],"mappings":";;;;AAIA,MAAMA,OAAOA,CAAC;AAAA,EAAEC;AAAAA,EAAQC;AAAAA,EAAOC;AAAK,MAAM;AACxC,QAAMC,oBAAoBC;AACpB,QAAA,CAACC,MAAMC,OAAO,IAAIC,SAASL,KAAKD,MAAMO,EAAE,CAAC;AAE/C,QAAMC,eAAgBC,CAAQ,QAAA;AACtBC,UAAAA,QAAQR,kBAAkBS;AAC1BC,UAAAA,WAAWF,MAAMG,IAAKC,CAAS,SAAA;AAC/BA,UAAAA,KAAKP,OAAOR,QAAQ;AACtBe,aAAKb,OAAO;AAAA,UAAE,GAAGa,KAAKb;AAAAA,UAAM,CAACD,MAAMO,EAAE,GAAGE;AAAAA,QAAAA;AAAAA,MAC1C;AACOK,aAAAA;AAAAA,IAAAA,CACR;AACDZ,sBAAkBa,SAASH,QAAQ;AACnCP,YAAQI,GAAG;AAAA,EAAA;AAGb,SACG,oBAAA,SAAA,EACC,OAAOT,MAAMgB,OACb,OAAOZ,MACP,UAAU,CAACa,KAAKR,QAAQD,aAAaC,GAAG,EACxC,CAAA;AAEN;AAEA,MAAA,SAAeX;"}
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../src/components/Flow/Node/Parameters/Text.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { HvInput, HvInputProps } from \"@hitachivantara/uikit-react-core\";\nimport { useReactFlow } from \"reactflow\";\n\nimport { HvFlowNodeTextParam } from \"../../types\";\n\ninterface TextProps {\n nodeId: string;\n param: Omit<HvFlowNodeTextParam, \"type\">;\n data: any;\n}\n\nconst Text = ({ nodeId, param, data }: TextProps) => {\n const { id, label } = param;\n\n const reactFlowInstance = useReactFlow();\n\n const [text, setText] = useState(data[id]);\n\n const onTextChange: HvInputProps[\"onChange\"] = (event, val) => {\n const nodes = reactFlowInstance.getNodes();\n\n const newNodes = nodes.map((node) => {\n if (node.id === nodeId) {\n node.data = { ...node.data, [id]: val };\n }\n return node;\n });\n\n reactFlowInstance.setNodes(newNodes);\n setText(val);\n };\n\n return (\n <HvInput\n className=\"nodrag\" // Prevents dragging within the input field\n label={label}\n value={text}\n onChange={onTextChange}\n />\n );\n};\n\nexport default Text;\n"],"names":["Text","nodeId","param","data","id","label","reactFlowInstance","useReactFlow","text","setText","useState","onTextChange","event","val","nodes","getNodes","newNodes","map","node","setNodes"],"mappings":";;;;AAYA,MAAMA,OAAOA,CAAC;AAAA,EAAEC;AAAAA,EAAQC;AAAAA,EAAOC;AAAgB,MAAM;AAC7C,QAAA;AAAA,IAAEC;AAAAA,IAAIC;AAAAA,EAAUH,IAAAA;AAEtB,QAAMI,oBAAoBC;AAE1B,QAAM,CAACC,MAAMC,OAAO,IAAIC,SAASP,KAAKC,EAAE,CAAC;AAEnCO,QAAAA,eAAyCA,CAACC,OAAOC,QAAQ;AACvDC,UAAAA,QAAQR,kBAAkBS;AAE1BC,UAAAA,WAAWF,MAAMG,IAAKC,CAAS,SAAA;AAC/BA,UAAAA,KAAKd,OAAOH,QAAQ;AACtBiB,aAAKf,OAAO;AAAA,UAAE,GAAGe,KAAKf;AAAAA,UAAM,CAACC,EAAE,GAAGS;AAAAA,QAAAA;AAAAA,MACpC;AACOK,aAAAA;AAAAA,IAAAA,CACR;AAEDZ,sBAAkBa,SAASH,QAAQ;AACnCP,YAAQI,GAAG;AAAA,EAAA;AAIX,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV;AAAA,MACA,OAAOL;AAAAA,MACP,UAAUG;AAAAA,IAAAA;AAAAA,EAAAA;AAGhB;AAEA,MAAA,SAAeX;"}
@@ -1,7 +1,7 @@
1
- import { useStore } from "reactflow";
2
- const useFlowNode = (id) => {
3
- const nodes = useStore((state) => state.getNodes());
4
- const edges = useStore((state) => state.edges);
1
+ import { useNodes, useEdges } from "reactflow";
2
+ function useFlowNode(id) {
3
+ const nodes = useNodes();
4
+ const edges = useEdges();
5
5
  return {
6
6
  // self node
7
7
  get node() {
@@ -18,7 +18,7 @@ const useFlowNode = (id) => {
18
18
  return parentNodeArray;
19
19
  }
20
20
  };
21
- };
21
+ }
22
22
  export {
23
23
  useFlowNode
24
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useFlowNode.js","sources":["../../../../../src/components/Flow/hooks/useFlowNode.ts"],"sourcesContent":["import { Edge, Node, useStore } from \"reactflow\";\n\nexport const useFlowNode = (id: string) => {\n const nodes = useStore((state) => state.getNodes());\n const edges = useStore((state) => state.edges);\n\n return {\n // self node\n get node() {\n const self = nodes.find((n: Node) => n.id === id);\n return self;\n },\n\n // parent nodes\n get parentNodes() {\n const connectedEdges = edges.filter((e: Edge) => e.target === id);\n const parentNodeArray = connectedEdges.map((e) => {\n const parentNode = nodes.find((n: Node) => n.id === e.source) as Node;\n return parentNode;\n });\n return parentNodeArray;\n },\n };\n};\n"],"names":["useFlowNode","id","nodes","useStore","state","getNodes","edges","node","self","find","n","parentNodes","connectedEdges","filter","e","target","parentNodeArray","map","parentNode","source"],"mappings":";AAEaA,MAAAA,cAAcA,CAACC,OAAe;AACzC,QAAMC,QAAQC,SAAUC,CAAUA,UAAAA,MAAMC,UAAU;AAClD,QAAMC,QAAQH,SAAUC,CAAUA,UAAAA,MAAME,KAAK;AAEtC,SAAA;AAAA;AAAA,IAEL,IAAIC,OAAO;AACT,YAAMC,OAAON,MAAMO,KAAK,CAACC,MAAYA,EAAET,OAAOA,EAAE;AACzCO,aAAAA;AAAAA,IACT;AAAA;AAAA,IAGA,IAAIG,cAAc;AAChB,YAAMC,iBAAiBN,MAAMO,OAAO,CAACC,MAAYA,EAAEC,WAAWd,EAAE;AAC1De,YAAAA,kBAAkBJ,eAAeK,IAAKH,CAAM,MAAA;AAC1CI,cAAAA,aAAahB,MAAMO,KAAK,CAACC,MAAYA,EAAET,OAAOa,EAAEK,MAAM;AACrDD,eAAAA;AAAAA,MAAAA,CACR;AACMF,aAAAA;AAAAA,IACT;AAAA,EAAA;AAEJ;"}
1
+ {"version":3,"file":"useFlowNode.js","sources":["../../../../../src/components/Flow/hooks/useFlowNode.ts"],"sourcesContent":["import { Edge, Node, useEdges, useNodes } from \"reactflow\";\n\nexport function useFlowNode<T = any>(id: string) {\n const nodes = useNodes<T>();\n const edges = useEdges();\n\n return {\n // self node\n get node() {\n const self = nodes.find((n: Node) => n.id === id);\n return self;\n },\n\n // parent nodes\n get parentNodes() {\n const connectedEdges = edges.filter((e: Edge) => e.target === id);\n const parentNodeArray = connectedEdges.map((e) => {\n const parentNode = nodes.find((n: Node) => n.id === e.source) as Node;\n return parentNode;\n });\n return parentNodeArray;\n },\n };\n}\n"],"names":["useFlowNode","id","nodes","useNodes","edges","useEdges","node","self","find","n","parentNodes","connectedEdges","filter","e","target","parentNodeArray","map","parentNode","source"],"mappings":";AAEO,SAASA,YAAqBC,IAAY;AAC/C,QAAMC,QAAQC;AACd,QAAMC,QAAQC;AAEP,SAAA;AAAA;AAAA,IAEL,IAAIC,OAAO;AACT,YAAMC,OAAOL,MAAMM,KAAK,CAACC,MAAYA,EAAER,OAAOA,EAAE;AACzCM,aAAAA;AAAAA,IACT;AAAA;AAAA,IAGA,IAAIG,cAAc;AAChB,YAAMC,iBAAiBP,MAAMQ,OAAO,CAACC,MAAYA,EAAEC,WAAWb,EAAE;AAC1Dc,YAAAA,kBAAkBJ,eAAeK,IAAKH,CAAM,MAAA;AAC1CI,cAAAA,aAAaf,MAAMM,KAAK,CAACC,MAAYA,EAAER,OAAOY,EAAEK,MAAM;AACrDD,eAAAA;AAAAA,MAAAA,CACR;AACMF,aAAAA;AAAAA,IACT;AAAA,EAAA;AAEJ;"}
@@ -1,7 +1,7 @@
1
1
  import { BackgroundProps } from 'reactflow';
2
2
  import { ComponentClass } from 'react';
3
3
  import { ControlProps } from 'reactflow';
4
- import type { CSSInterpolation } from '@emotion/serialize';
4
+ import { CSSInterpolation } from '@emotion/serialize';
5
5
  import { Dispatch } from 'react';
6
6
  import { DndContextProps } from '@dnd-kit/core';
7
7
  import { DragEndEvent } from '@dnd-kit/core';
@@ -20,7 +20,7 @@ import { HvColorAny } from '@hitachivantara/uikit-styles';
20
20
  import { HvDialogProps } from '@hitachivantara/uikit-react-core';
21
21
  import { HvDrawerProps } from '@hitachivantara/uikit-react-core';
22
22
  import { HvEmptyStateProps } from '@hitachivantara/uikit-react-core';
23
- import type { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
23
+ import { JSX as JSX_2 } from '@emotion/react/jsx-runtime';
24
24
  import { MiniMapProps } from 'reactflow';
25
25
  import { ModalProps } from '@mui/material';
26
26
  import { Node as Node_2 } from 'reactflow';
@@ -31,17 +31,17 @@ import { ReactFlowProps } from 'reactflow';
31
31
  import { SetStateAction } from 'react';
32
32
 
33
33
  export declare const flowBaseNodeClasses: {
34
- title: "HvFlowBaseNode-title";
35
34
  root: "HvFlowBaseNode-root";
36
- mandatory: "HvFlowBaseNode-mandatory";
35
+ title: "HvFlowBaseNode-title";
37
36
  titleContainer: "HvFlowBaseNode-titleContainer";
37
+ mandatory: "HvFlowBaseNode-mandatory";
38
+ inputContainer: "HvFlowBaseNode-inputContainer";
39
+ contentContainer: "HvFlowBaseNode-contentContainer";
38
40
  headerContainer: "HvFlowBaseNode-headerContainer";
39
41
  inputsTitleContainer: "HvFlowBaseNode-inputsTitleContainer";
40
42
  outputsTitleContainer: "HvFlowBaseNode-outputsTitleContainer";
41
- contentContainer: "HvFlowBaseNode-contentContainer";
42
43
  inputsContainer: "HvFlowBaseNode-inputsContainer";
43
44
  outputsContainer: "HvFlowBaseNode-outputsContainer";
44
- inputContainer: "HvFlowBaseNode-inputContainer";
45
45
  outputContainer: "HvFlowBaseNode-outputContainer";
46
46
  };
47
47
 
@@ -261,13 +261,7 @@ export declare type HvFlowNodeOutput = {
261
261
  maxConnections?: number;
262
262
  };
263
263
 
264
- export declare type HvFlowNodeParam = {
265
- id: string;
266
- type: "text" | "select";
267
- label: string;
268
- options?: string[];
269
- value?: string;
270
- };
264
+ export declare type HvFlowNodeParam = HvFlowNodeSelectParam | HvFlowNodeTextParam;
271
265
 
272
266
  export declare interface HvFlowNodeProps<T = any> extends Omit<HvFlowBaseNodeProps<T>, "classes"> {
273
267
  /** Node description */
@@ -288,6 +282,21 @@ export declare interface HvFlowNodeProps<T = any> extends Omit<HvFlowBaseNodePro
288
282
  classes?: HvFlowNodeClasses | HvFlowBaseNodeProps<T>["classes"];
289
283
  }
290
284
 
285
+ export declare interface HvFlowNodeSelectParam extends HvFlowNodeSharedParam {
286
+ type: "select";
287
+ multiple?: boolean;
288
+ options?: string[];
289
+ }
290
+
291
+ export declare interface HvFlowNodeSharedParam {
292
+ id: string;
293
+ label: string;
294
+ }
295
+
296
+ export declare interface HvFlowNodeTextParam extends HvFlowNodeSharedParam {
297
+ type: "text";
298
+ }
299
+
291
300
  export declare type HvFlowNodeTypeMeta<GroupId extends keyof any = string, NodeData = any> = {
292
301
  label: string;
293
302
  groupId?: GroupId;
@@ -547,19 +556,19 @@ export declare interface HvWizardTitleProps extends HvBaseProps {
547
556
  }
548
557
 
549
558
  export declare const stepNavigationClasses: {
550
- li: "HvStepNavigation-li";
551
- ol: "HvStepNavigation-ol";
552
559
  root: "HvStepNavigation-root";
553
560
  separator: "HvStepNavigation-separator";
561
+ li: "HvStepNavigation-li";
562
+ ol: "HvStepNavigation-ol";
554
563
  titles: "HvStepNavigation-titles";
555
564
  };
556
565
 
557
- declare const useClasses: (classesProp?: Partial<Record<"li" | "ol" | "root" | "separator" | "titles", string>>, addStatic?: boolean) => {
566
+ declare const useClasses: (classesProp?: Partial<Record<"root" | "separator" | "li" | "ol" | "titles", string>>, addStatic?: boolean) => {
558
567
  classes: {
559
- li: string;
560
- ol: string;
561
568
  root: string;
562
569
  separator: string;
570
+ li: string;
571
+ ol: string;
563
572
  titles: string;
564
573
  };
565
574
  css: {
@@ -586,19 +595,19 @@ declare const useClasses_10: (classesProp?: Partial<Record<"description" | "titl
586
595
  cx: (...args: any) => string;
587
596
  };
588
597
 
589
- declare const useClasses_11: (classesProp?: Partial<Record<"title" | "root" | "mandatory" | "titleContainer" | "headerContainer" | "inputsTitleContainer" | "outputsTitleContainer" | "contentContainer" | "inputsContainer" | "outputsContainer" | "inputContainer" | "outputContainer", string>>, addStatic?: boolean) => {
598
+ declare const useClasses_11: (classesProp?: Partial<Record<"root" | "title" | "titleContainer" | "mandatory" | "inputContainer" | "contentContainer" | "headerContainer" | "inputsTitleContainer" | "outputsTitleContainer" | "inputsContainer" | "outputsContainer" | "outputContainer", string>>, addStatic?: boolean) => {
590
599
  classes: {
591
- title: string;
592
600
  root: string;
593
- mandatory: string;
601
+ title: string;
594
602
  titleContainer: string;
603
+ mandatory: string;
604
+ inputContainer: string;
605
+ contentContainer: string;
595
606
  headerContainer: string;
596
607
  inputsTitleContainer: string;
597
608
  outputsTitleContainer: string;
598
- contentContainer: string;
599
609
  inputsContainer: string;
600
610
  outputsContainer: string;
601
- inputContainer: string;
602
611
  outputContainer: string;
603
612
  };
604
613
  css: {
@@ -621,16 +630,16 @@ declare const useClasses_12: (classesProp?: Partial<Record<"actions" | "subtitle
621
630
  cx: (...args: any) => string;
622
631
  };
623
632
 
624
- declare const useClasses_2: (classesProp?: Partial<Record<"xl" | "lg" | "md" | "sm" | "xs" | "root" | "ghost" | "avatar" | "ghostDisabled" | "notCurrent", string>>, addStatic?: boolean) => {
633
+ declare const useClasses_2: (classesProp?: Partial<Record<"xs" | "sm" | "md" | "lg" | "xl" | "root" | "avatar" | "ghost" | "ghostDisabled" | "notCurrent", string>>, addStatic?: boolean) => {
625
634
  classes: {
626
- xl: string;
627
- lg: string;
628
- md: string;
629
- sm: string;
630
635
  xs: string;
636
+ sm: string;
637
+ md: string;
638
+ lg: string;
639
+ xl: string;
631
640
  root: string;
632
- ghost: string;
633
641
  avatar: string;
642
+ ghost: string;
634
643
  ghostDisabled: string;
635
644
  notCurrent: string;
636
645
  };
@@ -652,10 +661,10 @@ declare const useClasses_3: (classesProp?: Partial<Record<"root", string>>, addS
652
661
  cx: (...args: any) => string;
653
662
  };
654
663
 
655
- declare const useClasses_4: (classesProp?: Partial<Record<"buttonWidth" | "actionsContainer" | "buttonsContainer" | "buttonSpacing", string>>, addStatic?: boolean) => {
664
+ declare const useClasses_4: (classesProp?: Partial<Record<"actionsContainer" | "buttonWidth" | "buttonsContainer" | "buttonSpacing", string>>, addStatic?: boolean) => {
656
665
  classes: {
657
- buttonWidth: string;
658
666
  actionsContainer: string;
667
+ buttonWidth: string;
659
668
  buttonsContainer: string;
660
669
  buttonSpacing: string;
661
670
  };
@@ -666,13 +675,13 @@ declare const useClasses_4: (classesProp?: Partial<Record<"buttonWidth" | "actio
666
675
  cx: (...args: any) => string;
667
676
  };
668
677
 
669
- declare const useClasses_5: (classesProp?: Partial<Record<"titleContainer" | "messageContainer" | "headerContainer" | "buttonWidth" | "rootSummaryButton" | "stepContainer", string>>, addStatic?: boolean) => {
678
+ declare const useClasses_5: (classesProp?: Partial<Record<"titleContainer" | "messageContainer" | "buttonWidth" | "rootSummaryButton" | "headerContainer" | "stepContainer", string>>, addStatic?: boolean) => {
670
679
  classes: {
671
680
  titleContainer: string;
672
681
  messageContainer: string;
673
- headerContainer: string;
674
682
  buttonWidth: string;
675
683
  rootSummaryButton: string;
684
+ headerContainer: string;
676
685
  stepContainer: string;
677
686
  };
678
687
  css: {
@@ -734,14 +743,14 @@ declare const useClasses_9: (classesProp?: Partial<Record<"root", string>>, addS
734
743
 
735
744
  export declare const useFlowContext: () => HvFlowContextValue<string>;
736
745
 
737
- export declare const useFlowNode: (id: string) => {
738
- readonly node: Node_2 | undefined;
739
- readonly parentNodes: Node_2[];
746
+ export declare function useFlowNode<T = any>(id: string): {
747
+ readonly node: Node_2<T, string | undefined> | undefined;
748
+ readonly parentNodes: Node_2<any, string | undefined>[];
740
749
  };
741
750
 
742
751
  export declare const wizardActionsClasses: {
743
- buttonWidth: "HvWizardActions-buttonWidth";
744
752
  actionsContainer: "HvWizardActions-actionsContainer";
753
+ buttonWidth: "HvWizardActions-buttonWidth";
745
754
  buttonsContainer: "HvWizardActions-buttonsContainer";
746
755
  buttonSpacing: "HvWizardActions-buttonSpacing";
747
756
  };
@@ -767,9 +776,9 @@ export declare const wizardContentClasses: {
767
776
  export declare const wizardTitleClasses: {
768
777
  titleContainer: "HvWizardTitle-titleContainer";
769
778
  messageContainer: "HvWizardTitle-messageContainer";
770
- headerContainer: "HvWizardTitle-headerContainer";
771
779
  buttonWidth: "HvWizardTitle-buttonWidth";
772
780
  rootSummaryButton: "HvWizardTitle-rootSummaryButton";
781
+ headerContainer: "HvWizardTitle-headerContainer";
773
782
  stepContainer: "HvWizardTitle-stepContainer";
774
783
  };
775
784