@hitachivantara/uikit-react-lab 5.16.0 → 5.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -57,9 +57,9 @@ const HvFlowNode = ({
57
57
  (subtitle || actsVisible?.length || actsDropdown?.length) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: classes.subtitleContainer, children: [
58
58
  subtitle && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { children: subtitle }) }),
59
59
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: classes.actions, children: actions?.length && actions?.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
60
- actsVisible?.map((action) => /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTooltip, { title: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTypography, { children: action.label }), children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvButton, { icon: true, onClick: (event) => {
60
+ actsVisible?.map((action) => /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvTooltip, { title: action.label, children: /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvButton, { icon: true, onClick: (event) => {
61
61
  actionCallback?.(event, id, action);
62
- }, "aria-label": action.label, children: renderedIcon(action.icon) }) }) }, action.id)),
62
+ }, "aria-label": action.label, children: renderedIcon(action.icon) }) }, action.id)),
63
63
  actsDropdown && actsDropdown.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(uikitReactCore.HvDropDownMenu, { keepOpened: false, dataList: actsDropdown?.map((action) => ({
64
64
  id: action.id,
65
65
  label: action.label
@@ -1 +1 @@
1
- {"version":3,"file":"Node.cjs","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","jsxs","HvFlowBaseNode","jsx","HvTooltip","HvTypography","Info","HvButton","p","Up","Down","subtitleContainer","map","action","event","HvDropDownMenu","paramsContainer","ParamRenderer","data"],"mappings":";;;;;;;;;;;;AAmDA,MAAMA,eAAeA,CAACC,eACpBC,qBAAeD,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,YAAAA,WAAWH,WAAiC;AAChE,QAAM,CAACI,YAAYC,aAAa,IAAIC,eAASV,QAAQ;AAC/C,QAAA;AAAA,IAAEW;AAAAA,EAAAA,IAASC,YAAA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AA,CACH,EAEJ,CAAA;AAAA,IAAA,GACF;AAAA,IAED1C;AAAAA,IACAG,cAAcP,UACZoC,2BAAAA,IAAA,OAAA,EAAI,WAAWlC,QAAQ+C,iBACtB,UAACb,2BAAAA,IAAAc,cAAAA,SAAA,EAAc,QAAQ1D,IAAI,QAAgB,MAAMkB,MAAMyC,KAAK,CAAA,GAC9D;AAAA,EAEJ,EAAA,CAAA;AAEJ;;;"}
1
+ {"version":3,"file":"Node.cjs","sources":["../../../../../src/components/Flow/Node/Node.tsx"],"sourcesContent":["import React, { 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 key={action.id} title={action.label}>\n <HvButton\n icon\n onClick={(event) => {\n actionCallback?.(event, id, action);\n }}\n aria-label={action.label}\n >\n {renderedIcon(action.icon)}\n </HvButton>\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","jsxs","HvFlowBaseNode","jsx","HvTooltip","HvTypography","Info","HvButton","p","Up","Down","subtitleContainer","map","action","event","HvDropDownMenu","paramsContainer","ParamRenderer","data"],"mappings":";;;;;;;;;;;;AAmDA,MAAMA,eAAeA,CAACC,eACpBC,qBAAeD,UAAU,IAAIA,aAAcA;AAEtC,MAAME,aAAaA,CAAC;AAAA,EACzBC;AAAAA,EACAC;AAAAA,EACAC;AAAAA,EACAC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A,IAACY,eACC,gBAAA,EAAA,YAAY,OACZ,UAAUjB,cAAcc,IAAKC,CAAY,YAAA;AAAA,UACvCtD,IAAIsD,OAAOtD;AAAAA,UACX2B,OAAO2B,OAAO3B;AAAAA,QACd,EAAA,GACF,SAAS,CAAC4B,OAAOD,WAAW;AACTC,2BAAAA,OAAOvD,IAAIsD,MAA0B;AAAA,QAAA,GAG3D;AAAA,MAAA,EAAA,CACH,EAEJ,CAAA;AAAA,IAAA,GACF;AAAA,IAED1C;AAAAA,IACAG,cAAcP,UACZoC,2BAAAA,IAAA,OAAA,EAAI,WAAWlC,QAAQ+C,iBACtB,UAACb,2BAAAA,IAAAc,cAAAA,SAAA,EAAc,QAAQ1D,IAAI,QAAgB,MAAMkB,MAAMyC,KAAK,CAAA,GAC9D;AAAA,EAEJ,EAAA,CAAA;AAEJ;;;"}
@@ -1,44 +1,43 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const buildGroups = (nodeGroups, nodeTypes, defaultGroupProps) => {
4
- if (nodeGroups) {
5
- const groups = Object.entries(nodeGroups).reduce((acc, curr) => {
6
- const nodesWithGroupId = [];
7
- const nodesWithoutGroupId = [];
8
- if (nodeTypes) {
9
- for (const [nodeType, node] of Object.entries(nodeTypes)) {
10
- if (node.meta?.groupId === curr[0]) {
11
- nodesWithGroupId.push({
12
- type: nodeType,
13
- label: node.meta?.label,
14
- data: node.meta?.data
15
- });
16
- } else if (!node.meta?.groupId) {
17
- nodesWithoutGroupId.push({
18
- type: nodeType,
19
- label: node.meta?.label || "",
20
- data: node.meta?.data
21
- });
22
- }
4
+ if (!nodeGroups)
5
+ return {};
6
+ return Object.entries(nodeGroups).reduce((acc, curr) => {
7
+ const nodesWithGroupId = [];
8
+ const nodesWithoutGroupId = [];
9
+ if (nodeTypes) {
10
+ for (const [nodeType, node] of Object.entries(nodeTypes)) {
11
+ if (node.meta?.groupId === curr[0]) {
12
+ nodesWithGroupId.push({
13
+ type: nodeType,
14
+ label: node.meta?.label,
15
+ data: node.meta?.data
16
+ });
17
+ } else if (!node.meta?.groupId) {
18
+ nodesWithoutGroupId.push({
19
+ type: nodeType,
20
+ label: node.meta?.label || "",
21
+ data: node.meta?.data
22
+ });
23
23
  }
24
24
  }
25
- acc[curr[0]] = {
26
- ...curr[1],
27
- nodes: nodesWithGroupId
25
+ }
26
+ acc[curr[0]] = {
27
+ ...curr[1],
28
+ nodes: nodesWithGroupId
29
+ };
30
+ if (nodesWithoutGroupId.length > 0) {
31
+ acc.Default = {
32
+ // @ts-ignore
33
+ name: "Default",
34
+ label: "Default",
35
+ nodes: nodesWithoutGroupId,
36
+ ...defaultGroupProps
28
37
  };
29
- if (nodesWithoutGroupId.length > 0) {
30
- acc.Default = {
31
- name: "Default",
32
- label: "Default",
33
- nodes: nodesWithoutGroupId,
34
- ...defaultGroupProps
35
- };
36
- }
37
- return acc;
38
- }, {});
39
- return groups;
40
- }
41
- return {};
38
+ }
39
+ return acc;
40
+ }, {});
42
41
  };
43
42
  exports.buildGroups = buildGroups;
44
43
  //# sourceMappingURL=utils.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.cjs","sources":["../../../../../src/components/Flow/Sidebar/utils.ts"],"sourcesContent":["import { HvFlowContextValue } from \"../FlowContext\";\nimport { HvFlowNodeGroup } from \"../types\";\nimport {\n HvFlowSidebarGroupNodes,\n HvFlowSidebarGroupNode,\n} from \"./SidebarGroup\";\n\nexport const buildGroups = (\n nodeGroups: HvFlowContextValue[\"nodeGroups\"],\n nodeTypes: HvFlowContextValue[\"nodeTypes\"],\n defaultGroupProps?: HvFlowNodeGroup\n): {\n [key: string]: HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n} => {\n if (nodeGroups) {\n const groups = Object.entries(nodeGroups).reduce((acc, curr) => {\n const nodesWithGroupId: HvFlowSidebarGroupNode[] = [];\n const nodesWithoutGroupId: HvFlowSidebarGroupNode[] = [];\n\n if (nodeTypes) {\n for (const [nodeType, node] of Object.entries(nodeTypes)) {\n if (node.meta?.groupId === curr[0]) {\n nodesWithGroupId.push({\n type: nodeType,\n label: node.meta?.label,\n data: node.meta?.data,\n });\n } else if (!node.meta?.groupId) {\n nodesWithoutGroupId.push({\n type: nodeType,\n label: node.meta?.label || \"\",\n data: node.meta?.data,\n });\n }\n }\n }\n\n acc[curr[0]] = {\n ...curr[1],\n nodes: nodesWithGroupId,\n } as HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n\n // Create a \"Default\" group for nodes without a groupId\n if (nodesWithoutGroupId.length > 0) {\n // @ts-ignore\n acc.Default = {\n name: \"Default\",\n label: \"Default\",\n nodes: nodesWithoutGroupId,\n ...defaultGroupProps,\n } as HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n }\n\n return acc;\n }, {});\n\n return groups;\n }\n\n return {};\n};\n"],"names":["buildGroups","nodeGroups","nodeTypes","defaultGroupProps","groups","Object","entries","reduce","acc","curr","nodesWithGroupId","nodesWithoutGroupId","nodeType","node","meta","groupId","push","type","label","data","nodes","length","Default","name"],"mappings":";;AAOO,MAAMA,cAAcA,CACzBC,YACAC,WACAC,sBAGG;AACH,MAAIF,YAAY;AACRG,UAAAA,SAASC,OAAOC,QAAQL,UAAU,EAAEM,OAAO,CAACC,KAAKC,SAAS;AAC9D,YAAMC,mBAA6C,CAAA;AACnD,YAAMC,sBAAgD,CAAA;AAEtD,UAAIT,WAAW;AACb,mBAAW,CAACU,UAAUC,IAAI,KAAKR,OAAOC,QAAQJ,SAAS,GAAG;AACxD,cAAIW,KAAKC,MAAMC,YAAYN,KAAK,CAAC,GAAG;AAClCC,6BAAiBM,KAAK;AAAA,cACpBC,MAAML;AAAAA,cACNM,OAAOL,KAAKC,MAAMI;AAAAA,cAClBC,MAAMN,KAAKC,MAAMK;AAAAA,YAAAA,CAClB;AAAA,UACQ,WAAA,CAACN,KAAKC,MAAMC,SAAS;AAC9BJ,gCAAoBK,KAAK;AAAA,cACvBC,MAAML;AAAAA,cACNM,OAAOL,KAAKC,MAAMI,SAAS;AAAA,cAC3BC,MAAMN,KAAKC,MAAMK;AAAAA,YAAAA,CAClB;AAAA,UACH;AAAA,QACF;AAAA,MACF;AAEIV,UAAAA,KAAK,CAAC,CAAC,IAAI;AAAA,QACb,GAAGA,KAAK,CAAC;AAAA,QACTW,OAAOV;AAAAA,MAAAA;AAILC,UAAAA,oBAAoBU,SAAS,GAAG;AAElCb,YAAIc,UAAU;AAAA,UACZC,MAAM;AAAA,UACNL,OAAO;AAAA,UACPE,OAAOT;AAAAA,UACP,GAAGR;AAAAA,QAAAA;AAAAA,MAEP;AAEOK,aAAAA;AAAAA,IACT,GAAG,CAAE,CAAA;AAEEJ,WAAAA;AAAAA,EACT;AAEA,SAAO;AACT;;"}
1
+ {"version":3,"file":"utils.cjs","sources":["../../../../../src/components/Flow/Sidebar/utils.ts"],"sourcesContent":["import { HvFlowContextValue } from \"../FlowContext\";\nimport { HvFlowNodeGroup } from \"../types\";\nimport {\n HvFlowSidebarGroupNodes,\n HvFlowSidebarGroupNode,\n} from \"./SidebarGroup\";\n\ntype NodeGroup = HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n\nexport const buildGroups = (\n nodeGroups: HvFlowContextValue[\"nodeGroups\"],\n nodeTypes: HvFlowContextValue[\"nodeTypes\"],\n defaultGroupProps?: HvFlowNodeGroup\n) => {\n if (!nodeGroups) return {};\n\n return Object.entries(nodeGroups).reduce((acc, curr) => {\n const nodesWithGroupId: HvFlowSidebarGroupNode[] = [];\n const nodesWithoutGroupId: HvFlowSidebarGroupNode[] = [];\n\n if (nodeTypes) {\n for (const [nodeType, node] of Object.entries(nodeTypes)) {\n if (node.meta?.groupId === curr[0]) {\n nodesWithGroupId.push({\n type: nodeType,\n label: node.meta?.label,\n data: node.meta?.data,\n });\n } else if (!node.meta?.groupId) {\n nodesWithoutGroupId.push({\n type: nodeType,\n label: node.meta?.label || \"\",\n data: node.meta?.data,\n });\n }\n }\n }\n\n acc[curr[0]] = {\n ...curr[1],\n nodes: nodesWithGroupId,\n };\n\n // Create a \"Default\" group for nodes without a groupId\n if (nodesWithoutGroupId.length > 0) {\n acc.Default = {\n // @ts-ignore\n name: \"Default\",\n label: \"Default\",\n nodes: nodesWithoutGroupId,\n ...defaultGroupProps,\n };\n }\n\n return acc;\n }, {} as Record<string, NodeGroup>);\n};\n"],"names":["buildGroups","nodeGroups","nodeTypes","defaultGroupProps","Object","entries","reduce","acc","curr","nodesWithGroupId","nodesWithoutGroupId","nodeType","node","meta","groupId","push","type","label","data","nodes","length","Default","name"],"mappings":";;AASO,MAAMA,cAAcA,CACzBC,YACAC,WACAC,sBACG;AACH,MAAI,CAACF;AAAY,WAAO;AAExB,SAAOG,OAAOC,QAAQJ,UAAU,EAAEK,OAAO,CAACC,KAAKC,SAAS;AACtD,UAAMC,mBAA6C,CAAA;AACnD,UAAMC,sBAAgD,CAAA;AAEtD,QAAIR,WAAW;AACb,iBAAW,CAACS,UAAUC,IAAI,KAAKR,OAAOC,QAAQH,SAAS,GAAG;AACxD,YAAIU,KAAKC,MAAMC,YAAYN,KAAK,CAAC,GAAG;AAClCC,2BAAiBM,KAAK;AAAA,YACpBC,MAAML;AAAAA,YACNM,OAAOL,KAAKC,MAAMI;AAAAA,YAClBC,MAAMN,KAAKC,MAAMK;AAAAA,UAAAA,CAClB;AAAA,QACQ,WAAA,CAACN,KAAKC,MAAMC,SAAS;AAC9BJ,8BAAoBK,KAAK;AAAA,YACvBC,MAAML;AAAAA,YACNM,OAAOL,KAAKC,MAAMI,SAAS;AAAA,YAC3BC,MAAMN,KAAKC,MAAMK;AAAAA,UAAAA,CAClB;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAEIV,QAAAA,KAAK,CAAC,CAAC,IAAI;AAAA,MACb,GAAGA,KAAK,CAAC;AAAA,MACTW,OAAOV;AAAAA,IAAAA;AAILC,QAAAA,oBAAoBU,SAAS,GAAG;AAClCb,UAAIc,UAAU;AAAA;AAAA,QAEZC,MAAM;AAAA,QACNL,OAAO;AAAA,QACPE,OAAOT;AAAAA,QACP,GAAGP;AAAAA,MAAAA;AAAAA,IAEP;AAEOI,WAAAA;AAAAA,EACT,GAAG,CAAgC,CAAA;AACrC;;"}
@@ -56,9 +56,9 @@ const HvFlowNode = ({
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 }) }),
58
58
  /* @__PURE__ */ jsx("div", { className: classes.actions, children: actions?.length && actions?.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
59
- actsVisible?.map((action) => /* @__PURE__ */ jsx(HvTooltip, { title: /* @__PURE__ */ jsx(HvTypography, { children: action.label }), children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(HvButton, { icon: true, onClick: (event) => {
59
+ actsVisible?.map((action) => /* @__PURE__ */ jsx(HvTooltip, { title: action.label, children: /* @__PURE__ */ jsx(HvButton, { icon: true, onClick: (event) => {
60
60
  actionCallback?.(event, id, action);
61
- }, "aria-label": action.label, children: renderedIcon(action.icon) }) }) }, action.id)),
61
+ }, "aria-label": action.label, children: renderedIcon(action.icon) }) }, action.id)),
62
62
  actsDropdown && actsDropdown.length > 0 && /* @__PURE__ */ jsx(HvDropDownMenu, { keepOpened: false, dataList: actsDropdown?.map((action) => ({
63
63
  id: action.id,
64
64
  label: action.label
@@ -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 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,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,oBAAC,OAAI,EAAA,WAAWhB,QAAQN,SACrBA,mBAASqC,UAAUrC,SAASqC,SAAS,KAEjCJ,qBAAAA,UAAAA,EAAAA,UAAAA;AAAAA,QAAAA,aAAaO,IAAKC,CACjB,WAAA,oBAAC,aAEC,OAAO,oBAAC,gBAAcA,UAAOlB,OAAAA,OAAM,GAEnC,UAAA,oBAAC,SACC,UAAC,oBAAA,UAAA,EACC,MAAI,MACJ,SAAS,CAACmB,UAA0C;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;"}
1
+ {"version":3,"file":"Node.js","sources":["../../../../../src/components/Flow/Node/Node.tsx"],"sourcesContent":["import React, { 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 key={action.id} title={action.label}>\n <HvButton\n icon\n onClick={(event) => {\n actionCallback?.(event, id, action);\n }}\n aria-label={action.label}\n >\n {renderedIcon(action.icon)}\n </HvButton>\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,c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AA,WAAWhB,QAAQN,SACrBA,mBAASqC,UAAUrC,SAASqC,SAAS,KAEjCJ,qBAAAA,UAAAA,EAAAA,UAAAA;AAAAA,QAAAA,aAAaO,IAAKC,CAAAA,WAChB,oBAAA,WAAA,EAA0B,OAAOA,OAAOlB,OACvC,UAAA,oBAAC,UACC,EAAA,MAAI,MACJ,SAAUmB,CAAU,UAAA;AACDA,2BAAAA,OAAO9C,IAAI6C,MAAM;AAAA,QACpC,GACA,cAAYA,OAAOlB,OAElB/B,UAAAA,aAAaiD,OAAOZ,IAAI,EAC3B,CAAA,EAAA,GATcY,OAAO7C,EAUvB,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,42 +1,41 @@
1
1
  const buildGroups = (nodeGroups, nodeTypes, defaultGroupProps) => {
2
- if (nodeGroups) {
3
- const groups = Object.entries(nodeGroups).reduce((acc, curr) => {
4
- const nodesWithGroupId = [];
5
- const nodesWithoutGroupId = [];
6
- if (nodeTypes) {
7
- for (const [nodeType, node] of Object.entries(nodeTypes)) {
8
- if (node.meta?.groupId === curr[0]) {
9
- nodesWithGroupId.push({
10
- type: nodeType,
11
- label: node.meta?.label,
12
- data: node.meta?.data
13
- });
14
- } else if (!node.meta?.groupId) {
15
- nodesWithoutGroupId.push({
16
- type: nodeType,
17
- label: node.meta?.label || "",
18
- data: node.meta?.data
19
- });
20
- }
2
+ if (!nodeGroups)
3
+ return {};
4
+ return Object.entries(nodeGroups).reduce((acc, curr) => {
5
+ const nodesWithGroupId = [];
6
+ const nodesWithoutGroupId = [];
7
+ if (nodeTypes) {
8
+ for (const [nodeType, node] of Object.entries(nodeTypes)) {
9
+ if (node.meta?.groupId === curr[0]) {
10
+ nodesWithGroupId.push({
11
+ type: nodeType,
12
+ label: node.meta?.label,
13
+ data: node.meta?.data
14
+ });
15
+ } else if (!node.meta?.groupId) {
16
+ nodesWithoutGroupId.push({
17
+ type: nodeType,
18
+ label: node.meta?.label || "",
19
+ data: node.meta?.data
20
+ });
21
21
  }
22
22
  }
23
- acc[curr[0]] = {
24
- ...curr[1],
25
- nodes: nodesWithGroupId
23
+ }
24
+ acc[curr[0]] = {
25
+ ...curr[1],
26
+ nodes: nodesWithGroupId
27
+ };
28
+ if (nodesWithoutGroupId.length > 0) {
29
+ acc.Default = {
30
+ // @ts-ignore
31
+ name: "Default",
32
+ label: "Default",
33
+ nodes: nodesWithoutGroupId,
34
+ ...defaultGroupProps
26
35
  };
27
- if (nodesWithoutGroupId.length > 0) {
28
- acc.Default = {
29
- name: "Default",
30
- label: "Default",
31
- nodes: nodesWithoutGroupId,
32
- ...defaultGroupProps
33
- };
34
- }
35
- return acc;
36
- }, {});
37
- return groups;
38
- }
39
- return {};
36
+ }
37
+ return acc;
38
+ }, {});
40
39
  };
41
40
  export {
42
41
  buildGroups
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sources":["../../../../../src/components/Flow/Sidebar/utils.ts"],"sourcesContent":["import { HvFlowContextValue } from \"../FlowContext\";\nimport { HvFlowNodeGroup } from \"../types\";\nimport {\n HvFlowSidebarGroupNodes,\n HvFlowSidebarGroupNode,\n} from \"./SidebarGroup\";\n\nexport const buildGroups = (\n nodeGroups: HvFlowContextValue[\"nodeGroups\"],\n nodeTypes: HvFlowContextValue[\"nodeTypes\"],\n defaultGroupProps?: HvFlowNodeGroup\n): {\n [key: string]: HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n} => {\n if (nodeGroups) {\n const groups = Object.entries(nodeGroups).reduce((acc, curr) => {\n const nodesWithGroupId: HvFlowSidebarGroupNode[] = [];\n const nodesWithoutGroupId: HvFlowSidebarGroupNode[] = [];\n\n if (nodeTypes) {\n for (const [nodeType, node] of Object.entries(nodeTypes)) {\n if (node.meta?.groupId === curr[0]) {\n nodesWithGroupId.push({\n type: nodeType,\n label: node.meta?.label,\n data: node.meta?.data,\n });\n } else if (!node.meta?.groupId) {\n nodesWithoutGroupId.push({\n type: nodeType,\n label: node.meta?.label || \"\",\n data: node.meta?.data,\n });\n }\n }\n }\n\n acc[curr[0]] = {\n ...curr[1],\n nodes: nodesWithGroupId,\n } as HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n\n // Create a \"Default\" group for nodes without a groupId\n if (nodesWithoutGroupId.length > 0) {\n // @ts-ignore\n acc.Default = {\n name: \"Default\",\n label: \"Default\",\n nodes: nodesWithoutGroupId,\n ...defaultGroupProps,\n } as HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n }\n\n return acc;\n }, {});\n\n return groups;\n }\n\n return {};\n};\n"],"names":["buildGroups","nodeGroups","nodeTypes","defaultGroupProps","groups","Object","entries","reduce","acc","curr","nodesWithGroupId","nodesWithoutGroupId","nodeType","node","meta","groupId","push","type","label","data","nodes","length","Default","name"],"mappings":"AAOO,MAAMA,cAAcA,CACzBC,YACAC,WACAC,sBAGG;AACH,MAAIF,YAAY;AACRG,UAAAA,SAASC,OAAOC,QAAQL,UAAU,EAAEM,OAAO,CAACC,KAAKC,SAAS;AAC9D,YAAMC,mBAA6C,CAAA;AACnD,YAAMC,sBAAgD,CAAA;AAEtD,UAAIT,WAAW;AACb,mBAAW,CAACU,UAAUC,IAAI,KAAKR,OAAOC,QAAQJ,SAAS,GAAG;AACxD,cAAIW,KAAKC,MAAMC,YAAYN,KAAK,CAAC,GAAG;AAClCC,6BAAiBM,KAAK;AAAA,cACpBC,MAAML;AAAAA,cACNM,OAAOL,KAAKC,MAAMI;AAAAA,cAClBC,MAAMN,KAAKC,MAAMK;AAAAA,YAAAA,CAClB;AAAA,UACQ,WAAA,CAACN,KAAKC,MAAMC,SAAS;AAC9BJ,gCAAoBK,KAAK;AAAA,cACvBC,MAAML;AAAAA,cACNM,OAAOL,KAAKC,MAAMI,SAAS;AAAA,cAC3BC,MAAMN,KAAKC,MAAMK;AAAAA,YAAAA,CAClB;AAAA,UACH;AAAA,QACF;AAAA,MACF;AAEIV,UAAAA,KAAK,CAAC,CAAC,IAAI;AAAA,QACb,GAAGA,KAAK,CAAC;AAAA,QACTW,OAAOV;AAAAA,MAAAA;AAILC,UAAAA,oBAAoBU,SAAS,GAAG;AAElCb,YAAIc,UAAU;AAAA,UACZC,MAAM;AAAA,UACNL,OAAO;AAAA,UACPE,OAAOT;AAAAA,UACP,GAAGR;AAAAA,QAAAA;AAAAA,MAEP;AAEOK,aAAAA;AAAAA,IACT,GAAG,CAAE,CAAA;AAEEJ,WAAAA;AAAAA,EACT;AAEA,SAAO;AACT;"}
1
+ {"version":3,"file":"utils.js","sources":["../../../../../src/components/Flow/Sidebar/utils.ts"],"sourcesContent":["import { HvFlowContextValue } from \"../FlowContext\";\nimport { HvFlowNodeGroup } from \"../types\";\nimport {\n HvFlowSidebarGroupNodes,\n HvFlowSidebarGroupNode,\n} from \"./SidebarGroup\";\n\ntype NodeGroup = HvFlowNodeGroup & { nodes: HvFlowSidebarGroupNodes };\n\nexport const buildGroups = (\n nodeGroups: HvFlowContextValue[\"nodeGroups\"],\n nodeTypes: HvFlowContextValue[\"nodeTypes\"],\n defaultGroupProps?: HvFlowNodeGroup\n) => {\n if (!nodeGroups) return {};\n\n return Object.entries(nodeGroups).reduce((acc, curr) => {\n const nodesWithGroupId: HvFlowSidebarGroupNode[] = [];\n const nodesWithoutGroupId: HvFlowSidebarGroupNode[] = [];\n\n if (nodeTypes) {\n for (const [nodeType, node] of Object.entries(nodeTypes)) {\n if (node.meta?.groupId === curr[0]) {\n nodesWithGroupId.push({\n type: nodeType,\n label: node.meta?.label,\n data: node.meta?.data,\n });\n } else if (!node.meta?.groupId) {\n nodesWithoutGroupId.push({\n type: nodeType,\n label: node.meta?.label || \"\",\n data: node.meta?.data,\n });\n }\n }\n }\n\n acc[curr[0]] = {\n ...curr[1],\n nodes: nodesWithGroupId,\n };\n\n // Create a \"Default\" group for nodes without a groupId\n if (nodesWithoutGroupId.length > 0) {\n acc.Default = {\n // @ts-ignore\n name: \"Default\",\n label: \"Default\",\n nodes: nodesWithoutGroupId,\n ...defaultGroupProps,\n };\n }\n\n return acc;\n }, {} as Record<string, NodeGroup>);\n};\n"],"names":["buildGroups","nodeGroups","nodeTypes","defaultGroupProps","Object","entries","reduce","acc","curr","nodesWithGroupId","nodesWithoutGroupId","nodeType","node","meta","groupId","push","type","label","data","nodes","length","Default","name"],"mappings":"AASO,MAAMA,cAAcA,CACzBC,YACAC,WACAC,sBACG;AACH,MAAI,CAACF;AAAY,WAAO;AAExB,SAAOG,OAAOC,QAAQJ,UAAU,EAAEK,OAAO,CAACC,KAAKC,SAAS;AACtD,UAAMC,mBAA6C,CAAA;AACnD,UAAMC,sBAAgD,CAAA;AAEtD,QAAIR,WAAW;AACb,iBAAW,CAACS,UAAUC,IAAI,KAAKR,OAAOC,QAAQH,SAAS,GAAG;AACxD,YAAIU,KAAKC,MAAMC,YAAYN,KAAK,CAAC,GAAG;AAClCC,2BAAiBM,KAAK;AAAA,YACpBC,MAAML;AAAAA,YACNM,OAAOL,KAAKC,MAAMI;AAAAA,YAClBC,MAAMN,KAAKC,MAAMK;AAAAA,UAAAA,CAClB;AAAA,QACQ,WAAA,CAACN,KAAKC,MAAMC,SAAS;AAC9BJ,8BAAoBK,KAAK;AAAA,YACvBC,MAAML;AAAAA,YACNM,OAAOL,KAAKC,MAAMI,SAAS;AAAA,YAC3BC,MAAMN,KAAKC,MAAMK;AAAAA,UAAAA,CAClB;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAEIV,QAAAA,KAAK,CAAC,CAAC,IAAI;AAAA,MACb,GAAGA,KAAK,CAAC;AAAA,MACTW,OAAOV;AAAAA,IAAAA;AAILC,QAAAA,oBAAoBU,SAAS,GAAG;AAClCb,UAAIc,UAAU;AAAA;AAAA,QAEZC,MAAM;AAAA,QACNL,OAAO;AAAA,QACPE,OAAOT;AAAAA,QACP,GAAGP;AAAAA,MAAAA;AAAAA,IAEP;AAEOI,WAAAA;AAAAA,EACT,GAAG,CAAgC,CAAA;AACrC;"}
@@ -8,7 +8,7 @@ import { DragEndEvent } from '@dnd-kit/core';
8
8
  import { DragOverlayProps } from '@dnd-kit/core';
9
9
  import { Edge } from 'reactflow';
10
10
  import { ExtractNames } from '@hitachivantara/uikit-react-core';
11
- import { FunctionComponent } from 'react';
11
+ import { FC } from 'react';
12
12
  import { GetMiniMapNodeAttribute } from 'reactflow';
13
13
  import { HvActionGeneric } from '@hitachivantara/uikit-react-core';
14
14
  import { HvActionsGenericProps } from '@hitachivantara/uikit-react-core';
@@ -209,12 +209,10 @@ export declare interface HvFlowNodeAction extends HvActionGeneric {
209
209
 
210
210
  export declare type HvFlowNodeClasses = ExtractNames<typeof useClasses_12>;
211
211
 
212
- export declare interface HvFlowNodeComponentClass<GroupId extends keyof any = string, NodeData = any> extends ComponentClass<NodeProps> {
213
- /** Metadata used on the HvFlowSidebar component to group the node */
214
- meta?: HvFlowNodeTypeMeta<GroupId, NodeData>;
212
+ export declare interface HvFlowNodeComponentClass<GroupId extends keyof any = string, NodeData = any> extends ComponentClass<NodeProps>, NodeExtras<GroupId, NodeData> {
215
213
  }
216
214
 
217
- export declare type HvFlowNodeComponentType<GroupId extends keyof any = string, NodeData = any> = HvFlowNodeComponentClass<GroupId, NodeData> | HvFlowNodeFunctionComponent<GroupId, NodeData>;
215
+ export declare type HvFlowNodeComponentType<GroupId extends keyof any = string, NodeData = any> = HvFlowNodeComponentClass<GroupId, NodeData> | HvFlowNodeFC<GroupId, NodeData>;
218
216
 
219
217
  export declare type HvFlowNodeDefaults = {
220
218
  title?: string;
@@ -223,10 +221,8 @@ export declare type HvFlowNodeDefaults = {
223
221
  icon?: React_2.ReactNode;
224
222
  };
225
223
 
226
- /** Node types */
227
- export declare interface HvFlowNodeFunctionComponent<GroupId extends keyof any = string, NodeData = any> extends FunctionComponent<NodeProps> {
228
- /** Metadata used on the HvFlowSidebar component to group the node */
229
- meta?: HvFlowNodeTypeMeta<GroupId, NodeData>;
224
+ /** HvFlowNode component type. @extends React.FC */
225
+ export declare interface HvFlowNodeFC<GroupId extends keyof any = string, NodeData = any> extends FC<NodeProps>, NodeExtras<GroupId, NodeData> {
230
226
  }
231
227
 
232
228
  /** Node groups */
@@ -297,6 +293,7 @@ export declare interface HvFlowNodeTextParam extends HvFlowNodeSharedParam {
297
293
  type: "text";
298
294
  }
299
295
 
296
+ /** Metadata used on the `HvFlowSidebar` component to group the node */
300
297
  export declare type HvFlowNodeTypeMeta<GroupId extends keyof any = string, NodeData = any> = {
301
298
  label: string;
302
299
  groupId?: GroupId;
@@ -305,9 +302,7 @@ export declare type HvFlowNodeTypeMeta<GroupId extends keyof any = string, NodeD
305
302
  data?: NodeData;
306
303
  };
307
304
 
308
- export declare type HvFlowNodeTypes<GroupId extends keyof any = string, NodeData = any> = {
309
- [key: string]: HvFlowNodeComponentType<GroupId, NodeData>;
310
- };
305
+ export declare type HvFlowNodeTypes<GroupId extends keyof any = string, NodeData = any> = Record<string, HvFlowNodeComponentType<GroupId, NodeData>>;
311
306
 
312
307
  export declare interface HvFlowProps<NodeGroups extends keyof any = string, NodeType extends string | undefined = string | undefined, NodeData = any> extends HvDroppableFlowProps<NodeType, NodeData> {
313
308
  /** Flow nodes groups. */
@@ -555,6 +550,10 @@ export declare interface HvWizardTitleProps extends HvBaseProps {
555
550
  classes?: HvWizardTitleClasses;
556
551
  }
557
552
 
553
+ declare type NodeExtras<GroupId extends keyof any = string, NodeData = any> = {
554
+ meta?: HvFlowNodeTypeMeta<GroupId, NodeData>;
555
+ };
556
+
558
557
  export declare const stepNavigationClasses: {
559
558
  root: "HvStepNavigation-root";
560
559
  separator: "HvStepNavigation-separator";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hitachivantara/uikit-react-lab",
3
- "version": "5.16.0",
3
+ "version": "5.16.1",
4
4
  "private": false,
5
5
  "author": "Hitachi Vantara UI Kit Team",
6
6
  "description": "Contributed React components for the NEXT UI Kit.",
@@ -32,9 +32,9 @@
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.36.4",
36
- "@hitachivantara/uikit-react-icons": "^5.7.2",
37
- "@hitachivantara/uikit-styles": "^5.16.1",
35
+ "@hitachivantara/uikit-react-core": "^5.36.5",
36
+ "@hitachivantara/uikit-react-icons": "^5.7.3",
37
+ "@hitachivantara/uikit-styles": "^5.16.2",
38
38
  "lodash": "^4.17.21",
39
39
  "reactflow": "^11.9.4",
40
40
  "uid": "^2.0.2",
@@ -48,7 +48,7 @@
48
48
  "access": "public",
49
49
  "directory": "package"
50
50
  },
51
- "gitHead": "48869c29cffd62f712769fb6e7e629aa8a930025",
51
+ "gitHead": "d0236ef87c697adb1d66b6b99a09404ee33e930e",
52
52
  "main": "dist/cjs/index.cjs",
53
53
  "exports": {
54
54
  ".": {