@pega/react-sdk-overrides 24.2.11 → 25.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/lib/designSystemExtension/AlertBanner/AlertBanner.css +46 -0
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +37 -20
- package/lib/designSystemExtension/Banner/Banner.css +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +10 -7
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +53 -37
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -13
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +8 -9
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +9 -9
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +7 -8
- package/lib/designSystemExtension/Operator/Operator.tsx +21 -19
- package/lib/designSystemExtension/Pulse/Pulse.tsx +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +32 -4
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +7 -14
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +13 -2
- package/lib/field/AutoComplete/AutoComplete.tsx +1 -1
- package/lib/field/CancelAlert/CancelAlert.css +4 -4
- package/lib/field/CancelAlert/CancelAlert.tsx +6 -6
- package/lib/field/Checkbox/Checkbox.tsx +97 -4
- package/lib/field/Currency/Currency.tsx +3 -3
- package/lib/field/Currency/currency-utils.ts +1 -2
- package/lib/field/Date/Date.tsx +3 -7
- package/lib/field/DateTime/DateTime.tsx +3 -8
- package/lib/field/Decimal/Decimal.tsx +3 -5
- package/lib/field/Dropdown/Dropdown.tsx +5 -7
- package/lib/field/Email/Email.tsx +11 -13
- package/lib/field/Group/Group.tsx +10 -8
- package/lib/field/Integer/Integer.tsx +5 -7
- package/lib/field/Location/Location.css +4 -0
- package/lib/field/Location/Location.tsx +258 -0
- package/lib/field/Location/config-ext.json +8 -0
- package/lib/field/Location/index.tsx +1 -0
- package/lib/field/Multiselect/utils.ts +1 -1
- package/lib/field/ObjectReference/ObjectReference.tsx +235 -0
- package/lib/field/ObjectReference/index.tsx +1 -0
- package/lib/field/ObjectReference/utils.ts +111 -0
- package/lib/field/Percentage/Percentage.tsx +3 -7
- package/lib/field/Phone/Phone.tsx +7 -5
- package/lib/field/RadioButtons/RadioButtons.tsx +47 -2
- package/lib/field/RichText/RichText.css +79 -0
- package/lib/field/RichText/RichText.tsx +3 -1
- package/lib/field/ScalarList/ScalarList.tsx +2 -3
- package/lib/field/SelectableCard/SelectableCard.tsx +189 -0
- package/lib/field/SelectableCard/index.tsx +1 -0
- package/lib/field/SelectableCard/utils.tsx +223 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +160 -28
- package/lib/field/SemanticLink/utils.ts +1 -1
- package/lib/field/TextArea/TextArea.tsx +5 -7
- package/lib/field/TextContent/TextContent.tsx +1 -2
- package/lib/field/TextInput/TextInput.tsx +5 -7
- package/lib/field/Time/Time.tsx +3 -7
- package/lib/field/URL/URL.tsx +5 -7
- package/lib/field/UserReference/UserReference.tsx +2 -3
- package/lib/helpers/attachmentShared.ts +6 -0
- package/lib/helpers/common-utils.ts +3 -4
- package/lib/helpers/data_page.ts +0 -1
- package/lib/helpers/field-group-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +9 -4
- package/lib/helpers/formatters/CurrencyMap.ts +0 -2
- package/lib/helpers/object-utils.ts +10 -0
- package/lib/helpers/simpleTableHelpers.ts +118 -6
- package/lib/helpers/utils.ts +8 -1
- package/lib/helpers/versionHelpers.ts +0 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +28 -21
- package/lib/infra/Assignment/Assignment.tsx +47 -31
- package/lib/infra/Assignment/useValidationBanner.ts +29 -0
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +22 -102
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +1 -2
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +12 -6
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +8 -13
- package/lib/infra/Containers/container-helpers.ts +47 -1
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +3 -6
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
- package/lib/infra/DeferLoad/DeferLoad.tsx +26 -13
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -3
- package/lib/infra/MultiStep/MultiStep.css +48 -70
- package/lib/infra/MultiStep/MultiStep.tsx +27 -53
- package/lib/infra/NavBar/NavBar.css +1 -1
- package/lib/infra/NavBar/NavBar.tsx +49 -34
- package/lib/infra/Reference/Reference.tsx +8 -4
- package/lib/infra/Region/Region.tsx +1 -1
- package/lib/infra/RootContainer/RootContainer.tsx +6 -8
- package/lib/infra/Stages/Stages.tsx +3 -4
- package/lib/infra/View/View.tsx +9 -9
- package/lib/template/AdvancedSearch/AdvancedSearch.tsx +86 -0
- package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +52 -0
- package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +244 -0
- package/lib/template/AdvancedSearch/SearchGroups/hooks.ts +37 -0
- package/lib/template/AdvancedSearch/SearchGroups/index.tsx +1 -0
- package/lib/template/AdvancedSearch/SearchGroups/utils.ts +29 -0
- package/lib/template/AdvancedSearch/TemplateContext.ts +11 -0
- package/lib/template/AdvancedSearch/config-ext.json +9 -0
- package/lib/template/AdvancedSearch/index.tsx +1 -0
- package/lib/template/AppShell/AppShell.css +1 -5
- package/lib/template/AppShell/AppShell.tsx +16 -17
- package/lib/template/BannerPage/BannerPage.tsx +2 -2
- package/lib/template/CaseSummary/CaseSummary.tsx +25 -43
- package/lib/template/CaseView/CaseView.tsx +28 -35
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/lib/template/Confirmation/Confirmation.tsx +2 -3
- package/lib/template/DataReference/DataReference.tsx +312 -106
- package/lib/template/DataReference/DataReferenceAdvancedSearchContext.ts +10 -0
- package/lib/template/DataReference/SearchForm.tsx +149 -0
- package/lib/template/DataReference/utils.ts +90 -0
- package/lib/template/DefaultForm/DefaultForm.tsx +3 -3
- package/lib/template/DefaultForm/utils/index.ts +1 -3
- package/lib/template/DefaultPage/DefaultPage.tsx +108 -0
- package/lib/template/DefaultPage/index.tsx +1 -0
- package/lib/template/Details/Details/Details.tsx +11 -11
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +2 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +11 -11
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +11 -11
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +1 -1
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +12 -6
- package/lib/template/HierarchicalForm/HierarchicalForm.tsx +58 -0
- package/lib/template/HierarchicalForm/hooks.ts +224 -0
- package/lib/template/HierarchicalForm/index.tsx +1 -0
- package/lib/template/InlineDashboard/InlineDashboard.tsx +14 -16
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
- package/lib/template/ListPage/ListPage.tsx +1 -1
- package/lib/template/ListView/ListView.tsx +342 -204
- package/lib/template/ListView/hooks.ts +1 -5
- package/lib/template/ListView/utils.ts +38 -5
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +17 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +5 -5
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +11 -11
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
- package/lib/template/ObjectPage/index.tsx +1 -0
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -7
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +1 -2
- package/lib/template/SelfServiceCaseView/SelfServiceCaseView.tsx +153 -0
- package/lib/template/SelfServiceCaseView/index.tsx +1 -0
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +2 -3
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +45 -34
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +1 -1
- package/lib/template/SimpleTable/SimpleTableSelectReadonly/SimpleTableSelectReadonly.tsx +179 -0
- package/lib/template/SimpleTable/SimpleTableSelectReadonly/index.tsx +1 -0
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +10 -2
- package/lib/template/SubTabs/SubTabs.tsx +2 -2
- package/lib/template/SubTabs/tabUtils.ts +118 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +9 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +9 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +5 -5
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +11 -11
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.css +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +6 -6
- package/lib/template/utils.tsx +58 -0
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +1 -1
- package/lib/widget/Attachment/Attachment.css +6 -8
- package/lib/widget/Attachment/Attachment.tsx +303 -225
- package/lib/widget/Attachment/Attachment.types.ts +96 -0
- package/lib/widget/Attachment/AttachmentUtils.ts +316 -0
- package/lib/widget/CaseHistory/CaseHistory.tsx +5 -5
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.css +0 -14
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +3 -3
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +7 -6
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +29 -22
- package/lib/widget/Followers/Followers.tsx +2 -4
- package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
- package/lib/widget/SummaryItem/SummaryItem.css +9 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +2 -2
- package/lib/widget/SummaryList/SummaryList.tsx +1 -1
- package/lib/widget/ToDo/ToDo.css +1 -13
- package/lib/widget/ToDo/ToDo.tsx +37 -36
- package/package.json +1 -1
- package/lib/helpers/attachmentHelpers.ts +0 -76
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
2
|
import { Editor } from '@tinymce/tinymce-react';
|
|
3
|
-
import { FormControl, FormHelperText, InputLabel } from '@mui/material';
|
|
3
|
+
import { FormControl, FormHelperText, InputLabel, useTheme } from '@mui/material';
|
|
4
4
|
import makeStyles from '@mui/styles/makeStyles';
|
|
5
|
-
|
|
6
5
|
import { useAfterInitialEffect, useConsolidatedRef, useUID } from '@pega/react-sdk-components/lib/hooks';
|
|
7
6
|
|
|
8
7
|
const useStyles = makeStyles(theme => ({
|
|
@@ -31,6 +30,7 @@ interface RichTextEditorProps {
|
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorProps, ref) {
|
|
33
|
+
const theme = useTheme();
|
|
34
34
|
const classes = useStyles();
|
|
35
35
|
const uid = useUID();
|
|
36
36
|
const { id = uid, defaultValue, label, labelHidden, info, testId, placeholder, disabled, required, readOnly, error, onBlur, onChange } = props;
|
|
@@ -74,7 +74,7 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
|
|
|
74
74
|
|
|
75
75
|
if (readOnly) {
|
|
76
76
|
const value = defaultValue || '--';
|
|
77
|
-
|
|
77
|
+
|
|
78
78
|
richTextComponent = <div key={id} id={id} className='readonly-richtext-editor' dangerouslySetInnerHTML={{ __html: value }} />;
|
|
79
79
|
} else {
|
|
80
80
|
richTextComponent = (
|
|
@@ -87,6 +87,34 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
|
|
|
87
87
|
initialValue={defaultValue}
|
|
88
88
|
disabled={disabled}
|
|
89
89
|
init={{
|
|
90
|
+
skin: theme.palette.mode === 'dark' ? 'oxide-dark' : 'oxide',
|
|
91
|
+
// ...other TinyMCE config...
|
|
92
|
+
content_style: `
|
|
93
|
+
body {
|
|
94
|
+
font-family: ${theme.typography.fontFamily};
|
|
95
|
+
font-size: ${theme.typography.fontSize}px;
|
|
96
|
+
color: ${theme.palette.text.primary};
|
|
97
|
+
background: ${theme.palette.background.paper};
|
|
98
|
+
}
|
|
99
|
+
a { color: ${theme.palette.primary.main}; }
|
|
100
|
+
h1, h2, h3, h4, h5, h6 { color: ${theme.palette.text.primary}; font-family: ${theme.typography.fontFamily}; }
|
|
101
|
+
blockquote { color: ${theme.palette.text.secondary}; border-left: 4px solid ${theme.palette.primary.light}; padding-left: 8px; }
|
|
102
|
+
ul, ol { color: ${theme.palette.text.primary}; }
|
|
103
|
+
input, textarea, select {
|
|
104
|
+
background: ${theme.palette.background.paper};
|
|
105
|
+
color: ${theme.palette.text.primary};
|
|
106
|
+
border: 1px solid ${theme.palette.divider};
|
|
107
|
+
border-radius: 4px;
|
|
108
|
+
padding: 6px 10px;
|
|
109
|
+
font-size: 1em;
|
|
110
|
+
font-family: inherit;
|
|
111
|
+
}
|
|
112
|
+
.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {
|
|
113
|
+
color: ${theme.palette.text.secondary};
|
|
114
|
+
opacity: 0.7;
|
|
115
|
+
}
|
|
116
|
+
/* Add more styles as needed */
|
|
117
|
+
`,
|
|
90
118
|
placeholder,
|
|
91
119
|
menubar: false,
|
|
92
120
|
statusbar: false,
|
|
@@ -95,7 +123,7 @@ const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorP
|
|
|
95
123
|
autoresize_bottom_margin: 0,
|
|
96
124
|
toolbar: disabled ? false : 'blocks | bold italic strikethrough | bullist numlist outdent indent | link image',
|
|
97
125
|
toolbar_location: 'bottom',
|
|
98
|
-
content_style: 'body { font-family:Helvetica, Arial,sans-serif; font-size:14px }',
|
|
126
|
+
// content_style: 'body { font-family:Helvetica, Arial,sans-serif; font-size:14px }',
|
|
99
127
|
branding: false,
|
|
100
128
|
paste_data_images: true,
|
|
101
129
|
file_picker_types: 'image',
|
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
.quick-link-ul-list {
|
|
2
2
|
list-style: none;
|
|
3
3
|
padding: 0;
|
|
4
|
-
grid-template-columns: repeat(auto-
|
|
4
|
+
grid-template-columns: repeat(auto-fit, minmax(min(20ch, 100%), 1fr));
|
|
5
5
|
display: grid;
|
|
6
6
|
gap: calc(1rem);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.quick-link-list {
|
|
10
|
-
background-color: #3f51b5;
|
|
11
|
-
color: white;
|
|
12
|
-
border-radius: 8px;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
9
|
.quick-link-button {
|
|
16
10
|
text-transform: capitalize !important;
|
|
17
11
|
font-size: 16px !important;
|
|
18
|
-
color:
|
|
19
|
-
|
|
20
|
-
height: 6rem;
|
|
12
|
+
color: var(--app-text-color) !important;
|
|
13
|
+
height: 10rem;
|
|
21
14
|
width: 100%;
|
|
22
|
-
justify-content: start !important;
|
|
23
15
|
}
|
|
24
16
|
|
|
25
17
|
.quick-link-icon {
|
|
26
|
-
width: 1em;
|
|
27
|
-
height: 1em;
|
|
28
18
|
flex-shrink: 0;
|
|
29
|
-
|
|
19
|
+
object-fit: contain;
|
|
20
|
+
width: 3rem;
|
|
21
|
+
height: 3rem;
|
|
30
22
|
}
|
|
31
23
|
|
|
32
24
|
.quick-link-button-span {
|
|
33
25
|
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
34
27
|
align-items: center;
|
|
35
28
|
gap: 0.5rem;
|
|
36
29
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Button } from '@mui/material';
|
|
2
|
+
import { makeStyles } from '@mui/styles';
|
|
2
3
|
import './WssQuickCreate.css';
|
|
3
4
|
|
|
4
5
|
// WssQuickCreate is one of the few components that does NOT have getPConnect.
|
|
@@ -9,19 +10,29 @@ interface WssQuickCreateProps {
|
|
|
9
10
|
actions?: any[];
|
|
10
11
|
}
|
|
11
12
|
|
|
13
|
+
const useStyles = makeStyles(theme => ({
|
|
14
|
+
quickLinkList: {
|
|
15
|
+
backgroundColor: theme.palette.mode === 'dark' ? 'var(--app-background-color)' : 'var(--link-button-color)',
|
|
16
|
+
color: 'var(--app-text-color)',
|
|
17
|
+
borderRadius: '16px',
|
|
18
|
+
border: '1px solid var(--app-primary-color)'
|
|
19
|
+
}
|
|
20
|
+
}));
|
|
21
|
+
|
|
12
22
|
export default function WssQuickCreate(props: WssQuickCreateProps) {
|
|
13
23
|
const { heading, actions } = props;
|
|
24
|
+
const classes = useStyles();
|
|
14
25
|
|
|
15
26
|
return (
|
|
16
27
|
<div>
|
|
17
|
-
<h1 id='quick-links-heading' className='quick-
|
|
28
|
+
<h1 id='quick-links-heading' className='quick-links-heading'>
|
|
18
29
|
{heading}
|
|
19
30
|
</h1>
|
|
20
31
|
<ul id='quick-links' className='quick-link-ul-list'>
|
|
21
32
|
{actions &&
|
|
22
33
|
actions.map(element => {
|
|
23
34
|
return (
|
|
24
|
-
<li className=
|
|
35
|
+
<li className={classes.quickLinkList} key={element.label}>
|
|
25
36
|
<Button className='quick-link-button' onClick={element.onClick}>
|
|
26
37
|
<span className='quick-link-button-span'>
|
|
27
38
|
{element.icon && <img className='quick-link-icon' src={element.icon} />}
|
|
@@ -7,7 +7,7 @@ import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
|
7
7
|
import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
|
|
8
8
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
9
9
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
10
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
11
11
|
|
|
12
12
|
interface IOption {
|
|
13
13
|
key: string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
align-items: center;
|
|
6
6
|
height: 100%;
|
|
7
7
|
width: 100%;
|
|
8
|
-
background-color:
|
|
8
|
+
background-color: var(--modal-background-color);
|
|
9
9
|
position: fixed;
|
|
10
10
|
z-index: 9999;
|
|
11
11
|
top: 0px;
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
display: table;
|
|
17
17
|
margin: auto;
|
|
18
18
|
min-width: 550px;
|
|
19
|
-
background-color:
|
|
20
|
-
border: 1px solid
|
|
19
|
+
background-color: var(--modal-top-color);
|
|
20
|
+
border: 1px solid var(--modal-border-color);
|
|
21
21
|
border-radius: 10px;
|
|
22
22
|
padding: 20px;
|
|
23
|
-
box-shadow: 0 0 10px 3px
|
|
23
|
+
box-shadow: 0 0 10px 3px var(--modal-box-shadow-color);
|
|
24
24
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Button,
|
|
2
|
+
import { Button, Grid2, IconButton, Snackbar } from '@mui/material';
|
|
3
3
|
import CloseIcon from '@mui/icons-material/Close';
|
|
4
4
|
|
|
5
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
import './CancelAlert.css';
|
|
7
7
|
|
|
8
8
|
interface CancelAlertProps extends PConnFieldProps {
|
|
@@ -125,10 +125,10 @@ export default function CancelAlert(props: CancelAlertProps) {
|
|
|
125
125
|
<p>{localizedVal(content, localeCategory)}</p>
|
|
126
126
|
</div>
|
|
127
127
|
<div className='action-controls'>
|
|
128
|
-
<
|
|
129
|
-
<
|
|
130
|
-
<
|
|
131
|
-
</
|
|
128
|
+
<Grid2 container spacing={4} justifyContent='space-between'>
|
|
129
|
+
<Grid2>{leftButton}</Grid2>
|
|
130
|
+
<Grid2>{rightButton}</Grid2>
|
|
131
|
+
</Grid2>
|
|
132
132
|
</div>
|
|
133
133
|
</div>
|
|
134
134
|
</div>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable react/no-array-index-key */
|
|
2
1
|
import { useState, useEffect } from 'react';
|
|
3
2
|
import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText, FormLabel } from '@mui/material';
|
|
4
3
|
import makeStyles from '@mui/styles/makeStyles';
|
|
@@ -6,7 +5,7 @@ import makeStyles from '@mui/styles/makeStyles';
|
|
|
6
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
7
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
7
|
import { insertInstruction, deleteInstruction, updateNewInstuctions } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
|
|
9
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
9
|
|
|
11
10
|
interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
12
11
|
// If any, enter additional props that only exist on Checkbox here
|
|
@@ -21,18 +20,33 @@ interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
21
20
|
primaryField: string;
|
|
22
21
|
readonlyContextList: any;
|
|
23
22
|
referenceList: string;
|
|
23
|
+
variant?: string;
|
|
24
|
+
hideFieldLabels: boolean;
|
|
25
|
+
additionalProps: any;
|
|
26
|
+
imagePosition: string;
|
|
27
|
+
imageSize: string;
|
|
28
|
+
showImageDescription: string;
|
|
29
|
+
renderMode: string;
|
|
30
|
+
image: string;
|
|
24
31
|
}
|
|
25
32
|
|
|
26
33
|
const useStyles = makeStyles(() => ({
|
|
27
34
|
checkbox: {
|
|
28
35
|
display: 'flex',
|
|
29
36
|
flexDirection: 'column'
|
|
37
|
+
},
|
|
38
|
+
selectableCard: {
|
|
39
|
+
display: 'grid',
|
|
40
|
+
gridTemplateColumns: 'repeat(auto-fit, minmax(min(100%, 40ch), 1fr))',
|
|
41
|
+
gridAutoRows: '1fr',
|
|
42
|
+
gap: '0.5rem'
|
|
30
43
|
}
|
|
31
44
|
}));
|
|
32
45
|
|
|
33
46
|
export default function CheckboxComponent(props: CheckboxProps) {
|
|
34
47
|
// Get emitted components from map (so we can get any override that may exist)
|
|
35
48
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
49
|
+
const SelectableCard = getComponentFromMap('SelectableCard');
|
|
36
50
|
|
|
37
51
|
const {
|
|
38
52
|
getPConnect,
|
|
@@ -56,8 +70,20 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
56
70
|
selectionList,
|
|
57
71
|
primaryField,
|
|
58
72
|
referenceList,
|
|
59
|
-
readonlyContextList: selectedvalues
|
|
73
|
+
readonlyContextList: selectedvalues,
|
|
74
|
+
variant,
|
|
75
|
+
hideFieldLabels,
|
|
76
|
+
additionalProps,
|
|
77
|
+
imagePosition,
|
|
78
|
+
imageSize,
|
|
79
|
+
showImageDescription,
|
|
80
|
+
renderMode,
|
|
81
|
+
image
|
|
60
82
|
} = props;
|
|
83
|
+
const readOnlyMode = renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly;
|
|
84
|
+
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
86
|
+
const [theSelectedButton, setSelectedButton] = useState(value);
|
|
61
87
|
const classes = useStyles();
|
|
62
88
|
const helperTextToDisplay = validatemessage || helperText;
|
|
63
89
|
const thePConn = getPConnect();
|
|
@@ -71,12 +97,17 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
71
97
|
}, [value]);
|
|
72
98
|
|
|
73
99
|
useEffect(() => {
|
|
74
|
-
if (referenceList?.length > 0) {
|
|
100
|
+
if (referenceList?.length > 0 && !readOnlyMode) {
|
|
75
101
|
thePConn.setReferenceList(selectionList);
|
|
76
102
|
updateNewInstuctions(thePConn, selectionList);
|
|
77
103
|
}
|
|
78
104
|
}, [thePConn]);
|
|
79
105
|
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
// This update theSelectedButton which will update the UI to show the selected button correctly
|
|
108
|
+
setSelectedButton(value);
|
|
109
|
+
}, [value]);
|
|
110
|
+
|
|
80
111
|
if (displayMode === 'DISPLAY_ONLY') {
|
|
81
112
|
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} />;
|
|
82
113
|
}
|
|
@@ -93,6 +124,68 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
93
124
|
thePConn.getValidationApi().validate(event.target.checked);
|
|
94
125
|
};
|
|
95
126
|
|
|
127
|
+
const handleCheckboxChange = (event, item) => {
|
|
128
|
+
if (event.target.checked) {
|
|
129
|
+
insertInstruction(thePConn, selectionList, selectionKey, primaryField, item);
|
|
130
|
+
} else {
|
|
131
|
+
deleteInstruction(thePConn, selectionList, selectionKey, item);
|
|
132
|
+
}
|
|
133
|
+
thePConn.clearErrorMessages({ property: selectionList });
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const actions = thePConn.getActionsApi();
|
|
137
|
+
|
|
138
|
+
const commonProps = {
|
|
139
|
+
...additionalProps,
|
|
140
|
+
className: 'standard',
|
|
141
|
+
disabled,
|
|
142
|
+
readOnly,
|
|
143
|
+
onClick: (actions as any).onClick
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
if (variant === 'card') {
|
|
147
|
+
return (
|
|
148
|
+
<div>
|
|
149
|
+
<h4 style={{ marginTop: 0, marginBottom: 0 }}>{label}</h4>
|
|
150
|
+
<div className={classes.selectableCard}>
|
|
151
|
+
<SelectableCard
|
|
152
|
+
{...commonProps}
|
|
153
|
+
testId={testId}
|
|
154
|
+
displayMode={displayMode}
|
|
155
|
+
dataSource={datasource}
|
|
156
|
+
getPConnect={getPConnect}
|
|
157
|
+
readOnly={renderMode === 'ReadOnly' || displayMode === 'DISPLAY_ONLY' || readOnly}
|
|
158
|
+
onChange={e => {
|
|
159
|
+
e.stopPropagation();
|
|
160
|
+
const recordKey = selectionKey?.split('.').pop();
|
|
161
|
+
const selectedItem = datasource?.source?.find(item => item[recordKey as any] === e.target.id) ?? {};
|
|
162
|
+
handleCheckboxChange(e, {
|
|
163
|
+
id: selectedItem[recordKey as any],
|
|
164
|
+
primary: selectedItem[recordKey as any]
|
|
165
|
+
});
|
|
166
|
+
}}
|
|
167
|
+
onBlur={() => {
|
|
168
|
+
thePConn.getValidationApi().validate(selectedvalues, selectionList);
|
|
169
|
+
}}
|
|
170
|
+
hideFieldLabels={hideFieldLabels}
|
|
171
|
+
recordKey={selectionKey?.split('.').pop()}
|
|
172
|
+
cardLabel={primaryField.split('.').pop()}
|
|
173
|
+
image={{
|
|
174
|
+
imagePosition,
|
|
175
|
+
imageSize,
|
|
176
|
+
showImageDescription,
|
|
177
|
+
imageField: image?.split('.').pop(),
|
|
178
|
+
imageDescription: (thePConn?.getRawMetadata()?.config as any).imageDescription?.split('.').pop()
|
|
179
|
+
}}
|
|
180
|
+
readOnlyList={selectedvalues}
|
|
181
|
+
type='checkbox'
|
|
182
|
+
showNoValue={(renderMode === 'ReadOnly' || readOnly || displayMode === 'DISPLAY_ONLY') && selectedvalues.length === 0}
|
|
183
|
+
/>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
96
189
|
const handleChangeMultiMode = (event, element) => {
|
|
97
190
|
if (event.target.checked) {
|
|
98
191
|
insertInstruction(thePConn, selectionList, selectionKey, primaryField, {
|
|
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
|
|
2
2
|
import { NumericFormat } from 'react-number-format';
|
|
3
3
|
import { TextField } from '@mui/material';
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
7
7
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
8
8
|
import { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';
|
|
@@ -45,7 +45,7 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
45
45
|
const helperTextToDisplay = validatemessage || helperText;
|
|
46
46
|
const [values, setValues] = useState(value.toString());
|
|
47
47
|
|
|
48
|
-
const
|
|
48
|
+
const testProps: any = { 'data-test-id': testId };
|
|
49
49
|
|
|
50
50
|
useEffect(() => {
|
|
51
51
|
setValues(value.toString());
|
|
@@ -104,7 +104,7 @@ export default function Currency(props: CurrrencyProps) {
|
|
|
104
104
|
{...currencyProp}
|
|
105
105
|
decimalScale={allowDecimals !== false ? 2 : 0}
|
|
106
106
|
fixedDecimalScale={allowDecimals}
|
|
107
|
-
|
|
107
|
+
slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
|
|
108
108
|
customInput={TextField}
|
|
109
109
|
/>
|
|
110
110
|
);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
// eslint-disable-next-line import/no-named-default
|
|
2
1
|
import { default as CurrencyAlias } from '@pega/react-sdk-components/lib/components/helpers/formatters/Currency';
|
|
3
|
-
|
|
2
|
+
|
|
4
3
|
import { default as CurrencyMapAlias } from '@pega/react-sdk-components/lib/components/helpers/formatters/CurrencyMap';
|
|
5
4
|
|
|
6
5
|
export const getCurrencyOptions = (inISOCode: string) => {
|
package/lib/field/Date/Date.tsx
CHANGED
|
@@ -6,7 +6,7 @@ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event
|
|
|
6
6
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
7
7
|
import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
|
|
8
8
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
9
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
10
|
|
|
11
11
|
// Will return the date string in YYYY-MM-DD format which we'll be POSTing to the server
|
|
12
12
|
function getFormattedDate(date) {
|
|
@@ -62,11 +62,7 @@ export default function Date(props: DateProps) {
|
|
|
62
62
|
return <TextInput {...props} />;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
testProp = {
|
|
68
|
-
'data-test-id': testId
|
|
69
|
-
};
|
|
65
|
+
const testProps: any = { 'data-test-id': testId };
|
|
70
66
|
|
|
71
67
|
const handleChange = date => {
|
|
72
68
|
if (date && date.isValid()) {
|
|
@@ -89,7 +85,7 @@ export default function Date(props: DateProps) {
|
|
|
89
85
|
error: status === 'error',
|
|
90
86
|
helperText: helperTextToDisplay,
|
|
91
87
|
size: 'small',
|
|
92
|
-
InputProps: { ...
|
|
88
|
+
InputProps: { ...testProps }
|
|
93
89
|
}
|
|
94
90
|
}}
|
|
95
91
|
onChange={handleChange}
|
|
@@ -6,7 +6,7 @@ import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event
|
|
|
6
6
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
7
7
|
import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
|
|
8
8
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
9
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
10
|
|
|
11
11
|
interface DateTimeProps extends PConnFieldProps {
|
|
12
12
|
// If any, enter additional props that only exist on DateTime here
|
|
@@ -60,11 +60,7 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
60
60
|
return <TextInput {...props} value={formattedDateTime} />;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
testProp = {
|
|
66
|
-
'data-test-id': testId
|
|
67
|
-
};
|
|
63
|
+
const testProps: any = { 'data-test-id': testId };
|
|
68
64
|
|
|
69
65
|
const handleChange = date => {
|
|
70
66
|
const timeZoneDateTime = (dayjs as any).tz(date.format('YYYY-MM-DDTHH:mm:ss'), timezone);
|
|
@@ -89,7 +85,6 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
89
85
|
label={label}
|
|
90
86
|
value={dateValue}
|
|
91
87
|
onChange={handleChange}
|
|
92
|
-
data-test-id={testId}
|
|
93
88
|
slotProps={{
|
|
94
89
|
textField: {
|
|
95
90
|
variant: 'outlined',
|
|
@@ -98,7 +93,7 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
98
93
|
error: status === 'error',
|
|
99
94
|
helperText: helperTextToDisplay,
|
|
100
95
|
size: 'small',
|
|
101
|
-
InputProps: { ...
|
|
96
|
+
InputProps: { ...testProps }
|
|
102
97
|
}
|
|
103
98
|
}}
|
|
104
99
|
/>
|
|
@@ -5,7 +5,7 @@ import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-compo
|
|
|
5
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
6
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
7
7
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
8
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
9
|
|
|
10
10
|
/* Using react-number-format component here, since it allows formatting decimal values,
|
|
11
11
|
as per the locale.
|
|
@@ -83,9 +83,7 @@ export default function Decimal(props: DecimalProps) {
|
|
|
83
83
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
const
|
|
87
|
-
'data-test-id': testId
|
|
88
|
-
};
|
|
86
|
+
const testProps: any = { 'data-test-id': testId };
|
|
89
87
|
|
|
90
88
|
function decimalOnBlur() {
|
|
91
89
|
handleEvent(actions, 'changeNblur', propName, values);
|
|
@@ -117,7 +115,7 @@ export default function Decimal(props: DecimalProps) {
|
|
|
117
115
|
decimalSeparator={theCurrDec}
|
|
118
116
|
thousandSeparator={showGroupSeparators ? theCurrSep : ''}
|
|
119
117
|
decimalScale={readOnly && formatter === 'Currency' ? undefined : decimalPrecision}
|
|
120
|
-
|
|
118
|
+
slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
|
|
121
119
|
customInput={TextField}
|
|
122
120
|
/>
|
|
123
121
|
);
|
|
@@ -6,7 +6,7 @@ import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
|
6
6
|
import { getDataPage } from '@pega/react-sdk-components/lib/components/helpers/data_page';
|
|
7
7
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
8
8
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
9
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
10
10
|
|
|
11
11
|
interface IOption {
|
|
12
12
|
key: string;
|
|
@@ -170,7 +170,6 @@ export default function Dropdown(props: DropdownProps) {
|
|
|
170
170
|
return (
|
|
171
171
|
<FieldValueList
|
|
172
172
|
name={hideLabel ? '' : label}
|
|
173
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
174
173
|
value={thePConn.getLocalizedValue(val, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
175
174
|
/>
|
|
176
175
|
);
|
|
@@ -180,7 +179,6 @@ export default function Dropdown(props: DropdownProps) {
|
|
|
180
179
|
return (
|
|
181
180
|
<FieldValueList
|
|
182
181
|
name={hideLabel ? '' : label}
|
|
183
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
184
182
|
value={thePConn.getLocalizedValue(val, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
185
183
|
variant='stacked'
|
|
186
184
|
/>
|
|
@@ -198,9 +196,7 @@ export default function Dropdown(props: DropdownProps) {
|
|
|
198
196
|
readOnlyProp = { readOnly: true };
|
|
199
197
|
}
|
|
200
198
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
testProp = {
|
|
199
|
+
const testProps: any = {
|
|
204
200
|
'data-test-id': testId
|
|
205
201
|
};
|
|
206
202
|
|
|
@@ -228,7 +224,9 @@ export default function Dropdown(props: DropdownProps) {
|
|
|
228
224
|
label={label}
|
|
229
225
|
value={value === '' && !readOnly ? placeholder : value}
|
|
230
226
|
select
|
|
231
|
-
|
|
227
|
+
slotProps={{
|
|
228
|
+
input: { ...readOnlyProp, ...testProps }
|
|
229
|
+
}}
|
|
232
230
|
>
|
|
233
231
|
{options.map((option: any) => (
|
|
234
232
|
<MenuItem key={option.key} value={option.key}>
|
|
@@ -3,7 +3,7 @@ import { InputAdornment, TextField } from '@mui/material';
|
|
|
3
3
|
import MailOutlineIcon from '@mui/icons-material/MailOutline';
|
|
4
4
|
|
|
5
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
7
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
8
8
|
|
|
9
9
|
interface EmailProps extends PConnFieldProps {
|
|
@@ -55,11 +55,7 @@ export default function Email(props: EmailProps) {
|
|
|
55
55
|
return <TextInput {...props} />;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
testProp = {
|
|
61
|
-
'data-test-id': testId
|
|
62
|
-
};
|
|
58
|
+
const testProps: any = { 'data-test-id': testId };
|
|
63
59
|
|
|
64
60
|
function handleChange(event) {
|
|
65
61
|
// update internal value
|
|
@@ -85,13 +81,15 @@ export default function Email(props: EmailProps) {
|
|
|
85
81
|
label={label}
|
|
86
82
|
value={inputValue}
|
|
87
83
|
type='email'
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
slotProps={{
|
|
85
|
+
input: {
|
|
86
|
+
startAdornment: (
|
|
87
|
+
<InputAdornment position='start'>
|
|
88
|
+
<MailOutlineIcon />
|
|
89
|
+
</InputAdornment>
|
|
90
|
+
),
|
|
91
|
+
inputProps: { ...testProps }
|
|
92
|
+
}
|
|
95
93
|
}}
|
|
96
94
|
/>
|
|
97
95
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactElement, useMemo } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
1
|
+
import { type ReactElement, useMemo } from 'react';
|
|
2
|
+
import Grid2 from '@mui/material/Grid2';
|
|
3
|
+
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface GroupProps extends PConnFieldProps {
|
|
7
7
|
children: ReactElement[];
|
|
@@ -13,19 +13,21 @@ interface GroupProps extends PConnFieldProps {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export default function Group(props: GroupProps) {
|
|
16
|
+
const FieldGroup = getComponentFromMap('FieldGroup');
|
|
17
|
+
|
|
16
18
|
const { children, heading, showHeading, instructions, collapsible, displayMode, type } = props;
|
|
17
19
|
|
|
18
20
|
const isReadOnly = displayMode === 'DISPLAY_ONLY';
|
|
19
21
|
|
|
20
22
|
const content = useMemo(() => {
|
|
21
23
|
return (
|
|
22
|
-
<
|
|
24
|
+
<Grid2 container spacing={2}>
|
|
23
25
|
{children?.map(child => (
|
|
24
|
-
<
|
|
26
|
+
<Grid2 size={{ xs: 12 }} key={child.key}>
|
|
25
27
|
{child}
|
|
26
|
-
</
|
|
28
|
+
</Grid2>
|
|
27
29
|
))}
|
|
28
|
-
</
|
|
30
|
+
</Grid2>
|
|
29
31
|
);
|
|
30
32
|
}, [children, type, isReadOnly]);
|
|
31
33
|
|