@pega/cosmos-react-build 3.0.0-dev.4.1 → 3.0.0-dev.6.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 (152) hide show
  1. package/lib/components/AppHeader/AppHeader.js +4 -4
  2. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  3. package/lib/components/AppHeader/BranchButton.js +1 -1
  4. package/lib/components/AppHeader/BranchButton.js.map +1 -1
  5. package/lib/components/AppShell/AppShell.js +9 -9
  6. package/lib/components/AppShell/AppShell.js.map +1 -1
  7. package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
  8. package/lib/components/DynamicContentEditor/DynamicContentEditor.js +8 -4
  9. package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
  10. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts +2 -0
  11. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.d.ts.map +1 -1
  12. package/lib/components/DynamicContentEditor/DynamicContentEditor.types.js.map +1 -1
  13. package/lib/components/FlowModeller/AddNode.d.ts +9 -7
  14. package/lib/components/FlowModeller/AddNode.d.ts.map +1 -1
  15. package/lib/components/FlowModeller/AddNode.js +9 -3
  16. package/lib/components/FlowModeller/AddNode.js.map +1 -1
  17. package/lib/components/FlowModeller/Connector.d.ts +7 -0
  18. package/lib/components/FlowModeller/Connector.d.ts.map +1 -0
  19. package/lib/components/FlowModeller/Connector.js +34 -0
  20. package/lib/components/FlowModeller/Connector.js.map +1 -0
  21. package/lib/components/FlowModeller/DeletePopover.d.ts +26 -0
  22. package/lib/components/FlowModeller/DeletePopover.d.ts.map +1 -0
  23. package/lib/components/FlowModeller/DeletePopover.js +105 -0
  24. package/lib/components/FlowModeller/DeletePopover.js.map +1 -0
  25. package/lib/components/FlowModeller/FlowModeller.d.ts +3 -1
  26. package/lib/components/FlowModeller/FlowModeller.d.ts.map +1 -1
  27. package/lib/components/FlowModeller/FlowModeller.js +108 -58
  28. package/lib/components/FlowModeller/FlowModeller.js.map +1 -1
  29. package/lib/components/FlowModeller/Node/Node.types.d.ts +13 -7
  30. package/lib/components/FlowModeller/Node/Node.types.d.ts.map +1 -1
  31. package/lib/components/FlowModeller/Node/Node.types.js +2 -3
  32. package/lib/components/FlowModeller/Node/Node.types.js.map +1 -1
  33. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +6 -4
  34. package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +1 -1
  35. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +17 -10
  36. package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +1 -1
  37. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +1 -1
  38. package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +1 -1
  39. package/lib/components/FlowModeller/Node/NodeTemplates.js +26 -15
  40. package/lib/components/FlowModeller/Node/NodeTemplates.js.map +1 -1
  41. package/lib/components/FlowModeller/Node.d.ts +5 -0
  42. package/lib/components/FlowModeller/Node.d.ts.map +1 -0
  43. package/lib/components/FlowModeller/Node.js +23 -0
  44. package/lib/components/FlowModeller/Node.js.map +1 -0
  45. package/lib/components/FlowModeller/Renderer/Connectors.d.ts +2 -0
  46. package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +1 -1
  47. package/lib/components/FlowModeller/Renderer/Connectors.js +5 -3
  48. package/lib/components/FlowModeller/Renderer/Connectors.js.map +1 -1
  49. package/lib/components/FlowModeller/Renderer/Nodes.d.ts +2 -0
  50. package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +1 -1
  51. package/lib/components/FlowModeller/Renderer/Nodes.js +9 -3
  52. package/lib/components/FlowModeller/Renderer/Nodes.js.map +1 -1
  53. package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +1 -1
  54. package/lib/components/FlowModeller/Renderer/Renderer.js +2 -2
  55. package/lib/components/FlowModeller/Renderer/Renderer.js.map +1 -1
  56. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +10 -4
  57. package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +1 -1
  58. package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +1 -1
  59. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +3 -3
  60. package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +1 -1
  61. package/lib/components/FlowModeller/Renderer/Utils/Graph.js +7 -1
  62. package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +1 -1
  63. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +8 -4
  64. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +1 -1
  65. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +23 -3
  66. package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +1 -1
  67. package/lib/components/FlowModeller/Utils/{AddNodeUtils.d.ts → addNodeUtils.d.ts} +1 -1
  68. package/lib/components/FlowModeller/Utils/{AddNodeUtils.d.ts.map → addNodeUtils.d.ts.map} +1 -1
  69. package/lib/components/FlowModeller/Utils/{AddNodeUtils.js → addNodeUtils.js} +1 -1
  70. package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +1 -0
  71. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +21 -0
  72. package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +1 -0
  73. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +71 -0
  74. package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +1 -0
  75. package/lib/components/FlowModeller/helper.d.ts +2 -1
  76. package/lib/components/FlowModeller/helper.d.ts.map +1 -1
  77. package/lib/components/FlowModeller/helper.js +17 -2
  78. package/lib/components/FlowModeller/helper.js.map +1 -1
  79. package/lib/components/FlowModeller/index.d.ts +5 -1
  80. package/lib/components/FlowModeller/index.d.ts.map +1 -1
  81. package/lib/components/FlowModeller/index.js +5 -1
  82. package/lib/components/FlowModeller/index.js.map +1 -1
  83. package/lib/components/ItemLibrary/ItemLibrary.d.ts +8 -6
  84. package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
  85. package/lib/components/ItemLibrary/ItemLibrary.js +6 -5
  86. package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
  87. package/lib/components/LifeCycle/Category.d.ts.map +1 -1
  88. package/lib/components/LifeCycle/Category.js +6 -3
  89. package/lib/components/LifeCycle/Category.js.map +1 -1
  90. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
  91. package/lib/components/LifeCycle/LifeCycle.js +2 -3
  92. package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
  93. package/lib/components/LifeCycle/LifeCycle.types.d.ts +2 -4
  94. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
  95. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
  96. package/lib/components/LifeCycle/LifeCycleList.d.ts +1 -1
  97. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
  98. package/lib/components/LifeCycle/LifeCycleList.js +3 -2
  99. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
  100. package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
  101. package/lib/components/LifeCycle/Stage.js +8 -17
  102. package/lib/components/LifeCycle/Stage.js.map +1 -1
  103. package/lib/components/LifeCycle/Step.d.ts +3 -2
  104. package/lib/components/LifeCycle/Step.d.ts.map +1 -1
  105. package/lib/components/LifeCycle/Step.js +8 -30
  106. package/lib/components/LifeCycle/Step.js.map +1 -1
  107. package/lib/components/LifeCycle/Task.d.ts +4 -1
  108. package/lib/components/LifeCycle/Task.d.ts.map +1 -1
  109. package/lib/components/LifeCycle/Task.js +17 -10
  110. package/lib/components/LifeCycle/Task.js.map +1 -1
  111. package/lib/components/LifeCycle/index.d.ts +1 -2
  112. package/lib/components/LifeCycle/index.d.ts.map +1 -1
  113. package/lib/components/LifeCycle/index.js.map +1 -1
  114. package/lib/components/ObjectSelect/ObjectConfig.js +3 -3
  115. package/lib/components/ObjectSelect/ObjectConfig.js.map +1 -1
  116. package/lib/components/ObjectSelect/ObjectPicker.js +1 -1
  117. package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
  118. package/lib/components/ObjectSelect/ObjectSelect.js +1 -1
  119. package/lib/components/ObjectSelect/ObjectSelect.js.map +1 -1
  120. package/lib/components/ObjectSelect/ObjectSummary.js +1 -1
  121. package/lib/components/ObjectSelect/ObjectSummary.js.map +1 -1
  122. package/lib/components/PageTemplates/GalleryPage.js +4 -4
  123. package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
  124. package/lib/components/PageTemplates/PageTemplates.js +7 -7
  125. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  126. package/lib/components/SummaryCard/SummaryCard.js +1 -1
  127. package/lib/components/SummaryCard/SummaryCard.js.map +1 -1
  128. package/lib/components/Visual/Visual.js +1 -1
  129. package/lib/components/Visual/Visual.js.map +1 -1
  130. package/lib/components/Workbench/ConfigurationPanel.js +1 -1
  131. package/lib/components/Workbench/ConfigurationPanel.js.map +1 -1
  132. package/lib/components/Workbench/Toolbar.js +2 -2
  133. package/lib/components/Workbench/Toolbar.js.map +1 -1
  134. package/lib/components/Workbench/UtilityPanel.js +1 -1
  135. package/lib/components/Workbench/UtilityPanel.js.map +1 -1
  136. package/lib/components/Workbench/Workbench.d.ts.map +1 -1
  137. package/lib/components/Workbench/Workbench.js +1 -1
  138. package/lib/components/Workbench/Workbench.js.map +1 -1
  139. package/lib/index.d.ts +1 -0
  140. package/lib/index.d.ts.map +1 -1
  141. package/lib/index.js +1 -0
  142. package/lib/index.js.map +1 -1
  143. package/lib/utils/index.d.ts +2 -0
  144. package/lib/utils/index.d.ts.map +1 -0
  145. package/lib/utils/index.js +2 -0
  146. package/lib/utils/index.js.map +1 -0
  147. package/lib/utils/utils.d.ts +14 -0
  148. package/lib/utils/utils.d.ts.map +1 -0
  149. package/lib/utils/utils.js +13 -0
  150. package/lib/utils/utils.js.map +1 -0
  151. package/package.json +4 -4
  152. package/lib/components/FlowModeller/Utils/AddNodeUtils.js.map +0 -1
