@pega/react-sdk-overrides 23.1.10 → 23.1.12
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/LICENSE +201 -0
- package/README.md +17 -0
- package/SECURITY.md +10 -0
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +6 -14
- package/lib/designSystemExtension/Banner/Banner.tsx +14 -11
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +27 -22
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +14 -20
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +44 -19
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +7 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +21 -32
- package/lib/designSystemExtension/Operator/Operator.tsx +94 -82
- package/lib/designSystemExtension/Pulse/Pulse.tsx +14 -16
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +6 -5
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +14 -14
- package/lib/field/AutoComplete/AutoComplete.tsx +24 -26
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +98 -84
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +120 -63
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +25 -50
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +9 -16
- package/lib/field/Date/Date.tsx +15 -11
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +9 -9
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +33 -44
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +122 -31
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +11 -10
- package/lib/field/Email/config-ext.json +1 -2
- package/lib/field/Email/index.tsx +1 -1
- package/lib/field/Group/Group.tsx +39 -0
- package/lib/field/Group/config-ext.json +7 -0
- package/lib/field/Group/index.tsx +1 -0
- package/lib/field/Integer/Integer.tsx +8 -7
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/MultiSelect/Multiselect.tsx +244 -0
- package/lib/field/MultiSelect/index.tsx +1 -0
- package/lib/field/MultiSelect/utils.ts +230 -0
- package/lib/field/Percentage/Percentage.tsx +46 -41
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +13 -12
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +20 -18
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +8 -7
- package/lib/field/ScalarList/ScalarList.tsx +3 -13
- package/lib/field/ScalarList/config-ext.json +1 -2
- package/lib/field/SemanticLink/SemanticLink.tsx +7 -7
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -11
- package/lib/field/TextArea/TextArea.tsx +7 -6
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +4 -6
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +9 -7
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +11 -11
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +9 -8
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +18 -16
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/attachmentHelpers.ts +13 -8
- package/lib/helpers/case-utils.tsx +4 -8
- package/lib/helpers/common-utils.ts +5 -1
- package/lib/helpers/data_page.ts +3 -7
- package/lib/helpers/date-format-utils.ts +3 -3
- package/lib/helpers/event-utils.ts +3 -3
- package/lib/helpers/field-group-utils.ts +1 -1
- package/lib/helpers/formatters/Boolean.ts +9 -26
- package/lib/helpers/formatters/Currency.ts +15 -21
- package/lib/helpers/formatters/CurrencyMap.ts +505 -501
- package/lib/helpers/formatters/Date.ts +20 -26
- package/lib/helpers/formatters/common.ts +1 -2
- package/lib/helpers/formatters/index.ts +26 -19
- package/lib/helpers/instructions-utils.ts +38 -0
- package/lib/helpers/reactContextHelpers.ts +2 -2
- package/lib/helpers/simpleTableHelpers.ts +59 -83
- package/lib/helpers/state-utils.tsx +5 -9
- package/lib/helpers/template-utils.ts +3 -6
- package/lib/helpers/utils.ts +5 -5
- package/lib/helpers/versionHelpers.ts +1 -4
- package/lib/infra/ActionButtons/ActionButtons.tsx +38 -29
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -79
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +13 -16
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +67 -213
- package/lib/infra/Containers/FlowContainer/helpers.ts +34 -45
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +227 -218
- package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
- package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
- package/lib/infra/Containers/SimpleView/helper.ts +125 -0
- package/lib/infra/Containers/SimpleView/index.tsx +1 -0
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +36 -46
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -42
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -43
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -28
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +16 -30
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +176 -212
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +19 -31
- package/lib/infra/Reference/Reference.tsx +16 -18
- package/lib/infra/Region/Region.tsx +4 -6
- package/lib/infra/RootContainer/RootContainer.tsx +75 -111
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +32 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +11 -11
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +21 -28
- package/lib/infra/View/View.tsx +17 -21
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +39 -74
- package/lib/template/BannerPage/BannerPage.tsx +12 -14
- package/lib/template/CaseSummary/CaseSummary.tsx +58 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +34 -63
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +63 -19
- package/lib/template/Confirmation/Confirmation.tsx +12 -17
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +95 -121
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +13 -16
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/Details/Details/Details.tsx +19 -22
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +9 -13
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -24
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +19 -25
- package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +15 -14
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +15 -22
- package/lib/template/InlineDashboard/InlineDashboard.tsx +12 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +12 -16
- package/lib/template/ListPage/ListPage.tsx +5 -10
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/DefaultViewMeta.ts +1 -3
- package/lib/template/ListView/ListView.tsx +185 -175
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/hooks.ts +24 -26
- package/lib/template/ListView/utils.ts +51 -87
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +20 -20
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +25 -38
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +20 -25
- package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +14 -24
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +9 -19
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +14 -15
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +3 -10
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +6 -10
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +32 -28
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +37 -33
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -121
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +24 -25
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +30 -30
- package/lib/template/SubTabs/SubTabs.tsx +22 -40
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -5
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +30 -28
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +3 -10
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +30 -28
- package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +22 -34
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +24 -28
- package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +13 -21
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +8 -16
- package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +18 -21
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +29 -28
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +60 -1
- package/lib/widget/Attachment/Attachment.tsx +378 -405
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +64 -66
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +16 -18
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +310 -246
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +23 -20
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +68 -42
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +58 -58
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +7 -10
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +52 -53
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -834
- package/lib/helpers/authManager.ts +0 -933
- package/lib/helpers/config_access.js +0 -186
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
1
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
2
|
|
|
4
3
|
interface SingleReferenceReadOnlyProps extends PConnProps {
|
|
5
4
|
// If any, enter additional props that only exist on this component
|
|
6
|
-
config: any
|
|
7
|
-
displayAs?: string
|
|
8
|
-
ruleClass?: string
|
|
9
|
-
label?: string
|
|
10
|
-
displayMode?: string
|
|
11
|
-
type: string
|
|
12
|
-
referenceType?: string
|
|
13
|
-
hideLabel?: boolean
|
|
14
|
-
dataRelationshipContext?: string
|
|
5
|
+
config: any;
|
|
6
|
+
displayAs?: string;
|
|
7
|
+
ruleClass?: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
displayMode?: string;
|
|
10
|
+
type: string;
|
|
11
|
+
referenceType?: string;
|
|
12
|
+
hideLabel?: boolean;
|
|
13
|
+
dataRelationshipContext?: string;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
|
-
|
|
18
16
|
export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyProps) {
|
|
19
17
|
const {
|
|
20
18
|
getPConnect,
|
|
@@ -29,7 +27,7 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
|
|
|
29
27
|
config
|
|
30
28
|
} = props;
|
|
31
29
|
|
|
32
|
-
const editableComponents = [
|
|
30
|
+
const editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown'];
|
|
33
31
|
|
|
34
32
|
if (editableComponents.includes(type)) {
|
|
35
33
|
config.caseClass = ruleClass;
|
|
@@ -37,27 +35,29 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
|
|
|
37
35
|
config.caseID = config.value;
|
|
38
36
|
config.contextPage = `@P .${dataRelationshipContext}`;
|
|
39
37
|
config.resourceParams = {
|
|
40
|
-
|
|
38
|
+
workID: displayAs === 'table' ? config.selectionKey : config.value
|
|
41
39
|
};
|
|
42
40
|
config.resourcePayload = {
|
|
43
|
-
|
|
41
|
+
caseClassName: ruleClass
|
|
44
42
|
};
|
|
45
43
|
}
|
|
46
44
|
|
|
47
|
-
const component = getPConnect().createComponent(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
const component = getPConnect().createComponent(
|
|
46
|
+
{
|
|
47
|
+
type: 'SemanticLink',
|
|
48
|
+
config: {
|
|
49
|
+
...config,
|
|
50
|
+
label,
|
|
51
|
+
displayMode,
|
|
52
|
+
referenceType,
|
|
53
|
+
hideLabel,
|
|
54
|
+
dataRelationshipContext
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
'',
|
|
58
|
+
'',
|
|
59
|
+
{}
|
|
60
|
+
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
59
61
|
|
|
60
|
-
return
|
|
61
|
-
<React.Fragment>{component}</React.Fragment>
|
|
62
|
-
)
|
|
62
|
+
return <>{component}</>;
|
|
63
63
|
}
|
|
@@ -1,64 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Tab, Tabs } from
|
|
1
|
+
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
+
import { Tab, Tabs } from '@material-ui/core';
|
|
3
3
|
import { TabContext, TabPanel } from '@material-ui/lab';
|
|
4
|
-
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
7
|
|
|
8
|
-
interface SubTabsProps {
|
|
8
|
+
interface SubTabsProps extends PConnProps {
|
|
9
9
|
// If any, enter additional props that only exist on this component
|
|
10
|
-
children: Array<any>
|
|
11
10
|
}
|
|
12
11
|
|
|
13
|
-
|
|
14
|
-
export default function SubTabs(props: SubTabsProps) {
|
|
12
|
+
export default function SubTabs(props: PropsWithChildren<SubTabsProps>) {
|
|
15
13
|
const { children = [] } = props;
|
|
16
14
|
|
|
17
15
|
const defaultTabIndex = 0;
|
|
18
|
-
const deferLoadedTabs = children[0];
|
|
19
|
-
const availableTabs = getVisibleTabs(deferLoadedTabs,
|
|
16
|
+
const deferLoadedTabs = Children.toArray(children)[0];
|
|
17
|
+
const availableTabs = getVisibleTabs(deferLoadedTabs, 'tabsSubs');
|
|
20
18
|
const [currentTabId, setCurrentTabId] = useState(defaultTabIndex.toString());
|
|
21
19
|
|
|
22
|
-
const [tabItems, setTabitem] = useState<
|
|
20
|
+
const [tabItems, setTabitem] = useState<any[]>([]);
|
|
23
21
|
useEffect(() => {
|
|
24
|
-
const tempTabItems = getTransientTabs(
|
|
25
|
-
availableTabs,
|
|
26
|
-
currentTabId,
|
|
27
|
-
tabItems
|
|
28
|
-
);
|
|
22
|
+
const tempTabItems = getTransientTabs(availableTabs, currentTabId, tabItems);
|
|
29
23
|
setTabitem(tempTabItems);
|
|
30
24
|
}, [currentTabId]);
|
|
31
25
|
|
|
32
|
-
|
|
33
26
|
const handleTabClick = (id, index: string) => {
|
|
34
27
|
setCurrentTabId(index);
|
|
35
28
|
tabClick(index, availableTabs, currentTabId, setCurrentTabId, tabItems);
|
|
36
29
|
};
|
|
37
30
|
|
|
38
31
|
return (
|
|
39
|
-
<
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
value={currentTabId}
|
|
44
|
-
variant="scrollable"
|
|
45
|
-
>
|
|
46
|
-
{tabItems.map((tab:any) =>
|
|
47
|
-
<Tab
|
|
48
|
-
key={tab.id}
|
|
49
|
-
label={tab.name}
|
|
50
|
-
value={tab.id}
|
|
51
|
-
/>
|
|
52
|
-
)}
|
|
53
|
-
</Tabs>
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
-
tabItems.map((tab:any) => (
|
|
57
|
-
<TabPanel key={tab.id} value={tab.id} tabIndex={+tab.id}>
|
|
58
|
-
<div>{tab.content ? tab.content : "No content exists"}</div>
|
|
59
|
-
</TabPanel>
|
|
32
|
+
<TabContext value={currentTabId.toString()}>
|
|
33
|
+
<Tabs onChange={handleTabClick} value={currentTabId} variant='scrollable'>
|
|
34
|
+
{tabItems.map((tab: any) => (
|
|
35
|
+
<Tab key={tab.id} label={tab.name} value={tab.id} />
|
|
60
36
|
))}
|
|
61
|
-
</
|
|
62
|
-
|
|
37
|
+
</Tabs>
|
|
38
|
+
|
|
39
|
+
{tabItems.map((tab: any) => (
|
|
40
|
+
<TabPanel key={tab.id} value={tab.id} tabIndex={+tab.id}>
|
|
41
|
+
<div>{tab.content ? tab.content : 'No content exists'}</div>
|
|
42
|
+
</TabPanel>
|
|
43
|
+
))}
|
|
44
|
+
</TabContext>
|
|
63
45
|
);
|
|
64
46
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
export const getDeferFriendlyTabs = allTabs => {
|
|
3
2
|
return allTabs.map(tab => {
|
|
4
3
|
const theTabCompConfig = tab.getPConnect().getConfigProps();
|
|
@@ -38,9 +37,7 @@ export const getTransientTabs = (availableTabs, currentTabId, tabItems) => {
|
|
|
38
37
|
PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
|
|
39
38
|
const tabContent = () => {
|
|
40
39
|
if (i.toString() === currentTabId) {
|
|
41
|
-
return tabItems?.[i.toString()]?.content
|
|
42
|
-
? tabItems?.[i.toString()]?.content
|
|
43
|
-
: child.getPConnect().getComponent();
|
|
40
|
+
return tabItems?.[i.toString()]?.content ? tabItems?.[i.toString()]?.content : child.getPConnect().getComponent();
|
|
44
41
|
}
|
|
45
42
|
return tabItems?.[i.toString()]?.content;
|
|
46
43
|
};
|
|
@@ -65,7 +62,7 @@ export const tabClick = (id, availableTabs, currentTabId, setCurrentTabId, tabIt
|
|
|
65
62
|
}
|
|
66
63
|
|
|
67
64
|
const nextPConn = availableTabs[id].getPConnect();
|
|
68
|
-
const { deferLoadId: activeId } = nextPConn?.getConfigProps();
|
|
65
|
+
const { deferLoadId: activeId } = nextPConn?.getConfigProps() || {};
|
|
69
66
|
PCore.getDeferLoadManager().activate(activeId, nextPConn?.getContextName());
|
|
70
67
|
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn?.getContextName());
|
|
71
68
|
};
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Grid, GridSize } from
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid, GridSize } from '@material-ui/core';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
interface TwoColumnProps {
|
|
6
|
+
interface TwoColumnProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
8
|
-
|
|
9
|
-
templateCol?: string
|
|
8
|
+
templateCol?: string;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
13
11
|
const useStyles = makeStyles(() => ({
|
|
14
12
|
colStyles: {
|
|
15
|
-
display:
|
|
16
|
-
gap:
|
|
17
|
-
alignContent:
|
|
18
|
-
}
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gap: '1rem',
|
|
15
|
+
alignContent: 'baseline'
|
|
16
|
+
}
|
|
19
17
|
}));
|
|
20
18
|
|
|
21
|
-
export default function TwoColumn(props: TwoColumnProps) {
|
|
19
|
+
export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
22
20
|
const classes = useStyles();
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
const { children, templateCol = '1fr 1fr' } = props;
|
|
23
|
+
const childrenToRender = children as ReactElement[];
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
if (childrenToRender.length !== 2) {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
|
|
28
|
+
}
|
|
30
29
|
|
|
31
30
|
// Calculate the size
|
|
32
31
|
// Default to assume the 2 columns are evenly split. However, override if templateCol
|
|
@@ -34,20 +33,23 @@ export default function TwoColumn(props: TwoColumnProps) {
|
|
|
34
33
|
let aSize: GridSize = 6;
|
|
35
34
|
let bSize: GridSize = 6;
|
|
36
35
|
|
|
37
|
-
const colAArray = templateCol
|
|
36
|
+
const colAArray = templateCol
|
|
37
|
+
.replaceAll(/[a-z]+/g, '')
|
|
38
|
+
.split(/\s/)
|
|
39
|
+
.map(itm => Number(itm));
|
|
38
40
|
const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
|
|
39
41
|
const ratio = 12 / totalCols;
|
|
40
42
|
aSize = (ratio * colAArray[0]) as GridSize;
|
|
41
43
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
return (
|
|
46
|
+
<Grid container spacing={1}>
|
|
47
|
+
<Grid item xs={12} md={aSize} className={classes.colStyles}>
|
|
48
|
+
{childrenToRender[0]}
|
|
49
|
+
</Grid>
|
|
50
|
+
<Grid item xs={12} md={bSize} className={classes.colStyles}>
|
|
51
|
+
{childrenToRender[1]}
|
|
52
|
+
</Grid>
|
|
53
|
+
</Grid>
|
|
54
|
+
);
|
|
53
55
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
interface TwoColumnPageProps{
|
|
4
|
+
interface TwoColumnPageProps extends PConnProps {
|
|
6
5
|
// If any, enter additional props that only exist on this component
|
|
7
|
-
children: Array<any>
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
|
|
11
8
|
/*
|
|
12
9
|
* The wrapper handles knowing how to take in just children
|
|
13
10
|
* and mapping to the TwoColumn template.
|
|
@@ -16,9 +13,5 @@ export default function TwoColumnPage(props: TwoColumnPageProps) {
|
|
|
16
13
|
// Get emitted components from map (so we can get any override that may exist)
|
|
17
14
|
const TwoColumn = getComponentFromMap('TwoColumn');
|
|
18
15
|
|
|
19
|
-
return
|
|
20
|
-
<TwoColumn
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
16
|
+
return <TwoColumn {...props} />;
|
|
24
17
|
}
|
|
@@ -1,32 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Grid, GridSize } from
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid, GridSize } from '@material-ui/core';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
interface TwoColumnTabProps {
|
|
6
|
+
interface TwoColumnTabProps extends PConnProps {
|
|
7
7
|
// If any, enter additional props that only exist on this component
|
|
8
|
-
|
|
9
|
-
templateCol?: string
|
|
8
|
+
templateCol?: string;
|
|
10
9
|
}
|
|
11
10
|
|
|
12
|
-
|
|
13
11
|
const useStyles = makeStyles(() => ({
|
|
14
12
|
colStyles: {
|
|
15
|
-
display:
|
|
16
|
-
gap:
|
|
17
|
-
alignContent:
|
|
18
|
-
}
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gap: '1rem',
|
|
15
|
+
alignContent: 'baseline'
|
|
16
|
+
}
|
|
19
17
|
}));
|
|
20
18
|
|
|
21
|
-
export default function TwoColumnTab(props:TwoColumnTabProps) {
|
|
19
|
+
export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>) {
|
|
22
20
|
const classes = useStyles();
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
const { children, templateCol = '1fr 1fr' } = props;
|
|
23
|
+
const childrenToRender = children as ReactElement[];
|
|
25
24
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
if (childrenToRender.length !== 2) {
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
27
|
+
console.error(`TwoColumn template sees more than 2 columns: ${childrenToRender.length}`);
|
|
28
|
+
}
|
|
30
29
|
|
|
31
30
|
// Calculate the size
|
|
32
31
|
// Default to assume the 2 columns are evenly split. However, override if templateCol
|
|
@@ -34,20 +33,23 @@ export default function TwoColumnTab(props:TwoColumnTabProps) {
|
|
|
34
33
|
let aSize: GridSize = 6;
|
|
35
34
|
let bSize: GridSize = 6;
|
|
36
35
|
|
|
37
|
-
const colAArray = templateCol
|
|
36
|
+
const colAArray = templateCol
|
|
37
|
+
.replaceAll(/[a-z]+/g, '')
|
|
38
|
+
.split(/\s/)
|
|
39
|
+
.map(itm => Number(itm));
|
|
38
40
|
const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
|
|
39
41
|
const ratio = 12 / totalCols;
|
|
40
42
|
aSize = (ratio * colAArray[0]) as GridSize;
|
|
41
43
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
42
44
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
return (
|
|
46
|
+
<Grid container spacing={1}>
|
|
47
|
+
<Grid item xs={12} md={aSize} className={classes.colStyles}>
|
|
48
|
+
{childrenToRender[0]}
|
|
49
|
+
</Grid>
|
|
50
|
+
<Grid item xs={12} md={bSize} className={classes.colStyles}>
|
|
51
|
+
{childrenToRender[1]}
|
|
52
|
+
</Grid>
|
|
53
|
+
</Grid>
|
|
54
|
+
);
|
|
53
55
|
}
|
|
@@ -1,49 +1,37 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
3
|
import './WideNarrow.css';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
interface WideNarrowProps {
|
|
5
|
+
interface WideNarrowProps extends PConnProps {
|
|
6
6
|
// If any, enter additional props that only exist on this component
|
|
7
|
-
a: any
|
|
8
|
-
b: any
|
|
9
|
-
children?: Array<any>,
|
|
7
|
+
a: any;
|
|
8
|
+
b: any;
|
|
10
9
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
11
|
-
title?: string
|
|
10
|
+
title?: string;
|
|
12
11
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
13
|
-
cols?: string
|
|
12
|
+
cols?: string;
|
|
14
13
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
15
|
-
icon?: string
|
|
14
|
+
icon?: string;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
export default function WideNarrow(props: WideNarrowProps) {
|
|
17
|
+
export default function WideNarrow(props: PropsWithChildren<WideNarrowProps>) {
|
|
20
18
|
// const {a, b /*, cols, icon, title */ } = props;
|
|
21
19
|
const { a, b, children = [] } = props;
|
|
22
20
|
|
|
23
21
|
return (
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{children[
|
|
29
|
-
</div>
|
|
30
|
-
<div className="psdk-narrow-column-column">
|
|
31
|
-
{children[1]}
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
}
|
|
35
|
-
{a && b &&
|
|
36
|
-
<div className="psdk-wide-narrow-column">
|
|
37
|
-
<div className="psdk-wide-column-column">
|
|
38
|
-
{a}
|
|
22
|
+
<>
|
|
23
|
+
{children && (children as ReactElement[]).length === 2 && (
|
|
24
|
+
<div className='psdk-wide-narrow-column'>
|
|
25
|
+
<div className='psdk-wide-column-column'>{children[0]}</div>
|
|
26
|
+
<div className='psdk-narrow-column-column'>{children[1]}</div>
|
|
39
27
|
</div>
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
)}
|
|
29
|
+
{a && b && (
|
|
30
|
+
<div className='psdk-wide-narrow-column'>
|
|
31
|
+
<div className='psdk-wide-column-column'>{a}</div>
|
|
32
|
+
<div className='psdk-narrow-column-column'>{b}</div>
|
|
42
33
|
</div>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
)
|
|
48
|
-
|
|
34
|
+
)}
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
49
37
|
}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Grid from '@material-ui/core/Grid';
|
|
3
|
-
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import Grid, { GridSize } from '@material-ui/core/Grid';
|
|
3
|
+
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
// }
|
|
9
|
+
interface WideNarrowDetailsProps extends PConnProps {
|
|
10
|
+
// If any, enter additional props that only exist on this component
|
|
11
|
+
showLabel?: boolean;
|
|
12
|
+
label?: string;
|
|
13
|
+
showHighlightedData?: boolean;
|
|
14
|
+
}
|
|
16
15
|
|
|
17
16
|
const COLUMN_WIDTHS = [8, 4];
|
|
18
17
|
|
|
19
|
-
export default function WideNarrowDetails(props
|
|
18
|
+
export default function WideNarrowDetails(props: WideNarrowDetailsProps) {
|
|
20
19
|
// Get emitted components from map (so we can get any override that may exist)
|
|
21
20
|
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
22
21
|
|
|
@@ -29,25 +28,23 @@ export default function WideNarrowDetails(props /* : WideNarrowDetailsProps */)
|
|
|
29
28
|
// in a readonly (display) mode instead of a editable
|
|
30
29
|
getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
31
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
32
|
-
const children = getPConnect()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
theConfigObject = {}
|
|
38
|
-
}
|
|
31
|
+
const children = (getPConnect().getChildren() as any[])?.map((configObject, index) => {
|
|
32
|
+
let theConfigObject: object = configObject;
|
|
33
|
+
if (!theConfigObject) {
|
|
34
|
+
theConfigObject = {};
|
|
35
|
+
}
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
37
|
+
return createElement(createPConnectComponent(), {
|
|
38
|
+
...theConfigObject,
|
|
39
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
40
|
+
key: index.toString()
|
|
45
41
|
});
|
|
42
|
+
});
|
|
46
43
|
|
|
47
44
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
48
45
|
let highlightedDataArr = [];
|
|
49
46
|
if (showHighlightedData) {
|
|
50
|
-
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
47
|
+
const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;
|
|
51
48
|
highlightedDataArr = highlightedData.map(field => {
|
|
52
49
|
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
53
50
|
|
|
@@ -57,13 +54,12 @@ export default function WideNarrowDetails(props /* : WideNarrowDetailsProps */)
|
|
|
57
54
|
field.config.displayAsStatus = true;
|
|
58
55
|
}
|
|
59
56
|
|
|
60
|
-
return getPConnect().createComponent(field,
|
|
61
|
-
'', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
57
|
+
return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
62
58
|
});
|
|
63
59
|
}
|
|
64
60
|
|
|
65
61
|
let theName = '';
|
|
66
|
-
if (propsToUse?.showLabel && propsToUse.label
|
|
62
|
+
if (propsToUse?.showLabel && propsToUse.label) {
|
|
67
63
|
theName = propsToUse.label;
|
|
68
64
|
}
|
|
69
65
|
|