@pega/react-sdk-overrides 0.24.4 → 0.25.2
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.tsx +1 -1
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -2
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +59 -32
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +4 -4
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +5 -5
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +4 -4
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +6 -6
- package/lib/designSystemExtension/Operator/Operator.tsx +16 -12
- package/lib/designSystemExtension/Pulse/Pulse.tsx +3 -3
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +3 -2
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -1
- package/lib/field/AutoComplete/AutoComplete.tsx +5 -5
- package/lib/field/CancelAlert/CancelAlert.tsx +5 -8
- package/lib/field/Checkbox/Checkbox.tsx +5 -5
- package/lib/field/Currency/Currency.tsx +12 -9
- package/lib/field/Date/Date.tsx +29 -48
- package/lib/field/DateTime/DateTime.tsx +37 -39
- package/lib/field/Decimal/Decimal.tsx +12 -9
- package/lib/field/Dropdown/Dropdown.tsx +34 -27
- package/lib/field/Email/Email.tsx +39 -20
- package/lib/field/Group/Group.tsx +4 -4
- package/lib/field/Integer/Integer.tsx +27 -15
- package/lib/field/Multiselect/Multiselect.tsx +8 -14
- package/lib/field/Multiselect/utils.ts +1 -1
- package/lib/field/Percentage/Percentage.tsx +11 -11
- package/lib/field/Phone/Phone.tsx +13 -10
- package/lib/field/Phone/config-ext.json +8 -0
- package/lib/field/RadioButtons/RadioButtons.tsx +4 -7
- package/lib/field/RichText/RichText.tsx +2 -2
- package/lib/field/RichText/config-ext.json +10 -0
- package/lib/field/ScalarList/ScalarList.tsx +4 -5
- package/lib/field/SemanticLink/SemanticLink.tsx +5 -5
- package/lib/field/TextArea/TextArea.tsx +30 -14
- package/lib/field/TextContent/TextContent.tsx +2 -2
- package/lib/field/TextInput/TextInput.tsx +7 -9
- package/lib/field/Time/Time.tsx +30 -27
- package/lib/field/URL/URL.tsx +29 -12
- package/lib/field/UserReference/UserReference.tsx +4 -6
- package/lib/helpers/common-utils.ts +24 -1
- package/lib/helpers/field-group-utils.ts +3 -3
- package/lib/helpers/formatters/Currency.ts +11 -16
- package/lib/helpers/formatters/common.ts +2 -1
- package/lib/helpers/formatters/index.ts +2 -4
- package/lib/helpers/simpleTableHelpers.ts +1 -1
- package/lib/infra/ActionButtons/ActionButtons.tsx +3 -3
- package/lib/infra/Assignment/Assignment.tsx +14 -14
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +2 -2
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +17 -29
- package/lib/infra/Containers/FlowContainer/helpers.ts +1 -5
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +10 -5
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +9 -9
- package/lib/infra/Containers/SimpleView/helper.ts +1 -1
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +2 -2
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +6 -8
- package/lib/infra/DashboardFilter/filterUtils.tsx +3 -4
- package/lib/infra/DeferLoad/DeferLoad.tsx +9 -9
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +1 -1
- package/lib/infra/MultiStep/MultiStep.tsx +17 -16
- package/lib/infra/NavBar/NavBar.css +1 -0
- package/lib/infra/NavBar/NavBar.tsx +49 -38
- package/lib/infra/Reference/Reference.tsx +1 -1
- package/lib/infra/Region/Region.tsx +1 -1
- package/lib/infra/RootContainer/RootContainer.tsx +7 -8
- package/lib/infra/Stages/Stages.tsx +5 -5
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +4 -3
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +2 -2
- package/lib/infra/View/View.tsx +38 -4
- package/lib/template/AdvancedSearch/AdvancedSearch.tsx +87 -0
- package/lib/template/AdvancedSearch/SearchGroup/persistUtils.ts +58 -0
- package/lib/template/AdvancedSearch/SearchGroups/SearchGroups.tsx +245 -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.tsx +62 -12
- package/lib/template/BannerPage/BannerPage.tsx +2 -2
- package/lib/template/BannerPage/config-ext.json +9 -0
- package/lib/template/CaseSummary/CaseSummary.tsx +2 -2
- package/lib/template/CaseView/CaseView.tsx +12 -11
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +8 -8
- package/lib/template/Confirmation/Confirmation.tsx +5 -4
- package/lib/template/DataReference/DataReference.tsx +318 -108
- package/lib/template/DataReference/DataReferenceAdvancedSearchContext.js +10 -0
- package/lib/template/DataReference/SearchForm.tsx +148 -0
- package/lib/template/DataReference/utils.js +90 -0
- package/lib/template/DefaultForm/DefaultForm.tsx +2 -2
- package/lib/template/DefaultForm/utils/index.ts +1 -3
- package/lib/template/Details/Details/Details.tsx +3 -3
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +5 -5
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +3 -3
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +3 -3
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +5 -5
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +11 -6
- package/lib/template/InlineDashboard/InlineDashboard.tsx +4 -4
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +2 -2
- package/lib/template/InlineDashboardPage/config-ext.json +9 -0
- package/lib/template/ListPage/ListPage.tsx +1 -1
- package/lib/template/ListView/ListView.tsx +201 -95
- package/lib/template/ListView/utils.ts +38 -6
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +2 -2
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +3 -3
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +2 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +2 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +4 -4
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +1 -1
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +2 -2
- package/lib/template/PromotedFilters/PromotedFilters.tsx +2 -3
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +1 -3
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +112 -88
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +3 -5
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/lib/template/SubTabs/SubTabs.tsx +4 -4
- package/lib/template/SubTabs/tabUtils.ts +118 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +10 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +1 -1
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +10 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +3 -3
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +2 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +2 -2
- package/lib/template/WssNavBar/WssNavBar.tsx +10 -10
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +3 -3
- package/lib/widget/Attachment/Attachment.css +1 -0
- package/lib/widget/Attachment/Attachment.tsx +8 -10
- package/lib/widget/CaseHistory/CaseHistory.tsx +13 -11
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +6 -5
- package/lib/widget/Followers/Followers.tsx +4 -4
- package/lib/widget/QuickCreate/QuickCreate.tsx +1 -2
- package/lib/widget/QuickCreate/config-ext.json +9 -0
- package/lib/widget/SummaryItem/SummaryItem.tsx +5 -4
- package/lib/widget/SummaryList/SummaryList.tsx +1 -1
- package/lib/widget/ToDo/ToDo.tsx +102 -40
- package/package.json +1 -1
- /package/lib/infra/Containers/{helpers.ts → container-helpers.ts} +0 -0
package/lib/field/Date/Date.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
|
|
3
|
+
import dayjs, { Dayjs } from 'dayjs';
|
|
2
4
|
|
|
3
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
4
6
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
5
7
|
import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
|
|
6
8
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
10
|
|
|
9
11
|
// Will return the date string in YYYY-MM-DD format which we'll be POSTing to the server
|
|
10
12
|
function getFormattedDate(date) {
|
|
@@ -20,22 +22,9 @@ export default function Date(props: DateProps) {
|
|
|
20
22
|
const TextInput = getComponentFromMap('TextInput');
|
|
21
23
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
22
24
|
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
required,
|
|
27
|
-
disabled,
|
|
28
|
-
value = '',
|
|
29
|
-
validatemessage,
|
|
30
|
-
status,
|
|
31
|
-
onChange,
|
|
32
|
-
onBlur,
|
|
33
|
-
readOnly,
|
|
34
|
-
testId,
|
|
35
|
-
helperText,
|
|
36
|
-
displayMode,
|
|
37
|
-
hideLabel
|
|
38
|
-
} = props;
|
|
25
|
+
const { getPConnect, label, required, disabled, value, validatemessage, status, readOnly, testId, helperText, displayMode, hideLabel } = props;
|
|
26
|
+
|
|
27
|
+
const [dateValue, setDateValue] = useState<Dayjs | null>(value ? dayjs(value) : null);
|
|
39
28
|
|
|
40
29
|
const pConn = getPConnect();
|
|
41
30
|
const actions = pConn.getActionsApi();
|
|
@@ -50,7 +39,11 @@ export default function Date(props: DateProps) {
|
|
|
50
39
|
dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;
|
|
51
40
|
dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;
|
|
52
41
|
|
|
53
|
-
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setDateValue(dayjs(value));
|
|
44
|
+
}, [value]);
|
|
45
|
+
|
|
46
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
54
47
|
const formattedDate = format(props.value, 'date', {
|
|
55
48
|
format: dateFormatInfo.dateFormatString
|
|
56
49
|
});
|
|
@@ -69,45 +62,33 @@ export default function Date(props: DateProps) {
|
|
|
69
62
|
return <TextInput {...props} />;
|
|
70
63
|
}
|
|
71
64
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
testProp = {
|
|
75
|
-
'data-test-id': testId
|
|
76
|
-
};
|
|
65
|
+
const testProps: any = { 'data-test-id': testId };
|
|
77
66
|
|
|
78
67
|
const handleChange = date => {
|
|
79
68
|
if (date && date.isValid()) {
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const handleAccept = date => {
|
|
85
|
-
if (date && date.isValid()) {
|
|
69
|
+
setDateValue(date);
|
|
86
70
|
handleEvent(actions, 'changeNblur', propName, getFormattedDate(date));
|
|
87
71
|
}
|
|
88
72
|
};
|
|
89
73
|
|
|
90
74
|
return (
|
|
91
|
-
<
|
|
92
|
-
disableToolbar
|
|
93
|
-
variant='inline'
|
|
94
|
-
inputVariant='outlined'
|
|
95
|
-
placeholder={dateFormatInfo.dateFormatStringLC}
|
|
96
|
-
format={dateFormatInfo.dateFormatString}
|
|
97
|
-
mask={dateFormatInfo.dateFormatMask}
|
|
98
|
-
fullWidth
|
|
99
|
-
autoOk
|
|
100
|
-
required={required}
|
|
101
|
-
disabled={disabled}
|
|
102
|
-
error={status === 'error'}
|
|
103
|
-
helperText={helperTextToDisplay}
|
|
104
|
-
size='small'
|
|
75
|
+
<DatePicker
|
|
105
76
|
label={label}
|
|
106
|
-
|
|
77
|
+
disabled={disabled}
|
|
78
|
+
format={dateFormatInfo.dateFormatString}
|
|
79
|
+
value={dateValue}
|
|
80
|
+
slotProps={{
|
|
81
|
+
textField: {
|
|
82
|
+
required,
|
|
83
|
+
variant: 'outlined',
|
|
84
|
+
placeholder: dateFormatInfo.dateFormatStringLC,
|
|
85
|
+
error: status === 'error',
|
|
86
|
+
helperText: helperTextToDisplay,
|
|
87
|
+
size: 'small',
|
|
88
|
+
InputProps: { ...testProps }
|
|
89
|
+
}
|
|
90
|
+
}}
|
|
107
91
|
onChange={handleChange}
|
|
108
|
-
onBlur={!readOnly ? onBlur : undefined}
|
|
109
|
-
onAccept={handleAccept}
|
|
110
|
-
InputProps={{ ...testProp }}
|
|
111
92
|
/>
|
|
112
93
|
);
|
|
113
94
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { DateTimePicker } from '@mui/x-date-pickers/DateTimePicker';
|
|
3
|
+
import dayjs, { Dayjs } from 'dayjs';
|
|
4
|
+
import DateFormatter from '@pega/react-sdk-components/lib/components/helpers/formatters/Date';
|
|
3
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
4
6
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
5
7
|
import { dateFormatInfoDefault, getDateFormatInfo } from '@pega/react-sdk-components/lib/components/helpers/date-format-utils';
|
|
6
8
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
9
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
10
|
|
|
9
11
|
interface DateTimeProps extends PConnFieldProps {
|
|
10
12
|
// If any, enter additional props that only exist on DateTime here
|
|
@@ -15,21 +17,12 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
15
17
|
const TextInput = getComponentFromMap('TextInput');
|
|
16
18
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
17
19
|
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
validatemessage,
|
|
25
|
-
status,
|
|
26
|
-
onChange,
|
|
27
|
-
readOnly,
|
|
28
|
-
testId,
|
|
29
|
-
helperText,
|
|
30
|
-
displayMode,
|
|
31
|
-
hideLabel
|
|
32
|
-
} = props;
|
|
20
|
+
const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, testId, helperText, displayMode, hideLabel } = props;
|
|
21
|
+
|
|
22
|
+
const environmentInfo = PCore.getEnvironmentInfo();
|
|
23
|
+
const timezone = environmentInfo && environmentInfo.getTimeZone();
|
|
24
|
+
|
|
25
|
+
const [dateValue, setDateValue] = useState<Dayjs | null>(value ? dayjs(DateFormatter.convertToTimezone(value, { timezone })) : null);
|
|
33
26
|
|
|
34
27
|
const pConn = getPConnect();
|
|
35
28
|
const actions = pConn.getActionsApi();
|
|
@@ -44,7 +37,11 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
44
37
|
dateFormatInfo.dateFormatStringLC = theDateFormat.dateFormatStringLC;
|
|
45
38
|
dateFormatInfo.dateFormatMask = theDateFormat.dateFormatMask;
|
|
46
39
|
|
|
47
|
-
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
setDateValue(dayjs(DateFormatter.convertToTimezone(value, { timezone })));
|
|
42
|
+
}, [value]);
|
|
43
|
+
|
|
44
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
48
45
|
const formattedDateTime = format(props.value, 'datetime', {
|
|
49
46
|
format: `${dateFormatInfo.dateFormatString} hh:mm a`
|
|
50
47
|
});
|
|
@@ -63,13 +60,12 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
63
60
|
return <TextInput {...props} value={formattedDateTime} />;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
const
|
|
67
|
-
const changeValue = date && date.isValid() ? date.toISOString() : null;
|
|
68
|
-
onChange({ value: changeValue });
|
|
69
|
-
};
|
|
63
|
+
const testProps: any = { 'data-test-id': testId };
|
|
70
64
|
|
|
71
|
-
const
|
|
72
|
-
const
|
|
65
|
+
const handleChange = date => {
|
|
66
|
+
const timeZoneDateTime = (dayjs as any).tz(date.format('YYYY-MM-DDTHH:mm:ss'), timezone);
|
|
67
|
+
const changeValue = timeZoneDateTime && timeZoneDateTime.isValid() ? timeZoneDateTime.toISOString() : '';
|
|
68
|
+
setDateValue(timeZoneDateTime);
|
|
73
69
|
handleEvent(actions, 'changeNblur', propName, changeValue);
|
|
74
70
|
};
|
|
75
71
|
|
|
@@ -79,25 +75,27 @@ export default function DateTime(props: DateTimeProps) {
|
|
|
79
75
|
//
|
|
80
76
|
|
|
81
77
|
return (
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
fullWidth
|
|
86
|
-
autoOk
|
|
87
|
-
required={required}
|
|
78
|
+
<DateTimePicker
|
|
79
|
+
// fullWidth
|
|
80
|
+
// autoOk
|
|
88
81
|
disabled={disabled}
|
|
89
|
-
placeholder={`${dateFormatInfo.dateFormatStringLC} hh:mm a`}
|
|
90
82
|
format={`${dateFormatInfo.dateFormatString} hh:mm a`}
|
|
91
|
-
mask={`${dateFormatInfo.dateFormatMask} __:__ _m`}
|
|
83
|
+
// mask={`${dateFormatInfo.dateFormatMask} __:__ _m`}
|
|
92
84
|
minutesStep={5}
|
|
93
|
-
error={status === 'error'}
|
|
94
|
-
helperText={helperTextToDisplay}
|
|
95
|
-
size='small'
|
|
96
85
|
label={label}
|
|
97
|
-
value={
|
|
86
|
+
value={dateValue}
|
|
98
87
|
onChange={handleChange}
|
|
99
|
-
|
|
100
|
-
|
|
88
|
+
slotProps={{
|
|
89
|
+
textField: {
|
|
90
|
+
variant: 'outlined',
|
|
91
|
+
required,
|
|
92
|
+
placeholder: `${dateFormatInfo.dateFormatStringLC} hh:mm a`,
|
|
93
|
+
error: status === 'error',
|
|
94
|
+
helperText: helperTextToDisplay,
|
|
95
|
+
size: 'small',
|
|
96
|
+
InputProps: { ...testProps }
|
|
97
|
+
}
|
|
98
|
+
}}
|
|
101
99
|
/>
|
|
102
100
|
);
|
|
103
101
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { TextField } from '@material-ui/core';
|
|
2
1
|
import { NumericFormat } from 'react-number-format';
|
|
3
|
-
import {
|
|
2
|
+
import { TextField } from '@mui/material';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
4
|
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
|
|
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.
|
|
@@ -58,6 +58,10 @@ export default function Decimal(props: DecimalProps) {
|
|
|
58
58
|
|
|
59
59
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
60
60
|
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
setValues(value.toString());
|
|
63
|
+
}, [value]);
|
|
64
|
+
|
|
61
65
|
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
62
66
|
|
|
63
67
|
if (readOnly) {
|
|
@@ -68,10 +72,10 @@ export default function Decimal(props: DecimalProps) {
|
|
|
68
72
|
if (formatter === 'Currency') {
|
|
69
73
|
formattedValue = format(value, formatter.toLowerCase(), theCurrencyOptions);
|
|
70
74
|
} else {
|
|
71
|
-
formattedValue = format(value, pConn.getComponentName()
|
|
75
|
+
formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
72
76
|
}
|
|
73
77
|
|
|
74
|
-
if (displayMode === '
|
|
78
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
75
79
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
76
80
|
}
|
|
77
81
|
|
|
@@ -79,9 +83,7 @@ export default function Decimal(props: DecimalProps) {
|
|
|
79
83
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
|
|
80
84
|
}
|
|
81
85
|
|
|
82
|
-
const
|
|
83
|
-
'data-test-id': testId
|
|
84
|
-
};
|
|
86
|
+
const testProps: any = { 'data-test-id': testId };
|
|
85
87
|
|
|
86
88
|
function decimalOnBlur() {
|
|
87
89
|
handleEvent(actions, 'changeNblur', propName, values);
|
|
@@ -109,10 +111,11 @@ export default function Decimal(props: DecimalProps) {
|
|
|
109
111
|
}}
|
|
110
112
|
onBlur={!readOnly ? decimalOnBlur : undefined}
|
|
111
113
|
prefix={readOnly && formatter === 'Currency' ? theCurrSym : ''}
|
|
114
|
+
suffix={readOnly && formatter === 'Percentage' ? '%' : ''}
|
|
112
115
|
decimalSeparator={theCurrDec}
|
|
113
116
|
thousandSeparator={showGroupSeparators ? theCurrSep : ''}
|
|
114
117
|
decimalScale={readOnly && formatter === 'Currency' ? undefined : decimalPrecision}
|
|
115
|
-
|
|
118
|
+
slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
|
|
116
119
|
customInput={TextField}
|
|
117
120
|
/>
|
|
118
121
|
);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
|
-
import { TextField } from '@material
|
|
3
|
-
import MenuItem from '@material
|
|
2
|
+
import { TextField } from '@mui/material';
|
|
3
|
+
import MenuItem from '@mui/material/MenuItem';
|
|
4
4
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
5
5
|
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;
|
|
@@ -137,7 +137,7 @@ export default function Dropdown(props: DropdownProps) {
|
|
|
137
137
|
}, [theDatasource]);
|
|
138
138
|
|
|
139
139
|
useEffect(() => {
|
|
140
|
-
if (
|
|
140
|
+
if (listType !== 'associated' && typeof datasource === 'string') {
|
|
141
141
|
getDataPage(datasource, parameters, context).then((results: any) => {
|
|
142
142
|
const optionsData: any[] = [];
|
|
143
143
|
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
@@ -165,34 +165,40 @@ export default function Dropdown(props: DropdownProps) {
|
|
|
165
165
|
|
|
166
166
|
let readOnlyProp = {};
|
|
167
167
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
168
|
+
const displayFn = (displayM, val) => {
|
|
169
|
+
if (displayM === 'DISPLAY_ONLY') {
|
|
170
|
+
return (
|
|
171
|
+
<FieldValueList
|
|
172
|
+
name={hideLabel ? '' : label}
|
|
173
|
+
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
174
|
+
value={thePConn.getLocalizedValue(val, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
175
|
+
/>
|
|
176
|
+
);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (displayM === 'STACKED_LARGE_VAL') {
|
|
180
|
+
return (
|
|
181
|
+
<FieldValueList
|
|
182
|
+
name={hideLabel ? '' : label}
|
|
183
|
+
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
184
|
+
value={thePConn.getLocalizedValue(val, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
185
|
+
variant='stacked'
|
|
186
|
+
/>
|
|
187
|
+
);
|
|
188
|
+
}
|
|
177
189
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
184
|
-
variant='stacked'
|
|
185
|
-
/>
|
|
186
|
-
);
|
|
190
|
+
return null;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
if (displayMode) {
|
|
194
|
+
return displayFn(displayMode, options.find(option => option.key === value)?.value || value);
|
|
187
195
|
}
|
|
188
196
|
|
|
189
197
|
if (readOnly) {
|
|
190
198
|
readOnlyProp = { readOnly: true };
|
|
191
199
|
}
|
|
192
200
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
testProp = {
|
|
201
|
+
const testProps: any = {
|
|
196
202
|
'data-test-id': testId
|
|
197
203
|
};
|
|
198
204
|
|
|
@@ -220,11 +226,12 @@ export default function Dropdown(props: DropdownProps) {
|
|
|
220
226
|
label={label}
|
|
221
227
|
value={value === '' && !readOnly ? placeholder : value}
|
|
222
228
|
select
|
|
223
|
-
|
|
229
|
+
slotProps={{
|
|
230
|
+
input: { ...readOnlyProp, ...testProps }
|
|
231
|
+
}}
|
|
224
232
|
>
|
|
225
233
|
{options.map((option: any) => (
|
|
226
234
|
<MenuItem key={option.key} value={option.key}>
|
|
227
|
-
{/* @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv' */}
|
|
228
235
|
{thePConn.getLocalizedValue(option.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
229
236
|
</MenuItem>
|
|
230
237
|
))}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { InputAdornment, TextField } from '@mui/material';
|
|
3
|
+
import MailOutlineIcon from '@mui/icons-material/MailOutline';
|
|
3
4
|
|
|
4
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
8
|
|
|
7
9
|
interface EmailProps extends PConnFieldProps {
|
|
8
10
|
// If any, enter additional props that only exist on Date here
|
|
@@ -14,14 +16,13 @@ export default function Email(props: EmailProps) {
|
|
|
14
16
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
15
17
|
|
|
16
18
|
const {
|
|
19
|
+
getPConnect,
|
|
17
20
|
label,
|
|
18
21
|
required,
|
|
19
22
|
disabled,
|
|
20
23
|
value = '',
|
|
21
24
|
validatemessage,
|
|
22
25
|
status,
|
|
23
|
-
onChange,
|
|
24
|
-
onBlur,
|
|
25
26
|
readOnly,
|
|
26
27
|
testId,
|
|
27
28
|
helperText,
|
|
@@ -29,9 +30,20 @@ export default function Email(props: EmailProps) {
|
|
|
29
30
|
hideLabel,
|
|
30
31
|
placeholder
|
|
31
32
|
} = props;
|
|
33
|
+
|
|
34
|
+
const pConn = getPConnect();
|
|
35
|
+
const actions = pConn.getActionsApi();
|
|
36
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
37
|
+
|
|
32
38
|
const helperTextToDisplay = validatemessage || helperText;
|
|
33
39
|
|
|
34
|
-
|
|
40
|
+
const [inputValue, setInputValue] = useState('');
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
setInputValue(value);
|
|
44
|
+
}, [value]);
|
|
45
|
+
|
|
46
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
35
47
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
36
48
|
}
|
|
37
49
|
|
|
@@ -43,11 +55,16 @@ export default function Email(props: EmailProps) {
|
|
|
43
55
|
return <TextInput {...props} />;
|
|
44
56
|
}
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
const testProps: any = { 'data-test-id': testId };
|
|
47
59
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
60
|
+
function handleChange(event) {
|
|
61
|
+
// update internal value
|
|
62
|
+
setInputValue(event?.target?.value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function handleBlur() {
|
|
66
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
67
|
+
}
|
|
51
68
|
|
|
52
69
|
return (
|
|
53
70
|
<TextField
|
|
@@ -58,19 +75,21 @@ export default function Email(props: EmailProps) {
|
|
|
58
75
|
size='small'
|
|
59
76
|
required={required}
|
|
60
77
|
disabled={disabled}
|
|
61
|
-
onChange={
|
|
62
|
-
onBlur={!readOnly ?
|
|
78
|
+
onChange={handleChange}
|
|
79
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
63
80
|
error={status === 'error'}
|
|
64
81
|
label={label}
|
|
65
|
-
value={
|
|
82
|
+
value={inputValue}
|
|
66
83
|
type='email'
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
84
|
+
slotProps={{
|
|
85
|
+
input: {
|
|
86
|
+
startAdornment: (
|
|
87
|
+
<InputAdornment position='start'>
|
|
88
|
+
<MailOutlineIcon />
|
|
89
|
+
</InputAdornment>
|
|
90
|
+
),
|
|
91
|
+
inputProps: { ...testProps }
|
|
92
|
+
}
|
|
74
93
|
}}
|
|
75
94
|
/>
|
|
76
95
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ReactElement, useMemo } from 'react';
|
|
2
|
-
import { Grid } from '@material
|
|
1
|
+
import { type ReactElement, useMemo } from 'react';
|
|
2
|
+
import { Grid } from '@mui/material';
|
|
3
3
|
import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
|
|
4
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface GroupProps extends PConnFieldProps {
|
|
7
7
|
children: ReactElement[];
|
|
@@ -15,7 +15,7 @@ interface GroupProps extends PConnFieldProps {
|
|
|
15
15
|
export default function Group(props: GroupProps) {
|
|
16
16
|
const { children, heading, showHeading, instructions, collapsible, displayMode, type } = props;
|
|
17
17
|
|
|
18
|
-
const isReadOnly = displayMode === '
|
|
18
|
+
const isReadOnly = displayMode === 'DISPLAY_ONLY';
|
|
19
19
|
|
|
20
20
|
const content = useMemo(() => {
|
|
21
21
|
return (
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { TextField } from '@mui/material';
|
|
2
3
|
|
|
4
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
3
5
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
7
|
|
|
6
8
|
interface IntegerProps extends PConnFieldProps {
|
|
7
9
|
// If any, enter additional props that only exist on Integer here
|
|
@@ -13,14 +15,13 @@ export default function Integer(props: IntegerProps) {
|
|
|
13
15
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
14
16
|
|
|
15
17
|
const {
|
|
18
|
+
getPConnect,
|
|
16
19
|
label,
|
|
17
20
|
required,
|
|
18
21
|
disabled,
|
|
19
22
|
value = '',
|
|
20
23
|
validatemessage,
|
|
21
24
|
status,
|
|
22
|
-
onChange,
|
|
23
|
-
onBlur,
|
|
24
25
|
readOnly,
|
|
25
26
|
testId,
|
|
26
27
|
helperText,
|
|
@@ -28,11 +29,20 @@ export default function Integer(props: IntegerProps) {
|
|
|
28
29
|
hideLabel,
|
|
29
30
|
placeholder
|
|
30
31
|
} = props;
|
|
32
|
+
|
|
33
|
+
const pConn = getPConnect();
|
|
34
|
+
const actions = pConn.getActionsApi();
|
|
35
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
36
|
+
|
|
31
37
|
const helperTextToDisplay = validatemessage || helperText;
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
const [inputValue, setInputValue] = useState('');
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setInputValue(value);
|
|
43
|
+
}, [value]);
|
|
34
44
|
|
|
35
|
-
if (displayMode === '
|
|
45
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
36
46
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
37
47
|
}
|
|
38
48
|
|
|
@@ -44,11 +54,7 @@ export default function Integer(props: IntegerProps) {
|
|
|
44
54
|
return <TextInput {...props} />;
|
|
45
55
|
}
|
|
46
56
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
testProp = {
|
|
50
|
-
'data-test-id': testId
|
|
51
|
-
};
|
|
57
|
+
const testProps: any = { 'data-test-id': testId };
|
|
52
58
|
|
|
53
59
|
function intOnChange(event) {
|
|
54
60
|
// console.log(`Integer intOnChange inValue: ${event.target.value}`);
|
|
@@ -64,7 +70,11 @@ export default function Integer(props: IntegerProps) {
|
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
// Pass through to the Constellation change handler
|
|
67
|
-
|
|
73
|
+
setInputValue(event.target.value);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function handleBlur() {
|
|
77
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
68
78
|
}
|
|
69
79
|
|
|
70
80
|
return (
|
|
@@ -77,12 +87,14 @@ export default function Integer(props: IntegerProps) {
|
|
|
77
87
|
required={required}
|
|
78
88
|
disabled={disabled}
|
|
79
89
|
onChange={intOnChange}
|
|
80
|
-
onBlur={!readOnly ?
|
|
90
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
81
91
|
error={status === 'error'}
|
|
82
92
|
label={label}
|
|
83
|
-
value={
|
|
93
|
+
value={inputValue}
|
|
84
94
|
type='text'
|
|
85
|
-
|
|
95
|
+
slotProps={{
|
|
96
|
+
htmlInput: { inputMode: 'numeric', pattern: '[0-9]*', ...testProps }
|
|
97
|
+
}}
|
|
86
98
|
/>
|
|
87
99
|
);
|
|
88
100
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { Checkbox, TextField } from '@material-ui/core';
|
|
2
|
-
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
3
|
-
import CheckBoxOutlineBlankIcon from '@material-ui/icons/CheckBoxOutlineBlank';
|
|
4
|
-
import CheckBoxIcon from '@material-ui/icons/CheckBox';
|
|
5
1
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { Autocomplete, TextField } from '@mui/material';
|
|
6
3
|
import { doSearch, getDisplayFieldsMetaData, useDeepMemo, preProcessColumns, getGroupDataForItemsTree } from './utils';
|
|
7
4
|
import { insertInstruction, deleteInstruction } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
|
|
8
5
|
import { debounce } from 'throttle-debounce';
|
|
9
6
|
|
|
10
|
-
const icon = <CheckBoxOutlineBlankIcon fontSize='small' />;
|
|
11
|
-
const checkedIcon = <CheckBoxIcon fontSize='small' />;
|
|
12
|
-
|
|
13
7
|
export default function Multiselect(props) {
|
|
14
8
|
const {
|
|
15
9
|
getPConnect,
|
|
@@ -226,16 +220,16 @@ export default function Multiselect(props) {
|
|
|
226
220
|
fullWidth
|
|
227
221
|
options={itemsTree}
|
|
228
222
|
disableCloseOnSelect
|
|
229
|
-
getOptionSelected={(option: any, val: any) => option?.primary === val?.primary}
|
|
223
|
+
// getOptionSelected={(option: any, val: any) => option?.primary === val?.primary}
|
|
230
224
|
getOptionLabel={(option: any) => option?.primary}
|
|
231
225
|
onChange={handleChange}
|
|
232
226
|
value={selectedItems}
|
|
233
|
-
renderOption={(option: any, { selected }) => (
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
)}
|
|
227
|
+
// renderOption={(_props, option: any, { selected }) => (
|
|
228
|
+
// <>
|
|
229
|
+
// <Checkbox icon={icon} checkedIcon={checkedIcon} style={{ marginRight: 8 }} checked={selected} />
|
|
230
|
+
// {option.primary}
|
|
231
|
+
// </>
|
|
232
|
+
// )}
|
|
239
233
|
renderInput={params => (
|
|
240
234
|
<TextField {...params} variant='outlined' fullWidth label={label} placeholder={placeholder} size='small' onChange={onSearchHandler} />
|
|
241
235
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useRef } from 'react';
|
|
2
2
|
import equal from 'fast-deep-equal';
|
|
3
|
-
import cloneDeep from 'lodash
|
|
3
|
+
import cloneDeep from 'lodash.clonedeep';
|
|
4
4
|
import { updateNewInstuctions, insertInstruction, deleteInstruction } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
|
|
5
5
|
|
|
6
6
|
export const setVisibilityForList = (c11nEnv, visibility) => {
|