@pega/cosmos-react-build 8.0.0-build.9.1 → 8.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/lib/components/AppShell/AppShell.styles.d.ts +1 -1
  2. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  3. package/lib/components/AppShell/AppShell.styles.js +1 -46
  4. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  5. package/lib/components/AppShell/Header/AppHeader.d.ts +2 -3
  6. package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
  7. package/lib/components/AppShell/Header/AppHeader.js +4 -4
  8. package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
  9. package/lib/components/AppShell/Header/AppHeader.styles.d.ts +2 -2
  10. package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
  11. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts +6 -0
  12. package/lib/components/BackgroundPicker/BackgroundPicker.d.ts.map +1 -0
  13. package/lib/components/BackgroundPicker/BackgroundPicker.js +82 -0
  14. package/lib/components/BackgroundPicker/BackgroundPicker.js.map +1 -0
  15. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts +15 -0
  16. package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts.map +1 -0
  17. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js +152 -0
  18. package/lib/components/BackgroundPicker/BackgroundPicker.styles.js.map +1 -0
  19. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts +5 -0
  20. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts.map +1 -0
  21. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js +30 -0
  22. package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js.map +1 -0
  23. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts +98 -0
  24. package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts.map +1 -0
  25. package/lib/components/BackgroundPicker/BackgroundPicker.types.js +29 -0
  26. package/lib/components/BackgroundPicker/BackgroundPicker.types.js.map +1 -0
  27. package/lib/components/BackgroundPicker/GradientConfig.d.ts +6 -0
  28. package/lib/components/BackgroundPicker/GradientConfig.d.ts.map +1 -0
  29. package/lib/components/BackgroundPicker/GradientConfig.js +149 -0
  30. package/lib/components/BackgroundPicker/GradientConfig.js.map +1 -0
  31. package/lib/components/BackgroundPicker/ImageConfig.d.ts +6 -0
  32. package/lib/components/BackgroundPicker/ImageConfig.d.ts.map +1 -0
  33. package/lib/components/BackgroundPicker/ImageConfig.js +64 -0
  34. package/lib/components/BackgroundPicker/ImageConfig.js.map +1 -0
  35. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts +6 -0
  36. package/lib/components/BackgroundPicker/SolidColorConfig.d.ts.map +1 -0
  37. package/lib/components/BackgroundPicker/SolidColorConfig.js +24 -0
  38. package/lib/components/BackgroundPicker/SolidColorConfig.js.map +1 -0
  39. package/lib/components/BackgroundPicker/index.d.ts +3 -0
  40. package/lib/components/BackgroundPicker/index.d.ts.map +1 -0
  41. package/lib/components/BackgroundPicker/index.js +2 -0
  42. package/lib/components/BackgroundPicker/index.js.map +1 -0
  43. package/lib/components/BackgroundPicker/utils.d.ts +24 -0
  44. package/lib/components/BackgroundPicker/utils.d.ts.map +1 -0
  45. package/lib/components/BackgroundPicker/utils.js +186 -0
  46. package/lib/components/BackgroundPicker/utils.js.map +1 -0
  47. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
  48. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  49. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  50. package/lib/components/DynamicInput/BooleanControl.d.ts +3 -5
  51. package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
  52. package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
  53. package/lib/components/DynamicInput/DynamicInput.d.ts +1 -2
  54. package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
  55. package/lib/components/DynamicInput/DynamicInput.js +33 -33
  56. package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
  57. package/lib/components/DynamicInput/DynamicInput.styles.d.ts +2 -2
  58. package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
  59. package/lib/components/DynamicInput/DynamicInput.styles.js +1 -0
  60. package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
  61. package/lib/components/DynamicInput/DynamicInput.types.d.ts +61 -11
  62. package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
  63. package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
  64. package/lib/components/Expression/Expression.d.ts +6 -0
  65. package/lib/components/Expression/Expression.d.ts.map +1 -0
  66. package/lib/components/Expression/Expression.js +36 -0
  67. package/lib/components/Expression/Expression.js.map +1 -0
  68. package/lib/components/Expression/Expression.styles.d.ts +7 -0
  69. package/lib/components/Expression/Expression.styles.d.ts.map +1 -0
  70. package/lib/components/Expression/Expression.styles.js +47 -0
  71. package/lib/components/Expression/Expression.styles.js.map +1 -0
  72. package/lib/components/Expression/Expression.test-ids.d.ts +2 -0
  73. package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -0
  74. package/lib/components/Expression/Expression.test-ids.js +8 -0
  75. package/lib/components/Expression/Expression.test-ids.js.map +1 -0
  76. package/lib/components/Expression/Expression.types.d.ts +53 -0
  77. package/lib/components/Expression/Expression.types.d.ts.map +1 -0
  78. package/lib/components/Expression/Expression.types.js +2 -0
  79. package/lib/components/Expression/Expression.types.js.map +1 -0
  80. package/lib/components/Expression/index.d.ts +3 -0
  81. package/lib/components/Expression/index.d.ts.map +1 -0
  82. package/lib/components/Expression/index.js +2 -0
  83. package/lib/components/Expression/index.js.map +1 -0
  84. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +7 -5
  85. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
  86. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +393 -76
  87. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
  88. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +9 -2
  89. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
  90. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +100 -26
  91. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
  92. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts +2 -0
  93. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts.map +1 -0
  94. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js +6 -0
  95. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js.map +1 -0
  96. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +32 -6
  97. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
  98. package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
  99. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
  100. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +1 -0
  101. package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
  102. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts +3 -0
  103. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts.map +1 -0
  104. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js +34 -0
  105. package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js.map +1 -0
  106. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +2 -3
  107. package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
  108. package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
  109. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
  110. package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
  111. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -1
  112. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
  113. package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
  114. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +2 -3
  115. package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
  116. package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
  117. package/lib/components/ExpressionBuilder/ExpressionList.d.ts +2 -3
  118. package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
  119. package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
  120. package/lib/components/ExpressionBuilder/index.d.ts +1 -1
  121. package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
  122. package/lib/components/ExpressionBuilder/index.js.map +1 -1
  123. package/lib/components/FieldReference/FieldReference.styles.d.ts +1 -0
  124. package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -1
  125. package/lib/components/FieldReference/FieldReference.styles.js +45 -37
  126. package/lib/components/FieldReference/FieldReference.styles.js.map +1 -1
  127. package/lib/components/FieldReference/FieldReference.test-ids.d.ts +1 -0
  128. package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -1
  129. package/lib/components/FieldReference/FieldReference.test-ids.js +3 -0
  130. package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -1
  131. package/lib/components/FieldReference/FieldReference.types.d.ts +6 -1
  132. package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
  133. package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
  134. package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -1
  135. package/lib/components/FieldReference/FieldReferenceDisplay.js +11 -7
  136. package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -1
  137. package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
  138. package/lib/components/FieldReference/FieldReferenceInput.js +17 -11
  139. package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
  140. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +5 -4
  141. package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -1
  142. package/lib/components/FieldReference/FieldReferenceMenuList.js +7 -5
  143. package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -1
  144. package/lib/components/FieldReference/index.d.ts +2 -2
  145. package/lib/components/FieldReference/index.d.ts.map +1 -1
  146. package/lib/components/FieldReference/index.js +1 -1
  147. package/lib/components/FieldReference/index.js.map +1 -1
  148. package/lib/components/IconTile/IconTile.d.ts +7 -3
  149. package/lib/components/IconTile/IconTile.d.ts.map +1 -1
  150. package/lib/components/IconTile/IconTile.js +40 -4
  151. package/lib/components/IconTile/IconTile.js.map +1 -1
  152. package/lib/components/IconTile/IconTile.types.d.ts +17 -15
  153. package/lib/components/IconTile/IconTile.types.d.ts.map +1 -1
  154. package/lib/components/IconTile/IconTile.types.js.map +1 -1
  155. package/lib/components/IconTile/Tiles/Ai.d.ts +1 -1
  156. package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -1
  157. package/lib/components/IconTile/Tiles/Ai.js.map +1 -1
  158. package/lib/components/IconTile/Tiles/Automation.d.ts +1 -1
  159. package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -1
  160. package/lib/components/IconTile/Tiles/Automation.js.map +1 -1
  161. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +1 -1
  162. package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -1
  163. package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -1
  164. package/lib/components/IconTile/Tiles/AutomationCall.d.ts +1 -1
  165. package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -1
  166. package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -1
  167. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +1 -1
  168. package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -1
  169. package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -1
  170. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +1 -1
  171. package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -1
  172. package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -1
  173. package/lib/components/IconTile/Tiles/AutomationSet.d.ts +1 -1
  174. package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -1
  175. package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -1
  176. package/lib/components/IconTile/Tiles/Case.d.ts +1 -1
  177. package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -1
  178. package/lib/components/IconTile/Tiles/Case.js.map +1 -1
  179. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +1 -1
  180. package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -1
  181. package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -1
  182. package/lib/components/IconTile/Tiles/CaseProcess.d.ts +1 -1
  183. package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -1
  184. package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -1
  185. package/lib/components/IconTile/Tiles/CaseSla.d.ts +1 -1
  186. package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -1
  187. package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -1
  188. package/lib/components/IconTile/Tiles/CaseStage.d.ts +1 -1
  189. package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -1
  190. package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -1
  191. package/lib/components/IconTile/Tiles/CaseWait.d.ts +1 -1
  192. package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -1
  193. package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -1
  194. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +1 -1
  195. package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -1
  196. package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -1
  197. package/lib/components/IconTile/Tiles/LogicFunction.d.ts +1 -1
  198. package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -1
  199. package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -1
  200. package/lib/components/IconTile/Tiles/LogicValidation.d.ts +1 -1
  201. package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -1
  202. package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -1
  203. package/lib/components/IconTile/Tiles/LogicWhen.d.ts +1 -1
  204. package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -1
  205. package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -1
  206. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +1 -1
  207. package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -1
  208. package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -1
  209. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +1 -1
  210. package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -1
  211. package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -1
  212. package/lib/components/IconTile/Tiles/RuleConnector.d.ts +1 -1
  213. package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -1
  214. package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -1
  215. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +1 -1
  216. package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -1
  217. package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -1
  218. package/lib/components/IconTile/Tiles/RuleField.d.ts +1 -1
  219. package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -1
  220. package/lib/components/IconTile/Tiles/RuleField.js.map +1 -1
  221. package/lib/components/IconTile/Tiles/RuleInsight.d.ts +1 -1
  222. package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -1
  223. package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -1
  224. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +1 -1
  225. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -1
  226. package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -1
  227. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +1 -1
  228. package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -1
  229. package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -1
  230. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +1 -1
  231. package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -1
  232. package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -1
  233. package/lib/components/IconTile/Tiles/RulePermission.d.ts +1 -1
  234. package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -1
  235. package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -1
  236. package/lib/components/IconTile/Tiles/RulePersona.d.ts +1 -1
  237. package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -1
  238. package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -1
  239. package/lib/components/IconTile/Tiles/RulePortal.d.ts +1 -1
  240. package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -1
  241. package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -1
  242. package/lib/components/IconTile/Tiles/RuleRecord.d.ts +1 -1
  243. package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -1
  244. package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -1
  245. package/lib/components/IconTile/Tiles/RuleSystem.d.ts +1 -1
  246. package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -1
  247. package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -1
  248. package/lib/components/IconTile/Tiles/RuleView.d.ts +1 -1
  249. package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -1
  250. package/lib/components/IconTile/Tiles/RuleView.js.map +1 -1
  251. package/lib/components/IconTile/Tiles/Task.d.ts +1 -1
  252. package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -1
  253. package/lib/components/IconTile/Tiles/Task.js.map +1 -1
  254. package/lib/components/IconTile/Tiles/TaskAction.d.ts +1 -1
  255. package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -1
  256. package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -1
  257. package/lib/components/IconTile/iconUtils.d.ts +11 -0
  258. package/lib/components/IconTile/iconUtils.d.ts.map +1 -0
  259. package/lib/components/IconTile/iconUtils.js +41 -0
  260. package/lib/components/IconTile/iconUtils.js.map +1 -0
  261. package/lib/components/IconTile/index.d.ts +1 -0
  262. package/lib/components/IconTile/index.d.ts.map +1 -1
  263. package/lib/components/IconTile/index.js.map +1 -1
  264. package/lib/components/ItemLibrary/ItemLibrary.d.ts +10 -10
  265. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  266. package/lib/components/ItemLibrary/ItemLibrary.js +26 -18
  267. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  268. package/lib/components/LifeCycle/Category.d.ts +8 -6
  269. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  270. package/lib/components/LifeCycle/Category.js +53 -36
  271. package/lib/components/LifeCycle/Category.js.map +1 -1
  272. package/lib/components/LifeCycle/LifeCycle.d.ts +8 -4
  273. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  274. package/lib/components/LifeCycle/LifeCycle.js +113 -19
  275. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  276. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts +6 -0
  277. package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts.map +1 -0
  278. package/lib/components/LifeCycle/LifeCycle.test-ids.js +10 -0
  279. package/lib/components/LifeCycle/LifeCycle.test-ids.js.map +1 -0
  280. package/lib/components/LifeCycle/LifeCycle.types.d.ts +713 -58
  281. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  282. package/lib/components/LifeCycle/LifeCycle.types.js +71 -61
  283. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  284. package/lib/components/LifeCycle/LifeCycleContext.d.ts +16 -4
  285. package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
  286. package/lib/components/LifeCycle/LifeCycleContext.js +7 -1
  287. package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
  288. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts +21 -0
  289. package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -0
  290. package/lib/components/LifeCycle/LifeCycleDragDropList.js +298 -0
  291. package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -0
  292. package/lib/components/LifeCycle/LifeCycleList.d.ts +8 -6
  293. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  294. package/lib/components/LifeCycle/LifeCycleList.js +20 -30
  295. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  296. package/lib/components/LifeCycle/Stage.d.ts +12 -7
  297. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  298. package/lib/components/LifeCycle/Stage.js +87 -72
  299. package/lib/components/LifeCycle/Stage.js.map +1 -1
  300. package/lib/components/LifeCycle/Step.d.ts +21 -14
  301. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  302. package/lib/components/LifeCycle/Step.js +75 -51
  303. package/lib/components/LifeCycle/Step.js.map +1 -1
  304. package/lib/components/LifeCycle/Task.d.ts +18 -7
  305. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  306. package/lib/components/LifeCycle/Task.js +119 -55
  307. package/lib/components/LifeCycle/Task.js.map +1 -1
  308. package/lib/components/LifeCycle/index.d.ts +2 -1
  309. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  310. package/lib/components/LifeCycle/index.js +1 -0
  311. package/lib/components/LifeCycle/index.js.map +1 -1
  312. package/lib/components/LifeCycle/utils.d.ts +14 -0
  313. package/lib/components/LifeCycle/utils.d.ts.map +1 -0
  314. package/lib/components/LifeCycle/utils.js +250 -0
  315. package/lib/components/LifeCycle/utils.js.map +1 -0
  316. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +2 -3
  317. package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
  318. package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
  319. package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
  320. package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
  321. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  322. package/lib/components/PageTemplates/GalleryPage.d.ts +2 -2
  323. package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
  324. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  325. package/lib/components/PageTemplates/PageTemplates.d.ts +5 -5
  326. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  327. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  328. package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
  329. package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
  330. package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
  331. package/lib/components/RuleSelect/RuleSelect.js +3 -3
  332. package/lib/components/RuleSelect/RuleSelect.js.map +1 -1
  333. package/lib/components/Workbench/Workbench.d.ts +2 -3
  334. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  335. package/lib/components/Workbench/Workbench.js.map +1 -1
  336. package/lib/components/Workbench/Workbench.styles.d.ts +2 -2
  337. package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
  338. package/lib/index.d.ts +4 -2
  339. package/lib/index.d.ts.map +1 -1
  340. package/lib/index.js +4 -2
  341. package/lib/index.js.map +1 -1
  342. package/lib/{components/FieldReference → utils}/typeIconMapping.d.ts +8 -0
  343. package/lib/utils/typeIconMapping.d.ts.map +1 -0
  344. package/lib/{components/FieldReference → utils}/typeIconMapping.js +15 -3
  345. package/lib/utils/typeIconMapping.js.map +1 -0
  346. package/package.json +16 -14
  347. package/lib/components/FieldReference/typeIconMapping.d.ts.map +0 -1
  348. package/lib/components/FieldReference/typeIconMapping.js.map +0 -1
  349. package/lib/components/FlowModeller/AddNode.d.ts +0 -18
  350. package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
  351. package/lib/components/FlowModeller/AddNode.js +0 -86
  352. package/lib/components/FlowModeller/AddNode.js.map +0 -1
  353. package/lib/components/FlowModeller/Connector.d.ts +0 -6
  354. package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
  355. package/lib/components/FlowModeller/Connector.js +0 -69
  356. package/lib/components/FlowModeller/Connector.js.map +0 -1
  357. package/lib/components/FlowModeller/DeletePopover.d.ts +0 -19
  358. package/lib/components/FlowModeller/DeletePopover.d.ts.map +0 -1
  359. package/lib/components/FlowModeller/DeletePopover.js +0 -136
  360. package/lib/components/FlowModeller/DeletePopover.js.map +0 -1
  361. package/lib/components/FlowModeller/FlowModeller.d.ts +0 -5
  362. package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
  363. package/lib/components/FlowModeller/FlowModeller.js +0 -317
  364. package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
  365. package/lib/components/FlowModeller/FlowModeller.types.d.ts +0 -27
  366. package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +0 -1
  367. package/lib/components/FlowModeller/FlowModeller.types.js +0 -2
  368. package/lib/components/FlowModeller/FlowModeller.types.js.map +0 -1
  369. package/lib/components/FlowModeller/FlowModellerContext.d.ts +0 -10
  370. package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +0 -1
  371. package/lib/components/FlowModeller/FlowModellerContext.js +0 -8
  372. package/lib/components/FlowModeller/FlowModellerContext.js.map +0 -1
  373. package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -75
  374. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
  375. package/lib/components/FlowModeller/Node/Node.types.js +0 -27
  376. package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
  377. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -20
  378. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
  379. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -151
  380. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
  381. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
  382. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
  383. package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -69
  384. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
  385. package/lib/components/FlowModeller/Node.d.ts +0 -5
  386. package/lib/components/FlowModeller/Node.d.ts.map +0 -1
  387. package/lib/components/FlowModeller/Node.js +0 -22
  388. package/lib/components/FlowModeller/Node.js.map +0 -1
  389. package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
  390. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
  391. package/lib/components/FlowModeller/Renderer/Renderer.js +0 -48
  392. package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
  393. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
  394. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
  395. package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
  396. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
  397. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -59
  398. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
  399. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -258
  400. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
  401. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -36
  402. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
  403. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -120
  404. package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
  405. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -28
  406. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
  407. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -172
  408. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
  409. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +0 -18
  410. package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +0 -1
  411. package/lib/components/FlowModeller/Utils/addNodeUtils.js +0 -141
  412. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +0 -1
  413. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +0 -30
  414. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +0 -1
  415. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +0 -81
  416. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +0 -1
  417. package/lib/components/FlowModeller/helper.d.ts +0 -39
  418. package/lib/components/FlowModeller/helper.d.ts.map +0 -1
  419. package/lib/components/FlowModeller/helper.js +0 -198
  420. package/lib/components/FlowModeller/helper.js.map +0 -1
  421. package/lib/components/FlowModeller/index.d.ts +0 -20
  422. package/lib/components/FlowModeller/index.d.ts.map +0 -1
  423. package/lib/components/FlowModeller/index.js +0 -12
  424. package/lib/components/FlowModeller/index.js.map +0 -1
  425. package/lib/components/IconTile/IconTile.styles.d.ts +0 -7
  426. package/lib/components/IconTile/IconTile.styles.d.ts.map +0 -1
  427. package/lib/components/IconTile/IconTile.styles.js +0 -68
  428. package/lib/components/IconTile/IconTile.styles.js.map +0 -1