@@ -3,6 +3,10 @@ export { START_NODETYPE, STOP_NODETYPE } from './Node/Node.types';
3
3
  export { default as FlowRenderer } from './Renderer/Renderer';
4
4
  export { DirectedGraph } from './Renderer/Utils/Graph';
5
5
  export { default as GraphTraversal } from './Renderer/Utils/GraphTraversal';
6
- export { default as PlaceHolderHelper, isPlaceHolderConnector, isPlaceHolderNode } from './Utils/AddNodeUtils';
6
+ export { default as PlaceHolderHelper, isPlaceHolderConnector, isPlaceHolderNode } from './Utils/addNodeUtils';
7
7
  export { default as FlowModellerHelper } from './helper';
8
+ export { default as DeletePopover } from './DeletePopover';
9
+ export { default as Connector } from './Connector';
10
+ export { default as Node } from './Node';
11
+ export { default as deleteNodeUtils } from './Utils/deleteNodeUtils';
8
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAKL,cAAc,EACd,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAO9D,OAAO,EAAE,aAAa,EAA6B,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,sBAAsB,EACtB,iBAAiB,EAGlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default, FlowModellerProps } from './FlowModeller';\nexport {\n ActionParams,\n NodeProps,\n NodeType,\n NodeLibraryItem,\n START_NODETYPE,\n STOP_NODETYPE\n} from './Node/Node.types';\nexport { default as FlowRenderer } from './Renderer/Renderer';\nexport {\n RendererProps,\n RendererConnectorProps,\n RendererNodeProps,\n AddNodeHandlerParams\n} from './Renderer/Renderer.types';\nexport { DirectedGraph, GraphData, ConnectorProps } from './Renderer/Utils/Graph';\nexport { default as GraphTraversal } from './Renderer/Utils/GraphTraversal';\nexport { PlottedGraphConnector, PlottedGraphNode } from './Renderer/Utils/GraphLayout';\nexport {\n default as PlaceHolderHelper,\n isPlaceHolderConnector,\n isPlaceHolderNode,\n PlaceHolderConnector,\n PlaceHolderNode\n} from './Utils/AddNodeUtils';\nexport { default as FlowModellerHelper } from './helper';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/FlowModeller/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAKL,cAAc,EACd,aAAa,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAO9D,OAAO,EAAE,aAAa,EAA6B,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAE5E,OAAO,EACL,OAAO,IAAI,iBAAiB,EAC5B,sBAAsB,EACtB,iBAAiB,EAGlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAqB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,yBAAyB,CAAC","sourcesContent":["export { default, FlowModellerProps } from './FlowModeller';\nexport {\n ActionParams,\n NodeProps,\n NodeType,\n NodeLibraryItem,\n START_NODETYPE,\n STOP_NODETYPE\n} from './Node/Node.types';\nexport { default as FlowRenderer } from './Renderer/Renderer';\nexport {\n RendererProps,\n RendererConnectorProps,\n RendererNodeProps,\n AddNodeHandlerParams\n} from './Renderer/Renderer.types';\nexport { DirectedGraph, GraphData, ConnectorProps } from './Renderer/Utils/Graph';\nexport { default as GraphTraversal } from './Renderer/Utils/GraphTraversal';\nexport { PlottedGraphConnector, PlottedGraphNode } from './Renderer/Utils/GraphLayout';\nexport {\n default as PlaceHolderHelper,\n isPlaceHolderConnector,\n isPlaceHolderNode,\n PlaceHolderConnector,\n PlaceHolderNode\n} from './Utils/addNodeUtils';\nexport { default as FlowModellerHelper } from './helper';\nexport { default as DeletePopover, DeleteNodeOutcome } from './DeletePopover';\nexport { default as Connector } from './Connector';\nexport { default as Node } from './Node';\nexport { default as deleteNodeUtils } from './Utils/deleteNodeUtils';\n"]}
@@ -1,15 +1,15 @@
1
1
  import { FC, Ref } from 'react';
2
- import { SearchInputProps, ForwardProps, MenuItemProps } from '@pega/cosmos-react-core';
3
- export declare const StyledIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
4
- export interface ItemVisual {
5
- color: string;
6
- icon: string;
7
- }
2
+ import { SearchInputProps, ForwardProps, MenuItemProps, PopoverProps } from '@pega/cosmos-react-core';
3
+ import { ColorName } from '../../utils';
8
4
  export interface LibraryItem extends MenuItemProps {
9
5
  id: string;
10
6
  type: ItemVisual;
11
7
  items?: LibraryItem[];
12
8
  }
