@pega/cosmos-react-work 5.0.0-dev.4.9 → 5.0.0-dev.6.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 +23 -0
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -0
- package/lib/components/AppAnnouncement/AppAnnouncement.js +93 -0
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -0
- package/lib/components/AppAnnouncement/index.d.ts +3 -0
- package/lib/components/AppAnnouncement/index.d.ts.map +1 -0
- package/lib/components/AppAnnouncement/index.js +2 -0
- package/lib/components/AppAnnouncement/index.js.map +1 -0
- package/lib/components/Article/Article.d.ts +60 -0
- package/lib/components/Article/Article.d.ts.map +1 -0
- package/lib/components/Article/Article.js +87 -0
- package/lib/components/Article/Article.js.map +1 -0
- package/lib/components/Article/ArticleFooter.d.ts +38 -0
- package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
- package/lib/components/Article/ArticleFooter.js +58 -0
- package/lib/components/Article/ArticleFooter.js.map +1 -0
- package/lib/components/Article/ArticleMeta.d.ts +13 -0
- package/lib/components/Article/ArticleMeta.d.ts.map +1 -0
- package/lib/components/Article/ArticleMeta.js +27 -0
- package/lib/components/Article/ArticleMeta.js.map +1 -0
- package/lib/components/Article/ArticleRating.d.ts +13 -0
- package/lib/components/Article/ArticleRating.d.ts.map +1 -0
- package/lib/components/Article/ArticleRating.js +43 -0
- package/lib/components/Article/ArticleRating.js.map +1 -0
- package/lib/components/Article/index.d.ts +7 -0
- package/lib/components/Article/index.d.ts.map +1 -0
- package/lib/components/Article/index.js +4 -0
- package/lib/components/Article/index.js.map +1 -0
- package/lib/components/ArticleList/ArticleBuddy.d.ts +9 -0
- package/lib/components/ArticleList/ArticleBuddy.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleBuddy.js +57 -0
- package/lib/components/ArticleList/ArticleBuddy.js.map +1 -0
- package/lib/components/ArticleList/ArticleList.d.ts +6 -0
- package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.js +146 -0
- package/lib/components/ArticleList/ArticleList.js.map +1 -0
- package/lib/components/ArticleList/ArticleList.types.d.ts +128 -0
- package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.types.js +7 -0
- package/lib/components/ArticleList/ArticleList.types.js.map +1 -0
- package/lib/components/ArticleList/ArticleListFilter.d.ts +6 -0
- package/lib/components/ArticleList/ArticleListFilter.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleListFilter.js +67 -0
- package/lib/components/ArticleList/ArticleListFilter.js.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts +5 -0
- package/lib/components/ArticleList/ArticleListHeader.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleListHeader.js +20 -0
- package/lib/components/ArticleList/ArticleListHeader.js.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts +7 -0
- package/lib/components/ArticleList/ArticleSummary.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleSummary.js +63 -0
- package/lib/components/ArticleList/ArticleSummary.js.map +1 -0
- package/lib/components/ArticleList/index.d.ts +8 -0
- package/lib/components/ArticleList/index.d.ts.map +1 -0
- package/lib/components/ArticleList/index.js +5 -0
- package/lib/components/ArticleList/index.js.map +1 -0
- package/lib/components/Assignments/Assignments.d.ts +21 -0
- package/lib/components/Assignments/Assignments.d.ts.map +1 -0
- package/lib/components/Assignments/Assignments.js +20 -0
- package/lib/components/Assignments/Assignments.js.map +1 -0
- package/lib/components/Assignments/Assignments.styles.d.ts +8 -0
- package/lib/components/Assignments/Assignments.styles.d.ts.map +1 -0
- package/lib/components/Assignments/Assignments.styles.js +41 -0
- package/lib/components/Assignments/Assignments.styles.js.map +1 -0
- package/lib/components/Assignments/index.d.ts +3 -0
- package/lib/components/Assignments/index.d.ts.map +1 -0
- package/lib/components/Assignments/index.js +2 -0
- package/lib/components/Assignments/index.js.map +1 -0
- package/lib/components/CasePreview/CasePreview.d.ts +27 -0
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -0
- package/lib/components/CasePreview/CasePreview.js +82 -0
- package/lib/components/CasePreview/CasePreview.js.map +1 -0
- package/lib/components/CasePreview/CasePreview.test-ids.d.ts +2 -0
- package/lib/components/CasePreview/CasePreview.test-ids.d.ts.map +1 -0
- package/lib/components/CasePreview/CasePreview.test-ids.js +3 -0
- package/lib/components/CasePreview/CasePreview.test-ids.js.map +1 -0
- package/lib/components/CasePreview/index.d.ts +3 -0
- package/lib/components/CasePreview/index.d.ts.map +1 -0
- package/lib/components/CasePreview/index.js +2 -0
- package/lib/components/CasePreview/index.js.map +1 -0
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts +4 -0
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
- package/lib/components/CaseView/CaseHeader/CaseHeader.js +127 -0
- package/lib/components/CaseView/CaseHeader/CaseHeader.js.map +1 -0
- package/lib/components/CaseView/CaseHeader/Summary.d.ts +6 -0
- package/lib/components/CaseView/CaseHeader/Summary.d.ts.map +1 -0
- package/lib/components/CaseView/CaseHeader/Summary.js +182 -0
- package/lib/components/CaseView/CaseHeader/Summary.js.map +1 -0
- package/lib/components/CaseView/CaseSummary.d.ts +4 -0
- package/lib/components/CaseView/CaseSummary.d.ts.map +1 -0
- package/lib/components/CaseView/CaseSummary.js +18 -0
- package/lib/components/CaseView/CaseSummary.js.map +1 -0
- package/lib/components/CaseView/CaseSummaryFields.d.ts +6 -0
- package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -0
- package/lib/components/CaseView/CaseSummaryFields.js +18 -0
- package/lib/components/CaseView/CaseSummaryFields.js.map +1 -0
- package/lib/components/CaseView/CaseView.context.d.ts +5 -0
- package/lib/components/CaseView/CaseView.context.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.context.js +5 -0
- package/lib/components/CaseView/CaseView.context.js.map +1 -0
- package/lib/components/CaseView/CaseView.d.ts +8 -0
- package/lib/components/CaseView/CaseView.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.js +421 -0
- package/lib/components/CaseView/CaseView.js.map +1 -0
- package/lib/components/CaseView/CaseView.styles.d.ts +45 -0
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.styles.js +559 -0
- package/lib/components/CaseView/CaseView.styles.js.map +1 -0
- package/lib/components/CaseView/CaseView.test-ids.d.ts +2 -0
- package/lib/components/CaseView/CaseView.test-ids.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.test-ids.js +18 -0
- package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
- package/lib/components/CaseView/CaseView.types.d.ts +98 -0
- package/lib/components/CaseView/CaseView.types.d.ts.map +1 -0
- package/lib/components/CaseView/CaseView.types.js +2 -0
- package/lib/components/CaseView/CaseView.types.js.map +1 -0
- package/lib/components/CaseView/UtilitiesSummary.d.ts +9 -0
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -0
- package/lib/components/CaseView/UtilitiesSummary.js +53 -0
- package/lib/components/CaseView/UtilitiesSummary.js.map +1 -0
- package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts +9 -0
- package/lib/components/CaseView/UtilitySummaryItemDialog.d.ts.map +1 -0
- package/lib/components/CaseView/UtilitySummaryItemDialog.js +33 -0
- package/lib/components/CaseView/UtilitySummaryItemDialog.js.map +1 -0
- package/lib/components/CaseView/index.d.ts +5 -0
- package/lib/components/CaseView/index.d.ts.map +1 -0
- package/lib/components/CaseView/index.js +4 -0
- package/lib/components/CaseView/index.js.map +1 -0
- 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 +86 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -0
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +41 -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 +4 -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 +29 -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 +43 -0
- package/lib/components/Details/Details.d.ts.map +1 -0
- package/lib/components/Details/Details.js +95 -0
- package/lib/components/Details/Details.js.map +1 -0
- package/lib/components/Details/Details.styles.d.ts +50 -0
- package/lib/components/Details/Details.styles.d.ts.map +1 -0
- package/lib/components/Details/Details.styles.js +204 -0
- package/lib/components/Details/Details.styles.js.map +1 -0
- package/lib/components/Details/Details.test-ids.d.ts +2 -0
- package/lib/components/Details/Details.test-ids.d.ts.map +1 -0
- package/lib/components/Details/Details.test-ids.js +9 -0
- package/lib/components/Details/Details.test-ids.js.map +1 -0
- package/lib/components/Details/DetailsContext.d.ts +9 -0
- package/lib/components/Details/DetailsContext.d.ts.map +1 -0
- package/lib/components/Details/DetailsContext.js +9 -0
- package/lib/components/Details/DetailsContext.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 +4 -0
- package/lib/components/Details/index.js.map +1 -0
- package/lib/components/Glimpse/Glimpse.d.ts +20 -0
- package/lib/components/Glimpse/Glimpse.d.ts.map +1 -0
- package/lib/components/Glimpse/Glimpse.js +12 -0
- package/lib/components/Glimpse/Glimpse.js.map +1 -0
- package/lib/components/Glimpse/index.d.ts +3 -0
- package/lib/components/Glimpse/index.d.ts.map +1 -0
- package/lib/components/Glimpse/index.js +2 -0
- package/lib/components/Glimpse/index.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts +6 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js +83 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +9 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +199 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +35 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js +2 -0
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -0
- package/lib/components/IntelligentGuidance/index.d.ts +3 -0
- package/lib/components/IntelligentGuidance/index.d.ts.map +1 -0
- package/lib/components/IntelligentGuidance/index.js +2 -0
- package/lib/components/IntelligentGuidance/index.js.map +1 -0
- package/lib/components/Predictions/Predictions.d.ts +6 -0
- package/lib/components/Predictions/Predictions.d.ts.map +1 -0
- package/lib/components/Predictions/Predictions.js +68 -0
- package/lib/components/Predictions/Predictions.js.map +1 -0
- package/lib/components/Predictions/Predictions.types.d.ts +23 -0
- package/lib/components/Predictions/Predictions.types.d.ts.map +1 -0
- package/lib/components/Predictions/Predictions.types.js +2 -0
- package/lib/components/Predictions/Predictions.types.js.map +1 -0
- package/lib/components/Predictions/index.d.ts +3 -0
- package/lib/components/Predictions/index.d.ts.map +1 -0
- package/lib/components/Predictions/index.js +2 -0
- package/lib/components/Predictions/index.js.map +1 -0
- package/lib/components/SearchResults/Filter.d.ts +8 -0
- package/lib/components/SearchResults/Filter.d.ts.map +1 -0
- package/lib/components/SearchResults/Filter.js +45 -0
- package/lib/components/SearchResults/Filter.js.map +1 -0
- package/lib/components/SearchResults/SearchResult.d.ts +4 -0
- package/lib/components/SearchResults/SearchResult.d.ts.map +1 -0
- package/lib/components/SearchResults/SearchResult.js +27 -0
- package/lib/components/SearchResults/SearchResult.js.map +1 -0
- package/lib/components/SearchResults/SearchResults.d.ts +6 -0
- package/lib/components/SearchResults/SearchResults.d.ts.map +1 -0
- package/lib/components/SearchResults/SearchResults.js +121 -0
- package/lib/components/SearchResults/SearchResults.js.map +1 -0
- package/lib/components/SearchResults/SearchResults.styles.d.ts +11 -0
- package/lib/components/SearchResults/SearchResults.styles.d.ts.map +1 -0
- package/lib/components/SearchResults/SearchResults.styles.js +88 -0
- package/lib/components/SearchResults/SearchResults.styles.js.map +1 -0
- package/lib/components/SearchResults/SearchResults.types.d.ts +100 -0
- package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -0
- package/lib/components/SearchResults/SearchResults.types.js +2 -0
- package/lib/components/SearchResults/SearchResults.types.js.map +1 -0
- package/lib/components/SearchResults/index.d.ts +3 -0
- package/lib/components/SearchResults/index.d.ts.map +1 -0
- package/lib/components/SearchResults/index.js +2 -0
- package/lib/components/SearchResults/index.js.map +1 -0
- package/lib/components/Stages/StageGlimpse.d.ts +8 -0
- package/lib/components/Stages/StageGlimpse.d.ts.map +1 -0
- package/lib/components/Stages/StageGlimpse.js +11 -0
- package/lib/components/Stages/StageGlimpse.js.map +1 -0
- package/lib/components/Stages/Stages.d.ts +6 -0
- package/lib/components/Stages/Stages.d.ts.map +1 -0
- package/lib/components/Stages/Stages.js +107 -0
- package/lib/components/Stages/Stages.js.map +1 -0
- package/lib/components/Stages/Stages.styles.d.ts +14 -0
- package/lib/components/Stages/Stages.styles.d.ts.map +1 -0
- package/lib/components/Stages/Stages.styles.js +270 -0
- package/lib/components/Stages/Stages.styles.js.map +1 -0
- package/lib/components/Stages/Stages.types.d.ts +38 -0
- package/lib/components/Stages/Stages.types.d.ts.map +1 -0
- package/lib/components/Stages/Stages.types.js +2 -0
- package/lib/components/Stages/Stages.types.js.map +1 -0
- package/lib/components/Stages/index.d.ts +3 -0
- package/lib/components/Stages/index.d.ts.map +1 -0
- package/lib/components/Stages/index.js +2 -0
- package/lib/components/Stages/index.js.map +1 -0
- 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 +220 -0
- package/lib/components/Stakeholders/Stakeholders.js.map +1 -0
- package/lib/components/Stakeholders/Stakeholders.types.d.ts +75 -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 +230 -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 +39 -0
- package/lib/components/Tasks/TaskList.d.ts.map +1 -0
- package/lib/components/Tasks/TaskList.js +71 -0
- package/lib/components/Tasks/TaskList.js.map +1 -0
- package/lib/components/Tasks/Tasks.d.ts +29 -0
- package/lib/components/Tasks/Tasks.d.ts.map +1 -0
- package/lib/components/Tasks/Tasks.js +52 -0
- package/lib/components/Tasks/Tasks.js.map +1 -0
- package/lib/components/Tasks/Tasks.test-ids.d.ts +4 -0
- package/lib/components/Tasks/Tasks.test-ids.d.ts.map +1 -0
- package/lib/components/Tasks/Tasks.test-ids.js +5 -0
- package/lib/components/Tasks/Tasks.test-ids.js.map +1 -0
- package/lib/components/Tasks/index.d.ts +6 -0
- package/lib/components/Tasks/index.d.ts.map +1 -0
- package/lib/components/Tasks/index.js +4 -0
- package/lib/components/Tasks/index.js.map +1 -0
- package/lib/components/Timeline/Timeline.d.ts +6 -0
- package/lib/components/Timeline/Timeline.d.ts.map +1 -0
- package/lib/components/Timeline/Timeline.js +26 -0
- package/lib/components/Timeline/Timeline.js.map +1 -0
- package/lib/components/Timeline/Timeline.styles.d.ts +21 -0
- package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -0
- package/lib/components/Timeline/Timeline.styles.js +165 -0
- package/lib/components/Timeline/Timeline.styles.js.map +1 -0
- package/lib/components/Timeline/Timeline.types.d.ts +66 -0
- package/lib/components/Timeline/Timeline.types.d.ts.map +1 -0
- package/lib/components/Timeline/Timeline.types.js +2 -0
- package/lib/components/Timeline/Timeline.types.js.map +1 -0
- package/lib/components/Timeline/TimelineItem.d.ts +13 -0
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -0
- package/lib/components/Timeline/TimelineItem.js +33 -0
- package/lib/components/Timeline/TimelineItem.js.map +1 -0
- package/lib/components/Timeline/TimelineToolbar.d.ts +6 -0
- package/lib/components/Timeline/TimelineToolbar.d.ts.map +1 -0
- package/lib/components/Timeline/TimelineToolbar.js +68 -0
- package/lib/components/Timeline/TimelineToolbar.js.map +1 -0
- package/lib/components/Timeline/index.d.ts +4 -0
- package/lib/components/Timeline/index.d.ts.map +1 -0
- package/lib/components/Timeline/index.js +3 -0
- package/lib/components/Timeline/index.js.map +1 -0
- package/lib/components/Timeline/utils.d.ts +15 -0
- package/lib/components/Timeline/utils.d.ts.map +1 -0
- package/lib/components/Timeline/utils.js +75 -0
- package/lib/components/Timeline/utils.js.map +1 -0
- package/lib/index.d.ts +37 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +38 -0
- package/lib/index.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useLayoutEffect, useState } from 'react';
|
|
3
|
+
import { Flex, Grid, Icon, registerIcon, TabPanel, useBreakpoint, useScrollStick, useElement, Card, Drawer, useI18n, useDirection, Tabs, useAfterInitialEffect, windowIsAvailable, focusHeadingOrContainer, useConfiguration, useTestIds, withTestIds } from '@pega/cosmos-react-core';
|
|
4
|
+
import * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';
|
|
5
|
+
import * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';
|
|
6
|
+
import CaseSummary from './CaseSummary';
|
|
7
|
+
import UtilitiesSummary from './UtilitiesSummary';
|
|
8
|
+
import { StyledCaseDrawer, StyledCaseDrawerContent, StyledCaseView, StyledWorkArea, StyledPersistentUtility, StyledSummary, StyledSummaryTabContent, StyledUtilities, StyledExpandCollapseUtilitiesButton, StyledUtilitiesHeading } from './CaseView.styles';
|
|
9
|
+
import CaseViewContext from './CaseView.context';
|
|
10
|
+
import CaseSummaryFields from './CaseSummaryFields';
|
|
11
|
+
import { getCaseViewTestIds } from './CaseView.test-ids';
|
|
12
|
+
registerIcon(moveRightSolidIcon, moveLeftSolidIcon);
|
|
13
|
+
// This function is responsible for auto sizing table height in case tab panels.
|
|
14
|
+
const resizeTable = (tabPanelEl, workAreaEl) => {
|
|
15
|
+
tabPanelEl.style.removeProperty('--content-height-in-view');
|
|
16
|
+
// .rs-wrapper is currently the class used by the table component which needs to be targeted.
|
|
17
|
+
const tables = Array.from(tabPanelEl.querySelectorAll('.rs-wrapper')).filter(table => table.getBoundingClientRect().width !== 0);
|
|
18
|
+
// Only perform this logic when there is a single table in a tab's panel.
|
|
19
|
+
if (tables.length !== 1)
|
|
20
|
+
return;
|
|
21
|
+
// This selector finds the table's root element as they are always wrapped in a Card.
|
|
22
|
+
const table = tables[0].closest('article');
|
|
23
|
+
if (!table)
|
|
24
|
+
return;
|
|
25
|
+
const tabPanelRect = tabPanelEl.getBoundingClientRect();
|
|
26
|
+
const tableRect = table.getBoundingClientRect();
|
|
27
|
+
const vpHeight = document.documentElement.clientHeight;
|
|
28
|
+
const tableRectOffsetTop = tableRect.top + window.scrollY;
|
|
29
|
+
const workAreaPaddingBlockEnd =
|
|
30
|
+
// px unit are required for proper CSS calc calculation.
|
|
31
|
+
window.getComputedStyle(workAreaEl).getPropertyValue('padding-block-end') || '0px';
|
|
32
|
+
// Accounts for content rendered after the table.
|
|
33
|
+
const tableBottomToTabPanelBottom = tabPanelRect.bottom - tableRect.bottom;
|
|
34
|
+
// Sets a CSS variable for available height based on screen size and view state.
|
|
35
|
+
// Defines an available minimum height of ~600px.
|
|
36
|
+
tabPanelEl.style.setProperty('--content-height-in-view', `max(calc(${vpHeight - tableRectOffsetTop - tableBottomToTabPanelBottom}px - ${workAreaPaddingBlockEnd}), 37.5rem)`);
|
|
37
|
+
};
|
|
38
|
+
const CaseView = ({ testId,
|
|
39
|
+
// Case data mostly visually related to the case header
|
|
40
|
+
caseId, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, onEdit, actions, promotedActions,
|
|
41
|
+
// Summary content and state props
|
|
42
|
+
summaryFields, summaryExpanded: summaryExpandedProp = true, onToggleSummary,
|
|
43
|
+
// Case tabs
|
|
44
|
+
tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick },
|
|
45
|
+
// Workarea related content props
|
|
46
|
+
banners, stages, tasks, tabContent: tabContentProp = [],
|
|
47
|
+
// Utilities content and state props
|
|
48
|
+
utilities, utilitiesSummaryItems, utilitiesExpanded: utilitiesExpandedProp = true, onToggleUtilities,
|
|
49
|
+
// Etc...
|
|
50
|
+
persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
51
|
+
const testIds = useTestIds(testId, getCaseViewTestIds);
|
|
52
|
+
// General util hooks
|
|
53
|
+
const t = useI18n();
|
|
54
|
+
const direction = useDirection();
|
|
55
|
+
const { loadedRef } = useConfiguration();
|
|
56
|
+
// Element refs
|
|
57
|
+
const caseViewRef = useRef(null);
|
|
58
|
+
const summaryRef = useRef(null);
|
|
59
|
+
// undefined used to allow ref to be mutable. Element set below in ref callback for scroll stick.
|
|
60
|
+
const workAreaRef = useRef();
|
|
61
|
+
const toggleButtonRef = useRef(null);
|
|
62
|
+
const isToggleButtonFocused = useRef(false);
|
|
63
|
+
// Tab content
|
|
64
|
+
const [tabContentEl, setTabContentEl] = useElement(null);
|
|
65
|
+
// Breakpoint booleans
|
|
66
|
+
const smOrAbove = useBreakpoint('sm');
|
|
67
|
+
const mdOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });
|
|
68
|
+
const lgOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });
|
|
69
|
+
const xlOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });
|
|
70
|
+
// DOM ids
|
|
71
|
+
const initialTabId = tabItemsProp[0]?.id;
|
|
72
|
+
const summaryTabId = `summary-${caseId}`;
|
|
73
|
+
const utilitiesTabId = `utilities-${caseId}`;
|
|
74
|
+
const persistentUtilityTabId = `persistent-utility-${caseId}`;
|
|
75
|
+
// Summary state handling
|
|
76
|
+
let summaryExpanded = !isPreview && !!summaryExpandedProp;
|
|
77
|
+
if (persistentUtility) {
|
|
78
|
+
summaryExpanded = xlOrAbove;
|
|
79
|
+
}
|
|
80
|
+
// Focus heading on initial mount
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
if (!caseViewRef.current)
|
|
83
|
+
return;
|
|
84
|
+
if (loadedRef.current) {
|
|
85
|
+
focusHeadingOrContainer(caseViewRef.current, heading);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
loadedRef.current = true;
|
|
89
|
+
}
|
|
90
|
+
}, [caseId]);
|
|
91
|
+
// Utilities state handling
|
|
92
|
+
// Used in coordination with a layoutEffect below to determine the utilities state on initial render.
|
|
93
|
+
// Attempted with a ref but it did not work. Using state and enforcing a render in addition to the change render for lgOrAbove seems to fix...
|
|
94
|
+
const [obeyUtilitiesExpandedProp, setObeyUtilitiesExpandedProp] = useState(lgOrAbove);
|
|
95
|
+
// Allow the utilitiesExpandedProp to drive the utilities' state after the initial render
|
|
96
|
+
useLayoutEffect(() => {
|
|
97
|
+
if (lgOrAbove)
|
|
98
|
+
setObeyUtilitiesExpandedProp(true);
|
|
99
|
+
}, [lgOrAbove]);
|
|
100
|
+
// Tracks whether a resize forced the onToggleUtilities to close the utilities when it's a drawer
|
|
101
|
+
const utilitiesToggledByResize = useRef(false);
|
|
102
|
+
// If the initial render is within the MD size, where the utility drawer renders, it must begin collapsed
|
|
103
|
+
const utilitiesExpanded = obeyUtilitiesExpandedProp ? utilitiesExpandedProp : false;
|
|
104
|
+
// Handles utilities state based on breakpoint changes.
|
|
105
|
+
useAfterInitialEffect(() => {
|
|
106
|
+
// If we change into the MD breakpoint range and the utilities state is expanded call the toggle prop to collapse it with controlled state
|
|
107
|
+
if (mdOrAbove && !lgOrAbove && utilitiesExpandedProp) {
|
|
108
|
+
onToggleUtilities?.();
|
|
109
|
+
utilitiesToggledByResize.current = true;
|
|
110
|
+
}
|
|
111
|
+
if (lgOrAbove) {
|
|
112
|
+
if (utilitiesToggledByResize.current && !utilitiesExpandedProp) {
|
|
113
|
+
onToggleUtilities?.();
|
|
114
|
+
}
|
|
115
|
+
utilitiesToggledByResize.current = false;
|
|
116
|
+
}
|
|
117
|
+
// Purposely not listing utilitiesExpanded as a dependency as it is not a trigger and will be captured when BPs change
|
|
118
|
+
}, [mdOrAbove, lgOrAbove]);
|
|
119
|
+
// Handles focus of toggle button when toggled in drawer mode and when browser is resized
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (isToggleButtonFocused.current) {
|
|
122
|
+
toggleButtonRef.current?.focus();
|
|
123
|
+
}
|
|
124
|
+
if (!toggleButtonRef.current) {
|
|
125
|
+
// Toggle button is not on DOM.
|
|
126
|
+
isToggleButtonFocused.current = false;
|
|
127
|
+
}
|
|
128
|
+
}, [utilitiesExpanded, mdOrAbove, lgOrAbove]);
|
|
129
|
+
// Prepare tabs
|
|
130
|
+
const [tabItems, tabContent] = useMemo(() => {
|
|
131
|
+
const summaryTab = { id: summaryTabId, name: t('summary') };
|
|
132
|
+
const summaryTabContent = {
|
|
133
|
+
id: summaryTabId,
|
|
134
|
+
content: (_jsx(Card, { children: _jsx(StyledSummaryTabContent, { children: _jsx(CaseSummaryFields, { ...summaryFields }) }) }))
|
|
135
|
+
};
|
|
136
|
+
let items = tabItemsProp;
|
|
137
|
+
let content = tabContentProp;
|
|
138
|
+
if (mdOrAbove) {
|
|
139
|
+
if (!summaryExpanded || (persistentUtility && !xlOrAbove)) {
|
|
140
|
+
items = [summaryTab, ...tabItemsProp];
|
|
141
|
+
content = [summaryTabContent, ...tabContentProp];
|
|
142
|
+
}
|
|
143
|
+
return [items, content];
|
|
144
|
+
}
|
|
145
|
+
const utilityTabsItems = [];
|
|
146
|
+
const utilityTabsContent = [];
|
|
147
|
+
if (utilities) {
|
|
148
|
+
utilityTabsItems.push({ id: utilitiesTabId, name: t('utilities') });
|
|
149
|
+
utilityTabsContent.push({
|
|
150
|
+
id: utilitiesTabId,
|
|
151
|
+
content: _jsx(Flex, { container: { direction: 'column', gap: 2 }, children: utilities })
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (persistentUtility) {
|
|
155
|
+
utilityTabsItems.push({ id: persistentUtilityTabId, name: persistentUtility.title });
|
|
156
|
+
utilityTabsContent.push({ id: persistentUtilityTabId, content: persistentUtility?.content });
|
|
157
|
+
}
|
|
158
|
+
items = [summaryTab, ...tabItemsProp, ...utilityTabsItems];
|
|
159
|
+
content = [summaryTabContent, ...tabContentProp, ...utilityTabsContent];
|
|
160
|
+
return [items, content];
|
|
161
|
+
}, [
|
|
162
|
+
tabItemsProp,
|
|
163
|
+
summaryTabId,
|
|
164
|
+
mdOrAbove,
|
|
165
|
+
summaryExpanded,
|
|
166
|
+
persistentUtility,
|
|
167
|
+
xlOrAbove,
|
|
168
|
+
tabContentProp,
|
|
169
|
+
utilities,
|
|
170
|
+
utilitiesTabId,
|
|
171
|
+
persistentUtilityTabId
|
|
172
|
+
]);
|
|
173
|
+
// Grid layout props
|
|
174
|
+
let caseViewGridContainer = {
|
|
175
|
+
cols: 'minmax(0, 1fr)',
|
|
176
|
+
colGap: 0,
|
|
177
|
+
rows: 'minmax(0, max-content) auto',
|
|
178
|
+
areas: `
|
|
179
|
+
"summary"
|
|
180
|
+
"work-area"
|
|
181
|
+
`
|
|
182
|
+
};
|
|
183
|
+
const sharedGridProps = {
|
|
184
|
+
colGap: 2,
|
|
185
|
+
rows: caseViewGridContainer.rows
|
|
186
|
+
};
|
|
187
|
+
if (persistentUtility) {
|
|
188
|
+
if (xlOrAbove) {
|
|
189
|
+
caseViewGridContainer = {
|
|
190
|
+
...sharedGridProps,
|
|
191
|
+
cols: 'minmax(0, max-content) minmax(0, 1fr) repeat(2, minmax(0, max-content))',
|
|
192
|
+
areas: '"summary work-area persistentUtility utilities"'
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
else if (mdOrAbove) {
|
|
196
|
+
caseViewGridContainer = {
|
|
197
|
+
...sharedGridProps,
|
|
198
|
+
cols: 'minmax(0, 1fr) repeat(2, minmax(0, max-content))',
|
|
199
|
+
areas: `
|
|
200
|
+
"summary summary summary"
|
|
201
|
+
"work-area persistentUtility utilities"
|
|
202
|
+
`
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else if (summaryExpanded) {
|
|
207
|
+
if (mdOrAbove) {
|
|
208
|
+
caseViewGridContainer = {
|
|
209
|
+
...sharedGridProps,
|
|
210
|
+
cols: 'minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content)',
|
|
211
|
+
areas: '"summary work-area utilities"'
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else if (mdOrAbove) {
|
|
216
|
+
caseViewGridContainer = {
|
|
217
|
+
...sharedGridProps,
|
|
218
|
+
cols: 'minmax(0, 1fr) minmax(0, max-content)',
|
|
219
|
+
areas: `
|
|
220
|
+
"summary summary"
|
|
221
|
+
"work-area utilities"
|
|
222
|
+
`
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
// Apply sticky columns
|
|
226
|
+
const scrollStickOptions = useRef({
|
|
227
|
+
elements: []
|
|
228
|
+
});
|
|
229
|
+
const stickOffset = useMemo(() => {
|
|
230
|
+
if (windowIsAvailable && caseViewRef.current) {
|
|
231
|
+
return parseFloat(window.getComputedStyle(caseViewRef.current).getPropertyValue('--appshell-offset'));
|
|
232
|
+
}
|
|
233
|
+
return 0;
|
|
234
|
+
}, [caseViewRef.current]);
|
|
235
|
+
useScrollStick(
|
|
236
|
+
// isMediumOrAbove means side by side columns | | |
|
|
237
|
+
mdOrAbove ? { ...scrollStickOptions.current, offset: stickOffset } : undefined);
|
|
238
|
+
// Preview set summary tab active
|
|
239
|
+
useEffect(() => {
|
|
240
|
+
if (isPreview) {
|
|
241
|
+
onTabClick(summaryTabId);
|
|
242
|
+
}
|
|
243
|
+
}, []);
|
|
244
|
+
// Initial tab selection
|
|
245
|
+
useEffect(() => {
|
|
246
|
+
if (mdOrAbove &&
|
|
247
|
+
summaryExpanded &&
|
|
248
|
+
!persistentUtility &&
|
|
249
|
+
(currentTabId === summaryTabId || currentTabId === utilitiesTabId)) {
|
|
250
|
+
onTabClick(tabItemsProp[0]?.id);
|
|
251
|
+
}
|
|
252
|
+
// Toggle utilities tab selection
|
|
253
|
+
if (mdOrAbove && [utilitiesTabId, persistentUtilityTabId].includes(currentTabId)) {
|
|
254
|
+
onTabClick(initialTabId);
|
|
255
|
+
}
|
|
256
|
+
}, [mdOrAbove]);
|
|
257
|
+
// Initial / summary tab selection
|
|
258
|
+
useEffect(() => {
|
|
259
|
+
if (!smOrAbove && currentTabId === initialTabId) {
|
|
260
|
+
onTabClick(summaryTabId);
|
|
261
|
+
}
|
|
262
|
+
else if (smOrAbove && currentTabId === summaryTabId) {
|
|
263
|
+
onTabClick(initialTabId);
|
|
264
|
+
}
|
|
265
|
+
}, [smOrAbove]);
|
|
266
|
+
// Summary tab selection
|
|
267
|
+
useEffect(() => {
|
|
268
|
+
if (isPreview) {
|
|
269
|
+
onTabClick(summaryTabId);
|
|
270
|
+
}
|
|
271
|
+
}, [isPreview]);
|
|
272
|
+
// Initial tab selection
|
|
273
|
+
useEffect(() => {
|
|
274
|
+
if (summaryExpanded && currentTabId === summaryTabId) {
|
|
275
|
+
onTabClick(initialTabId);
|
|
276
|
+
}
|
|
277
|
+
}, [summaryExpanded]);
|
|
278
|
+
// Handles scrolling to tab content for newly clicked tab
|
|
279
|
+
useEffect(() => {
|
|
280
|
+
if (!tabContentEl)
|
|
281
|
+
return;
|
|
282
|
+
const scrollPos = window.scrollY;
|
|
283
|
+
const windowHeight = document.documentElement.clientHeight;
|
|
284
|
+
const bottomPos = scrollPos + windowHeight * 0.8;
|
|
285
|
+
const tabContentPos = tabContentEl.offsetTop;
|
|
286
|
+
if (tabContentPos > bottomPos) {
|
|
287
|
+
const top = tabContentPos - windowHeight * 0.2;
|
|
288
|
+
window.scrollTo({ top, behavior: 'smooth' });
|
|
289
|
+
}
|
|
290
|
+
}, [currentTabId]);
|
|
291
|
+
// We need a css variable for the height of the case summary when it is collapsed into a header like layout
|
|
292
|
+
useLayoutEffect(() => {
|
|
293
|
+
if (!caseViewRef.current || !summaryRef.current)
|
|
294
|
+
return;
|
|
295
|
+
caseViewRef.current.style.setProperty('--summary-height', `${!summaryExpanded ? summaryRef.current.offsetHeight : 0}px`);
|
|
296
|
+
}, [summaryExpanded]);
|
|
297
|
+
// CaseView context value
|
|
298
|
+
// Choosing not to memo for now due to extent of deps and how often they change. Optimize as needed.
|
|
299
|
+
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
300
|
+
const ctxValue = {
|
|
301
|
+
testIds,
|
|
302
|
+
caseId,
|
|
303
|
+
heading,
|
|
304
|
+
subheading,
|
|
305
|
+
caseLink,
|
|
306
|
+
parentCases,
|
|
307
|
+
icon,
|
|
308
|
+
followed,
|
|
309
|
+
onFollowedChange,
|
|
310
|
+
actions,
|
|
311
|
+
promotedActions,
|
|
312
|
+
onEdit,
|
|
313
|
+
summaryFields,
|
|
314
|
+
tabs: {
|
|
315
|
+
items: tabItems,
|
|
316
|
+
onClick: onTabClick,
|
|
317
|
+
currentTabId
|
|
318
|
+
},
|
|
319
|
+
stages,
|
|
320
|
+
tasks,
|
|
321
|
+
persistentUtility,
|
|
322
|
+
intelligentGuidance,
|
|
323
|
+
summaryExpanded,
|
|
324
|
+
utilitiesExpanded,
|
|
325
|
+
onToggleSummary,
|
|
326
|
+
isPreview,
|
|
327
|
+
aboveSM: smOrAbove,
|
|
328
|
+
aboveMD: mdOrAbove,
|
|
329
|
+
aboveLG: lgOrAbove,
|
|
330
|
+
aboveXL: xlOrAbove
|
|
331
|
+
};
|
|
332
|
+
const currentTabPanelRef = useRef(null);
|
|
333
|
+
// The following effects are dedicated to resizeTable handling.
|
|
334
|
+
useLayoutEffect(() => {
|
|
335
|
+
if (!currentTabPanelRef.current || !workAreaRef.current)
|
|
336
|
+
return;
|
|
337
|
+
const currentTabPanelEl = currentTabPanelRef.current;
|
|
338
|
+
const workAreaEl = workAreaRef.current;
|
|
339
|
+
resizeTable(currentTabPanelEl, workAreaEl);
|
|
340
|
+
const onTabChange = () => {
|
|
341
|
+
resizeTable(currentTabPanelEl, workAreaEl);
|
|
342
|
+
};
|
|
343
|
+
// TODO: optimize
|
|
344
|
+
const mo = new MutationObserver(() => {
|
|
345
|
+
resizeTable(currentTabPanelEl, workAreaEl);
|
|
346
|
+
});
|
|
347
|
+
mo.observe(currentTabPanelEl, { childList: true, subtree: true });
|
|
348
|
+
currentTabPanelEl.addEventListener('cosmos-tab-changed', onTabChange);
|
|
349
|
+
return () => {
|
|
350
|
+
mo.disconnect();
|
|
351
|
+
currentTabPanelEl.removeEventListener('cosmos-tab-changed', onTabChange);
|
|
352
|
+
};
|
|
353
|
+
});
|
|
354
|
+
const [bannersStagesTasksEl, setBannersStagesTasksEl] = useElement(null);
|
|
355
|
+
useEffect(() => {
|
|
356
|
+
if (!bannersStagesTasksEl)
|
|
357
|
+
return;
|
|
358
|
+
const observer = new ResizeObserver(() => {
|
|
359
|
+
if (!currentTabPanelRef.current || !workAreaRef.current)
|
|
360
|
+
return;
|
|
361
|
+
resizeTable(currentTabPanelRef.current, workAreaRef.current);
|
|
362
|
+
});
|
|
363
|
+
observer.observe(bannersStagesTasksEl);
|
|
364
|
+
return () => {
|
|
365
|
+
observer.disconnect();
|
|
366
|
+
};
|
|
367
|
+
}, [bannersStagesTasksEl]);
|
|
368
|
+
useEffect(() => {
|
|
369
|
+
const onResize = () => {
|
|
370
|
+
if (!currentTabPanelRef.current || !workAreaRef.current)
|
|
371
|
+
return;
|
|
372
|
+
resizeTable(currentTabPanelRef.current, workAreaRef.current);
|
|
373
|
+
};
|
|
374
|
+
window.addEventListener('resize', onResize);
|
|
375
|
+
return () => {
|
|
376
|
+
window.removeEventListener('resize', onResize);
|
|
377
|
+
};
|
|
378
|
+
}, []);
|
|
379
|
+
const utilitiesHeading = (_jsx(StyledUtilitiesHeading, { variant: 'h2', children: t('utilities') }));
|
|
380
|
+
const utilitiesToggleButton = (_jsx(StyledExpandCollapseUtilitiesButton, { compact: true, icon: true, label: t(utilitiesExpanded ? 'collapse' : 'expand'), "aria-label": t(utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel'), onClick: () => {
|
|
381
|
+
if (!obeyUtilitiesExpandedProp && utilitiesExpandedProp) {
|
|
382
|
+
setObeyUtilitiesExpandedProp(true);
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
onToggleUtilities?.();
|
|
386
|
+
}
|
|
387
|
+
}, onFocus: () => {
|
|
388
|
+
isToggleButtonFocused.current = true;
|
|
389
|
+
}, onBlur: () => {
|
|
390
|
+
isToggleButtonFocused.current = false;
|
|
391
|
+
}, ref: toggleButtonRef, children: _jsx(Icon, { name: 'arrow-micro-left' }) }));
|
|
392
|
+
// Here we go...
|
|
393
|
+
return (_jsxs(_Fragment, { children: [_jsx(CaseViewContext.Provider, { value: ctxValue, children: _jsxs(Grid, { "data-testid": testIds.root, ...restProps, as: StyledCaseView, ref: caseViewRef, container: caseViewGridContainer, item: { area: 'case-view' }, children: [_jsx(Grid, { as: StyledSummary, item: { area: 'summary' }, desktop: mdOrAbove && (!persistentUtility || xlOrAbove) && !summaryExpanded, isLargeOrAbove: lgOrAbove, ref: summaryRef, children: _jsx(CaseSummary, {}) }), _jsxs(Flex, { container: {
|
|
394
|
+
direction: 'column',
|
|
395
|
+
alignContent: 'start',
|
|
396
|
+
rowGap: 2
|
|
397
|
+
}, as: StyledWorkArea, persistentUtility: Boolean(persistentUtility), ref: (el) => {
|
|
398
|
+
workAreaRef.current = el;
|
|
399
|
+
if (el)
|
|
400
|
+
scrollStickOptions.current?.elements.push(el);
|
|
401
|
+
}, children: [(banners || stages || tasks) && (_jsxs(Flex, { container: {
|
|
402
|
+
direction: 'column',
|
|
403
|
+
alignContent: 'start',
|
|
404
|
+
rowGap: 2
|
|
405
|
+
}, ref: setBannersStagesTasksEl, children: [banners && _jsx("div", { "data-testid": testIds.banners, children: banners }), stages && _jsx("div", { "data-testid": testIds.stages, children: stages }), tasks && _jsx("div", { "data-testid": testIds.tasks, children: tasks })] })), (!mdOrAbove || (persistentUtility && !xlOrAbove) || !summaryExpanded) && (_jsx(Tabs, { "data-testid": testIds.tabs, tabs: tabItems, onTabClick: onTabClick, currentTabId: currentTabId })), _jsx("div", { ref: setTabContentEl, children: tabContent?.map(({ id, content }) => (_jsx(TabPanel, { "data-testid": currentTabId === id ? testIds.tabContent : undefined, currentTabId: currentTabId, tabId: id, ref: currentTabId === id ? currentTabPanelRef : undefined, children: content }, id))) })] }), persistentUtility && mdOrAbove && (_jsx(Grid, { as: StyledPersistentUtility, item: { area: 'persistentUtility' }, "data-app-region": true, children: persistentUtility.content })), utilities && mdOrAbove && !lgOrAbove && utilitiesExpanded && (_jsx(Drawer, { as: StyledCaseDrawer, open: utilitiesExpanded, position: 'fixed', placement: direction.end, shadow: true, nullWhenClosed: true, hasPersistentUtility: !!persistentUtility, children: _jsxs(Flex, { as: StyledCaseDrawerContent, container: { direction: 'column', gap: 2 }, "data-app-region": true, children: [_jsxs(Flex, { container: { alignItems: 'center', justify: 'between' }, children: [utilitiesHeading, utilitiesToggleButton] }), utilities] }) })), utilities && mdOrAbove && (_jsxs(Grid, { "data-testid": testIds.utilities, ref: (el) => {
|
|
406
|
+
if (el)
|
|
407
|
+
scrollStickOptions.current?.elements.push(el);
|
|
408
|
+
}, as: StyledUtilities, container: {
|
|
409
|
+
cols: 'minmax(0, 1fr)',
|
|
410
|
+
rowGap: 2
|
|
411
|
+
}, item: {
|
|
412
|
+
area: 'utilities'
|
|
413
|
+
}, "data-app-region": lgOrAbove || !utilitiesExpanded || undefined, "aria-label": t('utilities_label'), children: [_jsxs(Flex, { container: {
|
|
414
|
+
alignItems: 'center',
|
|
415
|
+
justify: utilitiesExpanded ? 'between' : 'center'
|
|
416
|
+
}, children: [utilitiesHeading, !lgOrAbove && utilitiesExpanded ? null : utilitiesToggleButton] }), utilitiesExpanded && lgOrAbove && utilities, (!utilitiesExpanded || (mdOrAbove && !lgOrAbove)) &&
|
|
417
|
+
utilitiesSummaryItems &&
|
|
418
|
+
utilitiesSummaryItems.length > 0 && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems }))] }))] }) }), intelligentGuidance] }));
|
|
419
|
+
};
|
|
420
|
+
export default withTestIds(CaseView, getCaseViewTestIds);
|
|
421
|
+
//# sourceMappingURL=CaseView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseView.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG9E,OAAO,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,UAAU,EACV,IAAI,EACJ,MAAM,EACN,OAAO,EACP,YAAY,EACZ,IAAI,EACJ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AAI,SAAS,IAAI,SAAS,EAE3C,CAAC,CAAC,iBAAiB,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,CAAC;oCAChD,qBAAqB;oCACrB,qBAAqB,CAAC,MAAM,GAAG,CAAC,IAAI,CAClC,KAAC,gBAAgB,IAAC,KAAK,EAAE,qBAAqB,GAAI,CACnD,IACE,CACR,IACI,GACkB,EAC1B,mBAAmB,IACnB,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { useEffect, useMemo, useRef, useLayoutEffect, useState } from 'react';\nimport type { FC } from 'react';\n\nimport {\n Flex,\n Grid,\n Icon,\n registerIcon,\n TabPanel,\n useBreakpoint,\n useScrollStick,\n useElement,\n Card,\n Drawer,\n useI18n,\n useDirection,\n Tabs,\n useAfterInitialEffect,\n windowIsAvailable,\n focusHeadingOrContainer,\n useConfiguration,\n useTestIds,\n withTestIds\n} from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport type { ScrollStickOptions } from '@pega/cosmos-react-core/lib/hooks/useScrollStick';\nimport * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';\nimport * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';\n\nimport CaseSummary from './CaseSummary';\nimport UtilitiesSummary from './UtilitiesSummary';\nimport {\n StyledCaseDrawer,\n StyledCaseDrawerContent,\n StyledCaseView,\n StyledWorkArea,\n StyledPersistentUtility,\n StyledSummary,\n StyledSummaryTabContent,\n StyledUtilities,\n StyledExpandCollapseUtilitiesButton,\n StyledUtilitiesHeading\n} from './CaseView.styles';\nimport type { CaseViewContextValue, CaseViewProps } from './CaseView.types';\nimport CaseViewContext from './CaseView.context';\nimport CaseSummaryFields from './CaseSummaryFields';\nimport { getCaseViewTestIds } from './CaseView.test-ids';\n\nregisterIcon(moveRightSolidIcon, moveLeftSolidIcon);\n\n// This function is responsible for auto sizing table height in case tab panels.\nconst resizeTable = (tabPanelEl: HTMLDivElement, workAreaEl: HTMLDivElement) => {\n tabPanelEl.style.removeProperty('--content-height-in-view');\n\n // .rs-wrapper is currently the class used by the table component which needs to be targeted.\n const tables = Array.from(tabPanelEl.querySelectorAll('.rs-wrapper')).filter(\n table => table.getBoundingClientRect().width !== 0\n );\n\n // Only perform this logic when there is a single table in a tab's panel.\n if (tables.length !== 1) return;\n\n // This selector finds the table's root element as they are always wrapped in a Card.\n const table = tables[0].closest('article');\n\n if (!table) return;\n\n const tabPanelRect = tabPanelEl.getBoundingClientRect();\n const tableRect = table.getBoundingClientRect();\n const vpHeight = document.documentElement.clientHeight;\n const tableRectOffsetTop = tableRect.top + window.scrollY;\n const workAreaPaddingBlockEnd =\n // px unit are required for proper CSS calc calculation.\n window.getComputedStyle(workAreaEl).getPropertyValue('padding-block-end') || '0px';\n\n // Accounts for content rendered after the table.\n const tableBottomToTabPanelBottom = tabPanelRect.bottom - tableRect.bottom;\n\n // Sets a CSS variable for available height based on screen size and view state.\n // Defines an available minimum height of ~600px.\n tabPanelEl.style.setProperty(\n '--content-height-in-view',\n `max(calc(${\n vpHeight - tableRectOffsetTop - tableBottomToTabPanelBottom\n }px - ${workAreaPaddingBlockEnd}), 37.5rem)`\n );\n};\n\nconst CaseView: FC<CaseViewProps & ForwardProps> = ({\n testId,\n\n // Case data mostly visually related to the case header\n caseId,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n onEdit,\n actions,\n promotedActions,\n\n // Summary content and state props\n summaryFields,\n summaryExpanded: summaryExpandedProp = true,\n onToggleSummary,\n\n // Case tabs\n tabs: { currentTabId, items: tabItemsProp, onClick: onTabClick },\n\n // Workarea related content props\n banners,\n stages,\n tasks,\n tabContent: tabContentProp = [],\n\n // Utilities content and state props\n utilities,\n utilitiesSummaryItems,\n utilitiesExpanded: utilitiesExpandedProp = true,\n onToggleUtilities,\n\n // Etc...\n persistentUtility,\n intelligentGuidance,\n isPreview = false,\n ...restProps\n}: CaseViewProps) => {\n const testIds = useTestIds(testId, getCaseViewTestIds);\n\n // General util hooks\n const t = useI18n();\n const direction = useDirection();\n const { loadedRef } = useConfiguration();\n\n // Element refs\n const caseViewRef = useRef<HTMLDivElement>(null);\n const summaryRef = useRef<HTMLDivElement>(null);\n // undefined used to allow ref to be mutable. Element set below in ref callback for scroll stick.\n const workAreaRef = useRef<HTMLDivElement | undefined>();\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n const isToggleButtonFocused = useRef(false);\n\n // Tab content\n const [tabContentEl, setTabContentEl] = useElement<HTMLElement>(null);\n\n // Breakpoint booleans\n const smOrAbove = useBreakpoint('sm');\n const mdOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });\n const lgOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });\n const xlOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });\n\n // DOM ids\n const initialTabId = tabItemsProp[0]?.id;\n const summaryTabId = `summary-${caseId}`;\n const utilitiesTabId = `utilities-${caseId}`;\n const persistentUtilityTabId = `persistent-utility-${caseId}`;\n\n // Summary state handling\n let summaryExpanded = !isPreview && !!summaryExpandedProp;\n\n if (persistentUtility) {\n summaryExpanded = xlOrAbove;\n }\n\n // Focus heading on initial mount\n useEffect(() => {\n if (!caseViewRef.current) return;\n\n if (loadedRef.current) {\n focusHeadingOrContainer(caseViewRef.current, heading);\n } else {\n loadedRef.current = true;\n }\n }, [caseId]);\n\n // Utilities state handling\n\n // Used in coordination with a layoutEffect below to determine the utilities state on initial render.\n // Attempted with a ref but it did not work. Using state and enforcing a render in addition to the change render for lgOrAbove seems to fix...\n const [obeyUtilitiesExpandedProp, setObeyUtilitiesExpandedProp] = useState(lgOrAbove);\n\n // Allow the utilitiesExpandedProp to drive the utilities' state after the initial render\n useLayoutEffect(() => {\n if (lgOrAbove) setObeyUtilitiesExpandedProp(true);\n }, [lgOrAbove]);\n\n // Tracks whether a resize forced the onToggleUtilities to close the utilities when it's a drawer\n const utilitiesToggledByResize = useRef(false);\n\n // If the initial render is within the MD size, where the utility drawer renders, it must begin collapsed\n const utilitiesExpanded = obeyUtilitiesExpandedProp ? utilitiesExpandedProp : false;\n\n // Handles utilities state based on breakpoint changes.\n useAfterInitialEffect(() => {\n // If we change into the MD breakpoint range and the utilities state is expanded call the toggle prop to collapse it with controlled state\n if (mdOrAbove && !lgOrAbove && utilitiesExpandedProp) {\n onToggleUtilities?.();\n utilitiesToggledByResize.current = true;\n }\n\n if (lgOrAbove) {\n if (utilitiesToggledByResize.current && !utilitiesExpandedProp) {\n onToggleUtilities?.();\n }\n\n utilitiesToggledByResize.current = false;\n }\n // Purposely not listing utilitiesExpanded as a dependency as it is not a trigger and will be captured when BPs change\n }, [mdOrAbove, lgOrAbove]);\n\n // Handles focus of toggle button when toggled in drawer mode and when browser is resized\n useEffect(() => {\n if (isToggleButtonFocused.current) {\n toggleButtonRef.current?.focus();\n }\n\n if (!toggleButtonRef.current) {\n // Toggle button is not on DOM.\n isToggleButtonFocused.current = false;\n }\n }, [utilitiesExpanded, mdOrAbove, lgOrAbove]);\n\n // Prepare tabs\n const [tabItems, tabContent] = useMemo(() => {\n const summaryTab = { id: summaryTabId, name: t('summary') };\n const summaryTabContent = {\n id: summaryTabId,\n content: (\n <Card>\n <StyledSummaryTabContent>\n <CaseSummaryFields {...summaryFields} />\n </StyledSummaryTabContent>\n </Card>\n )\n };\n\n let items = tabItemsProp;\n let content = tabContentProp;\n\n if (mdOrAbove) {\n if (!summaryExpanded || (persistentUtility && !xlOrAbove)) {\n items = [summaryTab, ...tabItemsProp];\n content = [summaryTabContent, ...tabContentProp];\n }\n\n return [items, content];\n }\n\n const utilityTabsItems = [];\n const utilityTabsContent = [];\n\n if (utilities) {\n utilityTabsItems.push({ id: utilitiesTabId, name: t('utilities') });\n utilityTabsContent.push({\n id: utilitiesTabId,\n content: <Flex container={{ direction: 'column', gap: 2 }}>{utilities}</Flex>\n });\n }\n\n if (persistentUtility) {\n utilityTabsItems.push({ id: persistentUtilityTabId, name: persistentUtility.title });\n utilityTabsContent.push({ id: persistentUtilityTabId, content: persistentUtility?.content });\n }\n\n items = [summaryTab, ...tabItemsProp, ...utilityTabsItems];\n content = [summaryTabContent, ...tabContentProp, ...utilityTabsContent];\n\n return [items, content];\n }, [\n tabItemsProp,\n summaryTabId,\n mdOrAbove,\n summaryExpanded,\n persistentUtility,\n xlOrAbove,\n tabContentProp,\n utilities,\n utilitiesTabId,\n persistentUtilityTabId\n ]);\n\n // Grid layout props\n let caseViewGridContainer = {\n cols: 'minmax(0, 1fr)',\n colGap: 0,\n rows: 'minmax(0, max-content) auto',\n areas: `\n \"summary\"\n \"work-area\"\n `\n };\n\n const sharedGridProps = {\n colGap: 2,\n rows: caseViewGridContainer.rows\n };\n\n if (persistentUtility) {\n if (xlOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, max-content) minmax(0, 1fr) repeat(2, minmax(0, max-content))',\n areas: '\"summary work-area persistentUtility utilities\"'\n };\n } else if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, 1fr) repeat(2, minmax(0, max-content))',\n areas: `\n \"summary summary summary\"\n \"work-area persistentUtility utilities\"\n `\n };\n }\n } else if (summaryExpanded) {\n if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, max-content) minmax(0, 1fr) minmax(0, max-content)',\n areas: '\"summary work-area utilities\"'\n };\n }\n } else if (mdOrAbove) {\n caseViewGridContainer = {\n ...sharedGridProps,\n cols: 'minmax(0, 1fr) minmax(0, max-content)',\n areas: `\n \"summary summary\"\n \"work-area utilities\"\n `\n };\n }\n\n // Apply sticky columns\n const scrollStickOptions = useRef<ScrollStickOptions & { elements: HTMLElement[] }>({\n elements: []\n });\n\n const stickOffset = useMemo(() => {\n if (windowIsAvailable && caseViewRef.current) {\n return parseFloat(\n window.getComputedStyle(caseViewRef.current).getPropertyValue('--appshell-offset')\n );\n }\n\n return 0;\n }, [caseViewRef.current]);\n\n useScrollStick(\n // isMediumOrAbove means side by side columns | | |\n mdOrAbove ? { ...scrollStickOptions.current, offset: stickOffset } : undefined\n );\n\n // Preview set summary tab active\n useEffect(() => {\n if (isPreview) {\n onTabClick(summaryTabId);\n }\n }, []);\n\n // Initial tab selection\n useEffect(() => {\n if (\n mdOrAbove &&\n summaryExpanded &&\n !persistentUtility &&\n (currentTabId === summaryTabId || currentTabId === utilitiesTabId)\n ) {\n onTabClick(tabItemsProp[0]?.id);\n }\n // Toggle utilities tab selection\n if (mdOrAbove && [utilitiesTabId, persistentUtilityTabId].includes(currentTabId)) {\n onTabClick(initialTabId);\n }\n }, [mdOrAbove]);\n\n // Initial / summary tab selection\n useEffect(() => {\n if (!smOrAbove && currentTabId === initialTabId) {\n onTabClick(summaryTabId);\n } else if (smOrAbove && currentTabId === summaryTabId) {\n onTabClick(initialTabId);\n }\n }, [smOrAbove]);\n\n // Summary tab selection\n useEffect(() => {\n if (isPreview) {\n onTabClick(summaryTabId);\n }\n }, [isPreview]);\n\n // Initial tab selection\n useEffect(() => {\n if (summaryExpanded && currentTabId === summaryTabId) {\n onTabClick(initialTabId);\n }\n }, [summaryExpanded]);\n\n // Handles scrolling to tab content for newly clicked tab\n useEffect(() => {\n if (!tabContentEl) return;\n const scrollPos = window.scrollY;\n const windowHeight = document.documentElement.clientHeight;\n const bottomPos = scrollPos + windowHeight * 0.8;\n const tabContentPos = tabContentEl.offsetTop;\n if (tabContentPos > bottomPos) {\n const top = tabContentPos - windowHeight * 0.2;\n window.scrollTo({ top, behavior: 'smooth' });\n }\n }, [currentTabId]);\n\n // We need a css variable for the height of the case summary when it is collapsed into a header like layout\n useLayoutEffect(() => {\n if (!caseViewRef.current || !summaryRef.current) return;\n\n caseViewRef.current.style.setProperty(\n '--summary-height',\n `${!summaryExpanded ? summaryRef.current.offsetHeight : 0}px`\n );\n }, [summaryExpanded]);\n\n // CaseView context value\n // Choosing not to memo for now due to extent of deps and how often they change. Optimize as needed.\n // eslint-disable-next-line react/jsx-no-constructed-context-values\n const ctxValue: CaseViewContextValue = {\n testIds,\n caseId,\n heading,\n subheading,\n caseLink,\n parentCases,\n icon,\n followed,\n onFollowedChange,\n actions,\n promotedActions,\n onEdit,\n summaryFields,\n tabs: {\n items: tabItems,\n onClick: onTabClick,\n currentTabId\n },\n stages,\n tasks,\n persistentUtility,\n intelligentGuidance,\n summaryExpanded,\n utilitiesExpanded,\n onToggleSummary,\n isPreview,\n aboveSM: smOrAbove,\n aboveMD: mdOrAbove,\n aboveLG: lgOrAbove,\n aboveXL: xlOrAbove\n };\n\n const currentTabPanelRef = useRef<HTMLDivElement>(null);\n\n // The following effects are dedicated to resizeTable handling.\n useLayoutEffect(() => {\n if (!currentTabPanelRef.current || !workAreaRef.current) return;\n\n const currentTabPanelEl = currentTabPanelRef.current;\n const workAreaEl = workAreaRef.current;\n\n resizeTable(currentTabPanelEl, workAreaEl);\n\n const onTabChange = () => {\n resizeTable(currentTabPanelEl, workAreaEl);\n };\n\n // TODO: optimize\n const mo = new MutationObserver(() => {\n resizeTable(currentTabPanelEl, workAreaEl);\n });\n\n mo.observe(currentTabPanelEl, { childList: true, subtree: true });\n\n currentTabPanelEl.addEventListener('cosmos-tab-changed', onTabChange);\n\n return () => {\n mo.disconnect();\n currentTabPanelEl.removeEventListener('cosmos-tab-changed', onTabChange);\n };\n });\n\n const [bannersStagesTasksEl, setBannersStagesTasksEl] = useElement<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!bannersStagesTasksEl) return;\n\n const observer = new ResizeObserver(() => {\n if (!currentTabPanelRef.current || !workAreaRef.current) return;\n\n resizeTable(currentTabPanelRef.current, workAreaRef.current);\n });\n\n observer.observe(bannersStagesTasksEl);\n\n return () => {\n observer.disconnect();\n };\n }, [bannersStagesTasksEl]);\n\n useEffect(() => {\n const onResize = () => {\n if (!currentTabPanelRef.current || !workAreaRef.current) return;\n\n resizeTable(currentTabPanelRef.current, workAreaRef.current);\n };\n\n window.addEventListener('resize', onResize);\n\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, []);\n\n const utilitiesHeading = (\n <StyledUtilitiesHeading variant='h2'>{t('utilities')}</StyledUtilitiesHeading>\n );\n\n const utilitiesToggleButton = (\n <StyledExpandCollapseUtilitiesButton\n compact\n icon\n label={t(utilitiesExpanded ? 'collapse' : 'expand')}\n aria-label={t(utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel')}\n onClick={() => {\n if (!obeyUtilitiesExpandedProp && utilitiesExpandedProp) {\n setObeyUtilitiesExpandedProp(true);\n } else {\n onToggleUtilities?.();\n }\n }}\n onFocus={() => {\n isToggleButtonFocused.current = true;\n }}\n onBlur={() => {\n isToggleButtonFocused.current = false;\n }}\n ref={toggleButtonRef}\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseUtilitiesButton>\n );\n\n // Here we go...\n return (\n <>\n <CaseViewContext.Provider value={ctxValue}>\n {/* Root element */}\n <Grid\n data-testid={testIds.root}\n {...restProps}\n as={StyledCaseView}\n ref={caseViewRef}\n container={caseViewGridContainer}\n item={{ area: 'case-view' }}\n >\n {/* Summary */}\n <Grid\n as={StyledSummary}\n item={{ area: 'summary' }}\n desktop={mdOrAbove && (!persistentUtility || xlOrAbove) && !summaryExpanded}\n isLargeOrAbove={lgOrAbove}\n ref={summaryRef}\n >\n <CaseSummary />\n </Grid>\n\n {/* Work area */}\n <Flex\n container={{\n direction: 'column',\n alignContent: 'start',\n rowGap: 2\n }}\n as={StyledWorkArea}\n persistentUtility={Boolean(persistentUtility)}\n ref={(el: HTMLDivElement) => {\n workAreaRef.current = el;\n if (el) scrollStickOptions.current?.elements.push(el);\n }}\n >\n {(banners || stages || tasks) && (\n <Flex\n container={{\n direction: 'column',\n alignContent: 'start',\n rowGap: 2\n }}\n ref={setBannersStagesTasksEl}\n >\n {banners && <div data-testid={testIds.banners}>{banners}</div>}\n {stages && <div data-testid={testIds.stages}>{stages}</div>}\n {tasks && <div data-testid={testIds.tasks}>{tasks}</div>}\n </Flex>\n )}\n\n {(!mdOrAbove || (persistentUtility && !xlOrAbove) || !summaryExpanded) && (\n <Tabs\n data-testid={testIds.tabs}\n tabs={tabItems}\n onTabClick={onTabClick}\n currentTabId={currentTabId}\n />\n )}\n\n <div ref={setTabContentEl}>\n {tabContent?.map(({ id, content }) => (\n <TabPanel\n data-testid={currentTabId === id ? testIds.tabContent : undefined}\n currentTabId={currentTabId}\n tabId={id}\n key={id}\n ref={currentTabId === id ? currentTabPanelRef : undefined}\n >\n {content}\n </TabPanel>\n ))}\n </div>\n </Flex>\n\n {/* Persistent utility column */}\n {persistentUtility && mdOrAbove && (\n <Grid as={StyledPersistentUtility} item={{ area: 'persistentUtility' }} data-app-region>\n {persistentUtility.content}\n </Grid>\n )}\n\n {/* Utility drawer */}\n {utilities && mdOrAbove && !lgOrAbove && utilitiesExpanded && (\n <Drawer\n as={StyledCaseDrawer}\n open={utilitiesExpanded}\n position='fixed'\n placement={direction.end}\n shadow\n nullWhenClosed\n hasPersistentUtility={!!persistentUtility}\n >\n <Flex\n as={StyledCaseDrawerContent}\n container={{ direction: 'column', gap: 2 }}\n data-app-region\n >\n <Flex container={{ alignItems: 'center', justify: 'between' }}>\n {utilitiesHeading}\n {utilitiesToggleButton}\n </Flex>\n\n {utilities}\n </Flex>\n </Drawer>\n )}\n\n {/* Utilities */}\n {utilities && mdOrAbove && (\n <Grid\n data-testid={testIds.utilities}\n ref={(el: HTMLDivElement) => {\n if (el) scrollStickOptions.current?.elements.push(el);\n }}\n as={StyledUtilities}\n container={{\n cols: 'minmax(0, 1fr)',\n rowGap: 2\n }}\n item={{\n area: 'utilities'\n }}\n data-app-region={lgOrAbove || !utilitiesExpanded || undefined}\n aria-label={t('utilities_label')}\n >\n <Flex\n container={{\n alignItems: 'center',\n justify: utilitiesExpanded ? 'between' : 'center'\n }}\n >\n {utilitiesHeading}\n {!lgOrAbove && utilitiesExpanded ? null : utilitiesToggleButton}\n </Flex>\n\n {utilitiesExpanded && lgOrAbove && utilities}\n\n {(!utilitiesExpanded || (mdOrAbove && !lgOrAbove)) &&\n utilitiesSummaryItems &&\n utilitiesSummaryItems.length > 0 && (\n <UtilitiesSummary items={utilitiesSummaryItems} />\n )}\n </Grid>\n )}\n </Grid>\n </CaseViewContext.Provider>\n {intelligentGuidance}\n </>\n );\n};\n\nexport default withTestIds(CaseView, getCaseViewTestIds);\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { DefaultTheme } from 'styled-components';
|
|
2
|
+
export declare const StyledCaseSummaryFields: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
3
|
+
export declare const StyledSummaryPrimaryList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FieldValueListProps & import("@pega/cosmos-react-core").ForwardProps> & {
|
|
4
|
+
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
|
|
5
|
+
}, DefaultTheme, {
|
|
6
|
+
wrapped?: boolean | undefined;
|
|
7
|
+
}, never>;
|
|
8
|
+
export declare const StyledSummarySecondaryList: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").FieldValueListProps & import("@pega/cosmos-react-core").ForwardProps> & {
|
|
9
|
+
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly []>;
|
|
10
|
+
}, DefaultTheme, {}, never>;
|
|
11
|
+
export declare const StyledSummaryTabContent: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").CardContentProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
|
|
12
|
+
export declare const StyledCaseHeader: import("styled-components").StyledComponent<"header", DefaultTheme, {}, never>;
|
|
13
|
+
export declare const StyledFollowIconWrap: import("styled-components").StyledComponent<"label", DefaultTheme, {}, never>;
|
|
14
|
+
export declare const StyledSubheading: import("styled-components").StyledComponent<"p", DefaultTheme, {}, never>;
|
|
15
|
+
export declare const StyledHeaderActions: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
16
|
+
offsetEnd: boolean;
|
|
17
|
+
}, never>;
|
|
18
|
+
export declare const StyledCaseHeaderText: import("styled-components").StyledComponent<"hgroup", DefaultTheme, {}, never>;
|
|
19
|
+
export declare const StyledCaseHeaderPromotedAction: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
|
|
20
|
+
export declare const StyledHeaderSummaryBlock: import("styled-components").StyledComponent<"div", DefaultTheme, {
|
|
21
|
+
hasItems: boolean;
|
|
22
|
+
}, never>;
|
|
23
|
+
export declare const StyledHeaderSummary: import("styled-components").StyledComponent<"dl", DefaultTheme, {}, never>;
|
|
24
|
+
export declare const StyledHeaderSummaryValue: import("styled-components").StyledComponent<"dd", DefaultTheme, {
|
|
25
|
+
bold?: boolean | undefined;
|
|
26
|
+
truncate?: boolean | undefined;
|
|
27
|
+
theme: DefaultTheme;
|
|
28
|
+
}, never>;
|
|
29
|
+
export declare const StyledCaseSummaryInfo: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
30
|
+
export declare const StyledCaseSummaryContainer: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
31
|
+
export declare const StyledExpandCollapseButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
|
|
32
|
+
export declare const StyledExpandCollapseSummaryButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
|
|
33
|
+
export declare const StyledCaseSummary: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
34
|
+
export declare const StyledWorkArea: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
35
|
+
export declare const StyledUtilitiesHeading: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
|
|
36
|
+
export declare const StyledExpandCollapseUtilitiesButton: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").ButtonProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
|
|
37
|
+
export declare const StyledUtilities: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
38
|
+
export declare const StyledSummary: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
39
|
+
export declare const StyledCaseDrawer: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
40
|
+
export declare const StyledCaseDrawerContent: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
41
|
+
export declare const StyledPersistentUtility: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
42
|
+
export declare const ScrollStick: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
43
|
+
export declare const StyledCaseView: import("styled-components").StyledComponent<"div", DefaultTheme, {}, never>;
|
|
44
|
+
export declare const StyledUtilitiesHeader: import("styled-components").StyledComponent<import("react").FunctionComponent<import("@pega/cosmos-react-core").TextProps & import("@pega/cosmos-react-core").ForwardProps>, DefaultTheme, {}, never>;
|
|
45
|
+
//# sourceMappingURL=CaseView.styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AA4CtD,eAAO,MAAM,uBAAuB,6EAAe,CAAC;AAIpD,eAAO,MAAM,wBAAwB;;;;SAmBpC,CAAC;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