@pega/cosmos-react-work 5.0.0-dev.4.8 → 5.0.0-dev.5.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/ArticleList.d.ts +6 -0
- package/lib/components/ArticleList/ArticleList.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.js +132 -0
- package/lib/components/ArticleList/ArticleList.js.map +1 -0
- package/lib/components/ArticleList/ArticleList.types.d.ts +92 -0
- package/lib/components/ArticleList/ArticleList.types.d.ts.map +1 -0
- package/lib/components/ArticleList/ArticleList.types.js +2 -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 +6 -0
- package/lib/components/ArticleList/index.d.ts.map +1 -0
- package/lib/components/ArticleList/index.js +4 -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 +2 -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 +29 -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 +4 -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,182 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import { Flex, getEdge, registerIcon, StyledStackedFieldValue, StyledLabel, StyledFieldName, useDirection, useChToPxConversionFactor, NoValue } from '@pega/cosmos-react-core';
|
|
4
|
+
import * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';
|
|
5
|
+
import * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';
|
|
6
|
+
import { StyledHeaderSummary, StyledHeaderSummaryValue, StyledHeaderSummaryBlock } from '../CaseView.styles';
|
|
7
|
+
import { useCaseViewContext } from '../CaseView.context';
|
|
8
|
+
registerIcon(pencilIcon, moreIcon);
|
|
9
|
+
const Field = ({ item, primary, truncate }) => {
|
|
10
|
+
const { name, value, simpleValue } = item;
|
|
11
|
+
const displayValue = simpleValue ?? value ?? _jsx(NoValue, {});
|
|
12
|
+
return (_jsxs(StyledStackedFieldValue, { children: [_jsx(StyledLabel, { as: StyledFieldName, children: name }), _jsx(StyledHeaderSummaryValue, { bold: primary, truncate: truncate, children: displayValue })] }));
|
|
13
|
+
};
|
|
14
|
+
const Summary = ({ siblingRef }) => {
|
|
15
|
+
const { ltr } = useDirection();
|
|
16
|
+
const { summaryFields } = useCaseViewContext();
|
|
17
|
+
const chToPxConversionFactor = useChToPxConversionFactor();
|
|
18
|
+
const containerRef = useRef(null);
|
|
19
|
+
const listRef = useRef(null);
|
|
20
|
+
const primaryItems = summaryFields?.primary ?? [];
|
|
21
|
+
const secondaryItems = summaryFields?.secondary ?? [];
|
|
22
|
+
const items = [...primaryItems, ...secondaryItems];
|
|
23
|
+
const [displayCount, setDisplayCount] = useState(items.length);
|
|
24
|
+
const [truncatedIndices, setTruncatedIndices] = useState(items.map((_, i) => i));
|
|
25
|
+
const priorTrailingEdgeStack = useRef([]);
|
|
26
|
+
const priorAvailableSpace = useRef(null);
|
|
27
|
+
const evalItemAddition = ({ nextSiblingLeadingEdge }) => {
|
|
28
|
+
const indicesToTruncate = truncatedIndices ? [...truncatedIndices] : [];
|
|
29
|
+
let nextDisplayCount = displayCount;
|
|
30
|
+
const reversedTrailingEdgeStack = [...priorTrailingEdgeStack.current].reverse();
|
|
31
|
+
for (let i = 0; i < reversedTrailingEdgeStack.length; i += 1) {
|
|
32
|
+
const priorEdge = reversedTrailingEdgeStack[i];
|
|
33
|
+
const shouldRender = ltr
|
|
34
|
+
? priorEdge < nextSiblingLeadingEdge
|
|
35
|
+
: priorEdge > nextSiblingLeadingEdge;
|
|
36
|
+
if (shouldRender) {
|
|
37
|
+
priorTrailingEdgeStack.current.pop();
|
|
38
|
+
if (!indicesToTruncate.includes(nextDisplayCount)) {
|
|
39
|
+
indicesToTruncate.push(nextDisplayCount);
|
|
40
|
+
}
|
|
41
|
+
nextDisplayCount += 1;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { indicesToTruncate, nextDisplayCount };
|
|
48
|
+
};
|
|
49
|
+
const evalTruncationReduction = ({ listChildren, availableSpace }) => {
|
|
50
|
+
const indicesToTruncate = [];
|
|
51
|
+
let hasAvailableSpace = availableSpace;
|
|
52
|
+
listChildren.forEach((item, index) => {
|
|
53
|
+
const valueEl = item.lastChild;
|
|
54
|
+
const truncatedSpace = Math.floor(valueEl.scrollWidth - valueEl.offsetWidth);
|
|
55
|
+
const shouldTruncate = truncatedSpace === 0 ? false : hasAvailableSpace - truncatedSpace <= 0;
|
|
56
|
+
if (shouldTruncate) {
|
|
57
|
+
if (!truncatedIndices?.includes(index)) {
|
|
58
|
+
hasAvailableSpace += truncatedSpace;
|
|
59
|
+
}
|
|
60
|
+
indicesToTruncate.push(index);
|
|
61
|
+
}
|
|
62
|
+
else if (truncatedIndices?.includes(index)) {
|
|
63
|
+
hasAvailableSpace -= truncatedSpace;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return { indicesToTruncate };
|
|
67
|
+
};
|
|
68
|
+
const evalTruncationIncrease = ({ listChildren, availableSpace }) => {
|
|
69
|
+
const indicesToTruncate = [];
|
|
70
|
+
const lastIndex = listChildren.length - 1;
|
|
71
|
+
let hasAvailableSpace = availableSpace;
|
|
72
|
+
[...listChildren].reverse().forEach((item, index) => {
|
|
73
|
+
if (truncatedIndices?.includes(lastIndex - index)) {
|
|
74
|
+
indicesToTruncate.push(lastIndex - index);
|
|
75
|
+
}
|
|
76
|
+
else if (hasAvailableSpace < 0) {
|
|
77
|
+
const truncatedElMaxWidth = 20 * chToPxConversionFactor;
|
|
78
|
+
const valueEl = item.lastChild;
|
|
79
|
+
const spaceToTruncate = Math.max(Math.floor(valueEl.offsetWidth - truncatedElMaxWidth), 0);
|
|
80
|
+
if (spaceToTruncate) {
|
|
81
|
+
indicesToTruncate.push(lastIndex - index);
|
|
82
|
+
hasAvailableSpace += spaceToTruncate;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return { indicesToTruncate, availableSpace: hasAvailableSpace };
|
|
87
|
+
};
|
|
88
|
+
const evalItemRemoval = ({ listChildren, availableSpace, nextSiblingLeadingEdge }) => {
|
|
89
|
+
let nextDisplayCount = displayCount;
|
|
90
|
+
let hasAvailableSpace = availableSpace;
|
|
91
|
+
let lastChildIndex = listChildren.length - 1;
|
|
92
|
+
do {
|
|
93
|
+
const itemTrailingEdge = getEdge({
|
|
94
|
+
el: listChildren[lastChildIndex],
|
|
95
|
+
side: 'trailing',
|
|
96
|
+
ltr
|
|
97
|
+
});
|
|
98
|
+
hasAvailableSpace = Math.floor(ltr ? nextSiblingLeadingEdge - itemTrailingEdge : itemTrailingEdge - nextSiblingLeadingEdge);
|
|
99
|
+
if (hasAvailableSpace < 0) {
|
|
100
|
+
priorTrailingEdgeStack.current = [...priorTrailingEdgeStack.current, itemTrailingEdge];
|
|
101
|
+
nextDisplayCount -= 1;
|
|
102
|
+
lastChildIndex -= 1;
|
|
103
|
+
}
|
|
104
|
+
} while (hasAvailableSpace < 0 && lastChildIndex > -1);
|
|
105
|
+
return { displayCount: nextDisplayCount };
|
|
106
|
+
};
|
|
107
|
+
const evaluateSummaryDisplay = () => {
|
|
108
|
+
const containerEl = containerRef.current;
|
|
109
|
+
if (!containerEl)
|
|
110
|
+
return;
|
|
111
|
+
const listChildren = Array.from(listRef.current?.children ?? []);
|
|
112
|
+
const lastSummaryItem = listChildren.length ? listChildren[listChildren.length - 1] : undefined;
|
|
113
|
+
const nextSibling = siblingRef?.current ?? document.body;
|
|
114
|
+
const nextSiblingLeadingEdge = getEdge({
|
|
115
|
+
el: nextSibling,
|
|
116
|
+
side: 'leading',
|
|
117
|
+
ltr
|
|
118
|
+
});
|
|
119
|
+
const testEdge = lastSummaryItem
|
|
120
|
+
? getEdge({ el: lastSummaryItem, side: 'trailing', ltr })
|
|
121
|
+
: getEdge({ el: containerEl, side: 'leading', ltr });
|
|
122
|
+
let availableSpace = Math.floor(ltr ? nextSiblingLeadingEdge - testEdge : testEdge - nextSiblingLeadingEdge);
|
|
123
|
+
if (availableSpace === priorAvailableSpace.current)
|
|
124
|
+
return;
|
|
125
|
+
priorAvailableSpace.current = availableSpace;
|
|
126
|
+
let indicesToTruncate;
|
|
127
|
+
let nextDisplayCount = displayCount;
|
|
128
|
+
if (availableSpace >= 0) {
|
|
129
|
+
if (displayCount !== items.length) {
|
|
130
|
+
const additionsConfig = evalItemAddition({ nextSiblingLeadingEdge });
|
|
131
|
+
indicesToTruncate = additionsConfig.indicesToTruncate;
|
|
132
|
+
nextDisplayCount = additionsConfig.nextDisplayCount;
|
|
133
|
+
}
|
|
134
|
+
else if (truncatedIndices?.length) {
|
|
135
|
+
const truncationConfig = evalTruncationReduction({
|
|
136
|
+
listChildren,
|
|
137
|
+
availableSpace
|
|
138
|
+
});
|
|
139
|
+
indicesToTruncate = truncationConfig.indicesToTruncate;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else if (listChildren) {
|
|
143
|
+
const truncationConfig = evalTruncationIncrease({
|
|
144
|
+
listChildren,
|
|
145
|
+
availableSpace
|
|
146
|
+
});
|
|
147
|
+
indicesToTruncate = truncationConfig.indicesToTruncate;
|
|
148
|
+
availableSpace = truncationConfig.availableSpace;
|
|
149
|
+
if (availableSpace < 0) {
|
|
150
|
+
const removalConfig = evalItemRemoval({
|
|
151
|
+
listChildren,
|
|
152
|
+
availableSpace,
|
|
153
|
+
nextSiblingLeadingEdge
|
|
154
|
+
});
|
|
155
|
+
nextDisplayCount = removalConfig.displayCount;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
setDisplayCount(nextDisplayCount);
|
|
159
|
+
if (indicesToTruncate) {
|
|
160
|
+
setTruncatedIndices(indicesToTruncate);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
// Initial display evaluation
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
evaluateSummaryDisplay();
|
|
166
|
+
}, []);
|
|
167
|
+
// Overflow resize observer
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
const resizeObserver = new ResizeObserver(evaluateSummaryDisplay);
|
|
170
|
+
if (containerRef.current) {
|
|
171
|
+
resizeObserver.observe(containerRef.current, { box: 'border-box' });
|
|
172
|
+
}
|
|
173
|
+
return () => {
|
|
174
|
+
resizeObserver.disconnect();
|
|
175
|
+
};
|
|
176
|
+
}, [evaluateSummaryDisplay]);
|
|
177
|
+
return (_jsx(Flex, { as: StyledHeaderSummaryBlock, item: { grow: 1, shrink: 1 }, container: { pad: [0.5, 0], alignItems: 'center' }, ref: containerRef, hasItems: displayCount > 0, children: _jsx(Flex, { as: StyledHeaderSummary, container: { gap: 4 }, ref: listRef, children: items.slice(0, displayCount).map((item, index) => {
|
|
178
|
+
return (_jsx(Field, { item: item, primary: !!primaryItems?.length && index < primaryItems.length, truncate: !!truncatedIndices?.includes(index) }, item.name));
|
|
179
|
+
}) }) }));
|
|
180
|
+
};
|
|
181
|
+
export default Summary;
|
|
182
|
+
//# sourceMappingURL=Summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Summary.js","sourceRoot":"","sources":["../../../../src/components/CaseView/CaseHeader/Summary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE/D,OAAO,EACL,IAAI,EACJ,OAAO,EACP,YAAY,EACZ,uBAAuB,EACvB,WAAW,EACX,eAAe,EACf,YAAY,EACZ,yBAAyB,EACzB,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,O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AC,CAAC;AAEF,eAAe,OAAO,CAAC","sourcesContent":["import { RefObject, useEffect, useRef, useState } from 'react';\n\nimport {\n Flex,\n getEdge,\n registerIcon,\n StyledStackedFieldValue,\n StyledLabel,\n StyledFieldName,\n useDirection,\n useChToPxConversionFactor,\n NoValue\n} from '@pega/cosmos-react-core';\nimport * as pencilIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/pencil.icon';\nimport * as moreIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/more.icon';\n\nimport {\n StyledHeaderSummary,\n StyledHeaderSummaryValue,\n StyledHeaderSummaryBlock\n} from '../CaseView.styles';\nimport { useCaseViewContext } from '../CaseView.context';\nimport { SummaryField } from '../CaseView.types';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst Field = ({\n item,\n primary,\n truncate\n}: {\n item: SummaryField;\n primary: boolean;\n truncate: boolean;\n}) => {\n const { name, value, simpleValue } = item;\n const displayValue = simpleValue ?? value ?? <NoValue />;\n\n return (\n <StyledStackedFieldValue>\n <StyledLabel as={StyledFieldName}>{name}</StyledLabel>\n <StyledHeaderSummaryValue bold={primary} truncate={truncate}>\n {displayValue}\n </StyledHeaderSummaryValue>\n </StyledStackedFieldValue>\n );\n};\n\nconst Summary = ({ siblingRef }: { siblingRef: RefObject<HTMLDivElement> }) => {\n const { ltr } = useDirection();\n const { summaryFields } = useCaseViewContext();\n const chToPxConversionFactor = useChToPxConversionFactor();\n\n const containerRef = useRef<HTMLDivElement>(null);\n const listRef = useRef<HTMLDListElement>(null);\n\n const primaryItems = summaryFields?.primary ?? [];\n const secondaryItems = summaryFields?.secondary ?? [];\n const items = [...primaryItems, ...secondaryItems];\n\n const [displayCount, setDisplayCount] = useState(items.length);\n const [truncatedIndices, setTruncatedIndices] = useState<number[] | undefined>(\n items.map((_, i) => i)\n );\n\n const priorTrailingEdgeStack = useRef<number[]>([]);\n const priorAvailableSpace = useRef<number | null>(null);\n\n const evalItemAddition = ({\n nextSiblingLeadingEdge\n }: {\n nextSiblingLeadingEdge: number;\n }): {\n indicesToTruncate: number[];\n nextDisplayCount: number;\n } => {\n const indicesToTruncate: number[] = truncatedIndices ? [...truncatedIndices] : [];\n let nextDisplayCount = displayCount;\n\n const reversedTrailingEdgeStack = [...priorTrailingEdgeStack.current].reverse();\n for (let i = 0; i < reversedTrailingEdgeStack.length; i += 1) {\n const priorEdge = reversedTrailingEdgeStack[i];\n\n const shouldRender = ltr\n ? priorEdge < nextSiblingLeadingEdge\n : priorEdge > nextSiblingLeadingEdge;\n\n if (shouldRender) {\n priorTrailingEdgeStack.current.pop();\n\n if (!indicesToTruncate.includes(nextDisplayCount)) {\n indicesToTruncate.push(nextDisplayCount);\n }\n\n nextDisplayCount += 1;\n } else {\n break;\n }\n }\n\n return { indicesToTruncate, nextDisplayCount };\n };\n\n const evalTruncationReduction = ({\n listChildren,\n availableSpace\n }: {\n listChildren: Element[];\n availableSpace: number;\n }): {\n indicesToTruncate: number[];\n } => {\n const indicesToTruncate: number[] = [];\n let hasAvailableSpace = availableSpace;\n\n listChildren.forEach((item, index) => {\n const valueEl = item.lastChild as HTMLElement;\n const truncatedSpace = Math.floor(valueEl.scrollWidth - valueEl.offsetWidth);\n const shouldTruncate = truncatedSpace === 0 ? false : hasAvailableSpace - truncatedSpace <= 0;\n\n if (shouldTruncate) {\n if (!truncatedIndices?.includes(index)) {\n hasAvailableSpace += truncatedSpace;\n }\n\n indicesToTruncate.push(index);\n } else if (truncatedIndices?.includes(index)) {\n hasAvailableSpace -= truncatedSpace;\n }\n });\n\n return { indicesToTruncate };\n };\n\n const evalTruncationIncrease = ({\n listChildren,\n availableSpace\n }: {\n listChildren: Element[];\n availableSpace: number;\n }): {\n indicesToTruncate: number[];\n availableSpace: number;\n } => {\n const indicesToTruncate: number[] = [];\n const lastIndex = listChildren.length - 1;\n let hasAvailableSpace = availableSpace;\n\n [...listChildren].reverse().forEach((item, index) => {\n if (truncatedIndices?.includes(lastIndex - index)) {\n indicesToTruncate.push(lastIndex - index);\n } else if (hasAvailableSpace < 0) {\n const truncatedElMaxWidth = 20 * chToPxConversionFactor;\n const valueEl = item.lastChild as HTMLElement;\n const spaceToTruncate = Math.max(Math.floor(valueEl.offsetWidth - truncatedElMaxWidth), 0);\n\n if (spaceToTruncate) {\n indicesToTruncate.push(lastIndex - index);\n hasAvailableSpace += spaceToTruncate;\n }\n }\n });\n\n return { indicesToTruncate, availableSpace: hasAvailableSpace };\n };\n\n const evalItemRemoval = ({\n listChildren,\n availableSpace,\n nextSiblingLeadingEdge\n }: {\n listChildren: Element[];\n availableSpace: number;\n nextSiblingLeadingEdge: number;\n }): { displayCount: number } => {\n let nextDisplayCount = displayCount;\n let hasAvailableSpace = availableSpace;\n let lastChildIndex = listChildren.length - 1;\n\n do {\n const itemTrailingEdge = getEdge({\n el: listChildren[lastChildIndex],\n side: 'trailing',\n ltr\n });\n hasAvailableSpace = Math.floor(\n ltr ? nextSiblingLeadingEdge - itemTrailingEdge : itemTrailingEdge - nextSiblingLeadingEdge\n );\n\n if (hasAvailableSpace < 0) {\n priorTrailingEdgeStack.current = [...priorTrailingEdgeStack.current, itemTrailingEdge];\n\n nextDisplayCount -= 1;\n lastChildIndex -= 1;\n }\n } while (hasAvailableSpace < 0 && lastChildIndex > -1);\n\n return { displayCount: nextDisplayCount };\n };\n\n const evaluateSummaryDisplay = () => {\n const containerEl = containerRef.current;\n if (!containerEl) return;\n\n const listChildren = Array.from(listRef.current?.children ?? []);\n const lastSummaryItem = listChildren.length ? listChildren[listChildren.length - 1] : undefined;\n const nextSibling = siblingRef?.current ?? document.body;\n const nextSiblingLeadingEdge = getEdge({\n el: nextSibling,\n side: 'leading',\n ltr\n });\n const testEdge = lastSummaryItem\n ? getEdge({ el: lastSummaryItem, side: 'trailing', ltr })\n : getEdge({ el: containerEl, side: 'leading', ltr });\n let availableSpace = Math.floor(\n ltr ? nextSiblingLeadingEdge - testEdge : testEdge - nextSiblingLeadingEdge\n );\n if (availableSpace === priorAvailableSpace.current) return;\n\n priorAvailableSpace.current = availableSpace;\n\n let indicesToTruncate: number[] | undefined;\n let nextDisplayCount = displayCount;\n\n if (availableSpace >= 0) {\n if (displayCount !== items.length) {\n const additionsConfig = evalItemAddition({ nextSiblingLeadingEdge });\n\n indicesToTruncate = additionsConfig.indicesToTruncate;\n nextDisplayCount = additionsConfig.nextDisplayCount;\n } else if (truncatedIndices?.length) {\n const truncationConfig = evalTruncationReduction({\n listChildren,\n availableSpace\n });\n\n indicesToTruncate = truncationConfig.indicesToTruncate;\n }\n } else if (listChildren) {\n const truncationConfig = evalTruncationIncrease({\n listChildren,\n availableSpace\n });\n\n indicesToTruncate = truncationConfig.indicesToTruncate;\n availableSpace = truncationConfig.availableSpace;\n\n if (availableSpace < 0) {\n const removalConfig = evalItemRemoval({\n listChildren,\n availableSpace,\n nextSiblingLeadingEdge\n });\n\n nextDisplayCount = removalConfig.displayCount;\n }\n }\n\n setDisplayCount(nextDisplayCount);\n\n if (indicesToTruncate) {\n setTruncatedIndices(indicesToTruncate);\n }\n };\n\n // Initial display evaluation\n useEffect(() => {\n evaluateSummaryDisplay();\n }, []);\n\n // Overflow resize observer\n useEffect(() => {\n const resizeObserver = new ResizeObserver(evaluateSummaryDisplay);\n\n if (containerRef.current) {\n resizeObserver.observe(containerRef.current, { box: 'border-box' });\n }\n\n return () => {\n resizeObserver.disconnect();\n };\n }, [evaluateSummaryDisplay]);\n\n return (\n <Flex\n as={StyledHeaderSummaryBlock}\n item={{ grow: 1, shrink: 1 }}\n container={{ pad: [0.5, 0], alignItems: 'center' }}\n ref={containerRef}\n hasItems={displayCount > 0}\n >\n <Flex as={StyledHeaderSummary} container={{ gap: 4 }} ref={listRef}>\n {items.slice(0, displayCount).map((item, index) => {\n return (\n <Field\n item={item}\n primary={!!primaryItems?.length && index < primaryItems.length}\n truncate={!!truncatedIndices?.includes(index)}\n key={item.name}\n />\n );\n })}\n </Flex>\n </Flex>\n );\n};\n\nexport default Summary;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAW,MAAM,OAAO,CAAC;AAgBpC,QAAA,MAAM,WAAW,EAAE,EA6BlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Flex, Tabs, registerIcon } from '@pega/cosmos-react-core';
|
|
4
|
+
import * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';
|
|
5
|
+
import CaseHeader from './CaseHeader/CaseHeader';
|
|
6
|
+
import { StyledCaseSummary, StyledCaseSummaryInfo, StyledCaseSummaryContainer } from './CaseView.styles';
|
|
7
|
+
import { useCaseViewContext } from './CaseView.context';
|
|
8
|
+
import CaseSummaryFields from './CaseSummaryFields';
|
|
9
|
+
registerIcon(arrowMicroLeftIcon);
|
|
10
|
+
const CaseSummary = () => {
|
|
11
|
+
const { testIds, summaryFields, summaryExpanded, tabs, aboveMD, isPreview } = useCaseViewContext();
|
|
12
|
+
const summary = useMemo(() => {
|
|
13
|
+
return _jsx(CaseSummaryFields, { ...summaryFields, inSummaryPanel: true });
|
|
14
|
+
}, [summaryFields]);
|
|
15
|
+
return (_jsxs(Flex, { as: StyledCaseSummary, container: { direction: 'column' }, item: { shrink: 0 }, children: [_jsx(CaseHeader, {}), aboveMD && !isPreview && summaryExpanded && (summary || tabs.items.length > 1) && (_jsxs(StyledCaseSummaryInfo, { children: [_jsx(StyledCaseSummaryContainer, { children: summary }), tabs.items.length > 1 && (_jsx(Tabs, { "data-testid": testIds.tabs, type: 'vertical', tabs: tabs.items, onTabClick: tabs.onClick, currentTabId: tabs.currentTabId }))] }))] }));
|
|
16
|
+
};
|
|
17
|
+
export default CaseSummary;
|
|
18
|
+
//# sourceMappingURL=CaseSummary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,KAAK,kBAAkB,MAAM,yEAAyE,CAAC;AAE9G,OAAO,UAAU,MAAM,yBAAyB,CAAC;AACjD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,YAAY,CAAC,kBAAkB,CAAC,CAAC;AAEjC,MAAM,WAAW,GAAO,GAAG,EAAE;IAC3B,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GACzE,kBAAkB,EAAE,CAAC;IAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,OAAO,KAAC,iBAAiB,OAAK,aAAa,EAAE,cAAc,SAAG,CAAC;IACjE,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,MAAC,IAAI,IAAC,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,aAClF,KAAC,UAAU,KAAG,EAEb,OAAO,IAAI,CAAC,SAAS,IAAI,eAAe,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CACjF,MAAC,qBAAqB,eACpB,KAAC,0BAA0B,cAAE,OAAO,GAA8B,EAEjE,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,KAAC,IAAI,mBACU,OAAO,CAAC,IAAI,EACzB,IAAI,EAAC,UAAU,EACf,IAAI,EAAE,IAAI,CAAC,KAAK,EAChB,UAAU,EAAE,IAAI,CAAC,OAAO,EACxB,YAAY,EAAE,IAAI,CAAC,YAAY,GAC/B,CACH,IACqB,CACzB,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import { FC, useMemo } from 'react';\n\nimport { Flex, Tabs, registerIcon } from '@pega/cosmos-react-core';\nimport * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';\n\nimport CaseHeader from './CaseHeader/CaseHeader';\nimport {\n StyledCaseSummary,\n StyledCaseSummaryInfo,\n StyledCaseSummaryContainer\n} from './CaseView.styles';\nimport { useCaseViewContext } from './CaseView.context';\nimport CaseSummaryFields from './CaseSummaryFields';\n\nregisterIcon(arrowMicroLeftIcon);\n\nconst CaseSummary: FC = () => {\n const { testIds, summaryFields, summaryExpanded, tabs, aboveMD, isPreview } =\n useCaseViewContext();\n\n const summary = useMemo(() => {\n return <CaseSummaryFields {...summaryFields} inSummaryPanel />;\n }, [summaryFields]);\n\n return (\n <Flex as={StyledCaseSummary} container={{ direction: 'column' }} item={{ shrink: 0 }}>\n <CaseHeader />\n\n {aboveMD && !isPreview && summaryExpanded && (summary || tabs.items.length > 1) && (\n <StyledCaseSummaryInfo>\n <StyledCaseSummaryContainer>{summary}</StyledCaseSummaryContainer>\n\n {tabs.items.length > 1 && (\n <Tabs\n data-testid={testIds.tabs}\n type='vertical'\n tabs={tabs.items}\n onTabClick={tabs.onClick}\n currentTabId={tabs.currentTabId}\n />\n )}\n </StyledCaseSummaryInfo>\n )}\n </Flex>\n );\n};\n\nexport default CaseSummary;\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import { CaseSummaryFieldsProps } from './CaseView.types';
|
|
4
|
+
declare const CaseSummaryFields: FC<CaseSummaryFieldsProps & ForwardProps>;
|
|
5
|
+
export default CaseSummaryFields;
|
|
6
|
+
//# sourceMappingURL=CaseSummaryFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseSummaryFields.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAA2B,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAQ,YAAY,EAA0B,MAAM,yBAAyB,CAAC;AAOrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,GAAG,YAAY,CAsChE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { Grid, useI18n, useBreakpoint } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledCaseSummaryFields, StyledSummaryPrimaryList, StyledSummarySecondaryList } from './CaseView.styles';
|
|
5
|
+
import { useCaseViewContext } from './CaseView.context';
|
|
6
|
+
const CaseSummaryFields = ({ primary, secondary, inSummaryPanel }) => {
|
|
7
|
+
const t = useI18n();
|
|
8
|
+
const { testIds } = useCaseViewContext();
|
|
9
|
+
const containerRef = useRef(null);
|
|
10
|
+
const isSMContentWidthOrAbove = useBreakpoint('sm', {
|
|
11
|
+
breakpointRef: containerRef,
|
|
12
|
+
themeProp: 'content-width'
|
|
13
|
+
});
|
|
14
|
+
const wrapped = !inSummaryPanel && !isSMContentWidthOrAbove;
|
|
15
|
+
return (_jsxs(Grid, { "data-testid": testIds.summaryFields, as: StyledCaseSummaryFields, container: { rowGap: 2 }, ref: containerRef, children: [primary && (_jsx(StyledSummaryPrimaryList, { variant: 'stacked', fields: primary, "aria-label": t('primary_summary_fields'), wrapped: wrapped })), secondary && (_jsx(StyledSummarySecondaryList, { variant: wrapped ? 'stacked' : 'inline', fields: secondary, "aria-label": t('summary_fields') }))] }));
|
|
16
|
+
};
|
|
17
|
+
export default CaseSummaryFields;
|
|
18
|
+
//# sourceMappingURL=CaseSummaryFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAuB,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAAE,IAAI,EAAgB,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAErF,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,iBAAiB,GAA8C,CAAC,EACpE,OAAO,EACP,SAAS,EACT,cAAc,EAC0B,EAAE,EAAE;IAC5C,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,OAAO,EAAE,GAAG,kBAAkB,EAAE,CAAC;IACzC,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,uBAAuB,GAAG,aAAa,CAAC,IAAI,EAAE;QAClD,aAAa,EAAE,YAAY;QAC3B,SAAS,EAAE,eAAe;KAC3B,CAAC,CAAC;IACH,MAAM,OAAO,GAAG,CAAC,cAAc,IAAI,CAAC,uBAAuB,CAAC;IAE5D,OAAO,CACL,MAAC,IAAI,mBACU,OAAO,CAAC,aAAa,EAClC,EAAE,EAAE,uBAAuB,EAC3B,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,EACxB,GAAG,EAAE,YAAY,aAEhB,OAAO,IAAI,CACV,KAAC,wBAAwB,IACvB,OAAO,EAAC,SAAS,EACjB,MAAM,EAAE,OAAO,gBACH,CAAC,CAAC,wBAAwB,CAAC,EACvC,OAAO,EAAE,OAAO,GAChB,CACH,EACA,SAAS,IAAI,CACZ,KAAC,0BAA0B,IACzB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EACvC,MAAM,EAAE,SAAS,gBACL,CAAC,CAAC,gBAAgB,CAAC,GAC/B,CACH,IACI,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { FC, PropsWithoutRef, useRef } from 'react';\n\nimport { Grid, ForwardProps, useI18n, useBreakpoint } from '@pega/cosmos-react-core';\n\nimport {\n StyledCaseSummaryFields,\n StyledSummaryPrimaryList,\n StyledSummarySecondaryList\n} from './CaseView.styles';\nimport { CaseSummaryFieldsProps } from './CaseView.types';\nimport { useCaseViewContext } from './CaseView.context';\n\nconst CaseSummaryFields: FC<CaseSummaryFieldsProps & ForwardProps> = ({\n primary,\n secondary,\n inSummaryPanel\n}: PropsWithoutRef<CaseSummaryFieldsProps>) => {\n const t = useI18n();\n const { testIds } = useCaseViewContext();\n const containerRef = useRef<HTMLDivElement>(null);\n const isSMContentWidthOrAbove = useBreakpoint('sm', {\n breakpointRef: containerRef,\n themeProp: 'content-width'\n });\n const wrapped = !inSummaryPanel && !isSMContentWidthOrAbove;\n\n return (\n <Grid\n data-testid={testIds.summaryFields}\n as={StyledCaseSummaryFields}\n container={{ rowGap: 2 }}\n ref={containerRef}\n >\n {primary && (\n <StyledSummaryPrimaryList\n variant='stacked'\n fields={primary}\n aria-label={t('primary_summary_fields')}\n wrapped={wrapped}\n />\n )}\n {secondary && (\n <StyledSummarySecondaryList\n variant={wrapped ? 'stacked' : 'inline'}\n fields={secondary}\n aria-label={t('summary_fields')}\n />\n )}\n </Grid>\n );\n};\n\nexport default CaseSummaryFields;\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CaseViewContextValue } from './CaseView.types';
|
|
2
|
+
declare const CaseViewContext: import("react").Context<CaseViewContextValue>;
|
|
3
|
+
export declare const useCaseViewContext: () => CaseViewContextValue;
|
|
4
|
+
export default CaseViewContext;
|
|
5
|
+
//# sourceMappingURL=CaseView.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseView.context.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExD,QAAA,MAAM,eAAe,+CAAkE,CAAC;AAExF,eAAO,MAAM,kBAAkB,4BAAoC,CAAC;AAEpE,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseView.context.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAIlD,MAAM,eAAe,GAAG,aAAa,CAAuB,EAA0B,CAAC,CAAC;AAExF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAEpE,eAAe,eAAe,CAAC","sourcesContent":["import { createContext, useContext } from 'react';\n\nimport { CaseViewContextValue } from './CaseView.types';\n\nconst CaseViewContext = createContext<CaseViewContextValue>({} as CaseViewContextValue);\n\nexport const useCaseViewContext = () => useContext(CaseViewContext);\n\nexport default CaseViewContext;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
+
import { CaseViewProps } from './CaseView.types';
|
|
4
|
+
declare const _default: FC<CaseViewProps & ForwardProps> & {
|
|
5
|
+
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["header", "heading", "subheading", "icon", "edit", "actions", "promoted-actions", "summary-fields", "banners", "stages", "tasks", "tabs", "tab-content", "utilities"]>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=CaseView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAyD,MAAM,OAAO,CAAC;AAElF,OAAO,EASL,YAAY,EAYb,MAAM,yBAAyB,CAAC;AAmBjC,OAAO,EAAwB,aAAa,EAAE,MAAM,kBAAkB,CAAC;;;;AAupBvE,wBAAyD"}
|