@pega/cosmos-react-work 4.0.0-dev.9.1 → 4.0.0-rc.1
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 +7 -21
- package/lib/components/AppAnnouncement/AppAnnouncement.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/AppAnnouncement.js +3 -2
- package/lib/components/AppAnnouncement/AppAnnouncement.js.map +1 -1
- package/lib/components/AppAnnouncement/index.d.ts +1 -1
- package/lib/components/AppAnnouncement/index.d.ts.map +1 -1
- package/lib/components/AppAnnouncement/index.js.map +1 -1
- package/lib/components/Article/Article.d.ts +49 -0
- package/lib/components/Article/Article.d.ts.map +1 -0
- package/lib/components/Article/Article.js +73 -0
- package/lib/components/Article/Article.js.map +1 -0
- package/lib/components/Article/ArticleFooter.d.ts +40 -0
- package/lib/components/Article/ArticleFooter.d.ts.map +1 -0
- package/lib/components/Article/ArticleFooter.js +54 -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 +24 -0
- package/lib/components/Article/ArticleMeta.js.map +1 -0
- package/lib/components/Article/index.d.ts +5 -0
- package/lib/components/Article/index.d.ts.map +1 -0
- package/lib/components/Article/index.js +3 -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 +137 -0
- package/lib/components/ArticleList/ArticleList.js.map +1 -0
- package/lib/components/ArticleList/ArticleList.types.d.ts +87 -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 +61 -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 +56 -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 +9 -4
- package/lib/components/CasePreview/CasePreview.d.ts.map +1 -1
- package/lib/components/CasePreview/CasePreview.js +7 -10
- package/lib/components/CasePreview/CasePreview.js.map +1 -1
- 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 +1 -1
- package/lib/components/CasePreview/index.d.ts.map +1 -1
- package/lib/components/CasePreview/index.js.map +1 -1
- package/lib/components/CaseView/CaseHeader/CaseHeader.d.ts.map +1 -0
- package/lib/components/CaseView/CaseHeader/CaseHeader.js +119 -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.map +1 -1
- package/lib/components/CaseView/CaseSummary.js +9 -4
- package/lib/components/CaseView/CaseSummary.js.map +1 -1
- package/lib/components/CaseView/CaseSummaryFields.d.ts.map +1 -1
- package/lib/components/CaseView/CaseSummaryFields.js +12 -3
- package/lib/components/CaseView/CaseSummaryFields.js.map +1 -1
- package/lib/components/CaseView/CaseView.d.ts +4 -2
- package/lib/components/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.js +174 -67
- package/lib/components/CaseView/CaseView.js.map +1 -1
- package/lib/components/CaseView/CaseView.styles.d.ts +45 -22
- package/lib/components/CaseView/CaseView.styles.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.styles.js +298 -79
- package/lib/components/CaseView/CaseView.styles.js.map +1 -1
- 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 +17 -0
- package/lib/components/CaseView/CaseView.test-ids.js.map +1 -0
- package/lib/components/CaseView/CaseView.types.d.ts +23 -24
- package/lib/components/CaseView/CaseView.types.d.ts.map +1 -1
- package/lib/components/CaseView/CaseView.types.js.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts +0 -1
- package/lib/components/CaseView/UtilitiesSummary.d.ts.map +1 -1
- package/lib/components/CaseView/UtilitiesSummary.js +4 -8
- package/lib/components/CaseView/UtilitiesSummary.js.map +1 -1
- package/lib/components/CaseView/index.d.ts +1 -6
- package/lib/components/CaseView/index.d.ts.map +1 -1
- package/lib/components/CaseView/index.js +0 -4
- package/lib/components/CaseView/index.js.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.d.ts.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.js.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts +1 -3
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.d.ts.map +1 -1
- package/lib/components/ConfigurableLayout/ConfigurableLayout.types.js.map +1 -1
- package/lib/components/ConfigurableLayout/index.d.ts +1 -1
- package/lib/components/ConfigurableLayout/index.d.ts.map +1 -1
- package/lib/components/ConfigurableLayout/index.js.map +1 -1
- package/lib/components/Confirmation/Confirmation.d.ts +1 -1
- package/lib/components/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/Confirmation/Confirmation.js +20 -5
- package/lib/components/Confirmation/Confirmation.js.map +1 -1
- package/lib/components/Confirmation/index.d.ts +1 -1
- package/lib/components/Confirmation/index.d.ts.map +1 -1
- package/lib/components/Confirmation/index.js.map +1 -1
- package/lib/components/Details/Details.d.ts +8 -4
- package/lib/components/Details/Details.d.ts.map +1 -1
- package/lib/components/Details/Details.js +33 -21
- package/lib/components/Details/Details.js.map +1 -1
- package/lib/components/Details/Details.styles.d.ts +7 -4
- package/lib/components/Details/Details.styles.d.ts.map +1 -1
- package/lib/components/Details/Details.styles.js +46 -101
- package/lib/components/Details/Details.styles.js.map +1 -1
- 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/Glimpse/Glimpse.d.ts +10 -10
- package/lib/components/Glimpse/Glimpse.d.ts.map +1 -1
- package/lib/components/Glimpse/Glimpse.js +7 -17
- package/lib/components/Glimpse/Glimpse.js.map +1 -1
- package/lib/components/Glimpse/index.d.ts +1 -1
- package/lib/components/Glimpse/index.d.ts.map +1 -1
- package/lib/components/Glimpse/index.js +0 -1
- package/lib/components/Glimpse/index.js.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js +38 -27
- package/lib/components/IntelligentGuidance/IntelligentGuidance.js.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts +3 -2
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js +137 -81
- package/lib/components/IntelligentGuidance/IntelligentGuidance.styles.js.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts +9 -9
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/IntelligentGuidance.types.js.map +1 -1
- package/lib/components/IntelligentGuidance/index.d.ts +1 -1
- package/lib/components/IntelligentGuidance/index.d.ts.map +1 -1
- package/lib/components/IntelligentGuidance/index.js.map +1 -1
- 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/SearchResults.js +1 -1
- package/lib/components/SearchResults/SearchResults.js.map +1 -1
- package/lib/components/SearchResults/SearchResults.types.d.ts +5 -5
- package/lib/components/SearchResults/SearchResults.types.d.ts.map +1 -1
- package/lib/components/SearchResults/SearchResults.types.js.map +1 -1
- package/lib/components/SearchResults/index.d.ts +1 -1
- package/lib/components/SearchResults/index.d.ts.map +1 -1
- package/lib/components/SearchResults/index.js.map +1 -1
- package/lib/components/Stages/Stages.d.ts.map +1 -1
- package/lib/components/Stages/Stages.js +8 -8
- package/lib/components/Stages/Stages.js.map +1 -1
- package/lib/components/Stages/Stages.styles.d.ts.map +1 -1
- package/lib/components/Stages/Stages.styles.js +0 -2
- package/lib/components/Stages/Stages.styles.js.map +1 -1
- package/lib/components/Stages/index.d.ts +1 -1
- package/lib/components/Stages/index.d.ts.map +1 -1
- package/lib/components/Stages/index.js.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.d.ts.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.js +3 -3
- package/lib/components/Stakeholders/Stakeholders.js.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.types.d.ts +5 -13
- package/lib/components/Stakeholders/Stakeholders.types.d.ts.map +1 -1
- package/lib/components/Stakeholders/Stakeholders.types.js.map +1 -1
- package/lib/components/Stakeholders/index.d.ts +1 -1
- package/lib/components/Stakeholders/index.d.ts.map +1 -1
- package/lib/components/Stakeholders/index.js.map +1 -1
- package/lib/components/Tags/Tags.d.ts +1 -1
- package/lib/components/Tags/Tags.d.ts.map +1 -1
- package/lib/components/Tags/Tags.js +5 -21
- package/lib/components/Tags/Tags.js.map +1 -1
- package/lib/components/Tags/index.d.ts +2 -1
- package/lib/components/Tags/index.d.ts.map +1 -1
- package/lib/components/Tags/index.js.map +1 -1
- package/lib/components/Tasks/TaskList.d.ts +18 -7
- package/lib/components/Tasks/TaskList.d.ts.map +1 -1
- package/lib/components/Tasks/TaskList.js +48 -10
- package/lib/components/Tasks/TaskList.js.map +1 -1
- package/lib/components/Tasks/Tasks.d.ts +21 -15
- package/lib/components/Tasks/Tasks.d.ts.map +1 -1
- package/lib/components/Tasks/Tasks.js +9 -9
- package/lib/components/Tasks/Tasks.js.map +1 -1
- 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 +3 -5
- package/lib/components/Tasks/index.d.ts.map +1 -1
- package/lib/components/Tasks/index.js +1 -0
- package/lib/components/Tasks/index.js.map +1 -1
- package/lib/components/Timeline/Timeline.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.js +15 -13
- package/lib/components/Timeline/Timeline.js.map +1 -1
- package/lib/components/Timeline/Timeline.styles.d.ts +4 -5
- package/lib/components/Timeline/Timeline.styles.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.styles.js +28 -53
- package/lib/components/Timeline/Timeline.styles.js.map +1 -1
- package/lib/components/Timeline/Timeline.types.d.ts +8 -8
- package/lib/components/Timeline/Timeline.types.d.ts.map +1 -1
- package/lib/components/Timeline/Timeline.types.js.map +1 -1
- package/lib/components/Timeline/TimelineItem.d.ts.map +1 -1
- package/lib/components/Timeline/TimelineItem.js +19 -7
- package/lib/components/Timeline/TimelineItem.js.map +1 -1
- package/lib/components/Timeline/TimelineToolbar.js +1 -1
- package/lib/components/Timeline/TimelineToolbar.js.map +1 -1
- package/lib/components/Timeline/index.d.ts +1 -1
- package/lib/components/Timeline/index.d.ts.map +1 -1
- package/lib/components/Timeline/index.js.map +1 -1
- package/lib/components/Timeline/utils.d.ts +1 -0
- package/lib/components/Timeline/utils.d.ts.map +1 -1
- package/lib/components/Timeline/utils.js +12 -0
- package/lib/components/Timeline/utils.js.map +1 -1
- package/lib/index.d.ts +8 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -1
- package/package.json +14 -14
- package/lib/components/CaseView/CaseHeader.d.ts.map +0 -1
- package/lib/components/CaseView/CaseHeader.js +0 -49
- package/lib/components/CaseView/CaseHeader.js.map +0 -1
- package/lib/components/CaseView/MobileCaseView.d.ts +0 -13
- package/lib/components/CaseView/MobileCaseView.d.ts.map +0 -1
- package/lib/components/CaseView/MobileCaseView.js +0 -25
- package/lib/components/CaseView/MobileCaseView.js.map +0 -1
- /package/lib/components/CaseView/{CaseHeader.d.ts → CaseHeader/CaseHeader.d.ts} +0 -0
|
@@ -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,OAAO,KAAK,UAAU,MAAM,+DAA+D,CAAC;AAC5F,OAAO,KAAK,QAAQ,MAAM,6DAA6D,CAAC;AAExF,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEnC,MAAM,KAAK,GAAG,CAAC,EACb,IAAI,EACJ,OAAO,EACP,QAAQ,EAKT,EAAE,EAAE;IACH,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC1C,MAAM,YAAY,GAAG,WAAW,IAAI,KAAK,IAAI,KAAC,OAAO,KAAG,CAAC;IAEzD,OAAO,CACL,MAAC,uBAAuB,eACtB,KAAC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,EAAE,EAC5B,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,EAClD,GAAG,EAAE,YAAY,EACjB,QAAQ,EAAE,YAAY,GAAG,CAAC,YAE1B,KAAC,IAAI,IAAC,EAAE,EAAE,mBAAmB,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,OAAO,YAC/D,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;gBAChD,OAAO,CACL,KAAC,KAAK,IACJ,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,CAAC,CAAC,YAAY,EAAE,MAAM,IAAI,KAAK,GAAG,YAAY,CAAC,MAAM,EAC9D,QAAQ,EAAE,CAAC,CAAC,gBAAgB,EAAE,QAAQ,CAAC,KAAK,CAAC,IACxC,IAAI,CAAC,IAAI,CACd,CACH,CAAC;YACJ,CAAC,CAAC,GACG,GACF,CACR,CAAC;AACJ,CAAC,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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummary.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
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"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from 'react';
|
|
2
3
|
import { Flex, Tabs, registerIcon } from '@pega/cosmos-react-core';
|
|
3
4
|
import * as arrowMicroLeftIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-micro-left.icon';
|
|
4
|
-
import CaseHeader from './CaseHeader';
|
|
5
|
-
import { StyledCaseSummary, StyledCaseSummaryInfo } from './CaseView.styles';
|
|
5
|
+
import CaseHeader from './CaseHeader/CaseHeader';
|
|
6
|
+
import { StyledCaseSummary, StyledCaseSummaryInfo, StyledCaseSummaryContainer } from './CaseView.styles';
|
|
6
7
|
import { useCaseViewContext } from './CaseView.context';
|
|
8
|
+
import CaseSummaryFields from './CaseSummaryFields';
|
|
7
9
|
registerIcon(arrowMicroLeftIcon);
|
|
8
10
|
const CaseSummary = () => {
|
|
9
|
-
const {
|
|
10
|
-
|
|
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 }))] }))] }));
|
|
11
16
|
};
|
|
12
17
|
export default CaseSummary;
|
|
13
18
|
//# sourceMappingURL=CaseSummary.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"CaseSummary.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,OAAO,EAAE,MAAM,OAAO,CAAC;AAEpC,OA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AAO,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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummaryFields.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,
|
|
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"}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { Grid, useI18n, useBreakpoint } from '@pega/cosmos-react-core';
|
|
3
4
|
import { StyledCaseSummaryFields, StyledSummaryPrimaryList, StyledSummarySecondaryList } from './CaseView.styles';
|
|
4
|
-
|
|
5
|
+
import { useCaseViewContext } from './CaseView.context';
|
|
6
|
+
const CaseSummaryFields = ({ primary, secondary, inSummaryPanel }) => {
|
|
5
7
|
const t = useI18n();
|
|
6
|
-
|
|
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') }))] }));
|
|
7
16
|
};
|
|
8
17
|
export default CaseSummaryFields;
|
|
9
18
|
//# sourceMappingURL=CaseSummaryFields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSummaryFields.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseSummaryFields.tsx"],"names":[],"mappings":";
|
|
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"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ForwardProps } from '@pega/cosmos-react-core';
|
|
3
3
|
import { CaseViewProps } from './CaseView.types';
|
|
4
|
-
declare const
|
|
5
|
-
|
|
4
|
+
declare const _default: FC<CaseViewProps & ForwardProps> & {
|
|
5
|
+
getTestIds: (testIdProp?: string | undefined) => import("@pega/cosmos-react-core").TestIdsRecord<readonly ["header", "heading", "subheading", "edit", "actions", "promoted-actions", "summary-fields", "banners", "stages", "tasks", "tabs", "tab-content", "utilities"]>;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
6
8
|
//# sourceMappingURL=CaseView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAyD,MAAM,OAAO,CAAC;AAElF,OAAO,
|
|
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;;;;AAqpBvE,wBAAyD"}
|
|
@@ -1,15 +1,41 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useRef, useLayoutEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
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
4
|
import * as moveRightSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-right-solid.icon';
|
|
5
5
|
import * as moveLeftSolidIcon from '@pega/cosmos-react-core/lib/components/Icon/icons/move-left-solid.icon';
|
|
6
6
|
import CaseSummary from './CaseSummary';
|
|
7
7
|
import UtilitiesSummary from './UtilitiesSummary';
|
|
8
|
-
import { StyledCaseDrawer, StyledCaseDrawerContent, StyledCaseView, StyledWorkArea, StyledPersistentUtility, StyledSummary, StyledSummaryTabContent, StyledUtilities,
|
|
8
|
+
import { StyledCaseDrawer, StyledCaseDrawerContent, StyledCaseView, StyledWorkArea, StyledPersistentUtility, StyledSummary, StyledSummaryTabContent, StyledUtilities, StyledExpandCollapseUtilitiesButton, StyledUtilitiesHeading } from './CaseView.styles';
|
|
9
9
|
import CaseViewContext from './CaseView.context';
|
|
10
10
|
import CaseSummaryFields from './CaseSummaryFields';
|
|
11
|
+
import { getCaseViewTestIds } from './CaseView.test-ids';
|
|
11
12
|
registerIcon(moveRightSolidIcon, moveLeftSolidIcon);
|
|
12
|
-
|
|
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,
|
|
13
39
|
// Case data mostly visually related to the case header
|
|
14
40
|
caseId, heading, subheading, caseLink, parentCases, icon, followed, onFollowedChange, onEdit, actions, promotedActions,
|
|
15
41
|
// Summary content and state props
|
|
@@ -22,9 +48,7 @@ banners, stages, tasks, tabContent: tabContentProp = [],
|
|
|
22
48
|
utilities, utilitiesSummaryItems, utilitiesExpanded: utilitiesExpandedProp = true, onToggleUtilities,
|
|
23
49
|
// Etc...
|
|
24
50
|
persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
25
|
-
const
|
|
26
|
-
return _jsx(CaseSummaryFields, { ...summaryFields });
|
|
27
|
-
}, [summaryFields]);
|
|
51
|
+
const testIds = useTestIds(testId, getCaseViewTestIds);
|
|
28
52
|
// General util hooks
|
|
29
53
|
const t = useI18n();
|
|
30
54
|
const direction = useDirection();
|
|
@@ -32,19 +56,22 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
|
32
56
|
// Element refs
|
|
33
57
|
const caseViewRef = useRef(null);
|
|
34
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);
|
|
35
63
|
// Tab content
|
|
36
64
|
const [tabContentEl, setTabContentEl] = useElement(null);
|
|
37
65
|
// Breakpoint booleans
|
|
66
|
+
const smOrAbove = useBreakpoint('sm');
|
|
38
67
|
const mdOrAbove = useBreakpoint('md', { breakpointRef: caseViewRef });
|
|
39
68
|
const lgOrAbove = useBreakpoint('lg', { breakpointRef: caseViewRef });
|
|
40
69
|
const xlOrAbove = useBreakpoint('xl', { breakpointRef: caseViewRef });
|
|
41
70
|
// DOM ids
|
|
71
|
+
const initialTabId = tabItemsProp[0]?.id;
|
|
42
72
|
const summaryTabId = `summary-${caseId}`;
|
|
43
73
|
const utilitiesTabId = `utilities-${caseId}`;
|
|
44
74
|
const persistentUtilityTabId = `persistent-utility-${caseId}`;
|
|
45
|
-
const summaryId = `summary-${caseId}`;
|
|
46
|
-
const utilitiesId = `utilities-${caseId}`;
|
|
47
|
-
const utilitiesDrawerId = `utilities-drawer-${caseId}`;
|
|
48
75
|
// Summary state handling
|
|
49
76
|
let summaryExpanded = !isPreview && !!summaryExpandedProp;
|
|
50
77
|
if (persistentUtility) {
|
|
@@ -89,57 +116,51 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
|
89
116
|
}
|
|
90
117
|
// Purposely not listing utilitiesExpanded as a dependency as it is not a trigger and will be captured when BPs change
|
|
91
118
|
}, [mdOrAbove, lgOrAbove]);
|
|
92
|
-
//
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return !summaryExpanded || (persistentUtility && !xlOrAbove)
|
|
97
|
-
? [summaryTab, ...tabItemsProp]
|
|
98
|
-
: tabItemsProp;
|
|
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();
|
|
99
123
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
if (persistentUtility && !mdOrAbove) {
|
|
104
|
-
utilityTabs.push({ id: persistentUtilityTabId, name: persistentUtility.title });
|
|
124
|
+
if (!toggleButtonRef.current) {
|
|
125
|
+
// Toggle button is not on DOM.
|
|
126
|
+
isToggleButtonFocused.current = false;
|
|
105
127
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
summaryTabId,
|
|
111
|
-
utilitiesTabId,
|
|
112
|
-
persistentUtilityTabId,
|
|
113
|
-
utilities,
|
|
114
|
-
persistentUtility,
|
|
115
|
-
tabItemsProp,
|
|
116
|
-
summaryExpanded
|
|
117
|
-
]);
|
|
118
|
-
// Setup tab content
|
|
119
|
-
const tabContent = useMemo(() => {
|
|
128
|
+
}, [utilitiesExpanded, mdOrAbove, lgOrAbove]);
|
|
129
|
+
// Prepare tabs
|
|
130
|
+
const [tabItems, tabContent] = useMemo(() => {
|
|
131
|
+
const summaryTab = { id: summaryTabId, name: t('summary') };
|
|
120
132
|
const summaryTabContent = {
|
|
121
133
|
id: summaryTabId,
|
|
122
|
-
content: (_jsx(Card, { children: _jsx(StyledSummaryTabContent, { children:
|
|
134
|
+
content: (_jsx(Card, { children: _jsx(StyledSummaryTabContent, { children: _jsx(CaseSummaryFields, { ...summaryFields }) }) }))
|
|
123
135
|
};
|
|
136
|
+
let items = tabItemsProp;
|
|
137
|
+
let content = tabContentProp;
|
|
124
138
|
if (mdOrAbove) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
139
|
+
if (!summaryExpanded || (persistentUtility && !xlOrAbove)) {
|
|
140
|
+
items = [summaryTab, ...tabItemsProp];
|
|
141
|
+
content = [summaryTabContent, ...tabContentProp];
|
|
142
|
+
}
|
|
143
|
+
return [items, content];
|
|
128
144
|
}
|
|
129
|
-
const
|
|
145
|
+
const utilityTabsItems = [];
|
|
146
|
+
const utilityTabsContent = [];
|
|
130
147
|
if (utilities) {
|
|
131
|
-
|
|
148
|
+
utilityTabsItems.push({ id: utilitiesTabId, name: t('utilities') });
|
|
149
|
+
utilityTabsContent.push({
|
|
132
150
|
id: utilitiesTabId,
|
|
133
151
|
content: _jsx(Flex, { container: { direction: 'column', gap: 2 }, children: utilities })
|
|
134
152
|
});
|
|
135
153
|
}
|
|
136
154
|
if (persistentUtility) {
|
|
137
|
-
|
|
155
|
+
utilityTabsItems.push({ id: persistentUtilityTabId, name: persistentUtility.title });
|
|
156
|
+
utilityTabsContent.push({ id: persistentUtilityTabId, content: persistentUtility?.content });
|
|
138
157
|
}
|
|
139
|
-
|
|
158
|
+
items = [summaryTab, ...tabItemsProp, ...utilityTabsItems];
|
|
159
|
+
content = [summaryTabContent, ...tabContentProp, ...utilityTabsContent];
|
|
160
|
+
return [items, content];
|
|
140
161
|
}, [
|
|
162
|
+
tabItemsProp,
|
|
141
163
|
summaryTabId,
|
|
142
|
-
summary,
|
|
143
164
|
mdOrAbove,
|
|
144
165
|
summaryExpanded,
|
|
145
166
|
persistentUtility,
|
|
@@ -214,11 +235,13 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
|
214
235
|
useScrollStick(
|
|
215
236
|
// isMediumOrAbove means side by side columns | | |
|
|
216
237
|
mdOrAbove ? { ...scrollStickOptions.current, offset: stickOffset } : undefined);
|
|
238
|
+
// Preview set summary tab active
|
|
217
239
|
useEffect(() => {
|
|
218
240
|
if (isPreview) {
|
|
219
241
|
onTabClick(summaryTabId);
|
|
220
242
|
}
|
|
221
243
|
}, []);
|
|
244
|
+
// Initial tab selection
|
|
222
245
|
useEffect(() => {
|
|
223
246
|
if (mdOrAbove &&
|
|
224
247
|
summaryExpanded &&
|
|
@@ -226,11 +249,32 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
|
226
249
|
(currentTabId === summaryTabId || currentTabId === utilitiesTabId)) {
|
|
227
250
|
onTabClick(tabItemsProp[0]?.id);
|
|
228
251
|
}
|
|
229
|
-
|
|
252
|
+
// Toggle utilities tab selection
|
|
253
|
+
if (mdOrAbove && [utilitiesTabId, persistentUtilityTabId].includes(currentTabId)) {
|
|
254
|
+
onTabClick(initialTabId);
|
|
255
|
+
}
|
|
256
|
+
}, [mdOrAbove]);
|
|
257
|
+
// Initial / summary tab selection
|
|
230
258
|
useEffect(() => {
|
|
231
|
-
if (
|
|
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) {
|
|
232
269
|
onTabClick(summaryTabId);
|
|
233
|
-
|
|
270
|
+
}
|
|
271
|
+
}, [isPreview]);
|
|
272
|
+
// Initial tab selection
|
|
273
|
+
useEffect(() => {
|
|
274
|
+
if (summaryExpanded && currentTabId === summaryTabId) {
|
|
275
|
+
onTabClick(initialTabId);
|
|
276
|
+
}
|
|
277
|
+
}, [summaryExpanded]);
|
|
234
278
|
// Handles scrolling to tab content for newly clicked tab
|
|
235
279
|
useEffect(() => {
|
|
236
280
|
if (!tabContentEl)
|
|
@@ -252,7 +296,9 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
|
252
296
|
}, [summaryExpanded]);
|
|
253
297
|
// CaseView context value
|
|
254
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
|
|
255
300
|
const ctxValue = {
|
|
301
|
+
testIds,
|
|
256
302
|
caseId,
|
|
257
303
|
heading,
|
|
258
304
|
subheading,
|
|
@@ -264,49 +310,110 @@ persistentUtility, intelligentGuidance, isPreview = false, ...restProps }) => {
|
|
|
264
310
|
actions,
|
|
265
311
|
promotedActions,
|
|
266
312
|
onEdit,
|
|
267
|
-
|
|
313
|
+
summaryFields,
|
|
268
314
|
tabs: {
|
|
269
315
|
items: tabItems,
|
|
270
316
|
onClick: onTabClick,
|
|
271
317
|
currentTabId
|
|
272
318
|
},
|
|
319
|
+
stages,
|
|
320
|
+
tasks,
|
|
273
321
|
persistentUtility,
|
|
274
322
|
intelligentGuidance,
|
|
275
|
-
summaryId,
|
|
276
323
|
summaryExpanded,
|
|
277
324
|
utilitiesExpanded,
|
|
278
325
|
onToggleSummary,
|
|
279
326
|
isPreview,
|
|
327
|
+
aboveSM: smOrAbove,
|
|
280
328
|
aboveMD: mdOrAbove,
|
|
281
329
|
aboveLG: lgOrAbove,
|
|
282
330
|
aboveXL: xlOrAbove
|
|
283
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' }) }));
|
|
284
392
|
// Here we go...
|
|
285
|
-
return (_jsxs(_Fragment, { children: [_jsx(CaseViewContext.Provider, { value: ctxValue, children: _jsxs(Grid, { as: StyledCaseView, ref: caseViewRef, container: caseViewGridContainer, item: { area: 'case-view' },
|
|
286
|
-
// Used for aria-controls on the toggle button
|
|
287
|
-
, {
|
|
288
|
-
// Used for aria-controls on the toggle button
|
|
289
|
-
id: summaryId, as: StyledSummary, item: { area: 'summary' }, desktop: mdOrAbove && (!persistentUtility || xlOrAbove) && !summaryExpanded, isLargeOrAbove: lgOrAbove, ref: summaryRef, children: _jsx(CaseSummary, {}) }), _jsxs(Flex, { container: {
|
|
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: {
|
|
290
394
|
direction: 'column',
|
|
291
395
|
alignContent: 'start',
|
|
292
396
|
rowGap: 2
|
|
293
|
-
}, as: StyledWorkArea, persistentUtility: Boolean(persistentUtility),
|
|
397
|
+
}, as: StyledWorkArea, persistentUtility: Boolean(persistentUtility), ref: (el) => {
|
|
398
|
+
workAreaRef.current = el;
|
|
294
399
|
if (el)
|
|
295
|
-
|
|
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);
|
|
296
408
|
}, as: StyledUtilities, container: {
|
|
297
409
|
cols: 'minmax(0, 1fr)',
|
|
298
|
-
rowGap: 2
|
|
299
|
-
pad: [2, 0, 2]
|
|
410
|
+
rowGap: 2
|
|
300
411
|
}, item: {
|
|
301
412
|
area: 'utilities'
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
else {
|
|
307
|
-
onToggleUtilities?.();
|
|
308
|
-
}
|
|
309
|
-
}, as: StyledUtilToggle, label: t(utilitiesExpanded ? 'collapse_utilities_panel' : 'expand_utilities_panel'), children: _jsx(Icon, { name: `move-${utilitiesExpanded ? direction.end : direction.start}-solid` }) }) }), lgOrAbove && utilitiesExpanded && (_jsx(Flex, { container: { direction: 'column', gap: 2 }, id: utilitiesId, children: utilities })), (!utilitiesExpanded || (mdOrAbove && !lgOrAbove)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems, onClick: onToggleUtilities, "aria-expanded": utilitiesExpanded ? 'true' : 'false', "aria-controls": lgOrAbove ? utilitiesId : utilitiesDrawerId }))] }))] }) }), intelligentGuidance] }));
|
|
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)) && (_jsx(UtilitiesSummary, { items: utilitiesSummaryItems }))] }))] }) }), intelligentGuidance] }));
|
|
310
417
|
};
|
|
311
|
-
export default CaseView;
|
|
418
|
+
export default withTestIds(CaseView, getCaseViewTestIds);
|
|
312
419
|
//# sourceMappingURL=CaseView.js.map
|