@pega/cosmos-react-build 4.0.0-dev.2.0 → 4.0.0-dev.20.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 (179) hide show
  1. package/lib/components/AppShell/AppShell.d.ts +3 -2
  2. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppShell.js +42 -80
  4. package/lib/components/AppShell/AppShell.js.map +1 -1
  5. package/lib/components/AppShell/AppShell.styles.d.ts +12 -16
  6. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  7. package/lib/components/AppShell/AppShell.styles.js +208 -283
  8. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  9. package/lib/components/AppShell/AppShell.types.d.ts +63 -31
  10. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  11. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  12. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppShellContext.js +3 -5
  14. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  15. package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -0
  16. package/lib/components/AppShell/Header/AppHeader.js +73 -0
  17. package/lib/components/AppShell/Header/AppHeader.js.map +1 -0
  18. package/lib/components/{AppHeader → AppShell/Header}/AppHeader.styles.d.ts +7 -7
  19. package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -0
  20. package/lib/components/AppShell/Header/AppHeader.styles.js +158 -0
  21. package/lib/components/AppShell/Header/AppHeader.styles.js.map +1 -0
  22. package/lib/components/{AppHeader → AppShell/Header}/AppHeader.types.d.ts +6 -5
  23. package/lib/components/AppShell/Header/AppHeader.types.d.ts.map +1 -0
  24. package/lib/components/AppShell/Header/AppHeader.types.js.map +1 -0
  25. package/lib/components/AppShell/Header/BranchButton.d.ts.map +1 -0
  26. package/lib/components/{AppHeader → AppShell/Header}/BranchButton.js +5 -5
  27. package/lib/components/AppShell/Header/BranchButton.js.map +1 -0
  28. package/lib/components/AppShell/NavigationList.d.ts +6 -0
  29. package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
  30. package/lib/components/AppShell/NavigationList.js +97 -0
  31. package/lib/components/AppShell/NavigationList.js.map +1 -0
  32. package/lib/components/AppShell/index.d.ts +3 -1
  33. package/lib/components/AppShell/index.d.ts.map +1 -1
  34. package/lib/components/AppShell/index.js.map +1 -1
  35. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  36. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +27 -27
  37. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  38. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +1 -1
  39. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  40. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts +41 -27
  41. package/lib/components/DynamicContentEditor/PegaCustomElement.d.ts.map +1 -1
  42. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  43. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +17 -33
  44. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  45. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +6 -6
  46. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  47. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +4 -3
  48. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
  49. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
  50. package/lib/components/ExpressionBuilder/index.d.ts +1 -1
  51. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  52. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  53. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  54. package/lib/components/FlowModeller/AddNode.js +3 -4
  55. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  56. package/lib/components/FlowModeller/Connector.d.ts +2 -2
  57. package/lib/components/FlowModeller/Connector.d.ts.map +1 -1
  58. package/lib/components/FlowModeller/Connector.js +2 -4
  59. package/lib/components/FlowModeller/Connector.js.map +1 -1
  60. package/lib/components/FlowModeller/DeletePopover.d.ts +3 -3
  61. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -1
  62. package/lib/components/FlowModeller/DeletePopover.js.map +1 -1
  63. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  64. package/lib/components/FlowModeller/FlowModeller.js +1 -3
  65. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  66. package/lib/components/FlowModeller/Node/Node.types.d.ts +5 -0
  67. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  68. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  69. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +5 -1
  70. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  71. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +10 -3
  72. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  73. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  74. package/lib/components/FlowModeller/Node/NodeTemplates.js +11 -29
  75. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  76. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  77. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +3 -3
  78. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +1 -1
  79. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  80. package/lib/components/ItemLibrary/ItemLibrary.js +2 -2
  81. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  82. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  83. package/lib/components/LifeCycle/Category.js +2 -2
  84. package/lib/components/LifeCycle/Category.js.map +1 -1
  85. package/lib/components/LifeCycle/LifeCycle.types.d.ts +22 -1
  86. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  87. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  88. package/lib/components/LifeCycle/LifeCycleList.d.ts +11 -0
  89. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  90. package/lib/components/LifeCycle/LifeCycleList.js +1 -1
  91. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  92. package/lib/components/LifeCycle/Stage.d.ts +2 -0
  93. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  94. package/lib/components/LifeCycle/Stage.js +4 -10
  95. package/lib/components/LifeCycle/Stage.js.map +1 -1
  96. package/lib/components/LifeCycle/Step.d.ts +6 -2
  97. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  98. package/lib/components/LifeCycle/Step.js +30 -24
  99. package/lib/components/LifeCycle/Step.js.map +1 -1
  100. package/lib/components/LifeCycle/Task.d.ts +1 -0
  101. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  102. package/lib/components/LifeCycle/Task.js +6 -12
  103. package/lib/components/LifeCycle/Task.js.map +1 -1
  104. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +0 -1
  105. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
  106. package/lib/components/MobileBuildSummary/MobileBuildSummary.js +5 -16
  107. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
  108. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts +5 -3
  109. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.d.ts.map +1 -1
  110. package/lib/components/MobileBuildSummary/MobileBuildSummary.types.js.map +1 -1
  111. package/lib/components/ObjectPreview/ObjectPreview.d.ts +2 -2
  112. package/lib/components/ObjectPreview/ObjectPreview.d.ts.map +1 -1
  113. package/lib/components/ObjectPreview/ObjectPreview.js +1 -1
  114. package/lib/components/ObjectPreview/ObjectPreview.js.map +1 -1
  115. package/lib/components/ObjectSelect/ObjectSummary.d.ts +11 -3
  116. package/lib/components/ObjectSelect/ObjectSummary.d.ts.map +1 -1
  117. package/lib/components/ObjectSelect/ObjectSummary.js +50 -14
  118. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
  119. package/lib/components/ObjectSelect/useCreateModal.d.ts +9 -11
  120. package/lib/components/ObjectSelect/useCreateModal.d.ts.map +1 -1
  121. package/lib/components/ObjectSelect/useCreateModal.js +5 -6
  122. package/lib/components/ObjectSelect/useCreateModal.js.map +1 -1
  123. package/lib/components/PageBanner/PageBanner.d.ts +22 -0
  124. package/lib/components/PageBanner/PageBanner.d.ts.map +1 -0
  125. package/lib/components/PageBanner/PageBanner.js +59 -0
  126. package/lib/components/PageBanner/PageBanner.js.map +1 -0
  127. package/lib/components/PageBanner/index.d.ts +3 -0
  128. package/lib/components/PageBanner/index.d.ts.map +1 -0
  129. package/lib/components/PageBanner/index.js +2 -0
  130. package/lib/components/PageBanner/index.js.map +1 -0
  131. package/lib/components/PageTemplates/GalleryPage.d.ts +10 -10
  132. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  133. package/lib/components/PageTemplates/GalleryPage.js +35 -11
  134. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  135. package/lib/components/PageTemplates/PageTemplates.d.ts +1 -1
  136. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  137. package/lib/components/PageTemplates/PageTemplates.js +8 -45
  138. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  139. package/lib/components/PageTemplates/ShowcasePage.d.ts +16 -0
  140. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -0
  141. package/lib/components/PageTemplates/ShowcasePage.js +29 -0
  142. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -0
  143. package/lib/components/PageTemplates/index.d.ts +3 -1
  144. package/lib/components/PageTemplates/index.d.ts.map +1 -1
  145. package/lib/components/PageTemplates/index.js +2 -1
  146. package/lib/components/PageTemplates/index.js.map +1 -1
  147. package/lib/components/SummaryCard/SummaryCard.d.ts.map +1 -1
  148. package/lib/components/SummaryCard/SummaryCard.js +4 -7
  149. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  150. package/lib/components/Workbench/Workbench.types.d.ts +2 -2
  151. package/lib/components/Workbench/Workbench.types.d.ts.map +1 -1
  152. package/lib/index.d.ts +3 -2
  153. package/lib/index.d.ts.map +1 -1
  154. package/lib/index.js +3 -2
  155. package/lib/index.js.map +1 -1
  156. package/lib/utils/utils.d.ts +1 -1
  157. package/lib/utils/utils.d.ts.map +1 -1
  158. package/package.json +16 -9
  159. package/lib/components/AppHeader/AppHeader.d.ts.map +0 -1
  160. package/lib/components/AppHeader/AppHeader.js +0 -40
  161. package/lib/components/AppHeader/AppHeader.js.map +0 -1
  162. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +0 -1
  163. package/lib/components/AppHeader/AppHeader.styles.js +0 -118
  164. package/lib/components/AppHeader/AppHeader.styles.js.map +0 -1
  165. package/lib/components/AppHeader/AppHeader.types.d.ts.map +0 -1
  166. package/lib/components/AppHeader/AppHeader.types.js.map +0 -1
  167. package/lib/components/AppHeader/BranchButton.d.ts.map +0 -1
  168. package/lib/components/AppHeader/BranchButton.js.map +0 -1
  169. package/lib/components/AppHeader/index.d.ts +0 -4
  170. package/lib/components/AppHeader/index.d.ts.map +0 -1
  171. package/lib/components/AppHeader/index.js +0 -3
  172. package/lib/components/AppHeader/index.js.map +0 -1
  173. package/lib/components/PageTemplates/GalleryPage.styles.d.ts +0 -9
  174. package/lib/components/PageTemplates/GalleryPage.styles.d.ts.map +0 -1
  175. package/lib/components/PageTemplates/GalleryPage.styles.js +0 -70
  176. package/lib/components/PageTemplates/GalleryPage.styles.js.map +0 -1
  177. /package/lib/components/{AppHeader → AppShell/Header}/AppHeader.d.ts +0 -0
  178. /package/lib/components/{AppHeader → AppShell/Header}/AppHeader.types.js +0 -0
  179. /package/lib/components/{AppHeader → AppShell/Header}/BranchButton.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"GraphLayout.js","sourceRoot":"","sources":["../../../../../src/components/FlowModeller/Renderer/Utils/GraphLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,0CAAkB,CAAA;IAClB,0CAAkB,CAAA;AACpB,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B;AAED,MAAM,mBAAmB,GAAG,IAAI,CAAC;AACjC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAElC,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,wBAAwB;IACxB,MAAM,CAAC,IAAI,CACT,SAAY,EACZ,WAAoB,KAAK,EACzB,YAAkC,oBAAoB,CAAC,WAAW;QAElE,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAElE,UAAU,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAE3C,MAAM,gBAAgB,GAAG,GAAG,CAAC;QAC7B,MAAM,iBAAiB,GAAG,GAAG,CAAC;QAE9B,UAAU,CAAC,QAAQ,CAAC;YAClB,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzB,OAAO,EAAE,gBAAgB,GAAG,CAAC;YAC7B,OAAO,EAAE,EAAE;YACX,sBAAsB;YACtB,OAAO,EAAE,GAAG;YACZ,sBAAsB;YACtB,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;QAEH,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,MAA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IAAI,EAAE,CAAC;aACvB;YAED,MAAM,kBAAkB,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;YAEjD,6EAA6E;YAC7E,IACE,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,kBAAkB,GAAG,CAAC,CAAC,CAAC,CAAC;gBACzE,MAAM,CAAC,MAAM,KAAK,CAAC,EACnB;gBACA,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACxC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;QACvC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;QAEzC,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;YAC/C,OAAO;gBACL,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB;gBAC3D,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB;aAChE,CAAC;SACH;QAED,OAAO;YACL,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,oBAAoB;SAC7B,CAAC;IACJ,CAAC;CACF","sourcesContent":["import dagre from 'dagre';\n\nimport { ConnectorProps, GraphData, Node } from './Graph';\n\nexport interface PlottedGraphNode<T = any> extends Node<T> {\n dimensions: {\n width: number;\n height: number;\n };\n position: {\n x: number;\n y: number;\n };\n referencedNode?: T;\n}\n\nexport interface PlottedGraphConnector<T = any> extends ConnectorProps<T> {\n points: { x: number; y: number }[];\n labelLayout?: {\n value: any;\n width: number;\n height: number;\n x: number;\n y: number;\n };\n}\n\nexport enum GraphLayoutDirection {\n LeftToRight = 'LR',\n TopToBottom = 'TB'\n}\n\nconst DEFAULT_GRAPH_WIDTH = 2000;\nconst DEFAULT_GRAPH_HEIGHT = 2000;\n\nexport default class GraphLayout {\n // Using Dagre layouting\n static plot<T extends GraphData<PlottedGraphNode, PlottedGraphConnector>>(\n graphData: T,\n readOnly: boolean = false,\n direction: GraphLayoutDirection = GraphLayoutDirection.TopToBottom\n ) {\n const dagreGraph = new dagre.graphlib.Graph({ multigraph: true });\n\n dagreGraph.setDefaultEdgeLabel(() => ({}));\n\n const defaultNodeWidth = 280;\n const defaultNodeHeight = 112;\n\n dagreGraph.setGraph({\n rankdir: direction,\n ranksep: readOnly ? 2 : 4,\n edgesep: defaultNodeWidth / 2,\n nodesep: 20,\n // cspell:disable-next\n marginx: 200,\n // cspell:disable-next\n marginy: 32\n });\n\n graphData.nodes.forEach(node => {\n const height = node.dimensions.height === 0 ? 0 : node.dimensions.height || defaultNodeHeight;\n const width = node.dimensions.width === 0 ? 0 : node.dimensions.width || defaultNodeWidth;\n dagreGraph.setNode(node.id, {\n width,\n height\n });\n });\n\n graphData.connectors.forEach((con, index) => {\n dagreGraph.setEdge(\n con.fromNodeId,\n con.toNodeId,\n {\n weight: 1,\n minlen: 2,\n label: con.data?.label || '',\n width: 250,\n height: con.data?.label ? 90 : 40,\n // cspell:disable-next\n lablepos: 'c',\n labeloffset: 0\n },\n index.toString()\n );\n });\n\n dagre.layout(dagreGraph, {});\n\n graphData.nodes.forEach(el => {\n const node = dagreGraph.node(el.id);\n el.position.x = node.x - el.dimensions.width / 2;\n el.position.y = node.y - el.dimensions.height / 2;\n });\n\n graphData.connectors.forEach((con, index) => {\n const edge = dagreGraph.edge(con.fromNodeId, con.toNodeId, index.toString());\n\n con.labelLayout = {\n value: edge.label,\n x: edge.x,\n y: edge.y,\n width: edge.width,\n height: edge.height\n };\n\n const lastIndex = edge.points.length - 1;\n let firstPoint = edge.points[0];\n const secondPoint = edge.points[1];\n let lastPoint = edge.points[lastIndex];\n const secondLastPoint = edge.points[lastIndex - 1];\n\n const fromNode = dagreGraph.node(con.fromNodeId);\n const toNode = dagreGraph.node(con.toNodeId);\n\n firstPoint =\n firstPoint.x !== secondPoint.x\n ? {\n ...edge.points[0],\n x: fromNode.x,\n y: edge.points[1].y\n }\n : firstPoint;\n\n lastPoint =\n lastPoint.x !== secondLastPoint.x\n ? {\n ...edge.points[lastIndex],\n x: toNode.x,\n y: edge.points[lastIndex - 1].y\n }\n : lastPoint;\n\n con.points = [\n { x: fromNode.x, y: fromNode.y + fromNode.height / 2 },\n { ...firstPoint, y: firstPoint.y + 10 },\n { ...secondPoint, y: secondPoint.y + 10 },\n ...edge.points.slice(2, lastIndex),\n lastPoint\n ];\n\n // Only add the last point incase the edge has an arc at end\n if (edge.points[lastIndex].x !== edge.points[lastIndex - 1].x) {\n con.points.push({ x: toNode.x, y: toNode.y });\n }\n\n // if current edge source node is an placeholder node move down the starting point of placeholder node by 12\n if (fromNode.height === 0) {\n con.points[0].y += 12;\n }\n\n const edgeLastPointIndex = con.points.length - 1;\n\n // Move the merging arcs last point to the starting point of placeholder node\n if (\n con.points[edgeLastPointIndex].x === con.points[edgeLastPointIndex - 1].x &&\n toNode.height === 0\n ) {\n con.points[edgeLastPointIndex].y += 12;\n }\n });\n\n const width = dagreGraph.graph().width;\n const height = dagreGraph.graph().height;\n\n if (width !== undefined && height !== undefined) {\n return {\n width: Number.isFinite(width) ? width : DEFAULT_GRAPH_WIDTH,\n height: Number.isFinite(height) ? height : DEFAULT_GRAPH_HEIGHT\n };\n }\n\n return {\n width: DEFAULT_GRAPH_WIDTH,\n height: DEFAULT_GRAPH_HEIGHT\n };\n }\n}\n"]}
