@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,46 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
5
|
-
|
|
6
|
-
declare const PCore: typeof PCoreType;
|
|
1
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
2
|
|
|
3
|
+
interface MultiReferenceReadOnlyProps extends PConnProps {
|
|
4
|
+
config: { referenceList: any; readonlyContextList: any };
|
|
5
|
+
label: string;
|
|
6
|
+
hideLabel: boolean;
|
|
7
|
+
}
|
|
8
8
|
|
|
9
|
-
export default function MultiReferenceReadOnly(props) {
|
|
10
|
-
const { getPConnect, label, hideLabel, config } = props;
|
|
9
|
+
export default function MultiReferenceReadOnly(props: MultiReferenceReadOnlyProps) {
|
|
10
|
+
const { getPConnect, label = '', hideLabel = false, config } = props;
|
|
11
11
|
const { referenceList, readonlyContextList } = config;
|
|
12
12
|
|
|
13
13
|
// When referenceList does not contain selected values, it should be replaced with readonlyContextList while calling SimpleTableManual
|
|
14
14
|
let readonlyContextObject;
|
|
15
|
-
if (
|
|
15
|
+
if (!PCore.getAnnotationUtils().isProperty(referenceList)) {
|
|
16
16
|
readonlyContextObject = {
|
|
17
17
|
referenceList: readonlyContextList
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
const component =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
35
|
+
|
|
36
|
+
return <>{component}</>;
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
MultiReferenceReadOnly.defaultProps = {
|
|
37
|
-
label: "",
|
|
38
|
-
hideLabel: false
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
MultiReferenceReadOnly.propTypes = {
|
|
42
|
-
config: PropTypes.object.isRequired,
|
|
43
|
-
getPConnect: PropTypes.func.isRequired,
|
|
44
|
-
label: PropTypes.string,
|
|
45
|
-
hideLabel: PropTypes.bool
|
|
46
|
-
};
|
|
@@ -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 './NarrowWide.css';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface NarrowWideProps 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 NarrowWide(props: PropsWithChildren<NarrowWideProps>) {
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</div>
|
|
26
|
-
<div className="psdk-wide-column-column">
|
|
27
|
-
{b}
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
}
|
|
31
|
-
</React.Fragment>
|
|
32
|
-
|
|
33
|
-
)
|
|
34
|
-
|
|
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
|
+
);
|
|
35
37
|
}
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { GridSize } from '@material-ui/core/Grid';
|
|
1
|
+
import { createElement } from 'react';
|
|
2
|
+
import Grid, { GridSize } from '@material-ui/core/Grid';
|
|
3
|
+
|
|
5
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
6
|
-
import
|
|
5
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
+
|
|
7
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
|
|
9
|
+
interface NarrowWideDetailsProps extends PConnProps {
|
|
10
|
+
// If any, enter additional props that only exist on this component
|
|
11
|
+
showLabel?: boolean;
|
|
12
|
+
label: string;
|
|
13
|
+
showHighlightedData?: boolean;
|
|
14
|
+
}
|
|
7
15
|
|
|
8
16
|
const COLUMN_WIDTHS = [4, 8];
|
|
9
17
|
|
|
10
|
-
export default function NarrowWideDetails(props) {
|
|
11
|
-
|
|
18
|
+
export default function NarrowWideDetails(props: NarrowWideDetailsProps) {
|
|
19
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
20
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
21
|
+
|
|
22
|
+
const { label, showLabel = true, getPConnect, showHighlightedData = false } = props;
|
|
12
23
|
|
|
13
24
|
// Get the inherited props from the parent to determine label settings
|
|
14
25
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
@@ -17,20 +28,18 @@ export default function NarrowWideDetails(props) {
|
|
|
17
28
|
// in a readonly (display) mode instead of a editable
|
|
18
29
|
getPConnect().setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
19
30
|
getPConnect().setInheritedProp('readOnly', true);
|
|
20
|
-
const children = getPConnect()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
);
|
|
31
|
+
const children = (getPConnect().getChildren() as any[]).map((configObject, index) =>
|
|
32
|
+
createElement(createPConnectComponent(), {
|
|
33
|
+
...configObject,
|
|
34
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
35
|
+
key: index.toString()
|
|
36
|
+
})
|
|
37
|
+
);
|
|
29
38
|
|
|
30
39
|
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
31
40
|
let highlightedDataArr = [];
|
|
32
41
|
if (showHighlightedData) {
|
|
33
|
-
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
42
|
+
const { highlightedData = [] } = (getPConnect().getRawMetadata() as any).config;
|
|
34
43
|
highlightedDataArr = highlightedData.map(field => {
|
|
35
44
|
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
36
45
|
|
|
@@ -40,7 +49,7 @@ export default function NarrowWideDetails(props) {
|
|
|
40
49
|
field.config.displayAsStatus = true;
|
|
41
50
|
}
|
|
42
51
|
|
|
43
|
-
return getPConnect().createComponent(field);
|
|
52
|
+
return getPConnect().createComponent(field, '', '', {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional
|
|
44
53
|
});
|
|
45
54
|
}
|
|
46
55
|
|
|
@@ -65,16 +74,3 @@ export default function NarrowWideDetails(props) {
|
|
|
65
74
|
</FieldGroup>
|
|
66
75
|
);
|
|
67
76
|
}
|
|
68
|
-
|
|
69
|
-
NarrowWideDetails.defaultProps = {
|
|
70
|
-
label: undefined,
|
|
71
|
-
showLabel: true,
|
|
72
|
-
showHighlightedData: false
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
NarrowWideDetails.propTypes = {
|
|
76
|
-
showLabel: PropTypes.bool,
|
|
77
|
-
label: PropTypes.string,
|
|
78
|
-
getPConnect: PropTypes.func.isRequired,
|
|
79
|
-
showHighlightedData: PropTypes.bool
|
|
80
|
-
};
|
|
@@ -1,24 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
import './NarrowWideForm.css';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<React.Fragment>
|
|
10
|
-
{children && children.length === 2 &&
|
|
11
|
-
<div className="psdk-narrow-wide-column">
|
|
12
|
-
<div className="psdk-narrow-column-column">
|
|
13
|
-
{children[0]}
|
|
14
|
-
</div>
|
|
15
|
-
<div className="psdk-wide-column-column">
|
|
16
|
-
{children[1]}
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
}
|
|
20
|
-
</React.Fragment>
|
|
5
|
+
interface NarrowWideFormProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
}
|
|
21
8
|
|
|
22
|
-
|
|
9
|
+
export default function NarrowWideForm(props: PropsWithChildren<NarrowWideFormProps>) {
|
|
10
|
+
const { children } = props;
|
|
23
11
|
|
|
12
|
+
return (
|
|
13
|
+
<>
|
|
14
|
+
{children && (children as ReactElement[]).length === 2 && (
|
|
15
|
+
<div className='psdk-narrow-wide-column'>
|
|
16
|
+
<div className='psdk-narrow-column-column'>{children[0]}</div>
|
|
17
|
+
<div className='psdk-wide-column-column'>{children[1]}</div>
|
|
18
|
+
</div>
|
|
19
|
+
)}
|
|
20
|
+
</>
|
|
21
|
+
);
|
|
24
22
|
}
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
3
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
interface NarrowWidePageProps extends PConnProps {
|
|
6
|
+
// If any, enter additional props that only exist on this component
|
|
7
|
+
title: string;
|
|
8
|
+
templateCol: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
}
|
|
6
11
|
|
|
7
12
|
/*
|
|
8
13
|
* The wrapper handles knowing how to take in just children and mapping
|
|
9
14
|
* to the Cosmos template.
|
|
10
15
|
*/
|
|
11
|
-
export default function NarrowWidePage(props) {
|
|
12
|
-
|
|
13
|
-
const
|
|
16
|
+
export default function NarrowWidePage(props: PropsWithChildren<NarrowWidePageProps>) {
|
|
17
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
18
|
+
const NarrowWide = getComponentFromMap('NarrowWide');
|
|
19
|
+
|
|
20
|
+
const { children, title, templateCol = '1fr 1fr', icon = '' } = props;
|
|
21
|
+
const childrenToRender = children as ReactElement[];
|
|
14
22
|
|
|
15
23
|
return (
|
|
16
24
|
<div>
|
|
17
|
-
|
|
18
|
-
a={childArray[0]}
|
|
19
|
-
b={childArray[1]}
|
|
20
|
-
title={title}
|
|
21
|
-
cols={templateCol}
|
|
22
|
-
icon={icon?.replace("pi pi-", "")}
|
|
23
|
-
/>
|
|
25
|
+
<NarrowWide a={childrenToRender[0]} b={childrenToRender[1]} title={title} cols={templateCol} icon={icon?.replace('pi pi-', '')} />
|
|
24
26
|
</div>
|
|
25
27
|
);
|
|
26
28
|
}
|
|
27
|
-
|
|
28
|
-
NarrowWidePage.propTypes = {
|
|
29
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
30
|
-
title: PropTypes.string.isRequired,
|
|
31
|
-
templateCol: PropTypes.string,
|
|
32
|
-
icon: PropTypes.string
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
NarrowWidePage.defaultProps = {
|
|
36
|
-
templateCol: "1fr 1fr",
|
|
37
|
-
icon: ""
|
|
38
|
-
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { Grid } from "@material-ui/core";
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
|
+
import { Grid } 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 OneColumnProps extends PConnProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
}
|
|
5
9
|
|
|
6
10
|
const useStyles = makeStyles((/* theme */) => ({
|
|
7
11
|
colStyles: {
|
|
8
|
-
display:
|
|
9
|
-
gap:
|
|
10
|
-
alignContent:
|
|
11
|
-
}
|
|
12
|
+
display: 'grid',
|
|
13
|
+
gap: '1rem',
|
|
14
|
+
alignContent: 'baseline'
|
|
15
|
+
}
|
|
12
16
|
}));
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
export default function OneColumn(props) {
|
|
18
|
+
export default function OneColumn(props: PropsWithChildren<OneColumnProps>) {
|
|
16
19
|
const classes = useStyles();
|
|
17
20
|
|
|
18
|
-
const { children} = props;
|
|
21
|
+
const { children } = props;
|
|
19
22
|
|
|
20
23
|
return (
|
|
21
24
|
<Grid container spacing={2}>
|
|
22
25
|
<Grid item xs={12} className={classes.colStyles}>
|
|
23
|
-
{children.map(child => {
|
|
26
|
+
{(children as ReactElement[]).map(child => {
|
|
27
|
+
return child;
|
|
28
|
+
})}
|
|
24
29
|
</Grid>
|
|
25
30
|
</Grid>
|
|
26
|
-
)
|
|
31
|
+
);
|
|
27
32
|
}
|
|
28
|
-
|
|
29
|
-
OneColumn.propTypes = {
|
|
30
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
31
|
-
// template: PropTypes.string.isRequired
|
|
32
|
-
};
|
|
@@ -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 OneColumnPageProps 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 OneColumnPage(props) {
|
|
12
|
+
export default function OneColumnPage(props: OneColumnPageProps) {
|
|
13
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
14
|
+
const OneColumn = getComponentFromMap('OneColumn');
|
|
11
15
|
|
|
12
|
-
return
|
|
13
|
-
<OneColumn
|
|
14
|
-
{...props}
|
|
15
|
-
/>
|
|
16
|
-
);
|
|
16
|
+
return <OneColumn {...props} />;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
OneColumnPage.propTypes = {
|
|
20
|
-
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
OneColumnPage.defaultProps = {
|
|
24
|
-
};
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return (
|
|
8
|
-
<div id="OneColumnTab">
|
|
9
|
-
{children}
|
|
10
|
-
</div>
|
|
11
|
-
)
|
|
4
|
+
interface OneColumnTabProps extends PConnProps {
|
|
5
|
+
// If any, enter additional props that only exist on this component
|
|
12
6
|
}
|
|
7
|
+
export default function OneColumnTab(props: PropsWithChildren<OneColumnTabProps>) {
|
|
8
|
+
const { children } = props;
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// template: PropTypes.string.isRequired
|
|
17
|
-
};
|
|
10
|
+
return <div id='OneColumnTab'>{children}</div>;
|
|
11
|
+
}
|
|
@@ -1,16 +1,23 @@
|
|
|
1
|
-
import React, { useCallback, useMemo, useState, createElement
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { useCallback, useMemo, useState, createElement } from 'react';
|
|
3
2
|
import Button from '@material-ui/core/Button';
|
|
4
3
|
|
|
5
4
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
6
|
-
import ListView from '@pega/react-sdk-components/lib/components/template/ListView';
|
|
7
5
|
import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
6
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
7
|
import './PromotedFilters.css';
|
|
9
8
|
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
|
+
|
|
11
|
+
// Can't use PromotedFilterProps until getContainerManager() knows about addTransientItem
|
|
12
|
+
// Currently just expects "object"
|
|
13
|
+
interface PromotedFilterProps extends PConnProps {
|
|
14
|
+
// If any, enter additional props that only exist on this component
|
|
15
|
+
viewName: string;
|
|
16
|
+
filters: any[];
|
|
17
|
+
listViewProps: any;
|
|
18
|
+
pageClass: string;
|
|
19
|
+
parameters?: object;
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
const localeCategory = 'SimpleTable';
|
|
16
23
|
const SUPPORTED_TYPES_IN_PROMOTED_FILTERS = [
|
|
@@ -56,17 +63,20 @@ function Filters({ filters, transientItemID, localeReference }) {
|
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
function isValidInput(input) {
|
|
59
|
-
return Object.values(input).findIndex(
|
|
66
|
+
return Object.values(input).findIndex(v => v) >= 0;
|
|
60
67
|
}
|
|
61
68
|
|
|
62
|
-
export default function PromotedFilters(props) {
|
|
69
|
+
export default function PromotedFilters(props: PromotedFilterProps) {
|
|
70
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
71
|
+
const ListView = getComponentFromMap('ListView');
|
|
72
|
+
|
|
63
73
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
64
74
|
const { getPConnect, viewName, filters, listViewProps, pageClass, parameters } = props;
|
|
65
75
|
const [initTable, setInitTable] = useState(false);
|
|
66
76
|
const [payload, setPayload] = useState({});
|
|
67
77
|
const filtersProperties = {};
|
|
68
78
|
|
|
69
|
-
filters.forEach(
|
|
79
|
+
filters.forEach(filter => {
|
|
70
80
|
filtersProperties[PCore.getAnnotationUtils().getPropertyName(filter.config.value)] = '';
|
|
71
81
|
});
|
|
72
82
|
|
|
@@ -88,7 +98,7 @@ export default function PromotedFilters(props) {
|
|
|
88
98
|
lhs: {
|
|
89
99
|
field
|
|
90
100
|
},
|
|
91
|
-
comparator:
|
|
101
|
+
comparator: 'EQ',
|
|
92
102
|
rhs: {
|
|
93
103
|
value
|
|
94
104
|
}
|
|
@@ -99,12 +109,12 @@ export default function PromotedFilters(props) {
|
|
|
99
109
|
}
|
|
100
110
|
|
|
101
111
|
const getFilterData = useCallback(
|
|
102
|
-
|
|
112
|
+
e => {
|
|
103
113
|
e.preventDefault(); // to prevent un-intended forms submission.
|
|
104
114
|
|
|
105
115
|
const changes = PCore.getFormUtils().getChanges(transientItemID);
|
|
106
116
|
const formValues = {};
|
|
107
|
-
Object.keys(changes).forEach(
|
|
117
|
+
Object.keys(changes).forEach(key => {
|
|
108
118
|
if (!['context_data', 'pageInstructions'].includes(key)) {
|
|
109
119
|
formValues[key] = changes[key];
|
|
110
120
|
}
|
|
@@ -132,34 +142,30 @@ export default function PromotedFilters(props) {
|
|
|
132
142
|
}, [transientItemID]);
|
|
133
143
|
|
|
134
144
|
return (
|
|
135
|
-
|
|
145
|
+
<>
|
|
136
146
|
<div>{listViewProps.title}</div>
|
|
137
|
-
<div className=
|
|
138
|
-
<Filters filters={filters} transientItemID={transientItemID} localeReference={listViewProps.localeReference}/>
|
|
147
|
+
<div className='psdk-grid-filter'>
|
|
148
|
+
<Filters filters={filters} transientItemID={transientItemID} localeReference={listViewProps.localeReference} />
|
|
139
149
|
</div>
|
|
140
150
|
<div>
|
|
141
151
|
<Button key='1' type='button' onClick={clearFilterData} data-testid='clear' variant='contained' color='primary'>
|
|
142
152
|
{localizedVal('Clear', localeCategory)}
|
|
143
153
|
</Button>
|
|
144
|
-
<Button style={{float: 'right'}} key='2' type='submit' onClick={getFilterData} data-testid='search' variant='contained' color='primary'>
|
|
154
|
+
<Button style={{ float: 'right' }} key='2' type='submit' onClick={getFilterData} data-testid='search' variant='contained' color='primary'>
|
|
145
155
|
{localizedVal('Search', localeCategory)}
|
|
146
156
|
</Button>
|
|
147
157
|
</div>
|
|
148
|
-
{initTable &&
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
158
|
+
{initTable && (
|
|
159
|
+
<ListView
|
|
160
|
+
{...listViewProps}
|
|
161
|
+
title=''
|
|
162
|
+
payload={payload}
|
|
163
|
+
isSearchable
|
|
164
|
+
tableDisplay={{
|
|
165
|
+
show: initTable
|
|
166
|
+
}}
|
|
167
|
+
/>
|
|
168
|
+
)}
|
|
169
|
+
</>
|
|
155
170
|
);
|
|
156
171
|
}
|
|
157
|
-
|
|
158
|
-
PromotedFilters.propTypes = {
|
|
159
|
-
getPConnect: PropTypes.func.isRequired,
|
|
160
|
-
viewName: PropTypes.string.isRequired,
|
|
161
|
-
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
162
|
-
listViewProps: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
163
|
-
pageClass: PropTypes.string.isRequired,
|
|
164
|
-
parameters: PropTypes.object
|
|
165
|
-
};
|