@hitachivantara/uikit-react-lab 5.5.5 → 5.7.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 (42) hide show
  1. package/dist/cjs/components/Flow/DroppableFlow.cjs +73 -1
  2. package/dist/cjs/components/Flow/DroppableFlow.cjs.map +1 -1
  3. package/dist/cjs/components/Flow/Flow.cjs +2 -1
  4. package/dist/cjs/components/Flow/Flow.cjs.map +1 -1
  5. package/dist/cjs/components/Flow/Flow.styles.cjs +40 -1
  6. package/dist/cjs/components/Flow/Flow.styles.cjs.map +1 -1
  7. package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs +3 -1
  8. package/dist/cjs/components/Flow/FlowContext/FlowContext.cjs.map +1 -1
  9. package/dist/cjs/components/Flow/Node/Node.cjs +153 -0
  10. package/dist/cjs/components/Flow/Node/Node.cjs.map +1 -0
  11. package/dist/cjs/components/Flow/Node/Node.styles.cjs +97 -0
  12. package/dist/cjs/components/Flow/Node/Node.styles.cjs.map +1 -0
  13. package/dist/cjs/components/Flow/Node/Parameters/ParamRenderer.cjs +28 -0
  14. package/dist/cjs/components/Flow/Node/Parameters/ParamRenderer.cjs.map +1 -0
  15. package/dist/cjs/components/Flow/Node/Parameters/Select.cjs +39 -0
  16. package/dist/cjs/components/Flow/Node/Parameters/Select.cjs.map +1 -0
  17. package/dist/cjs/components/Flow/Node/Parameters/Text.cjs +32 -0
  18. package/dist/cjs/components/Flow/Node/Parameters/Text.cjs.map +1 -0
  19. package/dist/cjs/index.cjs +4 -0
  20. package/dist/cjs/index.cjs.map +1 -1
  21. package/dist/esm/components/Flow/DroppableFlow.js +75 -3
  22. package/dist/esm/components/Flow/DroppableFlow.js.map +1 -1
  23. package/dist/esm/components/Flow/Flow.js +2 -1
  24. package/dist/esm/components/Flow/Flow.js.map +1 -1
  25. package/dist/esm/components/Flow/Flow.styles.js +41 -2
  26. package/dist/esm/components/Flow/Flow.styles.js.map +1 -1
  27. package/dist/esm/components/Flow/FlowContext/FlowContext.js +3 -1
  28. package/dist/esm/components/Flow/FlowContext/FlowContext.js.map +1 -1
  29. package/dist/esm/components/Flow/Node/Node.js +154 -0
  30. package/dist/esm/components/Flow/Node/Node.js.map +1 -0
  31. package/dist/esm/components/Flow/Node/Node.styles.js +97 -0
  32. package/dist/esm/components/Flow/Node/Node.styles.js.map +1 -0
  33. package/dist/esm/components/Flow/Node/Parameters/ParamRenderer.js +28 -0
  34. package/dist/esm/components/Flow/Node/Parameters/ParamRenderer.js.map +1 -0
  35. package/dist/esm/components/Flow/Node/Parameters/Select.js +39 -0
  36. package/dist/esm/components/Flow/Node/Parameters/Select.js.map +1 -0
  37. package/dist/esm/components/Flow/Node/Parameters/Text.js +32 -0
  38. package/dist/esm/components/Flow/Node/Parameters/Text.js.map +1 -0
  39. package/dist/esm/index.js +4 -0
  40. package/dist/esm/index.js.map +1 -1
  41. package/dist/types/index.d.ts +105 -20
  42. package/package.json +3 -3