1
+ {"version":3,"file":"GraphLayout.js","sourceRoot":"","sources":["../../../../../src/components/FlowModeller/Renderer/Utils/GraphLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC9B,0C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,MAAM,KAAK,CAAC,EACnB;gBACA,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACxC;QACH,CAAC,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC;QACvC,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;QAEzC,IAAI,KAAK,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE;YAC/C,OAAO;gBACL,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB;gBAC3D,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,oBAAoB;aAChE,CAAC;SACH;QAED,OAAO;YACL,KAAK,EAAE,mBAAmB;YAC1B,MAAM,EAAE,oBAAoB;SAC7B,CAAC;IACJ,CAAC;CACF","sourcesContent":["import dagre from 'dagre';\n\nimport { ConnectorProps, GraphData, Node } from './Graph';\n\nexport interface PlottedGraphNode<T = any> extends Node<T> {\n dimensions: {\n width: number;\n height: number;\n };\n position: {\n x: number;\n y: number;\n };\n referencedNode?: T;\n}\n\nexport interface PlottedGraphConnector<T = any> extends ConnectorProps<T> {\n points: { x: number; y: number }[];\n labelLayout?: {\n value: any;\n width: number;\n height: number;\n x: number;\n y: number;\n };\n}\n\nexport enum GraphLayoutDirection {\n LeftToRight = 'LR',\n TopToBottom = 'TB'\n}\n\nconst DEFAULT_GRAPH_WIDTH = 2000;\nconst DEFAULT_GRAPH_HEIGHT = 2000;\n\nexport default class GraphLayout {\n // Using Dagre layouting\n static plot<T extends GraphData<PlottedGraphNode, PlottedGraphConnector>>(\n graphData: T,\n readOnly: boolean = false,\n direction: GraphLayoutDirection = GraphLayoutDirection.TopToBottom\n ) {\n const dagreGraph = new dagre.graphlib.Graph({ multigraph: true });\n\n dagreGraph.setDefaultEdgeLabel(() => ({}));\n\n const defaultNodeWidth = 280;\n const defaultNodeHeight = 112;\n\n dagreGraph.setGraph({\n rankdir: direction,\n ranksep: readOnly ? 2 : 4,\n edgesep: defaultNodeWidth / 2,\n nodesep: 20,\n // cspell:disable-next-line\n marginx: 200,\n // cspell:disable-next-line\n marginy: 32\n });\n\n graphData.nodes.forEach(node => {\n const height = node.dimensions.height === 0 ? 0 : node.dimensions.height || defaultNodeHeight;\n const width = node.dimensions.width === 0 ? 0 : node.dimensions.width || defaultNodeWidth;\n dagreGraph.setNode(node.id, {\n width,\n height\n });\n });\n\n graphData.connectors.forEach((con, index) => {\n dagreGraph.setEdge(\n con.fromNodeId,\n con.toNodeId,\n {\n weight: 1,\n minlen: 2,\n label: con.data?.label || '',\n width: 250,\n height: con.data?.label ? 90 : 40,\n // cspell:disable-next-line\n lablepos: 'c',\n labeloffset: 0\n },\n index.toString()\n );\n });\n\n dagre.layout(dagreGraph, {});\n\n graphData.nodes.forEach(el => {\n const node = dagreGraph.node(el.id);\n el.position.x = node.x - el.dimensions.width / 2;\n el.position.y = node.y - el.dimensions.height / 2;\n });\n\n graphData.connectors.forEach((con, index) => {\n const edge = dagreGraph.edge(con.fromNodeId, con.toNodeId, index.toString());\n\n con.labelLayout = {\n value: edge.label,\n x: edge.x,\n y: edge.y,\n width: edge.width,\n height: edge.height\n };\n\n const lastIndex = edge.points.length - 1;\n let firstPoint = edge.points[0];\n const secondPoint = edge.points[1];\n let lastPoint = edge.points[lastIndex];\n const secondLastPoint = edge.points[lastIndex - 1];\n\n const fromNode = dagreGraph.node(con.fromNodeId);\n const toNode = dagreGraph.node(con.toNodeId);\n\n firstPoint =\n firstPoint.x !== secondPoint.x\n ? {\n ...edge.points[0],\n x: fromNode.x,\n y: edge.points[1].y\n }\n : firstPoint;\n\n lastPoint =\n lastPoint.x !== secondLastPoint.x\n ? {\n ...edge.points[lastIndex],\n x: toNode.x,\n y: edge.points[lastIndex - 1].y\n }\n : lastPoint;\n\n con.points = [\n { x: fromNode.x, y: fromNode.y + fromNode.height / 2 },\n { ...firstPoint, y: firstPoint.y + 10 },\n { ...secondPoint, y: secondPoint.y + 10 },\n ...edge.points.slice(2, lastIndex),\n lastPoint\n ];\n\n // Only add the last point incase the edge has an arc at end\n if (edge.points[lastIndex].x !== edge.points[lastIndex - 1].x) {\n con.points.push({ x: toNode.x, y: toNode.y });\n }\n\n // if current edge source node is an placeholder node move down the starting point of placeholder node by 12\n if (fromNode.height === 0) {\n con.points[0].y += 12;\n }\n\n const edgeLastPointIndex = con.points.length - 1;\n\n // Move the merging arcs last point to the starting point of placeholder node\n if (\n con.points[edgeLastPointIndex].x === con.points[edgeLastPointIndex - 1].x &&\n toNode.height === 0\n ) {\n con.points[edgeLastPointIndex].y += 12;\n }\n });\n\n const width = dagreGraph.graph().width;\n const height = dagreGraph.graph().height;\n\n if (width !== undefined && height !== undefined) {\n return {\n width: Number.isFinite(width) ? width : DEFAULT_GRAPH_WIDTH,\n height: Number.isFinite(height) ? height : DEFAULT_GRAPH_HEIGHT\n };\n }\n\n return {\n width: DEFAULT_GRAPH_WIDTH,\n height: DEFAULT_GRAPH_HEIGHT\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ItemLibrary.d.ts","sourceRoot":"","sources":["../../../src/components/ItemLibrary/ItemLibrary.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EAGF,GAAG,EAOJ,MAAM,OAAO,CAAC;AAIf,OAAO,EACL,gBAAgB,EAChB,YAAY,EAKZ,aAAa,EAMb,YAAY,EACb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAY,SAAS,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AACD,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EAAE,OAAO,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,IAAI,CAAC;IAC/B,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC9C,QAAQ,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;CACtC;AAED,eAAO,MAAM,UAAU,yGAWrB,CAAC;AAIH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CA8FpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import { readableColor } from 'polished';
@@ -56,7 +56,7 @@ const ItemLibrary = forwardRef(({ show, target, items, onClick, placeholder, pos
56
56
  onClick(selectedNode);
57
57
  }
58
58
  }, [onClick]);
59
- return (_jsx(_Fragment, { children: show && (_jsx(Popover, { show: show, placement: position, target: target, ref: ref, children: _jsx(Menu, { items: itemsToRender, onItemClick: onItemSelect, header: _jsx(SearchInput, { ref: searchEleRef, onSearchChange: setSearch, value: search, searchInputAriaLabel: placeholder, placeholder: placeholder }), focusControlEl: searchEleRef.current || undefined }) })) }));
59
+ return show ? (_jsx(Popover, { show: show, placement: position, target: target, ref: ref, children: _jsx(Menu, { items: itemsToRender, onItemClick: onItemSelect, header: _jsx(SearchInput, { ref: searchEleRef, onSearchChange: setSearch, value: search, searchInputAriaLabel: placeholder, placeholder: placeholder }), focusControlEl: searchEleRef.current || undefined }) })) : null;
60
60
  });
61
61
  export default ItemLibrary;
62
62
  //# sourceMappingURL=ItemLibrary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ItemLibrary.js","sourceRoot":"","sources":["../../../src/components/ItemLibrary/ItemLibrary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAGV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EAET,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAGL,IAAI,EACJ,IAAI,EAEJ,WAAW,EAEX,OAAO,EACP,WAAW,EACX,GAAG,EACH,mBAAmB,EACnB,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAa,MAAM,aAAa,CAAC;AAqBlD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACjD,OAAO,GAAG,CAAA;;;0BAGc,KAAK,CAAC,IAAI,CAAC,OAAO;yBACnB,KAAK,CAAC,IAAI,CAAC,OAAO;;;;qBAItB,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;GAC7C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,WAAW,GAAwC,UAAU,CACjE,CACE,EACE,IAAI,EACJ,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,QAAQ,GAAG,cAAc,EACS,EACpC,GAA4B,EAC5B,EAAE;IACF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEzC,MAAM,YAAY,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEpD,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,IAAI,EAAE;YACR,SAAS,CAAC,EAAE,CAAC,C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CAAC,CAAC,SAAS;gBACb,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBACjD,SAAS,EAAE,IAAI,CAAC,SAAS;gBACzB,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS;aACnD,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC;IAEzB,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,EAAuB,EAAE,EAAE;QAC1B,MAAM,YAAY,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAgB,CAAC;QACnE,IAAI,OAAO,EAAE;YACX,OAAO,CAAC,YAAY,CAAC,CAAC;SACvB;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,4BACG,IAAI,IAAI,CACP,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,YAChE,KAAC,IAAI,IACH,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,YAAY,EACzB,MAAM,EACJ,KAAC,WAAW,IACV,GAAG,EAAE,YAAY,EACjB,cAAc,EAAE,SAAS,EACzB,KAAK,EAAE,MAAM,EACb,oBAAoB,EAAE,WAAW,EACjC,WAAW,EAAE,WAAW,GACxB,EAEJ,cAAc,EAAE,YAAY,CAAC,OAAO,IAAI,SAAS,GACjD,GACM,CACX,GACA,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n CSSProperties\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n SearchInputProps,\n ForwardProps,\n Icon,\n Menu,\n MenuGroupProps,\n menuHelpers,\n MenuItemProps,\n Popover,\n SearchInput,\n cap,\n createStringMatcher,\n defaultThemeProp,\n PopoverProps\n} from '@pega/cosmos-react-core';\n\nimport { colorMap, ColorName } from '../../utils';\n\nexport interface LibraryItem extends MenuItemProps {\n id: string;\n type: ItemVisual;\n items?: LibraryItem[];\n}\nexport interface ItemVisual {\n color: ColorName;\n icon: string;\n}\nexport interface ItemLibraryProps<T extends LibraryItem = LibraryItem> {\n show: boolean;\n target: HTMLElement | null;\n items: T[];\n onClick?: (libItem: T) => void;\n ref?: Ref<HTMLDivElement>;\n placeholder?: SearchInputProps['placeholder'];\n position?: PopoverProps['placement'];\n}\n\nexport const StyledIcon = styled.div(({ theme }) => {\n return css`\n min-height: 2rem;\n min-width: 2rem;\n padding: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n text-align: center;\n background-color: var(--bg-color);\n color: var(--fg-color);\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nconst ItemLibrary: FC<ItemLibraryProps & ForwardProps> = forwardRef(\n (\n {\n show,\n target,\n items,\n onClick,\n placeholder,\n position = 'bottom-start'\n }: PropsWithoutRef<ItemLibraryProps>,\n ref: ItemLibraryProps['ref']\n ) => {\n const [search, setSearch] = useState('');\n\n const searchEleRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (show) {\n setSearch('');\n searchEleRef?.current?.focus();\n }\n }, [show, searchEleRef.current]);\n\n const searchRegex = useMemo(\n () => (search ? createStringMatcher(cap(search), 'contains', '') : null),\n [search]\n );\n\n const itemsToRender: (MenuItemProps | MenuGroupProps)[] = useMemo(() => {\n return menuHelpers.mapTree(\n searchRegex\n ? menuHelpers.flatten(items).filter(({ primary }: MenuItemProps) => {\n return searchRegex.test(primary);\n })\n : items,\n node => {\n let selectable = false;\n if (!node.items) {\n selectable = true;\n }\n\n const nodeItem: LibraryItem = node as LibraryItem;\n return {\n ...node,\n visual: nodeItem.type ? (\n <StyledIcon\n id={node.id}\n style={\n {\n '--bg-color': colorMap[nodeItem.type.color],\n '--fg-color': readableColor(colorMap[nodeItem.type.color])\n } as CSSProperties\n }\n >\n <Icon name={nodeItem.type.icon} />\n </StyledIcon>\n ) : undefined,\n count: node.items ? node.items.length : undefined,\n secondary: node.secondary,\n selected: selectable ? !!node.selected : undefined\n };\n }\n );\n }, [items, searchRegex]);\n\n const onItemSelect = useCallback(\n (id: MenuItemProps['id']) => {\n const selectedNode = menuHelpers.getItem(items, id) as LibraryItem;\n if (onClick) {\n onClick(selectedNode);\n }\n },\n [onClick]\n );\n\n return (\n <>\n {show && (\n <Popover show={show} placement={position} target={target} ref={ref}>\n <Menu\n items={itemsToRender}\n onItemClick={onItemSelect}\n header={\n <SearchInput\n ref={searchEleRef}\n onSearchChange={setSearch}\n value={search}\n searchInputAriaLabel={placeholder}\n placeholder={placeholder}\n />\n }\n focusControlEl={searchEleRef.current || undefined}\n />\n </Popover>\n )}\n </>\n );\n }\n);\n\nexport default ItemLibrary;\n"]}
1
+ {"version":3,"file":"ItemLibrary.js","sourceRoot":"","sources":["../../../src/components/ItemLibrary/ItemLibrary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,UAAU,EAGV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EAET,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAGL,IAAI,EACJ,IAAI,EAEJ,WAAW,EAEX,OAAO,EACP,WAAW,EACX,GAAG,EACH,mBAAmB,EACnB,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAa,MAAM,aAAa,CAAC;AAqB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O,CAAC,YAAY,CAAC,CAAC;SACvB;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ,KAAC,OAAO,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,YAChE,KAAC,IAAI,IACH,KAAK,EAAE,aAAa,EACpB,WAAW,EAAE,YAAY,EACzB,MAAM,EACJ,KAAC,WAAW,IACV,GAAG,EAAE,YAAY,EACjB,cAAc,EAAE,SAAS,EACzB,KAAK,EAAE,MAAM,EACb,oBAAoB,EAAE,WAAW,EACjC,WAAW,EAAE,WAAW,GACxB,EAEJ,cAAc,EAAE,YAAY,CAAC,OAAO,IAAI,SAAS,GACjD,GACM,CACX,CAAC,CAAC,CAAC,IAAI,CAAC;AACX,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n FC,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n CSSProperties\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n SearchInputProps,\n ForwardProps,\n Icon,\n Menu,\n MenuGroupProps,\n menuHelpers,\n MenuItemProps,\n Popover,\n SearchInput,\n cap,\n createStringMatcher,\n defaultThemeProp,\n PopoverProps\n} from '@pega/cosmos-react-core';\n\nimport { colorMap, ColorName } from '../../utils';\n\nexport interface LibraryItem extends MenuItemProps {\n id: string;\n type: ItemVisual;\n items?: LibraryItem[];\n}\nexport interface ItemVisual {\n color: ColorName;\n icon: string;\n}\nexport interface ItemLibraryProps<T extends LibraryItem = LibraryItem> {\n show: boolean;\n target: HTMLElement | null;\n items: T[];\n onClick?: (libItem: T) => void;\n ref?: Ref<HTMLDivElement>;\n placeholder?: SearchInputProps['placeholder'];\n position?: PopoverProps['placement'];\n}\n\nexport const StyledIcon = styled.div(({ theme }) => {\n return css`\n min-height: 2rem;\n min-width: 2rem;\n padding: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n text-align: center;\n background-color: var(--bg-color);\n color: var(--fg-color);\n border-radius: ${theme.base['border-radius']};\n `;\n});\n\nStyledIcon.defaultProps = defaultThemeProp;\n\nconst ItemLibrary: FC<ItemLibraryProps & ForwardProps> = forwardRef(\n (\n {\n show,\n target,\n items,\n onClick,\n placeholder,\n position = 'bottom-start'\n }: PropsWithoutRef<ItemLibraryProps>,\n ref: ItemLibraryProps['ref']\n ) => {\n const [search, setSearch] = useState('');\n\n const searchEleRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (show) {\n setSearch('');\n searchEleRef?.current?.focus();\n }\n }, [show, searchEleRef.current]);\n\n const searchRegex = useMemo(\n () => (search ? createStringMatcher(cap(search), 'contains', '') : null),\n [search]\n );\n\n const itemsToRender: (MenuItemProps | MenuGroupProps)[] = useMemo(() => {\n return menuHelpers.mapTree(\n searchRegex\n ? menuHelpers.flatten(items).filter(({ primary }: MenuItemProps) => {\n return searchRegex.test(primary);\n })\n : items,\n node => {\n let selectable = false;\n if (!node.items) {\n selectable = true;\n }\n\n const nodeItem: LibraryItem = node as LibraryItem;\n return {\n ...node,\n visual: nodeItem.type ? (\n <StyledIcon\n id={node.id}\n style={\n {\n '--bg-color': colorMap[nodeItem.type.color],\n '--fg-color': readableColor(colorMap[nodeItem.type.color])\n } as CSSProperties\n }\n >\n <Icon name={nodeItem.type.icon} />\n </StyledIcon>\n ) : undefined,\n count: node.items ? node.items.length : undefined,\n secondary: node.secondary,\n selected: selectable ? !!node.selected : undefined\n };\n }\n );\n }, [items, searchRegex]);\n\n const onItemSelect = useCallback(\n (id: MenuItemProps['id']) => {\n const selectedNode = menuHelpers.getItem(items, id) as LibraryItem;\n if (onClick) {\n onClick(selectedNode);\n }\n },\n [onClick]\n );\n\n return show ? (\n <Popover show={show} placement={position} target={target} ref={ref}>\n <Menu\n items={itemsToRender}\n onItemClick={onItemSelect}\n header={\n <SearchInput\n ref={searchEleRef}\n onSearchChange={setSearch}\n value={search}\n searchInputAriaLabel={placeholder}\n placeholder={placeholder}\n />\n }\n focusControlEl={searchEleRef.current || undefined}\n />\n </Popover>\n ) : null;\n }\n);\n\nexport default ItemLibrary;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAMlB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,YAAY,EAMb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAGL,eAAe,EACf,aAAa,EACd,MAAM,mBAAmB,CAAC;AAI3B,eAAO,MAAM,cAAc;eAA0B,OAAO;SAQ1D,CAAC;AAIH,eAAO,MAAM,UAAU;eAA0B,eAAe,GAAG,SAAS;QAAM,MAAM;SAWvF,CAAC;AAIF,eAAO,MAAM,mBAAmB,yGA0B9B,CAAC;AAIH,eAAO,MAAM,aAAa,yGAaxB,CAAC;AAIH,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA+G7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Category.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAuD,MAAM,OAAO,CAAC;AAG/F,OAAO,EACL,YAAY,EAMb,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAGL,eAAe,EACf,aAAa,EACd,MAAM,mBAAmB,CAAC;AAI3B,eAAO,MAAM,cAAc;eAA0B,OAAO;SAQ1D,CAAC;AAIH,eAAO,MAAM,UAAU;eAA0B,eAAe,GAAG,SAAS;QAAM,MAAM;SAWvF,CAAC;AAIF,eAAO,MAAM,mBAAmB,yGA0B9B,CAAC;AAIH,eAAO,MAAM,aAAa,yGAaxB,CAAC;AAIH,QAAA,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA6G7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -76,7 +76,7 @@ const Category = forwardRef(({ item, showTitle = false, stageItem, category, id,
76
76
  if (task?.addTask?.showOnce && item?.tasks?.length !== 0) {
77
77
  showAddTaskButton = false;
78
78
  }
79
- /* Call back for click of add task button */
79
+ // Callback for click of add task button
80
80
  const onAddTaskClick = (e) => {
81
81
  const param = {
82
82
  category: item,
@@ -98,7 +98,7 @@ const Category = forwardRef(({ item, showTitle = false, stageItem, category, id,
98
98
  }) }))] }, i));
