@pega/cosmos-react-build 2.0.0-dev.12.1 → 2.0.0-dev.14.2

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 (47) hide show
  1. package/lib/components/AppHeader/AppHeader.d.ts.map +1 -1
  2. package/lib/components/AppHeader/AppHeader.js +4 -4
  3. package/lib/components/AppHeader/AppHeader.js.map +1 -1
  4. package/lib/components/AppHeader/AppHeader.styles.d.ts +2 -2
  5. package/lib/components/AppHeader/AppHeader.styles.d.ts.map +1 -1
  6. package/lib/components/AppHeader/AppHeader.styles.js +21 -13
  7. package/lib/components/AppHeader/AppHeader.styles.js.map +1 -1
  8. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  9. package/lib/components/AppShell/AppShell.styles.js +3 -2
  10. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  11. package/lib/components/LifeCycle/Category.d.ts +32 -0
  12. package/lib/components/LifeCycle/Category.d.ts.map +1 -0
  13. package/lib/components/LifeCycle/Category.js +98 -0
  14. package/lib/components/LifeCycle/Category.js.map +1 -0
  15. package/lib/components/LifeCycle/LifeCycle.d.ts +22 -0
  16. package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -0
  17. package/lib/components/LifeCycle/LifeCycle.js +75 -0
  18. package/lib/components/LifeCycle/LifeCycle.js.map +1 -0
  19. package/lib/components/LifeCycle/LifeCycle.types.d.ts +56 -0
  20. package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -0
  21. package/lib/components/LifeCycle/LifeCycle.types.js +2 -0
  22. package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -0
  23. package/lib/components/LifeCycle/LifeCycleList.d.ts +21 -0
  24. package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -0
  25. package/lib/components/LifeCycle/LifeCycleList.js +65 -0
  26. package/lib/components/LifeCycle/LifeCycleList.js.map +1 -0
  27. package/lib/components/LifeCycle/Stage.d.ts +47 -0
  28. package/lib/components/LifeCycle/Stage.d.ts.map +1 -0
  29. package/lib/components/LifeCycle/Stage.js +290 -0
  30. package/lib/components/LifeCycle/Stage.js.map +1 -0
  31. package/lib/components/LifeCycle/Step.d.ts +48 -0
  32. package/lib/components/LifeCycle/Step.d.ts.map +1 -0
  33. package/lib/components/LifeCycle/Step.js +231 -0
  34. package/lib/components/LifeCycle/Step.js.map +1 -0
  35. package/lib/components/LifeCycle/Task.d.ts +51 -0
  36. package/lib/components/LifeCycle/Task.d.ts.map +1 -0
  37. package/lib/components/LifeCycle/Task.js +179 -0
  38. package/lib/components/LifeCycle/Task.js.map +1 -0
  39. package/lib/components/LifeCycle/index.d.ts +4 -0
  40. package/lib/components/LifeCycle/index.d.ts.map +1 -0
  41. package/lib/components/LifeCycle/index.js +2 -0
  42. package/lib/components/LifeCycle/index.js.map +1 -0
  43. package/lib/index.d.ts +2 -0
  44. package/lib/index.d.ts.map +1 -1
  45. package/lib/index.js +2 -0
  46. package/lib/index.js.map +1 -1
  47. package/package.json +12 -12
