@pega/react-sdk-overrides 23.1.10 → 23.1.12
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 +6 -14
- package/lib/designSystemExtension/Banner/Banner.tsx +14 -11
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.css +0 -1
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +27 -22
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +14 -20
- package/lib/designSystemExtension/DetailsFields/index.tsx +1 -1
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +44 -19
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +7 -12
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +21 -32
- package/lib/designSystemExtension/Operator/Operator.tsx +94 -82
- package/lib/designSystemExtension/Pulse/Pulse.tsx +14 -16
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +6 -5
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +14 -14
- package/lib/field/AutoComplete/AutoComplete.tsx +24 -26
- package/lib/field/AutoComplete/config-ext.json +2 -3
- package/lib/field/CancelAlert/CancelAlert.tsx +98 -84
- package/lib/field/CancelAlert/index.tsx +1 -1
- package/lib/field/Checkbox/Checkbox.tsx +120 -63
- package/lib/field/Checkbox/config-ext.json +2 -3
- package/lib/field/Currency/Currency.tsx +25 -50
- package/lib/field/Currency/config-ext.json +2 -3
- package/lib/field/Currency/currency-utils.ts +9 -16
- package/lib/field/Date/Date.tsx +15 -11
- package/lib/field/Date/config-ext.json +2 -3
- package/lib/field/DateTime/DateTime.tsx +9 -9
- package/lib/field/DateTime/config-ext.json +1 -2
- package/lib/field/Decimal/Decimal.tsx +33 -44
- package/lib/field/Decimal/config-ext.json +1 -2
- package/lib/field/Decimal/index.tsx +1 -1
- package/lib/field/Dropdown/Dropdown.tsx +122 -31
- package/lib/field/Dropdown/config-ext.json +1 -2
- package/lib/field/Email/Email.tsx +11 -10
- package/lib/field/Email/config-ext.json +1 -2
- package/lib/field/Email/index.tsx +1 -1
- package/lib/field/Group/Group.tsx +39 -0
- package/lib/field/Group/config-ext.json +7 -0
- package/lib/field/Group/index.tsx +1 -0
- package/lib/field/Integer/Integer.tsx +8 -7
- package/lib/field/Integer/config-ext.json +1 -2
- package/lib/field/MultiSelect/Multiselect.tsx +244 -0
- package/lib/field/MultiSelect/index.tsx +1 -0
- package/lib/field/MultiSelect/utils.ts +230 -0
- package/lib/field/Percentage/Percentage.tsx +46 -41
- package/lib/field/Percentage/config-ext.json +1 -2
- package/lib/field/Phone/Phone.tsx +13 -12
- package/lib/field/Phone/index.tsx +1 -1
- package/lib/field/RadioButtons/RadioButtons.tsx +20 -18
- package/lib/field/RadioButtons/config-ext.json +1 -2
- package/lib/field/RichText/RichText.tsx +8 -7
- package/lib/field/ScalarList/ScalarList.tsx +3 -13
- package/lib/field/ScalarList/config-ext.json +1 -2
- package/lib/field/SemanticLink/SemanticLink.tsx +7 -7
- package/lib/field/SemanticLink/config-ext.json +1 -2
- package/lib/field/SemanticLink/utils.ts +8 -11
- package/lib/field/TextArea/TextArea.tsx +7 -6
- package/lib/field/TextArea/config-ext.json +1 -2
- package/lib/field/TextContent/TextContent.tsx +4 -6
- package/lib/field/TextContent/config-ext.json +1 -2
- package/lib/field/TextInput/TextInput.tsx +9 -7
- package/lib/field/TextInput/config-ext.json +1 -2
- package/lib/field/TextInput/index.tsx +1 -1
- package/lib/field/Time/Time.tsx +11 -11
- package/lib/field/Time/config-ext.json +1 -2
- package/lib/field/URL/URL.tsx +9 -8
- package/lib/field/URL/config-ext.json +1 -2
- package/lib/field/URL/index.tsx +1 -1
- package/lib/field/UserReference/UserReference.tsx +18 -16
- package/lib/field/UserReference/UserReferenceUtils.ts +2 -2
- package/lib/field/UserReference/config-ext.json +1 -2
- package/lib/helpers/attachmentHelpers.ts +13 -8
- package/lib/helpers/case-utils.tsx +4 -8
- package/lib/helpers/common-utils.ts +5 -1
- package/lib/helpers/data_page.ts +3 -7
- package/lib/helpers/date-format-utils.ts +3 -3
- package/lib/helpers/event-utils.ts +3 -3
- package/lib/helpers/field-group-utils.ts +1 -1
- package/lib/helpers/formatters/Boolean.ts +9 -26
- package/lib/helpers/formatters/Currency.ts +15 -21
- package/lib/helpers/formatters/CurrencyMap.ts +505 -501
- package/lib/helpers/formatters/Date.ts +20 -26
- package/lib/helpers/formatters/common.ts +1 -2
- package/lib/helpers/formatters/index.ts +26 -19
- package/lib/helpers/instructions-utils.ts +38 -0
- package/lib/helpers/reactContextHelpers.ts +2 -2
- package/lib/helpers/simpleTableHelpers.ts +59 -83
- package/lib/helpers/state-utils.tsx +5 -9
- package/lib/helpers/template-utils.ts +3 -6
- package/lib/helpers/utils.ts +5 -5
- package/lib/helpers/versionHelpers.ts +1 -4
- package/lib/infra/ActionButtons/ActionButtons.tsx +38 -29
- package/lib/infra/ActionButtons/index.tsx +1 -1
- package/lib/infra/Assignment/Assignment.tsx +99 -79
- package/lib/infra/Assignment/index.tsx +1 -1
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +13 -16
- package/lib/infra/AssignmentCard/index.tsx +1 -1
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +67 -213
- package/lib/infra/Containers/FlowContainer/helpers.ts +34 -45
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -1
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/ListViewActionButtons.tsx +65 -0
- package/lib/infra/Containers/ModalViewContainer/ListViewActionButtons/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +227 -218
- 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 +36 -46
- package/lib/infra/Containers/helpers.ts +6 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -42
- package/lib/infra/DashboardFilter/filterUtils.tsx +12 -43
- package/lib/infra/DeferLoad/DeferLoad.tsx +22 -28
- package/lib/infra/DeferLoad/index.tsx +1 -1
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +16 -30
- package/lib/infra/MultiStep/MultiStep.css +11 -15
- package/lib/infra/MultiStep/MultiStep.tsx +176 -212
- package/lib/infra/MultiStep/index.tsx +1 -1
- package/lib/infra/NavBar/NavBar.css +103 -105
- package/lib/infra/NavBar/NavBar.tsx +19 -31
- package/lib/infra/Reference/Reference.tsx +16 -18
- package/lib/infra/Region/Region.tsx +4 -6
- package/lib/infra/RootContainer/RootContainer.tsx +75 -111
- package/lib/infra/RootContainer/index.tsx +1 -1
- package/lib/infra/Stages/Stages.tsx +32 -39
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +11 -11
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +21 -28
- package/lib/infra/View/View.tsx +17 -21
- package/lib/template/AppShell/AppShell.css +22 -23
- package/lib/template/AppShell/AppShell.tsx +39 -74
- package/lib/template/BannerPage/BannerPage.tsx +12 -14
- package/lib/template/CaseSummary/CaseSummary.tsx +58 -18
- package/lib/template/CaseSummary/config-ext.json +1 -2
- package/lib/template/CaseView/CaseView.tsx +34 -63
- package/lib/template/CaseView/config-ext.json +1 -2
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +63 -19
- package/lib/template/Confirmation/Confirmation.tsx +12 -17
- package/lib/template/Confirmation/config-ext.json +1 -2
- package/lib/template/DataReference/DataReference.tsx +95 -121
- package/lib/template/DataReference/config-ext.json +1 -2
- package/lib/template/DefaultForm/DefaultForm.css +7 -3
- package/lib/template/DefaultForm/DefaultForm.tsx +13 -16
- package/lib/template/DefaultForm/config-ext.json +1 -2
- package/lib/template/Details/Details/Details.tsx +19 -22
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +9 -13
- package/lib/template/Details/DetailsSubTabs/config-ext.json +1 -2
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +19 -24
- package/lib/template/Details/DetailsThreeColumn/config-ext.json +1 -2
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +19 -25
- 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 +15 -14
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +15 -22
- package/lib/template/InlineDashboard/InlineDashboard.tsx +12 -14
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +12 -16
- package/lib/template/ListPage/ListPage.tsx +5 -10
- package/lib/template/ListPage/config-ext.json +1 -2
- package/lib/template/ListView/DefaultViewMeta.ts +1 -3
- package/lib/template/ListView/ListView.tsx +185 -175
- package/lib/template/ListView/config-ext.json +1 -2
- package/lib/template/ListView/hooks.ts +24 -26
- package/lib/template/ListView/utils.ts +51 -87
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +20 -20
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.css +0 -2
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +25 -38
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +20 -25
- 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 +14 -24
- package/lib/template/NarrowWide/NarrowWideForm/config-ext.json +1 -2
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +9 -19
- package/lib/template/NarrowWide/NarrowWidePage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +14 -15
- package/lib/template/OneColumn/OneColumn/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +3 -10
- package/lib/template/OneColumn/OneColumnPage/config-ext.json +1 -2
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +6 -10
- package/lib/template/OneColumn/OneColumnTab/config-ext.json +1 -2
- package/lib/template/PromotedFilters/PromotedFilters.css +1 -1
- package/lib/template/PromotedFilters/PromotedFilters.tsx +32 -28
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +37 -33
- package/lib/template/SimpleTable/SimpleTable/config-ext.json +1 -2
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +187 -121
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +24 -25
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +30 -30
- package/lib/template/SubTabs/SubTabs.tsx +22 -40
- package/lib/template/SubTabs/config-ext.json +1 -2
- package/lib/template/SubTabs/tabUtils.ts +2 -5
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.css +0 -1
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +30 -28
- package/lib/template/TwoColumn/TwoColumn/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +3 -10
- package/lib/template/TwoColumn/TwoColumnPage/config-ext.json +1 -2
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +30 -28
- 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 +22 -34
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +24 -28
- 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 +13 -21
- package/lib/template/WideNarrow/WideNarrowForm/config-ext.json +1 -2
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +8 -16
- 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 +18 -21
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +29 -28
- package/lib/widget/AppAnnouncement/config-ext.json +1 -2
- package/lib/widget/Attachment/Attachment.css +60 -1
- package/lib/widget/Attachment/Attachment.tsx +378 -405
- package/lib/widget/Attachment/index.tsx +1 -1
- package/lib/widget/CaseHistory/CaseHistory.tsx +64 -66
- package/lib/widget/CaseHistory/config-ext.json +1 -2
- package/lib/widget/CaseHistory/index.tsx +1 -1
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +16 -18
- package/lib/widget/FileUtility/FileUtility/FileUtility.css +2 -2
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +310 -246
- package/lib/widget/FileUtility/FileUtility/config-ext.json +1 -2
- package/lib/widget/Followers/Followers.tsx +23 -20
- package/lib/widget/Followers/config-ext.json +1 -2
- package/lib/widget/QuickCreate/QuickCreate.tsx +68 -42
- package/lib/widget/SummaryItem/SummaryItem.css +9 -9
- package/lib/widget/SummaryItem/SummaryItem.tsx +58 -58
- package/lib/widget/SummaryItem/index.tsx +1 -1
- package/lib/widget/SummaryList/SummaryList.tsx +7 -10
- package/lib/widget/ToDo/ToDo.css +4 -4
- package/lib/widget/ToDo/ToDo.tsx +52 -53
- package/lib/widget/ToDo/config-ext.json +1 -2
- package/package.json +5 -2
- package/lib/helpers/auth.js +0 -834
- package/lib/helpers/authManager.ts +0 -933
- package/lib/helpers/config_access.js +0 -186
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
import equal from 'fast-deep-equal';
|
|
3
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
4
|
+
import { updateNewInstuctions, insertInstruction, deleteInstruction } from '@pega/react-sdk-components/lib/components/helpers/instructions-utils';
|
|
5
|
+
|
|
6
|
+
export const setVisibilityForList = (c11nEnv, visibility) => {
|
|
7
|
+
const { selectionMode, selectionList, renderMode, referenceList } = c11nEnv.getComponentConfig();
|
|
8
|
+
// usecase:multiselect, fieldgroup, editable table
|
|
9
|
+
if ((selectionMode === PCore.getConstants().LIST_SELECTION_MODE.MULTI && selectionList) || (renderMode === 'Editable' && referenceList)) {
|
|
10
|
+
c11nEnv.getListActions().setVisibility(visibility);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const useDeepMemo = (memoFn, key) => {
|
|
15
|
+
const ref: any = useRef();
|
|
16
|
+
if (!ref.current || !equal(key, ref.current.key)) {
|
|
17
|
+
ref.current = { key, value: memoFn() };
|
|
18
|
+
}
|
|
19
|
+
return ref.current.value;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const preProcessColumns = columns => {
|
|
23
|
+
return columns?.map(col => {
|
|
24
|
+
const tempColObj = { ...col };
|
|
25
|
+
tempColObj.value = col.value && col.value.startsWith('.') ? col.value.substring(1) : col.value;
|
|
26
|
+
if (tempColObj.setProperty) {
|
|
27
|
+
tempColObj.setProperty = col.setProperty && col.setProperty.startsWith('.') ? col.setProperty.substring(1) : col.setProperty;
|
|
28
|
+
}
|
|
29
|
+
return tempColObj;
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const getDisplayFieldsMetaData = columns => {
|
|
34
|
+
const displayColumns = columns?.filter(col => col.display === 'true');
|
|
35
|
+
const metaDataObj: any = {
|
|
36
|
+
key: '',
|
|
37
|
+
primary: '',
|
|
38
|
+
secondary: []
|
|
39
|
+
};
|
|
40
|
+
const keyCol = columns?.filter(col => col.key === 'true');
|
|
41
|
+
metaDataObj.key = keyCol?.length > 0 ? keyCol[0].value : 'auto';
|
|
42
|
+
const itemsRecordsColumn = columns?.filter(col => col.itemsRecordsColumn === 'true');
|
|
43
|
+
if (itemsRecordsColumn?.length > 0) {
|
|
44
|
+
metaDataObj.itemsRecordsColumn = itemsRecordsColumn[0].value;
|
|
45
|
+
}
|
|
46
|
+
const itemsGroupKeyColumn = columns?.filter(col => col.itemsGroupKeyColumn === 'true');
|
|
47
|
+
if (itemsGroupKeyColumn?.length > 0) {
|
|
48
|
+
metaDataObj.itemsGroupKeyColumn = itemsGroupKeyColumn[0].value;
|
|
49
|
+
}
|
|
50
|
+
for (let index = 0; index < displayColumns?.length; index += 1) {
|
|
51
|
+
if (displayColumns[index].secondary === 'true') {
|
|
52
|
+
metaDataObj.secondary.push(displayColumns[index].value);
|
|
53
|
+
} else if (displayColumns[index].primary === 'true') {
|
|
54
|
+
metaDataObj.primary = displayColumns[index].value;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return metaDataObj;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const createSingleTreeObejct = (entry, displayFieldMeta, showSecondaryData, selected) => {
|
|
61
|
+
const secondaryArr: any = [];
|
|
62
|
+
displayFieldMeta.secondary.forEach(col => {
|
|
63
|
+
secondaryArr.push(entry[col]);
|
|
64
|
+
});
|
|
65
|
+
const isSelected = selected.some(item => item.id === entry[displayFieldMeta.key]);
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
id: entry[displayFieldMeta.key],
|
|
69
|
+
primary: entry[displayFieldMeta.primary],
|
|
70
|
+
secondary: showSecondaryData ? secondaryArr : [],
|
|
71
|
+
selected: isSelected
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const putItemsDataInItemsTree = (listObjData, displayFieldMeta, itemsTree, showSecondaryInSearchOnly, selected) => {
|
|
76
|
+
let newTreeItems = itemsTree.slice();
|
|
77
|
+
const showSecondaryData = !showSecondaryInSearchOnly;
|
|
78
|
+
for (const obj of listObjData) {
|
|
79
|
+
const items = obj[displayFieldMeta.itemsRecordsColumn].map(entry => createSingleTreeObejct(entry, displayFieldMeta, showSecondaryData, selected));
|
|
80
|
+
|
|
81
|
+
newTreeItems = newTreeItems.map(caseObject => {
|
|
82
|
+
if (caseObject.id === obj[displayFieldMeta.itemsGroupKeyColumn]) {
|
|
83
|
+
caseObject.items = [...items];
|
|
84
|
+
}
|
|
85
|
+
return caseObject;
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return newTreeItems;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const prepareSearchResults = (listObjData, displayFieldMeta) => {
|
|
92
|
+
const searchResults: any = [];
|
|
93
|
+
for (const obj of listObjData) {
|
|
94
|
+
searchResults.push(...obj[displayFieldMeta.itemsRecordsColumn]);
|
|
95
|
+
}
|
|
96
|
+
return searchResults;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const doSearch = async (
|
|
100
|
+
searchText,
|
|
101
|
+
clickedGroup,
|
|
102
|
+
initialCaseClass,
|
|
103
|
+
displayFieldMeta,
|
|
104
|
+
dataApiObj, // deep clone of the dataApiObj
|
|
105
|
+
itemsTree,
|
|
106
|
+
isGroupData,
|
|
107
|
+
showSecondaryInSearchOnly,
|
|
108
|
+
selected
|
|
109
|
+
) => {
|
|
110
|
+
let searchTextForUngroupedData = '';
|
|
111
|
+
if (dataApiObj) {
|
|
112
|
+
// creating dataApiObject in grouped data cases
|
|
113
|
+
if (isGroupData) {
|
|
114
|
+
dataApiObj = cloneDeep(dataApiObj);
|
|
115
|
+
dataApiObj.fetchedNQData = false;
|
|
116
|
+
dataApiObj.cache = {};
|
|
117
|
+
|
|
118
|
+
// if we have no search text and no group selected, return the original tree
|
|
119
|
+
if (searchText === '' && clickedGroup === '') {
|
|
120
|
+
return itemsTree;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// setting the inital search text & search classes in ApiObject
|
|
124
|
+
dataApiObj.parameters[Object.keys(dataApiObj.parameters)[1]] = searchText;
|
|
125
|
+
dataApiObj.parameters[Object.keys(dataApiObj.parameters)[0]] = initialCaseClass;
|
|
126
|
+
|
|
127
|
+
// if we have a selected group
|
|
128
|
+
if (clickedGroup) {
|
|
129
|
+
// check if the data for this group is already present and no search text
|
|
130
|
+
if (searchText === '') {
|
|
131
|
+
const containsData = itemsTree.find(item => item.id === clickedGroup);
|
|
132
|
+
// do not make API call when items of respective group are already fetched
|
|
133
|
+
if (containsData?.items?.length) return itemsTree;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
dataApiObj.parameters[Object.keys(dataApiObj.parameters)[0]] = JSON.stringify([clickedGroup]);
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
searchTextForUngroupedData = searchText;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// search API call
|
|
143
|
+
const response = await dataApiObj.fetchData(searchTextForUngroupedData).catch(() => {
|
|
144
|
+
return itemsTree;
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
let listObjData = response.data;
|
|
148
|
+
let newItemsTree = [];
|
|
149
|
+
if (isGroupData) {
|
|
150
|
+
if (searchText) {
|
|
151
|
+
listObjData = prepareSearchResults(listObjData, displayFieldMeta);
|
|
152
|
+
} else {
|
|
153
|
+
newItemsTree = putItemsDataInItemsTree(listObjData, displayFieldMeta, itemsTree, showSecondaryInSearchOnly, selected);
|
|
154
|
+
return newItemsTree;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const showSecondaryData = showSecondaryInSearchOnly ? !!searchText : true;
|
|
158
|
+
if (listObjData !== undefined && listObjData.length > 0) {
|
|
159
|
+
newItemsTree = listObjData.map(entry => createSingleTreeObejct(entry, displayFieldMeta, showSecondaryData, selected));
|
|
160
|
+
}
|
|
161
|
+
return newItemsTree;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return itemsTree;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const setValuesToPropertyList = (searchText, assocProp, items, columns, actions, updatePropertyInRedux = true) => {
|
|
168
|
+
const setPropertyList = columns
|
|
169
|
+
?.filter(col => col.setProperty)
|
|
170
|
+
.map(col => {
|
|
171
|
+
return {
|
|
172
|
+
source: col.value,
|
|
173
|
+
target: col.setProperty,
|
|
174
|
+
key: col.key,
|
|
175
|
+
primary: col.primary
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
const valueToSet: any = [];
|
|
179
|
+
if (setPropertyList.length > 0) {
|
|
180
|
+
setPropertyList.forEach(prop => {
|
|
181
|
+
items.forEach(item => {
|
|
182
|
+
if (prop.key === 'true' && item) {
|
|
183
|
+
valueToSet.push(item.id);
|
|
184
|
+
} else if (prop.primary === 'true' || !item) {
|
|
185
|
+
valueToSet.push(searchText);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
if (updatePropertyInRedux) {
|
|
190
|
+
// BUG-666851 setting options so that the store values are replaced and not merged
|
|
191
|
+
const options = {
|
|
192
|
+
isArrayDeepMerge: false
|
|
193
|
+
};
|
|
194
|
+
if (prop.target === 'Associated property') {
|
|
195
|
+
actions.updateFieldValue(assocProp, valueToSet, options);
|
|
196
|
+
} else {
|
|
197
|
+
actions.updateFieldValue(`.${prop.target}`, valueToSet, options);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
return valueToSet;
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
const getGroupDataForItemsTree = (groupDataSource, groupsDisplayFieldMeta, showSecondaryInSearchOnly) => {
|
|
206
|
+
return groupDataSource?.map(group => {
|
|
207
|
+
const secondaryArr: any = [];
|
|
208
|
+
groupsDisplayFieldMeta.secondary.forEach(col => {
|
|
209
|
+
secondaryArr.push(group[col]);
|
|
210
|
+
});
|
|
211
|
+
return {
|
|
212
|
+
id: group[groupsDisplayFieldMeta.key],
|
|
213
|
+
primary: group[groupsDisplayFieldMeta.primary],
|
|
214
|
+
secondary: showSecondaryInSearchOnly ? [] : secondaryArr,
|
|
215
|
+
items: []
|
|
216
|
+
};
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
export {
|
|
221
|
+
useDeepMemo,
|
|
222
|
+
preProcessColumns,
|
|
223
|
+
getDisplayFieldsMetaData,
|
|
224
|
+
doSearch,
|
|
225
|
+
setValuesToPropertyList,
|
|
226
|
+
getGroupDataForItemsTree,
|
|
227
|
+
updateNewInstuctions,
|
|
228
|
+
insertInstruction,
|
|
229
|
+
deleteInstruction
|
|
230
|
+
};
|
|
@@ -1,67 +1,58 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { TextField } from '@material-ui/core';
|
|
3
|
-
import { makeStyles } from '@material-ui/core/styles';
|
|
1
|
+
import CurrencyTextField from '@unicef/material-ui-currency-textfield';
|
|
4
2
|
|
|
5
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
input: {
|
|
11
|
-
'& input[type=number]': {
|
|
12
|
-
'-moz-appearance': 'textfield'
|
|
13
|
-
},
|
|
14
|
-
'& input[type=number]::-webkit-outer-spin-button': {
|
|
15
|
-
'-webkit-appearance': 'none',
|
|
16
|
-
margin: 0
|
|
17
|
-
},
|
|
18
|
-
'& input[type=number]::-webkit-inner-spin-button': {
|
|
19
|
-
'-webkit-appearance': 'none',
|
|
20
|
-
margin: 0
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}));
|
|
4
|
+
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
import { getCurrencyCharacters, getCurrencyOptions } from '@pega/react-sdk-components/lib/components/field/Currency/currency-utils';
|
|
6
|
+
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
7
|
+
import { format } from '@pega/react-sdk-components/lib/components/helpers/formatters';
|
|
24
8
|
|
|
9
|
+
/* Using @unicef/material-ui-currency-textfield component here, since it allows formatting decimal values,
|
|
10
|
+
as per the locale.
|
|
11
|
+
*/
|
|
25
12
|
interface PercentageProps extends PConnFieldProps {
|
|
26
13
|
// If any, enter additional props that only exist on Percentage here
|
|
14
|
+
currencyISOCode?: string;
|
|
27
15
|
}
|
|
28
16
|
|
|
29
17
|
export default function Percentage(props: PercentageProps) {
|
|
30
18
|
// Get emitted components from map (so we can get any override that may exist)
|
|
31
|
-
const TextInput = getComponentFromMap('TextInput');
|
|
32
19
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
33
20
|
|
|
34
|
-
const classes = useStyles();
|
|
35
|
-
|
|
36
21
|
const {
|
|
22
|
+
getPConnect,
|
|
37
23
|
label,
|
|
38
24
|
required,
|
|
39
25
|
disabled,
|
|
40
26
|
value = '',
|
|
41
27
|
validatemessage,
|
|
42
28
|
status,
|
|
43
|
-
onChange,
|
|
44
|
-
onBlur,
|
|
29
|
+
// onChange,
|
|
30
|
+
// onBlur,
|
|
45
31
|
readOnly,
|
|
32
|
+
currencyISOCode = 'USD',
|
|
46
33
|
testId,
|
|
47
34
|
helperText,
|
|
48
35
|
displayMode,
|
|
49
|
-
hideLabel
|
|
36
|
+
hideLabel,
|
|
37
|
+
placeholder
|
|
50
38
|
} = props;
|
|
39
|
+
|
|
40
|
+
const pConn = getPConnect();
|
|
41
|
+
const actions = pConn.getActionsApi();
|
|
42
|
+
const propName = (pConn.getStateProps() as any).value;
|
|
51
43
|
const helperTextToDisplay = validatemessage || helperText;
|
|
52
44
|
|
|
45
|
+
const theCurrencyOptions = getCurrencyOptions(currencyISOCode);
|
|
46
|
+
const formattedValue = format(value, pConn.getComponentName().toLowerCase(), theCurrencyOptions);
|
|
47
|
+
|
|
53
48
|
// console.log(`Percentage: label: ${label} value: ${value}`);
|
|
54
49
|
|
|
55
50
|
if (displayMode === 'LABELS_LEFT') {
|
|
56
|
-
return <FieldValueList name={hideLabel ? '' : label} value={
|
|
51
|
+
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} />;
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
60
|
-
return <FieldValueList name={hideLabel ? '' : label} value={
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (readOnly) {
|
|
64
|
-
return <TextInput {...props} />;
|
|
55
|
+
return <FieldValueList name={hideLabel ? '' : label} value={formattedValue} variant='stacked' />;
|
|
65
56
|
}
|
|
66
57
|
|
|
67
58
|
let testProp = {};
|
|
@@ -70,23 +61,37 @@ export default function Percentage(props: PercentageProps) {
|
|
|
70
61
|
'data-test-id': testId
|
|
71
62
|
};
|
|
72
63
|
|
|
64
|
+
const theSymbols = getCurrencyCharacters(currencyISOCode);
|
|
65
|
+
const theCurrDec = theSymbols.theDecimalIndicator;
|
|
66
|
+
const theCurrSep = theSymbols.theDigitGroupSeparator;
|
|
67
|
+
|
|
68
|
+
function PercentageOnBlur(event, inValue) {
|
|
69
|
+
handleEvent(actions, 'changeNblur', propName, inValue !== '' ? Number(inValue) : inValue);
|
|
70
|
+
}
|
|
71
|
+
|
|
73
72
|
return (
|
|
74
|
-
<
|
|
75
|
-
className={classes.input}
|
|
73
|
+
<CurrencyTextField
|
|
76
74
|
fullWidth
|
|
77
75
|
variant={readOnly ? 'standard' : 'outlined'}
|
|
78
76
|
helperText={helperTextToDisplay}
|
|
79
|
-
placeholder=
|
|
80
|
-
size=
|
|
77
|
+
placeholder={placeholder ?? ''}
|
|
78
|
+
size='small'
|
|
81
79
|
required={required}
|
|
82
80
|
disabled={disabled}
|
|
83
|
-
|
|
84
|
-
onBlur={!readOnly ? onBlur : undefined}
|
|
81
|
+
readOnly={!!readOnly}
|
|
85
82
|
error={status === 'error'}
|
|
86
83
|
label={label}
|
|
87
84
|
value={value}
|
|
88
|
-
type=
|
|
89
|
-
|
|
85
|
+
type='text'
|
|
86
|
+
outputFormat='number'
|
|
87
|
+
textAlign='left'
|
|
88
|
+
InputProps={{
|
|
89
|
+
inputProps: { ...testProp }
|
|
90
|
+
}}
|
|
91
|
+
currencySymbol=''
|
|
92
|
+
decimalCharacter={theCurrDec}
|
|
93
|
+
digitGroupSeparator={theCurrSep}
|
|
94
|
+
onBlur={!readOnly ? PercentageOnBlur : undefined}
|
|
90
95
|
/>
|
|
91
96
|
);
|
|
92
97
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
2
|
+
|
|
3
3
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
-
import
|
|
4
|
+
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
5
|
|
|
6
6
|
interface PhoneProps extends PConnFieldProps {
|
|
7
7
|
// If any, enter additional props that only exist on Phone here
|
|
@@ -24,7 +24,8 @@ export default function Phone(props: PhoneProps) {
|
|
|
24
24
|
testId,
|
|
25
25
|
helperText,
|
|
26
26
|
displayMode,
|
|
27
|
-
hideLabel
|
|
27
|
+
hideLabel,
|
|
28
|
+
placeholder
|
|
28
29
|
} = props;
|
|
29
30
|
const helperTextToDisplay = validatemessage || helperText;
|
|
30
31
|
|
|
@@ -39,7 +40,7 @@ export default function Phone(props: PhoneProps) {
|
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
42
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant=
|
|
43
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
if (readOnly) {
|
|
@@ -49,8 +50,8 @@ export default function Phone(props: PhoneProps) {
|
|
|
49
50
|
<MuiPhoneNumber
|
|
50
51
|
fullWidth
|
|
51
52
|
helperText={helperTextToDisplay}
|
|
52
|
-
placeholder=
|
|
53
|
-
size=
|
|
53
|
+
placeholder={placeholder ?? ''}
|
|
54
|
+
size='small'
|
|
54
55
|
required={required}
|
|
55
56
|
disabled={disabled}
|
|
56
57
|
onChange={onChange}
|
|
@@ -67,13 +68,13 @@ export default function Phone(props: PhoneProps) {
|
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
70
|
|
|
70
|
-
const handleChange =
|
|
71
|
+
const handleChange = inputVal => {
|
|
71
72
|
let phoneValue = inputVal && inputVal.replace(/\D+/g, '');
|
|
72
73
|
phoneValue = `+${phoneValue}`;
|
|
73
74
|
onChange({ value: phoneValue });
|
|
74
75
|
};
|
|
75
76
|
|
|
76
|
-
const handleBlur =
|
|
77
|
+
const handleBlur = event => {
|
|
77
78
|
const phoneValue = event?.target?.value;
|
|
78
79
|
event.target.value = `+${phoneValue && phoneValue.replace(/\D+/g, '')}`;
|
|
79
80
|
onBlur(event);
|
|
@@ -82,11 +83,11 @@ export default function Phone(props: PhoneProps) {
|
|
|
82
83
|
return (
|
|
83
84
|
<MuiPhoneNumber
|
|
84
85
|
fullWidth
|
|
85
|
-
variant=
|
|
86
|
+
variant='outlined'
|
|
86
87
|
helperText={helperTextToDisplay}
|
|
87
|
-
placeholder=
|
|
88
|
-
size=
|
|
89
|
-
defaultCountry=
|
|
88
|
+
placeholder={placeholder ?? ''}
|
|
89
|
+
size='small'
|
|
90
|
+
defaultCountry='us'
|
|
90
91
|
required={required}
|
|
91
92
|
disabled={disabled}
|
|
92
93
|
onChange={handleChange}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from './Phone';
|
|
1
|
+
export { default } from './Phone';
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
2
|
import { Radio, RadioGroup, FormControl, FormControlLabel, FormLabel, FormHelperText } from '@material-ui/core';
|
|
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
|
-
|
|
7
|
+
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
8
8
|
|
|
9
9
|
// Can't use RadioButtonProps until getLocaleRuleNameFromKeys is NOT private
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
interface RadioButtonsProps extends PConnFieldProps {
|
|
11
|
+
// If any, enter additional props that only exist on RadioButtons here
|
|
12
|
+
inline: boolean;
|
|
13
|
+
fieldMetadata?: any;
|
|
14
|
+
}
|
|
16
15
|
|
|
17
|
-
export default function RadioButtons(props
|
|
16
|
+
export default function RadioButtons(props: RadioButtonsProps) {
|
|
18
17
|
// Get emitted components from map (so we can get any override that may exist)
|
|
19
18
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
20
19
|
|
|
@@ -37,15 +36,15 @@ export default function RadioButtons(props /* : RadioButtonsProps */ ) {
|
|
|
37
36
|
const thePConn = getPConnect();
|
|
38
37
|
const theConfigProps = thePConn.getConfigProps();
|
|
39
38
|
const actionsApi = thePConn.getActionsApi();
|
|
40
|
-
const propName = thePConn.getStateProps()
|
|
39
|
+
const propName = (thePConn.getStateProps() as any).value;
|
|
41
40
|
const helperTextToDisplay = validatemessage || helperText;
|
|
42
41
|
const className = thePConn.getCaseInfo().getClassName();
|
|
43
42
|
|
|
44
|
-
let configProperty = thePConn.getRawMetadata()?.config?.value || '';
|
|
43
|
+
let configProperty = (thePConn.getRawMetadata() as any)?.config?.value || '';
|
|
45
44
|
configProperty = configProperty.startsWith('@P') ? configProperty.substring(3) : configProperty;
|
|
46
45
|
configProperty = configProperty.startsWith('.') ? configProperty.substring(1) : configProperty;
|
|
47
46
|
|
|
48
|
-
const metaData = Array.isArray(fieldMetadata) ? fieldMetadata.filter(
|
|
47
|
+
const metaData = Array.isArray(fieldMetadata) ? fieldMetadata.filter(field => field?.classID === className)[0] : fieldMetadata;
|
|
49
48
|
let displayName = metaData?.datasource?.propertyForDisplayText;
|
|
50
49
|
displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);
|
|
51
50
|
const localeContext = metaData?.datasource?.tableType === 'DataPage' ? 'datapage' : 'associated';
|
|
@@ -66,6 +65,7 @@ export default function RadioButtons(props /* : RadioButtonsProps */ ) {
|
|
|
66
65
|
return (
|
|
67
66
|
<FieldValueList
|
|
68
67
|
name={hideLabel ? '' : label}
|
|
68
|
+
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
69
69
|
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
70
70
|
/>
|
|
71
71
|
);
|
|
@@ -75,25 +75,26 @@ export default function RadioButtons(props /* : RadioButtonsProps */ ) {
|
|
|
75
75
|
return (
|
|
76
76
|
<FieldValueList
|
|
77
77
|
name={hideLabel ? '' : label}
|
|
78
|
+
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
78
79
|
value={thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName))}
|
|
79
|
-
variant=
|
|
80
|
+
variant='stacked'
|
|
80
81
|
/>
|
|
81
82
|
);
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
const handleChange =
|
|
85
|
+
const handleChange = event => {
|
|
85
86
|
handleEvent(actionsApi, 'changeNblur', propName, event.target.value);
|
|
86
87
|
};
|
|
87
88
|
|
|
88
|
-
const handleBlur =
|
|
89
|
+
const handleBlur = event => {
|
|
89
90
|
thePConn.getValidationApi().validate(event.target.value, ''); // 2nd arg empty string until typedef marked correctly as optional
|
|
90
91
|
};
|
|
91
92
|
|
|
92
93
|
return (
|
|
93
94
|
<FormControl error={status === 'error'} required={required}>
|
|
94
|
-
<FormLabel component=
|
|
95
|
+
<FormLabel component='legend'>{label}</FormLabel>
|
|
95
96
|
<RadioGroup value={theSelectedButton} onChange={handleChange} onBlur={!readOnly ? handleBlur : undefined} row={inline}>
|
|
96
|
-
{theOptions.map(
|
|
97
|
+
{theOptions.map(theOption => {
|
|
97
98
|
return (
|
|
98
99
|
<FormControlLabel
|
|
99
100
|
value={theOption.key}
|
|
@@ -101,9 +102,10 @@ export default function RadioButtons(props /* : RadioButtonsProps */ ) {
|
|
|
101
102
|
label={thePConn.getLocalizedValue(
|
|
102
103
|
theOption.value,
|
|
103
104
|
localePath,
|
|
105
|
+
// @ts-ignore - Property 'getLocaleRuleNameFromKeys' is private and only accessible within class 'C11nEnv'
|
|
104
106
|
thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)
|
|
105
107
|
)}
|
|
106
|
-
control={<Radio key={theOption.key} color=
|
|
108
|
+
control={<Radio key={theOption.key} color='primary' disabled={readOnly} />}
|
|
107
109
|
/>
|
|
108
110
|
);
|
|
109
111
|
})}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
|
|
2
3
|
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
3
4
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
|
-
import
|
|
5
|
+
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
6
|
|
|
6
7
|
interface RichTextProps extends PConnFieldProps {
|
|
7
8
|
// If any, enter additional props that only exist on TextArea here
|
|
@@ -18,16 +19,16 @@ export default function RichText(props: RichTextProps) {
|
|
|
18
19
|
const editorRef: any = useRef(null);
|
|
19
20
|
|
|
20
21
|
let { readOnly, required, disabled } = props;
|
|
21
|
-
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
22
|
+
[readOnly, required, disabled] = [readOnly, required, disabled].map(prop => prop === true || (typeof prop === 'string' && prop === 'true'));
|
|
22
23
|
|
|
23
24
|
const helperTextToDisplay = validatemessage || helperText;
|
|
24
25
|
|
|
25
26
|
if (displayMode === 'LABELS_LEFT') {
|
|
26
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
27
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} isHtml />;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
30
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant=
|
|
31
|
+
return <FieldValueList name={hideLabel ? '' : label} value={value} isHtml variant='stacked' />;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
let richTextComponent;
|
|
@@ -55,7 +56,7 @@ export default function RichText(props: RichTextProps) {
|
|
|
55
56
|
}
|
|
56
57
|
const handleChange = () => {
|
|
57
58
|
if (status === 'error') {
|
|
58
|
-
const property = pConn.getStateProps()
|
|
59
|
+
const property = (pConn.getStateProps() as any).value;
|
|
59
60
|
pConn.clearErrorMessages({
|
|
60
61
|
property,
|
|
61
62
|
category: '',
|
|
@@ -67,7 +68,7 @@ export default function RichText(props: RichTextProps) {
|
|
|
67
68
|
const handleBlur = () => {
|
|
68
69
|
if (editorRef.current) {
|
|
69
70
|
const editorValue = editorRef.current.getContent({ format: 'html' });
|
|
70
|
-
const property = pConn.getStateProps()
|
|
71
|
+
const property = (pConn.getStateProps() as any).value;
|
|
71
72
|
handleEvent(actionsApi, 'changeNblur', property, editorValue);
|
|
72
73
|
}
|
|
73
74
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/* eslint-disable react/no-array-index-key */
|
|
2
|
-
import React from 'react';
|
|
3
2
|
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
4
3
|
import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
4
|
|
|
@@ -8,7 +7,7 @@ interface ScalarListProps extends PConnProps {
|
|
|
8
7
|
// If any, enter additional props that only exist on this component
|
|
9
8
|
displayInModal: boolean;
|
|
10
9
|
hideLabel: boolean;
|
|
11
|
-
value:
|
|
10
|
+
value: any[];
|
|
12
11
|
componentType: string;
|
|
13
12
|
label: string;
|
|
14
13
|
displayMode: string;
|
|
@@ -30,15 +29,7 @@ export default function ScalarList(props: ScalarListProps) {
|
|
|
30
29
|
// Get emitted components from map (so we can get any override that may exist)
|
|
31
30
|
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
32
31
|
|
|
33
|
-
const {
|
|
34
|
-
label,
|
|
35
|
-
getPConnect,
|
|
36
|
-
componentType,
|
|
37
|
-
value: scalarValues,
|
|
38
|
-
displayMode,
|
|
39
|
-
hideLabel,
|
|
40
|
-
...restProps
|
|
41
|
-
} = props;
|
|
32
|
+
const { label, getPConnect, componentType, value: scalarValues, displayMode, hideLabel, ...restProps } = props;
|
|
42
33
|
|
|
43
34
|
const items = scalarValues?.map(scalarValue => {
|
|
44
35
|
return getPConnect().createComponent(
|
|
@@ -59,12 +50,11 @@ export default function ScalarList(props: ScalarListProps) {
|
|
|
59
50
|
});
|
|
60
51
|
|
|
61
52
|
if (['LABELS_LEFT', 'STACKED_LARGE_VAL', 'DISPLAY_ONLY'].includes(displayMode)) {
|
|
62
|
-
|
|
53
|
+
return (
|
|
63
54
|
<div>
|
|
64
55
|
<CommaSeparatedList items={items} />
|
|
65
56
|
</div>
|
|
66
57
|
);
|
|
67
|
-
return displayComp;
|
|
68
58
|
}
|
|
69
59
|
|
|
70
60
|
const displayComp = <CommaSeparatedList items={items} />;
|