@@ -1,10 +1,14 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { createElement as _createElement } from "react";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useState, useCallback, useContext } from 'react';
3
4
  import styled, { css } from 'styled-components';
4
- import { Flex, defaultThemeProp, Button, Icon, useElement, Actions, useI18n, Avatar, useOuterEvent, useEscape } from '@pega/cosmos-react-core';
5
+ import { Flex, defaultThemeProp, Button, Icon, useElement, Actions, useI18n, Avatar, useTestIds, withTestIds, Text, Tooltip, StyledButton, StyledIcon } from '@pega/cosmos-react-core';
5
6
  import { ItemLibrary } from '../ItemLibrary';
6
- import Step from './Step';
7
+ import { generateDynamicTestId } from './utils';
8
+ import Step, {} from './Step';
7
9
  import LifeCycleContext from './LifeCycleContext';
10
+ import { getStepTestIds, getTaskTestIds } from './LifeCycle.test-ids';
11
+ import LifeCycleDragDropList from './LifeCycleDragDropList';
8
12
  export const StyledTaskList = styled.li(({ theme }) => {
9
13
  return css `
10
14
  list-style-type: none;
@@ -16,39 +20,61 @@ export const StyledTaskList = styled.li(({ theme }) => {
16
20
  `;
17
21
  });
