@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Timeline.types.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n FieldValueListProps,\n IconProps,\n ListToolbarProps,\n NoChildrenProp,\n OmitStrict,\n StatusProps\n} from '@pega/cosmos-react-core';\nimport { DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTime.types';\nimport { AcceptedMouseEventElement } from '@pega/cosmos-react-core/lib/components/Menu/Menu.types';\n\nexport interface ActivityObject {\n /** Unique id for activity */\n id: string;\n /** Date as ISO8601 string, timestamp or native Date object. */\n date: string | number | Date;\n /** Header region for rendering text and links. */\n title: ReactNode;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon?: IconProps['name'];\n /** Represents the current status of activity */\n status?: StatusProps;\n /** The set of field values to render in the list. */\n content?: FieldValueListProps['fields'] |
|
|
1
|
+
{"version":3,"file":"Timeline.types.js","sourceRoot":"","sources":["../../../src/components/Timeline/Timeline.types.ts"],"names":[],"mappings":"","sourcesContent":["import { MouseEvent, ReactElement, ReactNode, Ref } from 'react';\n\nimport {\n BaseProps,\n FieldValueListProps,\n IconProps,\n ListToolbarProps,\n NoChildrenProp,\n OmitStrict,\n StatusProps\n} from '@pega/cosmos-react-core';\nimport { DateTimeVariant } from '@pega/cosmos-react-core/lib/components/DateTime/DateTime.types';\nimport { AcceptedMouseEventElement } from '@pega/cosmos-react-core/lib/components/Menu/Menu.types';\n\nexport interface ActivityObject {\n /** Unique id for activity */\n id: string;\n /** Date as ISO8601 string, timestamp or native Date object. */\n date: string | number | Date;\n /** Header region for rendering text and links. */\n title: ReactNode;\n /** Name of the icon (to be selected from default Pega icon set) */\n icon?: IconProps['name'];\n /** Represents the current status of activity */\n status?: StatusProps;\n /** The set of field values to render in the list. */\n content?: FieldValueListProps['fields'] | ReactElement;\n}\n\nexport type TimelineSortOrder = 'ascending' | 'descending';\nexport type TimelineGroupBy =\n | Extract<DateTimeVariant, 'date' | 'monthyear' | 'quarteryear' | 'year'>\n | 'none';\n\nexport default interface TimelineProps extends BaseProps, NoChildrenProp {\n /** List of activity */\n activity: ActivityObject[];\n /** Current time as Date */\n currentTime: Date;\n /**\n * List of activity sorted in ascending or descending order.\n * @default 'descending'\n */\n sortOrder?: TimelineSortOrder;\n /**\n * List of activity grouped by day, month, quarter or year.\n * @default 'date'\n */\n groupBy?: TimelineGroupBy;\n /**\n * Show a Progress indicator at the end of a list where newly loaded items will be appended.\n * @default false\n */\n loading?: boolean;\n /** Callback to fetch more activity items */\n loadMore?: () => void;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLTableElement>;\n}\n\nexport interface TimelineToolbarProps extends OmitStrict<ListToolbarProps, 'sort' | 'group'> {\n sort?: {\n /** An item click handler for all item clicks. */\n onItemClick: (id: TimelineSortOrder, e: MouseEvent<AcceptedMouseEventElement>) => void;\n /**\n * Currently selected sort order.\n * @default 'descending'\n */\n selected: TimelineProps['sortOrder'];\n };\n group?: {\n /** An item click handler for all item clicks. */\n onItemClick: (id: TimelineGroupBy, e: MouseEvent<AcceptedMouseEventElement>) => void;\n /**\n * Currently selected sort order.\n * @default 'date'\n */\n selected: TimelineProps['groupBy'];\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TimelineItem.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiD,MAAM,OAAO,CAAC;AAEzF,OAAO,EAEL,YAAY,EAKZ,oBAAoB,EAErB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYvD,UAAU,iBAAiB;IACzB,IAAI,EAAE,cAAc,CAAC;IACrB,UAAU,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;IAC5C,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,YAAY,EAAE,cAAc,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD,WAAW,EAAE,IAAI,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,GAAG,YAAY,CAgHrE,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { isValidElement, useCallback, useState } from 'react';
|
|
3
|
-
import { ExpandCollapse, Grid, Icon, Status, useBreakpoint,
|
|
4
|
-
import { StyledCard, StyledCardHeader,
|
|
2
|
+
import { isValidElement, useCallback, useRef, useState } from 'react';
|
|
3
|
+
import { ExpandCollapse, Grid, Icon, Status, useBreakpoint, FieldValueItem } from '@pega/cosmos-react-core';
|
|
4
|
+
import { StyledCard, StyledCardHeader, StyledTimelineIcon, StyledCardContent, StyledBulletWrapper, StyledToggleButton, StyledTime } from './Timeline.styles';
|
|
5
5
|
import { isFutureDate } from './utils';
|
|
6
6
|
const TimelineItem = ({ item: { date, title, icon, status, content }, timeFormat, prevItemDate, nextItemDate, currentTime }) => {
|
|
7
7
|
const [collapsed, setCollapsed] = useState(true);
|
|
8
8
|
const isSmallOrAbove = useBreakpoint('sm');
|
|
9
9
|
const toggleCollapse = useCallback(() => setCollapsed(prevState => !prevState), []);
|
|
10
|
-
|
|
10
|
+
const contentListRef = useRef(null);
|
|
11
|
+
const isSMContentWidthOrAbove = useBreakpoint('sm', {
|
|
12
|
+
breakpointRef: contentListRef
|
|
13
|
+
});
|
|
14
|
+
return (_jsxs("li", { children: [isSmallOrAbove && _jsx(StyledTime, { variant: timeFormat, value: date }), _jsx(StyledBulletWrapper, { hasIcon: !!icon, hasPrev: !!prevItemDate, hasNext: !!nextItemDate, isPrevFuture: isFutureDate(prevItemDate, currentTime), isNextFuture: isFutureDate(nextItemDate, currentTime), children: _jsx(StyledTimelineIcon, { container: { inline: true, alignItems: 'center', justify: 'center' }, children: icon && _jsx(Icon, { name: icon }) }) }), _jsxs("div", { children: [_jsx("div", { children: _jsx(StyledCard, { children: _jsxs(StyledCardHeader, { container: {
|
|
11
15
|
cols: 'auto 1fr',
|
|
12
16
|
alignContent: 'evenly',
|
|
13
|
-
alignItems: 'center'
|
|
14
|
-
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
gap: 0.5
|
|
19
|
+
}, sm: { container: { cols: 'auto 1fr auto' } }, children: [content && (_jsx(StyledToggleButton, { icon: true, variant: 'simple', onClick: toggleCollapse, collapsed: collapsed, "aria-expanded": !collapsed, compact: true, children: _jsx(Icon, { name: 'caret-down' }) })), _jsxs(Grid, { item: { colStart: '2', colEnd: '2' }, container: { rowGap: 0.25 }, children: [title, !isSmallOrAbove && (_jsxs(Grid, { container: {
|
|
15
20
|
cols: '1fr auto',
|
|
16
21
|
alignContent: 'evenly',
|
|
17
22
|
alignItems: 'center'
|
|
18
|
-
}, children: [_jsx(StyledTime, { variant: 'time', value: date }), status && _jsx(Status, { variant: status.variant, children: status.children })] }))] }), isSmallOrAbove && status && (_jsx(Grid, { sm: { item: { colStart: '3', colEnd: '3' } }, children: _jsx(Status, { variant: status.variant, children: status.children }) }))] }) }) }), content && (_jsx(ExpandCollapse, { dimension: 'height', collapsed: collapsed, nullWhenCollapsed: true, children: _jsx(StyledCardContent, { children: isValidElement(content) ? (content) : (_jsx(
|
|
23
|
+
}, children: [_jsx(StyledTime, { variant: 'time', value: date }), status && _jsx(Status, { variant: status.variant, children: status.children })] }))] }), isSmallOrAbove && status && (_jsx(Grid, { sm: { item: { colStart: '3', colEnd: '3' } }, children: _jsx(Status, { variant: status.variant, children: status.children }) }))] }) }) }), content && (_jsx(ExpandCollapse, { dimension: 'height', collapsed: collapsed, nullWhenCollapsed: true, children: _jsx(StyledCardContent, { children: isValidElement(content) ? (content) : (_jsx(Grid, { container: {
|
|
24
|
+
gap: 1,
|
|
25
|
+
cols: isSMContentWidthOrAbove
|
|
26
|
+
? `repeat(${content.length > 1 ? '2' : '1'}, minmax(16ch, auto) minmax(25%, 1fr))`
|
|
27
|
+
: 'minmax(0, 1fr)'
|
|
28
|
+
}, ref: contentListRef, children: content.map(({ id, name, value, variant }) => {
|
|
29
|
+
return (_jsx(FieldValueItem, { name: name, value: value, variant: isSmallOrAbove ? variant : 'stacked' }, id ?? name));
|
|
30
|
+
}) })) }) }))] })] }));
|
|
19
31
|
};
|
|
20
32
|
export default TimelineItem;
|
|
21
33
|
//# sourceMappingURL=TimelineItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineItem.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TimelineItem.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineItem.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,cAAc,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,E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GAAG,EAAE,EAAE,YAChD,KAAC,MAAM,IAAC,OAAO,EAAE,MAAM,CAAC,OAAO,YAAG,MAAM,CAAC,QAAQ,GAAU,GACtD,CACR,IACgB,GACR,GACT,EACL,OAAO,IAAI,CACV,KAAC,cAAc,IAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAE,SAAS,EAAE,iBAAiB,kBACxE,KAAC,iBAAiB,cACf,cAAc,CAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAC9B,OAAO,CACR,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IACH,SAAS,EAAE;oCACT,GAAG,EAAE,CAAC;oCACN,IAAI,EAAE,uBAAuB;wCAC3B,CAAC,CAAC,UACE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAC7B,wCAAwC;wCAC1C,CAAC,CAAC,gBAAgB;iCACrB,EACD,GAAG,EAAE,cAAc,YAElB,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;oCAC5C,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,IACxC,EAAE,IAAI,IAAI,CACf,CACH,CAAC;gCACJ,CAAC,CAAC,GACG,CACR,GACiB,GACL,CAClB,IACG,IACH,CACN,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FunctionComponent, isValidElement, useCallback, useRef, useState } from 'react';\n\nimport {\n ExpandCollapse,\n ForwardProps,\n Grid,\n Icon,\n Status,\n useBreakpoint,\n DateTimeDisplayProps,\n FieldValueItem\n} from '@pega/cosmos-react-core';\n\nimport type { ActivityObject } from './Timeline.types';\nimport {\n StyledCard,\n StyledCardHeader,\n StyledTimelineIcon,\n StyledCardContent,\n StyledBulletWrapper,\n StyledToggleButton,\n StyledTime\n} from './Timeline.styles';\nimport { isFutureDate } from './utils';\n\ninterface TimelineItemProps {\n item: ActivityObject;\n timeFormat: DateTimeDisplayProps['variant'];\n prevItemDate: ActivityObject['date'] | undefined;\n nextItemDate: ActivityObject['date'] | undefined;\n currentTime: Date;\n}\n\nconst TimelineItem: FunctionComponent<TimelineItemProps & ForwardProps> = ({\n item: { date, title, icon, status, content },\n timeFormat,\n prevItemDate,\n nextItemDate,\n currentTime\n}: TimelineItemProps & ForwardProps) => {\n const [collapsed, setCollapsed] = useState(true);\n const isSmallOrAbove = useBreakpoint('sm');\n\n const toggleCollapse = useCallback(() => setCollapsed(prevState => !prevState), []);\n const contentListRef = useRef<HTMLDivElement>(null);\n const isSMContentWidthOrAbove = useBreakpoint('sm', {\n breakpointRef: contentListRef\n });\n\n return (\n <li>\n {isSmallOrAbove && <StyledTime variant={timeFormat} value={date} />}\n <StyledBulletWrapper\n hasIcon={!!icon}\n hasPrev={!!prevItemDate}\n hasNext={!!nextItemDate}\n isPrevFuture={isFutureDate(prevItemDate, currentTime)}\n isNextFuture={isFutureDate(nextItemDate, currentTime)}\n >\n <StyledTimelineIcon container={{ inline: true, alignItems: 'center', justify: 'center' }}>\n {icon && <Icon name={icon} />}\n </StyledTimelineIcon>\n </StyledBulletWrapper>\n <div>\n <div>\n <StyledCard>\n <StyledCardHeader\n container={{\n cols: 'auto 1fr',\n alignContent: 'evenly',\n alignItems: 'center',\n gap: 0.5\n }}\n sm={{ container: { cols: 'auto 1fr auto' } }}\n >\n {content && (\n <StyledToggleButton\n icon\n variant='simple'\n onClick={toggleCollapse}\n collapsed={collapsed}\n aria-expanded={!collapsed}\n compact\n >\n <Icon name='caret-down' />\n </StyledToggleButton>\n )}\n <Grid item={{ colStart: '2', colEnd: '2' }} container={{ rowGap: 0.25 }}>\n {title}\n {!isSmallOrAbove && (\n <Grid\n container={{\n cols: '1fr auto',\n alignContent: 'evenly',\n alignItems: 'center'\n }}\n >\n <StyledTime variant='time' value={date} />\n {status && <Status variant={status.variant}>{status.children}</Status>}\n </Grid>\n )}\n </Grid>\n {isSmallOrAbove && status && (\n <Grid sm={{ item: { colStart: '3', colEnd: '3' } }}>\n <Status variant={status.variant}>{status.children}</Status>\n </Grid>\n )}\n </StyledCardHeader>\n </StyledCard>\n </div>\n {content && (\n <ExpandCollapse dimension='height' collapsed={collapsed} nullWhenCollapsed>\n <StyledCardContent>\n {isValidElement<any>(content) ? (\n content\n ) : (\n <Grid\n container={{\n gap: 1,\n cols: isSMContentWidthOrAbove\n ? `repeat(${\n content.length > 1 ? '2' : '1'\n }, minmax(16ch, auto) minmax(25%, 1fr))`\n : 'minmax(0, 1fr)'\n }}\n ref={contentListRef}\n >\n {content.map(({ id, name, value, variant }) => {\n return (\n <FieldValueItem\n name={name}\n value={value}\n variant={isSmallOrAbove ? variant : 'stacked'}\n key={id ?? name}\n />\n );\n })}\n </Grid>\n )}\n </StyledCardContent>\n </ExpandCollapse>\n )}\n </div>\n </li>\n );\n};\n\nexport default TimelineItem;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { ListToolbar, useI18n } from '@pega/cosmos-react-core';
|
|
4
|
-
const TimelineToolbar = forwardRef(({ sort, group, ...restProps }, ref)
|
|
4
|
+
const TimelineToolbar = forwardRef(function TimelineToolbar({ sort, group, ...restProps }, ref) {
|
|
5
5
|
const t = useI18n();
|
|
6
6
|
const timelineSort = useMemo(() => {
|
|
7
7
|
const selected = sort?.selected || 'descending';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineToolbar.js","sourceRoot":"","sources":["../../../src/components/Timeline/TimelineToolbar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAsC,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAgB,WAA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Component, PropsWithoutRef, useMemo } from 'react';\n\nimport { ForwardProps, ListToolbar, useI18n } from '@pega/cosmos-react-core';\nimport { PresetMenuProps } from '@pega/cosmos-react-core/lib/components/ListToolbar/ListToolbar.types';\n\nimport { TimelineGroupBy, TimelineSortOrder, TimelineToolbarProps } from './Timeline.types';\n\nconst TimelineToolbar: FunctionComponent<TimelineToolbarProps & ForwardProps> = forwardRef(\n function TimelineToolbar(\n { sort, group, ...restProps }: PropsWithoutRef<TimelineToolbarProps>,\n ref: TimelineToolbarProps['ref']\n ) {\n const t = useI18n();\n\n const timelineSort: PresetMenuProps = useMemo(() => {\n const selected = sort?.selected || 'descending';\n return {\n mode: 'single-select',\n items: [\n {\n id: 'descending',\n text: t('timeline_toolbar_sort_descending'),\n icon: 'arrow-down',\n selected: selected === 'descending'\n },\n {\n id: 'ascending',\n text: t('timeline_toolbar_sort_ascending'),\n icon: 'arrow-up',\n selected: selected === 'ascending'\n }\n ],\n onItemClick: (id, e) => {\n sort?.onItemClick(id as TimelineSortOrder, e);\n }\n };\n }, [sort?.selected, sort?.onItemClick]);\n\n const timelineGroup: PresetMenuProps = useMemo(() => {\n const selected = group?.selected || 'date';\n return {\n mode: 'single-select',\n items: [\n {\n id: 'date',\n text: t('timeline_toolbar_group_date'),\n selected: selected === 'date'\n },\n {\n id: 'monthyear',\n text: t('timeline_toolbar_group_monthyear'),\n selected: selected === 'monthyear'\n },\n {\n id: 'quarteryear',\n text: t('timeline_toolbar_group_quarteryear'),\n selected: selected === 'quarteryear'\n },\n {\n id: 'year',\n text: t('timeline_toolbar_group_year'),\n selected: selected === 'year'\n },\n {\n id: 'none',\n text: t('timeline_toolbar_group_none'),\n selected: selected === 'none'\n }\n ],\n onItemClick: (id, e) => {\n group?.onItemClick(id as TimelineGroupBy, e);\n }\n };\n }, [group?.selected, group?.onItemClick]);\n\n return (\n <ListToolbar\n {...restProps}\n sort={sort ? timelineSort : undefined}\n group={group ? timelineGroup : undefined}\n ref={ref}\n />\n );\n }\n);\n\nexport default TimelineToolbar;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default } from './Timeline';
|
|
2
|
-
export { default as TimelineProps } from './Timeline.types';
|
|
2
|
+
export type { default as TimelineProps } from './Timeline.types';
|
|
3
3
|
export { default as TimelineToolbar } from './TimelineToolbar';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './Timeline';\nexport { default as TimelineProps } from './Timeline.types';\nexport { default as TimelineToolbar } from './TimelineToolbar';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["export { default } from './Timeline';\nexport type { default as TimelineProps } from './Timeline.types';\nexport { default as TimelineToolbar } from './TimelineToolbar';\n"]}
|
|
@@ -10,5 +10,6 @@ export declare function isSameMonthYear(firstDate: string | number | Date, secon
|
|
|
10
10
|
export declare function isSameYear(firstDate: string | number | Date, secondDate: string | number | Date): boolean;
|
|
11
11
|
export declare function isSameQuarterYear(firstDate: string | number | Date, secondDate: string | number | Date): boolean;
|
|
12
12
|
export declare function isSameGroup(firstDate: string | number | Date | undefined, secondDate: string | number | Date | undefined, groupBy: TimelineGroupBy): boolean;
|
|
13
|
+
export declare function groupByActivity(activity: ActivityObject[], groupBy: TimelineGroupBy): ActivityObject[][];
|
|
13
14
|
export declare function isFutureDate(date: string | number | Date | undefined, current: Date): boolean;
|
|
14
15
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE3F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAE7E;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,EAAE,CAE9E;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,cAAc,EAAE,EAC1B,SAAS,EAAE,iBAAiB,GAC3B,cAAc,EAAE,CAElB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGpE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGzE;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGpE;AAED,wBAAgB,UAAU,CACxB,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EACjC,UA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ate, groupBy) {
|
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
export function groupByActivity(activity, groupBy) {
|
|
59
|
+
return activity.reduce((result, item, index) => {
|
|
60
|
+
const isFirstItemInGroup = !isSameGroup(activity[index - 1]?.date, item.date, groupBy);
|
|
61
|
+
if (isFirstItemInGroup) {
|
|
62
|
+
result.push([item]);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
result[result.length - 1].push(item);
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}, []);
|
|
69
|
+
}
|
|
58
70
|
export function isFutureDate(date, current) {
|
|
59
71
|
if (!date || !current)
|
|
60
72
|
return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACZ,MAAM,6DAA6D,CAAC;AAIrE,MAAM,UAAU,mBAAmB,CAAC,KAAuB;IACzD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAuB;IAC1D,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,QAA0B,EAC1B,SAA4B;IAE5B,OAAO,SAAS,KAAK,WAAW,CAA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CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,SAAiC,EACjC,UAAkC;IAElC,OAAO,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,KAAK,UAAU,CAAC,UAAU,CAAC,CAAC;AAC/F,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,SAA6C,EAC7C,UAA8C,EAC9C,OAAwB;IAExB,IAAI,CAAC,SAAS,IAAI,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IAC5C,QAAQ,OAAO,EAAE;QACf,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,IAAI,CAAC;SACb;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC1C;QACD,KAAK,WAAW,CAAC,CAAC;YAChB,OAAO,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC/C;QACD,KAAK,aAAa,CAAC,CAAC;YAClB,OAAO,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SACjD;QACD,KAAK,MAAM,CAAC,CAAC;YACX,OAAO,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;SAC1C;QACD;YACE,OAAO,KAAK,CAAC;KAChB;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAwC,EAAE,OAAa;IAClF,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC","sourcesContent":["import {\n getQuarter,\n parseToDate\n} from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\n\nimport type { ActivityObject, TimelineGroupBy, TimelineSortOrder } from './Timeline.types';\n\nexport function sortByDateAscending(dates: ActivityObject[]): ActivityObject[] {\n return [...dates].sort((a, b) => parseToDate(a.date).getTime() - parseToDate(b.date).getTime());\n}\n\nexport function sortByDateDescending(dates: ActivityObject[]): ActivityObject[] {\n return [...dates].sort((a, b) => parseToDate(b.date).getTime() - parseToDate(a.date).getTime());\n}\n\nexport function sortByDate(\n activity: ActivityObject[],\n sortOrder: TimelineSortOrder\n): ActivityObject[] {\n return sortOrder === 'ascending' ? sortByDateAscending(activity) : sortByDateDescending(activity);\n}\n\nexport function getDatePartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth(), parsedDate.getUTCDate());\n}\n\nexport function getMonthYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth());\n}\n\nexport function getYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear());\n}\n\nexport function isSameDate(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();\n}\n\nexport function isSameMonthYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return (\n getMonthYearPartAsDate(firstDate).getTime() === getMonthYearPartAsDate(secondDate).getTime()\n );\n}\n\nexport function isSameYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getYearPartAsDate(firstDate).getTime() === getYearPartAsDate(secondDate).getTime();\n}\n\nexport function isSameQuarterYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return isSameYear(firstDate, secondDate) && getQuarter(firstDate) === getQuarter(secondDate);\n}\n\nexport function isSameGroup(\n firstDate: string | number | Date | undefined,\n secondDate: string | number | Date | undefined,\n groupBy: TimelineGroupBy\n): boolean {\n if (!firstDate || !secondDate) return false;\n switch (groupBy) {\n case 'none': {\n return true;\n }\n case 'date': {\n return isSameDate(firstDate, secondDate);\n }\n case 'monthyear': {\n return isSameMonthYear(firstDate, secondDate);\n }\n case 'quarteryear': {\n return isSameQuarterYear(firstDate, secondDate);\n }\n case 'year': {\n return isSameYear(firstDate, secondDate);\n }\n default:\n return false;\n }\n}\n\nexport function isFutureDate(date: string | number | Date | undefined, current: Date): boolean {\n if (!date || !current) return false;\n return parseToDate(date).getTime() > current.getTime();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/Timeline/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACZ,MAAM,6DAA6D,CAAC;AAIrE,MAAM,UAAU,mBAAmB,CAAC,KAAuB;IACzD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,KAAuB;IAC1D,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,QAA0B,EAC1B,SAA4B;IAE5B,OAAO,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC;AACpG,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAA4B;IAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,IAAI,IAAI,CAAC,UAAU,C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,CAAC;IACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC","sourcesContent":["import {\n getQuarter,\n parseToDate\n} from '@pega/cosmos-react-core/lib/components/DateTime/Input/utils';\n\nimport type { ActivityObject, TimelineGroupBy, TimelineSortOrder } from './Timeline.types';\n\nexport function sortByDateAscending(dates: ActivityObject[]): ActivityObject[] {\n return [...dates].sort((a, b) => parseToDate(a.date).getTime() - parseToDate(b.date).getTime());\n}\n\nexport function sortByDateDescending(dates: ActivityObject[]): ActivityObject[] {\n return [...dates].sort((a, b) => parseToDate(b.date).getTime() - parseToDate(a.date).getTime());\n}\n\nexport function sortByDate(\n activity: ActivityObject[],\n sortOrder: TimelineSortOrder\n): ActivityObject[] {\n return sortOrder === 'ascending' ? sortByDateAscending(activity) : sortByDateDescending(activity);\n}\n\nexport function getDatePartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth(), parsedDate.getUTCDate());\n}\n\nexport function getMonthYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear(), parsedDate.getUTCMonth());\n}\n\nexport function getYearPartAsDate(date: string | number | Date): Date {\n const parsedDate = parseToDate(date);\n return new Date(parsedDate.getUTCFullYear());\n}\n\nexport function isSameDate(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getDatePartAsDate(firstDate).getTime() === getDatePartAsDate(secondDate).getTime();\n}\n\nexport function isSameMonthYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return (\n getMonthYearPartAsDate(firstDate).getTime() === getMonthYearPartAsDate(secondDate).getTime()\n );\n}\n\nexport function isSameYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return getYearPartAsDate(firstDate).getTime() === getYearPartAsDate(secondDate).getTime();\n}\n\nexport function isSameQuarterYear(\n firstDate: string | number | Date,\n secondDate: string | number | Date\n): boolean {\n return isSameYear(firstDate, secondDate) && getQuarter(firstDate) === getQuarter(secondDate);\n}\n\nexport function isSameGroup(\n firstDate: string | number | Date | undefined,\n secondDate: string | number | Date | undefined,\n groupBy: TimelineGroupBy\n): boolean {\n if (!firstDate || !secondDate) return false;\n switch (groupBy) {\n case 'none': {\n return true;\n }\n case 'date': {\n return isSameDate(firstDate, secondDate);\n }\n case 'monthyear': {\n return isSameMonthYear(firstDate, secondDate);\n }\n case 'quarteryear': {\n return isSameQuarterYear(firstDate, secondDate);\n }\n case 'year': {\n return isSameYear(firstDate, secondDate);\n }\n default:\n return false;\n }\n}\n\nexport function groupByActivity(\n activity: ActivityObject[],\n groupBy: TimelineGroupBy\n): ActivityObject[][] {\n return activity.reduce((result: ActivityObject[][], item, index) => {\n const isFirstItemInGroup = !isSameGroup(activity[index - 1]?.date, item.date, groupBy);\n if (isFirstItemInGroup) {\n result.push([item]);\n } else {\n result[result.length - 1].push(item);\n }\n return result;\n }, []);\n}\n\nexport function isFutureDate(date: string | number | Date | undefined, current: Date): boolean {\n if (!date || !current) return false;\n return parseToDate(date).getTime() > current.getTime();\n}\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export { default as AppAnnouncement } from './components/AppAnnouncement';
|
|
2
2
|
export * from './components/AppAnnouncement';
|
|
3
|
+
export { default as Article } from './components/Article';
|
|
4
|
+
export * from './components/Article';
|
|
5
|
+
export { default as ArticleList } from './components/ArticleList';
|
|
6
|
+
export * from './components/ArticleList';
|
|
7
|
+
export { default as Assignments } from './components/Assignments';
|
|
8
|
+
export * from './components/Assignments';
|
|
3
9
|
export { default as CasePreview } from './components/CasePreview';
|
|
4
10
|
export * from './components/CasePreview';
|
|
5
11
|
export { default as CaseView } from './components/CaseView';
|
|
@@ -14,6 +20,8 @@ export { default as Glimpse } from './components/Glimpse';
|
|
|
14
20
|
export * from './components/Glimpse';
|
|
15
21
|
export { default as IntelligentGuidance } from './components/IntelligentGuidance';
|
|
16
22
|
export * from './components/IntelligentGuidance';
|
|
23
|
+
export { default as Predictions } from './components/Predictions';
|
|
24
|
+
export * from './components/Predictions';
|
|
17
25
|
export { default as SearchResults } from './components/SearchResults';
|
|
18
26
|
export * from './components/SearchResults';
|
|
19
27
|
export { default as Stages } from './components/Stages';
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChF,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CA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,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,uBAAuB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// This file is autogenerated. Any changes will be overwritten.
|
|
2
2
|
export { default as AppAnnouncement } from './components/AppAnnouncement';
|
|
3
3
|
export * from './components/AppAnnouncement';
|
|
4
|
+
export { default as Article } from './components/Article';
|
|
5
|
+
export * from './components/Article';
|
|
6
|
+
export { default as ArticleList } from './components/ArticleList';
|
|
7
|
+
export * from './components/ArticleList';
|
|
8
|
+
export { default as Assignments } from './components/Assignments';
|
|
9
|
+
export * from './components/Assignments';
|
|
4
10
|
export { default as CasePreview } from './components/CasePreview';
|
|
5
11
|
export * from './components/CasePreview';
|
|
6
12
|
export { default as CaseView } from './components/CaseView';
|
|
@@ -15,6 +21,8 @@ export { default as Glimpse } from './components/Glimpse';
|
|
|
15
21
|
export * from './components/Glimpse';
|
|
16
22
|
export { default as IntelligentGuidance } from './components/IntelligentGuidance';
|
|
17
23
|
export * from './components/IntelligentGuidance';
|
|
24
|
+
export { default as Predictions } from './components/Predictions';
|
|
25
|
+
export * from './components/Predictions';
|
|
18
26
|
export { default as SearchResults } from './components/SearchResults';
|
|
19
27
|
export * from './components/SearchResults';
|
|
20
28
|
export { default as Stages } from './components/Stages';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,cAAc,8BAA8B,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAClE,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAChF,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAClF,cAAc,kCAAkC,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,uBAAuB,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\nexport { default as AppAnnouncement } from './components/AppAnnouncement';\nexport * from './components/AppAnnouncement';\nexport { default as CasePreview } from './components/CasePreview';\nexport * from './components/CasePreview';\nexport { default as CaseView } from './components/CaseView';\nexport * from './components/CaseView';\nexport { default as ConfigurableLayout } from './components/ConfigurableLayout';\nexport * from './components/ConfigurableLayout';\nexport { default as Confirmation } from './components/Confirmation';\nexport * from './components/Confirmation';\nexport { default as Details } from './components/Details';\nexport * from './components/Details';\nexport { default as Glimpse } from './components/Glimpse';\nexport * from './components/Glimpse';\nexport { default as IntelligentGuidance } from './components/IntelligentGuidance';\nexport * from './components/IntelligentGuidance';\nexport { default as SearchResults } from './components/SearchResults';\nexport * from './components/SearchResults';\nexport { default as Stages } from './components/Stages';\nexport * from './components/Stages';\nexport { default as Stakeholders } from './components/Stakeholders';\nexport * from './components/Stakeholders';\nexport { default as Tags } from './components/Tags';\nexport * from './components/Tags';\nexport { default as Tasks } from './components/Tasks';\nexport * from './components/Tasks';\nexport { default as Timeline } from './components/Timeline';\nexport * from './components/Timeline';\n"]}
|
|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cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,cAAc,2BAA2B,CAAC;AAC1C,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACpD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,uBAAuB,CAAC","sourcesContent":["// This file is autogenerated. Any changes will be overwritten.\nexport { default as AppAnnouncement } from './components/AppAnnouncement';\nexport * from './components/AppAnnouncement';\nexport { default as Article } from './components/Article';\nexport * from './components/Article';\nexport { default as ArticleList } from './components/ArticleList';\nexport * from './components/ArticleList';\nexport { default as Assignments } from './components/Assignments';\nexport * from './components/Assignments';\nexport { default as CasePreview } from './components/CasePreview';\nexport * from './components/CasePreview';\nexport { default as CaseView } from './components/CaseView';\nexport * from './components/CaseView';\nexport { default as ConfigurableLayout } from './components/ConfigurableLayout';\nexport * from './components/ConfigurableLayout';\nexport { default as Confirmation } from './components/Confirmation';\nexport * from './components/Confirmation';\nexport { default as Details } from './components/Details';\nexport * from './components/Details';\nexport { default as Glimpse } from './components/Glimpse';\nexport * from './components/Glimpse';\nexport { default as IntelligentGuidance } from './components/IntelligentGuidance';\nexport * from './components/IntelligentGuidance';\nexport { default as Predictions } from './components/Predictions';\nexport * from './components/Predictions';\nexport { default as SearchResults } from './components/SearchResults';\nexport * from './components/SearchResults';\nexport { default as Stages } from './components/Stages';\nexport * from './components/Stages';\nexport { default as Stakeholders } from './components/Stakeholders';\nexport * from './components/Stakeholders';\nexport { default as Tags } from './components/Tags';\nexport * from './components/Tags';\nexport { default as Tasks } from './components/Tasks';\nexport * from './components/Tasks';\nexport { default as Timeline } from './components/Timeline';\nexport * from './components/Timeline';\n"]}
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-work",
|
|
3
|
-
"version": "4.0.0-
|
|
4
|
-
"author": "Pegasystems",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
3
|
+
"version": "4.0.0-rc.1",
|
|
6
4
|
"repository": {
|
|
7
5
|
"type": "git",
|
|
8
6
|
"url": "https://github.com/pegasystems/cosmos-react.git",
|
|
9
7
|
"directory": "packages/cosmos-work"
|
|
10
8
|
},
|
|
9
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
10
|
+
"author": "Pegasystems",
|
|
11
|
+
"sideEffects": false,
|
|
11
12
|
"main": "lib/index.js",
|
|
12
13
|
"types": "lib/index.d.ts",
|
|
13
14
|
"files": [
|
|
@@ -15,12 +16,11 @@
|
|
|
15
16
|
"README.md",
|
|
16
17
|
"lib"
|
|
17
18
|
],
|
|
18
|
-
"sideEffects": false,
|
|
19
19
|
"scripts": {
|
|
20
20
|
"build": "tsc -b"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@pega/cosmos-react-core": "4.0.0-
|
|
23
|
+
"@pega/cosmos-react-core": "4.0.0-rc.1",
|
|
24
24
|
"@types/react": "^16.14.24 || ^17.0.38",
|
|
25
25
|
"@types/react-dom": "^16.9.14 || ^17.0.11",
|
|
26
26
|
"@types/styled-components": "^5.1.26",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
"styled-components": "^5.2.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@storybook/addon-a11y": "^
|
|
34
|
-
"@storybook/addon-actions": "^
|
|
35
|
-
"@storybook/addon-storysource": "^
|
|
36
|
-
"@storybook/addon-toolbars": "^
|
|
37
|
-
"@storybook/
|
|
38
|
-
"@storybook/
|
|
39
|
-
"@storybook/testing-react": "^1.2.4",
|
|
40
|
-
"@storybook/theming": "^6.4.19",
|
|
33
|
+
"@storybook/addon-a11y": "^7.0.24",
|
|
34
|
+
"@storybook/addon-actions": "^7.0.24",
|
|
35
|
+
"@storybook/addon-storysource": "^7.0.24",
|
|
36
|
+
"@storybook/addon-toolbars": "^7.0.24",
|
|
37
|
+
"@storybook/react": "^7.0.24",
|
|
38
|
+
"@storybook/theming": "^7.0.24",
|
|
41
39
|
"@testing-library/react": "^12.1.3",
|
|
42
40
|
"@testing-library/user-event": "^13.5.0",
|
|
43
|
-
"
|
|
41
|
+
"@types/dompurify": "^2.3.4",
|
|
42
|
+
"dompurify": "^2.4.0",
|
|
43
|
+
"typescript": "~5.0.2"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHeader.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/CaseHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAsB,MAAM,OAAO,CAAC;AA8B/C,QAAA,MAAM,UAAU,EAAE,EAuIjB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from 'react';
|
|
3
|
-
import { Breadcrumbs, Flex, Icon, registerIcon, Text, Link, Button, MenuButton, useI18n, useAfterInitialEffect } 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 { StyledCaseHeader, StyledCaseIconWrap, StyledCaseHeaderText, StyledPromotedActions, StyledExpandCollapseButton, StyledSubheading } from './CaseView.styles';
|
|
7
|
-
import { useCaseViewContext } from './CaseView.context';
|
|
8
|
-
registerIcon(pencilIcon, moreIcon);
|
|
9
|
-
const CaseHeader = () => {
|
|
10
|
-
const t = useI18n();
|
|
11
|
-
const { caseId, icon, heading, subheading, actions, caseLink, parentCases, onEdit, followed, onFollowedChange, promotedActions, summaryId, summaryExpanded, onToggleSummary, isPreview, aboveMD, persistentUtility } = useCaseViewContext();
|
|
12
|
-
const caseActions = actions
|
|
13
|
-
? actions.map(action => {
|
|
14
|
-
return {
|
|
15
|
-
...action,
|
|
16
|
-
primary: action.text,
|
|
17
|
-
visual: action.icon ? _jsx(Icon, { name: action.icon }) : null
|
|
18
|
-
};
|
|
19
|
-
})
|
|
20
|
-
: undefined;
|
|
21
|
-
const toggleButtonRef = useRef(null);
|
|
22
|
-
// FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.
|
|
23
|
-
useAfterInitialEffect(() => {
|
|
24
|
-
if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {
|
|
25
|
-
toggleButtonRef.current.blur();
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
toggleButtonRef.current?.focus();
|
|
28
|
-
}, 0);
|
|
29
|
-
}
|
|
30
|
-
}, [summaryExpanded]);
|
|
31
|
-
return (_jsxs("div", { children: [_jsxs(Flex, { as: StyledCaseHeader, container: { gap: 2, alignItems: 'start' }, children: [!isPreview && aboveMD && onToggleSummary && !persistentUtility && (_jsx(StyledExpandCollapseButton, { ref: toggleButtonRef, onClick: onToggleSummary, label: t(summaryExpanded ? 'collapse' : 'expand'), "aria-label": t(summaryExpanded ? 'collapse_summary_panel' : 'expand_summary_panel'), icon: true, compact: true, "aria-expanded": summaryExpanded ? 'true' : 'false', "aria-controls": summaryId, children: _jsx(Icon, { name: 'arrow-micro-left' }) })), icon && (_jsx(Flex, { container: true, item: { shrink: 0 }, as: StyledCaseIconWrap, children: icon })), _jsxs(Flex, { as: StyledCaseHeaderText, container: { direction: 'column' }, item: { grow: 1, shrink: 0, basis: '0' }, children: [_jsx(Text, { variant: 'h1', children: caseLink ? _jsx(Link, { ...caseLink, children: heading }) : heading }), subheading && (!parentCases || subheading !== caseId) && (_jsx(StyledSubheading, { children: subheading })), parentCases && (_jsx(Breadcrumbs, { forwardedAs: 'p', path: [
|
|
32
|
-
...parentCases,
|
|
33
|
-
{ ...caseLink, id: caseId, primary: caseId, href: caseLink?.href }
|
|
34
|
-
] }))] }), _jsxs("div", { children: [onEdit && (_jsx(Button, { icon: true, variant: 'simple', onClick: onEdit, label: t('edit'), children: _jsx(Icon, { name: 'pencil' }) })), caseActions && (_jsx(MenuButton, { icon: 'more', iconOnly: true, variant: 'simple', text: t('actions'), menu: {
|
|
35
|
-
items: followed !== undefined
|
|
36
|
-
? [
|
|
37
|
-
{
|
|
38
|
-
id: 'follow',
|
|
39
|
-
primary: followed ? t('unfollow') : t('follow'),
|
|
40
|
-
onClick: () => onFollowedChange?.(!followed)
|
|
41
|
-
},
|
|
42
|
-
...caseActions
|
|
43
|
-
]
|
|
44
|
-
: caseActions,
|
|
45
|
-
scrollAt: 20
|
|
46
|
-
} }))] })] }), promotedActions && promotedActions.length > 0 ? (_jsx(Flex, { as: StyledPromotedActions, container: { wrap: 'wrap', gap: 1, pad: [1, 2] }, children: promotedActions.map(promotedAction => (_jsx(Button, { variant: 'secondary', onClick: (e) => promotedAction.onClick?.(promotedAction.id, e), children: promotedAction.text }))) })) : null] }));
|
|
47
|
-
};
|
|
48
|
-
export default CaseHeader;
|
|
49
|
-
//# sourceMappingURL=CaseHeader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CaseHeader.js","sourceRoot":"","sources":["../../../src/components/CaseView/CaseHeader.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EACL,WAAW,EACX,IAAI,EACJ,IAAI,EACJ,YAAY,EACZ,IAAI,EACJ,IAAI,EAEJ,MAAM,EACN,UAAU,EACV,OAAO,EACP,qBAAqB,EACtB,MAAM,yBAAyB,CA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AE,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YAC9E,eAAe,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,CAAC,CACrC,KAAC,MAAM,IACL,OAAO,EAAC,WAAW,EACnB,OAAO,EAAE,CAAC,CAAgC,EAAE,EAAE,CAC5C,cAAc,CAAC,OAAO,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,CAAC,CAAC,YAG/C,cAAc,CAAC,IAAI,GACb,CACV,CAAC,GACG,CACR,CAAC,CAAC,CAAC,IAAI,IACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["import { FC, MouseEvent, useRef } from 'react';\n\nimport {\n Breadcrumbs,\n Flex,\n Icon,\n registerIcon,\n Text,\n Link,\n MenuItemProps,\n Button,\n MenuButton,\n useI18n,\n useAfterInitialEffect\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 StyledCaseHeader,\n StyledCaseIconWrap,\n StyledCaseHeaderText,\n StyledPromotedActions,\n StyledExpandCollapseButton,\n StyledSubheading\n} from './CaseView.styles';\nimport { useCaseViewContext } from './CaseView.context';\n\nregisterIcon(pencilIcon, moreIcon);\n\nconst CaseHeader: FC = () => {\n const t = useI18n();\n\n const {\n caseId,\n icon,\n heading,\n subheading,\n actions,\n caseLink,\n parentCases,\n onEdit,\n followed,\n onFollowedChange,\n promotedActions,\n summaryId,\n summaryExpanded,\n onToggleSummary,\n isPreview,\n aboveMD,\n persistentUtility\n } = useCaseViewContext();\n\n const caseActions: MenuItemProps[] | undefined = actions\n ? actions.map(action => {\n return {\n ...action,\n primary: action.text,\n visual: action.icon ? <Icon name={action.icon} /> : null\n };\n })\n : undefined;\n\n const toggleButtonRef = useRef<HTMLButtonElement>(null);\n\n // FIXME: This is a hack to get the Tooltip to reset its position when the summary changes layout.\n useAfterInitialEffect(() => {\n if (toggleButtonRef.current && toggleButtonRef.current === document.activeElement) {\n toggleButtonRef.current.blur();\n setTimeout(() => {\n toggleButtonRef.current?.focus();\n }, 0);\n }\n }, [summaryExpanded]);\n\n return (\n <div>\n <Flex as={StyledCaseHeader} container={{ gap: 2, alignItems: 'start' }}>\n {!isPreview && aboveMD && onToggleSummary && !persistentUtility && (\n <StyledExpandCollapseButton\n ref={toggleButtonRef}\n onClick={onToggleSummary}\n label={t(summaryExpanded ? 'collapse' : 'expand')}\n aria-label={t(summaryExpanded ? 'collapse_summary_panel' : 'expand_summary_panel')}\n icon\n compact\n aria-expanded={summaryExpanded ? 'true' : 'false'}\n aria-controls={summaryId}\n >\n <Icon name='arrow-micro-left' />\n </StyledExpandCollapseButton>\n )}\n\n {icon && (\n <Flex container item={{ shrink: 0 }} as={StyledCaseIconWrap}>\n {icon}\n </Flex>\n )}\n <Flex\n as={StyledCaseHeaderText}\n container={{ direction: 'column' }}\n item={{ grow: 1, shrink: 0, basis: '0' }}\n >\n <Text variant='h1'>{caseLink ? <Link {...caseLink}>{heading}</Link> : heading}</Text>\n {subheading && (!parentCases || subheading !== caseId) && (\n <StyledSubheading>{subheading}</StyledSubheading>\n )}\n {parentCases && (\n <Breadcrumbs\n forwardedAs='p'\n path={[\n ...parentCases,\n { ...caseLink, id: caseId, primary: caseId, href: caseLink?.href }\n ]}\n />\n )}\n </Flex>\n <div>\n {onEdit && (\n <Button icon variant='simple' onClick={onEdit} label={t('edit')}>\n <Icon name='pencil' />\n </Button>\n )}\n\n {caseActions && (\n <MenuButton\n icon='more'\n iconOnly\n variant='simple'\n text={t('actions')}\n menu={{\n items:\n followed !== undefined\n ? [\n {\n id: 'follow',\n primary: followed ? t('unfollow') : t('follow'),\n onClick: () => onFollowedChange?.(!followed)\n },\n ...caseActions\n ]\n : caseActions,\n scrollAt: 20\n }}\n />\n )}\n </div>\n </Flex>\n\n {promotedActions && promotedActions.length > 0 ? (\n <Flex as={StyledPromotedActions} container={{ wrap: 'wrap', gap: 1, pad: [1, 2] }}>\n {promotedActions.map(promotedAction => (\n <Button\n variant='secondary'\n onClick={(e: MouseEvent<HTMLButtonElement>) =>\n promotedAction.onClick?.(promotedAction.id, e)\n }\n >\n {promotedAction.text}\n </Button>\n ))}\n </Flex>\n ) : null}\n </div>\n );\n};\n\nexport default CaseHeader;\n"]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { TabsProps, ForwardProps } from '@pega/cosmos-react-core';
|
|
3
|
-
export interface MobileCaseViewProps {
|
|
4
|
-
title: string;
|
|
5
|
-
tabs: TabsProps;
|
|
6
|
-
tabContent: ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export declare const StyledMobileCaseView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
9
|
-
export declare const StyledMobileCaseViewHeader: import("styled-components").StyledComponent<"header", import("styled-components").DefaultTheme, {}, never>;
|
|
10
|
-
/** @deprecated */
|
|
11
|
-
declare const MobileCaseView: FC<ForwardProps & MobileCaseViewProps>;
|
|
12
|
-
export default MobileCaseView;
|
|
13
|
-
//# sourceMappingURL=MobileCaseView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MobileCaseView.d.ts","sourceRoot":"","sources":["../../../src/components/CaseView/MobileCaseView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGtC,OAAO,EAGL,SAAS,EAGT,YAAY,EACb,MAAM,yBAAyB,CAAC;AAGjC,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE,SAAS,CAAC;CACvB;AAED,eAAO,MAAM,oBAAoB,yGAGhC,CAAC;AAEF,eAAO,MAAM,0BAA0B,4GAOtC,CAAC;AAKF,kBAAkB;AAClB,QAAA,MAAM,cAAc,EAAE,EAAE,CAAC,YAAY,GAAG,mBAAmB,CAgB1D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import { Flex, Tabs, Text, defaultThemeProp } from '@pega/cosmos-react-core';
|
|
4
|
-
import { StyledText } from '@pega/cosmos-react-core/lib/components/Text/Text';
|
|
5
|
-
export const StyledMobileCaseView = styled.div `
|
|
6
|
-
min-height: 100vh;
|
|
7
|
-
background-color: #e9eef3;
|
|
8
|
-
`;
|
|
9
|
-
export const StyledMobileCaseViewHeader = styled.header `
|
|
10
|
-
color: ${props => props.theme.base.palette.light};
|
|
11
|
-
background-color: ${props => props.theme.base.palette.interactive};
|
|
12
|
-
|
|
13
|
-
${StyledText} {
|
|
14
|
-
padding: ${props => props.theme.base.spacing};
|
|
15
|
-
}
|
|
16
|
-
`;
|
|
17
|
-
StyledMobileCaseView.defaultProps = defaultThemeProp;
|
|
18
|
-
StyledMobileCaseViewHeader.defaultProps = defaultThemeProp;
|
|
19
|
-
/** @deprecated */
|
|
20
|
-
const MobileCaseView = (props) => {
|
|
21
|
-
const { tabs, tabContent, title, ...restProps } = props;
|
|
22
|
-
return (_jsxs(Flex, { container: { direction: 'column' }, as: StyledMobileCaseView, ...restProps, children: [_jsxs(Flex, { container: { direction: 'column' }, item: { shrink: 0 }, as: StyledMobileCaseViewHeader, children: [_jsx(Text, { as: 'h1', children: title }), _jsx(Tabs, { ...tabs, type: 'horizontal', inverted: true })] }), tabContent] }));
|
|
23
|
-
};
|
|
24
|
-
export default MobileCaseView;
|
|
25
|
-
//# sourceMappingURL=MobileCaseView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"M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AQ,EAC5B,KAAC,IAAI,OAAK,IAAI,EAAE,IAAI,EAAC,YAAY,EAAC,QAAQ,SAAG,IACxC,EACN,UAAU,IACN,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import { FC, ReactNode } from 'react';\nimport styled from 'styled-components';\n\nimport {\n Flex,\n Tabs,\n TabsProps,\n Text,\n defaultThemeProp,\n ForwardProps\n} from '@pega/cosmos-react-core';\nimport { StyledText } from '@pega/cosmos-react-core/lib/components/Text/Text';\n\nexport interface MobileCaseViewProps {\n title: string;\n tabs: TabsProps;\n tabContent: ReactNode;\n}\n\nexport const StyledMobileCaseView = styled.div`\n min-height: 100vh;\n background-color: #e9eef3;\n`;\n\nexport const StyledMobileCaseViewHeader = styled.header`\n color: ${props => props.theme.base.palette.light};\n background-color: ${props => props.theme.base.palette.interactive};\n\n ${StyledText} {\n padding: ${props => props.theme.base.spacing};\n }\n`;\n\nStyledMobileCaseView.defaultProps = defaultThemeProp;\nStyledMobileCaseViewHeader.defaultProps = defaultThemeProp;\n\n/** @deprecated */\nconst MobileCaseView: FC<ForwardProps & MobileCaseViewProps> = (props: MobileCaseViewProps) => {\n const { tabs, tabContent, title, ...restProps } = props;\n\n return (\n <Flex container={{ direction: 'column' }} as={StyledMobileCaseView} {...restProps}>\n <Flex\n container={{ direction: 'column' }}\n item={{ shrink: 0 }}\n as={StyledMobileCaseViewHeader}\n >\n <Text as='h1'>{title}</Text>\n <Tabs {...tabs} type='horizontal' inverted />\n </Flex>\n {tabContent}\n </Flex>\n );\n};\n\nexport default MobileCaseView;\n"]}
|
|
File without changes
|