9
+ export interface ItemVisual {
10
+ color: ColorName;
11
+ icon: string;
12
+ }
13
13
  export interface ItemLibraryProps<T extends LibraryItem = LibraryItem> {
14
14
  show: boolean;
15
15
  target: HTMLElement | null;
@@ -17,7 +17,9 @@ export interface ItemLibraryProps<T extends LibraryItem = LibraryItem> {
17
17
  onClick?: (libItem: T) => void;
18
18
  ref?: Ref<HTMLDivElement>;
19
19
  placeholder?: SearchInputProps['placeholder'];
20
+ position?: PopoverProps['placement'];
20
21
  }
22
+ export declare const StyledIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
21
23
  declare const ItemLibrary: FC<ItemLibraryProps & ForwardProps>;
22
24
  export default ItemLibrary;
23
25
  //# sourceMappingURL=ItemLibrary.d.ts.map
@@ -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,EAMd,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,UAAU,yGAWrB,CAAC;AAIH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAMD,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IACnE,IAAI,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;CAC/C;AAED,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAyFpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
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,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IACnE,IAAI,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;AAQH,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CAiGpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -3,6 +3,7 @@ import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'r
3
3
  import styled, { css } from 'styled-components';
4
4
  import { readableColor } from 'polished';
5
5
  import { Icon, Menu, menuHelpers, Popover, SearchInput, cap, createStringMatcher, defaultThemeProp } from '@pega/cosmos-react-core';
6
+ import { colorMap } from '../../utils';
6
7
  export const StyledIcon = styled.div(({ theme }) => {
7
8
  return css `
8
9
  min-height: 2rem;
@@ -19,7 +20,7 @@ StyledIcon.defaultProps = defaultThemeProp;
19
20
  const StyledPopover = styled(Popover) `
20
21
  min-width: 40ch;
21
22
  `;
22
- const ItemLibrary = forwardRef(({ show, target, items, onClick, placeholder }, ref) => {
23
+ const ItemLibrary = forwardRef(({ show, target, items, onClick, placeholder, position = 'bottom-start' }, ref) => {
23
24
  const [search, setSearch] = useState('');
24
25
  const searchEleRef = useRef(null);
25
26
  useEffect(() => {
@@ -43,9 +44,9 @@ const ItemLibrary = forwardRef(({ show, target, items, onClick, placeholder }, r
43
44
  return {
44
45
  ...node,
45
46
  visual: nodeItem.type ? (_jsx(StyledIcon, { id: node.id, style: {
46
- '--bg-color': nodeItem.type.color,
47
- '--fg-color': readableColor(nodeItem.type.color)
48
- }, children: _jsx(Icon, { name: nodeItem.type.icon }, void 0) }, void 0)) : undefined,
47
+ '--bg-color': colorMap[nodeItem.type.color],
48
+ '--fg-color': readableColor(colorMap[nodeItem.type.color])
49
+ }, children: _jsx(Icon, { name: nodeItem.type.icon }) })) : undefined,
49
50
  count: node.items ? node.items.length : undefined,
50
51
  secondary: node.secondary,
51
52
  selected: selectable ? !!node.selected : undefined
@@ -58,7 +59,7 @@ const ItemLibrary = forwardRef(({ show, target, items, onClick, placeholder }, r
58
59
  onClick(selectedNode);
59
60
  }
60
61
  }, [onClick]);
61
- return (_jsx(_Fragment, { children: show && (_jsx(StyledPopover, { show: show, target: target, ref: ref, children: _jsx(Menu, { items: itemsToRender, onItemClick: onItemSelect, header: _jsx(SearchInput, { ref: searchEleRef, onSearchChange: setSearch, value: search, searchInputAriaLabel: placeholder, placeholder: placeholder }, void 0) }, void 0) }, void 0)) }, void 0));
62
+ return (_jsx(_Fragment, { children: show && (_jsx(StyledPopover, { 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 }) })) }));
62
63
  });
63
64
  export default ItemLibrary;
64
65
  //# 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,EACjB,MAAM,yBAAyB,CAAC;AAEjC,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;AAa3C,MAAM,aAAa,GAAmB,MAAM,CAAC,OAAO,CAAC,CAAA;;CAEpD,CAAC;AAWF,MAAM,WAAW,GAAwC,UAAU,CACjE,CACE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAqC,EAChF,GAA4B,EAC5B,EAAE;IACF,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAEzC,MAAM,YAAY,GAAG,MAAM,C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,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,WAAI,WACvB,CACd,CAAC,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;IACF,OAAO,CACL,4BACG,IAAI,IAAI,CACP,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,YACjD,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,WACxB,WAEJ,WACY,CACjB,WACA,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} from '@pega/cosmos-react-core';\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\nexport interface ItemVisual {\n color: string;\n icon: string;\n}\n\nexport interface LibraryItem extends MenuItemProps {\n id: string;\n type: ItemVisual;\n items?: LibraryItem[];\n}\n\nconst StyledPopover: typeof Popover = styled(Popover)`\n min-width: 40ch;\n`;\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}\n\nconst ItemLibrary: FC<ItemLibraryProps & ForwardProps> = forwardRef(\n (\n { show, target, items, onClick, placeholder }: 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': nodeItem.type.color,\n '--fg-color': readableColor(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 return (\n <>\n {show && (\n <StyledPopover show={show} 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 />\n </StyledPopover>\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;AAqBlD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,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Y,CAAC,CAAC;SACvB;IACH,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IACF,OAAO,CACL,4BACG,IAAI,IAAI,CACP,KAAC,aAAa,IAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,YACtE,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,GACY,CACjB,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 StyledPopover: typeof Popover = styled(Popover)`\n min-width: 40ch;\n`;\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 return (\n <>\n {show && (\n <StyledPopover 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 </StyledPopover>\n )}\n </>\n );\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,EAAE,iBAAiB,EAAc,GAAG,EAAyC,MAAM,OAAO,CAAC;AAGlG,OAAO,EACL,YAAY,EACZ,SAAS,EAST,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAEL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAC3B,OAAa,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEzC,MAAM,WAAW,eAAgB,SAAQ,mBAAmB;IAE1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAc,SAAQ,SAAS,EAAE,cAAc;IAC9D,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAE5B,IAAI,EAAE,iBAAiB,CAAC;IAExB,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,0BAA0B;IAC1B,IAAI,EAAE,SAAS,CAAC;IAChB,6CAA6C;IAC7C,SAAS,EAAE,cAAc,CAAC;IAC1B,2BAA2B;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,cAAc;eAA0B,OAAO;SAQ1D,CAAC;AAEH,eAAO,MAAM,UAAU;eAA0B,eAAe,GAAG,SAAS;QAAM,MAAM;SAUvF,CAAC;AAEF,eAAO,MAAM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Q,EAAE,iBAAiB,CAAC,aAAa,GAAG,YAAY,CA+G7D,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -12,6 +12,7 @@ export const StyledCategory = styled.h3(({ showTitle, theme }) => {
12
12
  margin: ${theme.base.spacing} 0 0 0;
13
13
  `;
14
14
  });
15
+ StyledCategory.defaultProps = defaultThemeProp;
15
16
  export const StyledList = styled.ol(({ category, theme, id }) => {
16
17
  return css `
17
18
  margin-block-start: ${theme.base.spacing};
@@ -21,6 +22,7 @@ export const StyledList = styled.ol(({ category, theme, id }) => {
21
22
  `}
22
23
  `;
23
24
  });
25
+ StyledList.defaultProps = defaultThemeProp;
24
26
  export const StyledParallelTitle = styled.div(({ theme }) => {
25
27
  return css `
26
28
  position: relative;
@@ -48,6 +50,7 @@ export const StyledParallelTitle = styled.div(({ theme }) => {
48
50
  }
49
51
  `;
50
52
  });
53
+ StyledParallelTitle.defaultProps = defaultThemeProp;
51
54
  export const StyledAddTask = styled.div(({ theme }) => {
52
55
  return css `
53
56
  > button {
@@ -78,7 +81,7 @@ const Category = forwardRef(({ item, showTitle = false, stageItem, category, id,
78
81
  };
79
82
  task?.addTask.onAddTask?.(param, e);
80
83
  };
81
- return (_jsxs(_Fragment, { children: [category?.label && (_jsx(StyledCategory, { showTitle: showTitle, tabIndex: -1, id: item?.categoryId, children: category?.label }, void 0)), _jsxs(StyledList, { ref: ref, role: 'gridcell', category: category, id: item?.id, "data-id": item?.categoryId, children: [item &&
84
+ return (_jsxs(_Fragment, { children: [category?.label && (_jsx(StyledCategory, { showTitle: showTitle, tabIndex: -1, id: item?.categoryId, children: category?.label })), _jsxs(StyledList, { ref: ref, role: 'gridcell', category: category, id: item?.id, "data-id": item?.categoryId, children: [item &&
82
85
  item.tasks.length !== 0 &&
83
86
  item.tasks.map((TaskItem, index) => {
84
87
  if (Array.isArray(TaskItem)) {
@@ -87,12 +90,12 @@ const Category = forwardRef(({ item, showTitle = false, stageItem, category, id,
87
90
  }
88
91
  /* Using creatUID instead of useUID, since it is a list item and multiple ref is trying to get created which causes issue */
89
92
  const parallelListItemId = createUID();
90
- return (_jsxs(Fragment, { children: [index !== 0 && (_jsx(Flex, { as: StyledParallelTitle, container: { justify: 'center' }, children: _jsx("span", { children: t('parallel') }, void 0) }, void 0)), TaskItem.map((parallelTask) => {
93
+ return (_jsxs(Fragment, { children: [index !== 0 && (_jsx(Flex, { as: StyledParallelTitle, container: { justify: 'center' }, children: _jsx("span", { children: t('parallel') }) })), TaskItem.map((parallelTask) => {
91
94
  return (_jsx(Task, { id: parallelTask.id, value: parallelTask.label, item: parallelTask, visual: parallelTask.visual, stageItem: stageItem, categoryItem: item, error: parallelTask.error, ...task, ...restProps }, parallelTask.id));
92
95
  })] }, parallelListItemId));
93
96
  }
94
97
  return (_jsx(Task, { id: TaskItem.id, value: TaskItem.label, item: TaskItem, visual: TaskItem.visual, stageItem: stageItem, categoryItem: item, onAddStep: task?.onAddStep, error: TaskItem.error, ...task, ...restProps }, TaskItem.id));
95
- }), (showAddTaskButton || !item) && (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledAddTask, children: _jsxs(Button, { variant: 'simple', icon: true, ref: setAddTaskEl, onClick: onAddTaskClick, children: [_jsx(Icon, { name: 'plus' }, void 0), _jsx(Flex, { children: task?.addTask.title }, void 0)] }, void 0) }, void 0), _jsx(Tooltip, { target: addTaskEl, "aria-hidden": 'true', children: `${t('add')} ${task?.addTask.title}` }, void 0)] }, void 0))] }, void 0)] }, void 0));
98
+ }), (showAddTaskButton || !item) && (_jsxs(_Fragment, { children: [_jsx(Flex, { as: StyledAddTask, children: _jsxs(Button, { variant: 'simple', icon: true, ref: setAddTaskEl, onClick: onAddTaskClick, children: [_jsx(Icon, { name: 'plus' }), _jsx(Flex, { children: task?.addTask.title })] }) }), _jsx(Tooltip, { target: addTaskEl, "aria-hidden": 'true', children: `${t('add')} ${task?.addTask.title}` })] }))] })] }));
96
99
  });
97
100
  export default Category;
98
101
  //# sourceMappingURL=Category.js.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,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, Ref, Fragment, PropsWithoutRef, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n ForwardProps,\n BaseProps,\n Flex,\n Button,\n Icon,\n Tooltip,\n useElement,\n useI18n,\n createUID,\n defaultThemeProp,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport {\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam\n} from './LifeCycle.types';\nimport Task, { TaskProps } from './Task';\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 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\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 ${category?.elementId !== id &&\n ` min-height: ${category?.height ? `${category.height}px` : 'auto'};\n `}\n `;\n }\n);\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\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 [addTaskEl, setAddTaskEl] = useElement();\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\n ref={ref}\n role='gridcell'\n category={category}\n id={item?.id}\n data-id={item?.categoryId}\n >\n {item &&\n item.tasks.length !== 0 &&\n item.tasks.map((TaskItem: TaskItemProps | TaskItemProps[], index: number) => {\n if (Array.isArray(TaskItem)) {\n if (task && task.addTask && task.addTask.showOnce && TaskItem.length !== 0) {\n showAddTaskButton = false;\n }\n /* Using creatUID instead of useUID, since it is a list item and multiple ref is trying to get created which causes issue */\n const parallelListItemId = createUID();\n return (\n <Fragment key={parallelListItemId}>\n {index !== 0 && (\n <Flex as={StyledParallelTitle} container={{ justify: 'center' }}>\n <span>{t('parallel')}</span>\n </Flex>\n )}\n {TaskItem.map((parallelTask: TaskItemProps) => {\n return (\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 {...task}\n {...restProps}\n />\n );\n })}\n </Fragment>\n );\n }\n return (\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 {...task}\n {...restProps}\n />\n );\n })}\n {(showAddTaskButton || !item) && (\n <>\n <Flex as={StyledAddTask}>\n <Button variant='simple' icon ref={setAddTaskEl} onClick={onAddTaskClick}>\n <Icon name='plus' />\n <Flex>{task?.addTask.title}</Flex>\n </Button>\n </Flex>\n <Tooltip target={addTaskEl} aria-hidden='true'>\n {`${t('add')} ${task?.addTask.title}`}\n </Tooltip>\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,EAAO,QAAQ,EAA+B,MAAM,OAAO,CAAC;AAClG,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAGL,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,SAAS,EACT,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AASjC,OAAO,IAAmB,MAAM,QAAQ,CAAC;AAwBzC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAyB,CAAC,EAAE,SAAS,EAAE,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,CAsBtB,CACZ,CAAC;6BACH;4BACD,OAAO,CACL,KAAC,IAAI,IAEH,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,KACjB,IAAI,KACJ,SAAS,IAVR,QAAQ,CAAC,EAAE,CAWhB,CACH,CAAC;wBACJ,CAAC,CAAC,EACH,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,IAAI,CAC/B,8BACE,KAAC,IAAI,IAAC,EAAE,EAAE,aAAa,YACrB,MAAC,MAAM,IAAC,OAAO,EAAC,QAAQ,EAAC,IAAI,QAAC,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,cAAc,aACtE,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,EACpB,KAAC,IAAI,cAAE,IAAI,EAAE,OAAO,CAAC,KAAK,GAAQ,IAC3B,GACJ,EACP,KAAC,OAAO,IAAC,MAAM,EAAE,SAAS,iBAAc,MAAM,YAC3C,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,GAC7B,IACT,CACJ,IACU,IACZ,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, Ref, Fragment, PropsWithoutRef, MouseEvent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n ForwardProps,\n BaseProps,\n Flex,\n Button,\n Icon,\n Tooltip,\n useElement,\n useI18n,\n createUID,\n defaultThemeProp,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport {\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam\n} from './LifeCycle.types';\nimport Task, { TaskProps } from './Task';\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 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 ${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 [addTaskEl, setAddTaskEl] = useElement();\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\n ref={ref}\n role='gridcell'\n category={category}\n id={item?.id}\n data-id={item?.categoryId}\n >\n {item &&\n item.tasks.length !== 0 &&\n item.tasks.map((TaskItem: TaskItemProps | TaskItemProps[], index: number) => {\n if (Array.isArray(TaskItem)) {\n if (task && task.addTask && task.addTask.showOnce && TaskItem.length !== 0) {\n showAddTaskButton = false;\n }\n /* Using creatUID instead of useUID, since it is a list item and multiple ref is trying to get created which causes issue */\n const parallelListItemId = createUID();\n return (\n <Fragment key={parallelListItemId}>\n {index !== 0 && (\n <Flex as={StyledParallelTitle} container={{ justify: 'center' }}>\n <span>{t('parallel')}</span>\n </Flex>\n )}\n {TaskItem.map((parallelTask: TaskItemProps) => {\n return (\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 {...task}\n {...restProps}\n />\n );\n })}\n </Fragment>\n );\n }\n return (\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 {...task}\n {...restProps}\n />\n );\n })}\n {(showAddTaskButton || !item) && (\n <>\n <Flex as={StyledAddTask}>\n <Button variant='simple' icon ref={setAddTaskEl} onClick={onAddTaskClick}>\n <Icon name='plus' />\n <Flex>{task?.addTask.title}</Flex>\n </Button>\n </Flex>\n <Tooltip target={addTaskEl} aria-hidden='true'>\n {`${t('add')} ${task?.addTask.title}`}\n </Tooltip>\n </>\n )}\n </StyledList>\n </>\n );\n }\n);\n\nexport default Category;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCycle.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,SAAS,EACT,YAAY,EAKZ,cAAc,EACf,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,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,CAA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CACjC;AAaD,QAAA,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,GAAG,YAAY,CAkI/D,CAAC;AAEF,eAAe,SAAS,CAAC"}
@@ -5,7 +5,6 @@ import styled, { css } from 'styled-components';
5
5
  import { defaultThemeProp, Flex, Button, Icon, useI18n } from '@pega/cosmos-react-core';
6
6
  import LifeCycleList from './LifeCycleList';
7
7
  const StyledLifeCycle = styled.ol ``;
8
- StyledLifeCycle.defaultProps = defaultThemeProp;
9
8
  const StyledAddButton = styled(Button)(({ theme }) => {
10
9
  return css `
11
10
  align-self: flex-start;
@@ -65,10 +64,10 @@ const LifeCycle = forwardRef(({ items, categories, alternateItems = [], onAddSta
65
64
  return (_jsxs(Flex, { container: { itemGap: 2 }, ref: ref, children: [_jsxs(Flex, { as: StyledLifeCycle, ref: lifeCycleEl, container: true, role: 'grid', "aria-label": t('stage'), children: [items.map((stageItem, index, stageArray) => {
66
65
  const listId = stageItem.id;
67
66
  return (_createElement(LifeCycleList, { ...restProps, key: listId, id: listId, item: stageItem, isFirstItem: index === 0, isLastItem: index === stageArray.length - 1, ref: setRef, stage: stage, prevStageVariant: stageArray[index - 1]?.type, categories: categoriesState }));
68
- }), _jsx(StyledAddButton, { variant: 'simple', label: t('add_stage'), icon: true, onClick: onAddStage, children: _jsx(Icon, { name: 'plus' }, void 0) }, void 0)] }, void 0), alternateItems.length !== 0 && (_jsxs(Flex, { as: StyledLifeCycle, container: true, ref: lifeCycleEl, role: 'grid', "aria-label": t('alternate_stage'), children: [alternateItems.map((stageItem, index, stageArray) => {
67
+ }), _jsx(StyledAddButton, { variant: 'simple', label: t('add_stage'), icon: true, onClick: onAddStage, children: _jsx(Icon, { name: 'plus' }) })] }), alternateItems.length !== 0 && (_jsxs(Flex, { as: StyledLifeCycle, container: true, ref: lifeCycleEl, role: 'grid', "aria-label": t('alternate_stage'), children: [alternateItems.map((stageItem, index, stageArray) => {
69
68
  const listId = stageItem.id;
70
69
  return (_createElement(LifeCycleList, { ...restProps, key: listId, id: listId, item: stageItem, isFirstItem: index === 0, isLastItem: index === stageArray.length - 1, ref: setRef, categories: categoriesState, stageVariant: 'alternate', prevStageVariant: stageArray[index - 1]?.type, stage: alternateStage }));
71
- }), _jsx(StyledAddButton, { variant: 'simple', label: t('add_alternate_stage'), icon: true, onClick: onAddAlternateStage, children: _jsx(Icon, { name: 'plus' }, void 0) }, void 0)] }, void 0))] }, void 0));
70
+ }), _jsx(StyledAddButton, { variant: 'simple', label: t('add_alternate_stage'), icon: true, onClick: onAddAlternateStage, children: _jsx(Icon, { name: 'plus' }) })] }))] }));
72
71
  });
73
72
  export default LifeCycle;
74
73
  //# sourceMappingURL=LifeCycle.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LifeCycle.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,EAIV,eAAe,EACf,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAGhB,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EAER,MAAM,yBAAyB,CAAC;AAEjC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AA8B5C,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAEpC,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;+BAEmB,KAAK,CAAC,IAAI,CAAC,OAAO;GAC9C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,SAAS,GAAqD,UAAU,CAC5E,CACE,EACE,KAAK,EACL,UAAU,EACV,cAA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,EAChB,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,IAAI,QACJ,OAAO,EAAE,mBAAmB,YAE5B,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,WAAG,WACJ,YACb,CACR,YACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useLayoutEffect,\n useRef,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Flex,\n Button,\n Icon,\n useI18n,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport LifeCycleList from './LifeCycleList';\nimport { StageItemProps } from './LifeCycle.types';\nimport { StageProps } from './Stage';\nimport { CategoriesProps } from './Category';\nimport { TaskProps } from './Task';\nimport { StepProps } from './Step';\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}\n\nconst StyledLifeCycle = styled.ol``;\n\nStyledLifeCycle.defaultProps = defaultThemeProp;\n\nconst StyledAddButton = styled(Button)(({ theme }) => {\n return css`\n align-self: flex-start;\n margin-block-start: calc(${theme.base.spacing} / 2);\n `;\n});\n\nStyledAddButton.defaultProps = defaultThemeProp;\n\nconst LifeCycle: FunctionComponent<LifeCycleProps & ForwardProps> = forwardRef(\n (\n {\n items,\n categories,\n alternateItems = [],\n onAddStage,\n onAddAlternateStage,\n stage,\n alternateStage,\n ...restProps\n }: PropsWithoutRef<LifeCycleProps>,\n ref: LifeCycleProps['ref']\n ) => {\n const lifeCycleEl = useRef(null);\n const t = useI18n();\n const [categoriesState, setcategoriesState] = useState(categories);\n const categoryElements: HTMLElement[] = [];\n const setRef = (element: HTMLOListElement) => {\n if (element) {\n categoryElements.push(element);\n }\n };\n\n useLayoutEffect(() => {\n let isHeightChanged = false;\n const categoriesColumn = [...categories];\n if (categoriesColumn && categoriesColumn.length > 0) {\n categoriesColumn.forEach((categoryItem, index) => {\n const categoryElm = [...categoryElements];\n let isActiveElement = false;\n const categoryComponent = categoryElm.filter((element: HTMLElement) => {\n if (element.getAttribute('data-id') === categoryItem.id) {\n if (categoryItem.elementId === element.getAttribute('id')) {\n isActiveElement = true;\n }\n return true;\n }\n return false;\n });\n if (!isActiveElement) {\n categoryItem.elementId = '';\n categoryItem.height = 0;\n }\n categoryComponent.forEach(categoryElement => {\n const columnHeight = categoryItem?.height ?? 0;\n const height = categoryElement.scrollHeight;\n const elementId = categoryElement.getAttribute('id');\n if (\n height > columnHeight ||\n (categoryItem.elementId === elementId && height !== columnHeight)\n ) {\n isHeightChanged = true;\n categoriesColumn[index].height = height;\n if (elementId) categoriesColumn[index].elementId = elementId;\n }\n });\n });\n if (isHeightChanged) {\n isHeightChanged = false;\n setcategoriesState(categoriesColumn);\n }\n }\n });\n\n return (\n <Flex container={{ itemGap: 2 }} ref={ref}>\n <Flex as={StyledLifeCycle} ref={lifeCycleEl} container role='grid' aria-label={t('stage')}>\n {items.map((stageItem: StageItemProps, index: number, stageArray: StageItemProps[]) => {\n const listId = stageItem.id;\n return (\n <LifeCycleList\n {...restProps}\n key={listId}\n id={listId}\n item={stageItem}\n isFirstItem={index === 0}\n isLastItem={index === stageArray.length - 1}\n ref={setRef}\n stage={stage}\n prevStageVariant={stageArray[index - 1]?.type}\n categories={categoriesState}\n />\n );\n })}\n <StyledAddButton variant='simple' label={t('add_stage')} icon onClick={onAddStage}>\n <Icon name='plus' />\n </StyledAddButton>\n </Flex>\n {alternateItems.length !== 0 && (\n <Flex\n as={StyledLifeCycle}\n container\n ref={lifeCycleEl}\n role='grid'\n aria-label={t('alternate_stage')}\n >\n {alternateItems.map(\n (stageItem: StageItemProps, index: number, stageArray: StageItemProps[]) => {\n const listId = stageItem.id;\n return (\n <LifeCycleList\n {...restProps}\n key={listId}\n id={listId}\n item={stageItem}\n isFirstItem={index === 0}\n isLastItem={index === stageArray.length - 1}\n ref={setRef}\n categories={categoriesState}\n stageVariant='alternate'\n prevStageVariant={stageArray[index - 1]?.type}\n stage={alternateStage}\n />\n );\n }\n )}\n <StyledAddButton\n variant='simple'\n label={t('add_alternate_stage')}\n icon\n onClick={onAddAlternateStage}\n >\n <Icon name='plus' />\n </StyledAddButton>\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nexport default LifeCycle;\n"]}
1
+ {"version":3,"file":"LifeCycle.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,EAIV,eAAe,EACf,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAGhB,IAAI,EACJ,MAAM,EACN,IAAI,EACJ,OAAO,EAER,MAAM,yBAAyB,CAAC;AAEjC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AA8B5C,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA,EAAE,CAAC;AAEpC,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;+BAEmB,KAAK,CAAC,IAAI,CAAC,OAAO;GAC9C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEh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B,CACH,CAAC;oBACJ,CAAC,CACF,EACD,KAAC,eAAe,IACd,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,CAAC,CAAC,qBAAqB,CAAC,EAC/B,IAAI,QACJ,OAAO,EAAE,mBAAmB,YAE5B,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,GACJ,IACb,CACR,IACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,SAAS,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useLayoutEffect,\n useRef,\n useState\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Flex,\n Button,\n Icon,\n useI18n,\n NoChildrenProp\n} from '@pega/cosmos-react-core';\n\nimport LifeCycleList from './LifeCycleList';\nimport { StageItemProps } from './LifeCycle.types';\nimport { StageProps } from './Stage';\nimport { CategoriesProps } from './Category';\nimport { TaskProps } from './Task';\nimport { StepProps } from './Step';\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}\n\nconst StyledLifeCycle = styled.ol``;\n\nconst StyledAddButton = styled(Button)(({ theme }) => {\n return css`\n align-self: flex-start;\n margin-block-start: calc(${theme.base.spacing} / 2);\n `;\n});\n\nStyledAddButton.defaultProps = defaultThemeProp;\n\nconst LifeCycle: FunctionComponent<LifeCycleProps & ForwardProps> = forwardRef(\n (\n {\n items,\n categories,\n alternateItems = [],\n onAddStage,\n onAddAlternateStage,\n stage,\n alternateStage,\n ...restProps\n }: PropsWithoutRef<LifeCycleProps>,\n ref: LifeCycleProps['ref']\n ) => {\n const lifeCycleEl = useRef(null);\n const t = useI18n();\n const [categoriesState, setcategoriesState] = useState(categories);\n const categoryElements: HTMLElement[] = [];\n const setRef = (element: HTMLOListElement) => {\n if (element) {\n categoryElements.push(element);\n }\n };\n\n useLayoutEffect(() => {\n let isHeightChanged = false;\n const categoriesColumn = [...categories];\n if (categoriesColumn && categoriesColumn.length > 0) {\n categoriesColumn.forEach((categoryItem, index) => {\n const categoryElm = [...categoryElements];\n let isActiveElement = false;\n const categoryComponent = categoryElm.filter((element: HTMLElement) => {\n if (element.getAttribute('data-id') === categoryItem.id) {\n if (categoryItem.elementId === element.getAttribute('id')) {\n isActiveElement = true;\n }\n return true;\n }\n return false;\n });\n if (!isActiveElement) {\n categoryItem.elementId = '';\n categoryItem.height = 0;\n }\n categoryComponent.forEach(categoryElement => {\n const columnHeight = categoryItem?.height ?? 0;\n const height = categoryElement.scrollHeight;\n const elementId = categoryElement.getAttribute('id');\n if (\n height > columnHeight ||\n (categoryItem.elementId === elementId && height !== columnHeight)\n ) {\n isHeightChanged = true;\n categoriesColumn[index].height = height;\n if (elementId) categoriesColumn[index].elementId = elementId;\n }\n });\n });\n if (isHeightChanged) {\n isHeightChanged = false;\n setcategoriesState(categoriesColumn);\n }\n }\n });\n\n return (\n <Flex container={{ itemGap: 2 }} ref={ref}>\n <Flex as={StyledLifeCycle} ref={lifeCycleEl} container role='grid' aria-label={t('stage')}>\n {items.map((stageItem: StageItemProps, index: number, stageArray: StageItemProps[]) => {\n const listId = stageItem.id;\n return (\n <LifeCycleList\n {...restProps}\n key={listId}\n id={listId}\n item={stageItem}\n isFirstItem={index === 0}\n isLastItem={index === stageArray.length - 1}\n ref={setRef}\n stage={stage}\n prevStageVariant={stageArray[index - 1]?.type}\n categories={categoriesState}\n />\n );\n })}\n <StyledAddButton variant='simple' label={t('add_stage')} icon onClick={onAddStage}>\n <Icon name='plus' />\n </StyledAddButton>\n </Flex>\n {alternateItems.length !== 0 && (\n <Flex\n as={StyledLifeCycle}\n container\n ref={lifeCycleEl}\n role='grid'\n aria-label={t('alternate_stage')}\n >\n {alternateItems.map(\n (stageItem: StageItemProps, index: number, stageArray: StageItemProps[]) => {\n const listId = stageItem.id;\n return (\n <LifeCycleList\n {...restProps}\n key={listId}\n id={listId}\n item={stageItem}\n isFirstItem={index === 0}\n isLastItem={index === stageArray.length - 1}\n ref={setRef}\n categories={categoriesState}\n stageVariant='alternate'\n prevStageVariant={stageArray[index - 1]?.type}\n stage={alternateStage}\n />\n );\n }\n )}\n <StyledAddButton\n variant='simple'\n label={t('add_alternate_stage')}\n icon\n onClick={onAddAlternateStage}\n >\n <Icon name='plus' />\n </StyledAddButton>\n </Flex>\n )}\n </Flex>\n );\n }\n);\n\nexport default LifeCycle;\n"]}
@@ -1,14 +1,12 @@
1
1
  import { MouseEvent } from 'react';
2
2
  import { Action, StatusProps } from '@pega/cosmos-react-core';
3
- export interface VisualColorProps {
4
- color: 'magenta' | 'studio' | 'congressBlue' | 'Japaneselaurel' | 'violet' | 'yellow' | 'orange' | 'darkyellow';
5
- }
3
+ import { ColorName } from '../../utils';
6
4
  export declare type StageType = 'start' | 'default' | 'default-wait' | 'resolution' | 'alternate' | 'alternate-wait';
7
5
  export interface StepItemProps {
8
6
  id: string;
9
7
  label: string;
10
8
  visual: {
11
- color: VisualColorProps['color'];
9
+ color: ColorName;
12
10
  icon: string;
13
11
  label: string;
14
12
  imgurl: 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,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAsB,MAAM,yBAAyB,CAAC;AAElF,MAAM,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EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC;IAC9D,OAAO,EAAE,CACP,KAAK,EAAE,oBAAoB,EAC3B,CAAC,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC,KACpE,IAAI,CAAC;CACX;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,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAsB,MAAM,yBAAyB,CAAC;AAElF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,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;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C;IAC9D,OAAO,EAAE,CACP,KAAK,EAAE,oBAAoB,EAC3B,CAAC,EAAE,UAAU,CAAC,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,CAAC,KACpE,IAAI,CAAC;CACX;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,EAAuB,SAAS,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAgGlF,MAAM,iBAAiB,GAAiC;IACtD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;YACpC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;YACtC,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,IAAI;SAClB;KACF;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;YACtC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;YACrC,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;SAClB;KACF;IACD,cAAc,EAAE;QACd,EAAE,EAAE,cAAc;QAClB,MAAM,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M,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 } from 'react';\n\nimport { Action, StatusProps, WorkTheme as Theme } from '@pega/cosmos-react-core';\n\nexport interface VisualColorProps {\n color:\n | 'magenta'\n | 'studio'\n | 'congressBlue'\n | 'Japaneselaurel'\n | 'violet'\n | 'yellow'\n | 'orange'\n | 'darkyellow';\n}\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: VisualColorProps['color'];\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 /* Data model should have id of the stage item */\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 LifeCycleActionParam {\n value?: string;\n stage?: StageItemProps;\n task?: TaskItemProps;\n category?: CategoryItemProps;\n step?: StepItemProps;\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 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,EAAuB,SAAS,IAAI,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAsFlF,MAAM,iBAAiB,GAAiC;IACtD,KAAK,EAAE;QACL,EAAE,EAAE,OAAO;QACX,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;YACpC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;YACtC,WAAW,EAAE,KAAK;YAClB,WAAW,EAAE,IAAI;SAClB;KACF;IACD,OAAO,EAAE;QACP,EAAE,EAAE,SAAS;QACb,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;YACtC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;YACrC,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;SAClB;KACF;IACD,cAAc,EAAE;QACd,EAAE,EAAE,cAAc;QAClB,MAAM,EAAE;YACN,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM;YACtC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK;YACrC,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,KAAK;SACnB;KACF;IACD,UAAU,EAAE;QACV,EAAE,EAAE,YAA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AW;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 } from 'react';\n\nimport { Action, StatusProps, WorkTheme as Theme } from '@pega/cosmos-react-core';\n\nimport { ColorName } from '../../utils';\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 /* Data model should have id of the stage item */\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 LifeCycleActionParam {\n value?: string;\n stage?: StageItemProps;\n task?: TaskItemProps;\n category?: CategoryItemProps;\n step?: StepItemProps;\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 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,5 +1,5 @@
1
1
  import { FunctionComponent, Ref } from 'react';
2
- import type { NoChildrenProp } from '@pega/cosmos-react-core';
2
+ import { NoChildrenProp } from '@pega/cosmos-react-core';
3
3
  import { StageItemProps, StageType } from './LifeCycle.types';
4
4
  import { StageProps } from './Stage';
5
5
  import { CategoriesProps } from './Category';
@@ -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,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAmC,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,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;AAoBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CAiGxD,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,EAAE,cAAc,EAAmC,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC/F,OAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEnC,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,CAiGxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -2,7 +2,7 @@ import { createElement as _createElement } from "react";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { forwardRef } from 'react';
4
4
  import styled, { css } from 'styled-components';
5
- import { createUID, useDirection } from '@pega/cosmos-react-core';
5
+ import { defaultThemeProp, createUID, useDirection } from '@pega/cosmos-react-core';
6
6
  import { getStageInfo } from './LifeCycle.types';
7
7
  import Stage from './Stage';
8
8
  import Category from './Category';
@@ -23,6 +23,7 @@ const StyledLifeCycleList = styled.li(({ theme, lastItem }) => {
23
23
  `}
24
24
  `;
25
25
  });
26
+ StyledLifeCycleList.defaultProps = defaultThemeProp;
26
27
  const LifeCycleList = forwardRef(({ item, isFirstItem, isLastItem, categories, stage: stageProps, task, step, prevStageVariant, stageVariant, id, ...restProps }, ref) => {
27
28
  const showTitle = isFirstItem || false;
28
29
  let sortedCategory = [];
@@ -45,7 +46,7 @@ const LifeCycleList = forwardRef(({ item, isFirstItem, isLastItem, categories, s
45
46
  sortedCategory = catgoryItem(item.categories);
46
47
  }
47
48
  const stageInfo = getStageInfo(item.type, prevStageVariant, isLastItem);
48
- return (_jsxs(StyledLifeCycleList, { role: 'row', lastItem: isLastItem, children: [_jsx(Stage, { value: item.label, stageInfo: stageInfo, item: item, error: item.error, id: item.id, ...stageProps }, void 0), sortedCategory.length !== 0 &&
49
+ return (_jsxs(StyledLifeCycleList, { role: 'row', lastItem: isLastItem, children: [_jsx(Stage, { value: item.label, stageInfo: stageInfo, item: item, error: item.error, id: item.id, ...stageProps }), sortedCategory.length !== 0 &&
49
50
  sortedCategory.map((categoryItem, categoryindex) => {
50
51
  const taskProps = task[categoryindex];
51
52
  let stepProps;
@@ -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;AAGhD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAqC,YAAY,EAAa,MAAM,mBAAmB,CAAC;AAC/F,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,QAA6B,MAAM,YAAY,CAAC;AA4BvD,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAoC,CAAC,EAAE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AC,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,IAAI,EAAC,UAAU,EACf,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,IARf,YAAY,CAAC,UAAU,CAS5B,CACH,CAAC;gBACJ,CAAC,CAAC,KAnDoB,MAAM,CAoDV,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 type { NoChildrenProp } from '@pega/cosmos-react-core';\nimport { createUID, useDirection } from '@pega/cosmos-react-core';\n\nimport { StageItemProps, CategoryItemProps, getStageInfo, StageType } from './LifeCycle.types';\nimport Stage, { StageProps } from './Stage';\nimport Category, { CategoriesProps } from './Category';\nimport { TaskProps } from './Task';\nimport { StepProps } from './Step';\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\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} role='row' 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 role='gridcell'\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 role='gridcell'\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,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,EAAqC,YAAY,EAAa,MAAM,mBAAmB,CAAC;AAC/F,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,QAA6B,MAAM,YAAY,CAAC;AA4BvD,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,iBA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oBAE1C,OAAO,CACL,KAAC,QAAQ,IAEP,IAAI,EAAC,UAAU,EACf,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,IARf,YAAY,CAAC,UAAU,CAS5B,CACH,CAAC;gBACJ,CAAC,CAAC,KAnDoB,MAAM,CAoDV,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 { StageItemProps, CategoryItemProps, getStageInfo, StageType } from './LifeCycle.types';\nimport Stage, { StageProps } from './Stage';\nimport Category, { CategoriesProps } from './Category';\nimport { TaskProps } from './Task';\nimport { StepProps } from './Step';\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} role='row' 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 role='gridcell'\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 role='gridcell'\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 +1 @@
1
- {"version":3,"file":"Stage.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Stage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,iBAAiB,EAEjB,GAAG,EACH,WAAW,EACX,UAAU,EAEX,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,SAAS,EACT,YAAY,EAKZ,gBAAgB,EAMjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,SAAS,EACT,cAAc,EACd,SAAS,EACV,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzE,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,CAAC,GAAG,eAAe,EAAE,CAAC;IACnE,6BAA6B;IAC7B,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,0CAA0C;IAC1C,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,mBAAmB;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACnF,uBAAuB;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACjF,sBAAsB;IACtB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,EAAE,CAAC,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,I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"}
@@ -7,8 +7,8 @@ export const StyledWrapper = styled.div `
7
7
  `;
8
8
  export const StyledDragIcon = styled.div(({ theme, error }) => {
9
9
  return css `
10
- width: 0%;
11
- transition: width ${theme.base.animation.speed};
10
+ width: 1.5rem;
11
+ visibility: hidden;
12
12
  ${error &&
13
13
  css `
14
14
  display: block;
@@ -19,6 +19,7 @@ export const StyledDragIcon = styled.div(({ theme, error }) => {
19
19
  text-align: center;
20
20
  `;
21
21
  });
22
+ StyledDragIcon.defaultProps = defaultThemeProp;
22
23
  export const StyledInput = styled.input(({ error, theme }) => {
23
24
  return css `
24
25
  height: ${theme.components.input.height};
@@ -51,6 +52,7 @@ export const StyledInput = styled.input(({ error, theme }) => {
51
52
  `}
52
53
  `;
53
54
  });
55
+ StyledInput.defaultProps = defaultThemeProp;
54
56
  export const StyledStageActions = styled.div(({ theme, error }) => {
55
57
  return css `
56
58
  z-index: 2;
@@ -67,6 +69,7 @@ export const StyledStageActions = styled.div(({ theme, error }) => {
67
69
  }
68
70
  `;
69
71
  });
72
+ StyledStageActions.defaultProps = defaultThemeProp;
70
73
  export const StyledStage = styled.div(({ stageInfo, theme, status }) => {
71
74
  const { visual: { bgColor, bgHover, tailPointed, headPointed } } = stageInfo;
72
75
  const { rtl } = useDirection();
@@ -89,20 +92,8 @@ export const StyledStage = styled.div(({ stageInfo, theme, status }) => {
89
92
 
90
93
  &:hover {
91
94
  cursor: pointer;
92
- ${StyledDragIcon} {
93
- @keyframes anim {
94
- 0% {
95
- transform: scale(0);
96
- }
97
- 100% {
98
- transform: scale(1);
99
- }
100
- }
101
- animation: anim ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
102
- width: 10%;
103
- transition: width ${theme.base.animation.speed};
104
- }
105
- ${StyledStageActions} {
95
+
96
+ ${StyledDragIcon},${StyledStageActions} {
106
97
  ${css `
107
98
  visibility: visible;
108
99
  `}
@@ -288,7 +279,7 @@ const Stage = forwardRef(({ value, actions, stageInfo, onChange, onFocus, onBlur
288
279
  return actionItem;
289
280
  });
290
281
  }
291
- return (_jsx(Flex, { container: { inline: true }, as: StyledStage, ...restProps, ref: ref, stageInfo: stageInfo, status: error, role: 'columnheader', children: _jsxs(Flex, { as: StyledWrapper, container: { inline: true }, children: [_jsx(Flex, { as: StyledDragIcon, error: error, children: _jsx(Icon, { name: 'drag' }, void 0) }, void 0), _jsxs(Flex, { container: true, children: [_jsxs(Flex, { as: StyledInputWrapper, item: { grow: 1 }, container: { inline: true, alignItems: 'center' }, children: [_jsx(StyledInput, { value: stageName, type: 'text', ref: setInputEl, error: error, id: item.id, onChange: onInputChange, "aria-label": stageName, onFocus: onInputFocus, onBlur: onInputBlur }, void 0), stageName && (_jsx(Tooltip, { target: inputEl, hideDelay: 'none', children: error || stageName }, void 0))] }, void 0), _jsx(StyledStageActions, { error: error, children: actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }, void 0) }, void 0)] }, void 0)] }, void 0) }, void 0));
282
+ return (_jsx(Flex, { container: { inline: true }, as: StyledStage, ...restProps, ref: ref, stageInfo: stageInfo, status: error, role: 'columnheader', children: _jsxs(Flex, { as: StyledWrapper, container: { inline: true }, children: [_jsx(Flex, { as: StyledDragIcon, error: error, children: _jsx(Icon, { name: 'drag' }) }), _jsxs(Flex, { container: true, children: [_jsxs(Flex, { as: StyledInputWrapper, item: { grow: 1 }, container: { inline: true, alignItems: 'center' }, children: [_jsx(StyledInput, { value: stageName, type: 'text', ref: setInputEl, error: error, id: item.id, onChange: onInputChange, "aria-label": stageName, onFocus: onInputFocus, onBlur: onInputBlur }), stageName && (_jsx(Tooltip, { target: inputEl, hideDelay: 'none', children: error || stageName }))] }), _jsx(StyledStageActions, { error: error, children: actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }) })] })] }) }));
292
283
  });
293
284
  export default Stage;
294
285
  //# sourceMappingURL=Stage.js.map