@pega/cosmos-react-work 2.0.0-dev.2.1 → 2.0.0-dev.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +13 -17
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.d.ts +5 -1
- package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.js +39 -15
- package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts +5 -5
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +17 -16
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.d.ts +20 -8
- package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.js +121 -14
- package/lib/components/CaseSummary/CaseSummary.js.map +1 -1
- package/lib/components/CaseSummaryFields/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/CaseSummaryFields/CaseSummaryFields.js +14 -12
- package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts +6 -19
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +173 -189
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +24 -0
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.styles.js +111 -0
- package/lib/components/CaseView/CaseView.styles.js.map +1 -0
- package/lib/components/CaseView/MobileCaseView.d.ts +1 -0
- package/lib/components/CaseView/MobileCaseView.d.ts.map +1 -1
- package/lib/components/CaseView/MobileCaseView.js +3 -6
- package/lib/components/CaseView/MobileCaseView.js.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.js +8 -10
- package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
- package/lib/components/CaseView/index.d.ts +2 -1
- package/lib/components/CaseView/index.d.ts.map +1 -1
- package/lib/components/CaseView/index.js +1 -1
- package/lib/components/CaseView/index.js.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts +4 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js +93 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +43 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js +2 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -0
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts +6 -0
- package/lib/components/ConfigurableLayout/LayoutCell.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/LayoutCell.js +64 -0
- package/lib/components/ConfigurableLayout/LayoutCell.js.map +1 -0
- package/lib/components/ConfigurableLayout/defaults.d.ts +4 -0
- package/lib/components/ConfigurableLayout/defaults.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/defaults.js +4 -0
- package/lib/components/ConfigurableLayout/defaults.js.map +1 -0
- package/lib/components/ConfigurableLayout/index.d.ts +3 -0
- package/lib/components/ConfigurableLayout/index.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/index.js +3 -0
- package/lib/components/ConfigurableLayout/index.js.map +1 -0
- package/lib/components/ConfigurableLayout/options.d.ts +10 -0
- package/lib/components/ConfigurableLayout/options.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/options.js +10 -0
- package/lib/components/ConfigurableLayout/options.js.map +1 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts +7 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.d.ts.map +1 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js +37 -0
- package/lib/components/ConfigurableLayout/useTrackWrappedRegions.js.map +1 -0
- package/lib/components/Confirmation/Confirmation.d.ts +19 -0
- package/lib/components/Confirmation/Confirmation.d.ts.map +1 -0
- package/lib/components/Confirmation/Confirmation.js +14 -0
- package/lib/components/Confirmation/Confirmation.js.map +1 -0
- package/lib/components/Confirmation/index.d.ts +3 -0
- package/lib/components/Confirmation/index.d.ts.map +1 -0
- package/lib/components/Confirmation/index.js +2 -0
- package/lib/components/Confirmation/index.js.map +1 -0
- package/lib/components/Details/Details.d.ts +13 -0
- package/lib/components/Details/Details.d.ts.map +1 -0
- package/lib/components/Details/Details.js +38 -0
- package/lib/components/Details/Details.js.map +1 -0
- package/lib/components/Details/index.d.ts +4 -0
- package/lib/components/Details/index.d.ts.map +1 -0
- package/lib/components/Details/index.js +3 -0
- package/lib/components/Details/index.js.map +1 -0
- package/lib/components/Glimpse/Glimpse.d.ts +2 -2
- package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
- package/lib/components/Glimpse/Glimpse.js +3 -6
- package/lib/components/Glimpse/Glimpse.js.map +1 -1
- package/lib/components/SearchResults/Filter.d.ts.map +1 -1
- package/lib/components/SearchResults/Filter.js +15 -48
- package/lib/components/SearchResults/Filter.js.map +1 -1
- package/lib/components/SearchResults/SearchResult.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResult.js +2 -8
- package/lib/components/SearchResults/SearchResult.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.js +44 -101
- package/lib/components/SearchResults/SearchResults.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.styles.d.ts +8 -0
- package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/lib/components/SearchResults/SearchResults.styles.js +67 -0
- package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
- package/lib/components/SearchResults/SearchResults.types.d.ts +14 -4
- package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
- package/lib/components/Stages/Stages.d.ts.map +1 -1
- package/lib/components/Stages/Stages.js +31 -36
- package/lib/components/Stages/Stages.js.map +1 -1
- package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
- package/lib/components/Stages/Stages.styles.js +22 -28
- package/lib/components/Stages/Stages.styles.js.map +1 -1
- package/lib/components/Stages/Steps.d.ts.map +1 -1
- package/lib/components/Stages/Steps.js +7 -7
- package/lib/components/Stages/Steps.js.map +1 -1
- package/lib/components/Stages/StepsContainer.d.ts.map +1 -1
- package/lib/components/Stages/StepsContainer.js +5 -9
- package/lib/components/Stages/StepsContainer.js.map +1 -1
- package/lib/components/Stakeholders/StakeholderForm.d.ts +7 -0
- package/lib/components/Stakeholders/StakeholderForm.d.ts.map +1 -0
- package/lib/components/Stakeholders/StakeholderForm.js +47 -0
- package/lib/components/Stakeholders/StakeholderForm.js.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.d.ts +6 -0
- package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.js +215 -0
- package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.types.d.ts +78 -0
- package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.types.js +2 -0
- package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -0
- package/lib/components/Stakeholders/index.d.ts +3 -0
- package/lib/components/Stakeholders/index.d.ts.map +1 -0
- package/lib/components/Stakeholders/index.js +2 -0
- package/lib/components/Stakeholders/index.js.map +1 -0
- package/lib/components/Tags/Tags.d.ts +34 -0
- package/lib/components/Tags/Tags.d.ts.map +1 -0
- package/lib/components/Tags/Tags.js +227 -0
- package/lib/components/Tags/Tags.js.map +1 -0
- package/lib/components/Tags/index.d.ts +3 -0
- package/lib/components/Tags/index.d.ts.map +1 -0
- package/lib/components/Tags/index.js +2 -0
- package/lib/components/Tags/index.js.map +1 -0
- package/lib/components/Tasks/TaskList.d.ts +25 -0
- package/lib/components/Tasks/TaskList.d.ts.map +1 -0
- package/lib/components/Tasks/TaskList.js +25 -0
- package/lib/components/Tasks/TaskList.js.map +1 -0
- package/lib/components/Tasks/Tasks.d.ts +2 -14
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +17 -39
- package/lib/components/Tasks/Tasks.js.map +1 -1
- package/lib/components/Tasks/index.d.ts +3 -0
- package/lib/components/Tasks/index.d.ts.map +1 -1
- package/lib/components/Tasks/index.js +1 -0
- package/lib/components/Tasks/index.js.map +1 -1
- package/lib/components/Timeline/Timeline.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.js +13 -29
- package/lib/components/Timeline/Timeline.js.map +1 -1
- package/lib/components/Timeline/Timeline.styles.d.ts +9 -5
- package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.styles.js +107 -50
- package/lib/components/Timeline/Timeline.styles.js.map +1 -1
- package/lib/components/Timeline/Timeline.types.d.ts +18 -5
- package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.types.js.map +1 -1
- package/lib/components/Timeline/TimelineItem.d.ts +5 -3
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +15 -32
- package/lib/components/Timeline/TimelineItem.js.map +1 -1
- package/lib/components/Timeline/utils.d.ts +11 -3
- package/lib/components/Timeline/utils.d.ts.map +1 -1
- package/lib/components/Timeline/utils.js +48 -4
- package/lib/components/Timeline/utils.js.map +1 -1
- package/lib/index.d.ts +10 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -2
- package/lib/index.js.map +1 -1
- package/package.json +14 -14
- package/lib/components/CaseActions/CaseActions.d.ts +0 -12
- package/lib/components/CaseActions/CaseActions.d.ts.map +0 -1
- package/lib/components/CaseActions/CaseActions.js +0 -15
- package/lib/components/CaseActions/CaseActions.js.map +0 -1
- package/lib/components/CaseActions/index.d.ts +0 -4
- package/lib/components/CaseActions/index.d.ts.map +0 -1
- package/lib/components/CaseActions/index.js +0 -3
- package/lib/components/CaseActions/index.js.map +0 -1
|
@@ -1,20 +1,127 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useEffect, useRef } from 'react';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
import { Flex, Tabs, ExpandCollapse, defaultThemeProp, useConsolidatedRef, Icon, registerIcon, useI18n, useFocusWithin, Button, StyledIcon } from '@pega/cosmos-react-core';
|
|
5
|
+
import * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';
|
|
4
6
|
import CaseHeader from '../CaseHeader';
|
|
5
|
-
|
|
6
|
-
export const StyledCaseSummary = styled.div
|
|
7
|
+
registerIcon(arrowMicroLeftIcon);
|
|
8
|
+
export const StyledCaseSummary = styled.div(({ expanded, fixedWidth }) => {
|
|
9
|
+
return css `
|
|
10
|
+
position: relative;
|
|
11
|
+
width: ${fixedWidth || 'auto'};
|
|
12
|
+
max-width: ${fixedWidth ? 'none' : '100%'};
|
|
13
|
+
height: 100%;
|
|
14
|
+
|
|
15
|
+
${expanded &&
|
|
16
|
+
css `
|
|
17
|
+
&:hover {
|
|
18
|
+
&::after {
|
|
19
|
+
content: '';
|
|
20
|
+
position: absolute;
|
|
21
|
+
top: 0;
|
|
22
|
+
bottom: 0;
|
|
23
|
+
inset-inline-start: 100%;
|
|
24
|
+
width: 0.75rem;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
`}
|
|
28
|
+
`;
|
|
29
|
+
});
|
|
30
|
+
export const StyledCaseSummaryInfo = styled.div `
|
|
31
|
+
overflow: auto;
|
|
32
|
+
flex: 1;
|
|
33
|
+
`;
|
|
34
|
+
const StyledExpandCollapse = styled.div(({ animationState }) => {
|
|
35
|
+
const expandingOrCollapsing = ['expanding', 'collapsing'].includes(animationState);
|
|
36
|
+
return css `
|
|
37
|
+
position: ${expandingOrCollapsing ? 'fixed' : 'relative'};
|
|
38
|
+
top: ${expandingOrCollapsing ? 'var(--appshell-offset, 0)' : 0};
|
|
39
|
+
`;
|
|
40
|
+
});
|
|
41
|
+
const StyledExpandCollapseButton = styled(Button)(({ theme, expanded, headerHeight, animationState, visible }) => {
|
|
42
|
+
return css `
|
|
43
|
+
border-radius: ${expanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};
|
|
44
|
+
box-shadow: ${theme.base.shadow.low};
|
|
45
|
+
border: none;
|
|
46
|
+
opacity: ${visible ? '1' : '0'};
|
|
47
|
+
position: ${animationState === 'collapsing' ? 'fixed' : 'absolute'};
|
|
48
|
+
inset-inline-start: ${expanded ? 'calc(100% - 0.75rem)' : 0};
|
|
49
|
+
top: calc(calc(${headerHeight}px / 2) - 0.75rem);
|
|
50
|
+
z-index: 1;
|
|
51
|
+
|
|
52
|
+
${StyledIcon} {
|
|
53
|
+
width: 1.5rem;
|
|
54
|
+
height: 1.5rem;
|
|
55
|
+
transform: rotate(${expanded ? '0' : '180deg'});
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
});
|
|
59
|
+
StyledExpandCollapseButton.defaultProps = defaultThemeProp;
|
|
7
60
|
const CaseSummary = forwardRef((props, ref) => {
|
|
8
|
-
const { icon, heading, caseId, caseLink, parentCases, followed, onFollowedChange, actions, summary, tabs, forceMobile,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
61
|
+
const { icon, heading, caseId, caseLink, parentCases, followed, onFollowedChange, actions, onEdit, summary, tabs, forceMobile, collapsible = false, desktop = true, fixedWidth, onBeforeCollapse, onAfterCollapse, onBeforeExpand, onAfterExpand, onAnimationStateChange, headerRef: caseSummaryHeaderRef, ...restProps } = props;
|
|
62
|
+
const [showExpandCollapse, setShowExpandCollapse] = useState(false);
|
|
63
|
+
const expandCollapseBtnRef = useRef(null);
|
|
64
|
+
const [expanded, setExpanded] = useState(true);
|
|
65
|
+
const isMediumOrAbove = !forceMobile && desktop;
|
|
66
|
+
const [animationState, setAnimationState] = useState('expanded');
|
|
67
|
+
const [collapsedHeight, setCollapsedHeight] = useState(0);
|
|
68
|
+
const caseSummaryRef = useConsolidatedRef(ref);
|
|
69
|
+
const focusWithin = useFocusWithin([caseSummaryRef.current]);
|
|
70
|
+
const t = useI18n();
|
|
71
|
+
const setAnimStateAndUpdateParent = (state) => {
|
|
72
|
+
setAnimationState(state);
|
|
73
|
+
onAnimationStateChange?.(state);
|
|
74
|
+
};
|
|
75
|
+
const headerRef = useConsolidatedRef(caseSummaryHeaderRef);
|
|
12
76
|
const showTabs = (isMediumOrAbove && tabs.items.length > 1) || !isMediumOrAbove;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
isMediumOrAbove
|
|
17
|
-
|
|
77
|
+
const caseHeaderProps = {
|
|
78
|
+
actions,
|
|
79
|
+
onEdit,
|
|
80
|
+
isMediumOrAbove,
|
|
81
|
+
caseId,
|
|
82
|
+
parentCases,
|
|
83
|
+
heading,
|
|
84
|
+
caseLink,
|
|
85
|
+
icon,
|
|
86
|
+
followed,
|
|
87
|
+
onFollowedChange,
|
|
88
|
+
style: {
|
|
89
|
+
maxHeight: ['expanding', 'collapsed', 'collapsing'].includes(animationState)
|
|
90
|
+
? `${collapsedHeight}px`
|
|
91
|
+
: 'auto'
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (['expanded'].includes(animationState)) {
|
|
96
|
+
setCollapsedHeight(headerRef.current?.offsetHeight || 0);
|
|
97
|
+
}
|
|
98
|
+
}, [animationState, headerRef.current]);
|
|
99
|
+
const expandOrCollapseNoun = expanded ? t('collapse_noun') : t('expand_noun');
|
|
100
|
+
return (_jsxs(Flex, { as: StyledCaseSummary, expanded: expanded, fixedWidth: fixedWidth, container: { direction: 'column' }, item: { shrink: 0 }, ref: caseSummaryRef, style: {
|
|
101
|
+
marginTop: ['collapsing', 'expanding'].includes(animationState)
|
|
102
|
+
? `${collapsedHeight}px`
|
|
103
|
+
: 0
|
|
104
|
+
}, onMouseEnter: () => {
|
|
105
|
+
setShowExpandCollapse(true);
|
|
106
|
+
}, onMouseLeave: () => {
|
|
107
|
+
setShowExpandCollapse(false);
|
|
108
|
+
}, ...restProps, children: [collapsible ? (_jsxs(_Fragment, { children: [_jsx(StyledExpandCollapseButton, { onClick: () => setExpanded(!expanded), expanded: expanded, headerHeight: collapsedHeight, animationState: animationState, label: ['expanded', 'collapsed'].includes(animationState)
|
|
109
|
+
? expandOrCollapseNoun
|
|
110
|
+
: undefined, "aria-label": ['expanding', 'collapsing'].includes(animationState)
|
|
111
|
+
? expandOrCollapseNoun
|
|
112
|
+
: undefined, visible: showExpandCollapse || !expanded || focusWithin, tabIndex: 0, icon: true, compact: true, ref: expandCollapseBtnRef, children: _jsx(Icon, { name: 'arrow-micro-left' }, void 0) }, void 0), _jsx(ExpandCollapse, { dimension: 'width', min: isMediumOrAbove || !expanded ? fixedWidth : '100%', max: '100%', collapsed: expanded, onBeforeExpand: () => {
|
|
113
|
+
setAnimStateAndUpdateParent('collapsing');
|
|
114
|
+
onBeforeCollapse?.();
|
|
115
|
+
}, onAfterExpand: () => {
|
|
116
|
+
setAnimStateAndUpdateParent('collapsed');
|
|
117
|
+
onAfterCollapse?.();
|
|
118
|
+
}, onBeforeCollapse: () => {
|
|
119
|
+
setAnimStateAndUpdateParent('expanding');
|
|
120
|
+
onBeforeExpand?.();
|
|
121
|
+
}, onAfterCollapse: () => {
|
|
122
|
+
setAnimStateAndUpdateParent('expanded');
|
|
123
|
+
onAfterExpand?.();
|
|
124
|
+
}, as: StyledExpandCollapse, animationState: animationState, ref: headerRef, children: _jsx(CaseHeader, { ...caseHeaderProps }, void 0) }, void 0)] }, void 0)) : (_jsx(CaseHeader, { ...caseHeaderProps }, void 0)), _jsxs(StyledCaseSummaryInfo, { children: [isMediumOrAbove && summary, showTabs && isMediumOrAbove && (_jsx(Tabs, { type: 'vertical', tabs: tabs.items, onTabClick: tabs.onClick, currentTabId: tabs.currentTabId }, void 0))] }, void 0)] }, void 0));
|
|
18
125
|
});
|
|
19
126
|
export default CaseSummary;
|
|
20
127
|
//# sourceMappingURL=CaseSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseSummary/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,UAAU,EAOX,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAqB,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEvF,OAAO,UAA+B,MAAM,eAAe,CAAC;AAC5D,OAAO,WAAiC,MAAM,gBAAgB,CAAC;AAwB/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAA,EAAE,CAAC;AAE9C,MAAM,WAAW,GAAuD,UAAU,CAChF,CAAC,KAAwC,EAAE,GAA4B,EAAE,EAAE;IACzE,MAAM,EACJ,IAAI,EACJ,OAAO,EACP,MAAM,EACN,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,OAAO,EACP,IAAI,EACJ,WAAW,EACX,WAAW,EACX,GAAG,SAAS,EACb,GAAG,KAAK,CAAC;IAEV,IAAI,eAAe,GAAG,aAAa,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAAC;IAC1E,IAAI,WAAW;QAAE,eAAe,GAAG,KAAK,CAAC;IAEzC,MAAM,QAAQ,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC;IAEhF,OAAO,CACL,oBAAC,IAAI,IACH,EAAE,EAAE,iBAAiB,EACrB,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAClC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EACnB,GAAG,EAAE,GAAG,KACJ,SAAS;QAEb,oBAAC,UAAU,IACT,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,gBAAgB,GAClC;QAED,OAAO,IAAI,oBAAC,WAAW,IAAC,OAAO,EAAE,OAAO,GAAI;QAE5C,eAAe,IAAI,OAAO;QAE1B,QAAQ,IAAI,CACX,oBAAC,IAAI,IACH,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,EACjD,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,UAAU,EAAE,IAAI,CAAC,OAAO,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,GAC/B,CACH,CACI,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React, {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n Ref,\n MouseEvent,\n RefObject\n} from 'react';\nimport styled from 'styled-components';\n\nimport { Flex, Tabs, Tab, ForwardProps, useBreakpoint } from '@pega/cosmos-react-core';\n\nimport CaseHeader, { CaseHeaderProps } from '../CaseHeader';\nimport CaseActions, { CaseActionsProps } from '../CaseActions';\n\nexport interface CaseSummaryProps extends CaseHeaderProps {\n /** A region to hold any buttons that will be used for various actions on the CaseView. */\n actions?: CaseActionsProps['actions'];\n /** A region to display any summary information about the CaseView. */\n summary: ReactNode;\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick(id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>): void;\n currentTabId: string;\n };\n /**\n * Forces rendering in the mobile layout, regardless of screen size.\n * @internal\n */\n forceMobile?: boolean;\n /** Ref for the CaseView element to base breakpoints off of. If undefined, breakpoints will be based on the viewport. */\n caseViewRef?: RefObject<HTMLDivElement>;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledCaseSummary = styled.div``;\n\nconst CaseSummary: FunctionComponent<CaseSummaryProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CaseSummaryProps>, ref: CaseSummaryProps['ref']) => {\n const {\n icon,\n heading,\n caseId,\n caseLink,\n parentCases,\n followed,\n onFollowedChange,\n actions,\n summary,\n tabs,\n forceMobile,\n caseViewRef,\n ...restProps\n } = props;\n\n let isMediumOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });\n if (forceMobile) isMediumOrAbove = false;\n\n const showTabs = (isMediumOrAbove && tabs.items.length > 1) || !isMediumOrAbove;\n\n return (\n <Flex\n as={StyledCaseSummary}\n container={{ direction: 'column' }}\n item={{ shrink: 0 }}\n ref={ref}\n {...restProps}\n >\n <CaseHeader\n caseId={caseId}\n parentCases={parentCases}\n heading={heading}\n caseLink={caseLink}\n icon={icon}\n followed={followed}\n onFollowedChange={onFollowedChange}\n />\n\n {actions && <CaseActions actions={actions} />}\n\n {isMediumOrAbove && summary}\n\n {showTabs && (\n <Tabs\n type={isMediumOrAbove ? 'vertical' : 'horizontal'}\n tabs={tabs.items}\n onTabClick={tabs.onClick}\n currentTabId={tabs.currentTabId}\n />\n )}\n </Flex>\n );\n }\n);\n\nexport default CaseSummary;\n"]}
|
|
1
|
+
{"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["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KAAK,EAChB,UAAU,EAAE,IAAI,CAAC,OAAO,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,WAC/B,CACH,YACqB,YACnB,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n ReactNode,\n Ref,\n MouseEvent,\n useState,\n useEffect,\n useRef\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Flex,\n Tabs,\n Tab,\n ForwardProps,\n ExpandCollapse,\n defaultThemeProp,\n useConsolidatedRef,\n Icon,\n registerIcon,\n useI18n,\n useFocusWithin,\n Button,\n StyledIcon\n} from '@pega/cosmos-react-core';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport CaseHeader, { CaseHeaderProps } from '../CaseHeader';\n\nregisterIcon(arrowMicroLeftIcon);\n\nexport interface CaseSummaryProps extends CaseHeaderProps {\n /** A region to display any summary information about the CaseView. */\n summary: ReactNode;\n /** An object handling the rendering and functionality of the Tabs in CaseSummary. */\n tabs: {\n items: Tab[];\n onClick: (id: string, event?: MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => void;\n currentTabId: string;\n };\n /**\n * Forces rendering in the mobile layout, regardless of screen size.\n * @internal\n */\n forceMobile?: boolean;\n /**\n * Indicator for a desktop size.\n * @internal\n */\n desktop?: boolean;\n /** The fixed width string is needed for the expandable and collapsible header. */\n fixedWidth?: string;\n /** A boolean that toggles the collapsible feature of the case summary. */\n collapsible?: boolean;\n onBeforeCollapse?: () => void;\n onAfterCollapse?: () => void;\n onBeforeExpand?: () => void;\n onAfterExpand?: () => void;\n /** A callback that will return the animation state of the case summary. */\n onAnimationStateChange?: (state: AnimationState) => void;\n /** Ref for the header element inside the Case Summary */\n headerRef?: Ref<HTMLDivElement>;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\ntype AnimationState = 'expanding' | 'expanded' | 'collapsing' | 'collapsed';\n\nexport const StyledCaseSummary = styled.div<{ expanded?: boolean; fixedWidth?: string }>(\n ({ expanded, fixedWidth }) => {\n return css`\n position: relative;\n width: ${fixedWidth || 'auto'};\n max-width: ${fixedWidth ? 'none' : '100%'};\n height: 100%;\n\n ${expanded &&\n css`\n &:hover {\n &::after {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n inset-inline-start: 100%;\n width: 0.75rem;\n }\n }\n `}\n `;\n }\n);\n\nexport const StyledCaseSummaryInfo = styled.div`\n overflow: auto;\n flex: 1;\n`;\n\nconst StyledExpandCollapse = styled.div<{ animationState: AnimationState }>(\n ({ animationState }) => {\n const expandingOrCollapsing = ['expanding', 'collapsing'].includes(animationState);\n return css`\n position: ${expandingOrCollapsing ? 'fixed' : 'relative'};\n top: ${expandingOrCollapsing ? 'var(--appshell-offset, 0)' : 0};\n `;\n }\n);\n\nconst StyledExpandCollapseButton = styled(Button)<{\n expanded: boolean;\n headerHeight: number;\n animationState: AnimationState;\n visible: boolean;\n}>(({ theme, expanded, headerHeight, animationState, visible }) => {\n return css`\n border-radius: ${expanded ? '1.5rem' : '0 1.5rem 1.5rem 0'};\n box-shadow: ${theme.base.shadow.low};\n border: none;\n opacity: ${visible ? '1' : '0'};\n position: ${animationState === 'collapsing' ? 'fixed' : 'absolute'};\n inset-inline-start: ${expanded ? 'calc(100% - 0.75rem)' : 0};\n top: calc(calc(${headerHeight}px / 2) - 0.75rem);\n z-index: 1;\n\n ${StyledIcon} {\n width: 1.5rem;\n height: 1.5rem;\n transform: rotate(${expanded ? '0' : '180deg'});\n }\n `;\n});\n\nStyledExpandCollapseButton.defaultProps = defaultThemeProp;\n\nconst CaseSummary: FunctionComponent<CaseSummaryProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<CaseSummaryProps>, ref: CaseSummaryProps['ref']) => {\n const {\n icon,\n heading,\n caseId,\n caseLink,\n parentCases,\n followed,\n onFollowedChange,\n actions,\n onEdit,\n summary,\n tabs,\n forceMobile,\n collapsible = false,\n desktop = true,\n fixedWidth,\n onBeforeCollapse,\n onAfterCollapse,\n onBeforeExpand,\n onAfterExpand,\n onAnimationStateChange,\n headerRef: caseSummaryHeaderRef,\n ...restProps\n } = props;\n\n const [showExpandCollapse, setShowExpandCollapse] = useState(false);\n const expandCollapseBtnRef = useRef<HTMLButtonElement>(null);\n const [expanded, setExpanded] = useState(true);\n const isMediumOrAbove = !forceMobile && desktop;\n const [animationState, setAnimationState] = useState('expanded');\n const [collapsedHeight, setCollapsedHeight] = useState(0);\n const caseSummaryRef = useConsolidatedRef(ref);\n const focusWithin = useFocusWithin<HTMLDivElement>([caseSummaryRef.current]);\n const t = useI18n();\n\n const setAnimStateAndUpdateParent = (state: AnimationState) => {\n setAnimationState(state);\n onAnimationStateChange?.(state);\n };\n\n const headerRef = useConsolidatedRef<HTMLDivElement>(caseSummaryHeaderRef);\n\n const showTabs = (isMediumOrAbove && tabs.items.length > 1) || !isMediumOrAbove;\n\n const caseHeaderProps = {\n actions,\n onEdit,\n isMediumOrAbove,\n caseId,\n parentCases,\n heading,\n caseLink,\n icon,\n followed,\n onFollowedChange,\n style: {\n maxHeight: ['expanding', 'collapsed', 'collapsing'].includes(animationState)\n ? `${collapsedHeight}px`\n : 'auto'\n }\n };\n\n useEffect(() => {\n if (['expanded'].includes(animationState)) {\n setCollapsedHeight(headerRef.current?.offsetHeight || 0);\n }\n }, [animationState, headerRef.current]);\n\n const expandOrCollapseNoun = expanded ? t('collapse_noun') : t('expand_noun');\n\n return (\n <Flex\n as={StyledCaseSummary}\n expanded={expanded}\n fixedWidth={fixedWidth}\n container={{ direction: 'column' }}\n item={{ shrink: 0 }}\n ref={caseSummaryRef}\n style={{\n marginTop: ['collapsing', 'expanding'].includes(animationState)\n ? `${collapsedHeight}px`\n : 0\n }}\n onMouseEnter={() => {\n setShowExpandCollapse(true);\n }}\n onMouseLeave={() => {\n setShowExpandCollapse(false);\n }}\n {...restProps}\n >\n {collapsible ? (\n <>\n <StyledExpandCollapseButton\n onClick={() => setExpanded(!expanded)}\n expanded={expanded}\n headerHeight={collapsedHeight}\n animationState={animationState}\n label={\n ['expanded', 'collapsed'].includes(animationState)\n ? expandOrCollapseNoun\n : undefined\n }\n aria-label={\n ['expanding', 'collapsing'].includes(animationState)\n ? expandOrCollapseNoun\n : undefined\n }\n visible={showExpandCollapse || !expanded || focusWithin}\n tabIndex={0}\n icon\n compact\n ref={expandCollapseBtnRef}\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseButton>\n <ExpandCollapse\n dimension='width'\n min={isMediumOrAbove || !expanded ? fixedWidth : '100%'}\n max='100%'\n collapsed={expanded}\n onBeforeExpand={() => {\n setAnimStateAndUpdateParent('collapsing');\n onBeforeCollapse?.();\n }}\n onAfterExpand={() => {\n setAnimStateAndUpdateParent('collapsed');\n onAfterCollapse?.();\n }}\n onBeforeCollapse={() => {\n setAnimStateAndUpdateParent('expanding');\n onBeforeExpand?.();\n }}\n onAfterCollapse={() => {\n setAnimStateAndUpdateParent('expanded');\n onAfterExpand?.();\n }}\n as={StyledExpandCollapse}\n animationState={animationState}\n ref={headerRef}\n >\n <CaseHeader {...caseHeaderProps} />\n </ExpandCollapse>\n </>\n ) : (\n <CaseHeader {...caseHeaderProps} />\n )}\n <StyledCaseSummaryInfo>\n {isMediumOrAbove && summary}\n\n {showTabs && isMediumOrAbove && (\n <Tabs\n type='vertical'\n tabs={tabs.items}\n onTabClick={tabs.onClick}\n currentTabId={tabs.currentTabId}\n />\n )}\n </StyledCaseSummaryInfo>\n </Flex>\n );\n }\n);\n\nexport default CaseSummary;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummaryFields.d.ts","sourceRoot":"","sources":["../../../src/components/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CaseSummaryFields.d.ts","sourceRoot":"","sources":["../../../src/components/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,iBAAiB,EAAmB,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAOL,YAAY,EAEb,MAAM,yBAAyB,CAAC;AAEjC,eAAO,MAAM,uBAAuB,yGAelC,CAAC;AAIH,MAAM,WAAW,sBAAsB;IACrC,oEAAoE;IACpE,aAAa,EAAE;QACb,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,CAAC;KAClB,EAAE,CAAC;IACJ,oEAAoE;IACpE,eAAe,EAAE;QACf,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,SAAS,CAAC;KAClB,EAAE,CAAC;IACJ,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,GAAG,YAAY,CAY/E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
2
3
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import { Grid, FieldValueList, StyledFieldValueList,
|
|
4
|
-
export const StyledCaseSummaryFields = styled.div(({ theme }) =>
|
|
4
|
+
import { Grid, FieldValueList, StyledFieldValueList, StyledFieldValue, calculateFontSize, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
5
|
+
export const StyledCaseSummaryFields = styled.div(({ theme }) => {
|
|
6
|
+
const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
7
|
+
return css `
|
|
5
8
|
padding: calc(2 * ${theme.base.spacing});
|
|
6
9
|
|
|
7
10
|
> ${StyledFieldValueList}:first-child {
|
|
8
11
|
grid-template-columns: 16ch auto;
|
|
12
|
+
|
|
13
|
+
${StyledFieldValue} {
|
|
14
|
+
font-size: ${fontSizes[theme.components.text.h1['font-size']]};
|
|
15
|
+
font-weight: ${theme.components.text.h1['font-weight']};
|
|
16
|
+
}
|
|
9
17
|
}
|
|
10
|
-
|
|
18
|
+
`;
|
|
19
|
+
});
|
|
11
20
|
StyledCaseSummaryFields.defaultProps = defaultThemeProp;
|
|
12
21
|
const CaseSummaryFields = forwardRef(({ primaryFields, secondaryFields, ...restProps }, ref) => {
|
|
13
|
-
return (
|
|
14
|
-
React.createElement(FieldValueList, { variant: 'stacked', fields: primaryFields.map(field => typeof field.value === 'string'
|
|
15
|
-
? {
|
|
16
|
-
...field,
|
|
17
|
-
value: (React.createElement(Text, { variant: 'h1', as: 'span' }, field.value))
|
|
18
|
-
}
|
|
19
|
-
: field) }),
|
|
20
|
-
React.createElement(FieldValueList, { variant: 'inline', fields: secondaryFields })));
|
|
22
|
+
return (_jsxs(Grid, { ...restProps, as: StyledCaseSummaryFields, ref: ref, container: { rowGap: 2 }, children: [_jsx(FieldValueList, { variant: 'stacked', fields: primaryFields }, void 0), _jsx(FieldValueList, { variant: 'inline', fields: secondaryFields }, void 0)] }, void 0));
|
|
21
23
|
});
|
|
22
24
|
export default CaseSummaryFields;
|
|
23
25
|
//# sourceMappingURL=CaseSummaryFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseSummaryFields/CaseSummaryFields.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,UAAU,EAA2C,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EACL,IAAI,EACJ,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAGjB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9D,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAEvF,OAAO,GAAG,CAAA;wBACY,KAAK,CAAC,IAAI,CAAC,OAAO;;QAElC,oBAAoB;;;QAGpB,gBAAgB;qBACH,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAa,CAAC;uBAC1D,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC;;;GAG3D,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAmBxD,MAAM,iBAAiB,GAA6D,UAAU,CAC5F,CACE,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,SAAS,EAA2C,EACzF,GAAkC,EAClC,EAAE;IACF,OAAO,CACL,MAAC,IAAI,OAAK,SAAS,EAAE,EAAE,EAAE,uBAAuB,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aAClF,KAAC,cAAc,IAAC,OAAO,EAAC,SAAS,EAAC,MAAM,EAAE,aAAa,WAAI,EAC3D,KAAC,cAAc,IAAC,OAAO,EAAC,QAAQ,EAAC,MAAM,EAAE,eAAe,WAAI,YACvD,CACR,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { ReactNode, forwardRef, FunctionComponent, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n Grid,\n FieldValueList,\n StyledFieldValueList,\n StyledFieldValue,\n calculateFontSize,\n defaultThemeProp,\n ForwardProps,\n FontSize\n} from '@pega/cosmos-react-core';\n\nexport const StyledCaseSummaryFields = styled.div(({ theme }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n padding: calc(2 * ${theme.base.spacing});\n\n > ${StyledFieldValueList}:first-child {\n grid-template-columns: 16ch auto;\n\n ${StyledFieldValue} {\n font-size: ${fontSizes[theme.components.text.h1['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h1['font-weight']};\n }\n }\n `;\n});\n\nStyledCaseSummaryFields.defaultProps = defaultThemeProp;\n\nexport interface CaseSummaryFieldsProps {\n /** The primary summary fields to display above secondary fields. */\n primaryFields: {\n id?: string;\n name: string;\n value: ReactNode;\n }[];\n /** The secondary summary fields to display below primary fields. */\n secondaryFields: {\n id?: string;\n name: string;\n value: ReactNode;\n }[];\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n\nconst CaseSummaryFields: FunctionComponent<CaseSummaryFieldsProps & ForwardProps> = forwardRef(\n (\n { primaryFields, secondaryFields, ...restProps }: PropsWithoutRef<CaseSummaryFieldsProps>,\n ref: CaseSummaryFieldsProps['ref']\n ) => {\n return (\n <Grid {...restProps} as={StyledCaseSummaryFields} ref={ref} container={{ rowGap: 2 }}>\n <FieldValueList variant='stacked' fields={primaryFields} />\n <FieldValueList variant='inline' fields={secondaryFields} />\n </Grid>\n );\n }\n);\n\nexport default CaseSummaryFields;\n"]}
|
|
@@ -11,6 +11,8 @@ export interface CaseViewProps extends CaseSummaryProps {
|
|
|
11
11
|
utilities?: ReactNode;
|
|
12
12
|
/** The utilities summary array will be used to render the minimized the utilities card. */
|
|
13
13
|
utilitiesSummaryItems?: UtilitiesSummaryProps['items'];
|
|
14
|
+
/** Collapses the utilities by default on load */
|
|
15
|
+
defaultCollapsedUtilities?: boolean;
|
|
14
16
|
/** A region above the center column to display banners. */
|
|
15
17
|
banners?: ReactNode;
|
|
16
18
|
/** A region to the right reserved for persistent utilities. */
|
|
@@ -19,26 +21,11 @@ export interface CaseViewProps extends CaseSummaryProps {
|
|
|
19
21
|
title: string;
|
|
20
22
|
};
|
|
21
23
|
/** A region within the center column that is controlled by tabs in CaseSummary. */
|
|
22
|
-
tabContent?:
|
|
24
|
+
tabContent?: {
|
|
25
|
+
content: ReactNode;
|
|
26
|
+
id: string;
|
|
27
|
+
}[];
|
|
23
28
|
}
|
|
24
|
-
export declare const StyledCaseViewContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
25
|
-
forceMobile?: boolean | undefined;
|
|
26
|
-
isMediumOrAbove?: boolean | undefined;
|
|
27
|
-
}, never>;
|
|
28
|
-
export declare const StyledCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
29
|
-
forceMobile?: boolean | undefined;
|
|
30
|
-
isMediumOrAbove?: boolean | undefined;
|
|
31
|
-
}, never>;
|
|
32
|
-
export declare const StyledSummaryRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
33
|
-
forceMobile?: boolean | undefined;
|
|
34
|
-
isMediumOrAbove?: boolean | undefined;
|
|
35
|
-
}, never>;
|
|
36
|
-
export declare const StyledCaseDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
37
|
-
hasPersistentUtility?: boolean | undefined;
|
|
38
|
-
}, never>;
|
|
39
|
-
export declare const StyledCaseDrawerContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
40
|
-
export declare const StyledPersistentUtility: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
41
|
-
export declare const ScrollStick: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
42
29
|
declare const CaseView: FC<CaseViewProps & ForwardProps>;
|
|
43
30
|
export default CaseView;
|
|
44
31
|
//# sourceMappingURL=CaseView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,EAAE,EAWH,MAAM,OAAO,CAAC;AAEf,OAAO,EAUL,YAAY,EAOb,MAAM,yBAAyB,CAAC;AAMjC,OAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAyB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAe7E,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,2CAA2C;IAC3C,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gFAAgF;IAChF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,2FAA2F;IAC3F,qBAAqB,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;IACvD,iDAAiD;IACjD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,2DAA2D;IAC3D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1D,mFAAmF;IACnF,UAAU,CAAC,EAAE;QAAE,OAAO,EAAE,SAAS,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAMnD;AAED,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,GAAG,YAAY,CAkc9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|