@@ -0,0 +1,97 @@
1
+ import { createClasses, theme } from "@hitachivantara/uikit-react-core";
2
+ const {
3
+ staticClasses,
4
+ useClasses
5
+ } = createClasses("HvFlowNode", {
6
+ root: {
7
+ borderRadius: theme.radii.round,
8
+ backgroundColor: theme.colors.atmo1,
9
+ boxShadow: theme.colors.shadow,
10
+ minWidth: "250px"
11
+ },
12
+ headerContainer: {
13
+ padding: theme.spacing(0.5, 1),
14
+ display: "flex",
15
+ flexDirection: "row",
16
+ justifyContent: "space-between",
17
+ alignItems: "center"
18
+ },
19
+ groupContainer: {
20
+ display: "flex",
21
+ flexDirection: "row",
22
+ alignItems: "center"
23
+ },
24
+ group: {
25
+ color: theme.colors.base_dark
26
+ },
27
+ titleContainer: {
28
+ padding: theme.spacing(theme.space.xs, theme.space.xs, theme.space.xs, theme.space.sm),
29
+ display: "flex",
30
+ flexDirection: "row",
31
+ justifyContent: "space-between",
32
+ alignItems: "center"
33
+ },
34
+ actions: {
35
+ display: "flex",
36
+ alignItems: "center"
37
+ },
38
+ inputsTitleContainer: {
39
+ display: "flex",
40
+ justifyContent: "center",
41
+ padding: theme.space.xs,
42
+ backgroundColor: theme.colors.atmo2,
43
+ borderTop: `1px solid ${theme.colors.atmo4}`,
44
+ borderBottom: `1px solid ${theme.colors.atmo4}`
45
+ },
46
+ outputsTitleContainer: {
47
+ display: "flex",
48
+ justifyContent: "center",
49
+ padding: theme.space.xs,
50
+ backgroundColor: theme.colors.atmo2,
51
+ borderTop: `1px solid ${theme.colors.atmo4}`,
52
+ borderBottom: `1px solid ${theme.colors.atmo4}`
53
+ },
54
+ inputsContainer: {
55
+ display: "flex",
56
+ flexDirection: "column",
57
+ padding: theme.space.sm,
58
+ gap: theme.space.xs,
59
+ alignItems: "flex-start"
60
+ },
61
+ outputsContainer: {
62
+ display: "flex",
63
+ flexDirection: "column",
64
+ padding: theme.space.sm,
65
+ gap: theme.space.xs,
66
+ alignItems: "flex-end"
67
+ },
68
+ paramsContainer: {
69
+ borderTop: `1px solid ${theme.colors.atmo4}`,
70
+ display: "flex",
71
+ flexDirection: "column",
72
+ gap: theme.space.xs,
73
+ padding: theme.space.sm
74
+ },
75
+ inputContainer: {
76
+ display: "flex",
77
+ flexDirection: "row",
78
+ alignItems: "center"
79
+ },
80
+ outputContainer: {
81
+ display: "flex",
82
+ flexDirection: "row",
83
+ alignItems: "center"
84
+ },
85
+ mandatory: {
86
+ width: 10,
87
+ height: 10,
88
+ margin: theme.spacing(0, theme.space.xs),
89
+ borderRadius: theme.radii.circle,
90
+ backgroundColor: theme.colors.negative_20
91
+ }
92
+ });
93
+ export {
94
+ staticClasses,
95
+ useClasses
96
+ };
97
+ //# sourceMappingURL=Node.styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Node.styles.js","sources":["../../../../../src/components/Flow/Node/Node.styles.tsx"],"sourcesContent":["import { createClasses, theme } from \"@hitachivantara/uikit-react-core\";\n\nexport const { staticClasses, useClasses } = createClasses(\"HvFlowNode\", {\n root: {\n borderRadius: theme.radii.round,\n backgroundColor: theme.colors.atmo1,\n boxShadow: theme.colors.shadow,\n minWidth: \"250px\",\n },\n headerContainer: {\n padding: theme.spacing(0.5, 1),\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n groupContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n group: {\n color: theme.colors.base_dark,\n },\n titleContainer: {\n padding: theme.spacing(\n theme.space.xs,\n theme.space.xs,\n theme.space.xs,\n theme.space.sm\n ),\n display: \"flex\",\n flexDirection: \"row\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n },\n actions: {\n display: \"flex\",\n alignItems: \"center\",\n },\n inputsTitleContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n padding: theme.space.xs,\n backgroundColor: theme.colors.atmo2,\n borderTop: `1px solid ${theme.colors.atmo4}`,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n outputsTitleContainer: {\n display: \"flex\",\n justifyContent: \"center\",\n padding: theme.space.xs,\n backgroundColor: theme.colors.atmo2,\n borderTop: `1px solid ${theme.colors.atmo4}`,\n borderBottom: `1px solid ${theme.colors.atmo4}`,\n },\n inputsContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: theme.space.sm,\n gap: theme.space.xs,\n alignItems: \"flex-start\",\n },\n outputsContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n padding: theme.space.sm,\n gap: theme.space.xs,\n alignItems: \"flex-end\",\n },\n paramsContainer: {\n borderTop: `1px solid ${theme.colors.atmo4}`,\n display: \"flex\",\n flexDirection: \"column\",\n gap: theme.space.xs,\n padding: theme.space.sm,\n },\n inputContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n outputContainer: {\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n mandatory: {\n width: 10,\n height: 10,\n margin: theme.spacing(0, theme.space.xs),\n borderRadius: theme.radii.circle,\n backgroundColor: theme.colors.negative_20,\n },\n});\n"],"names":["staticClasses","useClasses","createClasses","root","borderRadius","theme","radii","round","backgroundColor","colors","atmo1","boxShadow","shadow","minWidth","headerContainer","padding","spacing","display","flexDirection","justifyContent","alignItems","groupContainer","group","color","base_dark","titleContainer","space","xs","sm","actions","inputsTitleContainer","atmo2","borderTop","atmo4","borderBottom","outputsTitleContainer","inputsContainer","gap","outputsContainer","paramsContainer","inputContainer","outputContainer","mandatory","width","height","margin","circle","negative_20"],"mappings":";AAEa,MAAA;AAAA,EAAEA;AAAAA,EAAeC;AAAW,IAAIC,cAAc,cAAc;AAAA,EACvEC,MAAM;AAAA,IACJC,cAAcC,MAAMC,MAAMC;AAAAA,IAC1BC,iBAAiBH,MAAMI,OAAOC;AAAAA,IAC9BC,WAAWN,MAAMI,OAAOG;AAAAA,IACxBC,UAAU;AAAA,EACZ;AAAA,EACAC,iBAAiB;AAAA,IACfC,SAASV,MAAMW,QAAQ,KAAK,CAAC;AAAA,IAC7BC,SAAS;AAAA,IACTC,eAAe;AAAA,IACfC,gBAAgB;AAAA,IAChBC,YAAY;AAAA,EACd;AAAA,EACAC,gBAAgB;AAAA,IACdJ,SAAS;AAAA,IACTC,eAAe;AAAA,IACfE,YAAY;AAAA,EACd;AAAA,EACAE,OAAO;AAAA,IACLC,OAAOlB,MAAMI,OAAOe;AAAAA,EACtB;AAAA,EACAC,gBAAgB;AAAA,IACdV,SAASV,MAAMW,QACbX,MAAMqB,MAAMC,IACZtB,MAAMqB,MAAMC,IACZtB,MAAMqB,MAAMC,IACZtB,MAAMqB,MAAME,EACd;AAAA,IACAX,SAAS;AAAA,IACTC,eAAe;AAAA,IACfC,gBAAgB;AAAA,IAChBC,YAAY;AAAA,EACd;AAAA,EACAS,SAAS;AAAA,IACPZ,SAAS;AAAA,IACTG,YAAY;AAAA,EACd;AAAA,EACAU,sBAAsB;AAAA,IACpBb,SAAS;AAAA,IACTE,gBAAgB;AAAA,IAChBJ,SAASV,MAAMqB,MAAMC;AAAAA,IACrBnB,iBAAiBH,MAAMI,OAAOsB;AAAAA,IAC9BC,WAAY,aAAY3B,MAAMI,OAAOwB,KAAM;AAAA,IAC3CC,cAAe,aAAY7B,MAAMI,OAAOwB,KAAM;AAAA,EAChD;AAAA,EACAE,uBAAuB;AAAA,IACrBlB,SAAS;AAAA,IACTE,gBAAgB;AAAA,IAChBJ,SAASV,MAAMqB,MAAMC;AAAAA,IACrBnB,iBAAiBH,MAAMI,OAAOsB;AAAAA,IAC9BC,WAAY,aAAY3B,MAAMI,OAAOwB,KAAM;AAAA,IAC3CC,cAAe,aAAY7B,MAAMI,OAAOwB,KAAM;AAAA,EAChD;AAAA,EACAG,iBAAiB;AAAA,IACfnB,SAAS;AAAA,IACTC,eAAe;AAAA,IACfH,SAASV,MAAMqB,MAAME;AAAAA,IACrBS,KAAKhC,MAAMqB,MAAMC;AAAAA,IACjBP,YAAY;AAAA,EACd;AAAA,EACAkB,kBAAkB;AAAA,IAChBrB,SAAS;AAAA,IACTC,eAAe;AAAA,IACfH,SAASV,MAAMqB,MAAME;AAAAA,IACrBS,KAAKhC,MAAMqB,MAAMC;AAAAA,IACjBP,YAAY;AAAA,EACd;AAAA,EACAmB,iBAAiB;AAAA,IACfP,WAAY,aAAY3B,MAAMI,OAAOwB,KAAM;AAAA,IAC3ChB,SAAS;AAAA,IACTC,eAAe;AAAA,IACfmB,KAAKhC,MAAMqB,MAAMC;AAAAA,IACjBZ,SAASV,MAAMqB,MAAME;AAAAA,EACvB;AAAA,EACAY,gBAAgB;AAAA,IACdvB,SAAS;AAAA,IACTC,eAAe;AAAA,IACfE,YAAY;AAAA,EACd;AAAA,EACAqB,iBAAiB;AAAA,IACfxB,SAAS;AAAA,IACTC,eAAe;AAAA,IACfE,YAAY;AAAA,EACd;AAAA,EACAsB,WAAW;AAAA,IACTC,OAAO;AAAA,IACPC,QAAQ;AAAA,IACRC,QAAQxC,MAAMW,QAAQ,GAAGX,MAAMqB,MAAMC,EAAE;AAAA,IACvCvB,cAAcC,MAAMC,MAAMwC;AAAAA,IAC1BtC,iBAAiBH,MAAMI,OAAOsC;AAAAA,EAChC;AACF,CAAC;"}
@@ -0,0 +1,28 @@
1
+ import { jsx, Fragment, jsxs } from "@emotion/react/jsx-runtime";
2
+ import Text from "./Text.js";
3
+ import Select from "./Select.js";
4
+ const renderers = {
5
+ text: Text,
6
+ select: Select
7
+ };
8
+ const ParamRenderer = ({
9
+ nodeId,
10
+ params,
11
+ data
12
+ }) => {
13
+ return /* @__PURE__ */ jsx(Fragment, { children: params.map((param, idx) => {
14
+ const Renderer = renderers[param.type];
15
+ if (Renderer) {
16
+ return /* @__PURE__ */ jsxs("div", { children: [
17
+ /* @__PURE__ */ jsx("span", { children: param.label }),
18
+ /* @__PURE__ */ jsx(Renderer, { nodeId, param, data })
19
+ ] }, idx);
20
+ }
21
+ return null;
22
+ }) });
23
+ };
24
+ const ParamRenderer$1 = ParamRenderer;
25
+ export {
26
+ ParamRenderer$1 as default
27
+ };
28
+ //# sourceMappingURL=ParamRenderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ParamRenderer.js","sources":["../../../../../../src/components/Flow/Node/Parameters/ParamRenderer.tsx"],"sourcesContent":["import { HvFlowNodeParam } from \"../../types\";\nimport Text from \"./Text\";\nimport Select from \"./Select\";\n\nexport type ParamRendererProps = {\n nodeId: string;\n params: HvFlowNodeParam[];\n data: any;\n};\n\nconst renderers = {\n text: Text,\n select: Select,\n};\n\nconst ParamRenderer = ({ nodeId, params, data }: ParamRendererProps) => {\n return (\n <>\n {params.map((param, idx) => {\n const Renderer = renderers[param.type];\n if (Renderer) {\n return (\n <div key={idx}>\n <span>{param.label}</span>\n <Renderer nodeId={nodeId} param={param} data={data} />\n </div>\n );\n }\n return null;\n })}\n </>\n );\n};\n\nexport default ParamRenderer;\n"],"names":["renderers","text","Text","select","Select","ParamRenderer","nodeId","params","data","map","param","idx","Renderer","type","label"],"mappings":";;;AAUA,MAAMA,YAAY;AAAA,EAChBC,MAAMC;AAAAA,EACNC,QAAQC;AACV;AAEA,MAAMC,gBAAgBA,CAAC;AAAA,EAAEC;AAAAA,EAAQC;AAAAA,EAAQC;AAAyB,MAAM;AACtE,SAEKD,oBAAAA,UAAAA,EAAAA,UAAAA,OAAOE,IAAI,CAACC,OAAOC,QAAQ;AACpBC,UAAAA,WAAWZ,UAAUU,MAAMG,IAAI;AACrC,QAAID,UAAU;AACZ,kCACG,OACC,EAAA,UAAA;AAAA,QAAC,oBAAA,QAAA,EAAMF,gBAAMI,MAAM,CAAA;AAAA,QAClB,oBAAA,UAAA,EAAS,QAAgB,OAAc,KAAW,CAAA;AAAA,MAAA,EAAA,GAF3CH,GAGV;AAAA,IAEJ;AACO,WAAA;AAAA,EACR,CAAA,EACH,CAAA;AAEJ;AAEA,MAAA,kBAAeN;"}
@@ -0,0 +1,39 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { HvDropdown } from "@hitachivantara/uikit-react-core";
3
+ import { useState } from "react";
4
+ import { useReactFlow } from "reactflow";
5
+ const Select = ({
6
+ nodeId,
7
+ param,
8
+ data
9
+ }) => {
10
+ var _a;
11
+ const reactFlowInstance = useReactFlow();
12
+ const [option, setOption] = useState(data[param.id]);
13
+ const onSelectChange = (item) => {
14
+ const nodes = reactFlowInstance.getNodes();
15
+ const newNodes = nodes.map((node) => {
16
+ if (node.id === nodeId) {
17
+ node.data = {
18
+ ...node.data,
19
+ [param.id]: item.label
20
+ };
21
+ }
22
+ return node;
23
+ });
24
+ reactFlowInstance.setNodes(newNodes);
25
+ setOption(item.label);
26
+ };
27
+ return /* @__PURE__ */ jsx(HvDropdown, { values: (_a = param.options) == null ? void 0 : _a.map((o) => {
28
+ return {
29
+ id: o,
30
+ label: o,
31
+ selected: o === option
32
+ };
33
+ }), onChange: (item) => onSelectChange(item) });
34
+ };
35
+ const Select$1 = Select;
36
+ export {
37
+ Select$1 as default
38
+ };
39
+ //# sourceMappingURL=Select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select.js","sources":["../../../../../../src/components/Flow/Node/Parameters/Select.tsx"],"sourcesContent":["import { HvDropdown } from \"@hitachivantara/uikit-react-core\";\nimport { useState } from \"react\";\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 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;AAGtB,6BACG,YACC,EAAA,SAAQf,WAAMiB,YAANjB,mBAAea,IAAKK,CAAM,MAAA;AACzB,WAAA;AAAA,MAAEX,IAAIW;AAAAA,MAAGH,OAAOG;AAAAA,MAAGC,UAAUD,MAAMd;AAAAA,IAAAA;AAAAA,EAAO,IAEnD,UAAWK,CAASD,SAAAA,eAAeC,IAAI,EACvC,CAAA;AAEN;AAEA,MAAA,WAAeX;"}
@@ -0,0 +1,32 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { HvInput } from "@hitachivantara/uikit-react-core";
3
+ import { useState } from "react";
4
+ import { useReactFlow } from "reactflow";
5
+ const Text = ({
6
+ nodeId,
7
+ param,
8
+ data
9
+ }) => {
10
+ const reactFlowInstance = useReactFlow();
11
+ const [text, setText] = useState(data[param.id]);
12
+ const onTextChange = (val) => {
13
+ const nodes = reactFlowInstance.getNodes();
14
+ const newNodes = nodes.map((node) => {
15
+ if (node.id === nodeId) {
16
+ node.data = {
17
+ ...node.data,
18
+ [param.id]: val
19
+ };
20
+ }
21
+ return node;
22
+ });
23
+ reactFlowInstance.setNodes(newNodes);
24
+ setText(val);
25
+ };
26
+ return /* @__PURE__ */ jsx(HvInput, { value: text, onChange: (evt, val) => onTextChange(val) });
27
+ };
28
+ const Text$1 = Text;
29
+ export {
30
+ Text$1 as default
31
+ };
32
+ //# sourceMappingURL=Text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Text.js","sources":["../../../../../../src/components/Flow/Node/Parameters/Text.tsx"],"sourcesContent":["import { HvInput } from \"@hitachivantara/uikit-react-core\";\nimport { useState } from \"react\";\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 <HvInput value={text} onChange={(evt, val) => onTextChange(val)} />;\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","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;AAGN,SAAA,oBAAC,SAAQ,EAAA,OAAOL,MAAM,UAAU,CAACY,KAAKP,QAAQD,aAAaC,GAAG,EAAK,CAAA;AAC5E;AAEA,MAAA,SAAeX;"}
package/dist/esm/index.js CHANGED
@@ -19,11 +19,14 @@ import { HvFlowMinimap } from "./components/Flow/Minimap/Minimap.js";
19
19
  import { staticClasses as staticClasses9 } from "./components/Flow/Sidebar/Sidebar.styles.js";
