@pega/cosmos-react-work 2.0.0-dev.9.2 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts +3 -3
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +5 -7
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.d.ts +2 -2
- package/lib/components/CaseHeader/CaseHeader.d.ts.map +1 -1
- package/lib/components/CaseHeader/CaseHeader.js +9 -9
- package/lib/components/CaseHeader/CaseHeader.js.map +1 -1
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +14 -11
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.d.ts +18 -1
- package/lib/components/CaseSummary/CaseSummary.d.ts.map +1 -1
- package/lib/components/CaseSummary/CaseSummary.js +122 -10
- 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 +12 -10
- package/lib/components/CaseSummaryFields/CaseSummaryFields.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts +6 -23
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +167 -170
- 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.js +1 -3
- package/lib/components/CaseView/MobileCaseView.js.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.js +4 -5
- 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 +1 -2
- 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 +10 -42
- package/lib/components/SearchResults/Filter.js.map +1 -1
- package/lib/components/SearchResults/SearchResult.js +1 -4
- 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 +33 -69
- 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 +16 -6
- 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 +13 -15
- 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 +2 -2
- package/lib/components/Stages/Stages.styles.js.map +1 -1
- package/lib/components/Stages/Stages.types.d.ts +2 -2
- package/lib/components/Stages/Stages.types.d.ts.map +1 -1
- package/lib/components/Stages/Stages.types.js.map +1 -1
- package/lib/components/Stages/Steps.d.ts.map +1 -1
- package/lib/components/Stages/Steps.js +5 -3
- 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 +4 -6
- 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 +49 -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 +83 -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 +3 -15
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +9 -28
- 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 +10 -12
- package/lib/components/Timeline/Timeline.js.map +1 -1
- package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.styles.js +8 -4
- 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 +2 -1
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +4 -11
- 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 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +10 -0
- package/lib/index.js.map +1 -1
- package/package.json +12 -12
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Grid, FieldValueList, StyledFieldValueList,
|
|
5
|
-
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 `
|
|
6
8
|
padding: calc(2 * ${theme.base.spacing});
|
|
7
9
|
|
|
8
10
|
> ${StyledFieldValueList}:first-child {
|
|
9
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
|
+
}
|
|
10
17
|
}
|
|
11
|
-
|
|
18
|
+
`;
|
|
19
|
+
});
|
|
12
20
|
StyledCaseSummaryFields.defaultProps = defaultThemeProp;
|
|
13
21
|
const CaseSummaryFields = forwardRef(({ primaryFields, secondaryFields, ...restProps }, ref) => {
|
|
14
|
-
return (_jsxs(Grid,
|
|
15
|
-
? {
|
|
16
|
-
...field,
|
|
17
|
-
value: (_jsx(Text, Object.assign({ variant: 'h1', as: 'span' }, { children: field.value }), void 0))
|
|
18
|
-
}
|
|
19
|
-
: field) }, void 0),
|
|
20
|
-
_jsx(FieldValueList, { variant: 'inline', fields: secondaryFields }, void 0)] }), void 0));
|
|
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,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,
|
|
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,30 +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 StyledMobileTabs: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
29
|
-
export declare const StyledCaseViewUtilities: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
30
|
-
utilitiesShown: boolean;
|
|
31
|
-
}, never>;
|
|
32
|
-
export declare const StyledCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
33
|
-
forceMobile?: boolean | undefined;
|
|
34
|
-
isMediumOrAbove?: boolean | undefined;
|
|
35
|
-
}, never>;
|
|
36
|
-
export declare const StyledSummaryRegion: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
37
|
-
forceMobile?: boolean | undefined;
|
|
38
|
-
isMediumOrAbove?: boolean | undefined;
|
|
39
|
-
}, never>;
|
|
40
|
-
export declare const StyledCaseDrawer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
41
|
-
hasPersistentUtility?: boolean | undefined;
|
|
42
|
-
}, never>;
|
|
43
|
-
export declare const StyledCaseDrawerContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
44
|
-
export declare const StyledPersistentUtility: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
45
|
-
export declare const ScrollStick: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
46
29
|
declare const CaseView: FC<CaseViewProps & ForwardProps>;
|
|
47
30
|
export default CaseView;
|
|
48
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,OAAO,EACL,SAAS,EACT,EAAE,
|
|
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,CAoc9C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,138 +1,54 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState, useCallback, useMemo, useRef } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { useContext, useEffect, useState, useCallback, useMemo, useRef, useLayoutEffect } from 'react';
|
|
3
|
+
import { Button, Flex, Grid, Icon, registerIcon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, useConsolidatedRef } from '@pega/cosmos-react-core';
|
|
4
|
+
import AppShellContext from '@pega/cosmos-react-core/lib/components/AppShell/AppShellContext';
|
|
5
|
+
import * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';
|
|
6
|
+
import * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';
|
|
5
7
|
import CaseSummary from '../CaseSummary';
|
|
6
8
|
import UtilitiesSummary from './UtilitiesSummary';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return css `
|
|
10
|
-
padding: calc(2 * ${theme.base.spacing});
|
|
11
|
-
|
|
12
|
-
${!forceMobile &&
|
|
13
|
-
isMediumOrAbove &&
|
|
14
|
-
css `
|
|
15
|
-
padding: calc(2 * ${theme.base.spacing}) 0;
|
|
16
|
-
`}
|
|
17
|
-
`;
|
|
18
|
-
});
|
|
19
|
-
export const StyledMobileTabs = styled.div(({ theme }) => {
|
|
20
|
-
return css `
|
|
21
|
-
border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};
|
|
22
|
-
margin: 0 calc(-2 * ${theme.base.spacing});
|
|
23
|
-
`;
|
|
24
|
-
});
|
|
25
|
-
StyledCaseViewContent.defaultProps = defaultThemeProp;
|
|
26
|
-
const StyledUtilToggle = styled.button(({ theme }) => {
|
|
27
|
-
return css `
|
|
28
|
-
align-self: flex-end;
|
|
29
|
-
color: ${theme.base.palette['foreground-color']};
|
|
30
|
-
margin-inline-end: 0.375rem;
|
|
31
|
-
`;
|
|
32
|
-
});
|
|
33
|
-
StyledUtilToggle.defaultProps = defaultThemeProp;
|
|
34
|
-
export const StyledCaseViewUtilities = styled.div(({ utilitiesShown, theme }) => {
|
|
35
|
-
return css `
|
|
36
|
-
width: ${utilitiesShown ? '25rem' : 'auto'};
|
|
37
|
-
height: max-content;
|
|
38
|
-
padding: calc(2 * ${theme.base.spacing}) 0 calc(2 * ${theme.base.spacing});
|
|
39
|
-
`;
|
|
40
|
-
});
|
|
41
|
-
StyledCaseViewUtilities.defaultProps = defaultThemeProp;
|
|
42
|
-
export const StyledCaseView = styled.div(({ theme, forceMobile, isMediumOrAbove }) => {
|
|
43
|
-
return css `
|
|
44
|
-
min-height: 100vh;
|
|
45
|
-
position: relative;
|
|
46
|
-
background-color: ${theme.base.palette['app-background']};
|
|
47
|
-
|
|
48
|
-
> :last-child {
|
|
49
|
-
${!forceMobile &&
|
|
50
|
-
isMediumOrAbove &&
|
|
51
|
-
css `
|
|
52
|
-
margin-inline-end: calc(2 * ${theme.base.spacing});
|
|
53
|
-
`}
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
});
|
|
57
|
-
StyledCaseView.defaultProps = defaultThemeProp;
|
|
58
|
-
export const StyledSummaryRegion = styled.div(({ theme, forceMobile, isMediumOrAbove }) => {
|
|
59
|
-
return css `
|
|
60
|
-
position: sticky;
|
|
61
|
-
top: 0;
|
|
62
|
-
width: 100%;
|
|
63
|
-
background-color: ${theme.base.palette['primary-background']};
|
|
64
|
-
overflow: auto;
|
|
65
|
-
|
|
66
|
-
${(forceMobile || !isMediumOrAbove) &&
|
|
67
|
-
css `
|
|
68
|
-
z-index: ${theme.base['z-index'].popover + 1};
|
|
69
|
-
`}
|
|
70
|
-
|
|
71
|
-
${!forceMobile &&
|
|
72
|
-
isMediumOrAbove &&
|
|
73
|
-
css `
|
|
74
|
-
height: 100vh;
|
|
75
|
-
`}
|
|
76
|
-
`;
|
|
77
|
-
});
|
|
78
|
-
StyledSummaryRegion.defaultProps = defaultThemeProp;
|
|
79
|
-
export const StyledCaseDrawer = styled.div(({ hasPersistentUtility, theme }) => {
|
|
80
|
-
return css `
|
|
81
|
-
min-width: 21.875rem;
|
|
82
|
-
max-width: 31.25rem;
|
|
83
|
-
width: calc((100vw - 31.25rem) / 10 + 21.875rem);
|
|
84
|
-
background-color: ${theme.base.palette['primary-background']};
|
|
85
|
-
height: 100vh;
|
|
86
|
-
|
|
87
|
-
${hasPersistentUtility &&
|
|
88
|
-
css `
|
|
89
|
-
@media (min-width: ${theme.base.breakpoints.md}) {
|
|
90
|
-
inset-inline-end: ${persistentUtilityWidth};
|
|
91
|
-
}
|
|
92
|
-
`}
|
|
93
|
-
`;
|
|
94
|
-
});
|
|
95
|
-
StyledCaseDrawer.defaultProps = defaultThemeProp;
|
|
96
|
-
export const StyledCaseDrawerContent = styled.div(({ theme }) => {
|
|
97
|
-
return css `
|
|
98
|
-
background-color: ${theme.base.palette['app-background']};
|
|
99
|
-
padding: calc(2 * ${theme.base.spacing});
|
|
100
|
-
height: 100%;
|
|
101
|
-
overflow: auto;
|
|
102
|
-
`;
|
|
103
|
-
});
|
|
104
|
-
StyledCaseDrawerContent.defaultProps = defaultThemeProp;
|
|
105
|
-
export const StyledPersistentUtility = styled.div(({ theme }) => {
|
|
106
|
-
return css `
|
|
107
|
-
z-index: calc(${theme.base['z-index'].drawer} + 400);
|
|
108
|
-
`;
|
|
109
|
-
});
|
|
110
|
-
StyledPersistentUtility.defaultProps = defaultThemeProp;
|
|
111
|
-
export const ScrollStick = styled.div `
|
|
112
|
-
position: sticky;
|
|
113
|
-
top: 0;
|
|
114
|
-
`;
|
|
9
|
+
import { StyledCaseDrawer, StyledCaseDrawerContent, StyledCaseView, StyledCaseViewContent, StyledPersistentUtility, StyledSummaryRegion, StyledCaseViewUtilities, StyledMobileTabs, StyledUtilToggle } from './CaseView.styles';
|
|
10
|
+
registerIcon(moveRightSolidIcon, moveLeftSolidIcon);
|
|
115
11
|
const CaseView = (props) => {
|
|
116
|
-
const { caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, caseSummaryRef, tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick }, stages, tasks, tabContent: tabContentProp, utilities, utilitiesSummaryItems, actions, onEdit, banners, persistentUtility, forceMobile, ...restProps } = props;
|
|
12
|
+
const { caseId, parentCases, heading, caseLink, icon, followed, onFollowedChange, summary, caseSummaryRef, tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick }, stages, tasks, tabContent: tabContentProp = [], utilities, utilitiesSummaryItems, defaultCollapsedUtilities = false, actions, onEdit, banners, persistentUtility, forceMobile, ...restProps } = props;
|
|
117
13
|
const t = useI18n();
|
|
118
14
|
const caseViewRef = useRef(null);
|
|
15
|
+
const caseViewSummaryRef = useConsolidatedRef(caseSummaryRef);
|
|
16
|
+
const caseSummaryHeaderRef = useRef(null);
|
|
17
|
+
const caseViewSummaryContainerRef = useRef(null);
|
|
18
|
+
const [tabContentEl, setTabContentEl] = useElement(null);
|
|
19
|
+
let isExtraLargeOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });
|
|
119
20
|
let isLargeOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });
|
|
120
21
|
let isMediumOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });
|
|
121
|
-
const isViewPortMediumOrAbove = useBreakpoint('md');
|
|
122
22
|
if (forceMobile) {
|
|
23
|
+
isExtraLargeOrAbove = false;
|
|
123
24
|
isLargeOrAbove = false;
|
|
124
25
|
isMediumOrAbove = false;
|
|
125
26
|
}
|
|
27
|
+
const { headerEl } = useContext(AppShellContext);
|
|
28
|
+
const [summaryAnimationState, setSummaryAnimationState] = useState('expanded');
|
|
126
29
|
const summaryTabId = `summary-${caseId}`;
|
|
127
30
|
const utilitiesTabId = `utilities-${caseId}`;
|
|
128
31
|
const persistentUtilityTabId = `persistent-utility-${caseId}`;
|
|
129
|
-
const [utilitiesShown, setUtilitiesShown] = useState(isLargeOrAbove);
|
|
130
|
-
const
|
|
32
|
+
const [utilitiesShown, setUtilitiesShown] = useState(isLargeOrAbove && !defaultCollapsedUtilities);
|
|
33
|
+
const initialUserUtilState = defaultCollapsedUtilities ? 'hidden' : undefined;
|
|
34
|
+
const [userUtilState, setUserUtilState] = useState(initialUserUtilState);
|
|
35
|
+
const [summaryPanelCollapsed, setSummaryPanelCollapsed] = useState(false);
|
|
131
36
|
const hasSideBySideColumns = isMediumOrAbove;
|
|
132
37
|
const scrollStickOptions = useRef({
|
|
133
38
|
elements: []
|
|
134
39
|
});
|
|
135
|
-
|
|
40
|
+
const getOffsets = () => {
|
|
41
|
+
const appshellHeaderHeight = headerEl?.offsetHeight || 0;
|
|
42
|
+
const summaryHeight = !isMediumOrAbove || (persistentUtility && !isExtraLargeOrAbove) || summaryPanelCollapsed
|
|
43
|
+
? caseViewSummaryRef?.current?.offsetHeight || 0
|
|
44
|
+
: 0;
|
|
45
|
+
return {
|
|
46
|
+
sticky: appshellHeaderHeight + summaryHeight,
|
|
47
|
+
summary: summaryHeight
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
const [offsets, setOffsets] = useState(getOffsets);
|
|
51
|
+
useScrollStick(hasSideBySideColumns ? { ...scrollStickOptions.current, offset: offsets.sticky } : undefined);
|
|
136
52
|
const toggleUtilities = useCallback((e) => {
|
|
137
53
|
if (e.type === 'keydown' && e.key !== 'Enter') {
|
|
138
54
|
return;
|
|
@@ -142,6 +58,9 @@ const CaseView = (props) => {
|
|
|
142
58
|
return !shown;
|
|
143
59
|
});
|
|
144
60
|
}, []);
|
|
61
|
+
useLayoutEffect(() => {
|
|
62
|
+
setOffsets(getOffsets());
|
|
63
|
+
}, [isExtraLargeOrAbove, isLargeOrAbove, isMediumOrAbove, headerEl, summaryPanelCollapsed]);
|
|
145
64
|
useEffect(() => {
|
|
146
65
|
if (isLargeOrAbove) {
|
|
147
66
|
setUtilitiesShown(userUtilState !== 'hidden');
|
|
@@ -151,51 +70,88 @@ const CaseView = (props) => {
|
|
|
151
70
|
}
|
|
152
71
|
}, [isLargeOrAbove]);
|
|
153
72
|
useEffect(() => {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
73
|
+
if (isMediumOrAbove &&
|
|
74
|
+
!summaryPanelCollapsed &&
|
|
75
|
+
!persistentUtility &&
|
|
76
|
+
(currentTabId === summaryTabId || currentTabId === utilitiesTabId)) {
|
|
77
|
+
onTabClick(tabItemsProp[0]?.id);
|
|
158
78
|
}
|
|
159
|
-
}, [
|
|
79
|
+
}, [
|
|
80
|
+
isMediumOrAbove,
|
|
81
|
+
onTabClick,
|
|
82
|
+
currentTabId,
|
|
83
|
+
summaryTabId,
|
|
84
|
+
utilitiesTabId,
|
|
85
|
+
summaryPanelCollapsed
|
|
86
|
+
]);
|
|
160
87
|
useEffect(() => {
|
|
161
|
-
if (isMediumOrAbove && !isLargeOrAbove && utilities)
|
|
88
|
+
if ((isMediumOrAbove && !isLargeOrAbove && utilities) || persistentUtility)
|
|
162
89
|
setUtilitiesShown(false);
|
|
163
90
|
}, [isMediumOrAbove, utilities]);
|
|
164
91
|
useEffect(() => {
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
169
|
-
}, [isViewPortMediumOrAbove, persistentUtility]);
|
|
92
|
+
if (persistentUtility && currentTabId === persistentUtilityTabId)
|
|
93
|
+
onTabClick(summaryTabId);
|
|
94
|
+
}, [persistentUtility]);
|
|
170
95
|
const tabItems = useMemo(() => {
|
|
96
|
+
const summaryTab = { id: summaryTabId, name: 'Summary' };
|
|
171
97
|
if (isMediumOrAbove)
|
|
172
|
-
return
|
|
98
|
+
return summaryPanelCollapsed || (persistentUtility && !isExtraLargeOrAbove)
|
|
99
|
+
? [summaryTab, ...tabItemsProp]
|
|
100
|
+
: tabItemsProp;
|
|
173
101
|
const utilityTabs = [];
|
|
174
102
|
if (utilities)
|
|
175
103
|
utilityTabs.push({ id: utilitiesTabId, name: 'Utilities' });
|
|
176
|
-
if (persistentUtility && !
|
|
104
|
+
if (persistentUtility && !isMediumOrAbove)
|
|
177
105
|
utilityTabs.push({ id: persistentUtilityTabId, name: persistentUtility.title });
|
|
178
|
-
return [
|
|
106
|
+
return [summaryTab, ...tabItemsProp, ...utilityTabs];
|
|
179
107
|
}, [
|
|
180
108
|
isMediumOrAbove,
|
|
181
|
-
|
|
109
|
+
isExtraLargeOrAbove,
|
|
182
110
|
summaryTabId,
|
|
183
111
|
utilitiesTabId,
|
|
184
112
|
persistentUtilityTabId,
|
|
185
113
|
utilities,
|
|
186
114
|
persistentUtility,
|
|
187
|
-
tabItemsProp
|
|
115
|
+
tabItemsProp,
|
|
116
|
+
summaryPanelCollapsed
|
|
188
117
|
]);
|
|
189
|
-
|
|
190
|
-
if (
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (!tabContentEl)
|
|
120
|
+
return;
|
|
121
|
+
const scrollPos = window.scrollY;
|
|
122
|
+
const windowHeight = document.documentElement.clientHeight;
|
|
123
|
+
const bottomPos = scrollPos + windowHeight * 0.8;
|
|
124
|
+
const tabContentPos = tabContentEl.offsetTop;
|
|
125
|
+
if (tabContentPos > bottomPos) {
|
|
126
|
+
const top = tabContentPos - windowHeight * 0.2;
|
|
127
|
+
window.scrollTo({ top, behavior: 'smooth' });
|
|
194
128
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
129
|
+
}, [currentTabId]);
|
|
130
|
+
const tabContent = useMemo(() => {
|
|
131
|
+
const summaryTabContent = { id: summaryTabId, content: _jsx(Card, { children: summary }, void 0) };
|
|
132
|
+
if (isMediumOrAbove)
|
|
133
|
+
return summaryPanelCollapsed || (persistentUtility && !isExtraLargeOrAbove)
|
|
134
|
+
? [summaryTabContent, ...tabContentProp]
|
|
135
|
+
: tabContentProp;
|
|
136
|
+
const utilityTabs = [];
|
|
137
|
+
if (utilities)
|
|
138
|
+
utilityTabs.push({
|
|
139
|
+
id: utilitiesTabId,
|
|
140
|
+
content: _jsx(Flex, { container: { direction: 'column', gap: 2 }, children: utilities }, void 0)
|
|
141
|
+
});
|
|
142
|
+
if (persistentUtility)
|
|
143
|
+
utilityTabs.push({ id: persistentUtilityTabId, content: persistentUtility?.content });
|
|
144
|
+
return [summaryTabContent, ...tabContentProp, ...utilityTabs];
|
|
145
|
+
}, [
|
|
146
|
+
currentTabId,
|
|
147
|
+
tabContentProp,
|
|
148
|
+
summary,
|
|
149
|
+
summaryTabId,
|
|
150
|
+
utilities,
|
|
151
|
+
utilitiesTabId,
|
|
152
|
+
isMediumOrAbove,
|
|
153
|
+
isExtraLargeOrAbove
|
|
154
|
+
]);
|
|
199
155
|
const direction = useDirection();
|
|
200
156
|
const utilitiesIcon = utilitiesShown
|
|
201
157
|
? `move-${direction.end}-solid`
|
|
@@ -206,57 +162,98 @@ const CaseView = (props) => {
|
|
|
206
162
|
rows: 'minmax(0, max-content) auto',
|
|
207
163
|
areas: '"case-nav" "content"'
|
|
208
164
|
};
|
|
209
|
-
|
|
210
|
-
|
|
165
|
+
let fixedSummaryWidth = '100%';
|
|
166
|
+
if (!forceMobile && !persistentUtility && !summaryPanelCollapsed) {
|
|
167
|
+
fixedSummaryWidth = isLargeOrAbove ? '25rem' : '22rem';
|
|
168
|
+
if (isLargeOrAbove || isMediumOrAbove) {
|
|
211
169
|
caseViewGridContainer = {
|
|
212
|
-
cols: '
|
|
170
|
+
cols: 'minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content)',
|
|
213
171
|
colGap: 2,
|
|
214
|
-
rows:
|
|
172
|
+
rows: caseViewGridContainer.rows,
|
|
215
173
|
areas: '"case-nav content utilities"'
|
|
216
174
|
};
|
|
217
175
|
}
|
|
218
|
-
|
|
176
|
+
}
|
|
177
|
+
else if (summaryPanelCollapsed) {
|
|
178
|
+
if (isLargeOrAbove || isMediumOrAbove) {
|
|
219
179
|
caseViewGridContainer = {
|
|
220
|
-
cols: '
|
|
180
|
+
cols: 'minmax(0, 1fr) minmax(0, max-content)',
|
|
221
181
|
colGap: 2,
|
|
222
|
-
rows:
|
|
223
|
-
areas: '"case-nav content utilities"'
|
|
182
|
+
rows: caseViewGridContainer.rows,
|
|
183
|
+
areas: '"case-nav case-nav" "content utilities"'
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else if (persistentUtility) {
|
|
188
|
+
if (isExtraLargeOrAbove) {
|
|
189
|
+
fixedSummaryWidth = '25rem';
|
|
190
|
+
caseViewGridContainer = {
|
|
191
|
+
cols: 'minmax(0, max-content) minmax(0, 1fr) repeat(2, minmax(0, max-content))',
|
|
192
|
+
colGap: 2,
|
|
193
|
+
rows: caseViewGridContainer.rows,
|
|
194
|
+
areas: '"case-nav content persistentUtility utilities"'
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
else if (isLargeOrAbove || isMediumOrAbove) {
|
|
198
|
+
caseViewGridContainer = {
|
|
199
|
+
cols: 'minmax(0, 1fr) repeat(2, minmax(0, max-content))',
|
|
200
|
+
colGap: 2,
|
|
201
|
+
rows: caseViewGridContainer.rows,
|
|
202
|
+
areas: '"case-nav case-nav case-nav" "content persistentUtility utilities"'
|
|
224
203
|
};
|
|
225
204
|
}
|
|
226
205
|
}
|
|
227
|
-
|
|
206
|
+
const animateSummaryPanel = (type) => {
|
|
207
|
+
if (type === 'close') {
|
|
208
|
+
const animation = [{ width: fixedSummaryWidth }, { width: 0 }];
|
|
209
|
+
caseViewSummaryContainerRef.current?.animate(animation, 250);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
const animation = [{ width: 0 }, { width: isLargeOrAbove ? '25rem' : '22rem' }];
|
|
213
|
+
caseViewSummaryContainerRef.current?.animate(animation, 250);
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
return (_jsxs(Grid, { as: StyledCaseView, stickyOffset: offsets.sticky, ref: caseViewRef, container: caseViewGridContainer, item: { area: 'caseView' }, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove, ...restProps, children: [_jsx(Grid, { as: StyledSummaryRegion, item: { area: 'case-nav' }, forceMobile: forceMobile, desktop: isMediumOrAbove && (!persistentUtility || isExtraLargeOrAbove) && !summaryPanelCollapsed, isLargeOrAbove: isLargeOrAbove, ref: caseViewSummaryContainerRef, style: ['collapsing', 'expanding'].includes(summaryAnimationState)
|
|
217
|
+
? {
|
|
218
|
+
overflow: 'hidden'
|
|
219
|
+
}
|
|
220
|
+
: undefined, children: _jsx(CaseSummary, { ref: caseViewSummaryRef, headerRef: caseSummaryHeaderRef, caseId: caseId, heading: heading, caseLink: caseLink, icon: icon, followed: followed, onFollowedChange: onFollowedChange, parentCases: parentCases, summary: summary, actions: actions, onEdit: onEdit, tabs: {
|
|
228
221
|
items: tabItems,
|
|
229
222
|
onClick: onTabClick,
|
|
230
223
|
currentTabId
|
|
231
|
-
}, forceMobile: forceMobile,
|
|
232
|
-
|
|
224
|
+
}, forceMobile: forceMobile, desktop: ((isMediumOrAbove && !persistentUtility) || isExtraLargeOrAbove) &&
|
|
225
|
+
!summaryPanelCollapsed, fixedWidth: isMediumOrAbove ? fixedSummaryWidth : undefined, collapsible: isMediumOrAbove && !persistentUtility, collapsed: summaryPanelCollapsed, onBeforeCollapse: () => {
|
|
226
|
+
animateSummaryPanel('close');
|
|
227
|
+
}, onAfterCollapse: () => setSummaryPanelCollapsed(true), onBeforeExpand: () => {
|
|
228
|
+
animateSummaryPanel('open');
|
|
229
|
+
setSummaryPanelCollapsed(false);
|
|
230
|
+
}, onAnimationStateChange: setSummaryAnimationState }, void 0) }, void 0), _jsxs(Grid, { container: {
|
|
233
231
|
cols: 'minmax(0, 1fr)',
|
|
234
232
|
alignContent: 'start',
|
|
235
233
|
rowGap: 2
|
|
236
|
-
}, item: { area: 'content' }, as: StyledCaseViewContent, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
234
|
+
}, item: { area: 'content' }, as: StyledCaseViewContent, forceMobile: forceMobile, isMediumOrAbove: isMediumOrAbove, persistentUtility: Boolean(persistentUtility), style: {
|
|
235
|
+
transform: ['collapsing', 'expanding'].includes(summaryAnimationState)
|
|
236
|
+
? `translate(0, ${caseSummaryHeaderRef.current?.offsetHeight}px) `
|
|
237
|
+
: undefined,
|
|
238
|
+
marginInlineStart: (summaryPanelCollapsed && isMediumOrAbove) ||
|
|
239
|
+
(persistentUtility && !isExtraLargeOrAbove)
|
|
240
|
+
? '1rem'
|
|
241
|
+
: 0
|
|
242
|
+
}, children: [banners && _jsx("div", { children: banners }, void 0), stages && _jsx("div", { children: stages }, void 0), tasks && _jsx("div", { children: tasks }, void 0), (!isMediumOrAbove ||
|
|
243
|
+
(persistentUtility && !isExtraLargeOrAbove) ||
|
|
244
|
+
summaryPanelCollapsed) && (_jsx(StyledMobileTabs, { type: 'horizontal', tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId }, void 0)), _jsx("div", { ref: setTabContentEl, children: tabContent?.map(({ id, content }) => (_jsx(TabPanel, { currentTabId: currentTabId, tabId: id, children: content }, id))) }, void 0)] }, void 0), persistentUtility && isMediumOrAbove && (_jsx(Grid, { as: StyledPersistentUtility, item: { area: 'persistentUtility' }, children: persistentUtility.content }, void 0)), !isLargeOrAbove && (_jsx(Drawer, { as: StyledCaseDrawer, open: utilitiesShown && isMediumOrAbove, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility, children: _jsxs(Flex, { as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 }, children: [_jsx(Flex, { container: { justify: 'end' }, children: _jsx(Button, { variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t('collapse_utilities_panel'), children: _jsx(Icon, { name: `move-${direction.end}-solid` }, void 0) }, void 0) }, void 0), utilities] }, void 0) }, void 0)), utilities && isMediumOrAbove && (_jsxs(Grid, { ref: (el) => {
|
|
246
245
|
if (el)
|
|
247
|
-
(
|
|
246
|
+
(scrollStickOptions.current?.elements).push(el);
|
|
248
247
|
}, as: StyledCaseViewUtilities, container: {
|
|
249
248
|
cols: 'minmax(0, 1fr)',
|
|
250
249
|
rowGap: 2
|
|
251
250
|
}, item: {
|
|
252
251
|
area: 'utilities'
|
|
253
|
-
}, utilitiesShown: utilitiesShown && isLargeOrAbove
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
}, container: utilitiesShown && isLargeOrAbove ? { direction: 'column', gap: 2 } : false, hidden: !utilitiesShown || !isLargeOrAbove }, { children: utilities }), void 0),
|
|
259
|
-
(!utilitiesShown || (isMediumOrAbove && !isLargeOrAbove)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems || [], onClick: toggleUtilities, onKeyDown: toggleUtilities }, void 0))] }), void 0))] }), void 0));
|
|
252
|
+
}, utilitiesShown: utilitiesShown && isLargeOrAbove, style: ['collapsing', 'expanding'].includes(summaryAnimationState)
|
|
253
|
+
? {
|
|
254
|
+
transform: `translate(0, ${caseSummaryHeaderRef.current?.offsetHeight}px) `
|
|
255
|
+
}
|
|
256
|
+
: undefined, children: [_jsx(Flex, { container: { justify: utilitiesShown ? 'end' : 'center' }, children: _jsx(Button, { variant: 'simple', icon: true, onClick: toggleUtilities, as: StyledUtilToggle, label: t(utilitiesShown ? 'collapse_utilities_panel' : 'expand_utilities_panel'), children: _jsx(Icon, { name: utilitiesIcon }, void 0) }, void 0) }, void 0), _jsx(Flex, { container: utilitiesShown && isLargeOrAbove ? { direction: 'column', gap: 2 } : undefined, hidden: !utilitiesShown || !isLargeOrAbove, children: utilities }, void 0), (!utilitiesShown || (isMediumOrAbove && !isLargeOrAbove)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems || [], onClick: toggleUtilities, onKeyDown: toggleUtilities }, void 0))] }, void 0))] }, void 0));
|
|
260
257
|
};
|
|
261
258
|
export default CaseView;
|
|
262
259
|
//# sourceMappingURL=CaseView.js.map
|