@pega/cosmos-react-build 2.1.3 → 2.1.6
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.
- package/package.json +3 -3
- package/lib/components/AppHeader/AppHeader.d.ts +0 -29
- package/lib/components/AppHeader/AppHeader.d.ts.map +0 -1
- package/lib/components/AppHeader/AppHeader.js +0 -32
- package/lib/components/AppHeader/AppHeader.js.map +0 -1
- package/lib/components/AppHeader/AppHeader.styles.d.ts +0 -12
- package/lib/components/AppHeader/AppHeader.styles.d.ts.map +0 -1
- package/lib/components/AppHeader/AppHeader.styles.js +0 -123
- package/lib/components/AppHeader/AppHeader.styles.js.map +0 -1
- package/lib/components/AppHeader/index.d.ts +0 -3
- package/lib/components/AppHeader/index.d.ts.map +0 -1
- package/lib/components/AppHeader/index.js +0 -2
- package/lib/components/AppHeader/index.js.map +0 -1
- package/lib/components/AppShell/AppShell.d.ts +0 -4
- package/lib/components/AppShell/AppShell.d.ts.map +0 -1
- package/lib/components/AppShell/AppShell.js +0 -84
- package/lib/components/AppShell/AppShell.js.map +0 -1
- package/lib/components/AppShell/AppShell.styles.d.ts +0 -20
- package/lib/components/AppShell/AppShell.styles.d.ts.map +0 -1
- package/lib/components/AppShell/AppShell.styles.js +0 -331
- package/lib/components/AppShell/AppShell.styles.js.map +0 -1
- package/lib/components/AppShell/AppShell.types.d.ts +0 -43
- package/lib/components/AppShell/AppShell.types.d.ts.map +0 -1
- package/lib/components/AppShell/AppShell.types.js +0 -2
- package/lib/components/AppShell/AppShell.types.js.map +0 -1
- package/lib/components/AppShell/AppShellContext.d.ts +0 -4
- package/lib/components/AppShell/AppShellContext.d.ts.map +0 -1
- package/lib/components/AppShell/AppShellContext.js +0 -10
- package/lib/components/AppShell/AppShellContext.js.map +0 -1
- package/lib/components/AppShell/index.d.ts +0 -3
- package/lib/components/AppShell/index.d.ts.map +0 -1
- package/lib/components/AppShell/index.js +0 -2
- package/lib/components/AppShell/index.js.map +0 -1
- package/lib/components/FlowModeller/AddNode.d.ts +0 -16
- package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
- package/lib/components/FlowModeller/AddNode.js +0 -62
- package/lib/components/FlowModeller/AddNode.js.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.d.ts +0 -21
- package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.js +0 -190
- package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -54
- package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.js +0 -28
- package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -15
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -128
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -64
- package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
- package/lib/components/FlowModeller/NodeLibrary.d.ts +0 -13
- package/lib/components/FlowModeller/NodeLibrary.d.ts.map +0 -1
- package/lib/components/FlowModeller/NodeLibrary.js +0 -51
- package/lib/components/FlowModeller/NodeLibrary.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Connectors.d.ts +0 -13
- package/lib/components/FlowModeller/Renderer/Connectors.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Connectors.js +0 -47
- package/lib/components/FlowModeller/Renderer/Connectors.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Nodes.d.ts +0 -9
- package/lib/components/FlowModeller/Renderer/Nodes.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Nodes.js +0 -25
- package/lib/components/FlowModeller/Renderer/Nodes.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.js +0 -17
- package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
- package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -54
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -302
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -35
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -107
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -24
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -152
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
- package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts +0 -16
- package/lib/components/FlowModeller/Utils/AddNodeUtils.d.ts.map +0 -1
- package/lib/components/FlowModeller/Utils/AddNodeUtils.js +0 -118
- package/lib/components/FlowModeller/Utils/AddNodeUtils.js.map +0 -1
- package/lib/components/FlowModeller/helper.d.ts +0 -23
- package/lib/components/FlowModeller/helper.d.ts.map +0 -1
- package/lib/components/FlowModeller/helper.js +0 -128
- package/lib/components/FlowModeller/helper.js.map +0 -1
- package/lib/components/FlowModeller/index.d.ts +0 -10
- package/lib/components/FlowModeller/index.d.ts.map +0 -1
- package/lib/components/FlowModeller/index.js +0 -8
- package/lib/components/FlowModeller/index.js.map +0 -1
- package/lib/components/LifeCycle/Category.d.ts +0 -32
- package/lib/components/LifeCycle/Category.d.ts.map +0 -1
- package/lib/components/LifeCycle/Category.js +0 -98
- package/lib/components/LifeCycle/Category.js.map +0 -1
- package/lib/components/LifeCycle/LifeCycle.d.ts +0 -22
- package/lib/components/LifeCycle/LifeCycle.d.ts.map +0 -1
- package/lib/components/LifeCycle/LifeCycle.js +0 -73
- package/lib/components/LifeCycle/LifeCycle.js.map +0 -1
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +0 -56
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +0 -1
- package/lib/components/LifeCycle/LifeCycle.types.js +0 -2
- package/lib/components/LifeCycle/LifeCycle.types.js.map +0 -1
- package/lib/components/LifeCycle/LifeCycleList.d.ts +0 -22
- package/lib/components/LifeCycle/LifeCycleList.d.ts.map +0 -1
- package/lib/components/LifeCycle/LifeCycleList.js +0 -65
- package/lib/components/LifeCycle/LifeCycleList.js.map +0 -1
- package/lib/components/LifeCycle/Stage.d.ts +0 -49
- package/lib/components/LifeCycle/Stage.d.ts.map +0 -1
- package/lib/components/LifeCycle/Stage.js +0 -293
- package/lib/components/LifeCycle/Stage.js.map +0 -1
- package/lib/components/LifeCycle/Step.d.ts +0 -51
- package/lib/components/LifeCycle/Step.d.ts.map +0 -1
- package/lib/components/LifeCycle/Step.js +0 -241
- package/lib/components/LifeCycle/Step.js.map +0 -1
- package/lib/components/LifeCycle/Task.d.ts +0 -53
- package/lib/components/LifeCycle/Task.d.ts.map +0 -1
- package/lib/components/LifeCycle/Task.js +0 -188
- package/lib/components/LifeCycle/Task.js.map +0 -1
- package/lib/components/LifeCycle/index.d.ts +0 -4
- package/lib/components/LifeCycle/index.d.ts.map +0 -1
- package/lib/components/LifeCycle/index.js +0 -2
- package/lib/components/LifeCycle/index.js.map +0 -1
- package/lib/components/PageTemplates/GalleryPage.d.ts +0 -23
- package/lib/components/PageTemplates/GalleryPage.d.ts.map +0 -1
- package/lib/components/PageTemplates/GalleryPage.js +0 -23
- package/lib/components/PageTemplates/GalleryPage.js.map +0 -1
- package/lib/components/PageTemplates/GalleryPage.styles.d.ts +0 -9
- package/lib/components/PageTemplates/GalleryPage.styles.d.ts.map +0 -1
- package/lib/components/PageTemplates/GalleryPage.styles.js +0 -70
- package/lib/components/PageTemplates/GalleryPage.styles.js.map +0 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +0 -27
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +0 -1
- package/lib/components/PageTemplates/PageTemplates.js +0 -105
- package/lib/components/PageTemplates/PageTemplates.js.map +0 -1
- package/lib/components/PageTemplates/index.d.ts +0 -5
- package/lib/components/PageTemplates/index.d.ts.map +0 -1
- package/lib/components/PageTemplates/index.js +0 -4
- package/lib/components/PageTemplates/index.js.map +0 -1
- package/lib/components/SummaryCard/SummaryCard.d.ts +0 -16
- package/lib/components/SummaryCard/SummaryCard.d.ts.map +0 -1
- package/lib/components/SummaryCard/SummaryCard.js +0 -31
- package/lib/components/SummaryCard/SummaryCard.js.map +0 -1
- package/lib/components/SummaryCard/index.d.ts +0 -3
- package/lib/components/SummaryCard/index.d.ts.map +0 -1
- package/lib/components/SummaryCard/index.js +0 -3
- package/lib/components/SummaryCard/index.js.map +0 -1
- package/lib/components/Visual/Visual.d.ts +0 -17
- package/lib/components/Visual/Visual.d.ts.map +0 -1
- package/lib/components/Visual/Visual.js +0 -28
- package/lib/components/Visual/Visual.js.map +0 -1
- package/lib/components/Visual/index.d.ts +0 -3
- package/lib/components/Visual/index.d.ts.map +0 -1
- package/lib/components/Visual/index.js +0 -3
- package/lib/components/Visual/index.js.map +0 -1
- package/lib/components/Workbench/ConfigurationPanel.d.ts +0 -5
- package/lib/components/Workbench/ConfigurationPanel.d.ts.map +0 -1
- package/lib/components/Workbench/ConfigurationPanel.js +0 -21
- package/lib/components/Workbench/ConfigurationPanel.js.map +0 -1
- package/lib/components/Workbench/Toolbar.d.ts +0 -14
- package/lib/components/Workbench/Toolbar.d.ts.map +0 -1
- package/lib/components/Workbench/Toolbar.js +0 -14
- package/lib/components/Workbench/Toolbar.js.map +0 -1
- package/lib/components/Workbench/UtilityPanel.d.ts +0 -7
- package/lib/components/Workbench/UtilityPanel.d.ts.map +0 -1
- package/lib/components/Workbench/UtilityPanel.js +0 -12
- package/lib/components/Workbench/UtilityPanel.js.map +0 -1
- package/lib/components/Workbench/Workbench.d.ts +0 -6
- package/lib/components/Workbench/Workbench.d.ts.map +0 -1
- package/lib/components/Workbench/Workbench.js +0 -24
- package/lib/components/Workbench/Workbench.js.map +0 -1
- package/lib/components/Workbench/Workbench.styles.d.ts +0 -10
- package/lib/components/Workbench/Workbench.styles.d.ts.map +0 -1
- package/lib/components/Workbench/Workbench.styles.js +0 -71
- package/lib/components/Workbench/Workbench.styles.js.map +0 -1
- package/lib/components/Workbench/Workbench.types.d.ts +0 -49
- package/lib/components/Workbench/Workbench.types.d.ts.map +0 -1
- package/lib/components/Workbench/Workbench.types.js +0 -2
- package/lib/components/Workbench/Workbench.types.js.map +0 -1
- package/lib/components/Workbench/index.d.ts +0 -2
- package/lib/components/Workbench/index.d.ts.map +0 -1
- package/lib/components/Workbench/index.js +0 -2
- package/lib/components/Workbench/index.js.map +0 -1
- package/lib/index.d.ts +0 -13
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -14
- package/lib/index.js.map +0 -1
|
@@ -1,65 +0,0 @@
|
|
|
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, { role: 'row', lastItem: isLastItem, children: [_jsx(Stage, { 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
|
|
@@ -1 +0,0 @@
|
|
|
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;AAGlE,OAAO,KAAqB,MAAM,SAAS,CAAC;AAC5C,OAAO,QAA6B,MAAM,YAAY,CAAC;AA2BvD,MAAM,mBAAmB,GAAG,MAA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AAM,KAAK,CAAC;gBAC1B,UAAU,CAAC,MAAM,KAAK,CAAC;gBACvB,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;gBAC1B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,YAA+B,EAAE,aAAqB,EAAE,EAAE;oBAC7E,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;oBACtC,IAAI,SAAS,CAAC;oBACd,IAAI,IAAI;wBAAE,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,CAAC;oBAE1C,OAAO,CACL,KAAC,QAAQ,IAEP,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,KArDoB,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 type { NoChildrenProp } from '@pega/cosmos-react-core';\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 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?: '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"]}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, Ref, ChangeEvent, FocusEvent } 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
|
-
/** onFocus of input */
|
|
14
|
-
onFocus?: (param: LifeCycleActionParam, e: FocusEvent<HTMLInputElement>) => void;
|
|
15
|
-
}
|
|
16
|
-
export interface StageComponentProps extends BaseProps, StageProps {
|
|
17
|
-
ref?: Ref<HTMLDivElement>;
|
|
18
|
-
/** Pass text for the task. */
|
|
19
|
-
value: string;
|
|
20
|
-
id: string;
|
|
21
|
-
/** Controls the styling of the stage. */
|
|
22
|
-
variant?: StageItemProps['type'] | 'default';
|
|
23
|
-
/** To make the stage with pointed tail */
|
|
24
|
-
tailPointed?: boolean;
|
|
25
|
-
/** To make the stage with pointed head */
|
|
26
|
-
headPointed?: boolean;
|
|
27
|
-
/** Full data object which can be passed to the callback */
|
|
28
|
-
item: StageItemProps;
|
|
29
|
-
error?: string;
|
|
30
|
-
}
|
|
31
|
-
export declare const StyledWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
32
|
-
export declare const StyledDragIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
33
|
-
error: string;
|
|
34
|
-
}, never>;
|
|
35
|
-
export declare const StyledInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
|
|
36
|
-
error: string | undefined;
|
|
37
|
-
}, never>;
|
|
38
|
-
export declare const StyledStageActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
39
|
-
error?: string | undefined;
|
|
40
|
-
}, never>;
|
|
41
|
-
export declare const StyledStage: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, Pick<StageComponentProps, "variant"> & {
|
|
42
|
-
tailPointed: boolean;
|
|
43
|
-
headPointed: boolean;
|
|
44
|
-
status: boolean;
|
|
45
|
-
}, never>;
|
|
46
|
-
export declare const StyledInputWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
47
|
-
declare const Stage: FunctionComponent<StageComponentProps & ForwardProps>;
|
|
48
|
-
export default Stage;
|
|
49
|
-
//# sourceMappingURL=Stage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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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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;SA2KjB,CAAC;AAIH,eAAO,MAAM,kBAAkB,yGAQ9B,CAAC;AAEF,QAAA,MAAM,KAAK,EAAE,iBAAiB,CAAC,mBAAmB,GAAG,YAAY,CAgHhE,CAAC;AAEF,eAAe,KAAK,CAAC"}
|
|
@@ -1,293 +0,0 @@
|
|
|
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 { Flex, Actions, Icon, Tooltip, useElement, defaultThemeProp, useDirection, StyledTooltip, StyledButton } from '@pega/cosmos-react-core';
|
|
5
|
-
export const StyledWrapper = styled.div `
|
|
6
|
-
overflow: hidden;
|
|
7
|
-
`;
|
|
8
|
-
export const StyledDragIcon = styled.div(({ theme, error }) => {
|
|
9
|
-
return css `
|
|
10
|
-
width: 0%;
|
|
11
|
-
transition: width ${theme.base.animation.speed};
|
|
12
|
-
${error &&
|
|
13
|
-
css `
|
|
14
|
-
display: block;
|
|
15
|
-
`}
|
|
16
|
-
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
17
|
-
margin: calc(0.5 * ${theme.base.spacing}) 0;
|
|
18
|
-
color: ${theme.base.colors.white};
|
|
19
|
-
text-align: center;
|
|
20
|
-
`;
|
|
21
|
-
});
|
|
22
|
-
export const StyledInput = styled.input(({ error, theme }) => {
|
|
23
|
-
return css `
|
|
24
|
-
height: ${theme.components.input.height};
|
|
25
|
-
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
26
|
-
text-overflow: ellipsis;
|
|
27
|
-
border: 0.0625rem solid transparent;
|
|
28
|
-
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
29
|
-
width: 100%;
|
|
30
|
-
color: ${theme.base.colors.white};
|
|
31
|
-
outline: none;
|
|
32
|
-
&:hover {
|
|
33
|
-
cursor: pointer;
|
|
34
|
-
}
|
|
35
|
-
&:disabled {
|
|
36
|
-
cursor: not-allowed;
|
|
37
|
-
}
|
|
38
|
-
${error
|
|
39
|
-
? css `
|
|
40
|
-
background: ${theme.base.colors.red['extra-light']};
|
|
41
|
-
border: 0.0625rem solid ${theme.base.colors.red.medium};
|
|
42
|
-
color: ${theme.base.colors.black};
|
|
43
|
-
`
|
|
44
|
-
: css `
|
|
45
|
-
background: ${theme.base.palette['primary-background']};
|
|
46
|
-
&&:focus:enabled {
|
|
47
|
-
color: ${theme.base.colors.black};
|
|
48
|
-
background: ${theme.base.palette['primary-background']};
|
|
49
|
-
border: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
50
|
-
}
|
|
51
|
-
`}
|
|
52
|
-
`;
|
|
53
|
-
});
|
|
54
|
-
export const StyledStageActions = styled.div(({ theme, error }) => {
|
|
55
|
-
return css `
|
|
56
|
-
z-index: 2;
|
|
57
|
-
visibility: hidden;
|
|
58
|
-
margin-inline-start: calc(0.5 * ${theme.base.spacing});
|
|
59
|
-
|
|
60
|
-
${error &&
|
|
61
|
-
css `
|
|
62
|
-
visibility: visible;
|
|
63
|
-
`}
|
|
64
|
-
|
|
65
|
-
& > ${StyledButton} {
|
|
66
|
-
color: ${theme.base.colors.white};
|
|
67
|
-
}
|
|
68
|
-
`;
|
|
69
|
-
});
|
|
70
|
-
export const StyledStage = styled.div(({ variant, theme, tailPointed, headPointed, status }) => {
|
|
71
|
-
let bgColor;
|
|
72
|
-
let bgHover = '';
|
|
73
|
-
switch (variant) {
|
|
74
|
-
case 'start':
|
|
75
|
-
bgColor = theme.base.colors.blue.dark;
|
|
76
|
-
bgHover = theme.base.colors.blue.medium;
|
|
77
|
-
break;
|
|
78
|
-
case 'default':
|
|
79
|
-
bgColor = theme.base.colors.blue.medium;
|
|
80
|
-
bgHover = theme.base.colors.blue.light;
|
|
81
|
-
break;
|
|
82
|
-
case 'resolution':
|
|
83
|
-
bgColor = theme.base.colors.green.medium;
|
|
84
|
-
bgHover = theme.base.colors.green.light;
|
|
85
|
-
break;
|
|
86
|
-
case 'alternate':
|
|
87
|
-
bgColor = theme.base.colors.red.light;
|
|
88
|
-
bgHover = theme.base.colors.red['extra-light'];
|
|
89
|
-
break;
|
|
90
|
-
// eslint-disable-next-line sonarjs/no-duplicated-branches
|
|
91
|
-
default:
|
|
92
|
-
bgColor = theme.base.colors.blue.medium;
|
|
93
|
-
bgHover = theme.base.colors.blue.light;
|
|
94
|
-
}
|
|
95
|
-
const { rtl } = useDirection();
|
|
96
|
-
const roundedEndsStyles = css `
|
|
97
|
-
content: '';
|
|
98
|
-
position: absolute;
|
|
99
|
-
display: block;
|
|
100
|
-
width: calc(3 * ${theme.base.spacing});
|
|
101
|
-
height: calc(3 * ${theme.base.spacing});
|
|
102
|
-
top: calc(1 * ${theme.base.spacing});
|
|
103
|
-
border: 0;
|
|
104
|
-
border-inline-end: 0.0625rem solid transparent;
|
|
105
|
-
`;
|
|
106
|
-
return css `
|
|
107
|
-
position: relative;
|
|
108
|
-
padding: calc(0.5 * ${theme.base.spacing});
|
|
109
|
-
background: ${bgColor};
|
|
110
|
-
border: 0.0625rem solid transparent;
|
|
111
|
-
width: 100%;
|
|
112
|
-
|
|
113
|
-
&:hover {
|
|
114
|
-
cursor: pointer;
|
|
115
|
-
${StyledDragIcon} {
|
|
116
|
-
@keyframes anim {
|
|
117
|
-
0% {
|
|
118
|
-
transform: scale(0);
|
|
119
|
-
}
|
|
120
|
-
100% {
|
|
121
|
-
transform: scale(1);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
animation: anim ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
|
|
125
|
-
width: 10%;
|
|
126
|
-
transition: width ${theme.base.animation.speed};
|
|
127
|
-
}
|
|
128
|
-
${StyledStageActions} {
|
|
129
|
-
${css `
|
|
130
|
-
visibility: visible;
|
|
131
|
-
`}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
&:focus-within {
|
|
135
|
-
border: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
136
|
-
${!headPointed &&
|
|
137
|
-
css `
|
|
138
|
-
&::after {
|
|
139
|
-
border-inline-end: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
140
|
-
${rtl
|
|
141
|
-
? css `
|
|
142
|
-
border-block-start: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
143
|
-
`
|
|
144
|
-
: css `
|
|
145
|
-
border-block-end: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
146
|
-
`}
|
|
147
|
-
}
|
|
148
|
-
`}
|
|
149
|
-
${!tailPointed &&
|
|
150
|
-
css `
|
|
151
|
-
&::before {
|
|
152
|
-
border-inline-end: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
153
|
-
${rtl
|
|
154
|
-
? css `
|
|
155
|
-
border-block-end: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
156
|
-
`
|
|
157
|
-
: css `
|
|
158
|
-
border-block-start: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
159
|
-
`}
|
|
160
|
-
}
|
|
161
|
-
`}
|
|
162
|
-
${StyledDragIcon} {
|
|
163
|
-
${css `
|
|
164
|
-
@keyframes anim {
|
|
165
|
-
0% {
|
|
166
|
-
transform: scale(0);
|
|
167
|
-
}
|
|
168
|
-
100% {
|
|
169
|
-
transform: scale(1);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
animation: anim ${theme.base.animation.speed} ${theme.base.animation.timing.ease};
|
|
173
|
-
width: 10%;
|
|
174
|
-
transition: width ${theme.base.animation.speed};
|
|
175
|
-
`}
|
|
176
|
-
}
|
|
177
|
-
${StyledStageActions} {
|
|
178
|
-
${css `
|
|
179
|
-
visibility: visible;
|
|
180
|
-
`}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
${!headPointed &&
|
|
185
|
-
css `
|
|
186
|
-
&::after {
|
|
187
|
-
${roundedEndsStyles}
|
|
188
|
-
z-index: 1;
|
|
189
|
-
background: inherit;
|
|
190
|
-
transform: rotateZ(-45deg) skew(-15deg, -15deg);
|
|
191
|
-
inset-inline-end: calc(1.6 * ${theme.base.spacing} * -1);
|
|
192
|
-
border-block-end: 0.0625rem solid transparent;
|
|
193
|
-
${rtl
|
|
194
|
-
? css `
|
|
195
|
-
border-radius: calc(0.75 * ${theme.base['border-radius']}) 0.1rem 0.1rem 0.1rem;
|
|
196
|
-
`
|
|
197
|
-
: css `
|
|
198
|
-
border-radius: 0.0625rem 0.075rem calc(0.75 * ${theme.base['border-radius']})
|
|
199
|
-
0.0625rem;
|
|
200
|
-
`}
|
|
201
|
-
}
|
|
202
|
-
`}
|
|
203
|
-
|
|
204
|
-
${!tailPointed &&
|
|
205
|
-
css `
|
|
206
|
-
&::before {
|
|
207
|
-
${roundedEndsStyles}
|
|
208
|
-
background: ${theme.base.palette['app-background']};
|
|
209
|
-
transform: rotateZ(45deg) skew(15deg, 15deg);
|
|
210
|
-
inset-inline-start: calc(-1.6 * ${theme.base.spacing});
|
|
211
|
-
${rtl
|
|
212
|
-
? css `
|
|
213
|
-
border-block-end: 0.0625rem solid transparent;
|
|
214
|
-
border-radius: 0.0625rem 0 0.0625rem calc(0.75 * ${theme.base['border-radius']});
|
|
215
|
-
`
|
|
216
|
-
: css `
|
|
217
|
-
border-block-start: 0.0625rem solid transparent;
|
|
218
|
-
border-radius: 0.0625rem calc(0.75 * ${theme.base['border-radius']}) 0.0625rem 0;
|
|
219
|
-
`}
|
|
220
|
-
}
|
|
221
|
-
`}
|
|
222
|
-
|
|
223
|
-
${StyledInput} {
|
|
224
|
-
${!status &&
|
|
225
|
-
css `
|
|
226
|
-
border: 0.0625rem solid transparent;
|
|
227
|
-
background: ${bgColor};
|
|
228
|
-
`}
|
|
229
|
-
:hover:not([readonly]):not([disabled]):not(:focus) {
|
|
230
|
-
${!status &&
|
|
231
|
-
css `
|
|
232
|
-
border: 0.0625rem solid transparent;
|
|
233
|
-
background: ${bgHover};
|
|
234
|
-
`}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
`;
|
|
238
|
-
});
|
|
239
|
-
StyledStage.defaultProps = defaultThemeProp;
|
|
240
|
-
export const StyledInputWrapper = styled.div `
|
|
241
|
-
&:focus-within {
|
|
242
|
-
${StyledTooltip} {
|
|
243
|
-
${css `
|
|
244
|
-
display: none;
|
|
245
|
-
`}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
`;
|
|
249
|
-
const Stage = forwardRef(({ value, actions, variant = 'default', headPointed = true, tailPointed = true, onChange, onFocus, id, item, error, ...restProps }, ref) => {
|
|
250
|
-
const [inputEl, setInputEl] = useElement();
|
|
251
|
-
const [stageName, setStageName] = useState(value);
|
|
252
|
-
const onInputChange = (e) => {
|
|
253
|
-
setStageName(e.target.value);
|
|
254
|
-
const param = {
|
|
255
|
-
value: stageName,
|
|
256
|
-
stage: item
|
|
257
|
-
};
|
|
258
|
-
onChange?.(param, e);
|
|
259
|
-
};
|
|
260
|
-
const onInputFocus = (e) => {
|
|
261
|
-
const param = {
|
|
262
|
-
value: stageName,
|
|
263
|
-
stage: item
|
|
264
|
-
};
|
|
265
|
-
onFocus?.(param, e);
|
|
266
|
-
};
|
|
267
|
-
const onActionItemClick = (actionId, e) => {
|
|
268
|
-
const param = {
|
|
269
|
-
stage: item
|
|
270
|
-
};
|
|
271
|
-
actions?.forEach((actionItem) => {
|
|
272
|
-
if (actionItem.id === actionId) {
|
|
273
|
-
actionItem.onClick?.(param, e);
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
/* Deep copy of actions object is required to provide consistent callback objects on actions */
|
|
278
|
-
const actionsClone = [];
|
|
279
|
-
if (actions) {
|
|
280
|
-
actions.forEach(actionItem => {
|
|
281
|
-
const actionCloneItem = {};
|
|
282
|
-
Object.keys(actionItem).forEach((key) => {
|
|
283
|
-
actionCloneItem[key] = actionItem[key];
|
|
284
|
-
});
|
|
285
|
-
actionCloneItem.onClick = onActionItemClick;
|
|
286
|
-
actionsClone.push(actionCloneItem);
|
|
287
|
-
return actionItem;
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
return (_jsx(Flex, { container: { inline: true }, as: StyledStage, ...restProps, ref: ref, variant: variant || 'default', tailPointed: tailPointed, headPointed: headPointed, 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 }, 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));
|
|
291
|
-
});
|
|
292
|
-
export default Stage;
|
|
293
|
-
//# sourceMappingURL=Stage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Stage.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Stage.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EACR,UAAU,EAOX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EAGJ,OAAO,EACP,IAAI,EACJ,OAAO,EACP,UAAU,EAEV,gBAAgB,EAChB,YAAY,EACZ,aAAa,EAEb,YAAY,EACb,MAAM,yBAAyB,CAAC;A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H,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,EACjB,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,aAEjD,KAAC,WAAW,IACV,KAAK,EAAE,SAAS,EAChB,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,EAAE,EAAE,IAAI,CAAC,EAAE,EACX,QAAQ,EAAE,aAAa,gBACX,SAAS,EACrB,OAAO,EAAE,YAAY,WACrB,EACD,SAAS,IAAI,CACZ,KAAC,OAAO,IAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,YACvC,KAAK,IAAI,SAAS,WACX,CACX,YACI,EACP,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,YAC7B,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,iBAAG,WAClD,YAChB,YACF,WACF,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import {\n useState,\n forwardRef,\n FunctionComponent,\n PropsWithChildren,\n Ref,\n ChangeEvent,\n FocusEvent,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\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 /** onFocus of input */\n onFocus?: (param: LifeCycleActionParam, e: FocusEvent<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 { 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 }\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 onFocus,\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\n const onInputFocus = (e: FocusEvent<HTMLInputElement>) => {\n const param: LifeCycleActionParam = {\n value: stageName,\n stage: item\n };\n onFocus?.(param, e);\n };\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n stage: item\n };\n actions?.forEach((actionItem: LifeCycleAction) => {\n if (actionItem.id === actionId) {\n actionItem.onClick?.(param, e);\n }\n });\n };\n\n /* Deep copy of actions object is required to provide consistent callback objects on actions */\n const actionsClone: Action[] = [];\n\n if (actions) {\n 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 onFocus={onInputFocus}\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"]}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ChangeEvent, FocusEvent } 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
|
-
/** Input Change */
|
|
8
|
-
onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;
|
|
9
|
-
/** callback for Focus of input */
|
|
10
|
-
onFocus?: (param: LifeCycleActionParam, e: FocusEvent<HTMLInputElement>) => void;
|
|
11
|
-
}
|
|
12
|
-
interface StepComponentProps extends BaseProps, StepProps {
|
|
13
|
-
/** Pass text for the step. */
|
|
14
|
-
value?: string;
|
|
15
|
-
/** step data id */
|
|
16
|
-
id?: string;
|
|
17
|
-
/** Determines the visual for icon, color and label to render.
|
|
18
|
-
* This color is passed as a variant and accessible colors are used to display.
|
|
19
|
-
* Icon and label are passed as normal string */
|
|
20
|
-
visual: {
|
|
21
|
-
imgurl: string;
|
|
22
|
-
color: 'magenta' | 'studio' | 'congressBlue' | 'Japaneselaurel' | 'violet' | 'yellow' | 'orange' | 'darkyellow';
|
|
23
|
-
icon: string;
|
|
24
|
-
title: string;
|
|
25
|
-
};
|
|
26
|
-
badge?: StepItemProps['status'];
|
|
27
|
-
error?: string;
|
|
28
|
-
item: StepItemProps;
|
|
29
|
-
stageItem: StageItemProps;
|
|
30
|
-
taskItem: TaskItemProps;
|
|
31
|
-
categoryItem: CategoryItemProps;
|
|
32
|
-
}
|
|
33
|
-
export declare const StyledStepType: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
34
|
-
color: string;
|
|
35
|
-
ref: HTMLDivElement;
|
|
36
|
-
img: string;
|
|
37
|
-
}, never>;
|
|
38
|
-
export declare const StyledStepBadge: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
39
|
-
export declare const StyledStepValueInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
|
|
40
|
-
error: string | undefined;
|
|
41
|
-
}, never>;
|
|
42
|
-
export declare const StyledStepStatus: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
43
|
-
badge: string;
|
|
44
|
-
error: string;
|
|
45
|
-
}, never>;
|
|
46
|
-
export declare const StyledStep: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
47
|
-
error: string;
|
|
48
|
-
}, never>;
|
|
49
|
-
declare const Step: FunctionComponent<StepComponentProps & ForwardProps>;
|
|
50
|
-
export default Step;
|
|
51
|
-
//# sourceMappingURL=Step.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Step.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,WAAW,EACX,UAAU,EAEX,MAAM,OAAO,CAAC;AAIf,OAAO,EAGL,SAAS,EACT,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