20
20
  import { HvFlowSidebar } from "./components/Flow/Sidebar/Sidebar.js";
21
21
  import { HvFlow } from "./components/Flow/Flow.js";
22
+ import { staticClasses as staticClasses10 } from "./components/Flow/Node/Node.styles.js";
23
+ import { HvFlowNode } from "./components/Flow/Node/Node.js";
22
24
  export {
23
25
  HvFlow,
24
26
  HvFlowBackground,
25
27
  HvFlowControls,
26
28
  HvFlowMinimap,
29
+ HvFlowNode,
27
30
  HvFlowSidebar,
28
31
  HvStepNavigation,
29
32
  HvWizard,
@@ -34,6 +37,7 @@ export {
34
37
  HvWizardTitle,
35
38
  staticClasses7 as flowClasses,
36
39
  staticClasses8 as flowMinimapClasses,
40
+ staticClasses10 as flowNodeClasses,
37
41
  staticClasses9 as flowSidebarClasses,
38
42
  staticClasses as stepNavigationClasses,
39
43
  staticClasses3 as wizardActionsClasses,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
@@ -8,6 +8,8 @@ import { Edge } from 'reactflow';
8
8
  import { ExtractNames } from '@hitachivantara/uikit-react-core';
9
9
  import { FunctionComponent } from 'react';
10
10
  import { GetMiniMapNodeAttribute } from 'reactflow';
11
+ import { HvActionGeneric } from '@hitachivantara/uikit-react-core';
12
+ import { HvActionsGenericProps } from '@hitachivantara/uikit-react-core';
11
13
  import { HvAvatarSize } from '@hitachivantara/uikit-react-core';
12
14
  import { HvBaseProps } from '@hitachivantara/uikit-react-core';
13
15
  import { HvBreakpoints } from '@hitachivantara/uikit-react-core';
@@ -33,6 +35,23 @@ export declare const flowMinimapClasses: {
33
35
  root: "HvFlowMinimap-root";
34
36
  };
35
37
 
38
+ export declare const flowNodeClasses: {
39
+ root: "HvFlowNode-root";
40
+ group: "HvFlowNode-group";
41
+ mandatory: "HvFlowNode-mandatory";
42
+ actions: "HvFlowNode-actions";
43
+ titleContainer: "HvFlowNode-titleContainer";
44
+ headerContainer: "HvFlowNode-headerContainer";
45
+ groupContainer: "HvFlowNode-groupContainer";
46
+ inputsTitleContainer: "HvFlowNode-inputsTitleContainer";
47
+ outputsTitleContainer: "HvFlowNode-outputsTitleContainer";
48
+ inputsContainer: "HvFlowNode-inputsContainer";
49
+ outputsContainer: "HvFlowNode-outputsContainer";
50
+ paramsContainer: "HvFlowNode-paramsContainer";
51
+ inputContainer: "HvFlowNode-inputContainer";
52
+ outputContainer: "HvFlowNode-outputContainer";
53
+ };
54
+
36
55
  export declare const flowSidebarClasses: {
37
56
  description: "HvFlowSidebar-description";
38
57
  titleContainer: "HvFlowSidebar-titleContainer";
@@ -46,13 +65,13 @@ declare interface HvDroppableFlowProps<NodeData = any, NodeType extends string |
46
65
  /** Flow content: background, controls, and minimap. */
47
66
  children?: React.ReactNode;
48
67
  /** Flow nodes. */
49
- nodes?: HvFlowNode<NodeData, NodeType>[];
68
+ nodes?: Node_2<NodeData, NodeType>[];
50
69
  /** Flow edges. */
51
- edges?: HvFlowEdge[];
70
+ edges?: Edge[];
52
71
  /** A Jss Object used to override or extend the styles applied to the component. */
53
72
  classes?: HvFlowClasses;
54
73
  /** Function called when the flow changes. Returns the updated nodes and edges. */
55
- onFlowChange?: (nodes: HvFlowNode<NodeData, NodeType>[], edges: HvFlowEdge[]) => void;
74
+ onFlowChange?: (nodes: Node_2<NodeData, NodeType>[], edges: Edge[]) => void;
56
75
  }
57
76
 
58
77
  /**
@@ -63,7 +82,7 @@ declare interface HvDroppableFlowProps<NodeData = any, NodeType extends string |
63
82
  *
64
83
  * DISCLAIMER: This component is a work in progress and there might be breaking changes.
65
84
  */
66
- export declare const HvFlow: ({ nodeTypes, nodeGroups, sidebar, dndContextProps, ...others }: HvFlowProps) => JSX_2.Element;
85
+ export declare const HvFlow: ({ nodeTypes, nodeGroups, sidebar, defaultActions, dndContextProps, ...others }: HvFlowProps) => JSX_2.Element;
67
86
 
68
87
  export declare const HvFlowBackground: ({ color, ...others }: HvFlowBackgroundProps) => JSX_2.Element;
69
88
 
@@ -98,9 +117,6 @@ export declare interface HvFlowControlsProps extends Omit<ControlProps, "positio
98
117
  hideInteractive?: boolean;
99
118
  }
100
119
 
101
- /** Edge */
102
- export declare type HvFlowEdge = Edge;
103
-
104
120
  export declare const HvFlowMinimap: ({ nodeColor, maskColor, maskStrokeColor, nodeStrokeColor, classes: classesProp, className, ...others }: HvFlowMinimapProps) => JSX_2.Element;
105
121
 
106
122
  export declare type HvFlowMinimapClasses = ExtractNames<typeof useClasses_9>;
@@ -118,15 +134,13 @@ export declare interface HvFlowMinimapProps<NodeData = any> extends Omit<MiniMap
118
134
  classes?: HvFlowMinimapClasses;
119
135
  }