99
99
  }
100
100
  return (_createElement(Task, { ...restProps, ...task, key: taskItem.id, id: taskItem.id, value: taskItem.label, item: taskItem, visual: taskItem.visual, stageItem: stageItem, categoryItem: item, onAddStep: task?.onAddStep, error: taskItem.error }));
101
- }), (showAddTaskButton || !item) && !readOnly && (_jsx(_Fragment, { children: _jsx(StyledAddTask, { children: _jsxs(Button, { variant: 'simple', label: t('add_noun', [task.addTask.title]), icon: true, onClick: onAddTaskClick, children: [_jsx(Icon, { name: 'plus' }), _jsx("div", { children: task.addTask.title })] }) }) }))] })] }));
101
+ }), (showAddTaskButton || !item) && !readOnly && (_jsx(StyledAddTask, { children: _jsxs(Button, { variant: 'simple', label: t('add_noun', [task.addTask.title]), icon: true, onClick: onAddTaskClick, children: [_jsx(Icon, { name: 'plus' }), _jsx("div", { children: task.addTask.title })] }) }))] })] }));
102
102
  });
103
103
  export default Category;
104
104
  //# sourceMappingURL=Category.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAEL,UAAU,EAIV,UAAU,EACX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,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,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,YAAY,CAAC,MAAM,EAC3B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,IAAI,EAClB,KAAK,EAAE,YAAY,CAAC,KAAK,GACzB,CACH,CAAC;4CACJ,CAAC,CAAC,GACC,CACN,KAzBM,CAAC,CA0BL,CACN,CAAC;6BACH;4BACD,OAAO,CACL,eAAC,IAAI,OACC,SAAS,KACT,IAAI,EACR,GAAG,EAAE,QAAQ,CAAC,EAAE,EAChB,EAAE,EAAE,QAAQ,CAAC,EAAE,EACf,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,QAAQ,CAAC,MAAM,EACvB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,IAAI,EAClB,SAAS,EAAE,IAAI,EAAE,SAAS,EAC1B,KAAK,EAAE,QAAQ,CAAC,KAAK,GACrB,CACH,CAAC;wBACJ,CAAC,CAAC,EACH,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,CAC5C,4BACE,KAAC,aAAa,cACZ,MAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAC1C,IAAI,QACJ,OAAO,EAAE,cAAc,aAEvB,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,EACpB,wBAAM,IAAI,CAAC,OAAO,CAAC,KAAK,GAAO,IACxB,GACK,GACf,CACJ,IACU,IACZ,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import {\n FunctionComponent,\n forwardRef,\n Fragment,\n PropsWithoutRef,\n MouseEvent,\n useContext\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n ForwardProps,\n Flex,\n Button,\n Icon,\n useI18n,\n defaultThemeProp\n} from '@pega/cosmos-react-core';\n\nimport {\n TaskItemProps,\n LifeCycleActionParam,\n CategoriesProps,\n CategoryProps\n} from './LifeCycle.types';\nimport Task from './Task';\nimport LifeCycleContext from './LifeCycleContext';\n\nexport const StyledCategory = styled.h3<{ showTitle: boolean }>(({ showTitle, theme }) => {\n return css`\n ${!showTitle &&\n css`\n visibility: hidden;\n `}\n margin: ${theme.base.spacing} 0 0 0;\n `;\n});\n\nStyledCategory.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.ol<{ category?: CategoriesProps | undefined; id: string }>(\n ({ category, theme, id }) => {\n return css`\n margin-block-start: ${theme.base.spacing};\n margin-block-end: calc(2 * ${theme.base.spacing});\n list-style-type: none;\n ${category?.elementId !== id &&\n ` min-height: ${category?.height ? `${category.height}px` : 'auto'};\n `}\n `;\n }\n);\n\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledParallelTitle = styled.div(({ theme }) => {\n return css`\n position: relative;\n z-index: 1;\n margin-block-end: 0.5rem;\n text-align: center;\n &::before {\n border-block-start: calc(0.2 * ${theme.base.spacing}) solid ${theme.base.colors.slate.medium};\n content: '';\n margin: 0 auto;\n position: absolute;\n top: 50%;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n z-index: -1;\n }\n span {\n background: ${theme.base.colors.slate.medium};\n padding: 0 ${theme.base.spacing};\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n color: ${theme.base.colors.white};\n text-transform: uppercase;\n }\n `;\n});\n\nStyledParallelTitle.defaultProps = defaultThemeProp;\n\nexport const StyledAddTask = styled.div(({ theme }) => {\n return css`\n > button {\n background: ${theme.base.palette['secondary-background']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n width: 100%;\n justify-content: flex-start;\n padding: calc(1 * ${theme.base.spacing}) calc(1.75 * ${theme.base.spacing});\n > div {\n margin: 0 calc(2 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledAddTask.defaultProps = defaultThemeProp;\n\nconst Category: FunctionComponent<CategoryProps & ForwardProps> = forwardRef(\n (\n {\n item,\n showTitle = false,\n stageItem,\n category,\n id,\n task,\n ...restProps\n }: PropsWithoutRef<CategoryProps>,\n ref: CategoryProps['ref']\n ) => {\n const { readOnly } = useContext(LifeCycleContext);\n let showAddTaskButton = true;\n const t = useI18n();\n\n if (task?.addTask?.showOnce && item?.tasks?.length !== 0) {\n showAddTaskButton = false;\n }\n /* Call back for click of add task button */\n const onAddTaskClick = (e: MouseEvent<HTMLButtonElement>) => {\n const param: LifeCycleActionParam = {\n category: item,\n stage: stageItem\n };\n task?.addTask.onAddTask?.(param, e);\n };\n\n return (\n <>\n {category?.label && (\n <StyledCategory showTitle={showTitle} tabIndex={-1} id={item?.categoryId}>\n {category?.label}\n </StyledCategory>\n )}\n <StyledList ref={ref} category={category} id={item?.id} data-id={item?.categoryId}>\n {item &&\n item.tasks.length !== 0 &&\n item.tasks.map((taskItem: TaskItemProps | TaskItemProps[], i: number) => {\n if (Array.isArray(taskItem)) {\n if (task && task.addTask && task.addTask.showOnce && taskItem.length !== 0) {\n showAddTaskButton = false;\n }\n\n return (\n // eslint-disable-next-line react/no-array-index-key\n <li key={i}>\n {i !== 0 && (\n <Flex as={StyledParallelTitle} container={{ justify: 'center' }}>\n <span>{t('parallel')}</span>\n </Flex>\n )}\n {taskItem.length > 0 && (\n <ol>\n {taskItem.map((parallelTask: TaskItemProps) => {\n return (\n <Task\n {...restProps}\n {...task}\n key={parallelTask.id}\n id={parallelTask.id}\n value={parallelTask.label}\n item={parallelTask}\n visual={parallelTask.visual}\n stageItem={stageItem}\n categoryItem={item}\n error={parallelTask.error}\n />\n );\n })}\n </ol>\n )}\n </li>\n );\n }\n return (\n <Task\n {...restProps}\n {...task}\n key={taskItem.id}\n id={taskItem.id}\n value={taskItem.label}\n item={taskItem}\n visual={taskItem.visual}\n stageItem={stageItem}\n categoryItem={item}\n onAddStep={task?.onAddStep}\n error={taskItem.error}\n />\n );\n })}\n {(showAddTaskButton || !item) && !readOnly && (\n <>\n <StyledAddTask>\n <Button\n variant='simple'\n label={t('add_noun', [task.addTask.title])}\n icon\n onClick={onAddTaskClick}\n >\n <Icon name='plus' />\n <div>{task.addTask.title}</div>\n </Button>\n </StyledAddTask>\n </>\n )}\n </StyledList>\n </>\n );\n }\n);\n\nexport default Category;\n"]}
