@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,8 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import { getContext, readContextResponse } from './utils';
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
declare const PCore: any;
|
|
3
|
+
import { getContext, readContextResponse } from './utils';
|
|
6
4
|
|
|
7
5
|
export default function useInit(props) {
|
|
8
6
|
const {
|
|
@@ -29,21 +27,22 @@ export default function useInit(props) {
|
|
|
29
27
|
|
|
30
28
|
(async function init() {
|
|
31
29
|
// promise to fetch metadata
|
|
32
|
-
|
|
30
|
+
// @ts-ignore - 3rd parameter "associationFilter" should be optional for getDataViewMetadata method
|
|
31
|
+
const metaDataPromise: Promise<any> = PCore.getAnalyticsUtils().getDataViewMetadata(referenceList, showDynamicFields);
|
|
33
32
|
|
|
34
33
|
const promisesArray = [metaDataPromise];
|
|
35
34
|
|
|
36
35
|
// promise to fetch report configured columns
|
|
37
|
-
const reportColumnsPromise =
|
|
38
|
-
.getFieldsForDataSource(referenceList, false, getPConnect().getContextName())
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
});
|
|
36
|
+
const reportColumnsPromise = (
|
|
37
|
+
PCore.getAnalyticsUtils().getFieldsForDataSource(referenceList, false, getPConnect().getContextName()) as Promise<any>
|
|
38
|
+
).catch(() => {
|
|
39
|
+
return Promise.resolve({
|
|
40
|
+
data: { data: [] }
|
|
43
41
|
});
|
|
42
|
+
});
|
|
44
43
|
promisesArray.push(reportColumnsPromise);
|
|
45
44
|
|
|
46
|
-
const fetchEditDetails = async
|
|
45
|
+
const fetchEditDetails = async metadata => {
|
|
47
46
|
const {
|
|
48
47
|
data: { isQueryable }
|
|
49
48
|
} = metadata;
|
|
@@ -64,7 +63,7 @@ export default function useInit(props) {
|
|
|
64
63
|
return Promise.resolve();
|
|
65
64
|
};
|
|
66
65
|
|
|
67
|
-
const editPromise = metaDataPromise.then(
|
|
66
|
+
const editPromise = metaDataPromise.then(metadata => fetchEditDetails(metadata));
|
|
68
67
|
promisesArray.push(editPromise);
|
|
69
68
|
getContext({
|
|
70
69
|
tableSource: referenceList,
|
|
@@ -76,20 +75,19 @@ export default function useInit(props) {
|
|
|
76
75
|
isSearchable,
|
|
77
76
|
isCacheable: true,
|
|
78
77
|
xRayUid
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
});
|
|
78
|
+
}).then(async context => {
|
|
79
|
+
if (isCompStillMounted) {
|
|
80
|
+
return readContextResponse(context, {
|
|
81
|
+
...props,
|
|
82
|
+
editing,
|
|
83
|
+
selectionCountThreshold,
|
|
84
|
+
ref,
|
|
85
|
+
selectionMode,
|
|
86
|
+
xRayUid,
|
|
87
|
+
cosmosTableRef
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
});
|
|
93
91
|
})();
|
|
94
92
|
|
|
95
93
|
return () => {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import getDefaultViewMeta from './DefaultViewMeta';
|
|
2
2
|
|
|
3
|
-
// Remove this and use "real" PCore type once .d.ts is fixed (currently shows 5 errors)
|
|
4
|
-
declare const PCore: any;
|
|
5
|
-
|
|
6
3
|
const USER_REFERENCE = 'UserReference';
|
|
7
4
|
const PAGE = '!P!';
|
|
8
5
|
const PAGELIST = '!PL!';
|
|
@@ -10,14 +7,13 @@ const PAGELIST = '!PL!';
|
|
|
10
7
|
export const formatConstants = {
|
|
11
8
|
WorkStatus: 'WorkStatus',
|
|
12
9
|
Integer: 'Integer',
|
|
13
|
-
WorkLink: 'WorkLink'
|
|
10
|
+
WorkLink: 'WorkLink'
|
|
14
11
|
};
|
|
15
12
|
|
|
16
13
|
class DataApi {
|
|
17
14
|
mappedPropertyToOriginalProperty: any;
|
|
18
15
|
originalPropertyToMappedProperty: any;
|
|
19
16
|
constructor() {
|
|
20
|
-
;
|
|
21
17
|
this.originalPropertyToMappedProperty = {};
|
|
22
18
|
this.mappedPropertyToOriginalProperty = {};
|
|
23
19
|
this.setPropertyMaps = this.setPropertyMaps.bind(this);
|
|
@@ -47,7 +43,7 @@ class DataApi {
|
|
|
47
43
|
|
|
48
44
|
export async function getContext(componentConfig) {
|
|
49
45
|
const {
|
|
50
|
-
promisesArray = []
|
|
46
|
+
promisesArray = [] // array of promises which can be invoked paralelly,
|
|
51
47
|
} = componentConfig;
|
|
52
48
|
const promisesResponseArray = await Promise.all(promisesArray);
|
|
53
49
|
const dataApi = new DataApi();
|
|
@@ -55,7 +51,7 @@ export async function getContext(componentConfig) {
|
|
|
55
51
|
promisesResponseArray,
|
|
56
52
|
setPropertyMaps: dataApi.setPropertyMaps,
|
|
57
53
|
getMappedProperty: dataApi.getMappedProperty,
|
|
58
|
-
getOriginalProperty: dataApi.getOriginalProperty
|
|
54
|
+
getOriginalProperty: dataApi.getOriginalProperty
|
|
59
55
|
};
|
|
60
56
|
}
|
|
61
57
|
|
|
@@ -86,14 +82,14 @@ export function getFieldNameFromEmbeddedFieldName(propertyName) {
|
|
|
86
82
|
* @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
|
|
87
83
|
*/
|
|
88
84
|
export function updateMetaEmbeddedFieldID(metaFields) {
|
|
89
|
-
return metaFields.forEach(
|
|
85
|
+
return metaFields.forEach(metaField => {
|
|
90
86
|
if (metaField.fieldID?.startsWith(PAGE) || metaField.fieldID?.startsWith(PAGELIST)) {
|
|
91
87
|
metaField.fieldID = getFieldNameFromEmbeddedFieldName(metaField.fieldID);
|
|
92
88
|
}
|
|
93
89
|
});
|
|
94
90
|
}
|
|
95
91
|
|
|
96
|
-
export const isEmbeddedField =
|
|
92
|
+
export const isEmbeddedField = field => {
|
|
97
93
|
if (field?.startsWith('@')) {
|
|
98
94
|
field = field.substring(field.indexOf(' ') + 1);
|
|
99
95
|
if (field[0] === '.') field = field.substring(1);
|
|
@@ -122,7 +118,7 @@ export const isPageListInPath = (propertyName, currentClassID) => {
|
|
|
122
118
|
return false;
|
|
123
119
|
}
|
|
124
120
|
const [first, ...rest] = propertyName.split('.');
|
|
125
|
-
const metadata = PCore.getMetadataUtils().getPropertyMetadata(first, currentClassID);
|
|
121
|
+
const metadata: any = PCore.getMetadataUtils().getPropertyMetadata(first, currentClassID);
|
|
126
122
|
if (metadata?.type === 'Page List') {
|
|
127
123
|
return true;
|
|
128
124
|
}
|
|
@@ -198,15 +194,16 @@ export function preparePropertyMaps(fields, classID, context) {
|
|
|
198
194
|
* @returns {Array} Metadata of configured embedded fields
|
|
199
195
|
*/
|
|
200
196
|
export function getConfigEmbeddedFieldsMeta(configFields, classID) {
|
|
201
|
-
const configEmbeddedFieldsMeta:
|
|
202
|
-
configFields.forEach(
|
|
197
|
+
const configEmbeddedFieldsMeta: any[] = [];
|
|
198
|
+
configFields.forEach(field => {
|
|
203
199
|
let value = field;
|
|
204
200
|
if (isEmbeddedField(value)) {
|
|
205
201
|
// conversion Page.PageList[].property => Page.PageList.property
|
|
206
202
|
if (value.includes('[')) {
|
|
207
203
|
value = value.substring(0, value.indexOf('[')) + value.substring(value.indexOf(']') + 1);
|
|
208
204
|
}
|
|
209
|
-
|
|
205
|
+
// @ts-ignore - Expected 3 arguments, but got 2.
|
|
206
|
+
const meta: any = PCore.getMetadataUtils().getEmbeddedPropertyMetadata(value, classID);
|
|
210
207
|
meta.fieldID = field;
|
|
211
208
|
configEmbeddedFieldsMeta.push(meta);
|
|
212
209
|
}
|
|
@@ -223,8 +220,8 @@ export function getConfigEmbeddedFieldsMeta(configFields, classID) {
|
|
|
223
220
|
*/
|
|
224
221
|
export function mergeConfigEmbeddedFieldsMeta(configEmbeddedFieldsMeta, metaFields) {
|
|
225
222
|
const mergedMetaFields = [...metaFields];
|
|
226
|
-
configEmbeddedFieldsMeta.forEach(
|
|
227
|
-
const fieldMeta = metaFields.find(
|
|
223
|
+
configEmbeddedFieldsMeta.forEach(configFieldMeta => {
|
|
224
|
+
const fieldMeta = metaFields.find(metaField => metaField.fieldID === configFieldMeta.fieldID);
|
|
228
225
|
if (!fieldMeta) mergedMetaFields.push(configFieldMeta);
|
|
229
226
|
});
|
|
230
227
|
return mergedMetaFields;
|
|
@@ -242,7 +239,7 @@ const oldToNewFieldTypeMapping = {
|
|
|
242
239
|
* @param {Array} metaFields Fields metadata Array. Contains metadata of all the fields.
|
|
243
240
|
*/
|
|
244
241
|
function updateFieldType(metaFields) {
|
|
245
|
-
metaFields.forEach(
|
|
242
|
+
metaFields.forEach(metaField => {
|
|
246
243
|
if (metaField.type) metaField.type = oldToNewFieldTypeMapping[metaField.type] || metaField.type;
|
|
247
244
|
});
|
|
248
245
|
}
|
|
@@ -268,7 +265,7 @@ function getPresetMetaAttribute(attribute) {
|
|
|
268
265
|
* @returns {Array} List of fields with updated meta objects.
|
|
269
266
|
*/
|
|
270
267
|
function generateViewMetaData(rawFields, classID, showField) {
|
|
271
|
-
return rawFields.map(
|
|
268
|
+
return rawFields.map(item => getDefaultViewMeta(item, classID, showField));
|
|
272
269
|
}
|
|
273
270
|
|
|
274
271
|
/**
|
|
@@ -283,7 +280,7 @@ function generateViewMetaData(rawFields, classID, showField) {
|
|
|
283
280
|
*/
|
|
284
281
|
function getConfigFields(configFields, primaryFields, metaFields, classID) {
|
|
285
282
|
const presetConfigFields = configFields;
|
|
286
|
-
const primaryFieldsViewIndex = presetConfigFields.findIndex(
|
|
283
|
+
const primaryFieldsViewIndex = presetConfigFields.findIndex(field => field.config.value === 'pyPrimaryFields');
|
|
287
284
|
if (!primaryFields || !primaryFields.length) {
|
|
288
285
|
if (primaryFieldsViewIndex < 0) return presetConfigFields;
|
|
289
286
|
|
|
@@ -295,12 +292,11 @@ function getConfigFields(configFields, primaryFields, metaFields, classID) {
|
|
|
295
292
|
if (primaryFieldsViewIndex > -1) {
|
|
296
293
|
// list of uncommon fields - non overlap of primary fields grouped view and independent entity columns of primary type
|
|
297
294
|
const uncommonFieldsList = primaryFields.filter(
|
|
298
|
-
(primaryField)
|
|
299
|
-
!presetConfigFields.some((presetConfigField) => presetConfigField.config.value.split('.')[1] === primaryField)
|
|
295
|
+
primaryField => !presetConfigFields.some(presetConfigField => presetConfigField.config.value.split('.')[1] === primaryField)
|
|
300
296
|
);
|
|
301
|
-
const uncommonFieldsRawMeta:
|
|
302
|
-
uncommonFieldsList.forEach(
|
|
303
|
-
const uncommonFieldMeta = metaFields.find(
|
|
297
|
+
const uncommonFieldsRawMeta: any[] = [];
|
|
298
|
+
uncommonFieldsList.forEach(uncommonField => {
|
|
299
|
+
const uncommonFieldMeta = metaFields.find(metaField => metaField.fieldID === uncommonField);
|
|
304
300
|
if (uncommonFieldMeta) uncommonFieldsRawMeta.push(uncommonFieldMeta);
|
|
305
301
|
});
|
|
306
302
|
const uncommonFieldsConfigMeta = generateViewMetaData(uncommonFieldsRawMeta, classID, true);
|
|
@@ -322,14 +318,7 @@ function getConfigFields(configFields, primaryFields, metaFields, classID) {
|
|
|
322
318
|
* @param {Array} metaFields List of all metafields
|
|
323
319
|
* @returns {object} Table config object
|
|
324
320
|
*/
|
|
325
|
-
export function getTableConfigFromPresetMeta(
|
|
326
|
-
presetMeta,
|
|
327
|
-
isMetaWithPresets,
|
|
328
|
-
getPConnect,
|
|
329
|
-
classID,
|
|
330
|
-
primaryFields,
|
|
331
|
-
metaFields
|
|
332
|
-
) {
|
|
321
|
+
export function getTableConfigFromPresetMeta(presetMeta, isMetaWithPresets, getPConnect, classID, primaryFields, metaFields) {
|
|
333
322
|
let presetId;
|
|
334
323
|
let presetName;
|
|
335
324
|
let cardHeader;
|
|
@@ -354,7 +343,7 @@ export function getTableConfigFromPresetMeta(
|
|
|
354
343
|
[fieldsMeta] = presetMeta.children;
|
|
355
344
|
if (
|
|
356
345
|
presetMeta.timelineTitle &&
|
|
357
|
-
!fieldsMeta.children.find(
|
|
346
|
+
!fieldsMeta.children.find(fieldMeta => {
|
|
358
347
|
return fieldMeta?.config?.value === presetMeta.timelineTitle?.config?.value;
|
|
359
348
|
})
|
|
360
349
|
) {
|
|
@@ -363,7 +352,7 @@ export function getTableConfigFromPresetMeta(
|
|
|
363
352
|
}
|
|
364
353
|
if (
|
|
365
354
|
presetMeta.timelineDate &&
|
|
366
|
-
!fieldsMeta.children.find(
|
|
355
|
+
!fieldsMeta.children.find(fieldMeta => {
|
|
367
356
|
return fieldMeta?.config?.value === presetMeta.timelineDate?.config?.value;
|
|
368
357
|
})
|
|
369
358
|
) {
|
|
@@ -377,7 +366,7 @@ export function getTableConfigFromPresetMeta(
|
|
|
377
366
|
fieldsMeta
|
|
378
367
|
.getPConnect()
|
|
379
368
|
.getChildren()
|
|
380
|
-
?.map(
|
|
369
|
+
?.map(child => {
|
|
381
370
|
return child.getPConnect().getRawMetadata();
|
|
382
371
|
}),
|
|
383
372
|
primaryFields,
|
|
@@ -412,7 +401,7 @@ function getReportColumns(response) {
|
|
|
412
401
|
data: { data: reportColumns }
|
|
413
402
|
} = response;
|
|
414
403
|
const reportColumnsSet = new Set();
|
|
415
|
-
reportColumns?.forEach(
|
|
404
|
+
reportColumns?.forEach(item => {
|
|
416
405
|
let val = item.pyFieldName;
|
|
417
406
|
// Remove '.' from index 0 only, if '.' is present
|
|
418
407
|
if (val[0] === '.') {
|
|
@@ -450,7 +439,7 @@ function getConfigFieldValue(config) {
|
|
|
450
439
|
*/
|
|
451
440
|
function prepareConfigFields(configFields, pushToComponentsList) {
|
|
452
441
|
const configFieldSet = new Set();
|
|
453
|
-
configFields.forEach(
|
|
442
|
+
configFields.forEach(item => {
|
|
454
443
|
pushToComponentsList(item.type);
|
|
455
444
|
const val = getConfigFieldValue(item.config);
|
|
456
445
|
configFieldSet.add(val);
|
|
@@ -467,7 +456,7 @@ function prepareConfigFields(configFields, pushToComponentsList) {
|
|
|
467
456
|
* @returns {object} config with its field value equal to fieldID, which means an authored field
|
|
468
457
|
*/
|
|
469
458
|
function findAuthoredField(configFields, fieldID) {
|
|
470
|
-
return configFields.find(
|
|
459
|
+
return configFields.find(configField => {
|
|
471
460
|
const val = getConfigFieldValue(configField.config);
|
|
472
461
|
return val === fieldID;
|
|
473
462
|
});
|
|
@@ -537,16 +526,9 @@ function isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, cl
|
|
|
537
526
|
* @param {boolean} showDynamicFields Flag indicating whether fields are fetched dynamically at runtime
|
|
538
527
|
* @returns {Array} List of extra fields with their meta updated.
|
|
539
528
|
*/
|
|
540
|
-
function prepareExtraFields(
|
|
541
|
-
metaFields,
|
|
542
|
-
configFields,
|
|
543
|
-
configFieldSet,
|
|
544
|
-
reportColumnsSet,
|
|
545
|
-
classID,
|
|
546
|
-
showDynamicFields
|
|
547
|
-
) {
|
|
529
|
+
function prepareExtraFields(metaFields, configFields, configFieldSet, reportColumnsSet, classID, showDynamicFields) {
|
|
548
530
|
// Filter all the extra fields
|
|
549
|
-
const extraFileds = metaFields.filter(
|
|
531
|
+
const extraFileds = metaFields.filter(item => {
|
|
550
532
|
return isAnExtraField(configFields, configFieldSet, reportColumnsSet, item, classID, showDynamicFields);
|
|
551
533
|
});
|
|
552
534
|
return generateViewMetaData(extraFileds, classID, false);
|
|
@@ -569,10 +551,7 @@ function populateRenderingOptions(name, config, field) {
|
|
|
569
551
|
config.cellRenderer = formatConstants.Integer;
|
|
570
552
|
}
|
|
571
553
|
}
|
|
572
|
-
export function initializeColumns(
|
|
573
|
-
fields: Array<any> = [],
|
|
574
|
-
getMappedProperty: any = null
|
|
575
|
-
) {
|
|
554
|
+
export function initializeColumns(fields: any[] = [], getMappedProperty: any = null) {
|
|
576
555
|
return fields.map((field, originalColIndex) => {
|
|
577
556
|
let name = field.config.value;
|
|
578
557
|
|
|
@@ -601,7 +580,7 @@ export function initializeColumns(
|
|
|
601
580
|
fieldType: field.config.fieldType,
|
|
602
581
|
meta: {
|
|
603
582
|
...field
|
|
604
|
-
}
|
|
583
|
+
}
|
|
605
584
|
};
|
|
606
585
|
|
|
607
586
|
populateRenderingOptions(name, config, field);
|
|
@@ -610,9 +589,9 @@ export function initializeColumns(
|
|
|
610
589
|
});
|
|
611
590
|
}
|
|
612
591
|
|
|
613
|
-
export const getItemKey =
|
|
592
|
+
export const getItemKey = fields => {
|
|
614
593
|
let itemKey;
|
|
615
|
-
if (fields.findIndex(
|
|
594
|
+
if (fields.findIndex(field => field.id === 'pyGUID') > -1) {
|
|
616
595
|
itemKey = 'pyGUID';
|
|
617
596
|
} else {
|
|
618
597
|
itemKey = 'pzInsKey';
|
|
@@ -621,9 +600,9 @@ export const getItemKey = (fields) => {
|
|
|
621
600
|
};
|
|
622
601
|
|
|
623
602
|
export function preparePatchQueryFields(fields, isDataObject = false, classID = '') {
|
|
624
|
-
const queryFields:
|
|
625
|
-
fields.forEach(
|
|
626
|
-
const patchFields:
|
|
603
|
+
const queryFields: any[] = [];
|
|
604
|
+
fields.forEach(field => {
|
|
605
|
+
const patchFields: any[] = [];
|
|
627
606
|
if (field.cellRenderer === 'WorkLink') {
|
|
628
607
|
if (field.customObject && field.customObject.isAssignmentLink) {
|
|
629
608
|
const associationName = field.name.includes(':') ? `${field.name.split(':')[0]}:` : '';
|
|
@@ -637,17 +616,15 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
|
|
|
637
616
|
} else if (isDataObject) {
|
|
638
617
|
const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
|
|
639
618
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
640
|
-
dataPageKeys?.forEach((item)
|
|
641
|
-
item.isAlternateKeyStorage ? patchFields.push(item.linkedField) : patchFields.push(item.keyName)
|
|
642
|
-
);
|
|
619
|
+
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? patchFields.push(item.linkedField) : patchFields.push(item.keyName)));
|
|
643
620
|
} else {
|
|
644
621
|
patchFields.push('pyID');
|
|
645
622
|
patchFields.push('pzInsKey');
|
|
646
623
|
patchFields.push('pxObjClass');
|
|
647
624
|
}
|
|
648
625
|
}
|
|
649
|
-
patchFields.forEach(
|
|
650
|
-
if (!queryFields.find(
|
|
626
|
+
patchFields.forEach(k => {
|
|
627
|
+
if (!queryFields.find(q => q === k)) {
|
|
651
628
|
queryFields.push(k);
|
|
652
629
|
}
|
|
653
630
|
});
|
|
@@ -660,7 +637,7 @@ export function preparePatchQueryFields(fields, isDataObject = false, classID =
|
|
|
660
637
|
* Update the renderer type for the properties of type Page.
|
|
661
638
|
*/
|
|
662
639
|
export function updatePageFieldsConfig(configFields, parentClassID) {
|
|
663
|
-
return configFields.forEach(
|
|
640
|
+
return configFields.forEach(item => {
|
|
664
641
|
const {
|
|
665
642
|
type,
|
|
666
643
|
config: { value }
|
|
@@ -674,18 +651,10 @@ export function updatePageFieldsConfig(configFields, parentClassID) {
|
|
|
674
651
|
}
|
|
675
652
|
|
|
676
653
|
export const readContextResponse = async (context, params) => {
|
|
677
|
-
const {
|
|
678
|
-
getPConnect,
|
|
679
|
-
apiContext,
|
|
680
|
-
setListContext,
|
|
681
|
-
children,
|
|
682
|
-
showDynamicFields,
|
|
683
|
-
referenceList,
|
|
684
|
-
isDataObject
|
|
685
|
-
} = params;
|
|
654
|
+
const { getPConnect, apiContext, setListContext, children, showDynamicFields, referenceList, isDataObject } = params;
|
|
686
655
|
const { promisesResponseArray, apiContext: otherContext } = context;
|
|
687
656
|
// eslint-disable-next-line sonarjs/no-unused-collection
|
|
688
|
-
const listOfComponents:
|
|
657
|
+
const listOfComponents: any[] = [];
|
|
689
658
|
const {
|
|
690
659
|
data: { fields: metaFields, classID, isQueryable }
|
|
691
660
|
} = promisesResponseArray[0];
|
|
@@ -694,7 +663,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
694
663
|
} = promisesResponseArray[0];
|
|
695
664
|
// When list is configured with Include all class fields configuration, provide support for Primary fields column
|
|
696
665
|
if (showDynamicFields) {
|
|
697
|
-
const sourceMetadata = PCore.getMetadataUtils().getDataPageMetadata(referenceList);
|
|
666
|
+
const sourceMetadata: any = PCore.getMetadataUtils().getDataPageMetadata(referenceList);
|
|
698
667
|
if (sourceMetadata?.primaryFields) {
|
|
699
668
|
primaryFields = sourceMetadata.primaryFields;
|
|
700
669
|
}
|
|
@@ -703,18 +672,17 @@ export const readContextResponse = async (context, params) => {
|
|
|
703
672
|
}
|
|
704
673
|
updateFieldType(metaFields);
|
|
705
674
|
|
|
706
|
-
|
|
707
675
|
if (isDataObject) {
|
|
708
|
-
const compositeKeys:
|
|
676
|
+
const compositeKeys: any[] = [];
|
|
709
677
|
const dataViewName = PCore.getDataTypeUtils().getSavableDataPage(classID);
|
|
710
678
|
const dataPageKeys = PCore.getDataTypeUtils().getDataPageKeys(dataViewName);
|
|
711
|
-
dataPageKeys?.forEach((item)
|
|
712
|
-
item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)
|
|
713
|
-
);
|
|
679
|
+
dataPageKeys?.forEach(item => (item.isAlternateKeyStorage ? compositeKeys.push(item.linkedField) : compositeKeys.push(item.keyName)));
|
|
714
680
|
if (compositeKeys.length) {
|
|
715
681
|
otherContext.setCompositeKeys(compositeKeys);
|
|
716
682
|
}
|
|
717
|
-
otherContext
|
|
683
|
+
if (otherContext) {
|
|
684
|
+
otherContext.fetchRowActionDetails = null;
|
|
685
|
+
}
|
|
718
686
|
}
|
|
719
687
|
|
|
720
688
|
const presetArray = [];
|
|
@@ -726,9 +694,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
726
694
|
let fields;
|
|
727
695
|
let tableConfig;
|
|
728
696
|
childrenIterator?.forEach((presetMeta, index) => {
|
|
729
|
-
const {
|
|
730
|
-
configFields
|
|
731
|
-
} = getTableConfigFromPresetMeta(
|
|
697
|
+
const { configFields } = getTableConfigFromPresetMeta(
|
|
732
698
|
{ ...presetMeta, label: resolvedPresets[index].label },
|
|
733
699
|
isMetaWithPresets,
|
|
734
700
|
getPConnect,
|
|
@@ -736,7 +702,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
736
702
|
primaryFields,
|
|
737
703
|
metaFields
|
|
738
704
|
);
|
|
739
|
-
const pushToComponentsList =
|
|
705
|
+
const pushToComponentsList = fieldType => {
|
|
740
706
|
listOfComponents.push(fieldType);
|
|
741
707
|
};
|
|
742
708
|
// read report columns response - in case of nonqueryable ignore the response and rely only on the fields configured at authoing time in presets
|
|
@@ -767,9 +733,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
767
733
|
|
|
768
734
|
const { getMappedProperty } = context;
|
|
769
735
|
|
|
770
|
-
fields = initializeColumns(
|
|
771
|
-
[...configFields, ...extraFields], getMappedProperty
|
|
772
|
-
);
|
|
736
|
+
fields = initializeColumns([...configFields, ...extraFields], getMappedProperty);
|
|
773
737
|
const patchQueryFields = preparePatchQueryFields(fields, isDataObject, classID);
|
|
774
738
|
const itemKey = getItemKey(fields);
|
|
775
739
|
tableConfig = { fieldDefs: fields, patchQueryFields, itemKey, isQueryable };
|
|
@@ -779,7 +743,7 @@ export const readContextResponse = async (context, params) => {
|
|
|
779
743
|
meta,
|
|
780
744
|
presets: presetArray,
|
|
781
745
|
apiContext: {
|
|
782
|
-
...apiContext
|
|
746
|
+
...apiContext
|
|
783
747
|
}
|
|
784
748
|
});
|
|
785
749
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
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 MultiReferenceReadOnlyProps extends PConnProps {
|
|
5
|
-
config: { referenceList: any
|
|
6
|
-
label: string
|
|
7
|
-
hideLabel: boolean
|
|
4
|
+
config: { referenceList: any; readonlyContextList: any };
|
|
5
|
+
label: string;
|
|
6
|
+
hideLabel: boolean;
|
|
8
7
|
}
|
|
9
8
|
|
|
10
|
-
|
|
11
9
|
export default function MultiReferenceReadOnly(props: MultiReferenceReadOnlyProps) {
|
|
12
10
|
const { getPConnect, label = '', hideLabel = false, config } = props;
|
|
13
11
|
const { referenceList, readonlyContextList } = config;
|
|
14
12
|
|
|
15
13
|
// When referenceList does not contain selected values, it should be replaced with readonlyContextList while calling SimpleTableManual
|
|
16
14
|
let readonlyContextObject;
|
|
17
|
-
if (
|
|
15
|
+
if (!PCore.getAnnotationUtils().isProperty(referenceList)) {
|
|
18
16
|
readonlyContextObject = {
|
|
19
17
|
referenceList: readonlyContextList
|
|
20
18
|
};
|
|
21
19
|
}
|
|
22
20
|
|
|
23
|
-
const component =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
const component = getPConnect().createComponent(
|
|
22
|
+
{
|
|
23
|
+
type: 'SimpleTable',
|
|
24
|
+
config: {
|
|
25
|
+
...config,
|
|
26
|
+
...readonlyContextObject,
|
|
27
|
+
label,
|
|
28
|
+
hideLabel
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
'',
|
|
32
|
+
'',
|
|
33
|
+
{}
|
|
34
|
+
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
<React.Fragment>{component}</React.Fragment>
|
|
36
|
-
)
|
|
36
|
+
return <>{component}</>;
|
|
37
37
|
}
|
|
@@ -1,50 +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 './NarrowWide.css';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
interface NarrowWideProps {
|
|
5
|
+
interface NarrowWideProps extends PConnProps {
|
|
7
6
|
// If any, enter additional props that only exist on this component
|
|
8
|
-
a: any
|
|
9
|
-
b: any
|
|
10
|
-
children?: Array<any>,
|
|
7
|
+
a: any;
|
|
8
|
+
b: any;
|
|
11
9
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
12
|
-
title?: string
|
|
10
|
+
title?: string;
|
|
13
11
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
14
|
-
cols?: string
|
|
12
|
+
cols?: string;
|
|
15
13
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
16
|
-
icon?: string
|
|
14
|
+
icon?: string;
|
|
17
15
|
}
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
export default function NarrowWide(props: NarrowWideProps) {
|
|
17
|
+
export default function NarrowWide(props: PropsWithChildren<NarrowWideProps>) {
|
|
21
18
|
// const {a, b /*, cols, icon, title */ } = props;
|
|
22
|
-
const {a, b, children} = props;
|
|
19
|
+
const { a, b, children } = props;
|
|
23
20
|
|
|
24
21
|
return (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</div>
|
|
41
|
-
<div className="psdk-wide-column-column">
|
|
42
|
-
{b}
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
}
|
|
46
|
-
</React.Fragment>
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
|
|
22
|
+
<>
|
|
23
|
+
{children && (children as ReactElement[]).length === 2 && (
|
|
24
|
+
<div className='psdk-narrow-wide-column'>
|
|
25
|
+
<div className='psdk-narrow-column-column'>{children[0]}</div>
|
|
26
|
+
<div className='psdk-wide-column-column'>{children[1]}</div>
|
|
27
|
+
</div>
|
|
28
|
+
)}
|
|
29
|
+
{a && b && (
|
|
30
|
+
<div className='psdk-narrow-wide-column'>
|
|
31
|
+
<div className='psdk-narrow-column-column'>{a}</div>
|
|
32
|
+
<div className='psdk-wide-column-column'>{b}</div>
|
|
33
|
+
</div>
|
|
34
|
+
)}
|
|
35
|
+
</>
|
|
36
|
+
);
|
|
50
37
|
}
|