120
136
 
121
- /** Node */
122
- export declare type HvFlowNode<NodeData = any, NodeType extends string | undefined = string | undefined> = Node_2<NodeData, NodeType>;
137
+ export declare const HvFlowNode: ({ id, type, description, expanded, params, actions, actionCallback, maxVisibleActions, classes: classesProp, className, }: HvFlowNodeProps) => JSX_2.Element | null;
138
+
139
+ export declare type HvFlowNodeClasses = ExtractNames<typeof useClasses_11>;
123
140
 
124
141
  export declare interface HvFlowNodeComponentClass<GroupId extends keyof any = string> extends ComponentClass<NodeProps> {
125
142
  /** Metadata used on the HvFlowSidebar component to group the node */
126
- meta?: {
127
- groupId: GroupId;
128
- label: string;
129
- };
143
+ meta?: HvFlowNodeMeta<GroupId>;
130
144
  }
131
145
 
132
146
  export declare type HvFlowNodeComponentType<GroupId extends keyof any = string> = HvFlowNodeComponentClass<GroupId> | HvFlowNodeFunctionComponent<GroupId>;
@@ -134,10 +148,7 @@ export declare type HvFlowNodeComponentType<GroupId extends keyof any = string>
134
148
  /** Node types */
135
149
  export declare interface HvFlowNodeFunctionComponent<GroupId extends keyof any = string> extends FunctionComponent<NodeProps> {
136
150
  /** Metadata used on the HvFlowSidebar component to group the node */
137
- meta?: {
138
- groupId: GroupId;
139
- label: string;
140
- };
151
+ meta?: HvFlowNodeMeta<GroupId>;
141
152
  }