1
+ {"version":3,"file":"Category.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Category.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAqB,UAAU,EAA+B,UAAU,EAAE,MAAM,OAAO,CAAC;AAC/F,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAEL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EACP,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAQjC,OAAO,IAAI,MAAM,QAAQ,CAAC;AAC1B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAyB,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;IACvF,OAAO,GAAG,CAAA;MACN,CAAC,SAAS;QACZ,GAAG,CAAA;;KAEF;cACS,KAAK,CAAC,IAAI,CAAC,OAAO;GAC7B,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,CACjC,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE;IAC1B,OAAO,GAAG,CAAA;4BACc,KAAK,CAAC,IAAI,CAAC,OAAO;mCACX,KAAK,CAAC,IAAI,CAAC,OAAO;;QAE7C,QAAQ,EAAE,SAAS,KAAK,EAAE;QAC5B,gBAAgB,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,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CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAC1C,IAAI,QACJ,OAAO,EAAE,cAAc,aAEvB,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,EACpB,wBAAM,IAAI,CAAC,OAAO,CAAC,KAAK,GAAO,IACxB,GACK,CACjB,IACU,IACZ,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef, MouseEvent, useContext } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n ForwardProps,\n Flex,\n Button,\n Icon,\n useI18n,\n defaultThemeProp\n} from '@pega/cosmos-react-core';\n\nimport {\n TaskItemProps,\n LifeCycleActionParam,\n CategoriesProps,\n CategoryProps\n} from './LifeCycle.types';\nimport Task from './Task';\nimport LifeCycleContext from './LifeCycleContext';\n\nexport const StyledCategory = styled.h3<{ showTitle: boolean }>(({ showTitle, theme }) => {\n return css`\n ${!showTitle &&\n css`\n visibility: hidden;\n `}\n margin: ${theme.base.spacing} 0 0 0;\n `;\n});\n\nStyledCategory.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.ol<{ category?: CategoriesProps | undefined; id: string }>(\n ({ category, theme, id }) => {\n return css`\n margin-block-start: ${theme.base.spacing};\n margin-block-end: calc(2 * ${theme.base.spacing});\n list-style-type: none;\n ${category?.elementId !== id &&\n ` min-height: ${category?.height ? `${category.height}px` : 'auto'};\n `}\n `;\n }\n);\n\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledParallelTitle = styled.div(({ theme }) => {\n return css`\n position: relative;\n z-index: 1;\n margin-block-end: 0.5rem;\n text-align: center;\n &::before {\n border-block-start: calc(0.2 * ${theme.base.spacing}) solid ${theme.base.colors.slate.medium};\n content: '';\n margin: 0 auto;\n position: absolute;\n top: 50%;\n left: 0;\n right: 0;\n bottom: 0;\n width: 100%;\n z-index: -1;\n }\n span {\n background: ${theme.base.colors.slate.medium};\n padding: 0 ${theme.base.spacing};\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n color: ${theme.base.colors.white};\n text-transform: uppercase;\n }\n `;\n});\n\nStyledParallelTitle.defaultProps = defaultThemeProp;\n\nexport const StyledAddTask = styled.div(({ theme }) => {\n return css`\n > button {\n background: ${theme.base.palette['secondary-background']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n width: 100%;\n justify-content: flex-start;\n padding: calc(1 * ${theme.base.spacing}) calc(1.75 * ${theme.base.spacing});\n > div {\n margin: 0 calc(2 * ${theme.base.spacing});\n }\n }\n `;\n});\n\nStyledAddTask.defaultProps = defaultThemeProp;\n\nconst Category: FunctionComponent<CategoryProps & ForwardProps> = forwardRef(\n (\n {\n item,\n showTitle = false,\n stageItem,\n category,\n id,\n task,\n ...restProps\n }: PropsWithoutRef<CategoryProps>,\n ref: CategoryProps['ref']\n ) => {\n const { readOnly } = useContext(LifeCycleContext);\n let showAddTaskButton = true;\n const t = useI18n();\n\n if (task?.addTask?.showOnce && item?.tasks?.length !== 0) {\n showAddTaskButton = false;\n }\n // Callback for click of add task button\n const onAddTaskClick = (e: MouseEvent<HTMLButtonElement>) => {\n const param: LifeCycleActionParam = {\n category: item,\n stage: stageItem\n };\n task?.addTask.onAddTask?.(param, e);\n };\n\n return (\n <>\n {category?.label && (\n <StyledCategory showTitle={showTitle} tabIndex={-1} id={item?.categoryId}>\n {category?.label}\n </StyledCategory>\n )}\n <StyledList ref={ref} category={category} id={item?.id} data-id={item?.categoryId}>\n {item &&\n item.tasks.length !== 0 &&\n item.tasks.map((taskItem: TaskItemProps | TaskItemProps[], i: number) => {\n if (Array.isArray(taskItem)) {\n if (task && task.addTask && task.addTask.showOnce && taskItem.length !== 0) {\n showAddTaskButton = false;\n }\n\n return (\n // eslint-disable-next-line react/no-array-index-key\n <li key={i}>\n {i !== 0 && (\n <Flex as={StyledParallelTitle} container={{ justify: 'center' }}>\n <span>{t('parallel')}</span>\n </Flex>\n )}\n {taskItem.length > 0 && (\n <ol>\n {taskItem.map((parallelTask: TaskItemProps) => {\n return (\n <Task\n {...restProps}\n {...task}\n key={parallelTask.id}\n id={parallelTask.id}\n value={parallelTask.label}\n item={parallelTask}\n visual={parallelTask.visual}\n stageItem={stageItem}\n categoryItem={item}\n error={parallelTask.error}\n />\n );\n })}\n </ol>\n )}\n </li>\n );\n }\n return (\n <Task\n {...restProps}\n {...task}\n key={taskItem.id}\n id={taskItem.id}\n value={taskItem.label}\n item={taskItem}\n visual={taskItem.visual}\n stageItem={stageItem}\n categoryItem={item}\n onAddStep={task?.onAddStep}\n error={taskItem.error}\n />\n );\n })}\n {(showAddTaskButton || !item) && !readOnly && (\n <StyledAddTask>\n <Button\n variant='simple'\n label={t('add_noun', [task.addTask.title])}\n icon\n onClick={onAddTaskClick}\n >\n <Icon name='plus' />\n <div>{task.addTask.title}</div>\n </Button>\n </StyledAddTask>\n )}\n </StyledList>\n </>\n );\n }\n);\n\nexport default Category;\n"]}
@@ -2,7 +2,7 @@ import { MouseEvent, Ref } from 'react';
2
2
  import { Action, StatusProps, NoChildrenProp, BaseProps, FormControlProps } from '@pega/cosmos-react-core';
3
3
  import { ColorName } from '../../utils';
4
4
  import { LibraryItem } from '../ItemLibrary';
