@pega/react-sdk-overrides 8.23.11 → 23.1.11
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 +12 -16
- package/lib/designSystemExtension/Banner/Banner.tsx +21 -7
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +36 -26
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +21 -28
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +50 -18
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +14 -11
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
- package/lib/designSystemExtension/Operator/Operator.tsx +100 -84
- package/lib/designSystemExtension/Pulse/Pulse.tsx +21 -19
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +122 -0
- package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +21 -12
- package/lib/field/AutoComplete/AutoComplete.tsx +33 -16
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +100 -81
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +27 -16
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +30 -47
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +10 -21
- package/lib/field/Date/Date.tsx +24 -13
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +21 -10
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +31 -40
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +128 -31
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +16 -7
- 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 +15 -6
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/Percentage/Percentage.tsx +52 -39
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +15 -6
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +26 -34
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +96 -0
- package/lib/field/RichText/index.tsx +1 -0
- package/lib/field/ScalarList/ScalarList.tsx +63 -0
- package/lib/field/ScalarList/config-ext.json +7 -0
- package/lib/field/ScalarList/index.tsx +1 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -11
- package/lib/field/TextArea/TextArea.tsx +15 -5
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +9 -2
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +18 -7
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +14 -19
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +15 -6
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +52 -60
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/attachmentHelpers.ts +15 -10
- package/lib/helpers/case-utils.tsx +5 -10
- package/lib/helpers/common-utils.ts +6 -2
- package/lib/helpers/data_page.ts +3 -7
- package/lib/helpers/date-format-utils.ts +4 -4
- package/lib/helpers/event-utils.ts +4 -4
- package/lib/helpers/field-group-utils.ts +6 -8
- package/lib/helpers/formatters/Boolean.ts +9 -26
- package/lib/helpers/formatters/Currency.ts +22 -28
- package/lib/helpers/formatters/CurrencyMap.ts +512 -505
- package/lib/helpers/formatters/Date.ts +20 -26
- package/lib/helpers/formatters/common.ts +2 -7
- package/lib/helpers/formatters/index.ts +29 -22
- package/lib/helpers/reactContextHelpers.ts +2 -2
- package/lib/helpers/simpleTableHelpers.ts +63 -87
- package/lib/helpers/state-utils.tsx +5 -12
- package/lib/helpers/template-utils.ts +4 -10
- package/lib/helpers/utils.ts +5 -5
- package/lib/helpers/versionHelpers.ts +1 -7
- package/lib/infra/ActionButtons/ActionButtons.tsx +44 -45
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +102 -86
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -26
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +93 -240
- package/lib/infra/Containers/FlowContainer/helpers.ts +34 -48
- 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 +229 -223
- 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 +47 -64
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +25 -54
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -42
- package/lib/infra/DeferLoad/DeferLoad.tsx +21 -33
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +21 -39
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +180 -216
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +26 -45
- package/lib/infra/Reference/Reference.tsx +16 -22
- package/lib/infra/Region/Region.tsx +9 -9
- package/lib/infra/RootContainer/RootContainer.tsx +75 -120
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +36 -41
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
- package/lib/infra/View/View.tsx +25 -29
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +47 -71
- package/lib/template/BannerPage/BannerPage.tsx +26 -33
- package/lib/template/CaseSummary/CaseSummary.tsx +66 -19
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +44 -74
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +66 -31
- package/lib/template/Confirmation/Confirmation.tsx +24 -55
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +112 -142
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +15 -16
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/Details/Details/Details.tsx +24 -28
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +15 -22
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +25 -29
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +25 -29
- 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 +79 -0
- package/lib/template/Details/DynamicTabs/config.json +36 -0
- package/lib/template/Details/DynamicTabs/index.tsx +1 -0
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +22 -35
- package/lib/template/InlineDashboard/InlineDashboard.tsx +16 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -21
- package/lib/template/ListPage/ListPage.tsx +12 -16
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/DefaultViewMeta.ts +1 -3
- package/lib/template/ListView/ListView.tsx +247 -309
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/hooks.ts +24 -26
- package/lib/template/ListView/utils.ts +205 -94
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -34
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +31 -29
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +27 -31
- 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 +17 -19
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +16 -26
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +9 -16
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +8 -14
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +39 -33
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +113 -15
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -104
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -44
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +45 -48
- package/lib/template/SubTabs/SubTabs.tsx +26 -45
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -9
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +33 -36
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +9 -16
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +33 -33
- 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 +29 -27
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +39 -33
- 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 +16 -18
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -25
- 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 +24 -10
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +60 -1
- package/lib/widget/Attachment/Attachment.tsx +379 -394
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +67 -67
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -9
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +322 -245
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +27 -25
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +71 -39
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +62 -52
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +15 -4
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +72 -116
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -483
- package/lib/helpers/authManager.js +0 -634
- package/lib/helpers/config_access.js +0 -259
|
@@ -1,19 +1,33 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface SingleReferenceReadOnlyProps extends PConnProps {
|
|
4
|
+
// If any, enter additional props that only exist on this component
|
|
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;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyProps) {
|
|
4
17
|
const {
|
|
5
18
|
getPConnect,
|
|
6
|
-
displayAs,
|
|
7
|
-
ruleClass,
|
|
8
|
-
label,
|
|
9
|
-
type,
|
|
10
|
-
displayMode,
|
|
11
|
-
referenceType,
|
|
12
|
-
hideLabel,
|
|
13
|
-
dataRelationshipContext,
|
|
19
|
+
displayAs = '',
|
|
20
|
+
ruleClass = '',
|
|
21
|
+
label = '',
|
|
22
|
+
type = '',
|
|
23
|
+
displayMode = '',
|
|
24
|
+
referenceType = '',
|
|
25
|
+
hideLabel = false,
|
|
26
|
+
dataRelationshipContext = null,
|
|
14
27
|
config
|
|
15
28
|
} = props;
|
|
16
|
-
|
|
29
|
+
|
|
30
|
+
const editableComponents = ['AutoComplete', 'SimpleTableSelect', 'Dropdown'];
|
|
17
31
|
|
|
18
32
|
if (editableComponents.includes(type)) {
|
|
19
33
|
config.caseClass = ruleClass;
|
|
@@ -21,46 +35,29 @@ export default function SingleReferenceReadOnly(props) {
|
|
|
21
35
|
config.caseID = config.value;
|
|
22
36
|
config.contextPage = `@P .${dataRelationshipContext}`;
|
|
23
37
|
config.resourceParams = {
|
|
24
|
-
|
|
38
|
+
workID: displayAs === 'table' ? config.selectionKey : config.value
|
|
25
39
|
};
|
|
26
40
|
config.resourcePayload = {
|
|
27
|
-
|
|
41
|
+
caseClassName: ruleClass
|
|
28
42
|
};
|
|
29
43
|
}
|
|
30
44
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
label: "",
|
|
48
|
-
displayMode: "",
|
|
49
|
-
type: "",
|
|
50
|
-
referenceType: "",
|
|
51
|
-
hideLabel: false,
|
|
52
|
-
dataRelationshipContext: null
|
|
53
|
-
};
|
|
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
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
getPConnect: PropTypes.func.isRequired,
|
|
58
|
-
displayAs: PropTypes.string,
|
|
59
|
-
ruleClass: PropTypes.string,
|
|
60
|
-
label: PropTypes.string,
|
|
61
|
-
displayMode: PropTypes.string,
|
|
62
|
-
type: PropTypes.string,
|
|
63
|
-
referenceType: PropTypes.string,
|
|
64
|
-
hideLabel: PropTypes.bool,
|
|
65
|
-
dataRelationshipContext: PropTypes.string
|
|
66
|
-
};
|
|
62
|
+
return <>{component}</>;
|
|
63
|
+
}
|
|
@@ -1,65 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Tab, Tabs } from "@material-ui/core";
|
|
1
|
+
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
+
import { Tab, Tabs } from '@material-ui/core';
|
|
4
3
|
import { TabContext, TabPanel } from '@material-ui/lab';
|
|
4
|
+
|
|
5
5
|
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
|
|
8
|
+
interface SubTabsProps extends PConnProps {
|
|
9
|
+
// If any, enter additional props that only exist on this component
|
|
10
|
+
}
|
|
6
11
|
|
|
7
|
-
export default function SubTabs(props) {
|
|
8
|
-
const { children } = props;
|
|
12
|
+
export default function SubTabs(props: PropsWithChildren<SubTabsProps>) {
|
|
13
|
+
const { children = [] } = props;
|
|
9
14
|
|
|
10
15
|
const defaultTabIndex = 0;
|
|
11
|
-
const deferLoadedTabs = children[0];
|
|
12
|
-
const availableTabs = getVisibleTabs(deferLoadedTabs,
|
|
16
|
+
const deferLoadedTabs = Children.toArray(children)[0];
|
|
17
|
+
const availableTabs = getVisibleTabs(deferLoadedTabs, 'tabsSubs');
|
|
13
18
|
const [currentTabId, setCurrentTabId] = useState(defaultTabIndex.toString());
|
|
14
19
|
|
|
15
|
-
const [tabItems, setTabitem] = useState<
|
|
20
|
+
const [tabItems, setTabitem] = useState<any[]>([]);
|
|
16
21
|
useEffect(() => {
|
|
17
|
-
const tempTabItems = getTransientTabs(
|
|
18
|
-
availableTabs,
|
|
19
|
-
currentTabId,
|
|
20
|
-
tabItems
|
|
21
|
-
);
|
|
22
|
+
const tempTabItems = getTransientTabs(availableTabs, currentTabId, tabItems);
|
|
22
23
|
setTabitem(tempTabItems);
|
|
23
24
|
}, [currentTabId]);
|
|
24
25
|
|
|
25
|
-
|
|
26
26
|
const handleTabClick = (id, index: string) => {
|
|
27
27
|
setCurrentTabId(index);
|
|
28
28
|
tabClick(index, availableTabs, currentTabId, setCurrentTabId, tabItems);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
value={currentTabId}
|
|
37
|
-
variant="scrollable"
|
|
38
|
-
>
|
|
39
|
-
{tabItems.map((tab:any) =>
|
|
40
|
-
<Tab
|
|
41
|
-
key={tab.id}
|
|
42
|
-
label={tab.name}
|
|
43
|
-
value={tab.id}
|
|
44
|
-
/>
|
|
45
|
-
)}
|
|
46
|
-
</Tabs>
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
tabItems.map((tab:any) => (
|
|
50
|
-
<TabPanel key={tab.id} value={tab.id} tabIndex={+tab.id}>
|
|
51
|
-
<div>{tab.content ? tab.content : "No content exists"}</div>
|
|
52
|
-
</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} />
|
|
53
36
|
))}
|
|
54
|
-
</
|
|
55
|
-
|
|
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>
|
|
56
45
|
);
|
|
57
46
|
}
|
|
58
|
-
|
|
59
|
-
SubTabs.defaultProps = {
|
|
60
|
-
children: []
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
SubTabs.propTypes = {
|
|
64
|
-
children: PropTypes.arrayOf(PropTypes.node)
|
|
65
|
-
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
2
|
-
|
|
3
|
-
declare const PCore: typeof PCoreType;
|
|
4
|
-
|
|
5
|
-
|
|
6
1
|
export const getDeferFriendlyTabs = allTabs => {
|
|
7
2
|
return allTabs.map(tab => {
|
|
8
3
|
const theTabCompConfig = tab.getPConnect().getConfigProps();
|
|
@@ -42,9 +37,7 @@ export const getTransientTabs = (availableTabs, currentTabId, tabItems) => {
|
|
|
42
37
|
PCore.getLocaleUtils().getLocaleValue('No label specified in config', 'Generic');
|
|
43
38
|
const tabContent = () => {
|
|
44
39
|
if (i.toString() === currentTabId) {
|
|
45
|
-
return tabItems?.[i.toString()]?.content
|
|
46
|
-
? tabItems?.[i.toString()]?.content
|
|
47
|
-
: child.getPConnect().getComponent();
|
|
40
|
+
return tabItems?.[i.toString()]?.content ? tabItems?.[i.toString()]?.content : child.getPConnect().getComponent();
|
|
48
41
|
}
|
|
49
42
|
return tabItems?.[i.toString()]?.content;
|
|
50
43
|
};
|
|
@@ -69,7 +62,7 @@ export const tabClick = (id, availableTabs, currentTabId, setCurrentTabId, tabIt
|
|
|
69
62
|
}
|
|
70
63
|
|
|
71
64
|
const nextPConn = availableTabs[id].getPConnect();
|
|
72
|
-
const { deferLoadId: activeId } = nextPConn?.getConfigProps();
|
|
65
|
+
const { deferLoadId: activeId } = nextPConn?.getConfigProps() || {};
|
|
73
66
|
PCore.getDeferLoadManager().activate(activeId, nextPConn?.getContextName());
|
|
74
67
|
PCore.getDeferLoadManager().refreshComponent(activeId, nextPConn?.getContextName());
|
|
75
68
|
};
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Grid, GridSize } from "@material-ui/core";
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid, GridSize } from '@material-ui/core';
|
|
4
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
6
|
+
interface TwoColumnProps extends PConnProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
templateCol?: string;
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
const useStyles = makeStyles(() => ({
|
|
7
12
|
colStyles: {
|
|
8
|
-
display:
|
|
9
|
-
gap:
|
|
10
|
-
alignContent:
|
|
11
|
-
}
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gap: '1rem',
|
|
15
|
+
alignContent: 'baseline'
|
|
16
|
+
}
|
|
12
17
|
}));
|
|
13
18
|
|
|
14
|
-
export default function TwoColumn(props) {
|
|
19
|
+
export default function TwoColumn(props: PropsWithChildren<TwoColumnProps>) {
|
|
15
20
|
const classes = useStyles();
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
const { children, templateCol = '1fr 1fr' } = props;
|
|
23
|
+
const childrenToRender = children as ReactElement[];
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
|
23
29
|
|
|
24
30
|
// Calculate the size
|
|
25
31
|
// Default to assume the 2 columns are evenly split. However, override if templateCol
|
|
@@ -27,32 +33,23 @@ export default function TwoColumn(props) {
|
|
|
27
33
|
let aSize: GridSize = 6;
|
|
28
34
|
let bSize: GridSize = 6;
|
|
29
35
|
|
|
30
|
-
const colAArray = templateCol
|
|
36
|
+
const colAArray = templateCol
|
|
37
|
+
.replaceAll(/[a-z]+/g, '')
|
|
38
|
+
.split(/\s/)
|
|
39
|
+
.map(itm => Number(itm));
|
|
31
40
|
const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
|
|
32
41
|
const ratio = 12 / totalCols;
|
|
33
42
|
aSize = (ratio * colAArray[0]) as GridSize;
|
|
34
43
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
35
44
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
);
|
|
46
55
|
}
|
|
47
|
-
|
|
48
|
-
TwoColumn.propTypes = {
|
|
49
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
50
|
-
// title: PropTypes.string,
|
|
51
|
-
templateCol: PropTypes.string,
|
|
52
|
-
// icon: PropTypes.string
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
TwoColumn.defaultProps = {
|
|
56
|
-
templateCol: "1fr 1fr",
|
|
57
|
-
// icon: ""
|
|
58
|
-
};
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
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
|
-
|
|
4
|
+
interface TwoColumnPageProps extends PConnProps {
|
|
5
|
+
// If any, enter additional props that only exist on this component
|
|
6
|
+
}
|
|
5
7
|
|
|
6
8
|
/*
|
|
7
9
|
* The wrapper handles knowing how to take in just children
|
|
8
10
|
* and mapping to the TwoColumn template.
|
|
9
11
|
*/
|
|
10
|
-
export default function TwoColumnPage(props) {
|
|
12
|
+
export default function TwoColumnPage(props: TwoColumnPageProps) {
|
|
13
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
14
|
+
const TwoColumn = getComponentFromMap('TwoColumn');
|
|
11
15
|
|
|
12
|
-
return
|
|
13
|
-
<TwoColumn
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
16
|
+
return <TwoColumn {...props} />;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
TwoColumnPage.propTypes = {
|
|
20
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
TwoColumnPage.defaultProps = {
|
|
24
|
-
};
|
|
@@ -1,25 +1,31 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Grid, GridSize } from "@material-ui/core";
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid, GridSize } from '@material-ui/core';
|
|
4
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
6
|
+
interface TwoColumnTabProps extends PConnProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
templateCol?: string;
|
|
9
|
+
}
|
|
5
10
|
|
|
6
11
|
const useStyles = makeStyles(() => ({
|
|
7
12
|
colStyles: {
|
|
8
|
-
display:
|
|
9
|
-
gap:
|
|
10
|
-
alignContent:
|
|
11
|
-
}
|
|
13
|
+
display: 'grid',
|
|
14
|
+
gap: '1rem',
|
|
15
|
+
alignContent: 'baseline'
|
|
16
|
+
}
|
|
12
17
|
}));
|
|
13
18
|
|
|
14
|
-
export default function TwoColumnTab(props) {
|
|
19
|
+
export default function TwoColumnTab(props: PropsWithChildren<TwoColumnTabProps>) {
|
|
15
20
|
const classes = useStyles();
|
|
16
21
|
|
|
17
|
-
|
|
22
|
+
const { children, templateCol = '1fr 1fr' } = props;
|
|
23
|
+
const childrenToRender = children as ReactElement[];
|
|
18
24
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
|
23
29
|
|
|
24
30
|
// Calculate the size
|
|
25
31
|
// Default to assume the 2 columns are evenly split. However, override if templateCol
|
|
@@ -27,29 +33,23 @@ export default function TwoColumnTab(props) {
|
|
|
27
33
|
let aSize: GridSize = 6;
|
|
28
34
|
let bSize: GridSize = 6;
|
|
29
35
|
|
|
30
|
-
const colAArray = templateCol
|
|
36
|
+
const colAArray = templateCol
|
|
37
|
+
.replaceAll(/[a-z]+/g, '')
|
|
38
|
+
.split(/\s/)
|
|
39
|
+
.map(itm => Number(itm));
|
|
31
40
|
const totalCols = colAArray.reduce((v, itm) => itm + v, 0);
|
|
32
41
|
const ratio = 12 / totalCols;
|
|
33
42
|
aSize = (ratio * colAArray[0]) as GridSize;
|
|
34
43
|
bSize = (ratio * colAArray[1]) as GridSize;
|
|
35
44
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
);
|
|
46
55
|
}
|
|
47
|
-
|
|
48
|
-
TwoColumnTab.propTypes = {
|
|
49
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
50
|
-
templateCol: PropTypes.string,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
TwoColumnTab.defaultProps = {
|
|
54
|
-
templateCol: "1fr 1fr",
|
|
55
|
-
};
|
|
@@ -1,35 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
import './WideNarrow.css';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface WideNarrowProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
a: any;
|
|
8
|
+
b: any;
|
|
9
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
10
|
+
title?: string;
|
|
11
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
12
|
+
cols?: string;
|
|
13
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
14
|
+
icon?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function WideNarrow(props: PropsWithChildren<WideNarrowProps>) {
|
|
6
18
|
// const {a, b /*, cols, icon, title */ } = props;
|
|
7
|
-
const { a, b, children } = props;
|
|
19
|
+
const { a, b, children = [] } = props;
|
|
8
20
|
|
|
9
21
|
return (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{children[
|
|
15
|
-
</div>
|
|
16
|
-
<div className="psdk-narrow-column-column">
|
|
17
|
-
{children[1]}
|
|
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>
|
|
18
27
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
{a}
|
|
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>
|
|
25
33
|
</div>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
</div>
|
|
30
|
-
}
|
|
31
|
-
</React.Fragment>
|
|
32
|
-
|
|
33
|
-
)
|
|
34
|
-
|
|
34
|
+
)}
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
35
37
|
}
|