@pega/cosmos-react-work 9.0.0-build.29.2 → 9.0.0-build.29.20
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/lib/components/CaseHierarchy/CaseHierarchy.d.ts +2 -2
- package/lib/components/CaseHierarchy/CaseHierarchy.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.js +3 -3
- package/lib/components/CaseHierarchy/CaseHierarchy.js.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.styles.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.styles.js +9 -7
- package/lib/components/CaseHierarchy/CaseHierarchy.styles.js.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js +2 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.test-ids.js.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts +7 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.types.d.ts.map +1 -1
- package/lib/components/CaseHierarchy/CaseHierarchy.types.js.map +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +5 -4
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.js +24 -4
- package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +1 -1
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +69 -65
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- package/lib/components/CaseView/CaseView.types.d.ts +9 -3
- package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.types.js.map +1 -1
- package/lib/components/GenAICoach/CaseWorkflow.d.ts.map +1 -1
- package/lib/components/GenAICoach/CaseWorkflow.js +5 -4
- package/lib/components/GenAICoach/CaseWorkflow.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.js +6 -5
- package/lib/components/GenAICoach/GenAICoach.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.styles.js +22 -22
- package/lib/components/GenAICoach/GenAICoach.styles.js.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.d.ts +2 -0
- package/lib/components/GenAICoach/GenAICoach.types.d.ts.map +1 -1
- package/lib/components/GenAICoach/GenAICoach.types.js.map +1 -1
- package/lib/components/HierarchicalAssignments/Assignments.styles.d.ts.map +1 -1
- package/lib/components/HierarchicalAssignments/Assignments.styles.js +0 -1
- package/lib/components/HierarchicalAssignments/Assignments.styles.js.map +1 -1
- package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts +2 -0
- package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.d.ts.map +1 -1
- package/lib/components/HierarchicalAssignments/HierarchicalAssignments.types.js.map +1 -1
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts +1 -1
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.d.ts.map +1 -1
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js +2 -2
- package/lib/components/HierarchicalAssignments/nodeItems/AssignmentItem.js.map +1 -1
- package/lib/components/Tasks/TaskList.d.ts +3 -1
- package/lib/components/Tasks/TaskList.d.ts.map +1 -1
- package/lib/components/Tasks/TaskList.js +2 -2
- package/lib/components/Tasks/TaskList.js.map +1 -1
- package/lib/components/Tasks/Tasks.d.ts +5 -0
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +29 -5
- package/lib/components/Tasks/Tasks.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CaseHierarchyProps } from './CaseHierarchy.types';
|
|
2
|
-
declare const _default: import("react").ForwardRefExoticComponent<Omit<CaseHierarchyProps, "ref"> & import("react").RefAttributes<
|
|
3
|
-
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "icon", "count"]>;
|
|
2
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<CaseHierarchyProps, "ref"> & import("react").RefAttributes<HTMLDivElement>> & {
|
|
3
|
+
getTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "icon", "count", "search"]>;
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
//# sourceMappingURL=CaseHierarchy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CaseHierarchy.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;;;;AAgFhE,wBAAmE"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
|
-
import { colorIconMapping, Count, EmptyState, ErrorState, Flex, Icon, Progress, Text, useI18n, useTestIds, useTheme, withTestIds } from '@pega/cosmos-react-core';
|
|
3
|
+
import { colorIconMapping, Count, EmptyState, ErrorState, Flex, Icon, Progress, SearchInput, Text, useI18n, useTestIds, useTheme, withTestIds } from '@pega/cosmos-react-core';
|
|
4
4
|
import { StyledCaseHierarchy, StyledCaseHierarchyHeader, StyledCaseHierarchyTree, StyledOverflowContainer } from './CaseHierarchy.styles';
|
|
5
5
|
import { getCaseHierarchyTestIds } from './CaseHierarchy.test-ids';
|
|
6
|
-
const CaseHierarchy = forwardRef(function CaseHierarchy({ testId, heading, icon, loading, error, count, nodes, currentCaseId, ...restProps }, ref) {
|
|
6
|
+
const CaseHierarchy = forwardRef(function CaseHierarchy({ testId, heading, icon, loading, error, count, nodes, search, currentCaseId, ...restProps }, ref) {
|
|
7
7
|
const t = useI18n();
|
|
8
8
|
const theme = useTheme();
|
|
9
9
|
const testIds = useTestIds(testId, getCaseHierarchyTestIds);
|
|
@@ -19,7 +19,7 @@ const CaseHierarchy = forwardRef(function CaseHierarchy({ testId, heading, icon,
|
|
|
19
19
|
}
|
|
20
20
|
return _jsx(StyledCaseHierarchyTree, { ...restProps, currentNodeId: currentCaseId, nodes: nodes });
|
|
21
21
|
})();
|
|
22
|
-
return (_jsxs(StyledCaseHierarchy, { "data-testid": testIds.root, ref: ref, children: [_jsx(StyledCaseHierarchyHeader, { children: _jsxs(Flex, { container: { alignItems: 'center', gap: 1 }, children: [theme.components['case-view'].utilities['icon-color'] ? (_jsx(Icon, { "data-testid": testIds.icon, name: icon ?? 'folder-nested', background: colorIconMapping(theme, icon ?? 'folder-nested'), shape: 'circle' })) : (_jsx(Icon, { "data-testid": testIds.icon, name: icon ?? 'folder-nested' })), _jsx(Text, { "data-testid": testIds.heading, variant: 'h3', children: heading }), !loading && typeof count === 'number' && (_jsx(Count, { "data-testid": testIds.count, children: count }))] }) }), _jsx(StyledOverflowContainer, { children: content })] }));
|
|
22
|
+
return (_jsxs(StyledCaseHierarchy, { "data-testid": testIds.root, ref: ref, children: [_jsx(StyledCaseHierarchyHeader, { children: _jsxs(Flex, { container: { direction: 'column', gap: 1 }, item: { grow: 1 }, children: [_jsxs(Flex, { container: { direction: 'row', alignItems: 'center', gap: 1 }, children: [theme.components['case-view'].utilities['icon-color'] ? (_jsx(Icon, { "data-testid": testIds.icon, name: icon ?? 'folder-nested', background: colorIconMapping(theme, icon ?? 'folder-nested'), shape: 'circle' })) : (_jsx(Icon, { "data-testid": testIds.icon, name: icon ?? 'folder-nested' })), _jsx(Text, { "data-testid": testIds.heading, variant: 'h3', children: heading }), !loading && typeof count === 'number' && (_jsx(Count, { "data-testid": testIds.count, children: count }))] }), search && (_jsx(SearchInput, { "data-testid": testIds.search, value: search.value, onSearchChange: search.handler }))] }) }), _jsx(StyledOverflowContainer, { children: content })] }));
|
|
23
23
|
});
|
|
24
24
|
export default withTestIds(CaseHierarchy, getCaseHierarchyTestIds);
|
|
25
25
|
//# sourceMappingURL=CaseHierarchy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,aAAa,CACrD,EACE,MAAM,EACN,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,aAAa,EACb,GAAG,SAAS,EACwB,EACtC,
|
|
1
|
+
{"version":3,"file":"CaseHierarchy.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EACL,gBAAgB,EAChB,KAAK,EACL,UAAU,EACV,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,WAAW,EACX,IAAI,EACJ,OAAO,EACP,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,MAAM,aAAa,GAAG,UAAU,CAAC,SAAS,aAAa,CACrD,EACE,MAAM,EACN,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,aAAa,EACb,GAAG,SAAS,EACwB,EACtC,GAAwB;IAExB,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;IAE5D,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE;QACpB,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,KAAC,UAAU,IAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,GAAI,CAAC;QAC7C,CAAC;QAED,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,CAAC;QACxC,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,KAAC,UAAU,KAAG,CAAC;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IACI,GACmB,EAC5B,KAAC,uBAAuB,cAAE,OAAO,GAA2B,IACxC,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\n\nimport {\n colorIconMapping,\n Count,\n EmptyState,\n ErrorState,\n Flex,\n Icon,\n Progress,\n SearchInput,\n Text,\n useI18n,\n useTestIds,\n useTheme,\n withTestIds\n} from '@pega/cosmos-react-core';\n\nimport type { CaseHierarchyProps } from './CaseHierarchy.types';\nimport {\n StyledCaseHierarchy,\n StyledCaseHierarchyHeader,\n StyledCaseHierarchyTree,\n StyledOverflowContainer\n} from './CaseHierarchy.styles';\nimport { getCaseHierarchyTestIds } from './CaseHierarchy.test-ids';\n\nconst CaseHierarchy = forwardRef(function CaseHierarchy(\n {\n testId,\n heading,\n icon,\n loading,\n error,\n count,\n nodes,\n search,\n currentCaseId,\n ...restProps\n }: PropsWithoutRef<CaseHierarchyProps>,\n ref: Ref<HTMLDivElement>\n) {\n const t = useI18n();\n const theme = useTheme();\n const testIds = useTestIds(testId, getCaseHierarchyTestIds);\n\n const content = (() => {\n if (error) {\n return <ErrorState message={t('error')} />;\n }\n\n if (loading) {\n return <Progress placement='block' />;\n }\n\n if (nodes.length === 0) {\n return <EmptyState />;\n }\n\n return <StyledCaseHierarchyTree {...restProps} currentNodeId={currentCaseId} nodes={nodes} />;\n })();\n\n return (\n <StyledCaseHierarchy data-testid={testIds.root} ref={ref}>\n <StyledCaseHierarchyHeader>\n <Flex container={{ direction: 'column', gap: 1 }} item={{ grow: 1 }}>\n <Flex container={{ direction: 'row', alignItems: 'center', gap: 1 }}>\n {theme.components['case-view'].utilities['icon-color'] ? (\n <Icon\n data-testid={testIds.icon}\n name={icon ?? 'folder-nested'}\n background={colorIconMapping(theme, icon ?? 'folder-nested')}\n shape='circle'\n />\n ) : (\n <Icon data-testid={testIds.icon} name={icon ?? 'folder-nested'} />\n )}\n <Text data-testid={testIds.heading} variant='h3'>\n {heading}\n </Text>\n {!loading && typeof count === 'number' && (\n <Count data-testid={testIds.count}>{count}</Count>\n )}\n </Flex>\n {search && (\n <SearchInput\n data-testid={testIds.search}\n value={search.value}\n onSearchChange={search.handler}\n />\n )}\n </Flex>\n </StyledCaseHierarchyHeader>\n <StyledOverflowContainer>{content}</StyledOverflowContainer>\n </StyledCaseHierarchy>\n );\n});\n\nexport default withTestIds(CaseHierarchy, getCaseHierarchyTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,
|
|
1
|
+
{"version":3,"file":"CaseHierarchy.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,YAAY,EAKb,MAAM,yBAAyB,CAAC;AAQjC,eAAO,MAAM,uBAAuB,EAAE,OAAO,YAe5C,CAAC;AAIF,eAAO,MAAM,uBAAuB,6ZAoBnC,CAAC;AAIF,eAAO,MAAM,yBAAyB;;2BAYpC,CAAC;AAIH,eAAO,MAAM,mBAAmB;;yLAI/B,CAAC"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { defaultThemeProp, StandardTree, Card, CardContent, StyledFlex } from '@pega/cosmos-react-core';
|
|
2
|
+
import { defaultThemeProp, StandardTree, Card, CardContent, StyledFlex, StyledButton } from '@pega/cosmos-react-core';
|
|
3
3
|
import { StyledSummaryListHeader } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';
|
|
4
4
|
import { StyledDialog } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.styles';
|
|
5
|
-
import { StyledNodeInteraction } from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';
|
|
6
|
-
export const StyledCaseHierarchyTree = styled(StandardTree)(({ theme }) =>
|
|
7
|
-
return css `
|
|
5
|
+
import { StyledLabelContainer, StyledNodeInteraction } from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';
|
|
6
|
+
export const StyledCaseHierarchyTree = styled(StandardTree)(({ theme }) => css `
|
|
8
7
|
display: table;
|
|
9
8
|
width: 100%;
|
|
10
9
|
|
|
10
|
+
${StyledLabelContainer} ${StyledButton} {
|
|
11
|
+
align-self: flex-start;
|
|
12
|
+
margin-block-start: calc(${theme.base.spacing} / 4);
|
|
13
|
+
}
|
|
14
|
+
|
|
11
15
|
[aria-current='true'],
|
|
12
16
|
[aria-current='page'] {
|
|
13
17
|
font-weight: ${theme.base['font-weight']['semi-bold']};
|
|
14
18
|
}
|
|
15
|
-
|
|
16
|
-
});
|
|
19
|
+
`);
|
|
17
20
|
StyledCaseHierarchyTree.defaultProps = defaultThemeProp;
|
|
18
21
|
export const StyledOverflowContainer = styled(CardContent)(({ theme }) => css `
|
|
19
22
|
overflow: auto;
|
|
@@ -51,7 +54,6 @@ export const StyledCaseHierarchyHeader = styled(StyledSummaryListHeader)(({ them
|
|
|
51
54
|
StyledCaseHierarchyHeader.defaultProps = defaultThemeProp;
|
|
52
55
|
export const StyledCaseHierarchy = styled(Card) `
|
|
53
56
|
${StyledDialog} & {
|
|
54
|
-
/* stylelint-disable-next-line unit-allowed-list */
|
|
55
57
|
max-height: calc(100dvh - 5rem);
|
|
56
58
|
}
|
|
57
59
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.styles.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,UAAU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AAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrF,OAAO,GAAG,CAAA;8BACkB,KAAK,CAAC,IAAI,CAAC,OAAO;;MAE1C,UAAU;oBACI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;;;sBAGjC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC;;;GAGvD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;IAC3C,YAAY;;;CAGf,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport {\n defaultThemeProp,\n StandardTree,\n Card,\n CardContent,\n StyledFlex,\n StyledButton\n} from '@pega/cosmos-react-core';\nimport { StyledSummaryListHeader } from '@pega/cosmos-react-core/lib/components/SummaryList/SummaryList';\nimport { StyledDialog } from '@pega/cosmos-react-core/lib/components/Dialog/Dialog.styles';\nimport {\n StyledLabelContainer,\n StyledNodeInteraction\n} from '@pega/cosmos-react-core/lib/components/Tree/StandardTree.styles';\n\nexport const StyledCaseHierarchyTree: typeof StandardTree = styled(StandardTree)(\n ({ theme }) => css`\n display: table;\n width: 100%;\n\n ${StyledLabelContainer} ${StyledButton} {\n align-self: flex-start;\n margin-block-start: calc(${theme.base.spacing} / 4);\n }\n\n [aria-current='true'],\n [aria-current='page'] {\n font-weight: ${theme.base['font-weight']['semi-bold']};\n }\n `\n);\n\nStyledCaseHierarchyTree.defaultProps = defaultThemeProp;\n\nexport const StyledOverflowContainer = styled(CardContent)(\n ({ theme }) => css`\n overflow: auto;\n max-height: inherit;\n\n ${StyledNodeInteraction} {\n border-top-right-radius: calc(\n var(--first-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-top-left-radius: calc(\n var(--first-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-bottom-left-radius: calc(\n var(--last-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n border-bottom-right-radius: calc(\n var(--last-visible) * var(--border-radius, ${theme.base['border-radius']})\n );\n }\n `\n);\n\nStyledOverflowContainer.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHierarchyHeader = styled(StyledSummaryListHeader)(({ theme }) => {\n return css`\n padding-block-end: calc(${theme.base.spacing} / 2);\n\n ${StyledFlex} {\n min-height: ${theme.base['hit-area']['mouse-min']};\n\n @media (pointer: coarse) {\n min-height: ${theme.base['hit-area']['finger-min']};\n }\n }\n `;\n});\n\nStyledCaseHierarchyHeader.defaultProps = defaultThemeProp;\n\nexport const StyledCaseHierarchy = styled(Card)`\n ${StyledDialog} & {\n max-height: calc(100dvh - 5rem);\n }\n`;\n\nStyledCaseHierarchy.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getCaseHierarchyTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "icon", "count"]>;
|
|
1
|
+
export declare const getCaseHierarchyTestIds: (testIdProp?: import("@pega/cosmos-react-core").TestIdProp["testId"]) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["heading", "icon", "count", "search"]>;
|
|
2
2
|
//# sourceMappingURL=CaseHierarchy.test-ids.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"CaseHierarchy.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,2KAKzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.test-ids.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,EAAE;IACrE,SAAS;IACT,MAAM;IACN,OAAO;
|
|
1
|
+
{"version":3,"file":"CaseHierarchy.test-ids.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,gBAAgB,EAAE;IACrE,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;CACA,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getCaseHierarchyTestIds = createTestIds('case-hierarchy', [\n 'heading',\n 'icon',\n 'count',\n 'search'\n] as const);\n"]}
|
|
@@ -4,7 +4,8 @@ export interface CaseHierarchyNode extends OmitStrict<StandardTreeNode, 'nodes'>
|
|
|
4
4
|
nodes?: CaseHierarchyNode[];
|
|
5
5
|
caseTypeId?: string;
|
|
6
6
|
}
|
|
7
|
-
export interface CaseHierarchyProps extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref'>, TestIdProp {
|
|
7
|
+
export interface CaseHierarchyProps extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref' | 'nodes'>, TestIdProp {
|
|
8
|
+
nodes: CaseHierarchyNode[];
|
|
8
9
|
/** Heading shown on the Card wrapping the component. */
|
|
9
10
|
heading: string;
|
|
10
11
|
/** The icon rendered as part of the header. If not set will default to 'folder-nested'. */
|
|
@@ -17,6 +18,11 @@ export interface CaseHierarchyProps extends OmitStrict<StandardTreeProps, 'curre
|
|
|
17
18
|
error?: boolean;
|
|
18
19
|
/** Will render the provided number in a count badge next to the heading. */
|
|
19
20
|
count?: number;
|
|
21
|
+
/** If set, will render a search input above the tree to search nodes. */
|
|
22
|
+
search?: {
|
|
23
|
+
value: string;
|
|
24
|
+
handler: (value: string) => void;
|
|
25
|
+
};
|
|
20
26
|
/** A ref to the wrapping element. */
|
|
21
27
|
ref?: Ref<HTMLDivElement>;
|
|
22
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,iBAAkB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC9E,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBACf,SAAQ,UAAU,CAAC,iBAAiB,EAAE,eAAe,GAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"CaseHierarchy.types.d.ts","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,UAAU,EACV,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAEjC,MAAM,WAAW,iBAAkB,SAAQ,UAAU,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAC9E,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,kBACf,SAAQ,UAAU,CAAC,iBAAiB,EAAE,eAAe,GAAG,KAAK,GAAG,OAAO,CAAC,EACtE,UAAU;IACZ,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,2FAA2F;IAC3F,IAAI,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;IACzB,mEAAmE;IACnE,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC/B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4EAA4E;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IAC7D,qCAAqC;IACrC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHierarchy.types.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type {\n IconProps,\n OmitStrict,\n StandardTreeNode,\n StandardTreeProps,\n TestIdProp,\n TreeNode\n} from '@pega/cosmos-react-core';\n\nexport interface CaseHierarchyNode extends OmitStrict<StandardTreeNode, 'nodes'> {\n nodes?: CaseHierarchyNode[];\n caseTypeId?: string;\n}\n\nexport interface CaseHierarchyProps\n extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref'>,\n TestIdProp {\n /** Heading shown on the Card wrapping the component. */\n heading: string;\n /** The icon rendered as part of the header. If not set will default to 'folder-nested'. */\n icon?: IconProps['name'];\n /** The currently selected case, will be highlighted by default. */\n currentCaseId?: TreeNode['id'];\n /** If set, a progress indicator will render in place of the component. */\n loading?: boolean;\n /** If set, an error state will render in place of the component. */\n error?: boolean;\n /** Will render the provided number in a count badge next to the heading. */\n count?: number;\n /** A ref to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CaseHierarchy.types.js","sourceRoot":"","sources":["../../../src/components/CaseHierarchy/CaseHierarchy.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\n\nimport type {\n IconProps,\n OmitStrict,\n StandardTreeNode,\n StandardTreeProps,\n TestIdProp,\n TreeNode\n} from '@pega/cosmos-react-core';\n\nexport interface CaseHierarchyNode extends OmitStrict<StandardTreeNode, 'nodes'> {\n nodes?: CaseHierarchyNode[];\n caseTypeId?: string;\n}\n\nexport interface CaseHierarchyProps\n extends OmitStrict<StandardTreeProps, 'currentNodeId' | 'ref' | 'nodes'>,\n TestIdProp {\n nodes: CaseHierarchyNode[];\n /** Heading shown on the Card wrapping the component. */\n heading: string;\n /** The icon rendered as part of the header. If not set will default to 'folder-nested'. */\n icon?: IconProps['name'];\n /** The currently selected case, will be highlighted by default. */\n currentCaseId?: TreeNode['id'];\n /** If set, a progress indicator will render in place of the component. */\n loading?: boolean;\n /** If set, an error state will render in place of the component. */\n error?: boolean;\n /** Will render the provided number in a count badge next to the heading. */\n count?: number;\n /** If set, will render a search input above the tree to search nodes. */\n search?: { value: string; handler: (value: string) => void };\n /** A ref to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
|
|
@@ -2,7 +2,7 @@ import type { Ref } from 'react';
|
|
|
2
2
|
import type { ForwardRefForwardPropsComponent, BaseProps, TestIdProp, NoChildrenProp, ErrorStateProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import type { CaseViewProps } from '../CaseView';
|
|
4
4
|
import type { CaseViewContextValue } from '../CaseView/CaseView.types';
|
|
5
|
-
export interface CasePreviewProps extends Pick<CaseViewProps, 'caseId' | 'caseType' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summaryFields' | 'tabs' | 'tabContent' | 'stages' | 'tasks' | 'banners' | 'utilities' | 'utilitiesSummaryItems'>, NoChildrenProp, TestIdProp, BaseProps {
|
|
5
|
+
export interface CasePreviewProps extends Pick<CaseViewProps, 'caseId' | 'caseType' | 'heading' | 'subheading' | 'parentCases' | 'icon' | 'color' | 'followed' | 'onFollowedChange' | 'actions' | 'promotedActions' | 'onEdit' | 'summaryFields' | 'tabs' | 'tabContent' | 'stages' | 'tasks' | 'banners' | 'utilities' | 'utilitiesSummaryItems'>, NoChildrenProp, TestIdProp, BaseProps {
|
|
6
6
|
/** A set of props including an href that will be forwarded to the case preview's heading and subheading. */
|
|
7
7
|
caseLink?: CaseViewContextValue['caseLink'];
|
|
8
8
|
/** If true, the Case Preview will be visible. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAelD,OAAO,KAAK,EACV,+BAA+B,EAC/B,SAAS,EACT,UAAU,EACV,cAAc,EACd,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAQvE,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,eAAe,GACf,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,uBAAuB,CAC1B,EACD,cAAc,EACd,UAAU,EACV,SAAS;IACX,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC5C,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAC1C,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;;;;
|
|
1
|
+
{"version":3,"file":"CasePreview.d.ts","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAelD,OAAO,KAAK,EACV,+BAA+B,EAC/B,SAAS,EACT,UAAU,EACV,cAAc,EACd,eAAe,EAEhB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAQvE,MAAM,WAAW,gBACf,SAAQ,IAAI,CACR,aAAa,EACX,QAAQ,GACR,UAAU,GACV,SAAS,GACT,YAAY,GACZ,aAAa,GACb,MAAM,GACN,OAAO,GACP,UAAU,GACV,kBAAkB,GAClB,SAAS,GACT,iBAAiB,GACjB,QAAQ,GACR,eAAe,GACf,MAAM,GACN,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,uBAAuB,CAC1B,EACD,cAAc,EACd,UAAU,EACV,SAAS;IACX,4GAA4G;IAC5G,QAAQ,CAAC,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAC5C,iDAAiD;IACjD,IAAI,EAAE,OAAO,CAAC;IACd,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2EAA2E;IAC3E,YAAY,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAC1C,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,yCAAyC;IACzC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;;;;AA6OD,wBAA+D"}
|
|
@@ -48,15 +48,15 @@ const StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {
|
|
|
48
48
|
`;
|
|
49
49
|
});
|
|
50
50
|
StyledCasePreviewDrawer.defaultProps = defaultThemeProp;
|
|
51
|
-
const CasePreviewContent = ({ error, onErrorRetry, caseId, caseType, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit }) => {
|
|
51
|
+
const CasePreviewContent = ({ error, onErrorRetry, caseId, caseType, heading, subheading, caseLink, parentCases, icon, color, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit }) => {
|
|
52
52
|
const t = useI18n();
|
|
53
53
|
if (error) {
|
|
54
54
|
return _jsx(ErrorState, { message: t('preview_error'), onRetry: onErrorRetry });
|
|
55
55
|
}
|
|
56
|
-
return (_jsx(CaseView, { caseId: caseId, caseType: caseType, parentCases: parentCases, heading: heading, subheading: subheading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, summaryFields: summaryFields, tabs: tabs, stages: stages, tasks: tasks, tabContent: tabContent, utilities: utilities, utilitiesSummaryItems: utilitiesSummaryItems, actions: actions, banners: banners, onEdit: onEdit, isPreview: true }));
|
|
56
|
+
return (_jsx(CaseView, { caseId: caseId, caseType: caseType, parentCases: parentCases, heading: heading, subheading: subheading, caseLink: caseLink, icon: icon, color: color, followed: followed, onFollowedChange: onFollowedChange, summaryFields: summaryFields, tabs: tabs, stages: stages, tasks: tasks, tabContent: tabContent, utilities: utilities, utilitiesSummaryItems: utilitiesSummaryItems, actions: actions, banners: banners, onEdit: onEdit, isPreview: true }));
|
|
57
57
|
};
|
|
58
58
|
const CasePreview = forwardRef(function CasePreview(props, ref) {
|
|
59
|
-
const { testId, open: openProp, progress, error, onErrorRetry, caseId, caseType, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, onBeforeOpen, onAfterOpen, onBeforeClose, onAfterClose, ...restProps } = props;
|
|
59
|
+
const { testId, open: openProp, progress, error, onErrorRetry, caseId, caseType, heading, subheading, caseLink, parentCases, icon, color, followed, onFollowedChange, summaryFields, tabs, stages, tasks, tabContent, utilities, utilitiesSummaryItems, actions, banners, onEdit, onBeforeOpen, onAfterOpen, onBeforeClose, onAfterClose, ...restProps } = props;
|
|
60
60
|
const testIds = useTestIds(testId, getCasePreviewTestIds);
|
|
61
61
|
const { createPreview } = usePreviewManager();
|
|
62
62
|
const previewMethodsRef = useRef(undefined);
|
|
@@ -78,6 +78,7 @@ const CasePreview = forwardRef(function CasePreview(props, ref) {
|
|
|
78
78
|
caseLink,
|
|
79
79
|
parentCases,
|
|
80
80
|
icon,
|
|
81
|
+
color,
|
|
81
82
|
followed,
|
|
82
83
|
onFollowedChange,
|
|
83
84
|
summaryFields,
|
|
@@ -94,7 +95,7 @@ const CasePreview = forwardRef(function CasePreview(props, ref) {
|
|
|
94
95
|
const metadata = {
|
|
95
96
|
previewProps: {
|
|
96
97
|
testId: testIds.root,
|
|
97
|
-
previewLabel: heading,
|
|
98
|
+
previewLabel: typeof heading === 'string' ? heading : heading?.text,
|
|
98
99
|
onBeforeOpen,
|
|
99
100
|
onAfterOpen,
|
|
100
101
|
onBeforeClose,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AASjC,OAAO,KAAK,SAAS,MAAM,8DAA8D,CAAC;AAE1F,OAAO,QAAQ,EAAE,EAAE,cAAc,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAGnG,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAEnG,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAA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EAAE,QAAQ,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YACjB,+DAA+D;YAC/D,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;QACxC,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,cAAc,CAAC,CAAC,CAAC;IAE7F,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef, useEffect, useState, useRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n registerIcon,\n defaultThemeProp,\n useBreakpoint,\n useI18n,\n useTestIds,\n withTestIds,\n ErrorState,\n useConsolidatedRef,\n StyledPreviewDrawer,\n usePreviewManager\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n ErrorStateProps,\n PreviewMethods\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, { StyledCaseView, StyledCaseViewContent, StyledSummaryRegion } from '../CaseView';\nimport type { CaseViewProps } from '../CaseView';\nimport type { CaseViewContextValue } from '../CaseView/CaseView.types';\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\nimport { StyledSummaryPrimaryList, StyledSummarySecondaryList } from '../CaseView/CaseView.styles';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n >,\n NoChildrenProp,\n TestIdProp,\n BaseProps {\n /** A set of props including an href that will be forwarded to the case preview's heading and subheading. */\n caseLink?: CaseViewContextValue['caseLink'];\n /** If true, the Case Preview will be visible. */\n open: boolean;\n /** If true, the Case Preview will render in a progress state. */\n progress?: boolean;\n /** If true, the Case Preview will render in an error state. */\n error?: boolean;\n /** Callback fired when \"Try again\" button is clicked in an error state. */\n onErrorRetry?: ErrorStateProps['onRetry'];\n /** Callback fired before Case Preview opens. */\n onBeforeOpen?: () => void;\n /** Callback fired after Case Preview opens. */\n onAfterOpen?: () => void;\n /** Callback fired before Case Preview closes. */\n onBeforeClose?: () => void;\n /** Callback fired after Case Preview closes. */\n onAfterClose?: () => void;\n /** Callback fired when a click action occurs outside of the Case Preview. */\n onOuterClick?: () => void;\n /** Reference to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {\n return css`\n ${StyledSummaryPrimaryList} {\n padding: unset;\n }\n\n ${StyledSummarySecondaryList} {\n padding-block-start: unset;\n padding-inline: unset;\n }\n\n ${StyledCaseView} {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});\n z-index: 1;\n\n @media (pointer: coarse) {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});\n }\n\n ${StyledSummaryRegion} {\n position: relative;\n top: 0;\n }\n }\n\n ${StyledCaseViewContent} {\n overflow-y: auto;\n\n & > :last-child {\n padding-bottom: calc(2 * ${theme.base.spacing});\n }\n }\n\n ${StyledGenAICoachContainer} {\n width: unset;\n min-width: unset;\n }\n `;\n});\n\nStyledCasePreviewDrawer.defaultProps = defaultThemeProp;\n\ntype CasePreviewContentProps = Pick<\n CasePreviewProps,\n | 'error'\n | 'onErrorRetry'\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'followed'\n | 'onFollowedChange'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n | 'actions'\n | 'onEdit'\n>;\n\nconst CasePreviewContent = ({\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit\n}: CasePreviewContentProps) => {\n const t = useI18n();\n\n if (error) {\n return <ErrorState message={t('preview_error')} onRetry={onErrorRetry} />;\n }\n\n return (\n <CaseView\n caseId={caseId}\n caseType={caseType}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n followed={followed}\n onFollowedChange={onFollowedChange}\n summaryFields={summaryFields}\n tabs={tabs}\n stages={stages}\n tasks={tasks}\n tabContent={tabContent}\n utilities={utilities}\n utilitiesSummaryItems={utilitiesSummaryItems}\n actions={actions}\n banners={banners}\n onEdit={onEdit}\n isPreview\n />\n );\n};\n\nconst CasePreview: ForwardRefForwardPropsComponent<CasePreviewProps> = forwardRef(\n function CasePreview(props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) {\n const {\n testId,\n open: openProp,\n progress,\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const { createPreview } = usePreviewManager();\n const previewMethodsRef = useRef<PreviewMethods | undefined>(undefined);\n const previewRef = useConsolidatedRef(ref);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const [open, setOpen] = useState(openProp);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (open && isSmallOrAbove) {\n const contentProps = {\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit\n };\n\n const metadata = {\n previewProps: {\n testId: testIds.root,\n previewLabel: heading,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose: () => {\n onAfterClose?.();\n setOpen(false);\n if (previewMethodsRef.current) {\n previewMethodsRef.current.unmountPreview();\n previewMethodsRef.current = undefined;\n }\n },\n as: StyledCasePreviewDrawer,\n ref: previewRef,\n progress,\n ...restProps\n }\n };\n if (previewMethodsRef.current) {\n previewMethodsRef.current.updatePreview(contentProps, metadata);\n } else {\n previewMethodsRef.current = createPreview(CasePreviewContent, contentProps, metadata);\n }\n } else if (!open) {\n // This branch is needed for controlled component via open prop\n previewMethodsRef.current = undefined;\n }\n }, [open, progress, error, tabs, banners, utilities, utilitiesSummaryItems, isSmallOrAbove]);\n\n return null;\n }\n);\n\nexport default withTestIds(CasePreview, getCasePreviewTestIds);\n"]}
|
|
1
|
+
{"version":3,"file":"CasePreview.js","sourceRoot":"","sources":["../../../src/components/CasePreview/CasePreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEhE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU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AO,CAAC,KAAK,CAAC,CAAC;wBACf,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;4BAC9B,iBAAiB,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;4BAC3C,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;wBACxC,CAAC;oBACH,CAAC;oBACD,EAAE,EAAE,uBAAuB;oBAC3B,GAAG,EAAE,UAAU;oBACf,QAAQ;oBACR,GAAG,SAAS;iBACb;aACF,CAAC;YACF,IAAI,iBAAiB,CAAC,OAAO,EAAE,CAAC;gBAC9B,iBAAiB,CAAC,OAAO,CAAC,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;YAClE,CAAC;iBAAM,CAAC;gBACN,iBAAiB,CAAC,OAAO,GAAG,aAAa,CAAC,kBAAkB,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;YACxF,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YACjB,+DAA+D;YAC/D,iBAAiB,CAAC,OAAO,GAAG,SAAS,CAAC;QACxC,CAAC;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,cAAc,CAAC,CAAC,CAAC;IAE7F,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,WAAW,EAAE,qBAAqB,CAAC,CAAC","sourcesContent":["import { forwardRef, useEffect, useState, useRef } from 'react';\nimport type { PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n registerIcon,\n defaultThemeProp,\n useBreakpoint,\n useI18n,\n useTestIds,\n withTestIds,\n ErrorState,\n useConsolidatedRef,\n StyledPreviewDrawer,\n usePreviewManager\n} from '@pega/cosmos-react-core';\nimport type {\n ForwardRefForwardPropsComponent,\n BaseProps,\n TestIdProp,\n NoChildrenProp,\n ErrorStateProps,\n PreviewMethods\n} from '@pega/cosmos-react-core';\nimport * as timesIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/times.icon';\n\nimport CaseView, { StyledCaseView, StyledCaseViewContent, StyledSummaryRegion } from '../CaseView';\nimport type { CaseViewProps } from '../CaseView';\nimport type { CaseViewContextValue } from '../CaseView/CaseView.types';\nimport { StyledGenAICoachContainer } from '../GenAICoach/GenAICoach.styles';\nimport { StyledSummaryPrimaryList, StyledSummarySecondaryList } from '../CaseView/CaseView.styles';\n\nimport { getCasePreviewTestIds } from './CasePreview.test-ids';\n\nregisterIcon(timesIcon);\n\nexport interface CasePreviewProps\n extends Pick<\n CaseViewProps,\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'parentCases'\n | 'icon'\n | 'color'\n | 'followed'\n | 'onFollowedChange'\n | 'actions'\n | 'promotedActions'\n | 'onEdit'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n >,\n NoChildrenProp,\n TestIdProp,\n BaseProps {\n /** A set of props including an href that will be forwarded to the case preview's heading and subheading. */\n caseLink?: CaseViewContextValue['caseLink'];\n /** If true, the Case Preview will be visible. */\n open: boolean;\n /** If true, the Case Preview will render in a progress state. */\n progress?: boolean;\n /** If true, the Case Preview will render in an error state. */\n error?: boolean;\n /** Callback fired when \"Try again\" button is clicked in an error state. */\n onErrorRetry?: ErrorStateProps['onRetry'];\n /** Callback fired before Case Preview opens. */\n onBeforeOpen?: () => void;\n /** Callback fired after Case Preview opens. */\n onAfterOpen?: () => void;\n /** Callback fired before Case Preview closes. */\n onBeforeClose?: () => void;\n /** Callback fired after Case Preview closes. */\n onAfterClose?: () => void;\n /** Callback fired when a click action occurs outside of the Case Preview. */\n onOuterClick?: () => void;\n /** Reference to the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst StyledCasePreviewDrawer = styled(StyledPreviewDrawer)(({ theme }) => {\n return css`\n ${StyledSummaryPrimaryList} {\n padding: unset;\n }\n\n ${StyledSummarySecondaryList} {\n padding-block-start: unset;\n padding-inline: unset;\n }\n\n ${StyledCaseView} {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['mouse-min']});\n z-index: 1;\n\n @media (pointer: coarse) {\n height: calc(100vh - ${theme.base.spacing} - ${theme.base['hit-area']['finger-min']});\n }\n\n ${StyledSummaryRegion} {\n position: relative;\n top: 0;\n }\n }\n\n ${StyledCaseViewContent} {\n overflow-y: auto;\n\n & > :last-child {\n padding-bottom: calc(2 * ${theme.base.spacing});\n }\n }\n\n ${StyledGenAICoachContainer} {\n width: unset;\n min-width: unset;\n }\n `;\n});\n\nStyledCasePreviewDrawer.defaultProps = defaultThemeProp;\n\ntype CasePreviewContentProps = Pick<\n CasePreviewProps,\n | 'error'\n | 'onErrorRetry'\n | 'caseId'\n | 'caseType'\n | 'heading'\n | 'subheading'\n | 'caseLink'\n | 'parentCases'\n | 'icon'\n | 'color'\n | 'followed'\n | 'onFollowedChange'\n | 'summaryFields'\n | 'tabs'\n | 'tabContent'\n | 'stages'\n | 'tasks'\n | 'banners'\n | 'utilities'\n | 'utilitiesSummaryItems'\n | 'actions'\n | 'onEdit'\n>;\n\nconst CasePreviewContent = ({\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit\n}: CasePreviewContentProps) => {\n const t = useI18n();\n\n if (error) {\n return <ErrorState message={t('preview_error')} onRetry={onErrorRetry} />;\n }\n\n return (\n <CaseView\n caseId={caseId}\n caseType={caseType}\n parentCases={parentCases}\n heading={heading}\n subheading={subheading}\n caseLink={caseLink}\n icon={icon}\n color={color}\n followed={followed}\n onFollowedChange={onFollowedChange}\n summaryFields={summaryFields}\n tabs={tabs}\n stages={stages}\n tasks={tasks}\n tabContent={tabContent}\n utilities={utilities}\n utilitiesSummaryItems={utilitiesSummaryItems}\n actions={actions}\n banners={banners}\n onEdit={onEdit}\n isPreview\n />\n );\n};\n\nconst CasePreview: ForwardRefForwardPropsComponent<CasePreviewProps> = forwardRef(\n function CasePreview(props: PropsWithoutRef<CasePreviewProps>, ref: CasePreviewProps['ref']) {\n const {\n testId,\n open: openProp,\n progress,\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose,\n ...restProps\n } = props;\n const testIds = useTestIds(testId, getCasePreviewTestIds);\n\n const { createPreview } = usePreviewManager();\n const previewMethodsRef = useRef<PreviewMethods | undefined>(undefined);\n const previewRef = useConsolidatedRef(ref);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const [open, setOpen] = useState(openProp);\n\n useEffect(() => {\n setOpen(openProp);\n }, [openProp]);\n\n useEffect(() => {\n if (open && isSmallOrAbove) {\n const contentProps = {\n error,\n onErrorRetry,\n caseId,\n caseType,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n color,\n followed,\n onFollowedChange,\n summaryFields,\n tabs,\n stages,\n tasks,\n tabContent,\n utilities,\n utilitiesSummaryItems,\n actions,\n banners,\n onEdit\n };\n\n const metadata = {\n previewProps: {\n testId: testIds.root,\n previewLabel: typeof heading === 'string' ? heading : heading?.text,\n onBeforeOpen,\n onAfterOpen,\n onBeforeClose,\n onAfterClose: () => {\n onAfterClose?.();\n setOpen(false);\n if (previewMethodsRef.current) {\n previewMethodsRef.current.unmountPreview();\n previewMethodsRef.current = undefined;\n }\n },\n as: StyledCasePreviewDrawer,\n ref: previewRef,\n progress,\n ...restProps\n }\n };\n if (previewMethodsRef.current) {\n previewMethodsRef.current.updatePreview(contentProps, metadata);\n } else {\n previewMethodsRef.current = createPreview(CasePreviewContent, contentProps, metadata);\n }\n } else if (!open) {\n // This branch is needed for controlled component via open prop\n previewMethodsRef.current = undefined;\n }\n }, [open, progress, error, tabs, banners, utilities, utilitiesSummaryItems, isSmallOrAbove]);\n\n return null;\n }\n);\n\nexport default withTestIds(CasePreview, getCasePreviewTestIds);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAc,MAAM,OAAO,CAAC;AA6C5C,QAAA,MAAM,UAAU,EAAE,EAmZjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { parseToHsl } from 'polished';
|
|
4
|
-
import { Breadcrumbs, Flex, getEdge, Icon, registerIcon, Text, Link, Button, throttle, useDirection, useI18n, useAfterInitialEffect, useTheme, tryCatch, Actions, StyledIconShape, useToaster, readableColor } from '@pega/cosmos-react-core';
|
|
4
|
+
import { Breadcrumbs, Flex, getEdge, Icon, registerIcon, Text, Link, Button, throttle, useDirection, useI18n, useAfterInitialEffect, useTheme, tryCatch, Actions, StyledIconShape, useToaster, readableColor, InlineEdit } from '@pega/cosmos-react-core';
|
|
5
5
|
import * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';
|
|
6
6
|
import * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';
|
|
7
7
|
import { StyledCaseHeader, StyledCaseHeaderText, StyledExpandCollapseSummaryButton, StyledSubheading, StyledHeaderActions, StyledCaseHeaderPromotedAction, StyledCaseViewImage, StyledCaseViewIcon, resolveCaseTypeColor } from '../CaseView.styles';
|
|
@@ -35,7 +35,10 @@ const CaseHeader = () => {
|
|
|
35
35
|
const caseTypeIconColor = color && theme.base['case-type-colors'] !== 'ignored'
|
|
36
36
|
? resolveCaseTypeColor(theme, color)
|
|
37
37
|
: iconBackground;
|
|
38
|
-
iconForeground = readableColor(caseTypeIconColor
|
|
38
|
+
iconForeground = readableColor(caseTypeIconColor ?? iconBackground, {
|
|
39
|
+
mode: 'light',
|
|
40
|
+
level: 'AANonText'
|
|
41
|
+
});
|
|
39
42
|
}
|
|
40
43
|
const [hasBrokenImage, setHasBrokenImage] = useState();
|
|
41
44
|
const showIcon = !!icon && !hasBrokenImage;
|
|
@@ -142,6 +145,8 @@ const CaseHeader = () => {
|
|
|
142
145
|
useEffect(() => {
|
|
143
146
|
setHasBrokenImage(undefined);
|
|
144
147
|
}, [typeof icon === 'string' ? icon : icon?.href]);
|
|
148
|
+
const headingText = typeof heading !== 'string' ? heading.text : heading;
|
|
149
|
+
const subheadingText = subheading && typeof subheading !== 'string' ? subheading.text : subheading;
|
|
145
150
|
return (_jsxs(Flex, { "data-testid": testIds.header, as: StyledCaseHeader, container: { direction: 'column', gap: 1 }, children: [_jsxs(Flex, { container: true, ref: contentsEl, children: [showExpandCollapse && onToggleSummary && !persistentUtility && (_jsx(StyledExpandCollapseSummaryButton, { ref: toggleButtonRef, onClick: onToggleSummary, label: t(summaryExpanded ? 'collapse' : 'expand'), "aria-label": t(summaryExpanded ? 'collapse_summary' : 'expand_summary'), icon: true, compact: true, children: _jsx(Icon, { name: summaryExpanded ? `arrow-micro-${start}` : 'arrow-micro-down' }) })), showIcon && (_jsx(Flex, { container: { pad: [1, 0, 0] }, item: { shrink: 0 }, children: (() => {
|
|
146
151
|
if (typeof icon === 'string') {
|
|
147
152
|
return (_jsx(StyledCaseViewIcon, { "data-testid": testIds.icon, "aria-label": t('case_type_icon', [caseType ?? t('case_type')]), name: icon, foreground: iconForeground, background: iconBackground }));
|
|
@@ -158,7 +163,22 @@ const CaseHeader = () => {
|
|
|
158
163
|
justify: 'center'
|
|
159
164
|
}, item: aboveSM
|
|
160
165
|
? { shrink: wrapPromotedActions || !hasPromotedActions ? 1 : 0 }
|
|
161
|
-
: { shrink: 1, grow: 1 }, ref: headerGroupEl, children: [
|
|
166
|
+
: { shrink: 1, grow: 1 }, ref: headerGroupEl, children: [(() => {
|
|
167
|
+
const headingContent = caseLink ? (_jsx(Link, { ...caseLink, children: headingText })) : (headingText);
|
|
168
|
+
const textEl = (_jsx(Text, { "data-testid": testIds.heading, variant: 'h1', children: headingContent }));
|
|
169
|
+
if (typeof heading !== 'string') {
|
|
170
|
+
return (_jsx(InlineEdit, { contextualLabel: headingText, ...heading.inlineEdit, children: textEl }));
|
|
171
|
+
}
|
|
172
|
+
return textEl;
|
|
173
|
+
})(), subheading &&
|
|
174
|
+
(!parentCases || subheadingText !== caseId) &&
|
|
175
|
+
(() => {
|
|
176
|
+
const subheadEl = (_jsx(StyledSubheading, { "data-testid": testIds.subheading, children: subheadingText }));
|
|
177
|
+
if (typeof subheading !== 'string') {
|
|
178
|
+
return (_jsx(InlineEdit, { contextualLabel: subheading.text, ...subheading.inlineEdit, children: subheadEl }));
|
|
179
|
+
}
|
|
180
|
+
return subheadEl;
|
|
181
|
+
})(), parentCases && (_jsx(Breadcrumbs, { forwardedAs: 'p', path: [
|
|
162
182
|
...parentCases,
|
|
163
183
|
{
|
|
164
184
|
...caseLink,
|
|
@@ -169,7 +189,7 @@ const CaseHeader = () => {
|
|
|
169
189
|
], leafOnly: true }))] }), collapsedMainHeader && !wrapPromotedActions && (_jsx(Summary, { siblingRef: actionsContainerEl }, summaryResetID)), _jsxs(Flex, { as: StyledHeaderActions, item: { shrink: 0 }, container: { alignItems: 'start', pad: [0, 0, 0, 2] }, offsetEnd: !summaryExpanded, ref: actionsContainerEl, children: [collapsedMainHeader &&
|
|
170
190
|
!wrapPromotedActions &&
|
|
171
191
|
promotedActions &&
|
|
172
|
-
promotedActions.length > 0 ? (_jsx(_Fragment, { children: promotedActions.map(promotedAction => (_jsx(StyledCaseHeaderPromotedAction, { variant: 'secondary', onClick: (e) => promotedAction.onClick?.(promotedAction.id, e), children: promotedAction.text }, promotedAction.id))) })) : null, onEdit && (_jsx(Button, { "data-testid": testIds.edit, icon: true, variant: 'simple', onClick: onEdit, label: t('edit'), "aria-label": `${t('edit')} - ${
|
|
192
|
+
promotedActions.length > 0 ? (_jsx(_Fragment, { children: promotedActions.map(promotedAction => (_jsx(StyledCaseHeaderPromotedAction, { variant: 'secondary', onClick: (e) => promotedAction.onClick?.(promotedAction.id, e), children: promotedAction.text }, promotedAction.id))) })) : null, onEdit && (_jsx(Button, { "data-testid": testIds.edit, icon: true, variant: 'simple', onClick: onEdit, label: t('edit'), "aria-label": `${t('edit')} - ${headingText}`, children: _jsx(Icon, { name: 'pencil' }) })), (actionsLoading || caseActions.length > 0) && (_jsx(Actions, { contextualLabel: typeof heading === 'string' ? heading : heading.text, "data-testid": testIds.actions, iconOnly: true, progress: actionsLoading, items: caseActions, menuAt: actionsLoading ? 0 : 1, filterAt: 5, scrollAt: Infinity }))] })] }), (!collapsedMainHeader || wrapPromotedActions || !aboveSM) &&
|
|
173
193
|
promotedActions &&
|
|
174
194
|
promotedActions.length > 0 ? (_jsx(Flex, { "data-testid": testIds.promotedActions, container: { justify: 'start', wrap: 'wrap', gap: 1, pad: [0, 0, 0.5] }, children: promotedActions.map(({ id, text, onClick }) => (_jsx("div", { children: _jsx(StyledCaseHeaderPromotedAction, { variant: 'secondary', onClick: (e) => onClick?.(id, e), children: text }) }, text))) })) : null, collaboration] }));
|
|
175
195
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHeader.js","s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CAAC,CAAC,CAC3B,KAAC,IAAI,mBACU,OAAO,CAAC,eAAe,EACpC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,YAEtE,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC9C,wBACE,KAAC,8BAA8B,IAC7B,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,YAE9D,IAAI,GAC0B,IANzB,IAAI,CAOR,CACP,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,EAEP,aAAa,IACT,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { FC, MouseEvent } from 'react';\nimport { parseToHsl } from 'polished';\n\nimport {\n Breadcrumbs,\n Flex,\n getEdge,\n Icon,\n registerIcon,\n Text,\n Link,\n Button,\n throttle,\n useDirection,\n useI18n,\n useAfterInitialEffect,\n useTheme,\n tryCatch,\n Actions,\n StyledIconShape,\n useToaster,\n readableColor\n} from '@pega/cosmos-react-core';\nimport type { Action } from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledCaseHeader,\n StyledCaseHeaderText,\n StyledExpandCollapseSummaryButton,\n StyledSubheading,\n StyledHeaderActions,\n StyledCaseHeaderPromotedAction,\n StyledCaseViewImage,\n StyledCaseViewIcon,\n resolveCaseTypeColor\n} from '../CaseView.styles';\nimport { useCaseViewContext } from '../CaseView.context';\n\nimport Summary from './Summary';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n const { ltr, start } = useDirection();\n const theme = useTheme();\n\n const {\n testIds,\n caseId,\n icon,\n color,\n heading,\n subheading,\n caseType,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryExpanded,\n onToggleSummary,\n isPreview,\n aboveSM,\n aboveMD,\n persistentUtility,\n collaboration\n } = useCaseViewContext();\n const { push } = useToaster();\n\n const [wrapPromotedActions, setWrapPromotedActions] = useState(false);\n const [summaryResetID, setSummaryResetID] = useState<number | undefined>(Math.random());\n\n const wrapActionsBreakpoint = useRef<number | null>(null);\n\n const hasPromotedActions = (promotedActions?.length ?? 0) > 0;\n\n let iconForeground =\n theme.components['case-view'].icon.color !== 'auto'\n ? theme.components['case-view'].icon.color\n : theme.components['case-view'].header['foreground-color'];\n\n const iconBackground = useMemo(() => {\n if (theme.components['case-view'].icon.background !== 'auto') {\n return theme.components['case-view'].icon.background;\n }\n return tryCatch(\n () => {\n const { lightness } = parseToHsl(theme.components['case-view'].header['background-color']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n },\n () => 'transparent'\n );\n }, [theme]);\n\n // Fall back to readable color if theme icon color and header foreground color are both 'auto'\n if (iconForeground === 'auto') {\n const caseTypeIconColor =\n color && theme.base['case-type-colors'] !== 'ignored'\n ? resolveCaseTypeColor(theme, color)\n : iconBackground;\n iconForeground = readableColor(caseTypeIconColor, { mode: 'light', level: 'AANonText' });\n }\n\n const [hasBrokenImage, setHasBrokenImage] = useState<undefined | boolean>();\n const showIcon = !!icon && !hasBrokenImage;\n\n const contentsEl = useRef<HTMLDivElement>(null);\n const headerGroupEl = useRef<HTMLElement>(null);\n const actionsContainerEl = useRef<HTMLDivElement>(null);\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n let actionsItems: Action[];\n let actionsLoading: boolean;\n\n if (Array.isArray(actions)) {\n actionsItems = actions;\n actionsLoading = false;\n } else if (actions) {\n actionsItems = actions.items ?? [];\n actionsLoading = !!actions.progress;\n } else {\n actionsItems = [];\n actionsLoading = false;\n }\n\n const caseActions: Action[] = actionsLoading\n ? []\n : [\n ...(onFollowedChange\n ? [\n {\n id: 'follow',\n text: followed ? t('unfollow') : t('follow'),\n onClick: () => {\n onFollowedChange(!followed);\n push({\n content: followed\n ? t('case_unfollowed', [caseId])\n : t('case_followed', [caseId])\n });\n }\n }\n ]\n : []),\n ...actionsItems.map(action => ({\n ...action,\n text: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n }))\n ];\n\n const showExpandCollapse = !isPreview && aboveMD;\n const collapsedMainHeader =\n (!isPreview && !aboveMD && aboveSM) || (showExpandCollapse && !summaryExpanded);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n // Actions wrapping\n useLayoutEffect(() => {\n if (\n !wrapPromotedActions &&\n contentsEl.current &&\n headerGroupEl.current &&\n actionsContainerEl.current\n ) {\n const contentStart = getEdge({\n el: contentsEl.current,\n side: 'leading',\n ltr\n });\n const headerGroupEnd = getEdge({\n el: headerGroupEl.current,\n side: 'trailing',\n ltr\n });\n const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;\n\n wrapActionsBreakpoint.current =\n Math.ceil(headerGroupEnd) - Math.ceil(contentStart) + Math.ceil(actionsContainerWidth);\n }\n\n const promotedActionsWrapHandler = () => {\n if (wrapActionsBreakpoint.current && contentsEl.current) {\n setWrapPromotedActions(\n Math.ceil(contentsEl.current.offsetWidth) < wrapActionsBreakpoint.current\n );\n }\n };\n\n const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));\n\n promotedActionsWrapHandler();\n\n if (contentsEl.current) {\n resizeObserver.observe(contentsEl.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [\n contentsEl,\n headerGroupEl,\n actionsContainerEl,\n promotedActions,\n heading,\n subheading,\n wrapPromotedActions\n ]);\n\n // Reset summary\n useEffect(() => {\n setSummaryResetID(Math.random());\n }, [heading, promotedActions]);\n\n useEffect(() => {\n setHasBrokenImage(undefined);\n }, [typeof icon === 'string' ? icon : icon?.href]);\n\n return (\n <Flex\n data-testid={testIds.header}\n as={StyledCaseHeader}\n container={{ direction: 'column', gap: 1 }}\n >\n <Flex container ref={contentsEl}>\n {showExpandCollapse && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseSummaryButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse' : 'expand')}\n aria-label={t(summaryExpanded ? 'collapse_summary' : 'expand_summary')}\n icon\n compact\n >\n <Icon name={summaryExpanded ? `arrow-micro-${start}` : 'arrow-micro-down'} />\n </StyledExpandCollapseSummaryButton>\n )}\n\n {showIcon && (\n <Flex container={{ pad: [1, 0, 0] }} item={{ shrink: 0 }}>\n {(() => {\n if (typeof icon === 'string') {\n return (\n <StyledCaseViewIcon\n data-testid={testIds.icon}\n aria-label={t('case_type_icon', [caseType ?? t('case_type')])}\n name={icon}\n foreground={iconForeground}\n background={iconBackground}\n />\n );\n }\n\n return (\n <StyledIconShape background={iconBackground} data-testid={testIds.icon}>\n <StyledCaseViewImage\n src={icon.href}\n alt={t('case_image')}\n onLoad={() => {\n setHasBrokenImage(false);\n }}\n onError={() => {\n setHasBrokenImage(true);\n }}\n />\n </StyledIconShape>\n );\n })()}\n </Flex>\n )}\n\n {/* header group */}\n <Flex\n as={StyledCaseHeaderText}\n container={{\n direction: 'column',\n pad: [0.5, 2, 0.5, showIcon ? 1 : undefined],\n alignItems: 'start',\n justify: 'center'\n }}\n item={\n aboveSM\n ? { shrink: wrapPromotedActions || !hasPromotedActions ? 1 : 0 }\n : { shrink: 1, grow: 1 }\n }\n ref={headerGroupEl}\n >\n <Text data-testid={testIds.heading} variant='h1'>\n {caseLink ? <Link {...caseLink}>{heading}</Link> : heading}\n </Text>\n\n {subheading && (!parentCases || subheading !== caseId) && (\n <StyledSubheading data-testid={testIds.subheading}>{subheading}</StyledSubheading>\n )}\n\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n {\n ...caseLink,\n id: caseId,\n primary: caseId,\n href: caseLink?.href\n }\n ]}\n leafOnly\n />\n )}\n </Flex>\n {/* summary */}\n {collapsedMainHeader && !wrapPromotedActions && (\n <Summary siblingRef={actionsContainerEl} key={summaryResetID} />\n )}\n {/* inline actions */}\n <Flex\n as={StyledHeaderActions}\n item={{ shrink: 0 }}\n container={{ alignItems: 'start', pad: [0, 0, 0, 2] }}\n offsetEnd={!summaryExpanded}\n ref={actionsContainerEl}\n >\n {collapsedMainHeader &&\n !wrapPromotedActions &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <>\n {promotedActions.map(promotedAction => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n promotedAction.onClick?.(promotedAction.id, e)\n }\n key={promotedAction.id}\n >\n {promotedAction.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n </>\n ) : null}\n\n {onEdit && (\n <Button\n data-testid={testIds.edit}\n icon\n variant='simple'\n onClick={onEdit}\n label={t('edit')}\n aria-label={`${t('edit')} - ${heading}`}\n >\n <Icon name='pencil' />\n </Button>\n )}\n\n {(actionsLoading || caseActions.length > 0) && (\n <Actions\n contextualLabel={heading}\n data-testid={testIds.actions}\n iconOnly\n progress={actionsLoading}\n items={caseActions}\n menuAt={actionsLoading ? 0 : 1}\n filterAt={5}\n scrollAt={Infinity}\n />\n )}\n </Flex>\n </Flex>\n\n {/* wrapped promoted actions */}\n {(!collapsedMainHeader || wrapPromotedActions || !aboveSM) &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <Flex\n data-testid={testIds.promotedActions}\n container={{ justify: 'start', wrap: 'wrap', gap: 1, pad: [0, 0, 0.5] }}\n >\n {promotedActions.map(({ id, text, onClick }) => (\n <div key={text}>\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick?.(id, e)}\n >\n {text}\n </StyledCaseHeaderPromotedAction>\n </div>\n ))}\n </Flex>\n ) : null}\n\n {collaboration}\n </Flex>\n );\n};\n\nexport default CaseHeader;\n"]}
|
|
1
|
+
{"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EACL,WAAW,EACX,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,qBAAqB,EACrB,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,UAAU,EACX,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAC5F,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AAExF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,iCAAiC,EACjC,gBAAgB,EAChB,mBAAmB,EACnB,8BAA8B,EAC9B,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,YAAY,CAAC,UAAU,EAAE,Q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,mBAAmB,IAAI,mBAAmB,IAAI,CAAC,OAAO,CAAC;gBAC1D,eAAe;gBACf,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC3B,KAAC,IAAI,mBACU,OAAO,CAAC,eAAe,EACpC,SAAS,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,YAEtE,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAC9C,wBACE,KAAC,8BAA8B,IAC7B,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,YAE9D,IAAI,GAC0B,IANzB,IAAI,CAOR,CACP,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,EAEP,aAAa,IACT,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport type { FC, MouseEvent } from 'react';\nimport { parseToHsl } from 'polished';\n\nimport {\n Breadcrumbs,\n Flex,\n getEdge,\n Icon,\n registerIcon,\n Text,\n Link,\n Button,\n throttle,\n useDirection,\n useI18n,\n useAfterInitialEffect,\n useTheme,\n tryCatch,\n Actions,\n StyledIconShape,\n useToaster,\n readableColor,\n InlineEdit\n} from '@pega/cosmos-react-core';\nimport type { Action } from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledCaseHeader,\n StyledCaseHeaderText,\n StyledExpandCollapseSummaryButton,\n StyledSubheading,\n StyledHeaderActions,\n StyledCaseHeaderPromotedAction,\n StyledCaseViewImage,\n StyledCaseViewIcon,\n resolveCaseTypeColor\n} from '../CaseView.styles';\nimport { useCaseViewContext } from '../CaseView.context';\n\nimport Summary from './Summary';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n const { ltr, start } = useDirection();\n const theme = useTheme();\n\n const {\n testIds,\n caseId,\n icon,\n color,\n heading,\n subheading,\n caseType,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryExpanded,\n onToggleSummary,\n isPreview,\n aboveSM,\n aboveMD,\n persistentUtility,\n collaboration\n } = useCaseViewContext();\n const { push } = useToaster();\n\n const [wrapPromotedActions, setWrapPromotedActions] = useState(false);\n const [summaryResetID, setSummaryResetID] = useState<number | undefined>(Math.random());\n\n const wrapActionsBreakpoint = useRef<number | null>(null);\n\n const hasPromotedActions = (promotedActions?.length ?? 0) > 0;\n\n let iconForeground =\n theme.components['case-view'].icon.color !== 'auto'\n ? theme.components['case-view'].icon.color\n : theme.components['case-view'].header['foreground-color'];\n\n const iconBackground = useMemo(() => {\n if (theme.components['case-view'].icon.background !== 'auto') {\n return theme.components['case-view'].icon.background;\n }\n return tryCatch(\n () => {\n const { lightness } = parseToHsl(theme.components['case-view'].header['background-color']);\n return lightness > 0.35 ? 'rgba(0, 0, 0, 0.2)' : 'rgba(255, 255, 255, 0.2)';\n },\n () => 'transparent'\n );\n }, [theme]);\n\n // Fall back to readable color if theme icon color and header foreground color are both 'auto'\n if (iconForeground === 'auto') {\n const caseTypeIconColor =\n color && theme.base['case-type-colors'] !== 'ignored'\n ? resolveCaseTypeColor(theme, color)\n : iconBackground;\n iconForeground = readableColor(caseTypeIconColor ?? iconBackground, {\n mode: 'light',\n level: 'AANonText'\n });\n }\n\n const [hasBrokenImage, setHasBrokenImage] = useState<undefined | boolean>();\n const showIcon = !!icon && !hasBrokenImage;\n\n const contentsEl = useRef<HTMLDivElement>(null);\n const headerGroupEl = useRef<HTMLElement>(null);\n const actionsContainerEl = useRef<HTMLDivElement>(null);\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n let actionsItems: Action[];\n let actionsLoading: boolean;\n\n if (Array.isArray(actions)) {\n actionsItems = actions;\n actionsLoading = false;\n } else if (actions) {\n actionsItems = actions.items ?? [];\n actionsLoading = !!actions.progress;\n } else {\n actionsItems = [];\n actionsLoading = false;\n }\n\n const caseActions: Action[] = actionsLoading\n ? []\n : [\n ...(onFollowedChange\n ? [\n {\n id: 'follow',\n text: followed ? t('unfollow') : t('follow'),\n onClick: () => {\n onFollowedChange(!followed);\n push({\n content: followed\n ? t('case_unfollowed', [caseId])\n : t('case_followed', [caseId])\n });\n }\n }\n ]\n : []),\n ...actionsItems.map(action => ({\n ...action,\n text: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n }))\n ];\n\n const showExpandCollapse = !isPreview && aboveMD;\n const collapsedMainHeader =\n (!isPreview && !aboveMD && aboveSM) || (showExpandCollapse && !summaryExpanded);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n // Actions wrapping\n useLayoutEffect(() => {\n if (\n !wrapPromotedActions &&\n contentsEl.current &&\n headerGroupEl.current &&\n actionsContainerEl.current\n ) {\n const contentStart = getEdge({\n el: contentsEl.current,\n side: 'leading',\n ltr\n });\n const headerGroupEnd = getEdge({\n el: headerGroupEl.current,\n side: 'trailing',\n ltr\n });\n const actionsContainerWidth = actionsContainerEl.current.getBoundingClientRect().width;\n\n wrapActionsBreakpoint.current =\n Math.ceil(headerGroupEnd) - Math.ceil(contentStart) + Math.ceil(actionsContainerWidth);\n }\n\n const promotedActionsWrapHandler = () => {\n if (wrapActionsBreakpoint.current && contentsEl.current) {\n setWrapPromotedActions(\n Math.ceil(contentsEl.current.offsetWidth) < wrapActionsBreakpoint.current\n );\n }\n };\n\n const resizeObserver = new ResizeObserver(throttle(promotedActionsWrapHandler, 30));\n\n promotedActionsWrapHandler();\n\n if (contentsEl.current) {\n resizeObserver.observe(contentsEl.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [\n contentsEl,\n headerGroupEl,\n actionsContainerEl,\n promotedActions,\n heading,\n subheading,\n wrapPromotedActions\n ]);\n\n // Reset summary\n useEffect(() => {\n setSummaryResetID(Math.random());\n }, [heading, promotedActions]);\n\n useEffect(() => {\n setHasBrokenImage(undefined);\n }, [typeof icon === 'string' ? icon : icon?.href]);\n\n const headingText = typeof heading !== 'string' ? heading.text : heading;\n const subheadingText =\n subheading && typeof subheading !== 'string' ? subheading.text : subheading;\n\n return (\n <Flex\n data-testid={testIds.header}\n as={StyledCaseHeader}\n container={{ direction: 'column', gap: 1 }}\n >\n <Flex container ref={contentsEl}>\n {showExpandCollapse && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseSummaryButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse' : 'expand')}\n aria-label={t(summaryExpanded ? 'collapse_summary' : 'expand_summary')}\n icon\n compact\n >\n <Icon name={summaryExpanded ? `arrow-micro-${start}` : 'arrow-micro-down'} />\n </StyledExpandCollapseSummaryButton>\n )}\n\n {showIcon && (\n <Flex container={{ pad: [1, 0, 0] }} item={{ shrink: 0 }}>\n {(() => {\n if (typeof icon === 'string') {\n return (\n <StyledCaseViewIcon\n data-testid={testIds.icon}\n aria-label={t('case_type_icon', [caseType ?? t('case_type')])}\n name={icon}\n foreground={iconForeground}\n background={iconBackground}\n />\n );\n }\n\n return (\n <StyledIconShape background={iconBackground} data-testid={testIds.icon}>\n <StyledCaseViewImage\n src={icon.href}\n alt={t('case_image')}\n onLoad={() => {\n setHasBrokenImage(false);\n }}\n onError={() => {\n setHasBrokenImage(true);\n }}\n />\n </StyledIconShape>\n );\n })()}\n </Flex>\n )}\n\n {/* header group */}\n <Flex\n as={StyledCaseHeaderText}\n container={{\n direction: 'column',\n pad: [0.5, 2, 0.5, showIcon ? 1 : undefined],\n alignItems: 'start',\n justify: 'center'\n }}\n item={\n aboveSM\n ? { shrink: wrapPromotedActions || !hasPromotedActions ? 1 : 0 }\n : { shrink: 1, grow: 1 }\n }\n ref={headerGroupEl}\n >\n {(() => {\n const headingContent = caseLink ? (\n <Link {...caseLink}>{headingText}</Link>\n ) : (\n headingText\n );\n const textEl = (\n <Text data-testid={testIds.heading} variant='h1'>\n {headingContent}\n </Text>\n );\n\n if (typeof heading !== 'string') {\n return (\n <InlineEdit contextualLabel={headingText} {...heading.inlineEdit}>\n {textEl}\n </InlineEdit>\n );\n }\n return textEl;\n })()}\n\n {subheading &&\n (!parentCases || subheadingText !== caseId) &&\n (() => {\n const subheadEl = (\n <StyledSubheading data-testid={testIds.subheading}>\n {subheadingText}\n </StyledSubheading>\n );\n if (typeof subheading !== 'string') {\n return (\n <InlineEdit contextualLabel={subheading.text} {...subheading.inlineEdit}>\n {subheadEl}\n </InlineEdit>\n );\n }\n return subheadEl;\n })()}\n\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n {\n ...caseLink,\n id: caseId,\n primary: caseId,\n href: caseLink?.href\n }\n ]}\n leafOnly\n />\n )}\n </Flex>\n {/* summary */}\n {collapsedMainHeader && !wrapPromotedActions && (\n <Summary siblingRef={actionsContainerEl} key={summaryResetID} />\n )}\n {/* inline actions */}\n <Flex\n as={StyledHeaderActions}\n item={{ shrink: 0 }}\n container={{ alignItems: 'start', pad: [0, 0, 0, 2] }}\n offsetEnd={!summaryExpanded}\n ref={actionsContainerEl}\n >\n {collapsedMainHeader &&\n !wrapPromotedActions &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <>\n {promotedActions.map(promotedAction => (\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n promotedAction.onClick?.(promotedAction.id, e)\n }\n key={promotedAction.id}\n >\n {promotedAction.text}\n </StyledCaseHeaderPromotedAction>\n ))}\n </>\n ) : null}\n\n {onEdit && (\n <Button\n data-testid={testIds.edit}\n icon\n variant='simple'\n onClick={onEdit}\n label={t('edit')}\n aria-label={`${t('edit')} - ${headingText}`}\n >\n <Icon name='pencil' />\n </Button>\n )}\n\n {(actionsLoading || caseActions.length > 0) && (\n <Actions\n contextualLabel={typeof heading === 'string' ? heading : heading.text}\n data-testid={testIds.actions}\n iconOnly\n progress={actionsLoading}\n items={caseActions}\n menuAt={actionsLoading ? 0 : 1}\n filterAt={5}\n scrollAt={Infinity}\n />\n )}\n </Flex>\n </Flex>\n\n {/* wrapped promoted actions */}\n {(!collapsedMainHeader || wrapPromotedActions || !aboveSM) &&\n promotedActions &&\n promotedActions.length > 0 ? (\n <Flex\n data-testid={testIds.promotedActions}\n container={{ justify: 'start', wrap: 'wrap', gap: 1, pad: [0, 0, 0.5] }}\n >\n {promotedActions.map(({ id, text, onClick }) => (\n <div key={text}>\n <StyledCaseHeaderPromotedAction\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) => onClick?.(id, e)}\n >\n {text}\n </StyledCaseHeaderPromotedAction>\n </div>\n ))}\n </Flex>\n ) : null}\n\n {collaboration}\n </Flex>\n );\n};\n\nexport default CaseHeader;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA8BhC,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,yBAAyB,CAAC;AAmCjE,OAAO,KAAK,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;;;;
|
|
1
|
+
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AA8BhC,OAAO,KAAK,EAAE,YAAY,EAAO,MAAM,yBAAyB,CAAC;AAmCjE,OAAO,KAAK,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;;;;AA44B5E,wBAAyD"}
|
|
@@ -105,7 +105,7 @@ genAICoachProps, collaboration, ...restProps }) => {
|
|
|
105
105
|
if (!caseViewRef.current)
|
|
106
106
|
return;
|
|
107
107
|
if (loadedRef.current) {
|
|
108
|
-
focusHeadingOrContainer(caseViewRef.current, heading);
|
|
108
|
+
focusHeadingOrContainer(caseViewRef.current, typeof heading === 'string' ? heading : heading.text);
|
|
109
109
|
}
|
|
110
110
|
else {
|
|
111
111
|
loadedRef.current = true;
|