5
- export declare type StageType = 'start' | 'default' | 'default-wait' | 'resolution' | 'alternate' | 'alternate-wait';
5
+ export type StageType = 'start' | 'default' | 'default-wait' | 'resolution' | 'alternate' | 'alternate-wait';
6
6
  export interface StepItemProps {
7
7
  id: string;
8
8
  label: string;
@@ -28,15 +28,22 @@ export interface TaskItemProps {
28
28
  steps: StepItemProps[];
29
29
  }
30
30
  export interface StageItemProps {
31
+ /** Data model should have id of the stage item */
31
32
  id: string;
33
+ /** Data model should have the stage label */
32
34
  label: string;
35
+ /** Data model should have the categoryData array */
33
36
  categories: CategoryItemProps[];
37
+ /** Data model should have the stageType as below */
34
38
  type: StageType;
35
39
  error: string;
36
40
  }
37
41
  export interface CategoryItemProps {
42
+ /** Data model should have id of the stage item */
38
43
  id: string;
44
+ /** id to map with category items */
39
45
  categoryId: string;
46
+ /** Data model should have the categoryData array */
40
47
  tasks: TaskItemProps[] | TaskItemProps[][];
41
48
  }
42
49
  export interface CategoriesItemProps {
@@ -54,13 +61,17 @@ export interface StageProps extends Omit<FormControlProps, 'status' | 'id'> {
54
61
  onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;
55
62
  }
56
63
  export interface CategoriesProps extends CategoriesItemProps {
64
+ /** height property used to manipulate height of catergory dom */
57
65
  height?: number;
58
66
  elementId?: string;
59
67
  }
60
68
  export interface CategoryProps extends BaseProps, NoChildrenProp {
61
69
  ref?: Ref<HTMLOListElement>;
70
+ /** Pass the category items */
62
71
  item: CategoryItemProps;
72
+ /** Enable the title for categories */
63
73
  showTitle?: boolean;
74
+ /** Props of the categoryColumn */
64
75
  category?: CategoriesProps;
65
76
  /** Task component prop */
66
77
  task: TaskProps;
@@ -105,15 +116,25 @@ export interface LifeCycleAction extends Omit<Action, 'onClick'> {
105
116
  onClick: (param: LifeCycleActionParam, e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>) => void;
106
117
  }
107
118
  export interface LifeCycleProps extends BaseProps, NoChildrenProp {
119
+ /** Pass reference to the LifeCycleComponent */
108
120
  ref?: Ref<HTMLDivElement>;
121
+ /** Array of stages and its contents */
109
122
  items: StageItemProps[];
123
+ /** Array of alternate stages and its contents */
110
124
  alternateItems?: StageItemProps[];
125
+ /** Props for the task component */
111
126
  task: TaskProps[];
127
+ /** Props for the Stage component */
112
128
  stage: StageProps;
129
+ /** Props for the AlternatStage component */
113
130
  alternateStage: StageProps;
131
+ /** Props for the Cluster component */
114
132
  categories: CategoriesProps[];
133
+ /** Props for the Step component */
115
134
  step: StepProps[];
135
+ /** Call back function for on AddState */
116
136
  onAddStage: () => void;
137
+ /** Call back function to add alternate stages */
117
138
  onAddAlternateStage: () => void;
118
139
  /** Selected stage or task or step */
119
140
  selectedItemId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCycle.types.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,MAAM,EACN,WAAW,EAEX,cAAc,EACd,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,oBAAY,SAAS,GACjB,OAAO,GACP,SAAS,GACT,cAAc,GACd,YAAY,GACZ,WAAW,GACX,gBAAgB,CAAC;AAErB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,KAAK,EAAE,SAAS,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAE7B,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,EAAE,MAAM,CAAC;IAEd,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAEhC,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;A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iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC,KACpE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS,EAAE,cAAc;IAE/D,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAE1B,KAAK,EAAE,cAAc,EAAE,CAAC;IAExB,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;IAElC,IAAI,EAAE,SAAS,EAAE,CAAC;IAElB,KAAK,EAAE,UAAU,CAAC;IAElB,cAAc,EAAE,UAAU,CAAC;IAE3B,UAAU,EAAE,eAAe,EAAE,CAAC;IAE9B,IAAI,EAAE,SAAS,EAAE,CAAC;IAElB,UAAU,EAAE,MAAM,IAAI,CAAC;IAEvB,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,SAAS,CAAC;IACd,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AA6DD,eAAO,MAAM,YAAY,gBACV,SAAS,YACZ,SAAS,GAAG,IAAI,cACd,OAAO,GAAG,SAAS,cAoBhC,CAAC"}
1
+ {"version":3,"file":"LifeCycle.types.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAExC,OAAO,EACL,MAAM,EACN,WAAW,EAEX,cAAc,EACd,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OA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AAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,uCAAuC;IACvC,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,iDAAiD;IACjD,cAAc,CAAC,EAAE,cAAc,EAAE,CAAC;IAClC,mCAAmC;IACnC,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,oCAAoC;IACpC,KAAK,EAAE,UAAU,CAAC;IAClB,4CAA4C;IAC5C,cAAc,EAAE,UAAU,CAAC;IAC3B,sCAAsC;IACtC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,mCAAmC;IACnC,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,yCAAyC;IACzC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,iDAAiD;IACjD,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,qCAAqC;IACrC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,SAAS,CAAC;IACd,MAAM,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;CACH;AA6DD,eAAO,MAAM,YAAY,gBACV,SAAS,YACZ,SAAS,GAAG,IAAI,cACd,OAAO,GAAG,SAAS,cAoBhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCycle.types.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,IAAI,KAAK,EAInB,MAAM,yBAAyB,CAAC;AA8KjC,MAAM,iBAAiB,GAAiC;IACtD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,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QACpB,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI;YACnC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM;YACrC,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,KAAK;SACnB;KACF;CACF,CAAC;AAEF,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,WAAsB,EACtB,QAA0B,EAC1B,UAA+B,EAC/B,EAAE;IACF,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,WAAW,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC;IACrF,qCAAqC;IACrC,MAAM,MAAM,GAAc;QACxB,GAAG,gBAAgB;QACnB,MAAM,EAAE;YACN,GAAG,gBAAgB,CAAC,MAAM;SAC3B;KACF,CAAC;IAEF,IAAI,QAAQ,EAAE;QACZ,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,iBAAiB,CAAC,KAAK,CAAC;QAC7E,MAAM,CAAC,MAAM,CAAC,WAAW;YACvB,gBAAgB,CAAC,MAAM,CAAC,WAAW,IAAI,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC;KAC3E;IACD,IAAI,UAAU,EAAE;QACd,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;KACnC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import { MouseEvent, Ref } from 'react';\n\nimport {\n Action,\n StatusProps,\n WorkTheme as Theme,\n NoChildrenProp,\n BaseProps,\n FormControlProps\n} from '@pega/cosmos-react-core';\n\nimport { ColorName } from '../../utils';\nimport { LibraryItem } from '../ItemLibrary';\n\nexport type StageType =\n | 'start'\n | 'default'\n | 'default-wait'\n | 'resolution'\n | 'alternate'\n | 'alternate-wait';\n\nexport interface StepItemProps {\n id: string;\n label: string;\n visual: {\n color: ColorName;\n icon: string;\n label: string;\n imgurl: string;\n };\n status: { type?: StatusProps['variant'] | ''; label: string };\n error: string;\n}\n\nexport interface TaskItemProps {\n id: string;\n label: string;\n visual: {\n imgurl: string;\n };\n error: string;\n steps: StepItemProps[];\n}\n\nexport interface StageItemProps {\n /* Data model should have id of the stage item */\n id: string;\n /* Data model should have the stage label */\n label: string;\n /* Data model should have the categoryData array */\n categories: CategoryItemProps[];\n /* Data model should have the stageType as below */\n type: StageType;\n error: string;\n}\n\nexport interface CategoryItemProps {\n /* Data model should have id of the stage item */\n id: string;\n /* id to map with category items */\n categoryId: string;\n /* Data model should have the categoryData array */\n tasks: TaskItemProps[] | TaskItemProps[][];\n}\n\nexport interface CategoriesItemProps {\n label: string;\n id: string;\n}\n\nexport interface StageProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: Record<StageType, LifeCycleAction[]> | LifeCycleAction[];\n /** Callback for Add stage */\n onAddStage?: () => void;\n /** Callback for Adding alternate stage */\n onAddAlternateStage?: () => void;\n /** callback for Click of stage */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface CategoriesProps extends CategoriesItemProps {\n /* height property used to manipulate height of catergory dom */\n height?: number;\n elementId?: string;\n}\n\nexport interface CategoryProps extends BaseProps, NoChildrenProp {\n ref?: Ref<HTMLOListElement>;\n /* Pass the category items */\n item: CategoryItemProps;\n /* Enable the title for categories */\n showTitle?: boolean;\n /* Props of the categoryColumn */\n category?: CategoriesProps;\n /** Task component prop */\n task: TaskProps;\n /** Stage data - to be passed in callbacks */\n stageItem: StageItemProps;\n /** Id for the component */\n id: string;\n}\n\nexport interface TaskProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Tooltip for adding items to the task component */\n addStepTitle: string;\n /** Region for adding the task component */\n addTask: {\n title: string;\n showOnce: boolean;\n onAddTask?: LifeCycleAction['onClick'];\n };\n onAddStep?: (param: LifeCycleActionParam, selectedItem: LibraryItem) => void;\n /** callback for Click of a task */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n /** Types of Nodes */\n nodeLibrary: LibraryItem[];\n}\n\nexport interface StepProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** callback for Click of a step */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface LifeCycleActionParam {\n value?: string;\n stage?: StageItemProps;\n task?: TaskItemProps;\n category?: CategoryItemProps;\n step?: StepItemProps;\n type?: 'Stage' | 'Step' | 'Task' | 'Alternate Stage';\n routeTo?: string;\n}\n\nexport interface LifeCycleAction extends Omit<Action, 'onClick'> {\n onClick: (\n param: LifeCycleActionParam,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => void;\n}\n\nexport interface LifeCycleProps extends BaseProps, NoChildrenProp {\n /* Pass reference to the LifeCycleComponent */\n ref?: Ref<HTMLDivElement>;\n /* Array of stages and its contents */\n items: StageItemProps[];\n /* Array of alternate stages and its contents */\n alternateItems?: StageItemProps[];\n /* Props for the task component */\n task: TaskProps[];\n /* Props for the Stage component */\n stage: StageProps;\n /* Props for the AlternatStage component */\n alternateStage: StageProps;\n /* Props for the Cluster component */\n categories: CategoriesProps[];\n /* Props for the Step component */\n step: StepProps[];\n /* Call back function for on AddState */\n onAddStage: () => void;\n /* Call back function to add alternate stages */\n onAddAlternateStage: () => void;\n /** Selected stage or task or step */\n selectedItemId?: string;\n /** makes component read-only */\n readOnly?: boolean;\n}\n\nexport interface StageInfo {\n id: StageType;\n visual: {\n bgColor: string;\n bgHover: string;\n tailPointed?: boolean;\n headPointed?: boolean;\n };\n}\n\nconst StageTypeDefaults: Record<StageType, StageInfo> = {\n start: {\n id: 'start',\n visual: {\n bgColor: Theme.base.colors.blue.dark,\n bgHover: Theme.base.colors.blue.medium,\n tailPointed: false,\n headPointed: true\n }\n },\n default: {\n id: 'default',\n visual: {\n bgColor: Theme.base.colors.blue.medium,\n bgHover: Theme.base.colors.blue.light,\n tailPointed: true,\n headPointed: true\n }\n },\n 'default-wait': {\n id: 'default-wait',\n visual: {\n bgColor: Theme.base.colors.blue.medium,\n bgHover: Theme.base.colors.blue.light,\n tailPointed: true,\n headPointed: false\n }\n },\n resolution: {\n id: 'resolution',\n visual: {\n bgColor: Theme.base.colors.green.medium,\n bgHover: Theme.base.colors.green.light,\n tailPointed: true,\n headPointed: false\n }\n },\n alternate: {\n id: 'alternate',\n visual: {\n bgColor: Theme.base.colors.red.dark,\n bgHover: Theme.base.colors.red.medium,\n tailPointed: false,\n headPointed: false\n }\n },\n 'alternate-wait': {\n id: 'alternate-wait',\n visual: {\n bgColor: Theme.base.colors.red.dark,\n bgHover: Theme.base.colors.red.medium,\n tailPointed: false,\n headPointed: false\n }\n }\n};\n\n// calculates the final stage info based on prev type and returns the final stage info\n// second param is mandatory for accurate results, optional only for the first stage\nexport const getStageInfo = (\n currentType: StageType,\n prevType: StageType | null,\n isLastItem: boolean | undefined\n) => {\n const currentStageInfo = StageTypeDefaults[currentType] || StageTypeDefaults.default;\n // cloning, to avoid getting modified\n const result: StageInfo = {\n ...currentStageInfo,\n visual: {\n ...currentStageInfo.visual\n }\n };\n\n if (prevType) {\n const prevStageInfo = StageTypeDefaults[prevType] || StageTypeDefaults.start;\n result.visual.tailPointed =\n currentStageInfo.visual.tailPointed && prevStageInfo.visual.headPointed;\n }\n if (isLastItem) {\n result.visual.headPointed = false;\n }\n return result;\n};\n"]}
1
+ {"version":3,"file":"LifeCycle.types.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,SAAS,IAAI,KAAK,EAInB,MAAM,yBAAyB,CAAC;AA8KjC,MAAM,iBAAiB,GAAiC;IACtD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,MAAM,EA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SACnB;KACF;IACD,gBAAgB,EAAE;QAChB,EAAE,EAAE,gBAAgB;QACpB,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI;YACnC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM;YACrC,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,KAAK;SACnB;KACF;CACF,CAAC;AAEF,sFAAsF;AACtF,oFAAoF;AACpF,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,WAAsB,EACtB,QAA0B,EAC1B,UAA+B,EAC/B,EAAE;IACF,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,WAAW,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC;IACrF,qCAAqC;IACrC,MAAM,MAAM,GAAc;QACxB,GAAG,gBAAgB;QACnB,MAAM,EAAE;YACN,GAAG,gBAAgB,CAAC,MAAM;SAC3B;KACF,CAAC;IAEF,IAAI,QAAQ,EAAE;QACZ,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,iBAAiB,CAAC,KAAK,CAAC;QAC7E,MAAM,CAAC,MAAM,CAAC,WAAW;YACvB,gBAAgB,CAAC,MAAM,CAAC,WAAW,IAAI,aAAa,CAAC,MAAM,CAAC,WAAW,CAAC;KAC3E;IACD,IAAI,UAAU,EAAE;QACd,MAAM,CAAC,MAAM,CAAC,WAAW,GAAG,KAAK,CAAC;KACnC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import { MouseEvent, Ref } from 'react';\n\nimport {\n Action,\n StatusProps,\n WorkTheme as Theme,\n NoChildrenProp,\n BaseProps,\n FormControlProps\n} from '@pega/cosmos-react-core';\n\nimport { ColorName } from '../../utils';\nimport { LibraryItem } from '../ItemLibrary';\n\nexport type StageType =\n | 'start'\n | 'default'\n | 'default-wait'\n | 'resolution'\n | 'alternate'\n | 'alternate-wait';\n\nexport interface StepItemProps {\n id: string;\n label: string;\n visual: {\n color: ColorName;\n icon: string;\n label: string;\n imgurl: string;\n };\n status: { type?: StatusProps['variant'] | ''; label: string };\n error: string;\n}\n\nexport interface TaskItemProps {\n id: string;\n label: string;\n visual: {\n imgurl: string;\n };\n error: string;\n steps: StepItemProps[];\n}\n\nexport interface StageItemProps {\n /** Data model should have id of the stage item */\n id: string;\n /** Data model should have the stage label */\n label: string;\n /** Data model should have the categoryData array */\n categories: CategoryItemProps[];\n /** Data model should have the stageType as below */\n type: StageType;\n error: string;\n}\n\nexport interface CategoryItemProps {\n /** Data model should have id of the stage item */\n id: string;\n /** id to map with category items */\n categoryId: string;\n /** Data model should have the categoryData array */\n tasks: TaskItemProps[] | TaskItemProps[][];\n}\n\nexport interface CategoriesItemProps {\n label: string;\n id: string;\n}\n\nexport interface StageProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: Record<StageType, LifeCycleAction[]> | LifeCycleAction[];\n /** Callback for Add stage */\n onAddStage?: () => void;\n /** Callback for Adding alternate stage */\n onAddAlternateStage?: () => void;\n /** callback for Click of stage */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface CategoriesProps extends CategoriesItemProps {\n /** height property used to manipulate height of catergory dom */\n height?: number;\n elementId?: string;\n}\n\nexport interface CategoryProps extends BaseProps, NoChildrenProp {\n ref?: Ref<HTMLOListElement>;\n /** Pass the category items */\n item: CategoryItemProps;\n /** Enable the title for categories */\n showTitle?: boolean;\n /** Props of the categoryColumn */\n category?: CategoriesProps;\n /** Task component prop */\n task: TaskProps;\n /** Stage data - to be passed in callbacks */\n stageItem: StageItemProps;\n /** Id for the component */\n id: string;\n}\n\nexport interface TaskProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Tooltip for adding items to the task component */\n addStepTitle: string;\n /** Region for adding the task component */\n addTask: {\n title: string;\n showOnce: boolean;\n onAddTask?: LifeCycleAction['onClick'];\n };\n onAddStep?: (param: LifeCycleActionParam, selectedItem: LibraryItem) => void;\n /** callback for Click of a task */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n /** Types of Nodes */\n nodeLibrary: LibraryItem[];\n}\n\nexport interface StepProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** callback for Click of a step */\n onClick?: (param: LifeCycleActionParam, e: MouseEvent) => void;\n}\n\nexport interface LifeCycleActionParam {\n value?: string;\n stage?: StageItemProps;\n task?: TaskItemProps;\n category?: CategoryItemProps;\n step?: StepItemProps;\n type?: 'Stage' | 'Step' | 'Task' | 'Alternate Stage';\n routeTo?: string;\n}\n\nexport interface LifeCycleAction extends Omit<Action, 'onClick'> {\n onClick: (\n param: LifeCycleActionParam,\n e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>\n ) => void;\n}\n\nexport interface LifeCycleProps extends BaseProps, NoChildrenProp {\n /** Pass reference to the LifeCycleComponent */\n ref?: Ref<HTMLDivElement>;\n /** Array of stages and its contents */\n items: StageItemProps[];\n /** Array of alternate stages and its contents */\n alternateItems?: StageItemProps[];\n /** Props for the task component */\n task: TaskProps[];\n /** Props for the Stage component */\n stage: StageProps;\n /** Props for the AlternatStage component */\n alternateStage: StageProps;\n /** Props for the Cluster component */\n categories: CategoriesProps[];\n /** Props for the Step component */\n step: StepProps[];\n /** Call back function for on AddState */\n onAddStage: () => void;\n /** Call back function to add alternate stages */\n onAddAlternateStage: () => void;\n /** Selected stage or task or step */\n selectedItemId?: string;\n /** makes component read-only */\n readOnly?: boolean;\n}\n\nexport interface StageInfo {\n id: StageType;\n visual: {\n bgColor: string;\n bgHover: string;\n tailPointed?: boolean;\n headPointed?: boolean;\n };\n}\n\nconst StageTypeDefaults: Record<StageType, StageInfo> = {\n start: {\n id: 'start',\n visual: {\n bgColor: Theme.base.colors.blue.dark,\n bgHover: Theme.base.colors.blue.medium,\n tailPointed: false,\n headPointed: true\n }\n },\n default: {\n id: 'default',\n visual: {\n bgColor: Theme.base.colors.blue.medium,\n bgHover: Theme.base.colors.blue.light,\n tailPointed: true,\n headPointed: true\n }\n },\n 'default-wait': {\n id: 'default-wait',\n visual: {\n bgColor: Theme.base.colors.blue.medium,\n bgHover: Theme.base.colors.blue.light,\n tailPointed: true,\n headPointed: false\n }\n },\n resolution: {\n id: 'resolution',\n visual: {\n bgColor: Theme.base.colors.green.medium,\n bgHover: Theme.base.colors.green.light,\n tailPointed: true,\n headPointed: false\n }\n },\n alternate: {\n id: 'alternate',\n visual: {\n bgColor: Theme.base.colors.red.dark,\n bgHover: Theme.base.colors.red.medium,\n tailPointed: false,\n headPointed: false\n }\n },\n 'alternate-wait': {\n id: 'alternate-wait',\n visual: {\n bgColor: Theme.base.colors.red.dark,\n bgHover: Theme.base.colors.red.medium,\n tailPointed: false,\n headPointed: false\n }\n }\n};\n\n// calculates the final stage info based on prev type and returns the final stage info\n// second param is mandatory for accurate results, optional only for the first stage\nexport const getStageInfo = (\n currentType: StageType,\n prevType: StageType | null,\n isLastItem: boolean | undefined\n) => {\n const currentStageInfo = StageTypeDefaults[currentType] || StageTypeDefaults.default;\n // cloning, to avoid getting modified\n const result: StageInfo = {\n ...currentStageInfo,\n visual: {\n ...currentStageInfo.visual\n }\n };\n\n if (prevType) {\n const prevStageInfo = StageTypeDefaults[prevType] || StageTypeDefaults.start;\n result.visual.tailPointed =\n currentStageInfo.visual.tailPointed && prevStageInfo.visual.headPointed;\n }\n if (isLastItem) {\n result.visual.headPointed = false;\n }\n return result;\n};\n"]}
@@ -2,16 +2,27 @@ import { FunctionComponent, Ref } from 'react';
2
2
  import { NoChildrenProp } from '@pega/cosmos-react-core';
3
3
  import { StageItemProps, TaskProps, StepProps, CategoriesProps, StageType, StageProps } from './LifeCycle.types';
4
4
  export interface LifeCycleListProps extends NoChildrenProp {
5
+ /** Pass reference to the LifeCycleComponent */
5
6
  ref?: Ref<HTMLOListElement>;
7
+ /** Array of categories column props */
6
8
  categories: CategoriesProps[];
9
+ /** Array of Task props */
7
10
  task: TaskProps[];
11
+ /** Array of Step props */
8
12
  stage?: StageProps;
13
+ /** Array of Stage props */
9
14
  step?: StepProps[];
15
+ /** Data model should be have stages array */
10
16
  item: StageItemProps;
17
+ /** Count of number of stages */
11
18
  isFirstItem?: boolean;
19
+ /** Index of stages item */
12
20
  isLastItem?: boolean;
21
+ /** type of stage */
13
22
  stageVariant?: StageType;
23
+ /** type of previous stage */
14
24
  prevStageVariant: StageType;
25
+ /** id for the list item */
15
26
  id?: string;
16
27
  }
17
28
  declare const LifeCycleList: FunctionComponent<LifeCycleListProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCycleList.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycleList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAoB,cAAc,EAA2B,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EACL,cAAc,EAEd,SAAS,EACT,SAAS,EAET,eAAe,EACf,SAAS,EACT,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IAExD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAE5B,UAAU,EAAE,eAAe,EAAE,CAAC;IAE9B,IAAI,EAAE,SAAS,EAAE,CAAC;IAElB,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IAEnB,IAAI,EAAE,cAAc,CAAC;IAErB,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,gBAAgB,EAAE,SAAS,CAAC;IAE5B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAsBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CA+FxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"LifeCycleList.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycleList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAG3D,OAAO,EAAoB,cAAc,EAA2B,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EACL,cAAc,EAEd,SAAS,EACT,SAAS,EAET,eAAe,EACf,SAAS,EACT,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,+CAA+C;IAC/C,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,wCAAwC;IACxC,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,0BAA0B;IAC1B,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2BAA2B;IAC3B,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACnB,6CAA6C;IAC7C,IAAI,EAAE,cAAc,CAAC;IACrB,gCAAgC;IAChC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB;IACpB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,6BAA6B;IAC7B,gBAAgB,EAAE,SAAS,CAAC;IAC5B,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAsBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CA+FxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -28,7 +28,7 @@ const LifeCycleList = forwardRef(({ item, isFirstItem, isLastItem, categories, s
28
28
  const showTitle = isFirstItem || false;
29
29
  let sortedCategory = [];
30
30
  const listId = id || createUID();
31
- /* Function used to rearrange the category data depends on Categories order */
31
+ // Function used to rearrange the category data depends on Categories order
32
32
  const catgoryItem = (categoryData) => {
33
33
  const sortedColumn = [];
34
34
  if (categories && categories.length > 0 && categoryData.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCycleList.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycleList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,OAAO,CAAC;AAC3D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAkB,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEpG,OAAO,EAKL,YAAY,EAIb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,QAAQ,MAAM,YAAY,CAAC;AA0BlC,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAoC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/F,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,GAAG,CAAA;;iBAEK,KAAK,CAAC,IAAI,CAAC,OAAO;;MAE7B,QAAQ;QACV,GAAG,CAAA;8BACuB,KAAK,CAAC,IAAI,CAAC,OAAO;KAC3C;MACC,QAAQ;QACV,GAAG;QACH,GAAG,CAAA;mBACY,KAAK,CAAC,IAAI,CAAC,OAAO,iBAAiB,KAAK,CAAC,IAAI,CAAC,OAAO;KACnE;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,aAAa,GAA0C,UAAU,CACrE,CACE,EACE,IAAI,EACJ,WAAW,EACX,UAAU,EACV,UAAU,EACV,KA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CAAC,KAjDoB,MAAM,CAkDV,CACvB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, NoChildrenProp, createUID, useDirection } from '@pega/cosmos-react-core';\n\nimport {\n StageItemProps,\n CategoryItemProps,\n TaskProps,\n StepProps,\n getStageInfo,\n CategoriesProps,\n StageType,\n StageProps\n} from './LifeCycle.types';\nimport Stage from './Stage';\nimport Category from './Category';\n\nexport interface LifeCycleListProps extends NoChildrenProp {\n /* Pass reference to the LifeCycleComponent */\n ref?: Ref<HTMLOListElement>;\n /* Array of categories column props */\n categories: CategoriesProps[];\n /* Array of Task props */\n task: TaskProps[];\n /* Array of Step props */\n stage?: StageProps;\n /* Array of Stage props */\n step?: StepProps[];\n /* Data model should be have stages array */\n item: StageItemProps;\n /* Count of number of stages */\n isFirstItem?: boolean;\n /* Index of stages item */\n isLastItem?: boolean;\n /* type of stages */\n stageVariant?: StageType;\n prevStageVariant: StageType;\n /* id for the list item */\n id?: string;\n}\n\nconst StyledLifeCycleList = styled.li<{ lastItem: boolean | undefined }>(({ theme, lastItem }) => {\n const { rtl } = useDirection();\n return css`\n list-style-type: none;\n padding: 0 ${theme.base.spacing} 0 0;\n width: 15rem;\n ${lastItem &&\n css`\n padding: 0 calc(0.5 * ${theme.base.spacing}) 0 0;\n `}\n ${lastItem &&\n rtl &&\n css`\n padding: 0 ${theme.base.spacing} 0 calc(0.5 * ${theme.base.spacing});\n `}\n `;\n});\n\nStyledLifeCycleList.defaultProps = defaultThemeProp;\n\nconst LifeCycleList: FunctionComponent<LifeCycleListProps> = forwardRef(\n (\n {\n item,\n isFirstItem,\n isLastItem,\n categories,\n stage: stageProps,\n task,\n step,\n prevStageVariant,\n stageVariant,\n id,\n ...restProps\n }: LifeCycleListProps,\n ref: LifeCycleListProps['ref']\n ) => {\n const showTitle = isFirstItem || false;\n let sortedCategory: CategoryItemProps[] = [];\n const listId = id || createUID();\n\n /* Function used to rearrange the category data depends on Categories order */\n const catgoryItem = (categoryData: CategoryItemProps[]) => {\n const sortedColumn: CategoryItemProps[] = [];\n if (categories && categories.length > 0 && categoryData.length > 0) {\n categories.forEach(categoryColumnItem => {\n categoryData.forEach((categoryItem: CategoryItemProps) => {\n if (categoryItem.categoryId === categoryColumnItem.id) {\n sortedColumn.push(categoryItem);\n }\n });\n });\n }\n return sortedColumn;\n };\n\n if (categories && categories.length !== 0) {\n sortedCategory = catgoryItem(item.categories);\n }\n\n const stageInfo = getStageInfo(item.type, prevStageVariant, isLastItem);\n return (\n <StyledLifeCycleList key={listId} lastItem={isLastItem}>\n <Stage\n value={item.label}\n stageInfo={stageInfo}\n item={item}\n error={item.error}\n id={item.id}\n {...stageProps}\n />\n {sortedCategory.length !== 0 &&\n sortedCategory.map((categoryItem: CategoryItemProps, categoryindex: number) => {\n const taskProps = task[categoryindex];\n let stepProps;\n if (step) stepProps = step[categoryindex];\n return (\n <Category\n {...restProps}\n key={categoryItem.categoryId}\n id={categoryItem.categoryId}\n ref={ref}\n category={categories[categoryindex]}\n item={categoryItem}\n showTitle={showTitle}\n stageItem={item}\n task={taskProps}\n step={stepProps}\n />\n );\n })}\n {sortedCategory.length === 0 &&\n categories.length === 0 &&\n item.categories.length > 0 &&\n item.categories.map((categoryItem: CategoryItemProps, categoryindex: number) => {\n const taskProps = task[categoryindex];\n let stepProps;\n if (step) stepProps = step[categoryindex];\n\n return (\n <Category\n key={categoryItem.categoryId}\n id={categoryItem.categoryId}\n ref={ref}\n item={categoryItem}\n stageItem={item}\n task={taskProps}\n step={stepProps}\n showTitle={showTitle}\n />\n );\n })}\n </StyledLifeCycleList>\n );\n }\n);\n\nexport default LifeCycleList;\n"]}
1
+ {"version":3,"file":"LifeCycleList.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycleList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAA0B,MA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AAU,EAC5B,EAAE,EAAE,YAAY,CAAC,UAAU,EAC3B,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,UAAU,CAAC,aAAa,CAAC,EACnC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,SAAS,GACf,CACH,CAAC;gBACJ,CAAC,CAAC,EACH,cAAc,CAAC,MAAM,KAAK,CAAC;gBAC1B,UAAU,CAAC,MAAM,KAAK,CAAC;gBACvB,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;gBAC1B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,YAA+B,EAAE,aAAqB,EAAE,EAAE;oBAC7E,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;oBACtC,IAAI,SAAS,CAAC;oBACd,IAAI,IAAI;wBAAE,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;oBAE1C,OAAO,CACL,KAAC,QAAQ,IAEP,EAAE,EAAE,YAAY,CAAC,UAAU,EAC3B,GAAG,EAAE,GAAG,EACR,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,SAAS,EACf,SAAS,EAAE,SAAS,IAPf,YAAY,CAAC,UAAU,CAQ5B,CACH,CAAC;gBACJ,CAAC,CAAC,KAjDoB,MAAM,CAkDV,CACvB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp, NoChildrenProp, createUID, useDirection } from '@pega/cosmos-react-core';\n\nimport {\n StageItemProps,\n CategoryItemProps,\n TaskProps,\n StepProps,\n getStageInfo,\n CategoriesProps,\n StageType,\n StageProps\n} from './LifeCycle.types';\nimport Stage from './Stage';\nimport Category from './Category';\n\nexport interface LifeCycleListProps extends NoChildrenProp {\n /** Pass reference to the LifeCycleComponent */\n ref?: Ref<HTMLOListElement>;\n /** Array of categories column props */\n categories: CategoriesProps[];\n /** Array of Task props */\n task: TaskProps[];\n /** Array of Step props */\n stage?: StageProps;\n /** Array of Stage props */\n step?: StepProps[];\n /** Data model should be have stages array */\n item: StageItemProps;\n /** Count of number of stages */\n isFirstItem?: boolean;\n /** Index of stages item */\n isLastItem?: boolean;\n /** type of stage */\n stageVariant?: StageType;\n /** type of previous stage */\n prevStageVariant: StageType;\n /** id for the list item */\n id?: string;\n}\n\nconst StyledLifeCycleList = styled.li<{ lastItem: boolean | undefined }>(({ theme, lastItem }) => {\n const { rtl } = useDirection();\n return css`\n list-style-type: none;\n padding: 0 ${theme.base.spacing} 0 0;\n width: 15rem;\n ${lastItem &&\n css`\n padding: 0 calc(0.5 * ${theme.base.spacing}) 0 0;\n `}\n ${lastItem &&\n rtl &&\n css`\n padding: 0 ${theme.base.spacing} 0 calc(0.5 * ${theme.base.spacing});\n `}\n `;\n});\n\nStyledLifeCycleList.defaultProps = defaultThemeProp;\n\nconst LifeCycleList: FunctionComponent<LifeCycleListProps> = forwardRef(\n (\n {\n item,\n isFirstItem,\n isLastItem,\n categories,\n stage: stageProps,\n task,\n step,\n prevStageVariant,\n stageVariant,\n id,\n ...restProps\n }: LifeCycleListProps,\n ref: LifeCycleListProps['ref']\n ) => {\n const showTitle = isFirstItem || false;\n let sortedCategory: CategoryItemProps[] = [];\n const listId = id || createUID();\n\n // Function used to rearrange the category data depends on Categories order\n const catgoryItem = (categoryData: CategoryItemProps[]) => {\n const sortedColumn: CategoryItemProps[] = [];\n if (categories && categories.length > 0 && categoryData.length > 0) {\n categories.forEach(categoryColumnItem => {\n categoryData.forEach((categoryItem: CategoryItemProps) => {\n if (categoryItem.categoryId === categoryColumnItem.id) {\n sortedColumn.push(categoryItem);\n }\n });\n });\n }\n return sortedColumn;\n };\n\n if (categories && categories.length !== 0) {\n sortedCategory = catgoryItem(item.categories);\n }\n\n const stageInfo = getStageInfo(item.type, prevStageVariant, isLastItem);\n return (\n <StyledLifeCycleList key={listId} lastItem={isLastItem}>\n <Stage\n value={item.label}\n stageInfo={stageInfo}\n item={item}\n error={item.error}\n id={item.id}\n {...stageProps}\n />\n {sortedCategory.length !== 0 &&\n sortedCategory.map((categoryItem: CategoryItemProps, categoryindex: number) => {\n const taskProps = task[categoryindex];\n let stepProps;\n if (step) stepProps = step[categoryindex];\n return (\n <Category\n {...restProps}\n key={categoryItem.categoryId}\n id={categoryItem.categoryId}\n ref={ref}\n category={categories[categoryindex]}\n item={categoryItem}\n showTitle={showTitle}\n stageItem={item}\n task={taskProps}\n step={stepProps}\n />\n );\n })}\n {sortedCategory.length === 0 &&\n categories.length === 0 &&\n item.categories.length > 0 &&\n item.categories.map((categoryItem: CategoryItemProps, categoryindex: number) => {\n const taskProps = task[categoryindex];\n let stepProps;\n if (step) stepProps = step[categoryindex];\n\n return (\n <Category\n key={categoryItem.categoryId}\n id={categoryItem.categoryId}\n ref={ref}\n item={categoryItem}\n stageItem={item}\n task={taskProps}\n step={stepProps}\n showTitle={showTitle}\n />\n );\n })}\n </StyledLifeCycleList>\n );\n }\n);\n\nexport default LifeCycleList;\n"]}
@@ -5,11 +5,13 @@ export interface StageComponentProps extends BaseProps, StageProps {
5
5
  ref?: Ref<HTMLDivElement>;
6
6
  /** Pass text for the task. */
7
7
  value: string;
8
+ /** unique id of the component */
8
9
  id: string;
9
10
  /** Controls the styling of the stage. */
10
11
  stageInfo: StageInfo;
11
12
  /** Full data object which can be passed to the callback */
12
13
  item: StageItemProps;
14
+ /** The status is used to show the input error status and the info on tooltip in case of error */
13
15
  error?: string;
14
16
  }
15
17
  export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
@@ -1 +1 @@
1
- {"version":3,"file":"Stage.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Stage.tsx"],"names":[],"mappings":"AAAA,OAAO,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,CAAC;IAC1B,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,iCAAiC;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,2DAA2D;IAC3D,IAAI,EAAE,cAAc,CAAC;IACrB,iGAAiG;IACjG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAIF,eAAO,MAAM,iBAAiB;WACrB,MAAM,GAAG,SAAS;SAyBzB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAE9B,CAAC;AAIF,eAAO,MAAM,cAAc,iLAQzB,CAAC;AAIH,eAAO,MAAM,WAAW;YAEZ,OAAO;WACR,MAAM;SAsIf,CAAC;AAIH,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAuGhE,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -1,8 +1,8 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import { readableColor } from 'polished';
5
- import { Flex, Actions, Tooltip, useElement, defaultThemeProp, useDirection, StyledButton, Icon, useI18n } from '@pega/cosmos-react-core';
5
+ import { Flex, Actions, defaultThemeProp, useDirection, StyledButton, Icon, useI18n } from '@pega/cosmos-react-core';
6
6
  export const StyledWrapper = styled.div `
7
7
  overflow: hidden;
8
8
  `;
@@ -44,11 +44,6 @@ export const StyledWarnIcon = styled(Icon)(({ theme }) => {
44
44
  &:hover {
45
45
  cursor: pointer;
46
46
  }
47
-
48
- &:focus {
49
- outline: none;
50
- box-shadow: ${theme.base.shadow.focus};
51
- }
52
47
  `;
53
48
  });
54
49
  StyledWarnIcon.defaultProps = defaultThemeProp;
@@ -184,7 +179,6 @@ export const StyledStage = styled.div(({ stageInfo, theme, status, error }) => {
184
179
  StyledStage.defaultProps = defaultThemeProp;
185
180
  const Stage = forwardRef(({ value, actions, stageInfo, onClick, id, item, error, ...restProps }, ref) => {
186
181
  const t = useI18n();
187
- const [errorIcon, setErrorIcon] = useElement();
188
182
  const onStageClick = (e) => {
189
183
  const actionParam = {
190
184
  value,
@@ -212,7 +206,7 @@ const Stage = forwardRef(({ value, actions, stageInfo, onClick, id, item, error,
212
206
  });
213
207
  }
214
208
  };
215
- /* Deep copy of actions object is required to provide consistent callback objects on actions */
209
+ // Deep copy of actions object is required to provide consistent callback objects on actions
216
210
  const actionsClone = [];
217
211
  if (actions) {
218
212
  let actionsList = [];
@@ -232,7 +226,7 @@ const Stage = forwardRef(({ value, actions, stageInfo, onClick, id, item, error,
232
226
  return actionItem;
233
227
  });
234
228
  }
235
- return (_jsxs(Flex, { ...restProps, container: { inline: true, alignItems: 'center' }, as: StyledStage, ref: ref, error: error, stageInfo: stageInfo, id: item.id, children: [error && (_jsxs(_Fragment, { children: [_jsx(StyledWarnIcon, { ref: setErrorIcon, role: 'status', tabIndex: '0', "aria-label": t('item_error', [error]), name: 'warn-solid' }), _jsx(Tooltip, { target: errorIcon, "aria-hidden": !!error, hideDelay: 'none', children: error })] })), _jsx(Flex, { as: StyledWrapper, container: { inline: true }, item: { grow: 1 }, onClick: onStageClick, children: _jsx(StyledStageButton, { error: error, "aria-label": t('stage_name', [value]), children: value }) }), _jsx(StyledStageActions, { children: actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }) })] }));
229
+ return (_jsxs(Flex, { ...restProps, container: { inline: true, alignItems: 'center' }, as: StyledStage, ref: ref, error: error, stageInfo: stageInfo, id: item.id, "aria-label": error ? t('stage_name_error', [value]) : undefined, children: [error && _jsx(StyledWarnIcon, { name: 'warn-solid' }), _jsx(Flex, { as: StyledWrapper, container: { inline: true }, item: { grow: 1 }, onClick: onStageClick, children: _jsx(StyledStageButton, { error: error, "aria-label": error ? undefined : t('stage_name', [value]), children: value }) }), _jsx(StyledStageActions, { children: actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }) })] }));
236
230
  });
237
231
  export default Stage;
238
232
  //# sourceMappingURL=Stage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stage.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Stage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyD,MAAM,OAAO,CAAC;AAC1F,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,IAAI,EAGJ,OAAO,EACP,OAAO,EACP,UAAU,EACV,gBAAgB,EAChB,YAAY,EAEZ,YAAY,EACZ,IAAI,EACJ,OAAO,EACR,MAAM,yBAAyB,CAAC;AAwBjC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEtC,CAAC;AAEF,aAAa,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAE3C,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IACtB,OAAO,GAAG,CAAA;cACE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM;;;;;;;2BAOjB,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEvC,KAAK;QACP,GAAG,CAAA;;KAEF;;;;;;;;;GASF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAA;;CAE3C,CAAC;AAEF,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,E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E,KAAK,gBAAc,CAAC,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,YAClE,KAAK,GACY,GACf,EACP,KAAC,kBAAkB,cAChB,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,SAAG,GAClD,IAChB,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithChildren, Ref, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Flex,\n BaseProps,\n ForwardProps,\n Actions,\n Tooltip,\n useElement,\n defaultThemeProp,\n useDirection,\n Action,\n StyledButton,\n Icon,\n useI18n\n} from '@pega/cosmos-react-core';\n\nimport {\n LifeCycleAction,\n LifeCycleActionParam,\n StageInfo,\n StageItemProps,\n StageProps\n} from './LifeCycle.types';\n\nexport interface StageComponentProps extends BaseProps, StageProps {\n ref?: Ref<HTMLDivElement>;\n /** Pass text for the task. */\n value: string;\n /* unique id of the component */\n id: string;\n /** Controls the styling of the stage. */\n stageInfo: StageInfo;\n /** Full data object which can be passed to the callback */\n item: StageItemProps;\n /* The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n}\n\nexport const StyledWrapper = styled.div`\n overflow: hidden;\n`;\n\nStyledWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStageButton = styled.button<{\n error: string | undefined;\n}>(({ error, theme }) => {\n return css`\n height: ${theme.components.button.height};\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n margin-inline-start: ${theme.base.spacing};\n\n ${error &&\n css`\n margin-inline-start: 0;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n `;\n});\n\nStyledStageButton.defaultProps = defaultThemeProp;\n\nexport const StyledStageActions = styled.div`\n z-index: 2;\n`;\n\nStyledStageActions.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n margin-inline: calc(0.5 * ${theme.base.spacing});\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n box-shadow: ${theme.base.shadow.focus};\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledStage = styled.div<\n Pick<StageComponentProps, 'stageInfo'> & {\n status: boolean;\n error: string;\n }\n>(({ stageInfo, theme, status, error }) => {\n const {\n visual: { bgColor, tailPointed, headPointed }\n } = stageInfo;\n\n const { rtl } = useDirection();\n const contrastColor = readableColor(bgColor);\n const roundedEndsStyles = css`\n content: '';\n position: absolute;\n display: block;\n width: calc(3 * ${theme.base.spacing});\n height: calc(3 * ${theme.base.spacing});\n top: calc(1 * ${theme.base.spacing});\n border: 0;\n border-inline-end: 0.0625rem solid transparent;\n `;\n\n return css`\n position: relative;\n padding: calc(0.5 * ${theme.base.spacing});\n background: ${bgColor};\n border: 0.0625rem solid transparent;\n width: 100%;\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus-within {\n border: 0.0625rem solid ${theme.base.palette.interactive};\n\n ${headPointed &&\n css`\n &::after {\n border-inline-end: 0.0625rem solid ${theme.base.palette.interactive};\n ${rtl\n ? css`\n border-block-start: 0.0625rem solid ${theme.base.palette.interactive};\n `\n : css`\n border-block-end: 0.0625rem solid ${theme.base.palette.interactive};\n `}\n }\n `}\n\n ${tailPointed &&\n css`\n &::before {\n border-inline-end: 0.0625rem solid ${theme.base.palette.interactive};\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid ${theme.base.palette.interactive};\n `\n : css`\n border-block-start: 0.0625rem solid ${theme.base.palette.interactive};\n `}\n }\n `}\n }\n\n ${headPointed &&\n css`\n &::after {\n ${roundedEndsStyles}\n z-index: 1;\n background: inherit;\n transform: rotateZ(-45deg) skew(-15deg, -15deg);\n inset-inline-end: calc(1.6 * ${theme.base.spacing} * -1);\n border-block-end: 0.0625rem solid transparent;\n ${rtl\n ? css`\n border-radius: calc(0.75 * ${theme.base['border-radius']}) 0.1rem 0.1rem 0.1rem;\n `\n : css`\n border-radius: 0.0625rem 0.075rem calc(0.75 * ${theme.base['border-radius']})\n 0.0625rem;\n `}\n }\n `}\n\n ${tailPointed &&\n css`\n ${!error &&\n css`\n ${StyledStageButton} {\n margin-inline-start: calc(1.5 * ${theme.base.spacing});\n }\n `}\n\n ${error &&\n css`\n ${StyledWarnIcon} {\n margin-inline-start: ${theme.base.spacing};\n }\n `}\n\n &::before {\n ${roundedEndsStyles}\n background: ${theme.base.palette['app-background']};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n inset-inline-start: calc(-1.6 * ${theme.base.spacing});\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid transparent;\n border-radius: 0.0625rem 1rem 0.0625rem calc(0.75 * ${theme.base['border-radius']});\n `\n : css`\n border-block-start: 0.0625rem solid transparent;\n border-radius: 0.0625rem calc(0.75 * ${theme.base['border-radius']}) 0.0625rem 1rem;\n `}\n }\n `}\n\n ${StyledWarnIcon} {\n color: ${contrastColor};\n }\n\n ${StyledStageActions} {\n & > ${StyledButton} {\n color: ${contrastColor};\n }\n }\n\n ${StyledStageButton} {\n color: ${contrastColor};\n ${!status &&\n css`\n background: ${bgColor};\n `}\n }\n `;\n});\n\nStyledStage.defaultProps = defaultThemeProp;\n\nconst Stage: FunctionComponent<StageComponentProps & ForwardProps> = forwardRef(\n (\n {\n value,\n actions,\n stageInfo,\n onClick,\n id,\n item,\n error,\n ...restProps\n }: PropsWithChildren<StageComponentProps>,\n ref: StageComponentProps['ref']\n ) => {\n const t = useI18n();\n const [errorIcon, setErrorIcon] = useElement();\n\n const onStageClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n stage: item,\n type: 'Stage'\n };\n onClick?.(actionParam, e);\n };\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n stage: item\n };\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList?.forEach((actionItem: LifeCycleAction) => {\n if (actionItem.id === actionId) {\n actionItem.onClick?.(param, e);\n }\n });\n }\n };\n\n /* Deep copy of actions object is required to provide consistent callback objects on actions */\n const actionsClone: Action[] = [];\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n return (\n <Flex\n {...restProps}\n container={{ inline: true, alignItems: 'center' }}\n as={StyledStage}\n ref={ref}\n error={error}\n stageInfo={stageInfo}\n id={item.id}\n >\n {error && (\n <>\n <StyledWarnIcon\n ref={setErrorIcon}\n role='status'\n tabIndex='0'\n aria-label={t('item_error', [error])}\n name='warn-solid'\n />\n <Tooltip target={errorIcon} aria-hidden={!!error} hideDelay='none'>\n {error}\n </Tooltip>\n </>\n )}\n <Flex\n as={StyledWrapper}\n container={{ inline: true }}\n item={{ grow: 1 }}\n onClick={onStageClick}\n >\n <StyledStageButton error={error} aria-label={t('stage_name', [value])}>\n {value}\n </StyledStageButton>\n </Flex>\n <StyledStageActions>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </StyledStageActions>\n </Flex>\n );\n }\n);\n\nexport default Stage;\n"]}
