@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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import { NumericFormat } from 'react-number-format';
|
|
3
|
-
import {
|
|
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 { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
|
|
7
7
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
8
8
|
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
@@ -50,7 +50,11 @@ export default function Percentage(props: PercentageProps) {
|
|
|
50
50
|
const helperTextToDisplay = validatemessage || helperText;
|
|
51
51
|
|
|
52
52
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
53
|
-
const formattedValue = format(value, pConn.getComponentName()
|
|
53
|
+
const formattedValue = format(value, pConn.getComponentName()?.toLowerCase(), theCurrencyOptions);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
setValues(value.toString());
|
|
57
|
+
}, [value]);
|
|
54
58
|
|
|
55
59
|
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
56
60
|
|
|
@@ -58,7 +62,7 @@ export default function Percentage(props: PercentageProps) {
|
|
|
58
62
|
readOnlyProp = { readOnly: true };
|
|
59
63
|
}
|
|
60
64
|
|
|
61
|
-
if (displayMode === '
|
|
65
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
62
66
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
63
67
|
}
|
|
64
68
|
|
|
@@ -66,11 +70,7 @@ export default function Percentage(props: PercentageProps) {
|
|
|
66
70
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
testProp = {
|
|
72
|
-
'data-test-id': testId
|
|
73
|
-
};
|
|
73
|
+
const testProps: any = { 'data-test-id': testId };
|
|
74
74
|
|
|
75
75
|
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
76
76
|
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
@@ -105,7 +105,7 @@ export default function Percentage(props: PercentageProps) {
|
|
|
105
105
|
thousandSeparator={showGroupSeparators ? theCurrSep : ''}
|
|
106
106
|
decimalScale={decimalPrecision}
|
|
107
107
|
suffix='%'
|
|
108
|
-
|
|
108
|
+
slotProps={{ input: { ...readOnlyProp, inputProps: { ...testProps } } }}
|
|
109
109
|
customInput={TextField}
|
|
110
110
|
/>
|
|
111
111
|
);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
2
1
|
import { useEffect, useState } from 'react';
|
|
2
|
+
import { MuiTelInput } from 'mui-tel-input';
|
|
3
3
|
|
|
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
|
|
|
8
8
|
interface PhoneProps extends PConnFieldProps {
|
|
@@ -45,7 +45,7 @@ export default function Phone(props: PhoneProps) {
|
|
|
45
45
|
'data-test-id': testId
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
if (displayMode === '
|
|
48
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
49
49
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -57,20 +57,23 @@ export default function Phone(props: PhoneProps) {
|
|
|
57
57
|
const disableDropdown = true;
|
|
58
58
|
return (
|
|
59
59
|
<div>
|
|
60
|
-
<
|
|
60
|
+
<MuiTelInput
|
|
61
61
|
fullWidth
|
|
62
62
|
helperText={helperTextToDisplay}
|
|
63
63
|
placeholder={placeholder ?? ''}
|
|
64
64
|
size='small'
|
|
65
|
+
defaultCountry='US'
|
|
65
66
|
required={required}
|
|
66
67
|
disabled={disabled}
|
|
67
68
|
onChange={onChange}
|
|
68
69
|
error={status === 'error'}
|
|
69
70
|
label={label}
|
|
70
71
|
value={value}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
slotProps={{
|
|
73
|
+
input: {
|
|
74
|
+
readOnly: true,
|
|
75
|
+
...testProp
|
|
76
|
+
}
|
|
74
77
|
}}
|
|
75
78
|
disableDropdown={disableDropdown}
|
|
76
79
|
/>
|
|
@@ -90,13 +93,13 @@ export default function Phone(props: PhoneProps) {
|
|
|
90
93
|
};
|
|
91
94
|
|
|
92
95
|
return (
|
|
93
|
-
<
|
|
96
|
+
<MuiTelInput
|
|
94
97
|
fullWidth
|
|
95
98
|
variant='outlined'
|
|
96
99
|
helperText={helperTextToDisplay}
|
|
97
100
|
placeholder={placeholder ?? ''}
|
|
98
101
|
size='small'
|
|
99
|
-
defaultCountry='
|
|
102
|
+
defaultCountry='US'
|
|
100
103
|
required={required}
|
|
101
104
|
disabled={disabled}
|
|
102
105
|
onChange={handleChange}
|
|
@@ -104,7 +107,7 @@ export default function Phone(props: PhoneProps) {
|
|
|
104
107
|
error={status === 'error'}
|
|
105
108
|
label={label}
|
|
106
109
|
value={inputValue}
|
|
107
|
-
|
|
110
|
+
slotProps={{ input: { ...testProp } }}
|
|
108
111
|
/>
|
|
109
112
|
);
|
|
110
113
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@material
|
|
2
|
+
import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@mui/material';
|
|
3
3
|
|
|
4
4
|
import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
5
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
6
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
8
|
|
|
9
9
|
// Can't use RadioButtonProps until getLocaleRuleNameFromKeys is NOT private
|
|
10
10
|
interface RadioButtonsProps extends PConnFieldProps {
|
|
@@ -61,11 +61,10 @@ export default function RadioButtons(props: RadioButtonsProps) {
|
|
|
61
61
|
setSelectedButton(value);
|
|
62
62
|
}, [value]);
|
|
63
63
|
|
|
64
|
-
if (displayMode === '
|
|
64
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
65
65
|
return (
|
|
66
66
|
<FieldValueList
|
|
67
67
|
name={hideLabel ? '' : label}
|
|
68
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
69
68
|
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
70
69
|
/>
|
|
71
70
|
);
|
|
@@ -75,7 +74,6 @@ export default function RadioButtons(props: RadioButtonsProps) {
|
|
|
75
74
|
return (
|
|
76
75
|
<FieldValueList
|
|
77
76
|
name={hideLabel ? '' : label}
|
|
78
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
79
77
|
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
80
78
|
variant='stacked'
|
|
81
79
|
/>
|
|
@@ -91,7 +89,7 @@ export default function RadioButtons(props: RadioButtonsProps) {
|
|
|
91
89
|
};
|
|
92
90
|
|
|
93
91
|
return (
|
|
94
|
-
<FormControl error={status === 'error'} required={required}>
|
|
92
|
+
<FormControl variant='standard' error={status === 'error'} required={required}>
|
|
95
93
|
<FormLabel component='legend'>{label}</FormLabel>
|
|
96
94
|
<RadioGroup value={theSelectedButton} onChange={handleChange} onBlur={!readOnly ? handleBlur : undefined} row={inline}>
|
|
97
95
|
{theOptions.map(theOption => {
|
|
@@ -102,7 +100,6 @@ export default function RadioButtons(props: RadioButtonsProps) {
|
|
|
102
100
|
label={thePConn.getLocalizedValue(
|
|
103
101
|
theOption.value,
|
|
104
102
|
localePath,
|
|
105
|
-
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
106
103
|
thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
|
|
107
104
|
)}
|
|
108
105
|
control={<Radio key={theOption.key} color='primary' disabled={readOnly} />}
|
|
@@ -2,7 +2,7 @@ import { useRef } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
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
|
|
|
7
7
|
interface RichTextProps extends PConnFieldProps {
|
|
8
8
|
// If any, enter additional props that only exist on TextArea here
|
|
@@ -23,7 +23,7 @@ export default function RichText(props: RichTextProps) {
|
|
|
23
23
|
|
|
24
24
|
const helperTextToDisplay = validatemessage || helperText;
|
|
25
25
|
|
|
26
|
-
if (displayMode === '
|
|
26
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
27
27
|
return <FieldValueList name={hideLabel ? '' : label} value={value} isHtml />;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/no-array-index-key */
|
|
2
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
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
4
|
|
|
5
5
|
// ScalarListProps can't extend PConnFieldProps because its 'value' has a different type
|
|
6
6
|
interface ScalarListProps extends PConnProps {
|
|
@@ -36,22 +36,21 @@ export default function ScalarList(props: ScalarListProps) {
|
|
|
36
36
|
{
|
|
37
37
|
type: componentType,
|
|
38
38
|
config: {
|
|
39
|
-
// @ts-ignore - Type '{ readOnly: true; displayInModal: boolean; value: any; displayMode: string; label: string; }' is not assignable to type 'ComponentMetadataConfig'.
|
|
40
39
|
value: scalarValue,
|
|
41
|
-
displayMode: '
|
|
40
|
+
displayMode: 'DISPLAY_ONLY',
|
|
42
41
|
label,
|
|
43
42
|
...restProps,
|
|
44
|
-
// @ts-ignore - Type 'string' is not assignable to type 'boolean | undefined'.
|
|
45
43
|
readOnly: 'true'
|
|
46
44
|
}
|
|
47
45
|
},
|
|
48
46
|
'',
|
|
47
|
+
// @ts-ignore
|
|
49
48
|
'',
|
|
50
49
|
{}
|
|
51
50
|
); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
|
|
52
51
|
});
|
|
53
52
|
|
|
54
|
-
if (['
|
|
53
|
+
if (['STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
|
|
55
54
|
return (
|
|
56
55
|
<div>
|
|
57
56
|
<CommaSeparatedList items={items} />
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Typography from '@material
|
|
2
|
-
import Grid from '@material
|
|
3
|
-
import
|
|
1
|
+
import Typography from '@mui/material/Typography';
|
|
2
|
+
import Grid from '@mui/material/Grid';
|
|
3
|
+
import makeStyles from '@mui/styles/makeStyles';
|
|
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
|
|
|
8
8
|
/* although this is called the SemanticLink component, we are not yet displaying as a
|
|
9
9
|
SemanticLink in SDK and only showing the value as a read only text field. */
|
|
@@ -52,7 +52,7 @@ export default function SemanticLink(props: SemanticLinkProps) {
|
|
|
52
52
|
const { text, displayMode, label, hideLabel } = props;
|
|
53
53
|
const classes = useStyles();
|
|
54
54
|
|
|
55
|
-
if (displayMode === '
|
|
55
|
+
if (displayMode === 'DISPLAY_ONLY' || (!displayMode && label !== undefined)) {
|
|
56
56
|
const value = text || '---';
|
|
57
57
|
return (
|
|
58
58
|
<Grid container spacing={1} style={{ padding: '4px 0px' }} id='semantic-link-grid'>
|
|
@@ -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 TextAreaProps extends PConnFieldProps {
|
|
7
9
|
// If any, enter additional props that only exist on TextArea here
|
|
@@ -13,14 +15,13 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
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
|
fieldMetadata,
|
|
@@ -30,12 +31,20 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
30
31
|
placeholder
|
|
31
32
|
} = props;
|
|
32
33
|
const helperTextToDisplay = validatemessage || helperText;
|
|
33
|
-
|
|
34
|
+
const pConn = getPConnect();
|
|
35
|
+
const actions = pConn.getActionsApi();
|
|
36
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
34
37
|
const maxLength = fieldMetadata?.maxLength;
|
|
35
38
|
|
|
39
|
+
const [inputValue, setInputValue] = useState('');
|
|
40
|
+
|
|
36
41
|
let readOnlyProp = {};
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setInputValue(value);
|
|
45
|
+
}, [value]);
|
|
46
|
+
|
|
47
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
39
48
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
40
49
|
}
|
|
41
50
|
|
|
@@ -49,11 +58,16 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
49
58
|
readOnlyProp = { readOnly: true };
|
|
50
59
|
}
|
|
51
60
|
|
|
52
|
-
|
|
61
|
+
const testProps: any = { 'data-test-id': testId };
|
|
53
62
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
function handleChange(event) {
|
|
64
|
+
// update internal value
|
|
65
|
+
setInputValue(event?.target?.value);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function handleBlur() {
|
|
69
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
70
|
+
}
|
|
57
71
|
|
|
58
72
|
return (
|
|
59
73
|
<TextField
|
|
@@ -67,12 +81,14 @@ export default function TextArea(props: TextAreaProps) {
|
|
|
67
81
|
size='small'
|
|
68
82
|
required={required}
|
|
69
83
|
disabled={disabled}
|
|
70
|
-
onChange={
|
|
71
|
-
onBlur={!readOnly ?
|
|
84
|
+
onChange={handleChange}
|
|
85
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
72
86
|
error={status === 'error'}
|
|
73
87
|
label={label}
|
|
74
|
-
value={
|
|
75
|
-
|
|
88
|
+
value={inputValue}
|
|
89
|
+
slotProps={{
|
|
90
|
+
input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
|
|
91
|
+
}}
|
|
76
92
|
/>
|
|
77
93
|
);
|
|
78
94
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Typography } from '@material
|
|
1
|
+
import { Typography } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
3
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
4
4
|
|
|
5
5
|
interface TextContentProps extends PConnProps {
|
|
6
6
|
// If any, enter additional props that only exist on TextContent here
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useState, useEffect } from 'react';
|
|
2
|
-
import { TextField } from '@material
|
|
2
|
+
import { TextField } from '@mui/material';
|
|
3
3
|
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
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
|
|
|
8
8
|
interface TextInputProps extends PConnFieldProps {
|
|
9
9
|
// If any, enter additional props that only exist on TextInput here
|
|
@@ -47,7 +47,7 @@ export default function TextInput(props: TextInputProps) {
|
|
|
47
47
|
setInputValue(value);
|
|
48
48
|
}, [value]);
|
|
49
49
|
|
|
50
|
-
if (displayMode === '
|
|
50
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
51
51
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -59,11 +59,7 @@ export default function TextInput(props: TextInputProps) {
|
|
|
59
59
|
readOnlyProp = { readOnly: true };
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
testProp = {
|
|
65
|
-
'data-test-id': testId
|
|
66
|
-
};
|
|
62
|
+
const testProps: any = { 'data-test-id': testId };
|
|
67
63
|
|
|
68
64
|
function handleChange(event) {
|
|
69
65
|
// update internal value
|
|
@@ -88,7 +84,9 @@ export default function TextInput(props: TextInputProps) {
|
|
|
88
84
|
error={status === 'error'}
|
|
89
85
|
label={label}
|
|
90
86
|
value={inputValue}
|
|
91
|
-
|
|
87
|
+
slotProps={{
|
|
88
|
+
input: { ...readOnlyProp, inputProps: { maxLength, ...testProps } }
|
|
89
|
+
}}
|
|
92
90
|
/>
|
|
93
91
|
);
|
|
94
92
|
}
|
package/lib/field/Time/Time.tsx
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import AccessTimeIcon from '@
|
|
1
|
+
import { TimePicker } from '@mui/x-date-pickers/TimePicker';
|
|
2
|
+
// import AccessTimeIcon from '@mui/icons-material/AccessTime';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
4
|
|
|
5
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
6
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
+
import type { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
8
|
|
|
8
9
|
interface TimeProps extends PConnFieldProps {
|
|
9
10
|
// If any, enter additional props that only exist on Time here
|
|
@@ -14,10 +15,12 @@ export default function Time(props: TimeProps) {
|
|
|
14
15
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
15
16
|
const TextInput = getComponentFromMap('TextInput');
|
|
16
17
|
|
|
17
|
-
const { label, required, disabled, value = '', validatemessage, status,
|
|
18
|
+
const { getPConnect, label, required, disabled, value = '', validatemessage, status, readOnly, helperText, displayMode, hideLabel, testId } = props;
|
|
18
19
|
const helperTextToDisplay = validatemessage || helperText;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const pConn = getPConnect();
|
|
21
|
+
const actions = pConn.getActionsApi();
|
|
22
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
23
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
21
24
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
22
25
|
}
|
|
23
26
|
|
|
@@ -29,19 +32,15 @@ export default function Time(props: TimeProps) {
|
|
|
29
32
|
return <TextInput {...props} />;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
testProp = {
|
|
35
|
-
'data-test-id': testId
|
|
36
|
-
};
|
|
35
|
+
const testProps: any = { 'data-test-id': testId };
|
|
37
36
|
|
|
38
37
|
const handleChange = date => {
|
|
39
|
-
const theValue = date && date.isValid() ? date.format('HH:mm') : null;
|
|
40
|
-
|
|
38
|
+
const theValue = date && date.isValid() ? date.format('HH:mm:ss') : null;
|
|
39
|
+
handleEvent(actions, 'changeNblur', propName, theValue);
|
|
41
40
|
};
|
|
42
41
|
|
|
43
42
|
let timeValue: any = null;
|
|
44
|
-
if (value) {
|
|
43
|
+
if (value && Object.keys(value).length) {
|
|
45
44
|
const timeArray = value.split(':').map(itm => Number(itm));
|
|
46
45
|
timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);
|
|
47
46
|
}
|
|
@@ -52,25 +51,29 @@ export default function Time(props: TimeProps) {
|
|
|
52
51
|
//
|
|
53
52
|
|
|
54
53
|
return (
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
keyboardIcon={<AccessTimeIcon />}
|
|
60
|
-
fullWidth
|
|
61
|
-
required={required}
|
|
54
|
+
<TimePicker
|
|
55
|
+
// keyboardIcon={<AccessTimeIcon />}
|
|
56
|
+
// fullWidth
|
|
57
|
+
|
|
62
58
|
disabled={disabled}
|
|
63
|
-
error={status === 'error'}
|
|
64
|
-
helperText={helperTextToDisplay}
|
|
65
59
|
minutesStep={5}
|
|
66
|
-
size='small'
|
|
67
60
|
label={label}
|
|
68
|
-
autoOk
|
|
69
|
-
mask='__:__ _m'
|
|
61
|
+
// autoOk
|
|
62
|
+
// mask='__:__ _m'
|
|
70
63
|
format='hh:mm a'
|
|
71
64
|
value={timeValue}
|
|
72
65
|
onChange={handleChange}
|
|
73
|
-
|
|
66
|
+
slotProps={{
|
|
67
|
+
textField: {
|
|
68
|
+
variant: 'outlined',
|
|
69
|
+
placeholder: 'hh:mm am',
|
|
70
|
+
required,
|
|
71
|
+
error: status === 'error',
|
|
72
|
+
helperText: helperTextToDisplay,
|
|
73
|
+
size: 'small',
|
|
74
|
+
InputProps: { ...testProps }
|
|
75
|
+
}
|
|
76
|
+
}}
|
|
74
77
|
/>
|
|
75
78
|
);
|
|
76
79
|
}
|
package/lib/field/URL/URL.tsx
CHANGED
|
@@ -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 URLComponentProps extends PConnFieldProps {
|
|
7
9
|
// If any, enter additional props that only exist on URLComponent here
|
|
@@ -16,14 +18,13 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
16
18
|
const TextInput = getComponentFromMap('TextInput');
|
|
17
19
|
|
|
18
20
|
const {
|
|
21
|
+
getPConnect,
|
|
19
22
|
label,
|
|
20
23
|
required,
|
|
21
24
|
disabled,
|
|
22
25
|
value = '',
|
|
23
26
|
validatemessage,
|
|
24
27
|
status,
|
|
25
|
-
onChange,
|
|
26
|
-
onBlur,
|
|
27
28
|
readOnly,
|
|
28
29
|
testId,
|
|
29
30
|
helperText,
|
|
@@ -33,7 +34,17 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
33
34
|
} = props;
|
|
34
35
|
const helperTextToDisplay = validatemessage || helperText;
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
const [inputValue, setInputValue] = useState('');
|
|
38
|
+
|
|
39
|
+
const pConn = getPConnect();
|
|
40
|
+
const actions = pConn.getActionsApi();
|
|
41
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setInputValue(value);
|
|
45
|
+
}, [value]);
|
|
46
|
+
|
|
47
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
37
48
|
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
38
49
|
}
|
|
39
50
|
|
|
@@ -45,12 +56,16 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
45
56
|
return <TextInput {...props} />;
|
|
46
57
|
}
|
|
47
58
|
|
|
48
|
-
|
|
59
|
+
const testProps: any = { 'data-test-id': testId };
|
|
49
60
|
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
const handleChange = event => {
|
|
62
|
+
setInputValue(event?.target?.value);
|
|
52
63
|
};
|
|
53
64
|
|
|
65
|
+
function handleBlur() {
|
|
66
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
67
|
+
}
|
|
68
|
+
|
|
54
69
|
return (
|
|
55
70
|
<TextField
|
|
56
71
|
type='url'
|
|
@@ -61,12 +76,14 @@ export default function URLComponent(props: URLComponentProps) {
|
|
|
61
76
|
size='small'
|
|
62
77
|
required={required}
|
|
63
78
|
disabled={disabled}
|
|
64
|
-
onChange={
|
|
65
|
-
onBlur={!readOnly ?
|
|
79
|
+
onChange={handleChange}
|
|
80
|
+
onBlur={!readOnly ? handleBlur : undefined}
|
|
66
81
|
error={status === 'error'}
|
|
67
82
|
label={label}
|
|
68
|
-
value={
|
|
69
|
-
|
|
83
|
+
value={inputValue}
|
|
84
|
+
slotProps={{
|
|
85
|
+
input: { inputProps: { ...testProps } }
|
|
86
|
+
}}
|
|
70
87
|
/>
|
|
71
88
|
);
|
|
72
89
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { memo, useEffect, useState } from 'react';
|
|
2
|
-
import { Typography } from '@material
|
|
2
|
+
import { Typography } from '@mui/material';
|
|
3
3
|
|
|
4
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
5
|
-
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
6
6
|
|
|
7
7
|
import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldValueList';
|
|
8
8
|
import { getUserId, isUserNameAvailable } from './UserReferenceUtils';
|
|
@@ -80,10 +80,8 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
PCore.getRestClient()
|
|
83
|
-
// @ts-ignore - Argument of type '{ queryPayload: { dataViewName: string; }; }' is not assignable to parameter of type 'RestApiOptionsObject'
|
|
84
|
-
// @ts-ignore - Expected 3 arguments, but got 2
|
|
85
83
|
.invokeRestApi('getListData', { queryPayload })
|
|
86
|
-
.then(
|
|
84
|
+
.then(res => {
|
|
87
85
|
const ddDataSource = res.data.data.map(listItem => ({
|
|
88
86
|
key: listItem.pyUserIdentifier,
|
|
89
87
|
value: listItem.pyUserName
|
|
@@ -99,7 +97,7 @@ const UserReference = (props: UserReferenceProps) => {
|
|
|
99
97
|
|
|
100
98
|
let userReferenceComponent: any = null;
|
|
101
99
|
|
|
102
|
-
if (displayMode === '
|
|
100
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
103
101
|
return <FieldValueList name={hideLabel ? '' : label} value={userName || ''} />;
|
|
104
102
|
}
|
|
105
103
|
|
|
@@ -1,4 +1,27 @@
|
|
|
1
|
-
/* eslint-disable import/prefer-default-export */
|
|
2
1
|
export function isEmptyObject(obj: Object): boolean {
|
|
3
2
|
return Object.keys(obj).length === 0;
|
|
4
3
|
}
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Get a localized value from the Generic Fields
|
|
7
|
+
* @param path - The path within Generic Fields (e.g., 'CosmosFields.fields.lists')
|
|
8
|
+
* @param key - The key of the string to localize
|
|
9
|
+
* @returns The localized string or the key itself if no translation is found
|
|
10
|
+
*/
|
|
11
|
+
export function getGenericFieldsLocalizedValue(path: string, key: string): string {
|
|
12
|
+
const GENERIC_BUNDLE_KEY = PCore.getLocaleUtils().GENERIC_BUNDLE_KEY;
|
|
13
|
+
const localeStore = PCore.getLocaleUtils().localeStore[GENERIC_BUNDLE_KEY];
|
|
14
|
+
|
|
15
|
+
if (!localeStore) return key;
|
|
16
|
+
|
|
17
|
+
// Split the path and traverse the object
|
|
18
|
+
const pathParts = path.split('.');
|
|
19
|
+
let currentObj = localeStore;
|
|
20
|
+
|
|
21
|
+
for (const part of pathParts) {
|
|
22
|
+
if (!currentObj[part]) return key;
|
|
23
|
+
currentObj = currentObj[part];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return currentObj[key] || key;
|
|
27
|
+
}
|