@pega/react-sdk-overrides 8.8.21 → 8.23.11-debug
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 +9 -13
- package/lib/designSystemExtension/Banner/Banner.tsx +1 -12
- package/lib/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +10 -15
- package/lib/designSystemExtension/DetailsFields/DetailsFields.tsx +11 -10
- package/lib/designSystemExtension/FieldGroup/FieldGroup.tsx +3 -10
- package/lib/designSystemExtension/FieldGroupList/FieldGroupList.tsx +3 -11
- package/lib/designSystemExtension/FieldValueList/FieldValueList.tsx +3 -11
- package/lib/designSystemExtension/Operator/Operator.tsx +12 -16
- package/lib/designSystemExtension/Pulse/Pulse.tsx +7 -11
- package/lib/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx +1 -10
- package/lib/field/AutoComplete/AutoComplete.tsx +18 -37
- package/lib/field/CancelAlert/CancelAlert.tsx +4 -9
- package/lib/field/Checkbox/Checkbox.tsx +16 -39
- package/lib/field/Currency/Currency.tsx +15 -23
- package/lib/field/Currency/currency-utils.ts +5 -1
- package/lib/field/Date/Date.tsx +15 -22
- package/lib/field/DateTime/DateTime.tsx +14 -25
- package/lib/field/Decimal/Decimal.tsx +14 -25
- package/lib/field/Dropdown/Dropdown.tsx +26 -30
- package/lib/field/Email/Email.tsx +9 -17
- package/lib/field/Integer/Integer.tsx +7 -15
- package/lib/field/Percentage/Percentage.tsx +7 -15
- package/lib/field/Phone/Phone.tsx +11 -19
- package/lib/field/RadioButtons/RadioButtons.tsx +37 -25
- package/lib/field/SemanticLink/SemanticLink.tsx +25 -26
- package/lib/field/TextArea/TextArea.tsx +5 -14
- package/lib/field/TextContent/TextContent.tsx +1 -10
- package/lib/field/TextInput/TextInput.tsx +6 -15
- package/lib/field/Time/Time.tsx +27 -22
- package/lib/field/URL/URL.tsx +8 -16
- package/lib/field/UserReference/UserReference.tsx +60 -50
- package/lib/helpers/attachmentHelpers.ts +4 -4
- package/lib/helpers/auth.js +397 -741
- package/lib/helpers/authManager.js +634 -0
- package/lib/helpers/case-utils.tsx +9 -8
- package/lib/helpers/common-utils.ts +1 -1
- package/lib/helpers/config_access.js +73 -0
- package/lib/helpers/date-format-utils.ts +1 -1
- package/lib/helpers/event-utils.ts +1 -1
- package/lib/helpers/formatters/Currency.ts +11 -11
- package/lib/helpers/formatters/CurrencyMap.ts +5 -8
- package/lib/helpers/formatters/Date.ts +1 -1
- package/lib/helpers/formatters/common.ts +6 -2
- package/lib/helpers/formatters/index.ts +3 -3
- package/lib/helpers/simpleTableHelpers.ts +7 -7
- package/lib/helpers/state-utils.tsx +3 -0
- package/lib/helpers/template-utils.ts +6 -3
- package/lib/helpers/versionHelpers.ts +3 -0
- package/lib/infra/ActionButtons/ActionButtons.tsx +19 -9
- package/lib/infra/Assignment/Assignment.tsx +28 -21
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +19 -15
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +58 -57
- package/lib/infra/Containers/FlowContainer/helpers.ts +3 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +19 -14
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +25 -14
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +21 -13
- package/lib/infra/DashboardFilter/filterUtils.tsx +1 -1
- package/lib/infra/DeferLoad/DeferLoad.tsx +20 -14
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +14 -10
- package/lib/infra/MultiStep/MultiStep.tsx +22 -22
- package/lib/infra/NavBar/NavBar.tsx +21 -14
- package/lib/infra/Reference/Reference.tsx +18 -13
- package/lib/infra/Region/Region.tsx +6 -8
- package/lib/infra/RootContainer/RootContainer.tsx +25 -16
- package/lib/infra/Stages/Stages.tsx +8 -10
- package/lib/infra/VerticalTabs/LeftAlignVerticalTabs/LeftAlignVerticalTabs.tsx +1 -8
- package/lib/infra/VerticalTabs/VerticalTabs/VerticalTabs.tsx +12 -12
- package/lib/infra/View/View.tsx +22 -21
- package/lib/template/AppShell/AppShell.tsx +25 -36
- package/lib/template/BannerPage/BannerPage.tsx +31 -26
- package/lib/template/CaseSummary/CaseSummary.tsx +8 -15
- package/lib/template/CaseView/CaseView.tsx +25 -24
- package/lib/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +19 -10
- package/lib/template/Confirmation/Confirmation.tsx +53 -27
- package/lib/template/DataReference/DataReference.tsx +52 -48
- package/lib/template/DefaultForm/DefaultForm.tsx +12 -14
- package/lib/template/Details/Details/Details.tsx +17 -16
- package/lib/template/Details/DetailsSubTabs/DetailsSubTabs.tsx +16 -13
- package/lib/template/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +18 -19
- package/lib/template/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +18 -20
- package/lib/template/FieldGroupTemplate/FieldGroupTemplate.tsx +28 -22
- package/lib/template/InlineDashboard/InlineDashboard.tsx +7 -11
- package/lib/template/InlineDashboardPage/InlineDashboardPage.tsx +17 -19
- package/lib/template/ListPage/ListPage.tsx +13 -14
- package/lib/template/ListView/ListView.tsx +186 -189
- package/lib/template/ListView/utils.ts +23 -170
- package/lib/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +19 -10
- package/lib/template/NarrowWide/NarrowWide/NarrowWide.tsx +1 -16
- package/lib/template/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +18 -19
- package/lib/template/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +1 -9
- package/lib/template/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +17 -17
- package/lib/template/OneColumn/OneColumn/OneColumn.tsx +7 -8
- package/lib/template/OneColumn/OneColumnPage/OneColumnPage.tsx +10 -10
- package/lib/template/OneColumn/OneColumnTab/OneColumnTab.tsx +7 -5
- package/lib/template/PromotedFilters/PromotedFilters.tsx +14 -16
- package/lib/template/SimpleTable/SimpleTable/SimpleTable.tsx +8 -102
- package/lib/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +7 -24
- package/lib/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +33 -23
- package/lib/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +36 -34
- package/lib/template/SubTabs/SubTabs.tsx +11 -10
- package/lib/template/SubTabs/tabUtils.ts +4 -0
- package/lib/template/TwoColumn/TwoColumn/TwoColumn.tsx +15 -10
- package/lib/template/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +10 -10
- package/lib/template/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +12 -10
- package/lib/template/WideNarrow/WideNarrow/WideNarrow.tsx +3 -17
- package/lib/template/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +25 -35
- package/lib/template/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +1 -7
- package/lib/template/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +17 -15
- package/lib/template/WssNavBar/WssNavBar.tsx +1 -18
- package/lib/widget/AppAnnouncement/AppAnnouncement.tsx +21 -13
- package/lib/widget/Attachment/Attachment.tsx +16 -28
- package/lib/widget/CaseHistory/CaseHistory.tsx +10 -12
- package/lib/widget/FileUtility/ActionButtonsForFileUtil/ActionButtonsForFileUtil.tsx +1 -13
- package/lib/widget/FileUtility/FileUtility/FileUtility.tsx +22 -35
- package/lib/widget/Followers/Followers.tsx +11 -10
- package/lib/widget/QuickCreate/QuickCreate.tsx +5 -11
- package/lib/widget/SummaryItem/SummaryItem.tsx +1 -11
- package/lib/widget/SummaryList/SummaryList.tsx +3 -17
- package/lib/widget/ToDo/ToDo.tsx +105 -62
- package/package.json +1 -1
- package/lib/designSystemExtension/RichTextEditor/RichTextEditor.tsx +0 -121
- package/lib/designSystemExtension/RichTextEditor/index.tsx +0 -1
- package/lib/field/RichText/RichText.tsx +0 -93
- package/lib/field/RichText/index.tsx +0 -1
- package/lib/field/ScalarList/ScalarList.tsx +0 -64
- package/lib/field/ScalarList/config-ext.json +0 -8
- package/lib/field/ScalarList/index.tsx +0 -1
- package/lib/helpers/authManager.ts +0 -933
|
@@ -1,23 +1,15 @@
|
|
|
1
1
|
import React, { useCallback, useMemo, useState, createElement, Fragment } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import Button from '@material-ui/core/Button';
|
|
3
4
|
|
|
4
5
|
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
6
|
+
import ListView from '@pega/react-sdk-components/lib/components/template/ListView';
|
|
5
7
|
import { isEmptyObject } from '@pega/react-sdk-components/lib/components/helpers/common-utils';
|
|
6
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
7
8
|
import './PromotedFilters.css';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
// Currently just expects "object"
|
|
13
|
-
// interface PromotedFilterProps extends PConnProps {
|
|
14
|
-
// // If any, enter additional props that only exist on this component
|
|
15
|
-
// viewName: string,
|
|
16
|
-
// filters: Array<any>,
|
|
17
|
-
// listViewProps: any,
|
|
18
|
-
// pageClass: string,
|
|
19
|
-
// parameters?: object
|
|
20
|
-
// }
|
|
12
|
+
declare const PCore: typeof PCoreType;
|
|
21
13
|
|
|
22
14
|
|
|
23
15
|
const localeCategory = 'SimpleTable';
|
|
@@ -67,10 +59,7 @@ function isValidInput(input) {
|
|
|
67
59
|
return Object.values(input).findIndex((v) => v) >= 0;
|
|
68
60
|
}
|
|
69
61
|
|
|
70
|
-
export default function PromotedFilters(props
|
|
71
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
72
|
-
const ListView = getComponentFromMap('ListView');
|
|
73
|
-
|
|
62
|
+
export default function PromotedFilters(props) {
|
|
74
63
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
75
64
|
const { getPConnect, viewName, filters, listViewProps, pageClass, parameters } = props;
|
|
76
65
|
const [initTable, setInitTable] = useState(false);
|
|
@@ -165,3 +154,12 @@ export default function PromotedFilters(props /* : PromotedFilterProps */) {
|
|
|
165
154
|
</Fragment>
|
|
166
155
|
);
|
|
167
156
|
}
|
|
157
|
+
|
|
158
|
+
PromotedFilters.propTypes = {
|
|
159
|
+
getPConnect: PropTypes.func.isRequired,
|
|
160
|
+
viewName: PropTypes.string.isRequired,
|
|
161
|
+
filters: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
162
|
+
listViewProps: PropTypes.objectOf(PropTypes.any).isRequired,
|
|
163
|
+
pageClass: PropTypes.string.isRequired,
|
|
164
|
+
parameters: PropTypes.object
|
|
165
|
+
};
|
|
@@ -1,120 +1,26 @@
|
|
|
1
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
1
|
import React from 'react';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
2
|
+
import FieldGroupTemplate from '@pega/react-sdk-components/lib/components/template/FieldGroupTemplate';
|
|
3
|
+
import SimpleTableManual from '@pega/react-sdk-components/lib/components/template/SimpleTable/SimpleTableManual';
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
// interface SimpleTableProps extends PConnProps {
|
|
11
|
-
// // If any, enter additional props that only exist on this component
|
|
12
|
-
// multiRecordDisplayAs: string,
|
|
13
|
-
// allowTableEdit: boolean,
|
|
14
|
-
// contextClass: any
|
|
15
|
-
// }
|
|
16
|
-
declare const PCore: any;
|
|
7
|
+
declare const PCore: typeof PCoreType;
|
|
17
8
|
|
|
18
|
-
export default function SimpleTable(props /* : SimpleTableProps */) {
|
|
19
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
20
|
-
const ListView = getComponentFromMap('ListView');
|
|
21
|
-
const FieldGroupTemplate = getComponentFromMap('FieldGroupTemplate');
|
|
22
|
-
const SimpleTableManual = getComponentFromMap('SimpleTableManual');
|
|
23
9
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
multiRecordDisplayAs,
|
|
27
|
-
allowTableEdit,
|
|
28
|
-
label: labelProp,
|
|
29
|
-
propertyLabel,
|
|
30
|
-
displayMode,
|
|
31
|
-
fieldMetadata,
|
|
32
|
-
hideLabel,
|
|
33
|
-
parameters,
|
|
34
|
-
isDataObject,
|
|
35
|
-
type,
|
|
36
|
-
ruleClass,
|
|
37
|
-
authorContext,
|
|
38
|
-
name
|
|
39
|
-
} = props;
|
|
10
|
+
export default function SimpleTable(props) {
|
|
11
|
+
const { getPConnect, multiRecordDisplayAs, allowTableEdit } = props;
|
|
40
12
|
|
|
41
13
|
let { contextClass } = props;
|
|
42
14
|
if (!contextClass) {
|
|
43
15
|
let listName = getPConnect().getComponentConfig().referenceList;
|
|
44
16
|
listName = PCore.getAnnotationUtils().getPropertyName(listName);
|
|
45
|
-
|
|
46
|
-
const theFieldMetadata = getPConnect().getFieldMetadata(listName);
|
|
47
|
-
if (theFieldMetadata) {
|
|
48
|
-
contextClass = theFieldMetadata['pageClass'];
|
|
49
|
-
} else {
|
|
50
|
-
contextClass = undefined;
|
|
51
|
-
}
|
|
17
|
+
contextClass = getPConnect().getFieldMetadata(listName)?.pageClass;
|
|
52
18
|
}
|
|
53
19
|
if (multiRecordDisplayAs === 'fieldGroup') {
|
|
54
20
|
const fieldGroupProps = { ...props, contextClass };
|
|
55
21
|
return <FieldGroupTemplate {...fieldGroupProps} />;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const label = labelProp || propertyLabel;
|
|
59
|
-
const propsToUse = { label, ...getPConnect().getInheritedProps() };
|
|
60
|
-
const isDisplayModeEnabled = displayMode === 'DISPLAY_ONLY';
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
fieldMetadata &&
|
|
64
|
-
fieldMetadata.type === 'Page List' &&
|
|
65
|
-
fieldMetadata.dataRetrievalType === 'refer'
|
|
66
|
-
) {
|
|
67
|
-
const {
|
|
68
|
-
children: [{ children: rawFields }],
|
|
69
|
-
parameters: rawParams
|
|
70
|
-
} = getPConnect().getRawMetadata().config;
|
|
71
|
-
if (isDisplayModeEnabled && hideLabel) {
|
|
72
|
-
propsToUse.label = '';
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const metaForListView = buildMetaForListView(
|
|
76
|
-
fieldMetadata,
|
|
77
|
-
rawFields,
|
|
78
|
-
type,
|
|
79
|
-
ruleClass,
|
|
80
|
-
name,
|
|
81
|
-
propsToUse.label,
|
|
82
|
-
isDataObject,
|
|
83
|
-
parameters // resolved params
|
|
84
|
-
);
|
|
85
|
-
|
|
86
|
-
const metaForPConnect = JSON.parse(JSON.stringify(metaForListView));
|
|
87
|
-
metaForPConnect.config.parameters =
|
|
88
|
-
rawParams ?? PCore.getMetadataUtils().getPropertyMetadata(name)?.datasource?.parameters;
|
|
89
|
-
|
|
90
|
-
const { referenceListStr: referenceList } = getContext(getPConnect());
|
|
91
|
-
let requiredContextForQueryInDisplayMode = {};
|
|
92
|
-
if (isDisplayModeEnabled) {
|
|
93
|
-
requiredContextForQueryInDisplayMode = {
|
|
94
|
-
referenceList
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
const options = {
|
|
98
|
-
context: getPConnect().getContextName(),
|
|
99
|
-
pageReference: getPConnect().getPageReference(),
|
|
100
|
-
...requiredContextForQueryInDisplayMode
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
const refToPConnect = useRef(
|
|
104
|
-
PCore.createPConnect({ meta: metaForPConnect, options }).getPConnect
|
|
105
|
-
).current; // getPConnect should be created only once.
|
|
106
|
-
/* BUG-637178 : need to send context */
|
|
107
|
-
const listViewProps = {
|
|
108
|
-
...metaForListView.config,
|
|
109
|
-
getPConnect: refToPConnect,
|
|
110
|
-
displayMode,
|
|
111
|
-
fieldName: authorContext,
|
|
112
|
-
bInForm: true
|
|
113
|
-
};
|
|
114
|
-
const listViewComponent = <ListView {...listViewProps} />;
|
|
115
|
-
return listViewComponent;
|
|
116
22
|
} else {
|
|
117
|
-
const simpleTableManualProps = {
|
|
23
|
+
const simpleTableManualProps = {...props, contextClass};
|
|
118
24
|
if (allowTableEdit === false) {
|
|
119
25
|
simpleTableManualProps.hideAddRow = true;
|
|
120
26
|
simpleTableManualProps.hideDeleteRow = true;
|
|
@@ -31,25 +31,10 @@ import Select from '@material-ui/core/Select';
|
|
|
31
31
|
import Button from '@material-ui/core/Button';
|
|
32
32
|
import TextField from '@material-ui/core/TextField';
|
|
33
33
|
|
|
34
|
-
import
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
hideAddRow?: boolean,
|
|
39
|
-
hideDeleteRow?: boolean,
|
|
40
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
41
|
-
disableDragDrop?: boolean
|
|
42
|
-
referenceList?: Array<any>,
|
|
43
|
-
children?: Array<any>,
|
|
44
|
-
renderMode?: string,
|
|
45
|
-
presets?: Array<any>,
|
|
46
|
-
label?: string,
|
|
47
|
-
showLabel?: boolean,
|
|
48
|
-
dataPageName?: string,
|
|
49
|
-
contextClass?: string,
|
|
50
|
-
propertyLabel?: string,
|
|
51
|
-
fieldMetadata?: any
|
|
52
|
-
}
|
|
34
|
+
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
35
|
+
|
|
36
|
+
declare const PCore: typeof PCoreType;
|
|
37
|
+
|
|
53
38
|
|
|
54
39
|
const useStyles = makeStyles((/* theme */) => ({
|
|
55
40
|
label: {
|
|
@@ -85,9 +70,7 @@ let menuColumnLabel = '';
|
|
|
85
70
|
|
|
86
71
|
const filterByColumns: Array<any> = [];
|
|
87
72
|
let myRows: Array<any>;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
export default function SimpleTableManual(props: SimpleTableManualProps) {
|
|
73
|
+
export default function SimpleTableManual(props) {
|
|
91
74
|
const classes = useStyles();
|
|
92
75
|
const {
|
|
93
76
|
getPConnect,
|
|
@@ -252,7 +235,7 @@ export default function SimpleTableManual(props: SimpleTableManualProps) {
|
|
|
252
235
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
253
236
|
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
254
237
|
} else {
|
|
255
|
-
pConn.getListActions().insert({ classID: contextClass }, referenceList.length
|
|
238
|
+
pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
|
|
256
239
|
}
|
|
257
240
|
};
|
|
258
241
|
|
|
@@ -260,7 +243,7 @@ export default function SimpleTableManual(props: SimpleTableManualProps) {
|
|
|
260
243
|
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
261
244
|
pConn.getListActions().deleteEntry(index, pageReference);
|
|
262
245
|
} else {
|
|
263
|
-
pConn.getListActions().deleteEntry(index
|
|
246
|
+
pConn.getListActions().deleteEntry(index);
|
|
264
247
|
}
|
|
265
248
|
};
|
|
266
249
|
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
1
2
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
+
import ListView from '@pega/react-sdk-components/lib/components/template/ListView';
|
|
4
|
+
import SimpleTable from '@pega/react-sdk-components/lib/components/template/SimpleTable/SimpleTable';
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
import PromotedFilters from '@pega/react-sdk-components/lib/components/template/PromotedFilters';
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
// label: string,
|
|
10
|
-
// referenceList: Array<object> | string,
|
|
11
|
-
// renderMode: string,
|
|
12
|
-
// showLabel: boolean,
|
|
13
|
-
// promptedFilters: Array<object>,
|
|
14
|
-
// viewName: string,
|
|
15
|
-
// parameters: any,
|
|
16
|
-
// readonlyContextList: Array<object> | string,
|
|
17
|
-
// dataRelationshipContext: string
|
|
18
|
-
// }
|
|
8
|
+
import PCoreType from '@pega/pcore-pconnect-typedefs/types/pcore';
|
|
9
|
+
|
|
10
|
+
declare const PCore: typeof PCoreType;
|
|
19
11
|
|
|
20
12
|
|
|
21
13
|
const isSelfReferencedProperty = (param, referenceProp) => {
|
|
@@ -27,13 +19,8 @@ const isSelfReferencedProperty = (param, referenceProp) => {
|
|
|
27
19
|
* SimpleTable react component
|
|
28
20
|
* @param {*} props - props
|
|
29
21
|
*/
|
|
30
|
-
export default function SimpleTableSelect(props
|
|
31
|
-
|
|
32
|
-
const ListView = getComponentFromMap('ListView');
|
|
33
|
-
const SimpleTable = getComponentFromMap('SimpleTable');
|
|
34
|
-
const PromotedFilters = getComponentFromMap('PromotedFilters');
|
|
35
|
-
|
|
36
|
-
const { label, getPConnect, renderMode = '', showLabel = true, viewName = '', parameters, dataRelationshipContext = null } = props;
|
|
22
|
+
export default function SimpleTableSelect(props) {
|
|
23
|
+
const { label, getPConnect, renderMode, showLabel, viewName, parameters, dataRelationshipContext } = props;
|
|
37
24
|
|
|
38
25
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
39
26
|
if (propsToUse.showLabel === false) {
|
|
@@ -58,7 +45,6 @@ export default function SimpleTableSelect(props /* : SimpleTableSelectProps */)
|
|
|
58
45
|
contextPageReference = pageReference.concat('.').concat(referenceProp);
|
|
59
46
|
}
|
|
60
47
|
|
|
61
|
-
// Need to get this written so typedefs work
|
|
62
48
|
const { datasource: { parameters: fieldParameters = {} } = {}, pageClass } = isMultiSelectMode
|
|
63
49
|
? pConn.getFieldMetadata(`@P .${referenceProp}`)
|
|
64
50
|
: pConn.getCurrentPageFieldMetadata(contextPageReference);
|
|
@@ -123,3 +109,27 @@ export default function SimpleTableSelect(props /* : SimpleTableSelectProps */)
|
|
|
123
109
|
}
|
|
124
110
|
return <ListView {...listViewProps} />;
|
|
125
111
|
}
|
|
112
|
+
|
|
113
|
+
SimpleTableSelect.defaultProps = {
|
|
114
|
+
label: undefined,
|
|
115
|
+
renderMode: '',
|
|
116
|
+
showLabel: true,
|
|
117
|
+
promptedFilters: [],
|
|
118
|
+
viewName: '',
|
|
119
|
+
parameters: undefined,
|
|
120
|
+
readonlyContextList: [],
|
|
121
|
+
dataRelationshipContext: null
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
SimpleTableSelect.propTypes = {
|
|
125
|
+
label: PropTypes.string,
|
|
126
|
+
getPConnect: PropTypes.func.isRequired,
|
|
127
|
+
referenceList: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.string]).isRequired,
|
|
128
|
+
renderMode: PropTypes.string,
|
|
129
|
+
showLabel: PropTypes.bool,
|
|
130
|
+
promptedFilters: PropTypes.arrayOf(PropTypes.object),
|
|
131
|
+
viewName: PropTypes.string,
|
|
132
|
+
parameters: PropTypes.objectOf(PropTypes.any),
|
|
133
|
+
readonlyContextList: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.string]),
|
|
134
|
+
dataRelationshipContext: PropTypes.string
|
|
135
|
+
};
|
|
@@ -1,35 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
1
|
+
import PropTypes from "prop-types";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
interface SingleReferenceReadOnlyProps extends PConnProps {
|
|
6
|
-
// If any, enter additional props that only exist on this component
|
|
7
|
-
config: any,
|
|
8
|
-
displayAs?: string,
|
|
9
|
-
ruleClass?: string,
|
|
10
|
-
label?: string,
|
|
11
|
-
displayMode?: string,
|
|
12
|
-
type: string,
|
|
13
|
-
referenceType?: string,
|
|
14
|
-
hideLabel?: boolean,
|
|
15
|
-
dataRelationshipContext?: string
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyProps) {
|
|
3
|
+
export default function SingleReferenceReadOnly(props) {
|
|
20
4
|
const {
|
|
21
5
|
getPConnect,
|
|
22
|
-
displayAs
|
|
23
|
-
ruleClass
|
|
24
|
-
label
|
|
25
|
-
type
|
|
26
|
-
displayMode
|
|
27
|
-
referenceType
|
|
28
|
-
hideLabel
|
|
29
|
-
dataRelationshipContext
|
|
6
|
+
displayAs,
|
|
7
|
+
ruleClass,
|
|
8
|
+
label,
|
|
9
|
+
type,
|
|
10
|
+
displayMode,
|
|
11
|
+
referenceType,
|
|
12
|
+
hideLabel,
|
|
13
|
+
dataRelationshipContext,
|
|
30
14
|
config
|
|
31
15
|
} = props;
|
|
32
|
-
|
|
33
16
|
const editableComponents = ["AutoComplete", "SimpleTableSelect", "Dropdown"];
|
|
34
17
|
|
|
35
18
|
if (editableComponents.includes(type)) {
|
|
@@ -45,7 +28,7 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
|
|
|
45
28
|
};
|
|
46
29
|
}
|
|
47
30
|
|
|
48
|
-
|
|
31
|
+
return getPConnect().createComponent({
|
|
49
32
|
type: 'SemanticLink',
|
|
50
33
|
config: {
|
|
51
34
|
...config,
|
|
@@ -55,10 +38,29 @@ export default function SingleReferenceReadOnly(props: SingleReferenceReadOnlyPr
|
|
|
55
38
|
hideLabel,
|
|
56
39
|
dataRelationshipContext
|
|
57
40
|
}
|
|
58
|
-
}
|
|
59
|
-
null, null, {}); // 2nd, 3rd, and 4th args empty string/object/null until typedef marked correctly as optional;
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<React.Fragment>{component}</React.Fragment>
|
|
63
|
-
)
|
|
41
|
+
});
|
|
64
42
|
}
|
|
43
|
+
|
|
44
|
+
SingleReferenceReadOnly.defaultProps = {
|
|
45
|
+
displayAs: "",
|
|
46
|
+
ruleClass: "",
|
|
47
|
+
label: "",
|
|
48
|
+
displayMode: "",
|
|
49
|
+
type: "",
|
|
50
|
+
referenceType: "",
|
|
51
|
+
hideLabel: false,
|
|
52
|
+
dataRelationshipContext: null
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
SingleReferenceReadOnly.propTypes = {
|
|
56
|
+
config: PropTypes.object,
|
|
57
|
+
getPConnect: PropTypes.func.isRequired,
|
|
58
|
+
displayAs: PropTypes.string,
|
|
59
|
+
ruleClass: PropTypes.string,
|
|
60
|
+
label: PropTypes.string,
|
|
61
|
+
displayMode: PropTypes.string,
|
|
62
|
+
type: PropTypes.string,
|
|
63
|
+
referenceType: PropTypes.string,
|
|
64
|
+
hideLabel: PropTypes.bool,
|
|
65
|
+
dataRelationshipContext: PropTypes.string
|
|
66
|
+
};
|
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
import React, { Fragment, useEffect, useState } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
import { Tab, Tabs } from "@material-ui/core";
|
|
3
4
|
import { TabContext, TabPanel } from '@material-ui/lab';
|
|
4
5
|
import { getTransientTabs, getVisibleTabs, tabClick } from './tabUtils';
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
interface SubTabsProps {
|
|
9
|
-
// If any, enter additional props that only exist on this component
|
|
10
|
-
children: Array<any>
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export default function SubTabs(props: SubTabsProps) {
|
|
15
|
-
const { children = [] } = props;
|
|
7
|
+
export default function SubTabs(props) {
|
|
8
|
+
const { children } = props;
|
|
16
9
|
|
|
17
10
|
const defaultTabIndex = 0;
|
|
18
11
|
const deferLoadedTabs = children[0];
|
|
@@ -62,3 +55,11 @@ export default function SubTabs(props: SubTabsProps) {
|
|
|
62
55
|
</Fragment>
|
|
63
56
|
);
|
|
64
57
|
}
|
|
58
|
+
|
|
59
|
+
SubTabs.defaultProps = {
|
|
60
|
+
children: []
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
SubTabs.propTypes = {
|
|
64
|
+
children: PropTypes.arrayOf(PropTypes.node)
|
|
65
|
+
};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
import { Grid, GridSize } from "@material-ui/core";
|
|
3
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
5
|
|
|
5
|
-
// TwoColumn does NOT have getPConnect. So, no need to extend from PConnProps
|
|
6
|
-
interface TwoColumnProps {
|
|
7
|
-
// If any, enter additional props that only exist on this component
|
|
8
|
-
children: Array<any>,
|
|
9
|
-
templateCol?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
6
|
const useStyles = makeStyles(() => ({
|
|
14
7
|
colStyles: {
|
|
15
8
|
display: "grid",
|
|
@@ -18,10 +11,10 @@ const useStyles = makeStyles(() => ({
|
|
|
18
11
|
},
|
|
19
12
|
}));
|
|
20
13
|
|
|
21
|
-
export default function TwoColumn(props
|
|
14
|
+
export default function TwoColumn(props) {
|
|
22
15
|
const classes = useStyles();
|
|
23
16
|
|
|
24
|
-
const {children, templateCol
|
|
17
|
+
const {children, templateCol} = props;
|
|
25
18
|
|
|
26
19
|
if (children.length !== 2) {
|
|
27
20
|
// eslint-disable-next-line no-console
|
|
@@ -51,3 +44,15 @@ export default function TwoColumn(props: TwoColumnProps) {
|
|
|
51
44
|
</Grid>
|
|
52
45
|
)
|
|
53
46
|
}
|
|
47
|
+
|
|
48
|
+
TwoColumn.propTypes = {
|
|
49
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
50
|
+
// title: PropTypes.string,
|
|
51
|
+
templateCol: PropTypes.string,
|
|
52
|
+
// icon: PropTypes.string
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
TwoColumn.defaultProps = {
|
|
56
|
+
templateCol: "1fr 1fr",
|
|
57
|
+
// icon: ""
|
|
58
|
+
};
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
// TwoColumnPage does NOT have getPConnect. So, no need to extend from PConnProps
|
|
5
|
-
interface TwoColumnPageProps{
|
|
6
|
-
// If any, enter additional props that only exist on this component
|
|
7
|
-
children: Array<any>
|
|
8
|
-
}
|
|
2
|
+
import PropTypes from "prop-types";
|
|
9
3
|
|
|
4
|
+
import TwoColumn from '@pega/react-sdk-components/lib/components/template/TwoColumn/TwoColumn';
|
|
10
5
|
|
|
11
6
|
/*
|
|
12
7
|
* The wrapper handles knowing how to take in just children
|
|
13
8
|
* and mapping to the TwoColumn template.
|
|
14
9
|
*/
|
|
15
|
-
export default function TwoColumnPage(props
|
|
16
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
17
|
-
const TwoColumn = getComponentFromMap('TwoColumn');
|
|
10
|
+
export default function TwoColumnPage(props) {
|
|
18
11
|
|
|
19
12
|
return (
|
|
20
13
|
<TwoColumn
|
|
@@ -22,3 +15,10 @@ export default function TwoColumnPage(props: TwoColumnPageProps) {
|
|
|
22
15
|
/>
|
|
23
16
|
);
|
|
24
17
|
}
|
|
18
|
+
|
|
19
|
+
TwoColumnPage.propTypes = {
|
|
20
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
TwoColumnPage.defaultProps = {
|
|
24
|
+
};
|
|
@@ -1,15 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
2
3
|
import { Grid, GridSize } from "@material-ui/core";
|
|
3
4
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
5
|
|
|
5
|
-
// TwoColumnTab does NOT have getPConnect. So, no need to extend from PConnProps
|
|
6
|
-
interface TwoColumnTabProps {
|
|
7
|
-
// If any, enter additional props that only exist on this component
|
|
8
|
-
children: Array<any>,
|
|
9
|
-
templateCol?: string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
6
|
const useStyles = makeStyles(() => ({
|
|
14
7
|
colStyles: {
|
|
15
8
|
display: "grid",
|
|
@@ -18,10 +11,10 @@ const useStyles = makeStyles(() => ({
|
|
|
18
11
|
},
|
|
19
12
|
}));
|
|
20
13
|
|
|
21
|
-
export default function TwoColumnTab(props
|
|
14
|
+
export default function TwoColumnTab(props) {
|
|
22
15
|
const classes = useStyles();
|
|
23
16
|
|
|
24
|
-
const {children, templateCol
|
|
17
|
+
const {children, templateCol} = props;
|
|
25
18
|
|
|
26
19
|
if (children.length !== 2) {
|
|
27
20
|
// eslint-disable-next-line no-console
|
|
@@ -51,3 +44,12 @@ export default function TwoColumnTab(props:TwoColumnTabProps) {
|
|
|
51
44
|
</Grid>
|
|
52
45
|
)
|
|
53
46
|
}
|
|
47
|
+
|
|
48
|
+
TwoColumnTab.propTypes = {
|
|
49
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
50
|
+
templateCol: PropTypes.string,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
TwoColumnTab.defaultProps = {
|
|
54
|
+
templateCol: "1fr 1fr",
|
|
55
|
+
};
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import './WideNarrow.css';
|
|
3
|
-
|
|
4
|
-
// WideNarrow does NOT have getPConnect. So, no need to extend from PConnProps
|
|
5
|
-
interface WideNarrowProps {
|
|
6
|
-
// If any, enter additional props that only exist on this component
|
|
7
|
-
a: any,
|
|
8
|
-
b: any,
|
|
9
|
-
children?: Array<any>,
|
|
10
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
11
|
-
title?: string,
|
|
12
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
13
|
-
cols?: string,
|
|
14
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
15
|
-
icon?: string
|
|
16
|
-
}
|
|
17
2
|
|
|
3
|
+
import './WideNarrow.css';
|
|
18
4
|
|
|
19
|
-
export default function WideNarrow(props
|
|
5
|
+
export default function WideNarrow(props) {
|
|
20
6
|
// const {a, b /*, cols, icon, title */ } = props;
|
|
21
|
-
const { a, b, children
|
|
7
|
+
const { a, b, children } = props;
|
|
22
8
|
|
|
23
9
|
return (
|
|
24
10
|
<React.Fragment>
|