1
+ {"version":3,"file":"Stage.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Stage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAyD,MAAM,OAAO,CAAC;AAC1F,OAAO,MAAM,EAAE,EAAE,GAAG,EA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;IAED,OAAO,CACL,MAAC,IAAI,OACC,SAAS,EACb,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,EACjD,EAAE,EAAE,WAAW,EACf,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,SAAS,EACpB,EAAE,EAAE,IAAI,CAAC,EAAE,gBACC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,aAE7D,KAAK,IAAI,KAAC,cAAc,IAAC,IAAI,EAAC,YAAY,GAAG,EAC9C,KAAC,IAAI,IACH,EAAE,EAAE,aAAa,EACjB,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAC3B,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,OAAO,EAAE,YAAY,YAErB,KAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,gBACA,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC,YAEvD,KAAK,GACY,GACf,EACP,KAAC,kBAAkB,cAChB,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,SAAG,GAClD,IAChB,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import { forwardRef, FunctionComponent, PropsWithChildren, Ref, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Flex,\n BaseProps,\n ForwardProps,\n Actions,\n defaultThemeProp,\n useDirection,\n Action,\n StyledButton,\n Icon,\n useI18n\n} from '@pega/cosmos-react-core';\n\nimport {\n LifeCycleAction,\n LifeCycleActionParam,\n StageInfo,\n StageItemProps,\n StageProps\n} from './LifeCycle.types';\n\nexport interface StageComponentProps extends BaseProps, StageProps {\n ref?: Ref<HTMLDivElement>;\n /** Pass text for the task. */\n value: string;\n /** unique id of the component */\n id: string;\n /** Controls the styling of the stage. */\n stageInfo: StageInfo;\n /** Full data object which can be passed to the callback */\n item: StageItemProps;\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n}\n\nexport const StyledWrapper = styled.div`\n overflow: hidden;\n`;\n\nStyledWrapper.defaultProps = defaultThemeProp;\n\nexport const StyledStageButton = styled.button<{\n error: string | undefined;\n}>(({ error, theme }) => {\n return css`\n height: ${theme.components.button.height};\n outline: none;\n border: none;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n margin-inline-start: ${theme.base.spacing};\n\n ${error &&\n css`\n margin-inline-start: 0;\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &:disabled {\n cursor: not-allowed;\n }\n `;\n});\n\nStyledStageButton.defaultProps = defaultThemeProp;\n\nexport const StyledStageActions = styled.div`\n z-index: 2;\n`;\n\nStyledStageActions.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n margin-inline: calc(0.5 * ${theme.base.spacing});\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledStage = styled.div<\n Pick<StageComponentProps, 'stageInfo'> & {\n status: boolean;\n error: string;\n }\n>(({ stageInfo, theme, status, error }) => {\n const {\n visual: { bgColor, tailPointed, headPointed }\n } = stageInfo;\n\n const { rtl } = useDirection();\n const contrastColor = readableColor(bgColor);\n const roundedEndsStyles = css`\n content: '';\n position: absolute;\n display: block;\n width: calc(3 * ${theme.base.spacing});\n height: calc(3 * ${theme.base.spacing});\n top: calc(1 * ${theme.base.spacing});\n border: 0;\n border-inline-end: 0.0625rem solid transparent;\n `;\n\n return css`\n position: relative;\n padding: calc(0.5 * ${theme.base.spacing});\n background: ${bgColor};\n border: 0.0625rem solid transparent;\n width: 100%;\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus-within {\n border: 0.0625rem solid ${theme.base.palette.interactive};\n\n ${headPointed &&\n css`\n &::after {\n border-inline-end: 0.0625rem solid ${theme.base.palette.interactive};\n ${rtl\n ? css`\n border-block-start: 0.0625rem solid ${theme.base.palette.interactive};\n `\n : css`\n border-block-end: 0.0625rem solid ${theme.base.palette.interactive};\n `}\n }\n `}\n\n ${tailPointed &&\n css`\n &::before {\n border-inline-end: 0.0625rem solid ${theme.base.palette.interactive};\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid ${theme.base.palette.interactive};\n `\n : css`\n border-block-start: 0.0625rem solid ${theme.base.palette.interactive};\n `}\n }\n `}\n }\n\n ${headPointed &&\n css`\n &::after {\n ${roundedEndsStyles}\n z-index: 1;\n background: inherit;\n transform: rotateZ(-45deg) skew(-15deg, -15deg);\n inset-inline-end: calc(1.6 * ${theme.base.spacing} * -1);\n border-block-end: 0.0625rem solid transparent;\n ${rtl\n ? css`\n border-radius: calc(0.75 * ${theme.base['border-radius']}) 0.1rem 0.1rem 0.1rem;\n `\n : css`\n border-radius: 0.0625rem 0.075rem calc(0.75 * ${theme.base['border-radius']})\n 0.0625rem;\n `}\n }\n `}\n\n ${tailPointed &&\n css`\n ${!error &&\n css`\n ${StyledStageButton} {\n margin-inline-start: calc(1.5 * ${theme.base.spacing});\n }\n `}\n\n ${error &&\n css`\n ${StyledWarnIcon} {\n margin-inline-start: ${theme.base.spacing};\n }\n `}\n\n &::before {\n ${roundedEndsStyles}\n background: ${theme.base.palette['app-background']};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n inset-inline-start: calc(-1.6 * ${theme.base.spacing});\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid transparent;\n border-radius: 0.0625rem 1rem 0.0625rem calc(0.75 * ${theme.base['border-radius']});\n `\n : css`\n border-block-start: 0.0625rem solid transparent;\n border-radius: 0.0625rem calc(0.75 * ${theme.base['border-radius']}) 0.0625rem 1rem;\n `}\n }\n `}\n\n ${StyledWarnIcon} {\n color: ${contrastColor};\n }\n\n ${StyledStageActions} {\n & > ${StyledButton} {\n color: ${contrastColor};\n }\n }\n\n ${StyledStageButton} {\n color: ${contrastColor};\n ${!status &&\n css`\n background: ${bgColor};\n `}\n }\n `;\n});\n\nStyledStage.defaultProps = defaultThemeProp;\n\nconst Stage: FunctionComponent<StageComponentProps & ForwardProps> = forwardRef(\n (\n {\n value,\n actions,\n stageInfo,\n onClick,\n id,\n item,\n error,\n ...restProps\n }: PropsWithChildren<StageComponentProps>,\n ref: StageComponentProps['ref']\n ) => {\n const t = useI18n();\n\n const onStageClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n stage: item,\n type: 'Stage'\n };\n onClick?.(actionParam, e);\n };\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n stage: item\n };\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList?.forEach((actionItem: LifeCycleAction) => {\n if (actionItem.id === actionId) {\n actionItem.onClick?.(param, e);\n }\n });\n }\n };\n\n // Deep copy of actions object is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n if (actions) {\n let actionsList: LifeCycleAction[] = [];\n if (Array.isArray(actions)) {\n actionsList = actions;\n } else {\n actionsList = actions[item.type];\n }\n\n actionsList.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n return (\n <Flex\n {...restProps}\n container={{ inline: true, alignItems: 'center' }}\n as={StyledStage}\n ref={ref}\n error={error}\n stageInfo={stageInfo}\n id={item.id}\n aria-label={error ? t('stage_name_error', [value]) : undefined}\n >\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n as={StyledWrapper}\n container={{ inline: true }}\n item={{ grow: 1 }}\n onClick={onStageClick}\n >\n <StyledStageButton\n error={error}\n aria-label={error ? undefined : t('stage_name', [value])}\n >\n {value}\n </StyledStageButton>\n </Flex>\n <StyledStageActions>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </StyledStageActions>\n </Flex>\n );\n }\n);\n\nexport default Stage;\n"]}