@pega/react-sdk-overrides 0.23.26 → 0.23.28
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 +39 -0
- package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
- 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 +13 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
- package/lib/designSystemExtension/Operator/Operator.tsx +106 -87
- 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 +21 -15
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +29 -19
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +27 -38
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +10 -18
- package/lib/field/Date/Date.tsx +33 -15
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +22 -11
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +64 -17
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +154 -18
- 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 +37 -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 +14 -6
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +17 -7
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +55 -24
- 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 -10
- 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 +41 -10
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +21 -18
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +23 -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 -58
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +16 -11
- package/lib/helpers/case-utils.tsx +99 -0
- package/lib/helpers/common-utils.ts +8 -0
- package/lib/helpers/data_page.ts +3 -6
- package/lib/helpers/date-format-utils.ts +29 -19
- package/lib/helpers/{event-utils.js → event-utils.ts} +4 -4
- package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +9 -10
- package/lib/helpers/formatters/Boolean.ts +21 -0
- package/lib/helpers/formatters/{Currency.js → Currency.ts} +22 -27
- package/lib/helpers/formatters/CurrencyMap.ts +915 -0
- package/lib/helpers/formatters/{Date.js → Date.ts} +20 -26
- package/lib/helpers/formatters/{common.js → common.ts} +3 -4
- package/lib/helpers/formatters/{index.js → index.ts} +22 -22
- package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +2 -2
- package/lib/helpers/simpleTableHelpers.ts +65 -85
- package/lib/helpers/state-utils.tsx +43 -0
- package/lib/helpers/template-utils.ts +4 -8
- package/lib/helpers/utils.ts +16 -8
- package/lib/helpers/versionHelpers.ts +1 -5
- package/lib/infra/ActionButtons/ActionButtons.tsx +46 -42
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -84
- 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 +98 -232
- package/lib/infra/Containers/FlowContainer/helpers.ts +138 -0
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +66 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +105 -70
- 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 +49 -64
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +26 -51
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -40
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -31
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +25 -38
- 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 +28 -43
- package/lib/infra/Reference/Reference.tsx +16 -22
- package/lib/infra/Region/Region.tsx +9 -9
- package/lib/infra/RootContainer/RootContainer.tsx +82 -125
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +38 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
- package/lib/infra/View/View.tsx +32 -63
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +51 -69
- package/lib/template/BannerPage/BannerPage.tsx +26 -33
- package/lib/template/CaseSummary/CaseSummary.tsx +23 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +122 -114
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +46 -35
- package/lib/template/Confirmation/Confirmation.tsx +25 -53
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +112 -140
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +26 -20
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/DefaultForm/utils/index.ts +33 -0
- 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 +24 -34
- 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.js → DefaultViewMeta.ts} +1 -3
- package/lib/template/ListView/ListView.tsx +245 -306
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/{hooks.js → hooks.ts} +24 -24
- package/lib/template/ListView/{utils.js → utils.ts} +202 -91
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -30
- 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 +44 -34
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +115 -14
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +171 -100
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +34 -40
- 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 -7
- 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 +20 -9
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +75 -4
- package/lib/widget/Attachment/Attachment.tsx +370 -388
- 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 +324 -246
- 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 +24 -16
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +62 -54
- 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 +80 -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 -631
- package/lib/helpers/config_access.js +0 -268
- package/lib/helpers/formatters/Boolean.js +0 -38
- package/lib/helpers/formatters/CurrencyMap.js +0 -908
- package/lib/infra/Containers/FlowContainer/helpers.js +0 -147
|
@@ -1,13 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { PropsWithChildren, ReactElement, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
6
|
+
// ReferenceProps can't be used until getComponentConfig() is NOT private
|
|
7
|
+
interface DataReferenceProps extends PConnProps {
|
|
8
|
+
// If any, enter additional props that only exist on this component
|
|
9
|
+
label: string;
|
|
10
|
+
showLabel: any;
|
|
11
|
+
displayMode: string;
|
|
12
|
+
allowAndPersistChangesInReviewMode: boolean;
|
|
13
|
+
referenceType: string;
|
|
14
|
+
selectionMode: string;
|
|
15
|
+
displayAs: string;
|
|
16
|
+
ruleClass: string;
|
|
17
|
+
parameters: string[]; // need to fix
|
|
18
|
+
hideLabel: boolean;
|
|
19
|
+
}
|
|
5
20
|
|
|
6
21
|
const SELECTION_MODE = { SINGLE: 'single', MULTI: 'multi' };
|
|
7
22
|
|
|
8
|
-
|
|
23
|
+
export default function DataReference(props: PropsWithChildren<DataReferenceProps>) {
|
|
24
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
25
|
+
const SingleReferenceReadonly = getComponentFromMap('SingleReferenceReadOnly');
|
|
26
|
+
const MultiReferenceReadonly = getComponentFromMap('MultiReferenceReadOnly');
|
|
9
27
|
|
|
10
|
-
export default function DataReference(props) {
|
|
11
28
|
const {
|
|
12
29
|
children,
|
|
13
30
|
getPConnect,
|
|
@@ -22,14 +39,14 @@ export default function DataReference(props) {
|
|
|
22
39
|
parameters,
|
|
23
40
|
hideLabel
|
|
24
41
|
} = props;
|
|
25
|
-
let childrenToRender = children;
|
|
42
|
+
let childrenToRender = children as ReactElement[];
|
|
26
43
|
const pConn = getPConnect();
|
|
27
44
|
const [dropDownDataSource, setDropDownDataSource] = useState(null);
|
|
28
|
-
const propsToUse = { label, showLabel, ...pConn.getInheritedProps() };
|
|
45
|
+
const propsToUse: any = { label, showLabel, ...pConn.getInheritedProps() };
|
|
29
46
|
if (propsToUse.showLabel === false) {
|
|
30
47
|
propsToUse.label = '';
|
|
31
48
|
}
|
|
32
|
-
const rawViewMetadata = pConn.getRawMetadata();
|
|
49
|
+
const rawViewMetadata: any = pConn.getRawMetadata();
|
|
33
50
|
const viewName = rawViewMetadata.name;
|
|
34
51
|
const [firstChildMeta] = rawViewMetadata.children;
|
|
35
52
|
const refList = rawViewMetadata.config.referenceList;
|
|
@@ -40,32 +57,34 @@ export default function DataReference(props) {
|
|
|
40
57
|
|
|
41
58
|
/* Only for dropdown when it has param use data api to get the data back and add it to datasource */
|
|
42
59
|
useEffect(() => {
|
|
43
|
-
if (
|
|
44
|
-
firstChildMeta?.type === "Dropdown" &&
|
|
45
|
-
rawViewMetadata.config?.parameters
|
|
46
|
-
) {
|
|
60
|
+
if (firstChildMeta?.type === 'Dropdown' && rawViewMetadata.config?.parameters) {
|
|
47
61
|
const { value, key, text } = firstChildMeta.config.datasource.fields;
|
|
48
|
-
|
|
49
|
-
.getData(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
62
|
+
(
|
|
63
|
+
PCore.getDataApiUtils().getData(
|
|
64
|
+
refList,
|
|
65
|
+
{
|
|
66
|
+
dataViewParameters: parameters
|
|
67
|
+
} as any,
|
|
68
|
+
''
|
|
69
|
+
) as Promise<any>
|
|
70
|
+
)
|
|
71
|
+
.then(res => {
|
|
53
72
|
if (res.data.data !== null) {
|
|
54
73
|
const ddDataSource = res.data.data
|
|
55
|
-
.map(
|
|
56
|
-
key: listItem[key.split(
|
|
57
|
-
text: listItem[text.split(
|
|
58
|
-
value: listItem[value.split(
|
|
74
|
+
.map(listItem => ({
|
|
75
|
+
key: listItem[key.split(' .', 2)[1]],
|
|
76
|
+
text: listItem[text.split(' .', 2)[1]],
|
|
77
|
+
value: listItem[value.split(' .', 2)[1]]
|
|
59
78
|
}))
|
|
60
|
-
.filter(
|
|
79
|
+
.filter(item => item.key);
|
|
61
80
|
// Filtering out undefined entries that will break preview
|
|
62
81
|
setDropDownDataSource(ddDataSource);
|
|
63
82
|
} else {
|
|
64
|
-
const ddDataSource: any = []
|
|
83
|
+
const ddDataSource: any = [];
|
|
65
84
|
setDropDownDataSource(ddDataSource);
|
|
66
85
|
}
|
|
67
86
|
})
|
|
68
|
-
.catch(
|
|
87
|
+
.catch(err => {
|
|
69
88
|
// eslint-disable-next-line no-console
|
|
70
89
|
console.error(err?.stack);
|
|
71
90
|
return Promise.resolve({
|
|
@@ -76,7 +95,7 @@ export default function DataReference(props) {
|
|
|
76
95
|
}, [firstChildMeta, rawViewMetadata, parameters]);
|
|
77
96
|
|
|
78
97
|
if (firstChildMeta?.type !== 'Region') {
|
|
79
|
-
firstChildPConnect = getPConnect().getChildren()[0].getPConnect;
|
|
98
|
+
firstChildPConnect = getPConnect().getChildren()?.[0].getPConnect;
|
|
80
99
|
/* remove refresh When condition from those old view so that it will not be used for runtime */
|
|
81
100
|
if (firstChildMeta.config?.readOnly) {
|
|
82
101
|
delete firstChildMeta.config.readOnly;
|
|
@@ -107,10 +126,9 @@ export default function DataReference(props) {
|
|
|
107
126
|
const handleSelection = event => {
|
|
108
127
|
const caseKey = pConn.getCaseInfo().getKey();
|
|
109
128
|
const refreshOptions = { autoDetectRefresh: true };
|
|
110
|
-
if (canBeChangedInReviewMode && pConn.getValue('__currentPageTabViewName')) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
.refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName'), null, refreshOptions);
|
|
129
|
+
if (canBeChangedInReviewMode && pConn.getValue('__currentPageTabViewName', '')) {
|
|
130
|
+
// 2nd arg empty string until typedef marked correctly
|
|
131
|
+
getPConnect().getActionsApi().refreshCaseView(caseKey, pConn.getValue('__currentPageTabViewName', ''), null, refreshOptions); // 2nd arg empty string until typedef marked correctly
|
|
114
132
|
PCore.getDeferLoadManager().refreshActiveComponents(pConn.getContextName());
|
|
115
133
|
} else {
|
|
116
134
|
const pgRef = pConn.getPageReference().replace('caseInfo.content', '');
|
|
@@ -120,45 +138,41 @@ export default function DataReference(props) {
|
|
|
120
138
|
// AutoComplete sets value on event.id whereas Dropdown sets it on event.target.value
|
|
121
139
|
const propValue = event?.id || event?.target.value;
|
|
122
140
|
if (propValue && canBeChangedInReviewMode && isDisplayModeEnabled) {
|
|
123
|
-
PCore.getDataApiUtils()
|
|
124
|
-
.
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
let curr = {};
|
|
128
|
-
const commitData = curr;
|
|
141
|
+
(PCore.getDataApiUtils().getCaseEditLock(caseKey, '') as Promise<any>).then(caseResponse => {
|
|
142
|
+
const pageTokens = pConn.getPageReference().replace('caseInfo.content', '').split('.');
|
|
143
|
+
let curr = {};
|
|
144
|
+
const commitData = curr;
|
|
129
145
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
146
|
+
pageTokens.forEach(el => {
|
|
147
|
+
if (el !== '') {
|
|
148
|
+
curr[el] = {};
|
|
149
|
+
curr = curr[el];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
136
152
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
153
|
+
// expecting format like {Customer: {pyID:"C-100"}}
|
|
154
|
+
const propArr = propName.split('.');
|
|
155
|
+
propArr.forEach((element, idx) => {
|
|
156
|
+
if (idx + 1 === propArr.length) {
|
|
157
|
+
curr[element] = propValue;
|
|
158
|
+
} else {
|
|
159
|
+
curr[element] = {};
|
|
160
|
+
curr = curr[element];
|
|
161
|
+
}
|
|
162
|
+
});
|
|
147
163
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
response.headers.etag
|
|
159
|
-
);
|
|
160
|
-
});
|
|
164
|
+
(
|
|
165
|
+
PCore.getDataApiUtils().updateCaseEditFieldsData(
|
|
166
|
+
caseKey,
|
|
167
|
+
{ [caseKey]: commitData },
|
|
168
|
+
caseResponse.headers.etag,
|
|
169
|
+
pConn.getContextName()
|
|
170
|
+
) as Promise<any>
|
|
171
|
+
).then(response => {
|
|
172
|
+
PCore.getContainerUtils().updateParentLastUpdateTime(pConn.getContextName(), response.data.data.caseInfo.lastUpdateTime);
|
|
173
|
+
PCore.getContainerUtils().updateRelatedContextEtag(pConn.getContextName(), response.headers.etag);
|
|
161
174
|
});
|
|
175
|
+
});
|
|
162
176
|
}
|
|
163
177
|
};
|
|
164
178
|
|
|
@@ -169,7 +183,10 @@ export default function DataReference(props) {
|
|
|
169
183
|
const { type, config } = firstChildMeta;
|
|
170
184
|
if (firstChildMeta?.type !== 'Region') {
|
|
171
185
|
pConn.clearErrorMessages({
|
|
172
|
-
|
|
186
|
+
// Need to add empty string for category and context to match typdef
|
|
187
|
+
property: propName,
|
|
188
|
+
category: '',
|
|
189
|
+
context: ''
|
|
173
190
|
});
|
|
174
191
|
if (!canBeChangedInReviewMode && isDisplayModeEnabled && selectionMode === SELECTION_MODE.SINGLE) {
|
|
175
192
|
return (
|
|
@@ -183,68 +200,51 @@ export default function DataReference(props) {
|
|
|
183
200
|
ruleClass={ruleClass}
|
|
184
201
|
referenceType={referenceType}
|
|
185
202
|
hideLabel={hideLabel}
|
|
186
|
-
dataRelationshipContext={
|
|
187
|
-
rawViewMetadata.config.contextClass && rawViewMetadata.config.name ? rawViewMetadata.config.name : null
|
|
188
|
-
}
|
|
203
|
+
dataRelationshipContext={rawViewMetadata.config.contextClass && rawViewMetadata.config.name ? rawViewMetadata.config.name : null}
|
|
189
204
|
/>
|
|
190
205
|
);
|
|
191
206
|
}
|
|
192
207
|
|
|
193
208
|
if (isDisplayModeEnabled && selectionMode === SELECTION_MODE.MULTI) {
|
|
194
|
-
return
|
|
195
|
-
<MultiReferenceReadonly
|
|
196
|
-
config={config}
|
|
197
|
-
getPConnect={firstChildPConnect}
|
|
198
|
-
label={propsToUse.label}
|
|
199
|
-
hideLabel={hideLabel}
|
|
200
|
-
/>
|
|
201
|
-
);
|
|
209
|
+
return <MultiReferenceReadonly config={config} getPConnect={firstChildPConnect} label={propsToUse.label} hideLabel={hideLabel} />;
|
|
202
210
|
}
|
|
203
211
|
|
|
204
212
|
// In the case of a datasource with parameters you cannot load the dropdown before the parameters
|
|
205
|
-
if (
|
|
206
|
-
type === 'Dropdown' &&
|
|
207
|
-
rawViewMetadata.config?.parameters &&
|
|
208
|
-
dropDownDataSource === null
|
|
209
|
-
) {
|
|
213
|
+
if (type === 'Dropdown' && rawViewMetadata.config?.parameters && dropDownDataSource === null) {
|
|
210
214
|
return null;
|
|
211
215
|
}
|
|
212
216
|
|
|
213
|
-
return firstChildPConnect().createComponent(
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
rawViewMetadata.config.contextClass && rawViewMetadata.config.name
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
217
|
+
return firstChildPConnect().createComponent(
|
|
218
|
+
{
|
|
219
|
+
type,
|
|
220
|
+
config: {
|
|
221
|
+
...config,
|
|
222
|
+
required: propsToUse.required,
|
|
223
|
+
visibility: propsToUse.visibility,
|
|
224
|
+
disabled: propsToUse.disabled,
|
|
225
|
+
label: propsToUse.label,
|
|
226
|
+
viewName: getPConnect().getCurrentView(),
|
|
227
|
+
parameters: rawViewMetadata.config.parameters,
|
|
228
|
+
readOnly: false,
|
|
229
|
+
localeReference: rawViewMetadata.config.localeReference,
|
|
230
|
+
...(selectionMode === SELECTION_MODE.SINGLE ? { referenceType } : ''),
|
|
231
|
+
dataRelationshipContext: rawViewMetadata.config.contextClass && rawViewMetadata.config.name ? rawViewMetadata.config.name : null,
|
|
232
|
+
hideLabel,
|
|
233
|
+
onRecordChange: handleSelection
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
'',
|
|
237
|
+
'',
|
|
238
|
+
{}
|
|
239
|
+
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional);
|
|
234
240
|
}
|
|
235
|
-
}, [
|
|
236
|
-
firstChildMeta.config?.datasource?.source,
|
|
237
|
-
parameters,
|
|
238
|
-
dropDownDataSource,
|
|
239
|
-
propsToUse.required,
|
|
240
|
-
propsToUse.disabled
|
|
241
|
-
]);
|
|
241
|
+
}, [firstChildMeta.config?.datasource?.source, parameters, dropDownDataSource, propsToUse.required, propsToUse.disabled]);
|
|
242
242
|
|
|
243
243
|
// Only include the views region for rendering when it has content
|
|
244
244
|
if (firstChildMeta?.type !== 'Region') {
|
|
245
245
|
const viewsRegion = rawViewMetadata.children[1];
|
|
246
246
|
if (viewsRegion?.name === 'Views' && viewsRegion.children.length) {
|
|
247
|
-
childrenToRender = [recreatedFirstChild, ...children.slice(1)];
|
|
247
|
+
childrenToRender = [recreatedFirstChild, ...(children as ReactElement[]).slice(1)];
|
|
248
248
|
} else {
|
|
249
249
|
childrenToRender = [recreatedFirstChild];
|
|
250
250
|
}
|
|
@@ -255,36 +255,8 @@ export default function DataReference(props) {
|
|
|
255
255
|
) : (
|
|
256
256
|
<div>
|
|
257
257
|
{childrenToRender.map(child => (
|
|
258
|
-
|
|
258
|
+
<>{child}</>
|
|
259
259
|
))}
|
|
260
260
|
</div>
|
|
261
261
|
);
|
|
262
262
|
}
|
|
263
|
-
|
|
264
|
-
DataReference.defaultProps = {
|
|
265
|
-
label: undefined,
|
|
266
|
-
showLabel: undefined,
|
|
267
|
-
displayMode: undefined,
|
|
268
|
-
allowAndPersistChangesInReviewMode: false,
|
|
269
|
-
referenceType: '',
|
|
270
|
-
selectionMode: '',
|
|
271
|
-
displayAs: '',
|
|
272
|
-
ruleClass: '',
|
|
273
|
-
parameters: undefined,
|
|
274
|
-
hideLabel: false
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
DataReference.propTypes = {
|
|
278
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
279
|
-
getPConnect: PropTypes.func.isRequired,
|
|
280
|
-
label: PropTypes.string,
|
|
281
|
-
showLabel: PropTypes.func,
|
|
282
|
-
displayMode: PropTypes.string,
|
|
283
|
-
allowAndPersistChangesInReviewMode: PropTypes.bool,
|
|
284
|
-
referenceType: PropTypes.string,
|
|
285
|
-
selectionMode: PropTypes.string,
|
|
286
|
-
displayAs: PropTypes.string,
|
|
287
|
-
ruleClass: PropTypes.string,
|
|
288
|
-
parameters: PropTypes.arrayOf(PropTypes.string), // need to fix
|
|
289
|
-
hideLabel: PropTypes.bool
|
|
290
|
-
};
|
|
@@ -16,15 +16,19 @@
|
|
|
16
16
|
gap: calc(1rem);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
.psdk-default-form-three-column .grid-column {
|
|
20
|
+
grid-column: 1 / span 3;
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
.psdk-default-form-two-column .grid-column {
|
|
20
24
|
grid-column: 1 / span 2;
|
|
21
25
|
}
|
|
22
26
|
|
|
23
|
-
.psdk-default-form-
|
|
24
|
-
grid-column: 1
|
|
27
|
+
.psdk-default-form-one-column .grid-column {
|
|
28
|
+
grid-column: 1;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
|
-
.psdk-default-form-instruction-text{
|
|
31
|
+
.psdk-default-form-instruction-text {
|
|
28
32
|
padding-top: 0.625rem;
|
|
29
33
|
padding-bottom: 0.625rem;
|
|
30
34
|
}
|
|
@@ -1,15 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { createElement, PropsWithChildren } from 'react';
|
|
3
2
|
|
|
4
3
|
import { getInstructions } from '@pega/react-sdk-components/lib/components/helpers/template-utils';
|
|
5
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
|
+
import connectToState from '@pega/react-sdk-components/lib/components/helpers/state-utils';
|
|
6
|
+
|
|
7
|
+
import { getKeyForMappedField, mapStateToProps } from './utils';
|
|
8
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
9
|
|
|
7
10
|
import './DefaultForm.css';
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
interface DefaultFormProps extends PConnProps {
|
|
13
|
+
// If any, enter additional props that only exist on this component
|
|
14
|
+
NumCols: string;
|
|
15
|
+
instructions: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Child = connectToState(mapStateToProps)(props => {
|
|
19
|
+
const { key, visibility, ...rest } = props;
|
|
20
|
+
|
|
21
|
+
return createElement(createPConnectComponent(), { ...rest, key, visibility });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export default function DefaultForm(props: PropsWithChildren<DefaultFormProps>) {
|
|
25
|
+
const { getPConnect, NumCols = '1' } = props;
|
|
11
26
|
const instructions = getInstructions(getPConnect(), props.instructions);
|
|
12
|
-
const instructionText = instructions?.replace(/<\/?[^>]+(>|$)/g, '');
|
|
13
27
|
|
|
14
28
|
let divClass: string;
|
|
15
29
|
|
|
@@ -35,26 +49,18 @@ export default function DefaultForm(props) {
|
|
|
35
49
|
// to take the children and create components for them, put in an array and pass as the
|
|
36
50
|
// defaultForm kids
|
|
37
51
|
const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
|
|
38
|
-
const dfChildren = arChildren
|
|
39
|
-
// eslint-disable-next-line react/no-array-index-key
|
|
40
|
-
createElement(createPConnectComponent(), { ...kid, key: idx })
|
|
41
|
-
);
|
|
52
|
+
const dfChildren = arChildren?.map(kid => <Child key={getKeyForMappedField(kid)} {...kid} />);
|
|
42
53
|
|
|
43
54
|
return (
|
|
44
55
|
<>
|
|
45
|
-
{
|
|
46
|
-
<div className='psdk-default-form-instruction-text'>
|
|
56
|
+
{instructions && (
|
|
57
|
+
<div className='psdk-default-form-instruction-text'>
|
|
58
|
+
{/* server performs sanitization method for instructions html content */}
|
|
59
|
+
{/* eslint-disable react/no-danger */}
|
|
60
|
+
<div key='instructions' id='instruction-text' dangerouslySetInnerHTML={{ __html: instructions }} />
|
|
61
|
+
</div>
|
|
47
62
|
)}
|
|
48
63
|
<div className={divClass}>{dfChildren}</div>
|
|
49
64
|
</>
|
|
50
65
|
);
|
|
51
66
|
}
|
|
52
|
-
|
|
53
|
-
DefaultForm.propTypes = {
|
|
54
|
-
// children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
55
|
-
NumCols: PropTypes.string
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
DefaultForm.defaultProps = {
|
|
59
|
-
NumCols: '1'
|
|
60
|
-
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
|
+
|
|
3
|
+
export const mapStateToProps: any = (_, ownProps) => {
|
|
4
|
+
const { getPConnect } = ownProps;
|
|
5
|
+
|
|
6
|
+
return {
|
|
7
|
+
visibility: getPConnect().getComputedVisibility(),
|
|
8
|
+
getPConnect
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const getKeyForMappedField = field => {
|
|
13
|
+
if (Array.isArray(field)) {
|
|
14
|
+
return field
|
|
15
|
+
.map(item => {
|
|
16
|
+
return getKeyForMappedField(item);
|
|
17
|
+
})
|
|
18
|
+
.join('__');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const pConnect = field?.getPConnect?.();
|
|
22
|
+
|
|
23
|
+
if (pConnect?.meta?.type && pConnect?.meta?.config?.name) {
|
|
24
|
+
return `${pConnect.meta.type}_${pConnect.meta.config.name}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Using label as a fallback if name is not defined.
|
|
28
|
+
if (pConnect?.meta?.type && pConnect?.meta?.config?.label) {
|
|
29
|
+
return `${pConnect.meta.type}_${pConnect.meta.config.label}`;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return uuidv4();
|
|
33
|
+
};
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import { createElement } from 'react';
|
|
3
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
|
+
|
|
4
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
|
|
8
|
+
interface DetailsProps extends PConnProps {
|
|
9
|
+
// If any, enter additional props that only exist on this component
|
|
10
|
+
label: string;
|
|
11
|
+
showLabel: boolean;
|
|
12
|
+
showHighlightedData: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function Details(props: DetailsProps) {
|
|
16
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
17
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
6
18
|
|
|
7
|
-
export default function Details(props) {
|
|
8
19
|
const { label, showLabel, getPConnect, showHighlightedData } = props;
|
|
9
20
|
|
|
10
21
|
// Get the inherited props from the parent to determine label settings
|
|
@@ -14,20 +25,18 @@ export default function Details(props) {
|
|
|
14
25
|
// in a readonly (display) mode instead of a editable
|
|
15
26
|
getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
16
27
|
getPConnect().setInheritedProp('readOnly', true);
|
|
17
|
-
const children = getPConnect()
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
);
|
|
28
|
+
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
29
|
+
createElement(createPConnectComponent(), {
|
|
30
|
+
...configObject,
|
|
31
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
32
|
+
key: index.toString()
|
|
33
|
+
})
|
|
34
|
+
);
|
|
26
35
|
|
|
27
36
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
28
37
|
let highlightedDataArr = [];
|
|
29
38
|
if (showHighlightedData) {
|
|
30
|
-
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
39
|
+
const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;
|
|
31
40
|
highlightedDataArr = highlightedData.map(field => {
|
|
32
41
|
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
33
42
|
|
|
@@ -37,7 +46,7 @@ export default function Details(props) {
|
|
|
37
46
|
field.config.displayAsStatus = true;
|
|
38
47
|
}
|
|
39
48
|
|
|
40
|
-
return getPConnect().createComponent(field);
|
|
49
|
+
return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
41
50
|
});
|
|
42
51
|
}
|
|
43
52
|
|
|
@@ -62,16 +71,3 @@ export default function Details(props) {
|
|
|
62
71
|
</FieldGroup>
|
|
63
72
|
);
|
|
64
73
|
}
|
|
65
|
-
|
|
66
|
-
Details.defaultProps = {
|
|
67
|
-
label: undefined,
|
|
68
|
-
showLabel: true,
|
|
69
|
-
showHighlightedData: false
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
Details.propTypes = {
|
|
73
|
-
showLabel: PropTypes.bool,
|
|
74
|
-
label: PropTypes.string,
|
|
75
|
-
getPConnect: PropTypes.func.isRequired,
|
|
76
|
-
showHighlightedData: PropTypes.bool
|
|
77
|
-
};
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { getTransientTabs, getVisibleTabs, tabClick } from '@pega/react-sdk-components/lib/components/template/SubTabs/tabUtils';
|
|
4
|
-
import React from 'react';
|
|
1
|
+
import { Children, PropsWithChildren, useEffect, useState } from 'react';
|
|
5
2
|
import { Tab, Tabs, TextField } from '@material-ui/core';
|
|
6
3
|
import { TabContext, TabPanel } from '@material-ui/lab';
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
import { getTransientTabs, getVisibleTabs, tabClick } from '@pega/react-sdk-components/lib/components/template/SubTabs/tabUtils';
|
|
6
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
|
|
8
|
+
interface DetailsSubTabsProps extends PConnProps {
|
|
9
|
+
// If any, enter additional props that only exist on this component
|
|
10
|
+
showLabel: boolean;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default function DetailsSubTabs(props: PropsWithChildren<DetailsSubTabsProps>) {
|
|
15
|
+
const { children = [], label, showLabel = true, getPConnect } = props;
|
|
10
16
|
// Get the inherited props from the parent to determine label settings
|
|
11
17
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
12
18
|
|
|
13
19
|
const defaultTabIndex = 0;
|
|
14
|
-
const deferLoadedTabs = children[0];
|
|
20
|
+
const deferLoadedTabs = Children.toArray(children)[0];
|
|
15
21
|
let availableTabs = [];
|
|
16
22
|
|
|
17
23
|
useEffect(() => {
|
|
@@ -32,7 +38,7 @@ export default function DetailsSubTabs(props) {
|
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
return (
|
|
35
|
-
|
|
41
|
+
<>
|
|
36
42
|
{propsToUse.showLabel && <TextField>{propsToUse.label}</TextField>}
|
|
37
43
|
<TabContext value={currentTabId.toString()}>
|
|
38
44
|
<Tabs onChange={handleTabClick} value={currentTabId}>
|
|
@@ -47,19 +53,6 @@ export default function DetailsSubTabs(props) {
|
|
|
47
53
|
</TabPanel>
|
|
48
54
|
))}
|
|
49
55
|
</TabContext>
|
|
50
|
-
|
|
56
|
+
</>
|
|
51
57
|
);
|
|
52
58
|
}
|
|
53
|
-
|
|
54
|
-
DetailsSubTabs.defaultProps = {
|
|
55
|
-
children: [],
|
|
56
|
-
label: undefined,
|
|
57
|
-
showLabel: true
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
DetailsSubTabs.propTypes = {
|
|
61
|
-
children: PropTypes.arrayOf(PropTypes.node),
|
|
62
|
-
showLabel: PropTypes.bool,
|
|
63
|
-
label: PropTypes.string,
|
|
64
|
-
getPConnect: PropTypes.func.isRequired
|
|
65
|
-
};
|