@@ -0,0 +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,EACR,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,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,KAAC,eAAe,kBACd,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,WAAW,EAAE,EACnC,IAAI,QACJ,OAAO,EAAE,mBAAmB,gBAE5B,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,WAAG,YACJ,aACb,CACR,aACI,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} 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 {\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 locStage = t('stage');\n const locAltStage = t('alternateStage');\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={locStage}>\n {items.map((stageItem: StageItemProps, index: number, stageArray: StageItemProps[]) => {\n const listId = stageItem.id;\n return (\n <LifeCycleList\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 categories={categoriesState}\n {...restProps}\n />\n );\n })}\n <StyledAddButton\n variant='simple'\n label={`${t('add')} ${locStage}`}\n icon\n onClick={onAddStage}\n >\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={locAltStage}\n >\n {alternateItems.map((stageItem: StageItemProps) => {\n const listId = stageItem.id;\n return (\n <LifeCycleList\n key={listId}\n id={listId}\n item={stageItem}\n ref={setRef}\n categories={categoriesState}\n stageVariant='alternate'\n stage={alternateStage}\n {...restProps}\n />\n );\n })}\n <StyledAddButton\n variant='simple'\n label={`${t('add')} ${locAltStage}`}\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"]}
@@ -0,0 +1,56 @@
1
+ import { MouseEvent } from 'react';
2
+ import { Action, StatusProps } from '@pega/cosmos-react-core';
3
+ export interface VisualColorProps {
4
+ color: 'magenta' | 'studio' | 'congressBlue' | 'Japaneselaurel' | 'violet' | 'yellow' | 'orange' | 'darkyellow';
5
+ }
6
+ export interface StepItemProps {
7
+ id: string;
8
+ label: string;
9
+ visual: {
10
+ color: VisualColorProps['color'];
11
+ icon: string;
12
+ label: string;
13
+ imgurl: string;
14
+ };
15
+ status: {
16
+ type?: StatusProps['variant'] | '';
17
+ label: string;
18
+ };
19
+ error: string;
20
+ }
21
+ export interface TaskItemProps {
22
+ id: string;
23
+ label: string;
24
+ visual: {
25
+ imgurl: string;
26
+ };
27
+ error: string;
28
+ steps: StepItemProps[];
29
+ }
30
+ export interface StageItemProps {
31
+ id: string;
32
+ label: string;
33
+ categories: CategoryItemProps[];
34
+ type: 'start' | 'default' | 'resolution' | 'alternate';
35
+ error: string;
36
+ }
37
+ export interface CategoryItemProps {
38
+ id: string;
39
+ categoryId: string;
40
+ tasks: TaskItemProps[] | TaskItemProps[][];
41
+ }
42
+ export interface CategoriesItemProps {
43
+ label: string;
44
+ id: string;
45
+ }
46
+ export interface LifeCycleActionParam {
47
+ value?: string;
48
+ stage?: StageItemProps;
49
+ task?: TaskItemProps;
50
+ category?: CategoryItemProps;
51
+ step?: StepItemProps;
52
+ }
53
+ export interface LifeCycleAction extends Omit<Action, 'onClick'> {
54
+ onClick: (param: LifeCycleActionParam, e: MouseEvent<HTMLButtonElement | HTMLAnchorElement | HTMLInputElement>) => void;
55
+ }
56
+ //# sourceMappingURL=LifeCycle.types.d.ts.map
@@ -0,0 +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,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EACD,SAAS,GACT,QAAQ,GACR,cAAc,GACd,gBAAgB,GAChB,QAAQ,GACR,QAAQ,GACR,QAAQ,GACR,YAAY,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,KAAK,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACjC,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE;QACN,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAE7B,EAAE,EAAE,MAAM,CAAC;IAEX,KAAK,EAAE,MAAM,CAAC;IAEd,UAAU,EAAE,iBAAiB,EAAE,CAAC;IAEhC,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAEhC,EAAE,EAAE,MAAM,CAAC;IAEX,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=LifeCycle.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LifeCycle.types.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycle.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent } from 'react';\n\nimport { Action, StatusProps } 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 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: 'start' | 'default' | 'resolution' | 'alternate';\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"]}
@@ -0,0 +1,21 @@
1
+ import { FunctionComponent, Ref } from 'react';
2
+ import { StageItemProps } from './LifeCycle.types';
3
+ import { StageProps } from './Stage';
4
+ import { CategoriesProps } from './Category';
5
+ import { TaskProps } from './Task';
6
+ import { StepProps } from './Step';
7
+ export interface LifeCycleListProps {
8
+ ref?: Ref<HTMLOListElement>;
9
+ categories: CategoriesProps[];
10
+ task: TaskProps[];
11
+ stage?: StageProps;
12
+ step?: StepProps[];
13
+ item: StageItemProps;
14
+ isFirstItem?: boolean;
15
+ isLastItem?: boolean;
16
+ stageVariant?: 'start' | 'default' | 'resolution' | 'alternate';
17
+ id?: string;
18
+ }
19
+ declare const LifeCycleList: FunctionComponent<LifeCycleListProps>;
20
+ export default LifeCycleList;
21
+ //# sourceMappingURL=LifeCycleList.d.ts.map
@@ -0,0 +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;AAK3D,OAAO,EAAE,cAAc,EAAqB,MAAM,mBAAmB,CAAC;AACtE,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,kBAAkB;IAEjC,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,OAAO,GAAG,SAAS,GAAG,YAAY,GAAG,WAAW,CAAC;IAEhE,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAoBD,QAAA,MAAM,aAAa,EAAE,iBAAiB,CAAC,kBAAkB,CAiGxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { createElement as _createElement } from "react";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from 'react';
4
+ import styled, { css } from 'styled-components';
5
+ import { createUID, useDirection } from '@pega/cosmos-react-core';
6
+ import Stage from './Stage';
7
+ import Category from './Category';
8
+ const StyledLifeCycleList = styled.li(({ theme, lastItem }) => {
9
+ const { rtl } = useDirection();
10
+ return css `
11
+ list-style-type: none;
12
+ padding: 0 ${theme.base.spacing} 0 0;
13
+ width: 15rem;
14
+ ${lastItem &&
15
+ css `
16
+ padding: 0 calc(0.5 * ${theme.base.spacing}) 0 0;
17
+ `}
18
+ ${lastItem &&
19
+ rtl &&
20
+ css `
21
+ padding: 0 ${theme.base.spacing} 0 calc(0.5 * ${theme.base.spacing});
22
+ `}
23
+ `;
24
+ });
25
+ const LifeCycleList = forwardRef(({ item, isFirstItem, categories, isLastItem, stage: stageProps, task, step, stageVariant, id, ...restProps }, ref) => {
26
+ const showTitle = isFirstItem || false;
27
+ let sortedCategory = [];
28
+ const listId = id || createUID();
29
+ /* Function used to rearrange the category data depends on Categories order */
30
+ const catgoryItem = (categoryData) => {
31
+ const sortedColumn = [];
32
+ if (categories && categories.length > 0 && categoryData.length > 0) {
33
+ categories.forEach(categoryColumnItem => {
34
+ categoryData.forEach((categoryItem) => {
35
+ if (categoryItem.categoryId === categoryColumnItem.id) {
36
+ sortedColumn.push(categoryItem);
37
+ }
38
+ });
39
+ });
40
+ }
41
+ return sortedColumn;
42
+ };
43
+ if (categories && categories.length !== 0) {
44
+ sortedCategory = catgoryItem(item.categories);
45
+ }
46
+ return (_jsxs(StyledLifeCycleList, Object.assign({ role: 'row', lastItem: isLastItem }, { children: [_jsx(Stage, Object.assign({ value: item.label, variant: stageVariant || (item.type ? item.type : 'default'), item: item, tailPointed: isFirstItem, headPointed: isLastItem, error: item.error, id: item.id }, stageProps), void 0), sortedCategory.length !== 0 &&
47
+ sortedCategory.map((categoryItem, categoryindex) => {
48
+ const taskProps = task[categoryindex];
49
+ let stepProps;
50
+ if (step)
51
+ stepProps = step[categoryindex];
52
+ return (_createElement(Category, { ...restProps, key: categoryItem.categoryId, role: 'gridcell', id: categoryItem.categoryId, ref: ref, category: categories[categoryindex], item: categoryItem, showTitle: showTitle, stageItem: item, task: taskProps, step: stepProps }));
53
+ }), sortedCategory.length === 0 &&
54
+ categories.length === 0 &&
55
+ item.categories.length > 0 &&
56
+ item.categories.map((categoryItem, categoryindex) => {
57
+ const taskProps = task[categoryindex];
58
+ let stepProps;
59
+ if (step)
60
+ stepProps = step[categoryindex];
61
+ return (_jsx(Category, { role: 'gridcell', id: categoryItem.categoryId, ref: ref, item: categoryItem, stageItem: item, task: taskProps, step: stepProps, showTitle: showTitle }, categoryItem.categoryId));
62
+ })] }), listId));
63
+ });
64
+ export default LifeCycleList;
65
+ //# sourceMappingURL=LifeCycleList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LifeCycleList.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/LifeCycleList.tsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAA0B,MAAM,OAAO,CAAC;AAC3D,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,QAA6B,MAAM,YAAY,CAAC;AA2BvD,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAoC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC/F,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,OAAO,GAAG,CAAA;;iBAEK,KAAK,CAAC,IAAI,CAAC,OAAO;;MAE7B,QAAQ;QACV,GAAG,CAAA;8BACuB,KAAK,CAAC,IAAI,CAAC,OAAO;KAC3C;MACC,QAAQ;QACV,GAAG;QACH,GAAG,CAAA;mBACY,KAAK,CAAC,IAAI,CAAC,OAAO,iBAAiB,KAAK,CAAC,IAAI,CAAC,OAAO;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AI,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,MArDoB,MAAM,CAsDV,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 { createUID, useDirection } from '@pega/cosmos-react-core';\n\nimport { StageItemProps, CategoryItemProps } 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 {\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?: 'start' | 'default' | 'resolution' | 'alternate';\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 categories,\n isLastItem,\n stage: stageProps,\n task,\n step,\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 return (\n <StyledLifeCycleList key={listId} role='row' lastItem={isLastItem}>\n <Stage\n value={item.label}\n variant={stageVariant || (item.type ? item.type : 'default')}\n item={item}\n tailPointed={isFirstItem}\n headPointed={isLastItem}\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"]}
@@ -0,0 +1,47 @@
1
+ import { FunctionComponent, Ref, ChangeEvent } from 'react';
2
+ import { BaseProps, ForwardProps, FormControlProps } from '@pega/cosmos-react-core';
3
+ import { LifeCycleAction, LifeCycleActionParam, StageItemProps } from './LifeCycle.types';
4
+ export interface StageProps extends Omit<FormControlProps, 'status' | 'id'> {
5
+ /** Pass an array of Action objects to append button(s) inline with the Input. */
6
+ actions?: LifeCycleAction[];
7
+ /** Callback for Add stage */
8
+ onAddStage?: () => void;
9
+ /** Callback for Adding alternate stage */
10
+ onAddAlternateStage?: () => void;
11
+ /** Input Change */
12
+ onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;
13
+ }
14
+ export interface StageComponentProps extends BaseProps, StageProps {
15
+ ref?: Ref<HTMLDivElement>;
16
+ /** Pass text for the task. */
17
+ value: string;
18
+ id: string;
19
+ /** Controls the styling of the stage. */
20
+ variant?: StageItemProps['type'] | 'default';
21
+ /** To make the stage with pointed tail */
22
+ tailPointed?: boolean;
23
+ /** To make the stage with pointed head */
24
+ headPointed?: boolean;
25
+ /** Full data object which can be passed to the callback */
26
+ item: StageItemProps;
27
+ error?: string;
28
+ }
29
+ export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
30
+ export declare const StyledDragIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
31
+ error: string;
32
+ }, never>;
33
+ export declare const StyledInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
34
+ error: string | undefined;
35
+ }, never>;
36
+ export declare const StyledStageActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
37
+ error?: string | undefined;
38
+ }, never>;
39
+ export declare const StyledStage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<StageComponentProps, "variant"> & {
40
+ tailPointed: boolean;
41
+ headPointed: boolean;
42
+ status: boolean;
43
+ }, never>;
44
+ export declare const StyledInputWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
45
+ declare const Stage: FunctionComponent<StageComponentProps & ForwardProps>;
46
+ export default Stage;
47
+ //# sourceMappingURL=Stage.d.ts.map
@@ -0,0 +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,EAEZ,MAAM,OAAO,CAAC;AAIf,OAAO,EAEL,SAAS,EACT,YAAY,EAKZ,gBAAgB,EAMjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE1F,MAAM,WAAW,UAAW,SAAQ,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,IAAI,CAAC;IACzE,iFAAiF;IACjF,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,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;CACpF;AAED,MAAM,WAAW,mBAAoB,SAAQ,SAAS,EAAE,UAAU;IAChE,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC1B,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IAEd,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,OAAO,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IAC7C,0CAA0C;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0CAA0C;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,2DAA2D;IAC3D,IAAI,EAAE,cAAc,CAAC;IAErB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,cAAc;WAAuB,MAAM;SAatD,CAAC;AAEH,eAAO,MAAM,WAAW;WAAyB,MAAM,GAAG,SAAS;SA+BjE,CAAC;AAEH,eAAO,MAAM,kBAAkB;;SAiB7B,CAAC;AAEH,eAAO,MAAM,WAAW;iBAEP,OAAO;iBACP,OAAO;YACZ,OAAO;SA8KjB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAQ9B,CAAC;AAEF,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAoGhE,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,290 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, forwardRef } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { readableColor } from 'polished';
5
+ import { Flex, Actions, Icon, Tooltip, useElement, defaultThemeProp, useDirection, StyledTooltip, StyledButton } from '@pega/cosmos-react-core';
6
+ export const StyledWrapper = styled.div `
7
+ overflow: hidden;
8
+ `;
9
+ export const StyledDragIcon = styled.div(({ theme, error }) => {
10
+ return css `
11
+ width: 0%;
12
+ transition: width ${theme.base.animation.speed};
13
+ ${error &&
14
+ css `
15
+ display: block;
16
+ `}
17
+ padding: 0 calc(0.5 * ${theme.base.spacing});
18
+ margin: calc(0.5 * ${theme.base.spacing}) 0;
19
+ color: ${theme.base.colors.white};
20
+ text-align: center;
21
+ `;
22
+ });
23
+ export const StyledInput = styled.input(({ error, theme }) => {
24
+ return css `
25
+ height: ${theme.components.input.height};
26
+ padding: 0 calc(0.5 * ${theme.base.spacing});
27
+ text-overflow: ellipsis;
28
+ border: 0.0625rem solid transparent;
29
+ border-radius: calc(0.5 * ${theme.base['border-radius']});
30
+ width: 100%;
31
+ color: ${theme.base.colors.white};
32
+ outline: none;
33
+ &:hover {
34
+ cursor: pointer;
35
+ }
36
+ &:disabled {
37
+ cursor: not-allowed;
38
+ }
39
+ ${error
40
+ ? css `
41
+ background: ${theme.base.colors.red['extra-light']};
42
+ border: 0.0625rem solid ${theme.base.colors.red.medium};
43
+ color: ${theme.base.colors.black};
44
+ `
45
+ : css `
46
+ background: ${theme.base.palette['primary-background']};
47
+ &&:focus:enabled {
48
+ color: ${theme.base.colors.black};
49
+ background: ${theme.base.palette['primary-background']};
50
+ border: 0.0625rem solid ${theme.base.colors.blue.medium};
51
+ }
52
+ `}
53
+ `;
54
+ });
55
+ export const StyledStageActions = styled.div(({ theme, error }) => {
56
+ return css `
57
+ z-index: 2;
58
+ visibility: hidden;
59
+ margin-inline-start: calc(0.5 * ${theme.base.spacing});
60
+
61
+ ${error &&
62
+ css `
63
+ visibility: visible;
64
+ `}
65
+
66
+ & > ${StyledButton} {
67
+ color: ${theme.base.colors.white};
68
+ }
69
+ `;
70
+ });
71
+ export const StyledStage = styled.div(({ variant, theme, tailPointed, headPointed, status }) => {
72
+ let bgColor;
73
+ let bgHover = '';
74
+ switch (variant) {
75
+ case 'start':
76
+ bgColor = theme.base.colors.blue.dark;
77
+ bgHover = theme.base.colors.blue.medium;
78
+ break;
79
+ case 'default':
80
+ bgColor = theme.base.colors.blue.medium;
81
+ bgHover = theme.base.colors.blue.light;
82
+ break;
83
+ case 'resolution':
84
+ bgColor = theme.base.colors.green.medium;
85
+ bgHover = theme.base.colors.green.light;
86
+ break;
87
+ case 'alternate':
88
+ bgColor = theme.base.colors.red.light;
89
+ bgHover = theme.base.colors.red['extra-light'];
90
+ break;
91
+ // eslint-disable-next-line sonarjs/no-duplicated-branches
92
+ default:
93
+ bgColor = theme.base.colors.blue.medium;
94
+ bgHover = theme.base.colors.blue.light;
95
+ }
96
+ const textColor = readableColor(bgHover);
97
+ const { rtl } = useDirection();
98
+ const roundedEndsStyles = css `
99
+ content: '';
100
+ position: absolute;
101
+ display: block;
102
+ width: calc(3 * ${theme.base.spacing});
103
+ height: calc(3 * ${theme.base.spacing});
104
+ top: calc(1 * ${theme.base.spacing});
105
+ border: 0;
106
+ border-inline-end: 0.0625rem solid transparent;
107
+ `;
108
+ return css `
109
+ position: relative;
110
+ padding: calc(0.5 * ${theme.base.spacing});
111
+ background: ${bgColor};
112
+ border: 0.0625rem solid transparent;
113
+ width: 100%;
114
+
115
+ &:hover {
116
+ cursor: pointer;
117
+ ${StyledDragIcon} {
118
+ @keyframes anim {
119
+ 0% {
120
+ transform: scale(0);
121
+ }
122
+ 100% {
123
+ transform: scale(1);
124
+ }
125
+ }
126
+ animation: anim ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
127
+ width: 10%;
128
+ transition: width ${theme.base.animation.speed};
129
+ }
130
+ ${StyledStageActions} {
131
+ ${css `
132
+ visibility: visible;
133
+ `}
134
+ }
135
+ }
136
+ &:focus-within {
137
+ border: 0.0625rem solid ${theme.base.colors.blue.medium};
138
+ ${!headPointed &&
139
+ css `
140
+ &::after {
141
+ border-inline-end: 0.0625rem solid ${theme.base.colors.blue.medium};
142
+ ${rtl
143
+ ? css `
144
+ border-block-start: 0.0625rem solid ${theme.base.colors.blue.medium};
145
+ `
146
+ : css `
147
+ border-block-end: 0.0625rem solid ${theme.base.colors.blue.medium};
148
+ `}
149
+ }
150
+ `}
151
+ ${!tailPointed &&
152
+ css `
153
+ &::before {
154
+ border-inline-end: 0.0625rem solid ${theme.base.colors.blue.medium};
155
+ ${rtl
156
+ ? css `
157
+ border-block-end: 0.0625rem solid ${theme.base.colors.blue.medium};
158
+ `
159
+ : css `
160
+ border-block-start: 0.0625rem solid ${theme.base.colors.blue.medium};
161
+ `}
162
+ }
163
+ `}
164
+ ${StyledDragIcon} {
165
+ ${css `
166
+ @keyframes anim {
167
+ 0% {
168
+ transform: scale(0);
169
+ }
170
+ 100% {
171
+ transform: scale(1);
172
+ }
173
+ }
174
+ animation: anim ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
175
+ width: 10%;
176
+ transition: width ${theme.base.animation.speed};
177
+ `}
178
+ }
179
+ ${StyledStageActions} {
180
+ ${css `
181
+ visibility: visible;
182
+ `}
183
+ }
184
+ }
185
+
186
+ ${!headPointed &&
187
+ css `
188
+ &::after {
189
+ ${roundedEndsStyles}
190
+ z-index: 1;
191
+ background: inherit;
192
+ transform: rotateZ(-45deg) skew(-15deg, -15deg);
193
+ inset-inline-end: calc(1.6 * ${theme.base.spacing} * -1);
194
+ border-block-end: 0.0625rem solid transparent;
195
+ ${rtl
196
+ ? css `
197
+ border-radius: calc(0.75 * ${theme.base['border-radius']}) 0.1rem 0.1rem 0.1rem;
198
+ `
199
+ : css `
200
+ border-radius: 0.0625rem 0.075rem calc(0.75 * ${theme.base['border-radius']})
201
+ 0.0625rem;
202
+ `}
203
+ }
204
+ `}
205
+
206
+ ${!tailPointed &&
207
+ css `
208
+ &::before {
209
+ ${roundedEndsStyles}
210
+ background: ${theme.base.palette['app-background']};
211
+ transform: rotateZ(45deg) skew(15deg, 15deg);
212
+ inset-inline-start: calc(-1.6 * ${theme.base.spacing});
213
+ ${rtl
214
+ ? css `
215
+ border-block-end: 0.0625rem solid transparent;
216
+ border-radius: 0.0625rem 0 0.0625rem calc(0.75 * ${theme.base['border-radius']});
217
+ `
218
+ : css `
219
+ border-block-start: 0.0625rem solid transparent;
220
+ border-radius: 0.0625rem calc(0.75 * ${theme.base['border-radius']}) 0.0625rem 0;
221
+ `}
222
+ }
223
+ `}
224
+
225
+ ${StyledInput} {
226
+ ${!status &&
227
+ css `
228
+ border: 0.0625rem solid transparent;
229
+ background: ${bgColor};
230
+ `}
231
+ :hover:not([readonly]):not([disabled]):not(:focus) {
232
+ ${!status &&
233
+ css `
234
+ border: 0.0625rem solid transparent;
235
+ background: ${bgHover};
236
+
237
+ /* color: ${textColor}; */
238
+ `}
239
+ }
240
+ }
241
+ `;
242
+ });
243
+ StyledStage.defaultProps = defaultThemeProp;
244
+ export const StyledInputWrapper = styled.div `
245
+ &:focus-within {
246
+ ${StyledTooltip} {
247
+ ${css `
248
+ display: none;
249
+ `}
250
+ }
251
+ }
252
+ `;
253
+ const Stage = forwardRef(({ value, actions, variant = 'default', headPointed = true, tailPointed = true, onChange, id, item, error, ...restProps }, ref) => {
254
+ const [inputEl, setInputEl] = useElement();
255
+ const [stageName, setStageName] = useState(value);
256
+ const onInputChange = (e) => {
257
+ setStageName(e.target.value);
258
+ const param = {
259
+ value: stageName,
260
+ stage: item
261
+ };
262
+ onChange?.(param, e);
263
+ };
264
+ const onActionItemClick = (actionId, e) => {
265
+ const param = {
266
+ stage: item
267
+ };
268
+ actions?.forEach((actionItem) => {
269
+ if (actionItem.id === actionId) {
270
+ actionItem.onClick?.(param, e);
271
+ }
272
+ });
273
+ };
274
+ /* Deep copy of actions object is required to provide consistent callback objects on actions */
275
+ const actionsClone = [];
276
+ if (actions) {
277
+ actions.forEach(actionItem => {
278
+ const actionCloneItem = {};
279
+ Object.keys(actionItem).forEach((key) => {
280
+ actionCloneItem[key] = actionItem[key];
281
+ });
282
+ actionCloneItem.onClick = onActionItemClick;
283
+ actionsClone.push(actionCloneItem);
284
+ return actionItem;
285
+ });
286
+ }
287
+ return (_jsx(Flex, Object.assign({ container: { inline: true }, as: StyledStage }, restProps, { ref: ref, variant: variant || 'default', tailPointed: tailPointed, headPointed: headPointed, status: error, role: 'columnheader' }, { children: _jsxs(Flex, Object.assign({ as: StyledWrapper, container: { inline: true } }, { children: [_jsx(Flex, Object.assign({ as: StyledDragIcon, error: error }, { children: _jsx(Icon, { name: 'drag' }, void 0) }), void 0), _jsxs(Flex, Object.assign({ container: true }, { children: [_jsxs(Flex, Object.assign({ 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 }, void 0), stageName && (_jsx(Tooltip, Object.assign({ target: inputEl, hideDelay: 'none' }, { children: error || stageName }), void 0))] }), void 0), _jsx(StyledStageActions, Object.assign({ error: error }, { children: actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }, void 0) }), void 0)] }), void 0)] }), void 0) }), void 0));
288
+ });
289
+ export default Stage;
290
+ //# sourceMappingURL=Stage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Stage.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Stage.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EAMX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EACL,IAAI,EAGJ,OAAO,EACP,IAAI,EACJ,OAAO,EACP,UAAU,EAEV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EAEb,YAAY,EACb,MAAM,yBAAyB,CAAC;AAiCjC,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAA;;CAEtC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAoB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC/E,OAAO,GAAG,CAAA;;wBAEY,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK;MAC5C,KAAK;QACP,GAAG,CAAA;;KAEF;4BACuB,KAAK,CAAC,IAAI,CAAC,OAAO;yBACrB,KAAK,CAAC,IAAI,CAAC,OAAO;aAC9B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;;GAEjC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAgC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IA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FunctionComponent,\n PropsWithChildren,\n Ref,\n ChangeEvent,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Flex,\n BaseProps,\n ForwardProps,\n Actions,\n Icon,\n Tooltip,\n useElement,\n FormControlProps,\n defaultThemeProp,\n useDirection,\n StyledTooltip,\n Action,\n StyledButton\n} from '@pega/cosmos-react-core';\n\nimport { LifeCycleAction, LifeCycleActionParam, StageItemProps } from './LifeCycle.types';\n\nexport interface StageProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Callback for Add stage */\n onAddStage?: () => void;\n /** Callback for Adding alternate stage */\n onAddAlternateStage?: () => void;\n /** Input Change */\n onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;\n}\n\nexport interface StageComponentProps extends BaseProps, StageProps {\n ref?: Ref<HTMLDivElement>;\n /** Pass text for the task. */\n value: string;\n /* unique id of the component */\n id: string;\n /** Controls the styling of the stage. */\n variant?: StageItemProps['type'] | 'default';\n /** To make the stage with pointed tail */\n tailPointed?: boolean;\n /** To make the stage with pointed head */\n headPointed?: boolean;\n /** Full data object which can be passed to the callback */\n item: StageItemProps;\n /* The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n}\n\nexport const StyledWrapper = styled.div`\n overflow: hidden;\n`;\n\nexport const StyledDragIcon = styled.div<{ error: string }>(({ theme, error }) => {\n return css`\n width: 0%;\n transition: width ${theme.base.animation.speed};\n ${error &&\n css`\n display: block;\n `}\n padding: 0 calc(0.5 * ${theme.base.spacing});\n margin: calc(0.5 * ${theme.base.spacing}) 0;\n color: ${theme.base.colors.white};\n text-align: center;\n `;\n});\n\nexport const StyledInput = styled.input<{ error: string | undefined }>(({ error, theme }) => {\n return css`\n height: ${theme.components.input.height};\n padding: 0 calc(0.5 * ${theme.base.spacing});\n text-overflow: ellipsis;\n border: 0.0625rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n width: 100%;\n color: ${theme.base.colors.white};\n outline: none;\n &:hover {\n cursor: pointer;\n }\n &:disabled {\n cursor: not-allowed;\n }\n ${error\n ? css`\n background: ${theme.base.colors.red['extra-light']};\n border: 0.0625rem solid ${theme.base.colors.red.medium};\n color: ${theme.base.colors.black};\n `\n : css`\n background: ${theme.base.palette['primary-background']};\n &&:focus:enabled {\n color: ${theme.base.colors.black};\n background: ${theme.base.palette['primary-background']};\n border: 0.0625rem solid ${theme.base.colors.blue.medium};\n }\n `}\n `;\n});\n\nexport const StyledStageActions = styled.div<{\n error?: string;\n}>(({ theme, error }) => {\n return css`\n z-index: 2;\n visibility: hidden;\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n\n ${error &&\n css`\n visibility: visible;\n `}\n\n & > ${StyledButton} {\n color: ${theme.base.colors.white};\n }\n `;\n});\n\nexport const StyledStage = styled.div<\n Pick<StageComponentProps, 'variant'> & {\n tailPointed: boolean;\n headPointed: boolean;\n status: boolean;\n }\n>(({ variant, theme, tailPointed, headPointed, status }) => {\n let bgColor;\n let bgHover = '';\n switch (variant) {\n case 'start':\n bgColor = theme.base.colors.blue.dark;\n bgHover = theme.base.colors.blue.medium;\n break;\n case 'default':\n bgColor = theme.base.colors.blue.medium;\n bgHover = theme.base.colors.blue.light;\n break;\n case 'resolution':\n bgColor = theme.base.colors.green.medium;\n bgHover = theme.base.colors.green.light;\n break;\n case 'alternate':\n bgColor = theme.base.colors.red.light;\n bgHover = theme.base.colors.red['extra-light'];\n break;\n // eslint-disable-next-line sonarjs/no-duplicated-branches\n default:\n bgColor = theme.base.colors.blue.medium;\n bgHover = theme.base.colors.blue.light;\n }\n const textColor = readableColor(bgHover);\n const { rtl } = useDirection();\n const roundedEndsStyles = css`\n content: '';\n position: absolute;\n display: block;\n width: calc(3 * ${theme.base.spacing});\n height: calc(3 * ${theme.base.spacing});\n top: calc(1 * ${theme.base.spacing});\n border: 0;\n border-inline-end: 0.0625rem solid transparent;\n `;\n\n return css`\n position: relative;\n padding: calc(0.5 * ${theme.base.spacing});\n background: ${bgColor};\n border: 0.0625rem solid transparent;\n width: 100%;\n\n &:hover {\n cursor: pointer;\n ${StyledDragIcon} {\n @keyframes anim {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n }\n animation: anim ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n width: 10%;\n transition: width ${theme.base.animation.speed};\n }\n ${StyledStageActions} {\n ${css`\n visibility: visible;\n `}\n }\n }\n &:focus-within {\n border: 0.0625rem solid ${theme.base.colors.blue.medium};\n ${!headPointed &&\n css`\n &::after {\n border-inline-end: 0.0625rem solid ${theme.base.colors.blue.medium};\n ${rtl\n ? css`\n border-block-start: 0.0625rem solid ${theme.base.colors.blue.medium};\n `\n : css`\n border-block-end: 0.0625rem solid ${theme.base.colors.blue.medium};\n `}\n }\n `}\n ${!tailPointed &&\n css`\n &::before {\n border-inline-end: 0.0625rem solid ${theme.base.colors.blue.medium};\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid ${theme.base.colors.blue.medium};\n `\n : css`\n border-block-start: 0.0625rem solid ${theme.base.colors.blue.medium};\n `}\n }\n `}\n ${StyledDragIcon} {\n ${css`\n @keyframes anim {\n 0% {\n transform: scale(0);\n }\n 100% {\n transform: scale(1);\n }\n }\n animation: anim ${theme.base.animation.speed} ${theme.base.animation.timing.ease};\n width: 10%;\n transition: width ${theme.base.animation.speed};\n `}\n }\n ${StyledStageActions} {\n ${css`\n visibility: visible;\n `}\n }\n }\n\n ${!headPointed &&\n css`\n &::after {\n ${roundedEndsStyles}\n z-index: 1;\n background: inherit;\n transform: rotateZ(-45deg) skew(-15deg, -15deg);\n inset-inline-end: calc(1.6 * ${theme.base.spacing} * -1);\n border-block-end: 0.0625rem solid transparent;\n ${rtl\n ? css`\n border-radius: calc(0.75 * ${theme.base['border-radius']}) 0.1rem 0.1rem 0.1rem;\n `\n : css`\n border-radius: 0.0625rem 0.075rem calc(0.75 * ${theme.base['border-radius']})\n 0.0625rem;\n `}\n }\n `}\n\n ${!tailPointed &&\n css`\n &::before {\n ${roundedEndsStyles}\n background: ${theme.base.palette['app-background']};\n transform: rotateZ(45deg) skew(15deg, 15deg);\n inset-inline-start: calc(-1.6 * ${theme.base.spacing});\n ${rtl\n ? css`\n border-block-end: 0.0625rem solid transparent;\n border-radius: 0.0625rem 0 0.0625rem calc(0.75 * ${theme.base['border-radius']});\n `\n : css`\n border-block-start: 0.0625rem solid transparent;\n border-radius: 0.0625rem calc(0.75 * ${theme.base['border-radius']}) 0.0625rem 0;\n `}\n }\n `}\n\n ${StyledInput} {\n ${!status &&\n css`\n border: 0.0625rem solid transparent;\n background: ${bgColor};\n `}\n :hover:not([readonly]):not([disabled]):not(:focus) {\n ${!status &&\n css`\n border: 0.0625rem solid transparent;\n background: ${bgHover};\n\n /* color: ${textColor}; */\n `}\n }\n }\n `;\n});\n\nStyledStage.defaultProps = defaultThemeProp;\n\nexport const StyledInputWrapper = styled.div`\n &:focus-within {\n ${StyledTooltip} {\n ${css`\n display: none;\n `}\n }\n }\n`;\n\nconst Stage: FunctionComponent<StageComponentProps & ForwardProps> = forwardRef(\n (\n {\n value,\n actions,\n variant = 'default',\n headPointed = true,\n tailPointed = true,\n onChange,\n id,\n item,\n error,\n ...restProps\n }: PropsWithChildren<StageComponentProps>,\n ref: StageComponentProps['ref']\n ) => {\n const [inputEl, setInputEl] = useElement();\n const [stageName, setStageName] = useState(value);\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n setStageName(e.target.value);\n const param: LifeCycleActionParam = {\n value: stageName,\n stage: item\n };\n onChange?.(param, e);\n };\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n stage: item\n };\n actions?.forEach((actionItem: LifeCycleAction) => {\n if (actionItem.id === actionId) {\n actionItem.onClick?.(param, e);\n }\n });\n };\n /* Deep copy of actions object is required to provide consistent callback objects on actions */\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n return (\n <Flex\n container={{ inline: true }}\n as={StyledStage}\n {...restProps}\n ref={ref}\n variant={variant || 'default'}\n tailPointed={tailPointed}\n headPointed={headPointed}\n status={error}\n role='columnheader'\n >\n <Flex as={StyledWrapper} container={{ inline: true }}>\n <Flex as={StyledDragIcon} error={error}>\n <Icon name='drag' />\n </Flex>\n <Flex container>\n <Flex\n as={StyledInputWrapper}\n item={{ grow: 1 }}\n container={{ inline: true, alignItems: 'center' }}\n >\n <StyledInput\n value={stageName}\n type='text'\n ref={setInputEl}\n error={error}\n id={item.id}\n onChange={onInputChange}\n aria-label={stageName}\n />\n {stageName && (\n <Tooltip target={inputEl} hideDelay='none'>\n {error || stageName}\n </Tooltip>\n )}\n </Flex>\n <StyledStageActions error={error}>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </StyledStageActions>\n </Flex>\n </Flex>\n </Flex>\n );\n }\n);\n\nexport default Stage;\n"]}
@@ -0,0 +1,48 @@
1
+ import { FunctionComponent, ChangeEvent } from 'react';
2
+ import { BaseProps, ForwardProps, FormControlProps } from '@pega/cosmos-react-core';
3
+ import { TaskItemProps, StepItemProps, StageItemProps, CategoryItemProps, LifeCycleAction, LifeCycleActionParam } from './LifeCycle.types';
4
+ export interface StepProps extends Omit<FormControlProps, 'status' | 'id'> {
5
+ /** Pass an array of Action objects to append button(s) inline with the Input. */
6
+ actions?: LifeCycleAction[];
7
+ onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;
8
+ }
9
+ interface StepComponentProps extends BaseProps, StepProps {
10
+ /** Pass text for the step. */
11
+ value?: string;
12
+ /** step data id */
13
+ id?: string;
14
+ /** Determines the visual for icon, color and label to render.
15
+ * This color is passed as a variant and accessible colors are used to display.
16
+ * Icon and label are passed as normal string */
17
+ visual: {
18
+ imgurl: string;
19
+ color: 'magenta' | 'studio' | 'congressBlue' | 'Japaneselaurel' | 'violet' | 'yellow' | 'orange' | 'darkyellow';
20
+ icon: string;
21
+ title: string;
22
+ };
23
+ badge?: StepItemProps['status'];
24
+ error?: string;
25
+ item: StepItemProps;
26
+ stageItem: StageItemProps;
27
+ taskItem: TaskItemProps;
28
+ categoryItem: CategoryItemProps;
29
+ }
30
+ export declare const StyledStepType: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
31
+ color: string;
32
+ ref: HTMLDivElement;
33
+ img: string;
34
+ }, never>;
35
+ export declare const StyledStepBadge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
36
+ export declare const StyledStepValueInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
37
+ error: string | undefined;
38
+ }, never>;
39
+ export declare const StyledStepStatus: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
40
+ badge: string;
41
+ error: string;
42
+ }, never>;
43
+ export declare const StyledStep: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
44
+ error: string;
45
+ }, never>;
46
+ declare const Step: FunctionComponent<StepComponentProps & ForwardProps>;
47
+ export default Step;
48
+ //# sourceMappingURL=Step.d.ts.map