@pega/react-sdk-overrides 0.23.25 → 0.23.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +17 -0
- package/SECURITY.md +10 -0
- package/lib/designSystemExtension/AlertBanner/AlertBanner.tsx +39 -0
- package/lib/designSystemExtension/AlertBanner/index.tsx +1 -0
- package/lib/designSystemExtension/Banner/Banner.css +4 -0
- package/lib/designSystemExtension/Banner/Banner.tsx +33 -16
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +36 -26
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +21 -28
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +50 -18
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +13 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +18 -27
- package/lib/designSystemExtension/Operator/Operator.tsx +106 -87
- package/lib/designSystemExtension/Pulse/Pulse.tsx +21 -19
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +122 -0
- package/lib/designSystemExtension/RichTextEditor/index.tsx +1 -0
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.css +6 -2
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +21 -12
- package/lib/field/AutoComplete/AutoComplete.tsx +33 -16
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +21 -15
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +29 -19
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +27 -38
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +10 -18
- package/lib/field/Date/Date.tsx +33 -15
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +22 -11
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +64 -17
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +154 -18
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +16 -7
- package/lib/field/Email/config-ext.json +1 -2
- package/lib/field/Email/index.tsx +1 -1
- package/lib/field/Group/Group.tsx +37 -0
- package/lib/field/Group/config-ext.json +7 -0
- package/lib/field/Group/index.tsx +1 -0
- package/lib/field/Integer/Integer.tsx +15 -6
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/Percentage/Percentage.tsx +14 -6
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +17 -7
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +55 -24
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +96 -0
- package/lib/field/RichText/index.tsx +1 -0
- package/lib/field/ScalarList/ScalarList.tsx +63 -0
- package/lib/field/ScalarList/config-ext.json +7 -0
- package/lib/field/ScalarList/index.tsx +1 -0
- package/lib/field/SemanticLink/SemanticLink.tsx +26 -25
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -10
- package/lib/field/TextArea/TextArea.tsx +15 -5
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +9 -2
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +41 -10
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +21 -18
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +23 -6
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +52 -58
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/{attachmentHelpers.js → attachmentHelpers.ts} +16 -11
- package/lib/helpers/case-utils.tsx +99 -0
- package/lib/helpers/common-utils.ts +8 -0
- package/lib/helpers/data_page.ts +3 -6
- package/lib/helpers/date-format-utils.ts +29 -19
- package/lib/helpers/{event-utils.js → event-utils.ts} +4 -4
- package/lib/helpers/{field-group-utils.js → field-group-utils.ts} +9 -10
- package/lib/helpers/formatters/Boolean.ts +21 -0
- package/lib/helpers/formatters/{Currency.js → Currency.ts} +22 -27
- package/lib/helpers/formatters/CurrencyMap.ts +915 -0
- package/lib/helpers/formatters/{Date.js → Date.ts} +20 -26
- package/lib/helpers/formatters/{common.js → common.ts} +3 -4
- package/lib/helpers/formatters/{index.js → index.ts} +22 -22
- package/lib/helpers/{reactContextHelpers.js → reactContextHelpers.ts} +2 -2
- package/lib/helpers/simpleTableHelpers.ts +65 -85
- package/lib/helpers/state-utils.tsx +43 -0
- package/lib/helpers/template-utils.ts +4 -8
- package/lib/helpers/utils.ts +16 -8
- package/lib/helpers/versionHelpers.ts +1 -5
- package/lib/infra/ActionButtons/ActionButtons.tsx +46 -42
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -84
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -26
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +98 -232
- package/lib/infra/Containers/FlowContainer/helpers.ts +138 -0
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +66 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +105 -70
- package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -1
- package/lib/infra/Containers/SimpleView/SimpleView.tsx +48 -0
- package/lib/infra/Containers/SimpleView/helper.ts +125 -0
- package/lib/infra/Containers/SimpleView/index.tsx +1 -0
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +49 -64
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +26 -51
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -40
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -31
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +25 -38
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +180 -216
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +28 -43
- package/lib/infra/Reference/Reference.tsx +16 -22
- package/lib/infra/Region/Region.tsx +9 -9
- package/lib/infra/RootContainer/RootContainer.tsx +82 -125
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +38 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +17 -10
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +29 -36
- package/lib/infra/View/View.tsx +34 -65
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +51 -69
- package/lib/template/BannerPage/BannerPage.tsx +26 -33
- package/lib/template/CaseSummary/CaseSummary.tsx +23 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +122 -114
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +46 -35
- package/lib/template/Confirmation/Confirmation.tsx +25 -53
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +112 -140
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +26 -20
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/DefaultForm/utils/index.ts +33 -0
- package/lib/template/Details/Details/Details.tsx +24 -28
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +15 -22
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +25 -29
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +25 -29
- package/lib/template/Details/DetailsTwoColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/index.tsx +1 -1
- package/lib/template/Details/DynamicTabs/DynamicTabs.tsx +79 -0
- package/lib/template/Details/DynamicTabs/config.json +36 -0
- package/lib/template/Details/DynamicTabs/index.tsx +1 -0
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +24 -34
- package/lib/template/InlineDashboard/InlineDashboard.tsx +16 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +19 -21
- package/lib/template/ListPage/ListPage.tsx +12 -16
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/{DefaultViewMeta.js → DefaultViewMeta.ts} +1 -3
- package/lib/template/ListView/ListView.tsx +245 -306
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/{hooks.js → hooks.ts} +24 -24
- package/lib/template/ListView/{utils.js → utils.ts} +202 -91
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +25 -30
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +31 -29
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +27 -31
- package/lib/template/NarrowWide/NarrowWideDetails/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.css +0 -2
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +17 -19
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +16 -26
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +9 -16
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +8 -14
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +44 -34
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +115 -14
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +171 -100
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +34 -40
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +45 -48
- package/lib/template/SubTabs/SubTabs.tsx +26 -45
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -7
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +33 -36
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +9 -16
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +33 -33
- package/lib/template/TwoColumn/TwoColumnTab/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.css +0 -2
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +29 -27
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +39 -33
- package/lib/template/WideNarrow/WideNarrowDetails/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.css +0 -2
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +16 -18
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +15 -25
- package/lib/template/WideNarrow/WideNarrowPage/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/index.tsx +1 -1
- package/lib/template/WssNavBar/WssNavBar.tsx +33 -17
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +34 -41
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +75 -4
- package/lib/widget/Attachment/Attachment.tsx +370 -388
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +67 -67
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +19 -9
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +324 -246
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +27 -25
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +24 -16
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +62 -54
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +15 -4
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +80 -116
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -483
- package/lib/helpers/authManager.js +0 -631
- package/lib/helpers/config_access.js +0 -268
- package/lib/helpers/formatters/Boolean.js +0 -38
- package/lib/helpers/formatters/CurrencyMap.js +0 -908
- package/lib/infra/Containers/FlowContainer/helpers.js +0 -147
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Editor } from '@tinymce/tinymce-react';
|
|
3
|
+
import { FormControl, FormHelperText, InputLabel, makeStyles } from '@material-ui/core';
|
|
4
|
+
|
|
5
|
+
import { useAfterInitialEffect, useConsolidatedRef, useUID } from '@pega/react-sdk-components/lib/hooks';
|
|
6
|
+
|
|
7
|
+
const useStyles = makeStyles(theme => ({
|
|
8
|
+
fieldLabel: {
|
|
9
|
+
position: 'relative',
|
|
10
|
+
transform: 'translate(0, 0px) scale(1)',
|
|
11
|
+
marginBottom: '5px',
|
|
12
|
+
color: theme.palette.text.secondary
|
|
13
|
+
}
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
interface RichTextEditorProps {
|
|
17
|
+
id?: string;
|
|
18
|
+
defaultValue: string;
|
|
19
|
+
label: string;
|
|
20
|
+
labelHidden: boolean;
|
|
21
|
+
info: string;
|
|
22
|
+
testId: string;
|
|
23
|
+
placeholder: string;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
required: boolean;
|
|
26
|
+
readOnly: boolean;
|
|
27
|
+
error: boolean;
|
|
28
|
+
onBlur: React.EventHandler<any>;
|
|
29
|
+
onChange: React.EventHandler<any>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const RichTextEditor = forwardRef(function RichTextEditor(props: RichTextEditorProps, ref) {
|
|
33
|
+
const classes = useStyles();
|
|
34
|
+
const uid = useUID();
|
|
35
|
+
const { id = uid, defaultValue, label, labelHidden, info, testId, placeholder, disabled, required, readOnly, error, onBlur, onChange } = props;
|
|
36
|
+
|
|
37
|
+
const editorRef: any = useConsolidatedRef(ref);
|
|
38
|
+
let richTextComponent: any = null;
|
|
39
|
+
|
|
40
|
+
useAfterInitialEffect(() => {
|
|
41
|
+
editorRef?.current.mode.set(readOnly || disabled ? 'readonly' : 'design');
|
|
42
|
+
}, [readOnly, disabled]);
|
|
43
|
+
|
|
44
|
+
const filePickerCallback = cb => {
|
|
45
|
+
const input = document.createElement('input');
|
|
46
|
+
input.setAttribute('type', 'file');
|
|
47
|
+
input.setAttribute('accept', 'image/*');
|
|
48
|
+
|
|
49
|
+
input.addEventListener('change', (e: any) => {
|
|
50
|
+
const file = e.target.files[0];
|
|
51
|
+
|
|
52
|
+
const reader: any = new FileReader();
|
|
53
|
+
reader.addEventListener('load', () => {
|
|
54
|
+
/*
|
|
55
|
+
Note: Now we need to register the blob in TinyMCEs image blob
|
|
56
|
+
registry. In the next release this part hopefully won't be
|
|
57
|
+
necessary, as we are looking to handle it internally.
|
|
58
|
+
*/
|
|
59
|
+
const blobId = `blobid${new Date().getTime()}`;
|
|
60
|
+
const blobCache = editorRef.current.editorUpload.blobCache;
|
|
61
|
+
const base64 = reader.result.split(',')[1];
|
|
62
|
+
const blobInfo = blobCache.create(blobId, file, base64);
|
|
63
|
+
blobCache.add(blobInfo);
|
|
64
|
+
|
|
65
|
+
/* call the callback and populate the Title field with the file name */
|
|
66
|
+
cb(blobInfo.blobUri(), { title: file.name });
|
|
67
|
+
});
|
|
68
|
+
reader.readAsDataURL(file);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
input.click();
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
if (readOnly) {
|
|
75
|
+
const value = defaultValue || '--';
|
|
76
|
+
// eslint-disable-next-line react/no-danger
|
|
77
|
+
richTextComponent = <div key={id} id={id} className='readonly-richtext-editor' dangerouslySetInnerHTML={{ __html: value }} />;
|
|
78
|
+
} else {
|
|
79
|
+
richTextComponent = (
|
|
80
|
+
<Editor
|
|
81
|
+
tinymceScriptSrc='tinymce/tinymce.min.js'
|
|
82
|
+
onInit={(_evt, editor) => {
|
|
83
|
+
editorRef.current = editor;
|
|
84
|
+
}}
|
|
85
|
+
id={id}
|
|
86
|
+
initialValue={defaultValue}
|
|
87
|
+
disabled={disabled}
|
|
88
|
+
init={{
|
|
89
|
+
placeholder,
|
|
90
|
+
menubar: false,
|
|
91
|
+
statusbar: false,
|
|
92
|
+
min_height: 130,
|
|
93
|
+
plugins: ['lists', 'advlist', 'autolink', 'image', 'link', 'autoresize'],
|
|
94
|
+
autoresize_bottom_margin: 0,
|
|
95
|
+
toolbar: disabled ? false : 'blocks | bold italic strikethrough | bullist numlist outdent indent | link image',
|
|
96
|
+
toolbar_location: 'bottom',
|
|
97
|
+
content_style: 'body { font-family:Helvetica, Arial,sans-serif; font-size:14px }',
|
|
98
|
+
branding: false,
|
|
99
|
+
paste_data_images: true,
|
|
100
|
+
file_picker_types: 'image',
|
|
101
|
+
file_picker_callback: filePickerCallback
|
|
102
|
+
}}
|
|
103
|
+
onBlur={onBlur}
|
|
104
|
+
onEditorChange={onChange}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<FormControl data-test-id={testId} error={error} required={required}>
|
|
111
|
+
{!labelHidden && (
|
|
112
|
+
<InputLabel id='demo-simple-select-error-label' className={classes.fieldLabel}>
|
|
113
|
+
{label}
|
|
114
|
+
</InputLabel>
|
|
115
|
+
)}
|
|
116
|
+
{richTextComponent}
|
|
117
|
+
{info && <FormHelperText>{info}</FormHelperText>}
|
|
118
|
+
</FormControl>
|
|
119
|
+
);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export default RichTextEditor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './RichTextEditor';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.quick-link-ul-list {
|
|
2
2
|
list-style: none;
|
|
3
3
|
padding: 0;
|
|
4
|
-
grid-template-columns: repeat(
|
|
4
|
+
grid-template-columns: repeat(auto-fill, minmax(min(40ch, 100%), 1fr));
|
|
5
5
|
display: grid;
|
|
6
6
|
gap: calc(1rem);
|
|
7
7
|
}
|
|
@@ -33,4 +33,8 @@
|
|
|
33
33
|
display: flex;
|
|
34
34
|
align-items: center;
|
|
35
35
|
gap: 0.5rem;
|
|
36
|
-
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.quick-link-heading {
|
|
39
|
+
margin-top: 8px;
|
|
40
|
+
}
|
|
@@ -1,25 +1,34 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Button } from '@material-ui/core';
|
|
3
2
|
import './WssQuickCreate.css';
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
// WssQuickCreate is one of the few components that does NOT have getPConnect.
|
|
5
|
+
// So, no need to extend PConnProps
|
|
6
|
+
interface WssQuickCreateProps {
|
|
7
|
+
// If any, enter additional props that only exist on this component
|
|
8
|
+
heading: string;
|
|
9
|
+
actions?: any[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default function WssQuickCreate(props: WssQuickCreateProps) {
|
|
6
13
|
const { heading, actions } = props;
|
|
7
14
|
|
|
8
15
|
return (
|
|
9
16
|
<div>
|
|
10
|
-
<h1
|
|
11
|
-
|
|
17
|
+
<h1 id='quick-links-heading' className='quick-link-heading'>
|
|
18
|
+
{heading}
|
|
19
|
+
</h1>
|
|
20
|
+
<ul id='quick-links' className='quick-link-ul-list'>
|
|
12
21
|
{actions &&
|
|
13
22
|
actions.map(element => {
|
|
14
23
|
return (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
<li className='quick-link-list' key={element.label}>
|
|
25
|
+
<Button className='quick-link-button' onClick={element.onClick}>
|
|
26
|
+
<span className='quick-link-button-span'>
|
|
27
|
+
{element.icon && <img className='quick-link-icon' src={element.icon} />}
|
|
28
|
+
<span>{element.label}</span>
|
|
29
|
+
</span>
|
|
30
|
+
</Button>
|
|
31
|
+
</li>
|
|
23
32
|
);
|
|
24
33
|
})}
|
|
25
34
|
</ul>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
2
|
import { TextField } from '@material-ui/core';
|
|
3
3
|
import Autocomplete from '@material-ui/lab/Autocomplete';
|
|
4
|
-
import Utils from '@pega/react-sdk-components/lib/components/helpers/utils';
|
|
5
|
-
import TextInput from '@pega/react-sdk-components/lib/components/field/TextInput';
|
|
6
4
|
import isDeepEqual from 'fast-deep-equal/react';
|
|
5
|
+
|
|
6
|
+
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
|
-
import
|
|
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
11
|
|
|
11
12
|
interface IOption {
|
|
12
13
|
key: string;
|
|
@@ -36,7 +37,25 @@ const getDisplayFieldsMetaData = columnList => {
|
|
|
36
37
|
return metaDataObj;
|
|
37
38
|
};
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
interface AutoCompleteProps extends PConnFieldProps {
|
|
41
|
+
// If any, enter additional props that only exist on AutoComplete here'
|
|
42
|
+
displayMode?: string;
|
|
43
|
+
deferDatasource?: boolean;
|
|
44
|
+
datasourceMetadata?: any;
|
|
45
|
+
status?: string;
|
|
46
|
+
onRecordChange?: any;
|
|
47
|
+
additionalProps?: object;
|
|
48
|
+
listType: string;
|
|
49
|
+
parameters?: any;
|
|
50
|
+
datasource: any;
|
|
51
|
+
columns: any[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default function AutoComplete(props: AutoCompleteProps) {
|
|
55
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
56
|
+
const TextInput = getComponentFromMap('TextInput');
|
|
57
|
+
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
58
|
+
|
|
40
59
|
const {
|
|
41
60
|
getPConnect,
|
|
42
61
|
label,
|
|
@@ -54,17 +73,18 @@ export default function AutoComplete(props) {
|
|
|
54
73
|
hideLabel,
|
|
55
74
|
onRecordChange
|
|
56
75
|
} = props;
|
|
76
|
+
|
|
57
77
|
const context = getPConnect().getContextName();
|
|
58
78
|
let { listType, parameters, datasource = [], columns = [] } = props;
|
|
59
79
|
const [inputValue, setInputValue] = useState('');
|
|
60
|
-
const [options, setOptions] = useState<
|
|
80
|
+
const [options, setOptions] = useState<IOption[]>([]);
|
|
61
81
|
const [theDatasource, setDatasource] = useState(null);
|
|
62
82
|
let selectedValue: any = '';
|
|
63
83
|
const helperTextToDisplay = validatemessage || helperText;
|
|
64
84
|
|
|
65
85
|
const thePConn = getPConnect();
|
|
66
86
|
const actionsApi = thePConn.getActionsApi();
|
|
67
|
-
const propName = thePConn.getStateProps().value;
|
|
87
|
+
const propName = (thePConn.getStateProps() as any).value;
|
|
68
88
|
|
|
69
89
|
if (!isDeepEqual(datasource, theDatasource)) {
|
|
70
90
|
// inbound datasource is different, so update theDatasource (to trigger useEffect)
|
|
@@ -86,13 +106,10 @@ export default function AutoComplete(props) {
|
|
|
86
106
|
if (deferDatasource && datasourceMetadata?.datasource?.name) {
|
|
87
107
|
listType = 'datapage';
|
|
88
108
|
datasource = datasourceMetadata.datasource.name;
|
|
89
|
-
parameters =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const valueProp = datasourceMetadata.datasource.propertyForValue.startsWith('@P')
|
|
94
|
-
? datasourceMetadata.datasource.propertyForValue.substring(3)
|
|
95
|
-
: datasourceMetadata.datasource.propertyForValue;
|
|
109
|
+
const { parameters: dataSourceParameters, propertyForDisplayText, propertyForValue } = datasourceMetadata.datasource;
|
|
110
|
+
parameters = flattenParameters(dataSourceParameters);
|
|
111
|
+
const displayProp = propertyForDisplayText.startsWith('@P') ? propertyForDisplayText.substring(3) : propertyForDisplayText;
|
|
112
|
+
const valueProp = propertyForValue.startsWith('@P') ? propertyForValue.substring(3) : propertyForValue;
|
|
96
113
|
columns = [
|
|
97
114
|
{
|
|
98
115
|
key: 'true',
|
|
@@ -111,14 +128,14 @@ export default function AutoComplete(props) {
|
|
|
111
128
|
|
|
112
129
|
useEffect(() => {
|
|
113
130
|
if (listType === 'associated') {
|
|
114
|
-
setOptions(Utils.getOptionList(props, getPConnect().getDataObject()));
|
|
131
|
+
setOptions(Utils.getOptionList(props, getPConnect().getDataObject('')));
|
|
115
132
|
}
|
|
116
133
|
}, [theDatasource]);
|
|
117
134
|
|
|
118
135
|
useEffect(() => {
|
|
119
136
|
if (!displayMode && listType !== 'associated') {
|
|
120
137
|
getDataPage(datasource, parameters, context).then((results: any) => {
|
|
121
|
-
const optionsData:
|
|
138
|
+
const optionsData: any[] = [];
|
|
122
139
|
const displayColumn = getDisplayFieldsMetaData(columns);
|
|
123
140
|
results?.forEach(element => {
|
|
124
141
|
const val = element[displayColumn.primary]?.toString();
|
|
@@ -2,11 +2,16 @@ import React, { useState } from 'react';
|
|
|
2
2
|
import { Button, Grid, IconButton, Snackbar } from '@material-ui/core';
|
|
3
3
|
import CloseIcon from '@material-ui/icons/Close';
|
|
4
4
|
|
|
5
|
+
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
6
|
import './CancelAlert.css';
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
interface CancelAlertProps extends PConnFieldProps {
|
|
9
|
+
// If any, enter additional props that only exist on CancelAlert here
|
|
10
|
+
pConn: any;
|
|
11
|
+
updateAlertState: any;
|
|
12
|
+
}
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
export default function CancelAlert(props: CancelAlertProps) {
|
|
10
15
|
const { pConn, updateAlertState } = props;
|
|
11
16
|
const [showSnackbar, setShowSnackbar] = useState(false);
|
|
12
17
|
const [snackbarMessage, setSnackbarMessage] = useState('');
|
|
@@ -15,6 +20,8 @@ const CancelAlert = props => {
|
|
|
15
20
|
const caseInfo = pConn.getCaseInfo();
|
|
16
21
|
const caseName = caseInfo.getName();
|
|
17
22
|
const ID = caseInfo.getID();
|
|
23
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
24
|
+
const localeCategory = 'ModalContainer';
|
|
18
25
|
|
|
19
26
|
function showToast(message: string) {
|
|
20
27
|
setSnackbarMessage(message);
|
|
@@ -48,12 +55,11 @@ const CancelAlert = props => {
|
|
|
48
55
|
.then(() => {
|
|
49
56
|
dismissModal();
|
|
50
57
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
58
|
+
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
59
|
+
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.CASE_EVENTS.CASE_CREATED);
|
|
54
60
|
})
|
|
55
61
|
.catch(() => {
|
|
56
|
-
showToast('Save failed');
|
|
62
|
+
showToast(localizedVal('Save failed', localeCategory));
|
|
57
63
|
});
|
|
58
64
|
break;
|
|
59
65
|
|
|
@@ -68,10 +74,12 @@ const CancelAlert = props => {
|
|
|
68
74
|
deletePromise
|
|
69
75
|
.then(() => {
|
|
70
76
|
dismissModal();
|
|
77
|
+
|
|
78
|
+
// @ts-ignore - second parameter “payload” for publish method should be optional
|
|
71
79
|
PCore.getPubSubUtils().publish(PCore.getConstants().PUB_SUB_EVENTS.EVENT_CANCEL);
|
|
72
80
|
})
|
|
73
81
|
.catch(() => {
|
|
74
|
-
showToast('Delete failed.');
|
|
82
|
+
showToast(localizedVal('Delete failed.', localeCategory));
|
|
75
83
|
});
|
|
76
84
|
break;
|
|
77
85
|
|
|
@@ -86,22 +94,22 @@ const CancelAlert = props => {
|
|
|
86
94
|
<div className='cancel-alert-top'>
|
|
87
95
|
<h3>{`Delete ${caseName}(${ID})`}</h3>
|
|
88
96
|
<div>
|
|
89
|
-
<p>{
|
|
90
|
-
<p>Alternatively, you can continue working or save your work for later
|
|
97
|
+
<p>{`${localizedVal('Are you sure you want to delete', localeCategory)} ${caseName} (${ID})?`}</p>
|
|
98
|
+
<p>{localizedVal('Alternatively, you can continue working or save your work for later.', localeCategory)}</p>
|
|
91
99
|
</div>
|
|
92
100
|
<div className='action-controls'>
|
|
93
101
|
<Grid container spacing={4} justifyContent='space-between'>
|
|
94
102
|
<Grid item>
|
|
95
103
|
<Button variant='outlined' color='primary' onClick={() => buttonClick('save')}>
|
|
96
|
-
Save for later
|
|
104
|
+
{localizedVal('Save for later', localeCategory)}
|
|
97
105
|
</Button>
|
|
98
106
|
</Grid>
|
|
99
107
|
<Grid item>
|
|
100
108
|
<Button variant='outlined' color='primary' onClick={() => buttonClick('continue')}>
|
|
101
|
-
Continue Working
|
|
109
|
+
{localizedVal('Continue Working', localeCategory)}
|
|
102
110
|
</Button>
|
|
103
111
|
<Button variant='contained' color='primary' onClick={() => buttonClick('delete')}>
|
|
104
|
-
Delete
|
|
112
|
+
{localizedVal('Delete', localeCategory)}
|
|
105
113
|
</Button>
|
|
106
114
|
</Grid>
|
|
107
115
|
</Grid>
|
|
@@ -121,6 +129,4 @@ const CancelAlert = props => {
|
|
|
121
129
|
/>
|
|
122
130
|
</>
|
|
123
131
|
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export default CancelAlert;
|
|
132
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './CancelAlert';
|
|
1
|
+
export { default } from './CancelAlert';
|
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
FormControl,
|
|
5
|
-
FormControlLabel,
|
|
6
|
-
FormGroup,
|
|
7
|
-
FormHelperText
|
|
8
|
-
} from '@material-ui/core';
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { Checkbox, FormControl, FormControlLabel, FormGroup, FormHelperText } from '@material-ui/core';
|
|
3
|
+
|
|
9
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
10
|
-
import
|
|
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';
|
|
7
|
+
|
|
8
|
+
interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
9
|
+
// If any, enter additional props that only exist on Checkbox here
|
|
10
|
+
value?: boolean;
|
|
11
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
12
|
+
caption?: string;
|
|
13
|
+
trueLabel?: string;
|
|
14
|
+
falseLabel?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default function CheckboxComponent(props: CheckboxProps) {
|
|
18
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
19
|
+
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
11
20
|
|
|
12
|
-
export default function CheckboxComponent(props) {
|
|
13
21
|
const {
|
|
14
22
|
getPConnect,
|
|
15
|
-
label,
|
|
16
23
|
value = false,
|
|
17
24
|
readOnly,
|
|
18
25
|
testId,
|
|
19
26
|
required,
|
|
27
|
+
disabled,
|
|
20
28
|
status,
|
|
21
29
|
helperText,
|
|
22
30
|
validatemessage,
|
|
23
31
|
displayMode,
|
|
24
|
-
hideLabel
|
|
32
|
+
hideLabel,
|
|
33
|
+
trueLabel,
|
|
34
|
+
falseLabel
|
|
25
35
|
} = props;
|
|
26
36
|
const helperTextToDisplay = validatemessage || helperText;
|
|
27
37
|
|
|
28
38
|
const thePConn = getPConnect();
|
|
29
|
-
const theConfigProps = thePConn.getConfigProps();
|
|
30
|
-
const
|
|
39
|
+
const theConfigProps = thePConn.getConfigProps() as CheckboxProps;
|
|
40
|
+
const caption = theConfigProps.caption;
|
|
31
41
|
const actionsApi = thePConn.getActionsApi();
|
|
32
|
-
const propName = thePConn.getStateProps().value;
|
|
42
|
+
const propName = (thePConn.getStateProps() as any).value;
|
|
33
43
|
|
|
34
44
|
const [checked, setChecked] = useState(false);
|
|
35
45
|
useEffect(() => {
|
|
@@ -38,11 +48,11 @@ export default function CheckboxComponent(props) {
|
|
|
38
48
|
}, [value]);
|
|
39
49
|
|
|
40
50
|
if (displayMode === 'LABELS_LEFT') {
|
|
41
|
-
return <FieldValueList name={hideLabel ? '' :
|
|
51
|
+
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} />;
|
|
42
52
|
}
|
|
43
53
|
|
|
44
54
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
45
|
-
return <FieldValueList name={hideLabel ? '' :
|
|
55
|
+
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} variant='stacked' />;
|
|
46
56
|
}
|
|
47
57
|
|
|
48
58
|
const handleChange = event => {
|
|
@@ -53,12 +63,12 @@ export default function CheckboxComponent(props) {
|
|
|
53
63
|
thePConn.getValidationApi().validate(event.target.checked);
|
|
54
64
|
};
|
|
55
65
|
|
|
56
|
-
let theCheckbox = <Checkbox color='primary' />;
|
|
66
|
+
let theCheckbox = <Checkbox color='primary' disabled={disabled} />;
|
|
57
67
|
|
|
58
68
|
if (readOnly) {
|
|
59
69
|
// Workaround for lack of InputProps readOnly from https://github.com/mui-org/material-ui/issues/17043
|
|
60
70
|
// Also note that we need to turn off the onChange call in the FormControlLabel wrapper, too. See below!
|
|
61
|
-
theCheckbox = <Checkbox value={value || false}
|
|
71
|
+
theCheckbox = <Checkbox value={value || false} readOnly={readOnly} />;
|
|
62
72
|
}
|
|
63
73
|
|
|
64
74
|
return (
|
|
@@ -1,14 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
// import { TextField } from "@material-ui/core";
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
3
2
|
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
3
|
+
|
|
4
4
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
5
|
+
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
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';
|
|
8
|
+
|
|
7
9
|
import { getCurrencyCharacters, getCurrencyOptions } from './currency-utils';
|
|
8
10
|
|
|
9
11
|
// Using control from: https://github.com/unicef/material-ui-currency-textfield
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
interface CurrrencyProps extends PConnFieldProps {
|
|
14
|
+
// If any, enter additional props that only exist on Currency here
|
|
15
|
+
currencyISOCode?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default function Currency(props: CurrrencyProps) {
|
|
19
|
+
// Get emitted components from map (so we can get any override that may exist)
|
|
20
|
+
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
21
|
+
|
|
12
22
|
const {
|
|
13
23
|
getPConnect,
|
|
14
24
|
label,
|
|
@@ -23,32 +33,24 @@ export default function Currency(props) {
|
|
|
23
33
|
helperText,
|
|
24
34
|
displayMode,
|
|
25
35
|
hideLabel,
|
|
26
|
-
currencyISOCode =
|
|
36
|
+
currencyISOCode = 'USD',
|
|
37
|
+
placeholder
|
|
27
38
|
} = props;
|
|
28
39
|
|
|
29
40
|
const pConn = getPConnect();
|
|
30
41
|
const actions = pConn.getActionsApi();
|
|
31
|
-
const propName = pConn.getStateProps().value;
|
|
42
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
32
43
|
const helperTextToDisplay = validatemessage || helperText;
|
|
33
44
|
|
|
34
45
|
// console.log(`Currency: label: ${label} value: ${value}`);
|
|
35
46
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (readOnly) {
|
|
39
|
-
readOnlyProp = { readOnly: true };
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
let testProp = {};
|
|
43
|
-
|
|
44
|
-
testProp = {
|
|
47
|
+
const testProp = {
|
|
45
48
|
'data-test-id': testId
|
|
46
49
|
};
|
|
47
50
|
|
|
48
|
-
const [
|
|
49
|
-
const [
|
|
50
|
-
const [
|
|
51
|
-
const [theCurrSep, setCurrSep] = useState(",");
|
|
51
|
+
const [theCurrSym, setCurrSym] = useState('$');
|
|
52
|
+
const [theCurrDec, setCurrDec] = useState('.');
|
|
53
|
+
const [theCurrSep, setCurrSep] = useState(',');
|
|
52
54
|
|
|
53
55
|
useEffect(() => {
|
|
54
56
|
// currencySymbols looks like this: { theCurrencySymbol: '$', theDecimalIndicator: '.', theSeparator: ',' }
|
|
@@ -58,11 +60,6 @@ export default function Currency(props) {
|
|
|
58
60
|
setCurrSep(theSymbols.theDigitGroupSeparator);
|
|
59
61
|
}, [currencyISOCode]);
|
|
60
62
|
|
|
61
|
-
useEffect(() => {
|
|
62
|
-
// const testVal = value;
|
|
63
|
-
setCurrValue(value.toString());
|
|
64
|
-
}, [value]);
|
|
65
|
-
|
|
66
63
|
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
67
64
|
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
68
65
|
|
|
@@ -74,14 +71,6 @@ export default function Currency(props) {
|
|
|
74
71
|
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
78
|
-
function currOnChange(event, inValue) {
|
|
79
|
-
// console.log(`Currency currOnChange inValue: ${inValue}`);
|
|
80
|
-
|
|
81
|
-
// update internal value
|
|
82
|
-
setCurrValue(event?.target?.value);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
74
|
function currOnBlur(event, inValue) {
|
|
86
75
|
// console.log(`Currency currOnBlur inValue: ${inValue}`);
|
|
87
76
|
handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
|
|
@@ -94,22 +83,22 @@ export default function Currency(props) {
|
|
|
94
83
|
fullWidth
|
|
95
84
|
variant={readOnly ? 'standard' : 'outlined'}
|
|
96
85
|
helperText={helperTextToDisplay}
|
|
97
|
-
placeholder=''
|
|
86
|
+
placeholder={placeholder ?? ''}
|
|
98
87
|
size='small'
|
|
99
88
|
required={required}
|
|
100
89
|
disabled={disabled}
|
|
101
|
-
|
|
102
|
-
onBlur={!readOnly ? currOnBlur : undefined}
|
|
90
|
+
readOnly={!!readOnly}
|
|
103
91
|
error={status === 'error'}
|
|
104
92
|
label={label}
|
|
105
|
-
value={
|
|
93
|
+
value={value}
|
|
106
94
|
type='text'
|
|
107
95
|
outputFormat='number'
|
|
108
96
|
textAlign='left'
|
|
109
|
-
InputProps={{
|
|
97
|
+
InputProps={{ inputProps: { ...testProp } }}
|
|
110
98
|
currencySymbol={theCurrSym}
|
|
111
99
|
decimalCharacter={theCurrDec}
|
|
112
100
|
digitGroupSeparator={theCurrSep}
|
|
101
|
+
onBlur={!readOnly ? currOnBlur : undefined}
|
|
113
102
|
/>
|
|
114
103
|
);
|
|
115
104
|
}
|