142
153
 
143
154
  /** Node groups */
@@ -150,6 +161,54 @@ export declare interface HvFlowNodeGroup {
150
161
 
151
162
  export declare type HvFlowNodeGroups<GroupId extends keyof any = string> = Record<GroupId, HvFlowNodeGroup>;
152
163
 
164
+ export declare type HvFlowNodeInput = {
165
+ label: string;
166
+ isMandatory?: boolean;
167
+ accepts?: string[];
168
+ };
169
+
170
+ export declare type HvFlowNodeMeta<GroupId extends keyof any = string> = {
171
+ label: string;
172
+ groupId: GroupId;
173
+ inputs?: HvFlowNodeInput[];
174
+ outputs?: HvFlowNodeOutput[];
175
+ };
176
+
177
+ export declare type HvFlowNodeOutput = {
178
+ label: string;
179
+ isMandatory?: boolean;
180
+ provides?: string[];
181
+ };
182
+
183
+ export declare type HvFlowNodeParam = {
184
+ id: string;
185
+ type: "text" | "select";
186
+ label: string;
187
+ options?: string[];
188
+ value?: string;
189
+ };
190
+
191
+ export declare interface HvFlowNodeProps extends Omit<HvBaseProps, "id">, NodeProps {
192
+ /** Node description */
193
+ description: string;
194
+ /** Node expanded */
195
+ expanded?: boolean;
196
+ /** Node inputs */
197
+ inputs?: HvFlowNodeInput[];
198
+ /** Node outputs */
199
+ outputs?: HvFlowNodeOutput[];
200
+ /** Node parameters */
201
+ params?: HvFlowNodeParam[];
202
+ /** Node actions */
203
+ actions?: HvActionGeneric[];
204
+ /** Node action callback */
205
+ actionCallback?: HvActionsGenericProps["actionsCallback"];
206
+ /** Node maximum number of actions visible */
207
+ maxVisibleActions?: number;
208
+ /** A Jss Object used to override or extend the styles applied to the component. */
209
+ classes?: HvFlowNodeClasses;
210
+ }
211
+
153
212
  export declare type HvFlowNodeTypes<GroupId extends keyof any = string> = {
154
213
  [key: string]: HvFlowNodeComponentType<GroupId>;
155
214
  };
@@ -161,6 +220,8 @@ export declare interface HvFlowProps<NodeData = any, NodeType extends string | u
161
220
  nodeTypes?: HvFlowNodeTypes<NodeGroups>;
162
221
  /** Flow sidebar. */
163
222
  sidebar?: React.ReactNode;
223
+ /** Flow default actions. */
224
+ defaultActions?: HvActionGeneric[];
164
225
  /**
165
226
  * Dnd Kit context props. This should be used for accessibility purposes.
166
227
  *
@@ -429,6 +490,30 @@ declare const useClasses_10: (classesProp?: Partial<Record<"description" | "titl
429
490
  cx: (...args: any) => string;
430
491
  };
431
492
 
493
+ declare const useClasses_11: (classesProp?: Partial<Record<"root" | "group" | "mandatory" | "actions" | "titleContainer" | "headerContainer" | "groupContainer" | "inputsTitleContainer" | "outputsTitleContainer" | "inputsContainer" | "outputsContainer" | "paramsContainer" | "inputContainer" | "outputContainer", string>>, addStatic?: boolean) => {
494
+ classes: {
495
+ root: string;
496
+ group: string;
497
+ mandatory: string;
498
+ actions: string;
499
+ titleContainer: string;
500
+ headerContainer: string;
501
+ groupContainer: string;
502
+ inputsTitleContainer: string;
503
+ outputsTitleContainer: string;
504
+ inputsContainer: string;
505
+ outputsContainer: string;
506
+ paramsContainer: string;
507
+ inputContainer: string;
508
+ outputContainer: string;
509
+ };
510
+ css: {
511
+ (template: TemplateStringsArray, ...args: CSSInterpolation[]): string;
512
+ (...args: CSSInterpolation[]): string;
513
+ };
514
+ cx: (...args: any) => string;
515
+ };
516
+
432
517
  declare const useClasses_2: (classesProp?: Partial<Record<"xl" | "lg" | "md" | "sm" | "xs" | "root" | "ghost" | "avatar" | "ghostDisabled" | "notCurrent", string>>, addStatic?: boolean) => {
433
518
  classes: {
434
519
  xl: string;
@@ -474,13 +559,13 @@ declare const useClasses_4: (classesProp?: Partial<Record<"buttonWidth" | "actio
474
559
  cx: (...args: any) => string;
475
560
  };
476
561
 
477
- declare const useClasses_5: (classesProp?: Partial<Record<"titleContainer" | "messageContainer" | "buttonWidth" | "rootSummaryButton" | "headerContainer" | "stepContainer", string>>, addStatic?: boolean) => {
562
+ declare const useClasses_5: (classesProp?: Partial<Record<"titleContainer" | "messageContainer" | "headerContainer" | "buttonWidth" | "rootSummaryButton" | "stepContainer", string>>, addStatic?: boolean) => {
478
563
  classes: {
479
564
  titleContainer: string;
480
565
  messageContainer: string;
566
+ headerContainer: string;
481
567
  buttonWidth: string;
482
568
  rootSummaryButton: string;
483
- headerContainer: string;
484
569
  stepContainer: string;
485
570
  };
486
571
  css: {
@@ -568,9 +653,9 @@ export declare const wizardContentClasses: {
568
653
  export declare const wizardTitleClasses: {
569
654
  titleContainer: "HvWizardTitle-titleContainer";
570
655
  messageContainer: "HvWizardTitle-messageContainer";
656
+ headerContainer: "HvWizardTitle-headerContainer";
571
657
  buttonWidth: "HvWizardTitle-buttonWidth";
572
658
  rootSummaryButton: "HvWizardTitle-rootSummaryButton";
573
- headerContainer: "HvWizardTitle-headerContainer";
574
659
  stepContainer: "HvWizardTitle-stepContainer";
575
660
  };
576
661
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-lab",
3
- "version": "5.5.5",
3
+ "version": "5.7.0",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Contributed React components for the NEXT UI Kit.",
@@ -32,7 +32,7 @@
32
32
  "@dnd-kit/core": "^6.0.8",
33
33
  "@dnd-kit/modifiers": "^6.0.1",
34
34
  "@emotion/css": "^11.11.0",
35
- "@hitachivantara/uikit-react-core": "^5.27.10",
35
+ "@hitachivantara/uikit-react-core": "^5.28.0",
36
36
  "@hitachivantara/uikit-react-icons": "^5.6.7",
37
37
  "@hitachivantara/uikit-styles": "^5.12.1",
38
38
  "lodash": "^4.17.21",
@@ -48,7 +48,7 @@
48
48
  "access": "public",
49
49
  "directory": "package"
50
50
  },
51
- "gitHead": "18f6e9c22421729de7c70bff66145e4806dd2f0d",
51
+ "gitHead": "f1d113e5f993a61c1a2a2733001ac2f70b8ede56",
52
52
  "main": "dist/cjs/index.cjs",
53
53
  "exports": {
54
54
  ".": {