@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,241 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { readableColor } from 'polished';
|
|
5
|
-
import { Flex, defaultThemeProp, Icon, Tooltip, useElement, Status, Actions, useI18n, Avatar, StyledTooltip } from '@pega/cosmos-react-core';
|
|
6
|
-
export const StyledStepType = styled.div(({ theme, color, img }) => {
|
|
7
|
-
let bgColor = '';
|
|
8
|
-
switch (color) {
|
|
9
|
-
case 'magenta':
|
|
10
|
-
bgColor = '#AC1361';
|
|
11
|
-
break;
|
|
12
|
-
case 'studio':
|
|
13
|
-
bgColor = '#684AAE';
|
|
14
|
-
break;
|
|
15
|
-
case 'congressBlue':
|
|
16
|
-
bgColor = '#0076d1';
|
|
17
|
-
break;
|
|
18
|
-
case 'Japaneselaurel':
|
|
19
|
-
bgColor = '#27813E';
|
|
20
|
-
break;
|
|
21
|
-
case 'violet':
|
|
22
|
-
bgColor = '#8C479F';
|
|
23
|
-
break;
|
|
24
|
-
case 'yellow':
|
|
25
|
-
bgColor = '#f7a801';
|
|
26
|
-
break;
|
|
27
|
-
case 'darkyellow':
|
|
28
|
-
bgColor = '#f7951c';
|
|
29
|
-
break;
|
|
30
|
-
case 'orange':
|
|
31
|
-
bgColor = '#f46c22';
|
|
32
|
-
break;
|
|
33
|
-
default:
|
|
34
|
-
bgColor = '#27813E';
|
|
35
|
-
}
|
|
36
|
-
const contrastColor = readableColor(bgColor);
|
|
37
|
-
return img
|
|
38
|
-
? css `
|
|
39
|
-
height: 2rem;
|
|
40
|
-
padding-inline-end: calc(0.25 * ${theme.base.spacing});
|
|
41
|
-
`
|
|
42
|
-
: css `
|
|
43
|
-
background: ${bgColor};
|
|
44
|
-
margin: calc(0.5 * ${theme.base.spacing});
|
|
45
|
-
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
46
|
-
color: ${contrastColor};
|
|
47
|
-
text-align: center;
|
|
48
|
-
border-radius: calc(0.25 * ${theme.base['border-radius']});
|
|
49
|
-
`;
|
|
50
|
-
});
|
|
51
|
-
export const StyledStepBadge = styled.div(({ theme }) => {
|
|
52
|
-
return css `
|
|
53
|
-
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
54
|
-
justify-content: flex-end;
|
|
55
|
-
width: auto;
|
|
56
|
-
max-width: calc(50% - ${theme.base.spacing});
|
|
57
|
-
> span {
|
|
58
|
-
white-space: nowrap;
|
|
59
|
-
text-overflow: ellipsis;
|
|
60
|
-
overflow: hidden;
|
|
61
|
-
}
|
|
62
|
-
`;
|
|
63
|
-
});
|
|
64
|
-
const StyledStepValue = styled.div(({ theme, error }) => {
|
|
65
|
-
return css `
|
|
66
|
-
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
67
|
-
${error &&
|
|
68
|
-
css `
|
|
69
|
-
background: ${theme.base.colors.red['extra-light']};
|
|
70
|
-
`}
|
|
71
|
-
`;
|
|
72
|
-
});
|
|
73
|
-
export const StyledStepValueInput = styled.input(({ error, theme }) => {
|
|
74
|
-
return css `
|
|
75
|
-
height: ${theme.components.input.height};
|
|
76
|
-
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
77
|
-
border: none;
|
|
78
|
-
border-inline-start: 0.0625rem solid transparent;
|
|
79
|
-
border-inline-end: 0.0625rem solid transparent;
|
|
80
|
-
text-overflow: ellipsis;
|
|
81
|
-
min-width: 40%;
|
|
82
|
-
outline: none;
|
|
83
|
-
&:hover {
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
}
|
|
86
|
-
&:disabled {
|
|
87
|
-
cursor: not-allowed;
|
|
88
|
-
}
|
|
89
|
-
${error
|
|
90
|
-
? css `
|
|
91
|
-
background: ${theme.base.colors.red['extra-light']};
|
|
92
|
-
&:focus:enabled {
|
|
93
|
-
border-color: ${theme.base.colors.red.medium};
|
|
94
|
-
}
|
|
95
|
-
`
|
|
96
|
-
: css `
|
|
97
|
-
background: ${theme.base.palette['secondary-background']};
|
|
98
|
-
&&:hover {
|
|
99
|
-
background: ${theme.base.palette['app-background']};
|
|
100
|
-
}
|
|
101
|
-
&&:focus:enabled {
|
|
102
|
-
background: ${theme.base.palette['primary-background']};
|
|
103
|
-
border-color: ${theme.base.colors.blue.medium};
|
|
104
|
-
}
|
|
105
|
-
`}
|
|
106
|
-
`;
|
|
107
|
-
});
|
|
108
|
-
export const StyledStepStatus = styled.div(({ theme, badge, error }) => {
|
|
109
|
-
return css `
|
|
110
|
-
border: none;
|
|
111
|
-
${badge &&
|
|
112
|
-
css `
|
|
113
|
-
display: none;
|
|
114
|
-
`}
|
|
115
|
-
visibility: hidden;
|
|
116
|
-
&:hover {
|
|
117
|
-
cursor: pointer;
|
|
118
|
-
}
|
|
119
|
-
&:focus:not([disabled]) {
|
|
120
|
-
outline: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
121
|
-
}
|
|
122
|
-
${error &&
|
|
123
|
-
!badge &&
|
|
124
|
-
css `
|
|
125
|
-
visibility: visible;
|
|
126
|
-
`}
|
|
127
|
-
`;
|
|
128
|
-
});
|
|
129
|
-
export const StyledStep = styled.div(({ theme, error }) => {
|
|
130
|
-
return css `
|
|
131
|
-
background: ${theme.base.palette['secondary-background']};
|
|
132
|
-
border: 0.0625rem solid transparent;
|
|
133
|
-
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
134
|
-
margin: 0 0 calc(0.5 * ${theme.base.spacing});
|
|
135
|
-
width: 100%;
|
|
136
|
-
${error &&
|
|
137
|
-
css `
|
|
138
|
-
border-color: ${theme.base.colors.red.medium};
|
|
139
|
-
box-shadow: none;
|
|
140
|
-
`}
|
|
141
|
-
&:hover {
|
|
142
|
-
cursor: pointer;
|
|
143
|
-
${StyledStepBadge} {
|
|
144
|
-
${css `
|
|
145
|
-
display: none;
|
|
146
|
-
`}
|
|
147
|
-
}
|
|
148
|
-
${StyledStepStatus} {
|
|
149
|
-
${css `
|
|
150
|
-
visibility: visible;
|
|
151
|
-
display: inline-block;
|
|
152
|
-
`}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
&:focus-within {
|
|
156
|
-
${!error &&
|
|
157
|
-
css `
|
|
158
|
-
border-color: ${theme.base.colors.blue.medium};
|
|
159
|
-
box-shadow: ${theme.components['form-control'][':focus']['box-shadow']};
|
|
160
|
-
`}
|
|
161
|
-
${StyledStepBadge} {
|
|
162
|
-
${css `
|
|
163
|
-
display: none;
|
|
164
|
-
`}
|
|
165
|
-
}
|
|
166
|
-
${StyledStepStatus} {
|
|
167
|
-
${css `
|
|
168
|
-
display: inline-block;
|
|
169
|
-
visibility: visible;
|
|
170
|
-
`}
|
|
171
|
-
}
|
|
172
|
-
${StyledTooltip} {
|
|
173
|
-
${css `
|
|
174
|
-
visibility: hidden;
|
|
175
|
-
`}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
`;
|
|
179
|
-
});
|
|
180
|
-
StyledStep.defaultProps = defaultThemeProp;
|
|
181
|
-
const Step = ({ value, id, visual, actions, badge, error, onChange, categoryItem, item, stageItem, taskItem, onFocus, ...restProps }) => {
|
|
182
|
-
const t = useI18n();
|
|
183
|
-
const [stepValue, setStepValue] = useState(value);
|
|
184
|
-
const [iconEl, setIconEl] = useElement();
|
|
185
|
-
const [actionEl, setActionEl] = useElement();
|
|
186
|
-
const [inputEl, setInputEl] = useElement();
|
|
187
|
-
const actionsLabel = t('actions');
|
|
188
|
-
const singleActionLabel = actions?.[0]?.text ?? '';
|
|
189
|
-
const tooltipValue = stepValue || error;
|
|
190
|
-
/* Need to check the value with statusProps */
|
|
191
|
-
const onActionItemClick = (actionId, e) => {
|
|
192
|
-
const param = {
|
|
193
|
-
task: taskItem,
|
|
194
|
-
stage: stageItem,
|
|
195
|
-
step: item,
|
|
196
|
-
category: categoryItem
|
|
197
|
-
};
|
|
198
|
-
actions?.forEach(actionItem => {
|
|
199
|
-
if (actionItem.id === actionId) {
|
|
200
|
-
actionItem.onClick(param, e);
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
/* Deep copy of actions is required to provide consistent callback objects on actions */
|
|
205
|
-
const actionsClone = [];
|
|
206
|
-
if (actions) {
|
|
207
|
-
actions.forEach(actionItem => {
|
|
208
|
-
const actionCloneItem = {};
|
|
209
|
-
Object.keys(actionItem).forEach((key) => {
|
|
210
|
-
actionCloneItem[key] = actionItem[key];
|
|
211
|
-
});
|
|
212
|
-
actionCloneItem.onClick = onActionItemClick;
|
|
213
|
-
actionsClone.push(actionCloneItem);
|
|
214
|
-
return actionItem;
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
const onInputChange = (e) => {
|
|
218
|
-
setStepValue(e.target.value);
|
|
219
|
-
const actionParam = {
|
|
220
|
-
value: e.target.value,
|
|
221
|
-
step: item,
|
|
222
|
-
task: taskItem,
|
|
223
|
-
category: categoryItem,
|
|
224
|
-
stage: stageItem
|
|
225
|
-
};
|
|
226
|
-
onChange?.(actionParam, e);
|
|
227
|
-
};
|
|
228
|
-
const onInputFocus = (e) => {
|
|
229
|
-
const actionParam = {
|
|
230
|
-
value: e.target.value,
|
|
231
|
-
step: item,
|
|
232
|
-
task: taskItem,
|
|
233
|
-
category: categoryItem,
|
|
234
|
-
stage: stageItem
|
|
235
|
-
};
|
|
236
|
-
onFocus?.(actionParam, e);
|
|
237
|
-
};
|
|
238
|
-
return (_jsxs(Flex, { as: StyledStep, container: { inline: true }, error: error, children: [_jsxs(Flex, { as: StyledStepType, color: visual.color, ref: setIconEl, img: visual.imgurl, children: [visual.imgurl.length > 0 && (_jsx(Avatar, { name: visual.title || '', imageSrc: visual?.imgurl, shape: 'squircle', size: 'm' }, void 0)), !visual.imgurl && _jsx(Icon, { name: visual.icon }, void 0)] }, void 0), _jsx(Tooltip, { target: iconEl, children: visual.title }, void 0), _jsxs(Flex, { as: StyledStepValue, item: { grow: 2 }, error: error, container: { inline: true, alignItems: 'center' }, children: [_jsx(StyledStepValueInput, { value: stepValue, type: 'text', ref: setInputEl, error: error, onChange: onInputChange, "aria-label": stepValue, id: item.id, ...restProps, onFocus: onInputFocus }, void 0), badge?.type && (_jsx(Flex, { as: StyledStepBadge, container: { inline: true, alignItems: 'center' }, children: _jsx(Status, { variant: badge?.type || 'success', children: badge?.label }, void 0) }, void 0))] }, void 0), _jsx(Tooltip, { target: inputEl, hideDelay: 'none', children: error || tooltipValue || 'test' }, void 0), _jsx(Flex, { as: StyledStepStatus, ref: setActionEl, badge: badge?.type, error: error, children: actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }, void 0) }, void 0), _jsx(Tooltip, { target: actionEl, "aria-hidden": 'true', children: actions && actions?.length > 1 ? actionsLabel : singleActionLabel }, void 0)] }, void 0));
|
|
239
|
-
};
|
|
240
|
-
export default Step;
|
|
241
|
-
//# sourceMappingURL=Step.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Step.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/Step.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,QAAQ,EAMT,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,EACJ,gBAAgB,EAGhB,IAAI,EACJ,OAAO,EACP,UAAU,EACV,MAAM,EAEN,OAAO,EACP,OAAO,EACP,MAAM,EACN,aAAa,EAEd,MAAM,yBAAyB,CAAC;AAqDjC,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CACtC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;IACxB,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,QAAQ,KAAK,EAAE;QACb,KAAK,SAAS;YACZ,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM;QACR,KAAK,QAAQ;YACX,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM;QACR,KAAK,cAAc;YACjB,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM;QACR,KAAK,gBAAgB;YACnB,OAAO,GAAG,SAAS,CAAC;YACpB,MAAM;QACR,KAAK,QAAQ;YACX,OAAO,GAAG,SAAS,CAAC;YACp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AC,oBAAoB,IACnB,KAAK,EAAE,SAAS,EAChB,IAAI,EAAC,MAAM,EACX,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,aAAa,gBACX,SAAS,EACrB,EAAE,EAAE,IAAI,CAAC,EAAE,KACP,SAAS,EACb,OAAO,EAAE,YAAY,WACrB,EACD,KAAK,EAAE,IAAI,IAAI,CACd,KAAC,IAAI,IAAC,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,YAC1E,KAAC,MAAM,IAAC,OAAO,EAAE,KAAK,EAAE,IAAI,IAAI,SAAS,YAAG,KAAK,EAAE,KAAK,WAAU,WAC7D,CACR,YACI,EACP,KAAC,OAAO,IAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,YACvC,KAAK,IAAI,YAAY,IAAI,MAAM,WACxB,EACV,KAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,EAAE,GAAG,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,YAC3E,YAAY,IAAI,KAAC,OAAO,IAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,iBAAG,WAChE,EACP,KAAC,OAAO,IAAC,MAAM,EAAE,QAAQ,iBAAc,MAAM,YAC1C,OAAO,IAAI,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,iBAAiB,WAC1D,YACL,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import {\n useState,\n FunctionComponent,\n PropsWithoutRef,\n ChangeEvent,\n FocusEvent,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\nimport { readableColor } from 'polished';\n\nimport {\n Flex,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Icon,\n Tooltip,\n useElement,\n Status,\n FormControlProps,\n Actions,\n useI18n,\n Avatar,\n StyledTooltip,\n Action\n} from '@pega/cosmos-react-core';\n\nimport {\n TaskItemProps,\n StepItemProps,\n StageItemProps,\n CategoryItemProps,\n LifeCycleAction,\n LifeCycleActionParam\n} from './LifeCycle.types';\n\nexport interface StepProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Input Change */\n onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;\n /** callback for Focus of input */\n onFocus?: (param: LifeCycleActionParam, e: FocusEvent<HTMLInputElement>) => void;\n}\n\ninterface StepComponentProps extends BaseProps, StepProps {\n /** Pass text for the step. */\n value?: string;\n /** step data id */\n id?: string;\n /** Determines the visual for icon, color and label to render.\n * This color is passed as a variant and accessible colors are used to display.\n * Icon and label are passed as normal string */\n visual: {\n imgurl: string;\n color:\n | 'magenta'\n | 'studio'\n | 'congressBlue'\n | 'Japaneselaurel'\n | 'violet'\n | 'yellow'\n | 'orange'\n | 'darkyellow';\n icon: string;\n title: string;\n };\n /* Determines the variant and label for the badges */\n badge?: StepItemProps['status'];\n /* The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /* Data of the steps which can be used to send the full info back */\n item: StepItemProps;\n stageItem: StageItemProps;\n taskItem: TaskItemProps;\n categoryItem: CategoryItemProps;\n}\n\nexport const StyledStepType = styled.div<{ color: string; ref: HTMLDivElement; img: string }>(\n ({ theme, color, img }) => {\n let bgColor = '';\n switch (color) {\n case 'magenta':\n bgColor = '#AC1361';\n break;\n case 'studio':\n bgColor = '#684AAE';\n break;\n case 'congressBlue':\n bgColor = '#0076d1';\n break;\n case 'Japaneselaurel':\n bgColor = '#27813E';\n break;\n case 'violet':\n bgColor = '#8C479F';\n break;\n case 'yellow':\n bgColor = '#f7a801';\n break;\n case 'darkyellow':\n bgColor = '#f7951c';\n break;\n case 'orange':\n bgColor = '#f46c22';\n break;\n\n default:\n bgColor = '#27813E';\n }\n\n const contrastColor = readableColor(bgColor);\n return img\n ? css`\n height: 2rem;\n padding-inline-end: calc(0.25 * ${theme.base.spacing});\n `\n : css`\n background: ${bgColor};\n margin: calc(0.5 * ${theme.base.spacing});\n padding: 0 calc(0.5 * ${theme.base.spacing});\n color: ${contrastColor};\n text-align: center;\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n `;\n }\n);\n\nexport const StyledStepBadge = styled.div(({ theme }) => {\n return css`\n padding: 0 calc(0.5 * ${theme.base.spacing});\n justify-content: flex-end;\n width: auto;\n max-width: calc(50% - ${theme.base.spacing});\n > span {\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n }\n `;\n});\n\nconst StyledStepValue = styled.div<{ error: string }>(({ theme, error }) => {\n return css`\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n ${error &&\n css`\n background: ${theme.base.colors.red['extra-light']};\n `}\n `;\n});\n\nexport const StyledStepValueInput = styled.input<{ error: string | undefined }>(\n ({ error, theme }) => {\n return css`\n height: ${theme.components.input.height};\n padding: 0 calc(0.5 * ${theme.base.spacing});\n border: none;\n border-inline-start: 0.0625rem solid transparent;\n border-inline-end: 0.0625rem solid transparent;\n text-overflow: ellipsis;\n min-width: 40%;\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 &:focus:enabled {\n border-color: ${theme.base.colors.red.medium};\n }\n `\n : css`\n background: ${theme.base.palette['secondary-background']};\n &&:hover {\n background: ${theme.base.palette['app-background']};\n }\n &&:focus:enabled {\n background: ${theme.base.palette['primary-background']};\n border-color: ${theme.base.colors.blue.medium};\n }\n `}\n `;\n }\n);\n\nexport const StyledStepStatus = styled.div<{\n badge: string;\n error: string;\n}>(({ theme, badge, error }) => {\n return css`\n border: none;\n ${badge &&\n css`\n display: none;\n `}\n visibility: hidden;\n &:hover {\n cursor: pointer;\n }\n &:focus:not([disabled]) {\n outline: 0.0625rem solid ${theme.base.colors.blue.medium};\n }\n ${error &&\n !badge &&\n css`\n visibility: visible;\n `}\n `;\n});\n\nexport const StyledStep = styled.div<{ error: string }>(({ theme, error }) => {\n return css`\n background: ${theme.base.palette['secondary-background']};\n border: 0.0625rem solid transparent;\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n width: 100%;\n ${error &&\n css`\n border-color: ${theme.base.colors.red.medium};\n box-shadow: none;\n `}\n &:hover {\n cursor: pointer;\n ${StyledStepBadge} {\n ${css`\n display: none;\n `}\n }\n ${StyledStepStatus} {\n ${css`\n visibility: visible;\n display: inline-block;\n `}\n }\n }\n &:focus-within {\n ${!error &&\n css`\n border-color: ${theme.base.colors.blue.medium};\n box-shadow: ${theme.components['form-control'][':focus']['box-shadow']};\n `}\n ${StyledStepBadge} {\n ${css`\n display: none;\n `}\n }\n ${StyledStepStatus} {\n ${css`\n display: inline-block;\n visibility: visible;\n `}\n }\n ${StyledTooltip} {\n ${css`\n visibility: hidden;\n `}\n }\n }\n `;\n});\n\nStyledStep.defaultProps = defaultThemeProp;\n\nconst Step: FunctionComponent<StepComponentProps & ForwardProps> = ({\n value,\n id,\n visual,\n actions,\n badge,\n error,\n onChange,\n categoryItem,\n item,\n stageItem,\n taskItem,\n onFocus,\n ...restProps\n}: PropsWithoutRef<StepComponentProps>) => {\n const t = useI18n();\n const [stepValue, setStepValue] = useState(value);\n const [iconEl, setIconEl] = useElement();\n const [actionEl, setActionEl] = useElement();\n const [inputEl, setInputEl] = useElement();\n const actionsLabel = t('actions');\n const singleActionLabel = (actions?.[0]?.text as string) ?? '';\n const tooltipValue = stepValue || error;\n\n /* Need to check the value with statusProps */\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: taskItem,\n stage: stageItem,\n step: item,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n /* Deep copy of actions is required to provide consistent callback objects on actions */\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n setStepValue(e.target.value);\n const actionParam: LifeCycleActionParam = {\n value: e.target.value,\n step: item,\n task: taskItem,\n category: categoryItem,\n stage: stageItem\n };\n onChange?.(actionParam, e);\n };\n\n const onInputFocus = (e: FocusEvent<HTMLInputElement>) => {\n const actionParam: LifeCycleActionParam = {\n value: e.target.value,\n step: item,\n task: taskItem,\n category: categoryItem,\n stage: stageItem\n };\n onFocus?.(actionParam, e);\n };\n\n return (\n <Flex as={StyledStep} container={{ inline: true }} error={error}>\n <Flex as={StyledStepType} color={visual.color} ref={setIconEl} img={visual.imgurl}>\n {visual.imgurl.length > 0 && (\n <Avatar name={visual.title || ''} imageSrc={visual?.imgurl} shape='squircle' size='m' />\n )}\n {!visual.imgurl && <Icon name={visual.icon} />}\n </Flex>\n\n <Tooltip target={iconEl}>{visual.title}</Tooltip>\n\n <Flex\n as={StyledStepValue}\n item={{ grow: 2 }}\n error={error}\n container={{ inline: true, alignItems: 'center' }}\n >\n <StyledStepValueInput\n value={stepValue}\n type='text'\n ref={setInputEl}\n error={error}\n onChange={onInputChange}\n aria-label={stepValue}\n id={item.id}\n {...restProps}\n onFocus={onInputFocus}\n />\n {badge?.type && (\n <Flex as={StyledStepBadge} container={{ inline: true, alignItems: 'center' }}>\n <Status variant={badge?.type || 'success'}>{badge?.label}</Status>\n </Flex>\n )}\n </Flex>\n <Tooltip target={inputEl} hideDelay='none'>\n {error || tooltipValue || 'test'}\n </Tooltip>\n <Flex as={StyledStepStatus} ref={setActionEl} badge={badge?.type} error={error}>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n </Flex>\n <Tooltip target={actionEl} aria-hidden='true'>\n {actions && actions?.length > 1 ? actionsLabel : singleActionLabel}\n </Tooltip>\n </Flex>\n );\n};\n\nexport default Step;\n"]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, ChangeEvent, FocusEvent } from 'react';
|
|
2
|
-
import { BaseProps, ForwardProps, FormControlProps } from '@pega/cosmos-react-core';
|
|
3
|
-
import { StepProps } from './Step';
|
|
4
|
-
import { TaskItemProps, StageItemProps, CategoryItemProps, LifeCycleAction, LifeCycleActionParam } from './LifeCycle.types';
|
|
5
|
-
export interface TaskProps extends Omit<FormControlProps, 'status' | 'id'> {
|
|
6
|
-
/** Pass an array of Action objects to append button(s) inline with the Input. */
|
|
7
|
-
actions?: LifeCycleAction[];
|
|
8
|
-
/** Tooltip for adding items to the task component */
|
|
9
|
-
addStepTitle: string;
|
|
10
|
-
/** Region for adding the task component */
|
|
11
|
-
addTask: {
|
|
12
|
-
title: string;
|
|
13
|
-
showOnce: boolean;
|
|
14
|
-
onAddTask?: LifeCycleAction['onClick'];
|
|
15
|
-
};
|
|
16
|
-
onAddStep?: LifeCycleAction['onClick'];
|
|
17
|
-
onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;
|
|
18
|
-
/** callback for Focus of input */
|
|
19
|
-
onFocus?: (param: LifeCycleActionParam, e: FocusEvent<HTMLInputElement>) => void;
|
|
20
|
-
}
|
|
21
|
-
interface TaskComponentProps extends BaseProps, TaskProps {
|
|
22
|
-
/** Pass text for the task. */
|
|
23
|
-
value?: string;
|
|
24
|
-
/** support for an Avatar, Icon, or other supporting visual. */
|
|
25
|
-
visual: {
|
|
26
|
-
imgurl: string;
|
|
27
|
-
};
|
|
28
|
-
/** Pass task data */
|
|
29
|
-
item: TaskItemProps;
|
|
30
|
-
error?: string;
|
|
31
|
-
/** Step Props */
|
|
32
|
-
step?: StepProps;
|
|
33
|
-
/** Stage data to pass it as callback */
|
|
34
|
-
stageItem: StageItemProps;
|
|
35
|
-
/** Category data to pass it as callback */
|
|
36
|
-
categoryItem: CategoryItemProps;
|
|
37
|
-
id: string;
|
|
38
|
-
}
|
|
39
|
-
export declare const StyledTaskList: import("styled-components").StyledComponent<"li", import("styled-components").DefaultTheme, {}, never>;
|
|
40
|
-
export declare const StyledCardHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
41
|
-
export declare const StyledCardContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
42
|
-
export declare const StyledInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {
|
|
43
|
-
error: string | undefined;
|
|
44
|
-
}, never>;
|
|
45
|
-
export declare const StyledTaskActions: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
46
|
-
ref: HTMLDivElement;
|
|
47
|
-
error: string;
|
|
48
|
-
}, never>;
|
|
49
|
-
export declare const StyledTask: import("styled-components").StyledComponent<"article", import("styled-components").DefaultTheme, {}, never>;
|
|
50
|
-
export declare const StyledInputWrapper: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
51
|
-
declare const Task: FunctionComponent<TaskComponentProps & ForwardProps>;
|
|
52
|
-
export default Task;
|
|
53
|
-
//# sourceMappingURL=Task.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Task.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/Task.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,WAAW,EACX,UAAU,EAEX,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,SAAS,EACT,YAAY,EAOZ,gBAAgB,EAIjB,MAAM,yBAAyB,CAAC;AAEjC,OAAa,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzC,OAA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AK3B,CAAC;AAGH,eAAO,MAAM,iBAAiB,yGAI5B,CAAC;AAGH,eAAO,MAAM,WAAW;WAAyB,MAAM,GAAG,SAAS;SA+BjE,CAAC;AAGH,eAAO,MAAM,iBAAiB;SACvB,cAAc;WACZ,MAAM;SAoBb,CAAC;AAGH,eAAO,MAAM,UAAU,6GAoBrB,CAAC;AAGH,eAAO,MAAM,kBAAkB,yGAQ9B,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,kBAAkB,GAAG,YAAY,CAqK9D,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Flex, defaultThemeProp, Button, Icon, Tooltip, useElement, Actions, useI18n, Avatar, StyledTooltip } from '@pega/cosmos-react-core';
|
|
5
|
-
import Step from './Step';
|
|
6
|
-
export const StyledTaskList = styled.li(({ theme }) => {
|
|
7
|
-
return css `
|
|
8
|
-
list-style-type: none;
|
|
9
|
-
margin-block-end: ${theme.base.spacing};
|
|
10
|
-
&:last-child > article {
|
|
11
|
-
margin-block-end: 0;
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
});
|
|
15
|
-
export const StyledCardHeader = styled.header(({ theme }) => {
|
|
16
|
-
return css `
|
|
17
|
-
padding: 0;
|
|
18
|
-
margin: 0 0 calc(0.5 * ${theme.base.spacing});
|
|
19
|
-
`;
|
|
20
|
-
});
|
|
21
|
-
StyledCardHeader.defaultProps = defaultThemeProp;
|
|
22
|
-
export const StyledCardContent = styled.div(() => {
|
|
23
|
-
return css `
|
|
24
|
-
padding: 0;
|
|
25
|
-
`;
|
|
26
|
-
});
|
|
27
|
-
StyledCardContent.defaultProps = defaultThemeProp;
|
|
28
|
-
export const StyledInput = styled.input(({ error, theme }) => {
|
|
29
|
-
return css `
|
|
30
|
-
height: ${theme.components.input.height};
|
|
31
|
-
padding: 0 calc(0.5 * ${theme.base.spacing});
|
|
32
|
-
text-overflow: ellipsis;
|
|
33
|
-
border: 0.0625rem solid transparent;
|
|
34
|
-
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
35
|
-
width: 100%;
|
|
36
|
-
outline: none;
|
|
37
|
-
&:hover {
|
|
38
|
-
cursor: pointer;
|
|
39
|
-
}
|
|
40
|
-
&:disabled {
|
|
41
|
-
cursor: not-allowed;
|
|
42
|
-
}
|
|
43
|
-
${error
|
|
44
|
-
? css `
|
|
45
|
-
background: ${theme.base.colors.red['extra-light']};
|
|
46
|
-
border: 0.0625rem solid ${theme.base.colors.red.medium};
|
|
47
|
-
`
|
|
48
|
-
: css `
|
|
49
|
-
background: ${theme.base.palette['primary-background']};
|
|
50
|
-
&&:hover {
|
|
51
|
-
background: ${theme.base.palette['secondary-background']};
|
|
52
|
-
}
|
|
53
|
-
&&:focus:enabled {
|
|
54
|
-
border: 0.0625rem solid ${theme.base.colors.blue.medium};
|
|
55
|
-
background: ${theme.base.palette['primary-background']};
|
|
56
|
-
}
|
|
57
|
-
`}
|
|
58
|
-
`;
|
|
59
|
-
});
|
|
60
|
-
StyledInput.defaultProps = defaultThemeProp;
|
|
61
|
-
export const StyledTaskActions = styled.div(({ error }) => {
|
|
62
|
-
return css `
|
|
63
|
-
border: none;
|
|
64
|
-
visibility: hidden;
|
|
65
|
-
&:hover {
|
|
66
|
-
cursor: pointer;
|
|
67
|
-
}
|
|
68
|
-
${error &&
|
|
69
|
-
css `
|
|
70
|
-
visibility: visible;
|
|
71
|
-
`}
|
|
72
|
-
&:focus-within {
|
|
73
|
-
${StyledTooltip} {
|
|
74
|
-
${css `
|
|
75
|
-
display: none;
|
|
76
|
-
`}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
`;
|
|
80
|
-
});
|
|
81
|
-
StyledTaskActions.defaultProps = defaultThemeProp;
|
|
82
|
-
export const StyledTask = styled.article(({ theme }) => {
|
|
83
|
-
return css `
|
|
84
|
-
background: ${theme.base.palette['primary-background']};
|
|
85
|
-
border-radius: calc(0.5 * ${theme.base['border-radius']});
|
|
86
|
-
padding: ${theme.base.spacing};
|
|
87
|
-
&:focus-within,
|
|
88
|
-
&:hover {
|
|
89
|
-
${StyledTaskActions} {
|
|
90
|
-
${css `
|
|
91
|
-
visibility: visible;
|
|
92
|
-
`}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
&:focus-within {
|
|
96
|
-
box-shadow: 0 0 0.2rem 0.0625rem ${theme.base.colors.blue.medium};
|
|
97
|
-
}
|
|
98
|
-
&:hover {
|
|
99
|
-
cursor: pointer;
|
|
100
|
-
}
|
|
101
|
-
`;
|
|
102
|
-
});
|
|
103
|
-
StyledTask.defaultProps = defaultThemeProp;
|
|
104
|
-
export const StyledInputWrapper = styled.div `
|
|
105
|
-
&:focus-within {
|
|
106
|
-
${StyledTooltip} {
|
|
107
|
-
${css `
|
|
108
|
-
display: none;
|
|
109
|
-
`}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
113
|
-
const Task = ({ value, visual, actions, item, addStepTitle, addTask, stageItem, error, onAddStep, onChange, onFocus, categoryItem, id, step: stepProp, ...restProps }) => {
|
|
114
|
-
const t = useI18n();
|
|
115
|
-
const [taskValue, setTaskValue] = useState(value);
|
|
116
|
-
const [actionEl, setActionEl] = useElement();
|
|
117
|
-
const [inputEl, setInputEl] = useElement();
|
|
118
|
-
const [addEl, setAddEl] = useElement();
|
|
119
|
-
const actionsLabel = t('actions');
|
|
120
|
-
const singleActionLabel = actions?.[0]?.text || '';
|
|
121
|
-
const onActionItemClick = (actionId, e) => {
|
|
122
|
-
const param = {
|
|
123
|
-
task: item,
|
|
124
|
-
stage: stageItem,
|
|
125
|
-
category: categoryItem
|
|
126
|
-
};
|
|
127
|
-
actions?.forEach(actionItem => {
|
|
128
|
-
if (actionItem.id === actionId) {
|
|
129
|
-
actionItem.onClick(param, e);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
};
|
|
133
|
-
/* Deep copy of actions is required to provide consistent callback objects on actions */
|
|
134
|
-
const actionsClone = [];
|
|
135
|
-
if (actions) {
|
|
136
|
-
actions.forEach(actionItem => {
|
|
137
|
-
const actionCloneItem = {};
|
|
138
|
-
Object.keys(actionItem).forEach((key) => {
|
|
139
|
-
actionCloneItem[key] = actionItem[key];
|
|
140
|
-
});
|
|
141
|
-
actionCloneItem.onClick = onActionItemClick;
|
|
142
|
-
actionsClone.push(actionCloneItem);
|
|
143
|
-
return actionItem;
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
const onInputChange = (e) => {
|
|
147
|
-
setTaskValue(e.target.value);
|
|
148
|
-
const param = {
|
|
149
|
-
value: taskValue,
|
|
150
|
-
task: item,
|
|
151
|
-
stage: stageItem,
|
|
152
|
-
category: categoryItem
|
|
153
|
-
};
|
|
154
|
-
onChange?.(param, e);
|
|
155
|
-
};
|
|
156
|
-
const onInputFocus = (e) => {
|
|
157
|
-
const param = {
|
|
158
|
-
value: taskValue,
|
|
159
|
-
task: item,
|
|
160
|
-
stage: stageItem,
|
|
161
|
-
category: categoryItem
|
|
162
|
-
};
|
|
163
|
-
onFocus?.(param, e);
|
|
164
|
-
};
|
|
165
|
-
const onAddStepClick = (e) => {
|
|
166
|
-
const param = {
|
|
167
|
-
task: item,
|
|
168
|
-
stage: stageItem,
|
|
169
|
-
category: categoryItem
|
|
170
|
-
};
|
|
171
|
-
onAddStep?.(param, e);
|
|
172
|
-
};
|
|
173
|
-
return (_jsx(Flex, { as: StyledTaskList, ...restProps, children: _jsxs(Flex, { as: StyledTask, container: { direction: 'column' }, role: 'region', children: [_jsxs(Flex, { as: StyledCardHeader, container: { itemGap: 0.4 }, children: [visual?.imgurl.length > 0 && _jsx(Avatar, { name: taskValue || '', imageSrc: visual?.imgurl }, void 0), _jsxs(Flex, { item: { grow: 1 }, as: StyledInputWrapper, container: { inline: true, alignItems: 'center' }, children: [_jsx(StyledInput, { value: taskValue, type: 'text', onChange: onInputChange, ref: setInputEl, error: error, id: item.id, "aria-labelledby": categoryItem.categoryId, onFocus: onInputFocus }, void 0), taskValue && (_jsx(Tooltip, { target: inputEl, hideDelay: 'none', children: error || taskValue }, void 0))] }, void 0), _jsxs(Flex, { as: StyledTaskActions, ref: setActionEl, error: error, children: [actionsClone && _jsx(Actions, { items: actionsClone, menuAt: 2, iconOnly: true }, void 0), _jsx(Tooltip, { target: actionEl, "aria-hidden": 'true', children: actions && actions?.length > 1 ? actionsLabel : singleActionLabel }, void 0)] }, void 0)] }, void 0), _jsxs(Flex, { as: StyledCardContent, children: [item?.steps.map((steps) => {
|
|
174
|
-
const badgeStatus = steps?.status?.type ? steps.status.type : '';
|
|
175
|
-
const badgeLabel = steps?.status?.label ? steps.status.label : '';
|
|
176
|
-
return (_jsx(Step, { id: steps.id, value: steps.label, visual: {
|
|
177
|
-
imgurl: steps.visual.imgurl,
|
|
178
|
-
color: steps.visual.color,
|
|
179
|
-
icon: steps.visual.icon,
|
|
180
|
-
title: steps.visual.label
|
|
181
|
-
}, item: steps, taskItem: item, stageItem: stageItem, badge: {
|
|
182
|
-
type: badgeStatus,
|
|
183
|
-
label: badgeLabel
|
|
184
|
-
}, error: steps.error, categoryItem: categoryItem, ...stepProp }, steps.id));
|
|
185
|
-
}), _jsxs(Flex, { children: [_jsx(Button, { variant: 'simple', label: addStepTitle, onClick: onAddStepClick, ref: setAddEl, icon: true, "aria-label": `${t('add')} ${addStepTitle}`, children: _jsx(Icon, { name: 'plus' }, void 0) }, void 0), _jsx(Tooltip, { target: addEl, "aria-hidden": 'true', children: `${t('add')} ${addStepTitle}` }, void 0)] }, void 0)] }, void 0)] }, void 0) }, void 0));
|
|
186
|
-
};
|
|
187
|
-
export default Task;
|
|
188
|
-
//# sourceMappingURL=Task.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Task.js","sourceRoot":"","sources":["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,EACvB,GAAG,EAAE,QAAQ,EACb,IAAI,sBACQ,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,EAAE,YAEzC,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,WAAG,WACb,EACT,KAAC,OAAO,IAAC,MAAM,EAAE,KAAK,iBAAc,MAAM,YACvC,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,EAAE,WACtB,YACL,YACF,YACF,WACF,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import {\n useState,\n FunctionComponent,\n PropsWithChildren,\n ChangeEvent,\n FocusEvent,\n MouseEvent\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n defaultThemeProp,\n BaseProps,\n ForwardProps,\n Button,\n Icon,\n Action,\n Tooltip,\n useElement,\n Actions,\n FormControlProps,\n useI18n,\n Avatar,\n StyledTooltip\n} from '@pega/cosmos-react-core';\n\nimport Step, { StepProps } from './Step';\nimport {\n TaskItemProps,\n StageItemProps,\n StepItemProps,\n CategoryItemProps,\n LifeCycleAction,\n LifeCycleActionParam\n} from './LifeCycle.types';\n\nexport interface TaskProps extends Omit<FormControlProps, 'status' | 'id'> {\n /** Pass an array of Action objects to append button(s) inline with the Input. */\n actions?: LifeCycleAction[];\n /** Tooltip for adding items to the task component */\n addStepTitle: string;\n /** Region for adding the task component */\n addTask: {\n title: string;\n showOnce: boolean;\n onAddTask?: LifeCycleAction['onClick'];\n };\n onAddStep?: LifeCycleAction['onClick'];\n onChange?: (param: LifeCycleActionParam, e: ChangeEvent<HTMLInputElement>) => void;\n /** callback for Focus of input */\n onFocus?: (param: LifeCycleActionParam, e: FocusEvent<HTMLInputElement>) => void;\n}\n\ninterface TaskComponentProps extends BaseProps, TaskProps {\n /** Pass text for the task. */\n value?: string;\n /** support for an Avatar, Icon, or other supporting visual. */\n visual: {\n imgurl: string;\n };\n /** Pass task data */\n item: TaskItemProps;\n /* The status is used to show the input error status and the info on tooltip in case of error */\n error?: string;\n /** Step Props */\n step?: StepProps;\n /** Stage data to pass it as callback */\n stageItem: StageItemProps;\n /** Category data to pass it as callback */\n categoryItem: CategoryItemProps;\n id: string;\n}\n\nexport const StyledTaskList = styled.li(({ theme }) => {\n return css`\n list-style-type: none;\n margin-block-end: ${theme.base.spacing};\n &:last-child > article {\n margin-block-end: 0;\n }\n `;\n});\n\nexport const StyledCardHeader = styled.header(({ theme }) => {\n return css`\n padding: 0;\n margin: 0 0 calc(0.5 * ${theme.base.spacing});\n `;\n});\nStyledCardHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCardContent = styled.div(() => {\n return css`\n padding: 0;\n `;\n});\nStyledCardContent.defaultProps = defaultThemeProp;\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 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 `\n : css`\n background: ${theme.base.palette['primary-background']};\n &&:hover {\n background: ${theme.base.palette['secondary-background']};\n }\n &&:focus:enabled {\n border: 0.0625rem solid ${theme.base.colors.blue.medium};\n background: ${theme.base.palette['primary-background']};\n }\n `}\n `;\n});\nStyledInput.defaultProps = defaultThemeProp;\n\nexport const StyledTaskActions = styled.div<{\n ref: HTMLDivElement;\n error: string;\n}>(({ error }) => {\n return css`\n border: none;\n visibility: hidden;\n &:hover {\n cursor: pointer;\n }\n ${error &&\n css`\n visibility: visible;\n `}\n &:focus-within {\n ${StyledTooltip} {\n ${css`\n display: none;\n `}\n }\n }\n `;\n});\nStyledTaskActions.defaultProps = defaultThemeProp;\n\nexport const StyledTask = styled.article(({ theme }) => {\n return css`\n background: ${theme.base.palette['primary-background']};\n border-radius: calc(0.5 * ${theme.base['border-radius']});\n padding: ${theme.base.spacing};\n &:focus-within,\n &:hover {\n ${StyledTaskActions} {\n ${css`\n visibility: visible;\n `}\n }\n }\n &:focus-within {\n box-shadow: 0 0 0.2rem 0.0625rem ${theme.base.colors.blue.medium};\n }\n &:hover {\n cursor: pointer;\n }\n `;\n});\nStyledTask.defaultProps = defaultThemeProp;\n\nexport const StyledInputWrapper = styled.div`\n &:focus-within {\n ${StyledTooltip} {\n ${css`\n display: none;\n `}\n }\n }\n`;\n\nconst Task: FunctionComponent<TaskComponentProps & ForwardProps> = ({\n value,\n visual,\n actions,\n item,\n addStepTitle,\n addTask,\n stageItem,\n error,\n onAddStep,\n onChange,\n onFocus,\n categoryItem,\n id,\n step: stepProp,\n ...restProps\n}: PropsWithChildren<TaskComponentProps>) => {\n const t = useI18n();\n const [taskValue, setTaskValue] = useState(value);\n const [actionEl, setActionEl] = useElement();\n const [inputEl, setInputEl] = useElement();\n const [addEl, setAddEl] = useElement();\n const actionsLabel = t('actions');\n const singleActionLabel = (actions?.[0]?.text as string) || '';\n\n const onActionItemClick = (\n actionId: string,\n e: MouseEvent<HTMLInputElement | HTMLAnchorElement | HTMLButtonElement>\n ) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n actions?.forEach(actionItem => {\n if (actionItem.id === actionId) {\n actionItem.onClick(param, e);\n }\n });\n };\n /* Deep copy of actions is required to provide consistent callback objects on actions */\n const actionsClone: Action[] = [];\n\n if (actions) {\n actions.forEach(actionItem => {\n const actionCloneItem = {} as Action;\n Object.keys(actionItem).forEach((key: string) => {\n actionCloneItem[key] = actionItem[key];\n });\n actionCloneItem.onClick = onActionItemClick;\n actionsClone.push(actionCloneItem);\n return actionItem;\n });\n }\n\n const onInputChange = (e: ChangeEvent<HTMLInputElement>) => {\n setTaskValue(e.target.value);\n const param: LifeCycleActionParam = {\n value: taskValue,\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onChange?.(param, e);\n };\n\n const onInputFocus = (e: FocusEvent<HTMLInputElement>) => {\n const param: LifeCycleActionParam = {\n value: taskValue,\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onFocus?.(param, e);\n };\n\n const onAddStepClick = (e: MouseEvent<HTMLButtonElement>) => {\n const param: LifeCycleActionParam = {\n task: item,\n stage: stageItem,\n category: categoryItem\n };\n onAddStep?.(param, e);\n };\n\n return (\n <Flex as={StyledTaskList} {...restProps}>\n <Flex as={StyledTask} container={{ direction: 'column' }} role='region'>\n <Flex as={StyledCardHeader} container={{ itemGap: 0.4 }}>\n {visual?.imgurl.length > 0 && <Avatar name={taskValue || ''} imageSrc={visual?.imgurl} />}\n <Flex\n item={{ grow: 1 }}\n as={StyledInputWrapper}\n container={{ inline: true, alignItems: 'center' }}\n >\n <StyledInput\n value={taskValue}\n type='text'\n onChange={onInputChange}\n ref={setInputEl}\n error={error}\n id={item.id}\n aria-labelledby={categoryItem.categoryId}\n onFocus={onInputFocus}\n />\n {taskValue && (\n <Tooltip target={inputEl} hideDelay='none'>\n {error || taskValue}\n </Tooltip>\n )}\n </Flex>\n <Flex as={StyledTaskActions} ref={setActionEl} error={error}>\n {actionsClone && <Actions items={actionsClone} menuAt={2} iconOnly />}\n <Tooltip target={actionEl} aria-hidden='true'>\n {actions && actions?.length > 1 ? actionsLabel : singleActionLabel}\n </Tooltip>\n </Flex>\n </Flex>\n <Flex as={StyledCardContent}>\n {item?.steps.map((steps: StepItemProps) => {\n const badgeStatus = steps?.status?.type ? steps.status.type : '';\n const badgeLabel = steps?.status?.label ? steps.status.label : '';\n return (\n <Step\n key={steps.id}\n id={steps.id}\n value={steps.label}\n visual={{\n imgurl: steps.visual.imgurl,\n color: steps.visual.color,\n icon: steps.visual.icon,\n title: steps.visual.label\n }}\n item={steps}\n taskItem={item}\n stageItem={stageItem}\n badge={{\n type: badgeStatus,\n label: badgeLabel\n }}\n error={steps.error}\n categoryItem={categoryItem}\n {...stepProp}\n />\n );\n })}\n <Flex>\n <Button\n variant='simple'\n label={addStepTitle}\n onClick={onAddStepClick}\n ref={setAddEl}\n icon\n aria-label={`${t('add')} ${addStepTitle}`}\n >\n <Icon name='plus' />\n </Button>\n <Tooltip target={addEl} aria-hidden='true'>\n {`${t('add')} ${addStepTitle}`}\n </Tooltip>\n </Flex>\n </Flex>\n </Flex>\n </Flex>\n );\n};\n\nexport default Task;\n"]}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { default } from './LifeCycle';
|
|
2
|
-
export { LifeCycleProps } from './LifeCycle';
|
|
3
|
-
export { StepItemProps, TaskItemProps, StageItemProps, CategoryItemProps, CategoriesItemProps, LifeCycleActionParam, LifeCycleAction } from './LifeCycle.types';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,aAAa,EACb,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/LifeCycle/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { default } from './LifeCycle';\nexport { LifeCycleProps } from './LifeCycle';\nexport {\n StepItemProps,\n TaskItemProps,\n StageItemProps,\n CategoryItemProps,\n CategoriesItemProps,\n LifeCycleActionParam,\n LifeCycleAction\n} from './LifeCycle.types';\n"]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { FC, Ref, MouseEvent } from 'react';
|
|
2
|
-
import { ForwardProps, ImageProps, NoChildrenProp } from '@pega/cosmos-react-core';
|
|
3
|
-
import { SummaryCardProps } from '../SummaryCard';
|
|
4
|
-
interface EmptyStateProps {
|
|
5
|
-
heading: string;
|
|
6
|
-
description?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface GalleryPageProps extends NoChildrenProp {
|
|
9
|
-
heading: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
image?: ImageProps;
|
|
12
|
-
action: {
|
|
13
|
-
text: string;
|
|
14
|
-
onClick: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
15
|
-
};
|
|
16
|
-
emptyState: EmptyStateProps;
|
|
17
|
-
items?: SummaryCardProps[];
|
|
18
|
-
onItemClick: (id: SummaryCardProps['id'], e: MouseEvent<HTMLDivElement>) => void;
|
|
19
|
-
ref?: Ref<HTMLDivElement>;
|
|
20
|
-
}
|
|
21
|
-
declare const GalleryPage: FC<GalleryPageProps & ForwardProps>;
|
|
22
|
-
export default GalleryPage;
|
|
23
|
-
//# sourceMappingURL=GalleryPage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GalleryPage.d.ts","sourceRoot":"","sources":["../../../src/components/PageTemplates/GalleryPage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA+B,GAAG,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EACL,YAAY,EAEZ,UAAU,EAIV,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAY/D,UAAU,eAAe;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;KACrD,CAAC;IACF,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAE,CAAC,EAAE,EAAE,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,UAAU,CAAC,cAAc,CAAC,KAAK,IAAI,CAAC;IACjF,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAmED,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,YAAY,CA+BpD,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { Image, Flex, Grid, Button } from '@pega/cosmos-react-core';
|
|
4
|
-
import SummaryCard from '../SummaryCard';
|
|
5
|
-
import { StyledDescription, StyledHeading, StyledSummaryCardList, StyledBanner, StyledImageContainer, StyledGalleryPage, StyledBannerInfo } from './GalleryPage.styles';
|
|
6
|
-
const Banner = ({ heading, description, image, action }) => {
|
|
7
|
-
return (_jsxs(Flex, { container: { alignItems: 'center', justify: 'between' }, as: StyledBanner, children: [_jsxs(Flex, { as: StyledBannerInfo, item: { grow: 1 }, children: [_jsx(StyledHeading, { variant: 'h1', children: heading }, void 0), description && _jsx(StyledDescription, { children: description }, void 0), action && (_jsx(Button, { onClick: (e) => action.onClick(e), children: action.text }, void 0))] }, void 0), image && (_jsx(StyledImageContainer, { children: _jsx(Image, { ...image }, void 0) }, void 0))] }, void 0));
|
|
8
|
-
};
|
|
9
|
-
const SummaryCardList = ({ items, onItemClick }) => {
|
|
10
|
-
return (_jsx(Grid, { container: {
|
|
11
|
-
cols: 'repeat(auto-fill, minmax(18.75rem, 1fr))',
|
|
12
|
-
autoRows: '10rem',
|
|
13
|
-
gap: 2
|
|
14
|
-
}, as: StyledSummaryCardList, children: items && items.map(item => _jsx(SummaryCard, { ...item, onClick: onItemClick }, item.id)) }, void 0));
|
|
15
|
-
};
|
|
16
|
-
const EmptyState = ({ heading, description, action }) => {
|
|
17
|
-
return (_jsxs(Flex, { container: { direction: 'column', alignItems: 'center', justify: 'center', rowGap: 2 }, item: { grow: 1 }, children: [_jsx(StyledHeading, { variant: 'h2', children: heading }, void 0), description && _jsx(StyledDescription, { children: description }, void 0), action && (_jsx(Button, { variant: 'primary', onClick: action.onClick, children: action.text }, void 0))] }, void 0));
|
|
18
|
-
};
|
|
19
|
-
const GalleryPage = forwardRef(({ heading, description, image, items, onItemClick, emptyState, action }, ref) => {
|
|
20
|
-
return (_jsx(StyledGalleryPage, { title: '', ref: ref, header: _jsx(Banner, { heading: heading, description: description, action: action, image: image }, void 0), a: items && items.length > 0 ? (_jsx(SummaryCardList, { items: items, onItemClick: onItemClick }, void 0)) : (_jsx(EmptyState, { ...emptyState, action: action }, void 0)), scrollContent: true }, void 0));
|
|
21
|
-
});
|
|
22
|
-
export default GalleryPage;
|
|
23
|
-
//# sourceMappingURL=GalleryPage.js.map
|