18
22
  StyledTaskList.defaultProps = defaultThemeProp;
19
- export const StyledCardHeader = styled.header(({ theme }) => {
23
+ export const StyledCardHeader = styled.header(({ theme: { base: { spacing } } }) => {
20
24
  return css `
21
- padding: 0;
22
- margin: 0 0 calc(0.5 * ${theme.base.spacing});
23
- `;
25
+ padding: 0 calc(0.25 * ${spacing});
26
+ margin: calc(0.25 * ${spacing});
27
+ `;
24
28
  });
25
29
  StyledCardHeader.defaultProps = defaultThemeProp;
26
- export const StyledCardContent = styled.div(() => {
27
- return css `
28
- padding: 0;
29
- `;
30
- });
31
- export const StyledTaskButton = styled.button(({ theme }) => {
30
+ export const StyledAddCustomStepButton = styled(Button)(({ theme }) => {
32
31
  return css `
33
- background: ${theme.base.palette['primary-background']};
34
- border: none;
35
32
  height: ${theme.components.button.height};
36
- overflow: hidden;
37
- text-overflow: ellipsis;
38
- white-space: nowrap;
39
- text-align: start;
33
+ margin-inline-start: calc(0.5 * ${theme.base.spacing});
40
34
 
41
- &:hover {
42
- cursor: pointer;
35
+ ${StyledIcon} {
36
+ margin-inline-end: ${theme.base.spacing};
43
37
  }
44
-
45
- &:focus {
46
- outline: none;
38
+ `;
39
+ });
40
+ StyledAddCustomStepButton.defaultProps = defaultThemeProp;
41
+ export const StyledAddStepButton = styled(Button) ``;
42
+ export const StyledCardContent = styled.div(({ hasSteps, theme }) => {
43
+ if (!hasSteps)
44
+ return;
45
+ return css `
46
+ & > ${StyledButton}, & > ${StyledAddCustomStepButton} {
47
+ margin-block-start: calc(0.5 * ${theme.base.spacing});
47
48
  }
48
49
  `;
49
50
  });
51
+ StyledCardContent.defaultProps = defaultThemeProp;
52
+ export const StyledTaskButton = styled.button(({ theme, visual }) => {
53
+ return css `
54
+ background: ${theme.base.palette['primary-background']};
55
+ border: none;
56
+ height: ${theme.components.button.height};
57
+ overflow: hidden;
58
+ text-overflow: ellipsis;
59
+ white-space: nowrap;
60
+ text-align: start;
61
+
62
+ ${visual.imgSrc &&
63
+ css `
64
+ padding-inline-start: calc(0.5 * ${theme.base.spacing});
65
+ `}
66
+
67
+ &:hover {
68
+ cursor: pointer;
69
+ }
70
+
71
+ &:focus {
72
+ outline: none;
73
+ }
74
+ `;
75
+ });
50
76
  StyledTaskButton.defaultProps = defaultThemeProp;
51
- export const StyledTask = styled.article(({ hasFocus, theme }) => {
77
+ export const StyledTask = styled.article(({ hasFocus, hasSteps, theme, dragEnabled }) => {
52
78
  return css `
53
79
  background: ${theme.base.palette['primary-background']};
54
80
  border: 0.125rem solid transparent;
@@ -67,13 +93,22 @@ export const StyledTask = styled.article(({ hasFocus, theme }) => {
67
93
  &[aria-current='true'] {
68
94
  border-color: ${theme.base.palette.interactive};
69
95
  }
96
+
97
+ ${hasSteps &&
98
+ !dragEnabled &&
99
+ css `
100
+ ${StyledAddCustomStepButton} ,${StyledAddStepButton} {
101
+ margin-block-start: calc(0.5 * ${theme.base.spacing});
102
+ }
103
+ `}
70
104
  `;
71
105
  });
72
106
  StyledTask.defaultProps = defaultThemeProp;
73
107
  export const StyledWarnIcon = styled(Icon)(({ theme }) => {
74
108
  return css `
75
109
  color: ${theme.base.palette.urgent};
76
- margin-inline: ${theme.base.spacing};
110
+ margin-inline-start: calc(0.5 * ${theme.base.spacing});
111
+ margin-inline-end: ${theme.base.spacing};
77
112
 
78
113
  &:hover {
79
114
  cursor: pointer;
@@ -81,13 +116,15 @@ export const StyledWarnIcon = styled(Icon)(({ theme }) => {
81
116
  `;
82
117
  });
83
118
  StyledWarnIcon.defaultProps = defaultThemeProp;
84
- const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem, error, onAddStep, onClick, categoryItem, id, step: stepProp, nodeLibrary, ...restProps }) => {
119
+ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem, error, onAddStep, onAddCustomStep, onClick, categoryItem, id, step: stepProp, nodeLibrary, ...restProps }) => {
85
120
  const t = useI18n();
86
- const { selectedItemId, readOnly } = useContext(LifeCycleContext);
121
+ const { selectedItemId, readOnly, dragEnabled, onDragDrop } = useContext(LifeCycleContext);
87
122
  const [taskHasFocus, setTaskHasFocus] = useState(false);
88
- const [showLibrary, setLibrary] = useState(false);
89
- const [popoverEl, setPopoverEl] = useElement(null);
90
- const [addEl, setAddEl] = useElement();
123
+ const [taskButtonEl, setTaskButtonEl] = useElement();
124
+ const [addEl, setAddEl] = useElement(null);
125
+ const taskTestID = generateDynamicTestId([stageItem.label, categoryItem.categoryLabel, value]);
126
+ const testIds = useTestIds(taskTestID, getTaskTestIds);
127
+ const stepTestIds = useTestIds(taskTestID, getStepTestIds);
91
128
  const onActionItemClick = (actionId, e) => {
92
129
  const param = {
93
130
  task: item,
@@ -109,7 +146,10 @@ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem,
109
146
  actionCloneItem[key] = actionItem[key];
110
147
  });
111
148
  actionCloneItem.onClick = onActionItemClick;
112
- actionsClone.push(actionCloneItem);
149
+ actionsClone.push({
150
+ ...actionCloneItem,
151
+ 'data-testid': testIds.actionButton
152
+ });
113
153
  return actionItem;
114
154
  });
115
155
  }
@@ -130,29 +170,53 @@ const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem,
130
170
  category: categoryItem
131
171
  };
132
172
  onAddStep?.(param, libItem);
133
- setLibrary(false);
134
173
  }, [onAddStep]);
135
- useEscape(() => {
136
- setLibrary(false);
137
- });
138
- useOuterEvent('mousedown', [addEl, popoverEl], () => setLibrary(false));
139
- return (_jsx(StyledTaskList, { ...restProps, id: item.id, children: _jsxs(Flex, { as: StyledTask, "aria-current": selectedItemId === id ? true : undefined, container: { direction: 'column' }, id: `${id}-task`, hasFocus: taskHasFocus && selectedItemId !== id, children: [_jsxs(Flex, { as: StyledCardHeader, container: { inline: true, alignItems: 'center' }, children: [visual?.imgurl.length > 0 && _jsx(Avatar, { name: value, imageSrc: visual?.imgurl }), error && _jsx(StyledWarnIcon, { name: 'warn-solid' }), _jsx(Flex, { item: { grow: 1 }, container: { inline: true, alignItems: 'center' }, onClick: onTaskClick, children: _jsx(StyledTaskButton, { onFocus: () => {
140
- setTaskHasFocus(true);
141
- }, onBlur: () => {
142
- setTaskHasFocus(false);
143
- }, "aria-label": t(error ? 'process_name_error' : 'process_name', [value]), children: value }) }), actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true })] }), _jsxs(StyledCardContent, { children: [item?.steps.map((steps) => {
144
- const badgeStatus = steps?.status?.type ? steps.status.type : '';
145
- const badgeLabel = steps?.status?.label ? steps.status.label : '';
146
- return (_jsx(Step, { id: steps.id, value: steps.label, visual: {
147
- imgurl: steps.visual.imgurl,
148
- color: steps.visual.color,
149
- icon: steps.visual.icon,
150
- title: steps.visual.label
151
- }, item: steps, taskItem: item, stageItem: stageItem, badge: {
152
- type: badgeStatus,
153
- label: badgeLabel
154
- }, error: steps.error, categoryItem: categoryItem, ...stepProp }, steps.id));
155
- }), !readOnly && (_jsxs(_Fragment, { children: [_jsx(Button, { variant: 'simple', ref: setAddEl, label: t('add_noun', [addStepTitle]), onClick: () => setLibrary(prev => !prev), icon: true, children: _jsx(Icon, { name: 'plus' }) }), _jsx(ItemLibrary, { items: nodeLibrary, show: showLibrary, target: addEl, onClick: onLibraryItemSelect, ref: setPopoverEl, placeholder: t('search_nodes') })] }))] })] }) }));
174
+ const isEmpty = (readOnly || (!readOnly && !addStepTitle)) && !item?.steps?.length && !value;
175
+ const getStepProps = useCallback((step, index) => {
176
+ return {
177
+ id: step.id,
178
+ value: step.label,
179
+ visual: {
180
+ imgSrc: step.visual.imgSrc,
181
+ name: step.visual.name,
182
+ label: step.visual.label,
183
+ category: step.visual.category,
184
+ inverted: step.visual.inverted
185
+ },
186
+ item: { ...step, index, alternate: item.alternate },
187
+ taskItem: item,
188
+ stageItem,
189
+ badge: {
190
+ type: step?.status?.type ?? '',
191
+ label: step?.status?.label ?? ''
192
+ },
193
+ error: step.error,
194
+ categoryItem
195
+ };
196
+ }, [categoryItem, item, stageItem]);
197
+ const addStepRegion = (_jsxs(_Fragment, { children: [!readOnly && addStepTitle && nodeLibrary && (_jsxs(_Fragment, { children: [_jsx(Button, { as: StyledAddStepButton, "data-testid": stepTestIds.addButton, variant: 'simple', label: t('add_noun', [addStepTitle]), onClick: (e) => setAddEl(e.currentTarget), icon: true, children: _jsx(Icon, { name: 'plus' }) }), addEl && (_jsx(ItemLibrary, { items: nodeLibrary, target: addEl, onClick: onLibraryItemSelect, onDismiss: () => setAddEl(null), placeholder: t('search_placeholder_default') }))] })), !readOnly && addStepTitle && !nodeLibrary && onAddCustomStep && (_jsxs(Button, { as: StyledAddCustomStepButton, "data-testid": stepTestIds.addButton, variant: 'link', onClick: () => {
198
+ const param = {
199
+ task: item,
200
+ stage: stageItem,
201
+ category: categoryItem
202
+ };
203
+ onAddCustomStep(param);
204
+ }, children: [_jsx(Icon, { name: 'plus' }), t('add_noun', [addStepTitle])] }))] }));
205
+ return (_jsx(StyledTaskList, { "data-testid": testIds.root, ...restProps, id: item.id, children: isEmpty ? (_jsx(Flex, { container: { justify: 'center', pad: 1 }, children: _jsx(Text, { variant: 'secondary', children: "No Steps" }) })) : (_jsxs(Flex, { as: StyledTask, "aria-current": selectedItemId === id ? 'true' : undefined, container: { direction: 'column' }, hasFocus: taskHasFocus && selectedItemId !== id, hasSteps: !!item?.steps?.length, dragEnabled: dragEnabled, children: [!!value && (_jsxs(Flex, { as: StyledCardHeader, container: { inline: true, alignItems: 'center' }, children: [visual?.imgSrc?.length > 0 && _jsx(Avatar, { name: value, imageSrc: visual?.imgSrc }), error && _jsx(StyledWarnIcon, { name: 'warn-solid' }), _jsxs(Flex, { item: { grow: 1 }, container: { inline: true, alignItems: 'center' }, onClick: onTaskClick, children: [_jsx(StyledTaskButton, { onFocus: () => {
206
+ setTaskHasFocus(true);
207
+ }, onBlur: () => {
208
+ setTaskHasFocus(false);
209
+ }, "aria-label": t(error ? 'process_name_error' : 'process_name', [value]), visual: visual, ref: setTaskButtonEl, children: value }), taskButtonEl && (_jsx(Tooltip, { target: taskButtonEl, smart: true, children: value }))] }), actionsClone && (_jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true, contextualLabel: t('process_name', [value]) }))] })), _jsx(StyledCardContent, { hasSteps: !!item?.steps?.length, as: dragEnabled ? 'div' : 'ul', children: dragEnabled ? (_jsx(LifeCycleDragDropList, { type: stageItem.alternate ? 'alternate-step' : 'step', listLocation: {
210
+ alternate: !!stageItem.alternate,
211
+ stage: stageItem.index,
212
+ category: categoryItem.index,
213
+ task: item.index,
214
+ subTask: item.subIndex
215
+ }, items: item?.steps?.map((step, index) => ({
216
+ id: step.id,
217
+ type: stageItem.alternate ? 'alternate-step' : 'step',
218
+ data: { ...stepProp, ...getStepProps(step, index) }
219
+ })), itemRenderer: Step, onDragDrop: onDragDrop, additionalDropZone: addStepRegion })) : (_jsx(_Fragment, { children: item?.steps?.map((step, index) => (_createElement(Step, { ...stepProp, key: step.id, ...getStepProps(step, index) }))) })) }), !dragEnabled && _jsx("div", { children: addStepRegion })] })) }));
156
220
  };
157
- export default Task;
221
+ export default withTestIds(Task, getTaskTestIds);
158
222
  //# sourceMappingURL=Task.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,aAAa,EACb,SAAS,EACV,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,IAAI,MAAM,QAAQ,CAAC;AAU1B,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAuBlD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACpD,OAAO,GAAG,CAAA;;wBAEY,KAAK,CAAC,IAAI,CAAC,OAAO;;;;;GAKvC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC1D,OAAO,GAAG,CAAA;;6BAEiB,KAAK,CAAC,IAAI,CAAC,OAAO;GAC5C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG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AE,mBAAmB,EAC5B,GAAG,EAAE,YAAY,EACjB,WAAW,EAAE,CAAC,CAAC,cAAc,CAAC,GAC9B,IACD,CACJ,IACiB,IACf,GACQ,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { useState, useCallback, useContext } from 'react';\nimport type { FunctionComponent, PropsWithChildren, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n Button,\n Icon,\n useElement,\n Actions,\n useI18n,\n Avatar,\n useOuterEvent,\n useEscape\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, Action } from '@pega/cosmos-react-core';\n\nimport { ItemLibrary } from '../ItemLibrary';\nimport type { LibraryItem } from '../ItemLibrary';\n\nimport Step from './Step';\nimport type {\n TaskItemProps,\n StageItemProps,\n StepItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps,\n TaskProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\n\ninterface TaskComponentProps extends BaseProps, TaskProps {\n /** Pass text for the task. */\n value: string;\n /** support for an Avatar, Icon, or other supporting visual. */\n visual: {\n imgurl: string;\n };\n /** Pass task data */\n item: TaskItemProps;\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Step Props */\n step?: StepProps;\n /** Stage data to pass it as callback */\n stageItem: StageItemProps;\n /** Category data to pass it as callback */\n categoryItem: CategoryItemProps;\n /** unique id of task */\n id: string;\n}\n\nexport const StyledTaskList = styled.li(({ theme }) => {\n return css`\n list-style-type: none;\n margin-block-end: ${theme.base.spacing};\n\n &:last-child > article {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledTaskList.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(({ theme }) => {\n return css`\n padding: 0;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n `;\n});\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(() => {\n return css`\n padding: 0;\n `;\n});\n\nexport const StyledTaskButton = styled.button(({ theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n});\n\nStyledTaskButton.defaultProps = defaultThemeProp;\n\nexport const StyledTask = styled.article<{ hasFocus: boolean }>(({ hasFocus, theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: calc(${theme.base.spacing} - 0.125rem);\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &[aria-current='true'] {\n border-color: ${theme.base.palette.interactive};\n }\n `;\n});\n\nStyledTask.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Task: FunctionComponent<TaskComponentProps & ForwardProps> = ({\n value,\n visual,\n actions,\n item,\n addStepTitle,\n addTask,\n stageItem,\n error,\n onAddStep,\n onClick,\n categoryItem,\n id,\n step: stepProp,\n nodeLibrary,\n ...restProps\n}: PropsWithChildren<TaskComponentProps>) => {\n const t = useI18n();\n const { selectedItemId, readOnly } = useContext(LifeCycleContext);\n const [taskHasFocus, setTaskHasFocus] = useState(false);\n const [showLibrary, setLibrary] = useState(false);\n const [popoverEl, setPopoverEl] = useElement<HTMLElement>(null);\n const [addEl, setAddEl] = useElement();\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.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 const onTaskClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n task: item,\n stage: stageItem,\n category: categoryItem,\n type: 'Task'\n };\n onClick?.(actionParam, e);\n };\n\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddStep?.(param, libItem);\n setLibrary(false);\n },\n [onAddStep]\n );\n\n useEscape(() => {\n setLibrary(false);\n });\n\n useOuterEvent('mousedown', [addEl, popoverEl], () => setLibrary(false));\n\n return (\n <StyledTaskList {...restProps} id={item.id}>\n <Flex\n as={StyledTask}\n aria-current={selectedItemId === id ? true : undefined}\n container={{ direction: 'column' }}\n id={`${id}-task`}\n hasFocus={taskHasFocus && selectedItemId !== id}\n >\n <Flex as={StyledCardHeader} container={{ inline: true, alignItems: 'center' }}>\n {visual?.imgurl.length > 0 && <Avatar name={value} imageSrc={visual?.imgurl} />}\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center' }}\n onClick={onTaskClick}\n >\n <StyledTaskButton\n onFocus={() => {\n setTaskHasFocus(true);\n }}\n onBlur={() => {\n setTaskHasFocus(false);\n }}\n aria-label={t(error ? 'process_name_error' : 'process_name', [value])}\n >\n {value}\n </StyledTaskButton>\n </Flex>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </Flex>\n <StyledCardContent>\n {item?.steps.map((steps: StepItemProps) => {\n const badgeStatus = steps?.status?.type ? steps.status.type : '';\n const badgeLabel = steps?.status?.label ? steps.status.label : '';\n return (\n <Step\n key={steps.id}\n id={steps.id}\n value={steps.label}\n visual={{\n imgurl: steps.visual.imgurl,\n color: steps.visual.color,\n icon: steps.visual.icon,\n title: steps.visual.label\n }}\n item={steps}\n taskItem={item}\n stageItem={stageItem}\n badge={{\n type: badgeStatus,\n label: badgeLabel\n }}\n error={steps.error}\n categoryItem={categoryItem}\n {...stepProp}\n />\n );\n })}\n {!readOnly && (\n <>\n <Button\n variant='simple'\n ref={setAddEl}\n label={t('add_noun', [addStepTitle])}\n onClick={() => setLibrary(prev => !prev)}\n icon\n >\n <Icon name='plus' />\n </Button>\n <ItemLibrary\n items={nodeLibrary}\n show={showLibrary}\n target={addEl as HTMLElement}\n onClick={onLibraryItemSelect}\n ref={setPopoverEl}\n placeholder={t('search_nodes')}\n />\n </>\n )}\n </StyledCardContent>\n </Flex>\n </StyledTaskList>\n );\n};\n\nexport default Task;\n"]}
1
+ {"version":3,"file":"Task.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,gBAAgB,EAChB,MAAM,EACN,IAAI,EACJ,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,UAAU,EACV,WAAW,EACX,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,UAAU,EACX,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,IAAI,EAAE,EAA2B,MAAM,QAAQ,CAAC;AAUvD,OAAO,gBAAgB,MAAM,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,CAAC,CAAC,EACH,YAAY,EAAE,IAAI,EAClB,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,aAAa,GACjC,CACH,CAAC,CAAC,CAAC,CACF,4BACG,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACjC,eAAC,IAAI,OAAK,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,KAAM,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,GAAI,CACpE,CAAC,GACD,CACJ,GACiB,EACnB,CAAC,WAAW,IAAI,wBAAM,aAAa,GAAO,IACtC,CACR,GACc,CAClB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import { useState, useCallback, useContext } from 'react';\nimport type { FunctionComponent, PropsWithChildren, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n Button,\n Icon,\n useElement,\n Actions,\n useI18n,\n Avatar,\n useTestIds,\n withTestIds,\n Text,\n Tooltip,\n StyledButton,\n StyledIcon\n} from '@pega/cosmos-react-core';\nimport type { BaseProps, ForwardProps, Action } from '@pega/cosmos-react-core';\n\nimport { ItemLibrary } from '../ItemLibrary';\nimport type { LibraryItem } from '../ItemLibrary';\n\nimport { generateDynamicTestId } from './utils';\nimport Step, { type StepComponentProps } from './Step';\nimport type {\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n LifeCycleActionParam,\n StepProps,\n TaskProps,\n StepItemProps\n} from './LifeCycle.types';\nimport LifeCycleContext from './LifeCycleContext';\nimport { getStepTestIds, getTaskTestIds } from './LifeCycle.test-ids';\nimport LifeCycleDragDropList from './LifeCycleDragDropList';\n\ninterface CategoryLabelProp {\n categoryLabel?: string;\n}\nexport interface TaskComponentProps extends BaseProps, TaskProps {\n /** Pass text for the task. */\n value: string;\n /** support for an Avatar, Icon, or other supporting visual. */\n visual: {\n imgSrc: string;\n };\n /** Pass task data */\n item: TaskItemProps;\n /** The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Step Props */\n step?: StepProps;\n /** Stage data to pass it as callback */\n stageItem: StageItemProps;\n /** Category data to pass it as callback */\n categoryItem: CategoryItemProps & CategoryLabelProp;\n /** unique id of task */\n id: string;\n}\n\nexport const StyledTaskList = styled.li(({ theme }) => {\n return css`\n list-style-type: none;\n margin-block-end: ${theme.base.spacing};\n\n &:last-child > article {\n margin-block-end: 0;\n }\n `;\n});\n\nStyledTaskList.defaultProps = defaultThemeProp;\n\nexport const StyledCardHeader = styled.header(\n ({\n theme: {\n base: { spacing }\n }\n }) => {\n return css`\n padding: 0 calc(0.25 * ${spacing});\n margin: calc(0.25 * ${spacing});\n `;\n }\n);\n\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledAddCustomStepButton = styled(Button)(({ theme }) => {\n return css`\n height: ${theme.components.button.height};\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n\n ${StyledIcon} {\n margin-inline-end: ${theme.base.spacing};\n }\n `;\n});\n\nStyledAddCustomStepButton.defaultProps = defaultThemeProp;\n\nexport const StyledAddStepButton = styled(Button)``;\n\nexport const StyledCardContent = styled.div<{ hasSteps?: boolean }>(({ hasSteps, theme }) => {\n if (!hasSteps) return;\n\n return css`\n & > ${StyledButton}, & > ${StyledAddCustomStepButton} {\n margin-block-start: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledCardContent.defaultProps = defaultThemeProp;\n\nexport const StyledTaskButton = styled.button<Pick<TaskComponentProps, 'visual'>>(\n ({ theme, visual }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: none;\n height: ${theme.components.button.height};\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n text-align: start;\n\n ${visual.imgSrc &&\n css`\n padding-inline-start: calc(0.5 * ${theme.base.spacing});\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &:focus {\n outline: none;\n }\n `;\n }\n);\n\nStyledTaskButton.defaultProps = defaultThemeProp;\n\nexport const StyledTask = styled.article<{\n hasFocus: boolean;\n hasSteps?: boolean;\n dragEnabled?: boolean;\n}>(({ hasFocus, hasSteps, theme, dragEnabled }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border: 0.125rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: calc(${theme.base.spacing} - 0.125rem);\n\n ${hasFocus &&\n css`\n box-shadow: ${theme.base.shadow.focus};\n `}\n\n &:hover {\n cursor: pointer;\n }\n\n &[aria-current='true'] {\n border-color: ${theme.base.palette.interactive};\n }\n\n ${hasSteps &&\n !dragEnabled &&\n css`\n ${StyledAddCustomStepButton} ,${StyledAddStepButton} {\n margin-block-start: calc(0.5 * ${theme.base.spacing});\n }\n `}\n `;\n});\n\nStyledTask.defaultProps = defaultThemeProp;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n margin-inline-end: ${theme.base.spacing};\n\n &:hover {\n cursor: pointer;\n }\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nconst Task: FunctionComponent<TaskComponentProps & ForwardProps> = ({\n value,\n visual,\n actions,\n item,\n addStepTitle,\n addTask,\n stageItem,\n error,\n onAddStep,\n onAddCustomStep,\n onClick,\n categoryItem,\n id,\n step: stepProp,\n nodeLibrary,\n ...restProps\n}: PropsWithChildren<TaskComponentProps>) => {\n const t = useI18n();\n const { selectedItemId, readOnly, dragEnabled, onDragDrop } = useContext(LifeCycleContext);\n const [taskHasFocus, setTaskHasFocus] = useState(false);\n const [taskButtonEl, setTaskButtonEl] = useElement();\n const [addEl, setAddEl] = useElement<HTMLButtonElement>(null);\n\n const taskTestID = generateDynamicTestId([stageItem.label, categoryItem.categoryLabel, value]);\n const testIds = useTestIds(taskTestID, getTaskTestIds);\n const stepTestIds = useTestIds(taskTestID, getStepTestIds);\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n // Deep copy of actions is required to provide consistent callback objects on actions\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.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({\n ...actionCloneItem,\n 'data-testid': testIds.actionButton\n });\n return actionItem;\n });\n }\n\n const onTaskClick = (e: MouseEvent) => {\n const actionParam: LifeCycleActionParam = {\n value,\n task: item,\n stage: stageItem,\n category: categoryItem,\n type: 'Task'\n };\n onClick?.(actionParam, e);\n };\n\n const onLibraryItemSelect = useCallback(\n (libItem: LibraryItem) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddStep?.(param, libItem);\n },\n [onAddStep]\n );\n\n const isEmpty = (readOnly || (!readOnly && !addStepTitle)) && !item?.steps?.length && !value;\n\n const getStepProps = useCallback(\n (step: StepItemProps, index: number): StepComponentProps => {\n return {\n id: step.id,\n value: step.label,\n visual: {\n imgSrc: step.visual.imgSrc,\n name: step.visual.name,\n label: step.visual.label,\n category: step.visual.category,\n inverted: step.visual.inverted\n },\n item: { ...step, index, alternate: item.alternate },\n taskItem: item,\n stageItem,\n badge: {\n type: step?.status?.type ?? '',\n label: step?.status?.label ?? ''\n },\n error: step.error,\n categoryItem\n };\n },\n [categoryItem, item, stageItem]\n );\n\n const addStepRegion = (\n <>\n {!readOnly && addStepTitle && nodeLibrary && (\n <>\n <Button\n as={StyledAddStepButton}\n data-testid={stepTestIds.addButton}\n variant='simple'\n label={t('add_noun', [addStepTitle])}\n onClick={(e: MouseEvent<HTMLButtonElement>) => setAddEl(e.currentTarget)}\n icon\n >\n <Icon name='plus' />\n </Button>\n {addEl && (\n <ItemLibrary\n items={nodeLibrary}\n target={addEl}\n onClick={onLibraryItemSelect}\n onDismiss={() => setAddEl(null)}\n placeholder={t('search_placeholder_default')}\n />\n )}\n </>\n )}\n {!readOnly && addStepTitle && !nodeLibrary && onAddCustomStep && (\n <Button\n as={StyledAddCustomStepButton}\n data-testid={stepTestIds.addButton}\n variant='link'\n onClick={() => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddCustomStep(param);\n }}\n >\n <Icon name='plus' />\n {t('add_noun', [addStepTitle])}\n </Button>\n )}\n </>\n );\n\n return (\n <StyledTaskList data-testid={testIds.root} {...restProps} id={item.id}>\n {isEmpty ? (\n <Flex container={{ justify: 'center', pad: 1 }}>\n <Text variant='secondary'>No Steps</Text>\n </Flex>\n ) : (\n <Flex\n as={StyledTask}\n aria-current={selectedItemId === id ? 'true' : undefined}\n container={{ direction: 'column' }}\n hasFocus={taskHasFocus && selectedItemId !== id}\n hasSteps={!!item?.steps?.length}\n dragEnabled={dragEnabled}\n >\n {!!value && (\n <Flex as={StyledCardHeader} container={{ inline: true, alignItems: 'center' }}>\n {visual?.imgSrc?.length > 0 && <Avatar name={value} imageSrc={visual?.imgSrc} />}\n {error && <StyledWarnIcon name='warn-solid' />}\n <Flex\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center' }}\n onClick={onTaskClick}\n >\n <StyledTaskButton\n onFocus={() => {\n setTaskHasFocus(true);\n }}\n onBlur={() => {\n setTaskHasFocus(false);\n }}\n aria-label={t(error ? 'process_name_error' : 'process_name', [value])}\n visual={visual}\n ref={setTaskButtonEl}\n >\n {value}\n </StyledTaskButton>\n {taskButtonEl && (\n <Tooltip target={taskButtonEl} smart>\n {value}\n </Tooltip>\n )}\n </Flex>\n {actionsClone && (\n <Actions\n items={actionsClone}\n menuAt={2}\n iconOnly\n contextualLabel={t('process_name', [value])}\n />\n )}\n </Flex>\n )}\n <StyledCardContent hasSteps={!!item?.steps?.length} as={dragEnabled ? 'div' : 'ul'}>\n {dragEnabled ? (\n <LifeCycleDragDropList\n type={stageItem.alternate ? 'alternate-step' : 'step'}\n listLocation={{\n alternate: !!stageItem.alternate,\n stage: stageItem.index,\n category: categoryItem.index,\n task: item.index,\n subTask: item.subIndex\n }}\n items={item?.steps?.map((step, index) => ({\n id: step.id,\n type: stageItem.alternate ? 'alternate-step' : 'step',\n data: { ...stepProp, ...getStepProps(step, index) }\n }))}\n itemRenderer={Step}\n onDragDrop={onDragDrop}\n additionalDropZone={addStepRegion}\n />\n ) : (\n <>\n {item?.steps?.map((step, index) => (\n <Step {...stepProp} key={step.id} {...getStepProps(step, index)} />\n ))}\n </>\n )}\n </StyledCardContent>\n {!dragEnabled && <div>{addStepRegion}</div>}\n </Flex>\n )}\n </StyledTaskList>\n );\n};\n\nexport default withTestIds(Task, getTaskTestIds);\n"]}
@@ -1,3 +1,4 @@
1
1
  export { default } from './LifeCycle';
2
- export type { StepItemProps, TaskItemProps, StageItemProps, CategoryItemProps, CategoriesItemProps, LifeCycleActionParam, LifeCycleAction, LifeCycleProps } from './LifeCycle.types';
2
+ export { defaultDragDropConfig, moveStage, moveStep } from './utils';
3
+ export type { StepItemProps, TaskItemProps, StageItemProps, CategoryItemProps, CategoriesItemProps, LifeCycleActionParam, LifeCycleAction, LifeCycleDragDropEvent, DragDropConfig, LifeCycleProps } from './LifeCycle.types';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACf,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACrE,YAAY,EACV,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,cAAc,EACf,MAAM,mBAAmB,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { default } from './LifeCycle';
2
+ export { defaultDragDropConfig, moveStage, moveStep } from './utils';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { default } from './LifeCycle';\nexport type {\n StepItemProps,\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam,\n LifeCycleAction,\n LifeCycleProps\n} from './LifeCycle.types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC","sourcesContent":["export { default } from './LifeCycle';\nexport { defaultDragDropConfig, moveStage, moveStep } from './utils';\nexport type {\n StepItemProps,\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam,\n LifeCycleAction,\n LifeCycleDragDropEvent,\n DragDropConfig,\n LifeCycleProps\n} from './LifeCycle.types';\n"]}
@@ -0,0 +1,14 @@
1
+ import type { DragDropConfig, IndexData, LifeCycleDragDropEvent, StageItemProps } from './LifeCycle.types';
2
+ import type { LifeCycleContextValue } from './LifeCycleContext';
3
+ export declare const defaultDragDropConfig: DragDropConfig;
4
+ export declare const generateDynamicTestId: (arr: (string | undefined)[]) => string;
5
+ export declare const moveStage: (event: LifeCycleDragDropEvent, stages: StageItemProps[], alternateStages: StageItemProps[]) => {
6
+ stages: StageItemProps[];
7
+ alternateStages: StageItemProps[];
8
+ } | undefined;
9
+ export declare const moveStep: (event: LifeCycleDragDropEvent, stages: StageItemProps[], alternateStages: StageItemProps[]) => {
10
+ stages: StageItemProps[];
11
+ alternateStages: StageItemProps[];
12
+ } | undefined;
13
+ export declare const getListLocation: (currentListLocation: IndexData, type: LifeCycleDragDropEvent["type"], lifeCycleData: LifeCycleContextValue["lifeCycleData"], direction: "prev" | "next") => IndexData | undefined;
14
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,sBAAsB,EACtB,cAAc,EAGf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,eAAO,MAAM,qBAAqB,EAAE,cAiBnC,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAS,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,WAKhE,CAAC;AAgCF,eAAO,MAAM,SAAS,UACb,sBAAsB,UACrB,cAAc,EAAE,mBACP,cAAc,EAAE;;;aA0BlC,CAAC;AAEF,eAAO,MAAM,QAAQ,UACZ,sBAAsB,UACrB,cAAc,EAAE,mBACP,cAAc,EAAE;;;aAqBlC,CAAC;AAmKF,eAAO,MAAM,eAAe,wBACL,SAAS,QACxB,sBAAsB,CAAC,MAAM,CAAC,iBACrB,qBAAqB,CAAC,eAAe,CAAC,aAC1C,MAAM,GAAG,MAAM,KACzB,SAAS,GAAG,SAmDd,CAAC"}
@@ -0,0 +1,250 @@
1
+ export const defaultDragDropConfig = {
2
+ stage: {
3
+ enabled: true,
4
+ accept: ['stage', 'alternate-stage']
5
+ },
6
+ step: {
7
+ enabled: true,
8
+ accept: ['step', 'alternate-step']
9
+ },
10
+ 'alternate-stage': {
11
+ enabled: true,
12
+ accept: ['stage', 'alternate-stage']
13
+ },
14
+ 'alternate-step': {
15
+ enabled: true,
16
+ accept: ['step', 'alternate-step']
17
+ }
18
+ };
19
+ export const generateDynamicTestId = (arr) => {
20
+ return arr
21
+ .filter(element => element)
22
+ .map(element => element?.replace(/\s+/g, '-').toLowerCase())
23
+ .join('_');
24
+ };
25
+ const getStageData = (stages, indexData) => {
26
+ if (indexData.stage === undefined)
27
+ return;
28
+ return stages[indexData.stage];
29
+ };
30
+ const getCategoryData = (stages, indexData) => {
31
+ if (indexData.category === undefined)
32
+ return;
33
+ const stage = getStageData(stages, indexData);
34
+ if (!stage)
35
+ return;
36
+ return stage.categories[indexData.category];
37
+ };
38
+ const getTaskData = (stages, indexData) => {
39
+ if (indexData.task === undefined)
40
+ return;
41
+ const category = getCategoryData(stages, indexData);
42
+ if (!category)
43
+ return;
44
+ if (Array.isArray(category.tasks[indexData.task])) {
45
+ if (indexData.subTask === undefined)
46
+ return;
47
+ return category.tasks[indexData.task][indexData.subTask];
48
+ }
49
+ return category.tasks[indexData.task];
50
+ };
51
+ const getStepData = (stages, indexData) => {
52
+ if (indexData.step === undefined)
53
+ return;
54
+ const task = getTaskData(stages, indexData);
55
+ if (!task)
56
+ return;
57
+ return task.steps[indexData.step];
58
+ };
59
+ export const moveStage = (event, stages, alternateStages) => {
60
+ let stagesClone = JSON.parse(JSON.stringify(stages));
61
+ let alternateStagesClone = JSON.parse(JSON.stringify(alternateStages));
62
+ // Remove the stage from its original position
63
+ let sourceData = event.sourceData.alternate ? alternateStagesClone : stagesClone;
64
+ const stage = getStageData(sourceData, event.sourceData);
65
+ if (!stage || event.targetData.stage === undefined)
66
+ return;
67
+ sourceData = sourceData.filter((item) => item.id !== stage.id);
68
+ if (event.sourceData.alternate) {
69
+ alternateStagesClone = sourceData;
70
+ }
71
+ else {
72
+ stagesClone = sourceData;
73
+ }
74
+ // Insert the stage in its new position
75
+ const targetData = event.targetData.alternate ? alternateStagesClone : stagesClone;
76
+ targetData.splice(event.targetData.stage, 0, stage);
77
+ if (event.targetData.alternate) {
78
+ alternateStagesClone = targetData;
79
+ }
80
+ else {
81
+ stagesClone = targetData;
82
+ }
83
+ return { stages: stagesClone, alternateStages: alternateStagesClone };
84
+ };
85
+ export const moveStep = (event, stages, alternateStages) => {
86
+ const stagesClone = JSON.parse(JSON.stringify(stages));
87
+ const alternateStagesClone = JSON.parse(JSON.stringify(alternateStages));
88
+ const sourceData = event.sourceData.alternate ? alternateStagesClone : stagesClone;
89
+ const targetData = event.targetData.alternate ? alternateStagesClone : stagesClone;
90
+ // Remove the step from its original position
91
+ const parentTask = getTaskData(sourceData, event.sourceData);
92
+ const step = getStepData(sourceData, event.sourceData);
93
+ if (!parentTask || !step)
94
+ return;
95
+ parentTask.steps = parentTask.steps.filter((item) => item.id !== step.id);
96
+ // Insert the step in its new position
97
+ const targetTask = getTaskData(targetData, event.targetData);
98
+ if (!targetTask || event.targetData.step === undefined)
99
+ return;
100
+ targetTask.steps = targetTask.steps || [];
101
+ targetTask.steps.splice(event.targetData.step, 0, step);
102
+ return { stages: stagesClone, alternateStages: alternateStagesClone };
103
+ };
104
+ const getTargetTaskLocation = (stages, currentListLocation, direction, layer) => {
105
+ const { stage, category, task } = currentListLocation;
106
+ if (currentListLocation[layer] === undefined || stage === undefined) {
107
+ return;
108
+ }
109
+ const jump = direction === 'next' ? 1 : -1;
110
+ let targetIndex = currentListLocation[layer] + jump;
111
+ if (layer === 'subTask') {
112
+ if (category === undefined || task === undefined) {
113
+ return;
114
+ }
115
+ const parentList = stages[stage].categories[category].tasks[task];
116
+ if (!Array.isArray(parentList)) {
117
+ return;
118
+ }
119
+ if (targetIndex < 0 || targetIndex >= parentList.length) {
120
+ return getTargetTaskLocation(stages, { ...currentListLocation, subTask: undefined }, direction, 'task');
121
+ }
122
+ return { ...currentListLocation, subTask: targetIndex, step: 0 };
123
+ }
124
+ if (layer === 'task') {
125
+ if (category === undefined) {
126
+ return;
127
+ }
128
+ const parentList = stages[stage].categories[category].tasks;
129
+ if (!Array.isArray(parentList)) {
130
+ return;
131
+ }
132
+ if (targetIndex < 0 || targetIndex >= parentList.length) {
133
+ return getTargetTaskLocation(stages, { ...currentListLocation, task: undefined }, direction, 'category');
134
+ }
135
+ if (Array.isArray(parentList[targetIndex])) {
136
+ return {
137
+ ...currentListLocation,
138
+ task: targetIndex,
139
+ subTask: direction === 'next' ? 0 : parentList[targetIndex].length - 1,
140
+ step: 0
141
+ };
142
+ }
143
+ return { ...currentListLocation, task: targetIndex, step: 0 };
144
+ }
145
+ if (layer === 'category') {
146
+ const parentList = stages[stage].categories;
147
+ if (!Array.isArray(parentList)) {
148
+ return;
149
+ }
150
+ if (targetIndex < 0 || targetIndex >= parentList.length) {
151
+ return getTargetTaskLocation(stages, { ...currentListLocation, category: undefined }, direction, 'stage');
152
+ }
153
+ while (parentList[targetIndex].tasks.length === 0) {
154
+ targetIndex += jump;
155
+ if (targetIndex < 0 || targetIndex >= parentList.length) {
156
+ return getTargetTaskLocation(stages, { ...currentListLocation, category: undefined }, direction, 'stage');
157
+ }
158
+ }
159
+ const taskIndex = direction === 'next' ? 0 : parentList[targetIndex].tasks.length - 1;
160
+ if (Array.isArray(parentList[targetIndex].tasks[taskIndex])) {
161
+ return {
162
+ ...currentListLocation,
163
+ category: targetIndex,
164
+ task: taskIndex,
165
+ subTask: direction === 'next'
166
+ ? 0
167
+ : parentList[targetIndex].tasks[taskIndex].length - 1,
168
+ step: 0
169
+ };
170
+ }
171
+ return { ...currentListLocation, category: targetIndex, task: taskIndex, step: 0 };
172
+ }
173
+ if (layer === 'stage') {
174
+ const parentList = stages;
175
+ if (!Array.isArray(parentList)) {
176
+ return;
177
+ }
178
+ if (targetIndex < 0 || targetIndex >= parentList.length) {
179
+ // Returns false to indicate that the target may be in an adjacent stages list
180
+ return false;
181
+ }
182
+ if (parentList[targetIndex].categories.length === 0 ||
183
+ parentList[targetIndex].categories[0].tasks.length === 0) {
184
+ while (parentList[targetIndex].categories.length === 0 ||
185
+ parentList[targetIndex].categories[0].tasks.length === 0) {
186
+ targetIndex += jump;
187
+ if (targetIndex < 0 || targetIndex >= parentList.length) {
188
+ // Returns false to indicate that the target may be in an adjacent stages list
189
+ return false;
190
+ }
191
+ }
192
+ }
193
+ const categoryIndex = direction === 'next' ? 0 : parentList[targetIndex].categories.length - 1;
194
+ const taskIndex = direction === 'next' ? 0 : parentList[targetIndex].categories[categoryIndex].tasks.length - 1;
195
+ if (Array.isArray(parentList[targetIndex].categories[categoryIndex].tasks[taskIndex])) {
196
+ return {
197
+ ...currentListLocation,
198
+ stage: targetIndex,
199
+ category: categoryIndex,
200
+ task: taskIndex,
201
+ subTask: direction === 'next'
202
+ ? 0
203
+ : parentList[targetIndex].categories[categoryIndex].tasks[taskIndex].length - 1,
204
+ step: 0
205
+ };
206
+ }
207
+ return {
208
+ ...currentListLocation,
209
+ stage: targetIndex,
210
+ category: categoryIndex,
211
+ task: taskIndex,
212
+ step: 0
213
+ };
214
+ }
215
+ };
216
+ export const getListLocation = (currentListLocation, type, lifeCycleData, direction) => {
217
+ const { stages, alternateStages } = lifeCycleData;
218
+ const alternate = currentListLocation.alternate;
219
+ if (type === 'stage') {
220
+ const targetList = alternate ? stages : alternateStages;
221
+ if (targetList.length === 0) {
222
+ return;
223
+ }
224
+ return { stage: direction === 'next' ? 0 : targetList.length, alternate: !alternate };
225
+ }
226
+ if (type === 'step') {
227
+ const { stage, category, task } = currentListLocation;
228
+ if (stage === undefined || category === undefined || task === undefined) {
229
+ return;
230
+ }
231
+ const sourceList = alternate ? alternateStages : stages;
232
+ const currentStage = sourceList[stage];
233
+ const currentCategory = currentStage.categories[category];
234
+ const currentTask = currentCategory.tasks[task];
235
+ let targetTaskLocation = getTargetTaskLocation(sourceList, currentListLocation, direction, Array.isArray(currentTask) ? 'subTask' : 'task');
236
+ // If the target task location is false, it means that the target could be in an adjacent list
237
+ if (targetTaskLocation === false) {
238
+ const adjacentList = alternate ? stages : alternateStages;
239
+ // Set the entry point to 1 index out of bounds since getTargetTaskLocation will move the target index by 1
240
+ const entryPoint = direction === 'next' ? -1 : adjacentList.length;
241
+ targetTaskLocation = getTargetTaskLocation(adjacentList, { alternate: !alternate, stage: entryPoint }, direction, 'stage');
242
+ // If the target is not in an adjacent list, return undefined
243
+ if (targetTaskLocation === false) {
244
+ return;
245
+ }
246
+ }
247
+ return targetTaskLocation;
248
+ }
249
+ };
250
+ //# sourceMappingURL=utils.js.map