@pega/react-sdk-overrides 0.23.6
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/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.css +19 -0
- package/lib/designSystemExtensions/CaseSummaryFields/CaseSummaryFields.tsx +156 -0
- package/lib/designSystemExtensions/CaseSummaryFields/index.tsx +1 -0
- package/lib/designSystemExtensions/DetailsFields/DetailsFields.tsx +154 -0
- package/lib/designSystemExtensions/DetailsFields/index.tsx +1 -0
- package/lib/designSystemExtensions/FieldGroup/FieldGroup.tsx +113 -0
- package/lib/designSystemExtensions/FieldGroup/index.tsx +1 -0
- package/lib/designSystemExtensions/FieldGroupList/FieldGroupList.tsx +53 -0
- package/lib/designSystemExtensions/FieldGroupList/index.tsx +1 -0
- package/lib/designSystemExtensions/FieldValueList/FieldValueList.tsx +106 -0
- package/lib/designSystemExtensions/FieldValueList/index.tsx +1 -0
- package/lib/designSystemExtensions/Operator/Operator.tsx +195 -0
- package/lib/designSystemExtensions/Operator/index.tsx +1 -0
- package/lib/designSystemExtensions/Pulse/Pulse.tsx +31 -0
- package/lib/designSystemExtensions/Pulse/index.tsx +1 -0
- package/lib/forms/AutoComplete/AutoComplete.tsx +183 -0
- package/lib/forms/AutoComplete/index.tsx +1 -0
- package/lib/forms/CancelAlert/CancelAlert.css +24 -0
- package/lib/forms/CancelAlert/CancelAlert.tsx +126 -0
- package/lib/forms/CancelAlert/index.tsx +1 -0
- package/lib/forms/Checkbox/Checkbox.tsx +68 -0
- package/lib/forms/Checkbox/index.tsx +1 -0
- package/lib/forms/Currency/Currency.tsx +89 -0
- package/lib/forms/Currency/index.tsx +1 -0
- package/lib/forms/Date/Date.tsx +79 -0
- package/lib/forms/Date/index.tsx +1 -0
- package/lib/forms/DateTime/DateTime.tsx +75 -0
- package/lib/forms/DateTime/index.tsx +1 -0
- package/lib/forms/Decimal/Decimal.tsx +51 -0
- package/lib/forms/Decimal/index.tsx +1 -0
- package/lib/forms/Dropdown/Dropdown.tsx +82 -0
- package/lib/forms/Dropdown/index.tsx +1 -0
- package/lib/forms/Email/Email.tsx +68 -0
- package/lib/forms/Email/index.tsx +1 -0
- package/lib/forms/Integer/Integer.tsx +77 -0
- package/lib/forms/Integer/index.tsx +1 -0
- package/lib/forms/Percentage/Percentage.tsx +82 -0
- package/lib/forms/Percentage/index.tsx +1 -0
- package/lib/forms/Phone/Phone.tsx +90 -0
- package/lib/forms/Phone/index.tsx +1 -0
- package/lib/forms/RadioButtons/RadioButtons.tsx +73 -0
- package/lib/forms/RadioButtons/index.tsx +1 -0
- package/lib/forms/SemanticLink/SemanticLink.tsx +69 -0
- package/lib/forms/SemanticLink/index.tsx +1 -0
- package/lib/forms/SemanticLink/utils.ts +51 -0
- package/lib/forms/TextArea/TextArea.tsx +66 -0
- package/lib/forms/TextArea/index.tsx +1 -0
- package/lib/forms/TextContent/TextContent.tsx +40 -0
- package/lib/forms/TextContent/index.tsx +1 -0
- package/lib/forms/TextInput/TextInput.tsx +61 -0
- package/lib/forms/TextInput/index.tsx +1 -0
- package/lib/forms/Time/Time.tsx +71 -0
- package/lib/forms/Time/index.tsx +1 -0
- package/lib/forms/URL/URL.tsx +53 -0
- package/lib/forms/URL/index.tsx +1 -0
- package/lib/forms/UserReference/UserReference.tsx +197 -0
- package/lib/forms/UserReference/UserReferenceUtils.ts +13 -0
- package/lib/forms/UserReference/index.tsx +1 -0
- package/lib/helpers/auth.js +483 -0
- package/lib/helpers/authManager.js +630 -0
- package/lib/helpers/config_access.js +268 -0
- package/lib/helpers/data_page.ts +24 -0
- package/lib/helpers/event-utils.js +20 -0
- package/lib/helpers/field-group-utils.js +61 -0
- package/lib/helpers/formatters/Boolean.js +38 -0
- package/lib/helpers/formatters/Currency.js +74 -0
- package/lib/helpers/formatters/CurrencyMap.js +908 -0
- package/lib/helpers/formatters/Date.js +77 -0
- package/lib/helpers/formatters/common.js +10 -0
- package/lib/helpers/formatters/index.js +120 -0
- package/lib/helpers/utils.ts +334 -0
- package/lib/helpers/versionHelpers.ts +50 -0
- package/lib/infra/ActionButtons/ActionButtons.tsx +70 -0
- package/lib/infra/ActionButtons/index.tsx +1 -0
- package/lib/infra/Assignment/Assignment.tsx +301 -0
- package/lib/infra/Assignment/index.tsx +1 -0
- package/lib/infra/AssignmentCard/AssignmentCard.tsx +47 -0
- package/lib/infra/AssignmentCard/index.tsx +1 -0
- package/lib/infra/Attachment/Attachment.css +18 -0
- package/lib/infra/Attachment/Attachment.tsx +404 -0
- package/lib/infra/Attachment/AttachmentUtils.js +71 -0
- package/lib/infra/Attachment/index.tsx +1 -0
- package/lib/infra/Containers/FlowContainer/FlowContainer.tsx +511 -0
- package/lib/infra/Containers/FlowContainer/helpers.js +147 -0
- package/lib/infra/Containers/FlowContainer/index.tsx +1 -0
- package/lib/infra/Containers/ModalViewContainer/ModalViewContainer.tsx +320 -0
- package/lib/infra/Containers/ModalViewContainer/index.tsx +1 -0
- package/lib/infra/Containers/ViewContainer/ViewContainer.tsx +216 -0
- package/lib/infra/Containers/ViewContainer/index.tsx +1 -0
- package/lib/infra/DashboardFilter/DashboardFilter.tsx +180 -0
- package/lib/infra/DashboardFilter/filterUtils.tsx +188 -0
- package/lib/infra/DashboardFilter/index.tsx +1 -0
- package/lib/infra/DeferLoad/DeferLoad.tsx +175 -0
- package/lib/infra/DeferLoad/index.tsx +1 -0
- package/lib/infra/ErrorBoundary/ErrorBoundary.tsx +103 -0
- package/lib/infra/ErrorBoundary/index.tsx +1 -0
- package/lib/infra/MultiStep/MultiStep.css +261 -0
- package/lib/infra/MultiStep/MultiStep.tsx +225 -0
- package/lib/infra/MultiStep/index.tsx +1 -0
- package/lib/infra/NavBar/NavBar.css +170 -0
- package/lib/infra/NavBar/NavBar.tsx +393 -0
- package/lib/infra/NavBar/index.tsx +1 -0
- package/lib/infra/Reference/Reference.tsx +58 -0
- package/lib/infra/Reference/index.tsx +1 -0
- package/lib/infra/Region/Region.tsx +17 -0
- package/lib/infra/Region/index.tsx +1 -0
- package/lib/infra/RootContainer/RootContainer.tsx +336 -0
- package/lib/infra/RootContainer/index.tsx +1 -0
- package/lib/infra/Stages/Stages.tsx +120 -0
- package/lib/infra/Stages/index.tsx +1 -0
- package/lib/infra/ToDo/ToDo.css +87 -0
- package/lib/infra/ToDo/ToDo.tsx +285 -0
- package/lib/infra/ToDo/index.tsx +1 -0
- package/lib/infra/VerticalTabs/LeftAlignVerticalTab.tsx +27 -0
- package/lib/infra/VerticalTabs/VerticalTabs.tsx +75 -0
- package/lib/infra/VerticalTabs/index.tsx +1 -0
- package/lib/infra/View/View.css +8 -0
- package/lib/infra/View/View.tsx +175 -0
- package/lib/infra/View/index.tsx +1 -0
- package/lib/templates/AppShell/AppShell.css +40 -0
- package/lib/templates/AppShell/AppShell.tsx +439 -0
- package/lib/templates/AppShell/index.tsx +1 -0
- package/lib/templates/CaseSummary/CaseSummary.tsx +50 -0
- package/lib/templates/CaseSummary/index.tsx +1 -0
- package/lib/templates/CaseView/CaseView.tsx +261 -0
- package/lib/templates/CaseView/CaseViewActionsMenu.tsx +73 -0
- package/lib/templates/CaseView/index.tsx +1 -0
- package/lib/templates/DataReference/DataReference.tsx +290 -0
- package/lib/templates/DataReference/index.tsx +1 -0
- package/lib/templates/DefaultForm/DefaultForm.css +25 -0
- package/lib/templates/DefaultForm/DefaultForm.tsx +52 -0
- package/lib/templates/DefaultForm/index.tsx +1 -0
- package/lib/templates/Details/Details/Details.tsx +35 -0
- package/lib/templates/Details/Details/index.tsx +1 -0
- package/lib/templates/Details/DetailsSubTabs/DetailsSubTabs.tsx +65 -0
- package/lib/templates/Details/DetailsSubTabs/index.tsx +1 -0
- package/lib/templates/Details/DetailsThreeColumn/DetailsThreeColumn.tsx +45 -0
- package/lib/templates/Details/DetailsThreeColumn/index.tsx +1 -0
- package/lib/templates/Details/DetailsTwoColumn/DetailsTwoColumn.tsx +43 -0
- package/lib/templates/Details/DetailsTwoColumn/index.tsx +1 -0
- package/lib/templates/FieldGroupTemplate/FieldGroupTemplate.tsx +94 -0
- package/lib/templates/FieldGroupTemplate/index.tsx +1 -0
- package/lib/templates/InlineDashboard/InlineDashboard.tsx +72 -0
- package/lib/templates/InlineDashboard/index.tsx +1 -0
- package/lib/templates/InlineDashboardPage/InlineDashboardPage.tsx +41 -0
- package/lib/templates/InlineDashboardPage/index.tsx +1 -0
- package/lib/templates/ListPage/ListPage.tsx +20 -0
- package/lib/templates/ListPage/index.tsx +1 -0
- package/lib/templates/ListView/ListView.css +10 -0
- package/lib/templates/ListView/ListView.tsx +1230 -0
- package/lib/templates/ListView/index.tsx +1 -0
- package/lib/templates/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +42 -0
- package/lib/templates/MultiReferenceReadOnly/index.tsx +1 -0
- package/lib/templates/NarrowWide/NarrowWide/NarrowWide.css +21 -0
- package/lib/templates/NarrowWide/NarrowWide/NarrowWide.tsx +35 -0
- package/lib/templates/NarrowWide/NarrowWide/index.tsx +1 -0
- package/lib/templates/NarrowWide/NarrowWideDetails/NarrowWideDetails.tsx +53 -0
- package/lib/templates/NarrowWide/NarrowWideDetails/index.tsx +1 -0
- package/lib/templates/NarrowWide/NarrowWideForm/NarrowWideForm.css +21 -0
- package/lib/templates/NarrowWide/NarrowWideForm/NarrowWideForm.tsx +24 -0
- package/lib/templates/NarrowWide/NarrowWideForm/index.tsx +1 -0
- package/lib/templates/NarrowWide/NarrowWidePage/NarrowWidePage.tsx +38 -0
- package/lib/templates/NarrowWide/NarrowWidePage/index.tsx +1 -0
- package/lib/templates/OneColumn/OneColumn/OneColumn.tsx +32 -0
- package/lib/templates/OneColumn/OneColumn/index.tsx +1 -0
- package/lib/templates/OneColumn/OneColumnPage/OneColumnPage.tsx +24 -0
- package/lib/templates/OneColumn/OneColumnPage/index.tsx +1 -0
- package/lib/templates/OneColumn/OneColumnTab/OneColumnTab.tsx +17 -0
- package/lib/templates/OneColumn/OneColumnTab/index.tsx +1 -0
- package/lib/templates/PromotedFilters/PromotedFilters.css +7 -0
- package/lib/templates/PromotedFilters/PromotedFilters.tsx +160 -0
- package/lib/templates/PromotedFilters/index.tsx +1 -0
- package/lib/templates/SimpleTable/SimpleTable/SimpleTable.tsx +28 -0
- package/lib/templates/SimpleTable/SimpleTable/index.tsx +1 -0
- package/lib/templates/SimpleTable/SimpleTableManual/SimpleTableManual.tsx +719 -0
- package/lib/templates/SimpleTable/SimpleTableManual/index.tsx +1 -0
- package/lib/templates/SimpleTable/SimpleTableSelect/SimpleTableSelect.tsx +129 -0
- package/lib/templates/SimpleTable/SimpleTableSelect/index.tsx +1 -0
- package/lib/templates/SimpleTable/helpers.ts +360 -0
- package/lib/templates/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +66 -0
- package/lib/templates/SingleReferenceReadOnly/index.tsx +1 -0
- package/lib/templates/SubTabs/SubTabs.tsx +65 -0
- package/lib/templates/SubTabs/index.tsx +1 -0
- package/lib/templates/SubTabs/tabUtils.ts +73 -0
- package/lib/templates/TwoColumn/TwoColumn/TwoColumn.css +13 -0
- package/lib/templates/TwoColumn/TwoColumn/TwoColumn.tsx +58 -0
- package/lib/templates/TwoColumn/TwoColumn/index.tsx +1 -0
- package/lib/templates/TwoColumn/TwoColumnPage/TwoColumnPage.tsx +25 -0
- package/lib/templates/TwoColumn/TwoColumnPage/index.tsx +1 -0
- package/lib/templates/TwoColumn/TwoColumnTab/TwoColumnTab.css +12 -0
- package/lib/templates/TwoColumn/TwoColumnTab/TwoColumnTab.tsx +55 -0
- package/lib/templates/TwoColumn/TwoColumnTab/index.tsx +1 -0
- package/lib/templates/WideNarrow/WideNarrow/WideNarrow.css +21 -0
- package/lib/templates/WideNarrow/WideNarrow/WideNarrow.tsx +35 -0
- package/lib/templates/WideNarrow/WideNarrow/index.tsx +1 -0
- package/lib/templates/WideNarrow/WideNarrowDetails/WideNarrowDetails.tsx +54 -0
- package/lib/templates/WideNarrow/WideNarrowDetails/index.tsx +1 -0
- package/lib/templates/WideNarrow/WideNarrowForm/WideNarrowForm.css +21 -0
- package/lib/templates/WideNarrow/WideNarrowForm/WideNarrowForm.tsx +24 -0
- package/lib/templates/WideNarrow/WideNarrowForm/index.tsx +1 -0
- package/lib/templates/WideNarrow/WideNarrowPage/WideNarrowPage.tsx +38 -0
- package/lib/templates/WideNarrow/WideNarrowPage/index.tsx +1 -0
- package/lib/templates/utils.ts +23 -0
- package/lib/widgets/AppAnnouncement/AppAnnouncement.tsx +67 -0
- package/lib/widgets/AppAnnouncement/index.tsx +1 -0
- package/lib/widgets/CaseHistory/CaseHistory.tsx +169 -0
- package/lib/widgets/CaseHistory/index.tsx +1 -0
- package/lib/widgets/FileUtility/ActionButtonsForFileUtil.css +27 -0
- package/lib/widgets/FileUtility/ActionButtonsForFileUtil.tsx +22 -0
- package/lib/widgets/FileUtility/FileUtility.css +117 -0
- package/lib/widgets/FileUtility/FileUtility.tsx +567 -0
- package/lib/widgets/FileUtility/index.tsx +0 -0
- package/lib/widgets/Followers/Followers.tsx +43 -0
- package/lib/widgets/Followers/index.tsx +1 -0
- package/lib/widgets/SummaryItem/SummaryItem.css +78 -0
- package/lib/widgets/SummaryItem/SummaryItem.tsx +80 -0
- package/lib/widgets/SummaryItem/index.tsx +1 -0
- package/lib/widgets/SummaryList/SummaryList.tsx +12 -0
- package/lib/widgets/SummaryList/index.tsx +1 -0
- package/package.json +14 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { createElement } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import createPConnectComponent from '@pega/react-sdk-components/lib/bridge/react_pconnect';
|
|
5
|
+
|
|
6
|
+
import './DefaultForm.css';
|
|
7
|
+
|
|
8
|
+
export default function DefaultForm(props) {
|
|
9
|
+
const { getPConnect, NumCols } = props;
|
|
10
|
+
|
|
11
|
+
let divClass: string;
|
|
12
|
+
|
|
13
|
+
const numCols = NumCols || "1";
|
|
14
|
+
switch (numCols) {
|
|
15
|
+
case "1" :
|
|
16
|
+
divClass = "psdk-default-form-one-column";
|
|
17
|
+
break;
|
|
18
|
+
case "2" :
|
|
19
|
+
divClass = "psdk-default-form-two-column";
|
|
20
|
+
break;
|
|
21
|
+
case "3" :
|
|
22
|
+
divClass = "psdk-default-form-three-column";
|
|
23
|
+
break;
|
|
24
|
+
default :
|
|
25
|
+
divClass = "psdk-default-form-one-column";
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// debugger;
|
|
30
|
+
|
|
31
|
+
// repoint the children because they are in a region and we need to not render the region
|
|
32
|
+
// to take the children and create components for them, put in an array and pass as the
|
|
33
|
+
// defaultForm kids
|
|
34
|
+
const arChildren = getPConnect().getChildren()[0].getPConnect().getChildren();
|
|
35
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
36
|
+
const dfChildren = arChildren.map((kid, idx) => createElement(createPConnectComponent(), {...kid, key: idx}));
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className={divClass}>
|
|
40
|
+
{dfChildren}
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
DefaultForm.propTypes = {
|
|
46
|
+
// children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
47
|
+
NumCols: PropTypes.string
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
DefaultForm.defaultProps = {
|
|
51
|
+
NumCols: "1"
|
|
52
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DefaultForm';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
// import PropTypes from "prop-types";
|
|
3
|
+
import Grid from '@material-ui/core/Grid';
|
|
4
|
+
import DetailsFields from '@pega/react-sdk-components/lib/components/designSystemExtensions/DetailsFields';
|
|
5
|
+
|
|
6
|
+
export default function Details(props) {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
const arFields: Array<any> = [];
|
|
9
|
+
|
|
10
|
+
for (const child of children) {
|
|
11
|
+
const theChildPConn = child.props.getPConnect();
|
|
12
|
+
theChildPConn.setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
13
|
+
theChildPConn.setInheritedProp('readOnly', true);
|
|
14
|
+
const theChildrenOfChild = theChildPConn.getChildren();
|
|
15
|
+
arFields.push(theChildrenOfChild);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div id="DetailsOneColumn">
|
|
20
|
+
<Grid container spacing={1}>
|
|
21
|
+
<Grid item xs={12}>
|
|
22
|
+
<DetailsFields fields={arFields[0]} />
|
|
23
|
+
</Grid>
|
|
24
|
+
</Grid>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
Details.defaultProps = {
|
|
30
|
+
// children: []
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
Details.propTypes = {
|
|
34
|
+
// children: PropTypes.arrayOf(PropTypes.node)
|
|
35
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Details';
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { useState, useEffect, Fragment } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { getTransientTabs, getVisibleTabs, tabClick } from '@pega/react-sdk-components/lib/components/templates/SubTabs/tabUtils';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { Tab, Tabs, TextField } from '@material-ui/core';
|
|
6
|
+
import { TabContext, TabPanel } from '@material-ui/lab';
|
|
7
|
+
|
|
8
|
+
export default function DetailsSubTabs(props) {
|
|
9
|
+
const { children, label, showLabel, getPConnect } = props;
|
|
10
|
+
// Get the inherited props from the parent to determine label settings
|
|
11
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
12
|
+
|
|
13
|
+
const defaultTabIndex = 0;
|
|
14
|
+
const deferLoadedTabs = children[0];
|
|
15
|
+
let availableTabs = [];
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
availableTabs = getVisibleTabs(deferLoadedTabs, 'detailsSubTabs');
|
|
19
|
+
}, [availableTabs]);
|
|
20
|
+
|
|
21
|
+
const [currentTabId, setCurrentTabId] = useState(defaultTabIndex.toString());
|
|
22
|
+
|
|
23
|
+
const [tabItems, setTabitem] = useState([]);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const tempTabItems = getTransientTabs(availableTabs, currentTabId, tabItems);
|
|
26
|
+
setTabitem(tempTabItems);
|
|
27
|
+
}, [currentTabId]);
|
|
28
|
+
|
|
29
|
+
const handleTabClick = (id, index: string) => {
|
|
30
|
+
setCurrentTabId(index);
|
|
31
|
+
tabClick(index, availableTabs, currentTabId, setCurrentTabId, tabItems);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<Fragment>
|
|
36
|
+
{propsToUse.showLabel && <TextField>{propsToUse.label}</TextField>}
|
|
37
|
+
<TabContext value={currentTabId.toString()}>
|
|
38
|
+
<Tabs onChange={handleTabClick} value={currentTabId}>
|
|
39
|
+
{tabItems.map((tab: any) => (
|
|
40
|
+
<Tab key={tab.id} label={tab.name} value={tab.id} />
|
|
41
|
+
))}
|
|
42
|
+
</Tabs>
|
|
43
|
+
|
|
44
|
+
{tabItems.map((tab: any) => (
|
|
45
|
+
<TabPanel key={tab.id} value={tab.id} tabIndex={+tab.id}>
|
|
46
|
+
<div>{tab.content ? tab.content : 'No content exists'}</div>
|
|
47
|
+
</TabPanel>
|
|
48
|
+
))}
|
|
49
|
+
</TabContext>
|
|
50
|
+
</Fragment>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
DetailsSubTabs.defaultProps = {
|
|
55
|
+
children: [],
|
|
56
|
+
label: undefined,
|
|
57
|
+
showLabel: true
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
DetailsSubTabs.propTypes = {
|
|
61
|
+
children: PropTypes.arrayOf(PropTypes.node),
|
|
62
|
+
showLabel: PropTypes.bool,
|
|
63
|
+
label: PropTypes.string,
|
|
64
|
+
getPConnect: PropTypes.func.isRequired
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DetailsSubTabs';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
// import PropTypes from "prop-types";
|
|
3
|
+
import Grid from '@material-ui/core/Grid';
|
|
4
|
+
import DetailsFields from '@pega/react-sdk-components/lib/components/designSystemExtensions/DetailsFields';
|
|
5
|
+
|
|
6
|
+
export default function DetailsThreeColumn(props) {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
const arFields: Array<any> = [];
|
|
9
|
+
|
|
10
|
+
for (const child of children) {
|
|
11
|
+
const theChildPConn = child.props.getPConnect();
|
|
12
|
+
theChildPConn.setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
13
|
+
theChildPConn.setInheritedProp('readOnly', true);
|
|
14
|
+
const theChildrenOfChild = theChildPConn.getChildren();
|
|
15
|
+
arFields.push(theChildrenOfChild);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (arFields.length !== 3) {
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.error(`DetailsThreeColumn expects 3 children and received ${arFields.length}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div id='DetailsThreeColumn'>
|
|
25
|
+
<Grid container spacing={1}>
|
|
26
|
+
<Grid item xs={4}>
|
|
27
|
+
<DetailsFields fields={arFields[0]} />
|
|
28
|
+
</Grid>
|
|
29
|
+
<Grid item xs={4}>
|
|
30
|
+
<DetailsFields fields={arFields[1]} />
|
|
31
|
+
</Grid>
|
|
32
|
+
<Grid item xs={4}>
|
|
33
|
+
<DetailsFields fields={arFields[2]} />
|
|
34
|
+
</Grid>
|
|
35
|
+
</Grid>
|
|
36
|
+
</div>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
DetailsThreeColumn.propTypes = {
|
|
41
|
+
// showLabel: PropTypes.bool,
|
|
42
|
+
// label: PropTypes.string,
|
|
43
|
+
// getPConnect: PropTypes.func.isRequired,
|
|
44
|
+
// template: PropTypes.string.isRequired
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DetailsThreeColumn';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
// import PropTypes from "prop-types";
|
|
3
|
+
import Grid from '@material-ui/core/Grid';
|
|
4
|
+
import DetailsFields from '@pega/react-sdk-components/lib/components/designSystemExtensions/DetailsFields';
|
|
5
|
+
|
|
6
|
+
export default function DetailsTwoColumn(props) {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
const arFields: Array<any> = [];
|
|
9
|
+
|
|
10
|
+
for (const child of children) {
|
|
11
|
+
const theChildPConn = child.props.getPConnect();
|
|
12
|
+
theChildPConn.setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
13
|
+
theChildPConn.setInheritedProp('readOnly', true);
|
|
14
|
+
const theChildrenOfChild = theChildPConn.getChildren();
|
|
15
|
+
arFields.push(theChildrenOfChild);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (arFields.length !== 2) {
|
|
19
|
+
// eslint-disable-next-line no-console
|
|
20
|
+
console.error(`DetailsTwoColumn expects 2 children and received ${arFields.length}`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div id="DetailsTwoColumn">
|
|
26
|
+
<Grid container spacing={1}>
|
|
27
|
+
<Grid item xs={6}>
|
|
28
|
+
<DetailsFields fields={arFields[0]} />
|
|
29
|
+
</Grid>
|
|
30
|
+
<Grid item xs={6}>
|
|
31
|
+
<DetailsFields fields={arFields[1]} />
|
|
32
|
+
</Grid>
|
|
33
|
+
</Grid>
|
|
34
|
+
</div>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
DetailsTwoColumn.propTypes = {
|
|
39
|
+
// showLabel: PropTypes.bool,
|
|
40
|
+
// label: PropTypes.string,
|
|
41
|
+
// getPConnect: PropTypes.func.isRequired,
|
|
42
|
+
// template: PropTypes.string.isRequired
|
|
43
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './DetailsTwoColumn';
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/* eslint-disable react-hooks/rules-of-hooks */
|
|
2
|
+
import React, { useMemo } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldGroup';
|
|
6
|
+
import FieldGroupList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldGroupList';
|
|
7
|
+
import { getReferenceList, buildView } from '@pega/react-sdk-components/lib/components/helpers/field-group-utils';
|
|
8
|
+
|
|
9
|
+
declare const PCore: any;
|
|
10
|
+
|
|
11
|
+
export default function FieldGroupTemplate(props) {
|
|
12
|
+
const {
|
|
13
|
+
referenceList,
|
|
14
|
+
renderMode,
|
|
15
|
+
contextClass,
|
|
16
|
+
getPConnect,
|
|
17
|
+
lookForChildInConfig,
|
|
18
|
+
heading,
|
|
19
|
+
displayMode
|
|
20
|
+
} = props;
|
|
21
|
+
const pConn = getPConnect();
|
|
22
|
+
const resolvedList = getReferenceList(pConn);
|
|
23
|
+
pConn.setReferenceList(resolvedList);
|
|
24
|
+
const pageReference = `${pConn.getPageReference()}${resolvedList}`;
|
|
25
|
+
const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';
|
|
26
|
+
const HEADING = heading ?? 'Row';
|
|
27
|
+
|
|
28
|
+
const addRecord = () => {
|
|
29
|
+
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
30
|
+
pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);
|
|
31
|
+
} else {
|
|
32
|
+
pConn.getListActions().insert({ classID: contextClass }, referenceList.length);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (!isReadonlyMode) {
|
|
37
|
+
const addFieldGroupItem = () => {
|
|
38
|
+
addRecord();
|
|
39
|
+
};
|
|
40
|
+
const deleteFieldGroupItem = index => {
|
|
41
|
+
if (PCore.getPCoreVersion()?.includes('8.7')) {
|
|
42
|
+
pConn.getListActions().deleteEntry(index, pageReference);
|
|
43
|
+
} else {
|
|
44
|
+
pConn.getListActions().deleteEntry(index);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
if (referenceList.length === 0) {
|
|
48
|
+
addFieldGroupItem();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const MemoisedChildren = useMemo(() => {
|
|
52
|
+
return referenceList.map((item, index) => ({
|
|
53
|
+
id: index,
|
|
54
|
+
name: `${HEADING} ${index + 1}`,
|
|
55
|
+
children: buildView(pConn, index, lookForChildInConfig)
|
|
56
|
+
}));
|
|
57
|
+
}, [referenceList?.length]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<FieldGroupList
|
|
61
|
+
items={MemoisedChildren}
|
|
62
|
+
onAdd={addFieldGroupItem}
|
|
63
|
+
onDelete={deleteFieldGroupItem}
|
|
64
|
+
/>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
pConn.setInheritedProp('displayMode', 'LABELS_LEFT');
|
|
69
|
+
const memoisedReadOnlyList = useMemo(() => {
|
|
70
|
+
return referenceList.map((item, index) => (
|
|
71
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
72
|
+
<FieldGroup item={item} key={index} name={`${HEADING} ${index + 1}`} />
|
|
73
|
+
));
|
|
74
|
+
}, []);
|
|
75
|
+
|
|
76
|
+
return <div>{memoisedReadOnlyList}</div>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
FieldGroupTemplate.defaultProps = {
|
|
80
|
+
referenceList: [],
|
|
81
|
+
heading: undefined,
|
|
82
|
+
contextClass: null,
|
|
83
|
+
displayMode: undefined
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
FieldGroupTemplate.propTypes = {
|
|
87
|
+
referenceList: PropTypes.arrayOf(Object),
|
|
88
|
+
contextClass: PropTypes.string,
|
|
89
|
+
getPConnect: PropTypes.func.isRequired,
|
|
90
|
+
renderMode: PropTypes.string.isRequired,
|
|
91
|
+
heading: PropTypes.string,
|
|
92
|
+
lookForChildInConfig: PropTypes.bool,
|
|
93
|
+
displayMode: PropTypes.string
|
|
94
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './FieldGroupTemplate';
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Grid, Typography } from '@material-ui/core';
|
|
4
|
+
import { makeStyles } from '@material-ui/core/styles';
|
|
5
|
+
|
|
6
|
+
const useStyles = makeStyles((/* theme */) => ({
|
|
7
|
+
headerStyles: {
|
|
8
|
+
fontWeight: 500,
|
|
9
|
+
fontSize: '1.25rem'
|
|
10
|
+
},
|
|
11
|
+
containerStyles: {
|
|
12
|
+
marginTop: '1rem',
|
|
13
|
+
marginBottom: '1rem'
|
|
14
|
+
},
|
|
15
|
+
colStyles: {
|
|
16
|
+
display: 'grid',
|
|
17
|
+
gap: '1rem',
|
|
18
|
+
alignContent: 'baseline'
|
|
19
|
+
},
|
|
20
|
+
filterContainerStyles: {
|
|
21
|
+
display: 'grid',
|
|
22
|
+
gap: '1rem',
|
|
23
|
+
gridTemplateColumns: 'repeat(7, 1fr);'
|
|
24
|
+
},
|
|
25
|
+
inlineStyles: {
|
|
26
|
+
display: 'grid',
|
|
27
|
+
gap: '1rem',
|
|
28
|
+
alignContent: 'baseline',
|
|
29
|
+
marginTop: '1rem'
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
export default function InlineDashboard(props) {
|
|
34
|
+
const classes = useStyles();
|
|
35
|
+
|
|
36
|
+
const { children, title, filterPosition } = props;
|
|
37
|
+
|
|
38
|
+
const direction = filterPosition === 'inline-start' ? 'row-reverse' : 'row';
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<Typography variant='h4' className={classes.headerStyles}>
|
|
42
|
+
{title}
|
|
43
|
+
</Typography>
|
|
44
|
+
|
|
45
|
+
{filterPosition === 'block-start' && (
|
|
46
|
+
<Grid container spacing={2} direction='column-reverse' className={classes.containerStyles}>
|
|
47
|
+
<Grid item xs={12} className={classes.colStyles}>
|
|
48
|
+
{children[0]}
|
|
49
|
+
</Grid>
|
|
50
|
+
<Grid item xs={12} className={classes.filterContainerStyles}>
|
|
51
|
+
{children[1]}
|
|
52
|
+
</Grid>
|
|
53
|
+
</Grid>
|
|
54
|
+
)}
|
|
55
|
+
{filterPosition !== 'block-start' && (
|
|
56
|
+
<Grid container spacing={2} direction={direction} className={classes.containerStyles}>
|
|
57
|
+
<Grid item xs={9}>
|
|
58
|
+
{children[0]}
|
|
59
|
+
</Grid>
|
|
60
|
+
<Grid item xs={3} className={classes.inlineStyles}>
|
|
61
|
+
{children[1]}
|
|
62
|
+
</Grid>
|
|
63
|
+
</Grid>
|
|
64
|
+
)}
|
|
65
|
+
</>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
InlineDashboard.propTypes = {
|
|
70
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired
|
|
71
|
+
// template: PropTypes.string.isRequired
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './InlineDashboard';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useMemo, Children, useEffect, useState } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import { buildFilterComponents } from '@pega/react-sdk-components/lib/components/infra/DashboardFilter/filterUtils';
|
|
6
|
+
import InlineDashboard from '@pega/react-sdk-components/lib/components/templates/InlineDashboard';
|
|
7
|
+
|
|
8
|
+
export default function InlineDashboardPage(props) {
|
|
9
|
+
const { children, getPConnect } = props;
|
|
10
|
+
const [filterComponents, setFilterComponents] = useState([]);
|
|
11
|
+
const childArray = useMemo(() => {
|
|
12
|
+
return Children.toArray(children);
|
|
13
|
+
}, [children]);
|
|
14
|
+
|
|
15
|
+
const allFilters = getPConnect().getRawMetadata().children[1];
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
setFilterComponents(buildFilterComponents(getPConnect, allFilters));
|
|
19
|
+
}, []);
|
|
20
|
+
|
|
21
|
+
const inlineProps = props;
|
|
22
|
+
// Region layout views
|
|
23
|
+
inlineProps.children[0] = childArray[0];
|
|
24
|
+
// filter items
|
|
25
|
+
inlineProps.children[1] = filterComponents;
|
|
26
|
+
|
|
27
|
+
return <InlineDashboard {...inlineProps} />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
InlineDashboardPage.propTypes = {
|
|
31
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
32
|
+
getPConnect: PropTypes.func.isRequired,
|
|
33
|
+
title: PropTypes.string.isRequired,
|
|
34
|
+
icon: PropTypes.string,
|
|
35
|
+
filterPosition: PropTypes.string
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
InlineDashboardPage.defaultProps = {
|
|
39
|
+
icon: '',
|
|
40
|
+
filterPosition: 'block-start'
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './InlineDashboardPage';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
|
|
4
|
+
import ListView from '@pega/react-sdk-components/lib/components/templates/ListView';
|
|
5
|
+
|
|
6
|
+
export default function ListPage(props) {
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<ListView {...props}></ListView>
|
|
10
|
+
)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
ListPage.defaultProps = {
|
|
14
|
+
parameters: undefined
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
ListPage.propTypes = {
|
|
18
|
+
getPConnect: PropTypes.func.isRequired,
|
|
19
|
+
parameters: PropTypes.objectOf(PropTypes.any)
|
|
20
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './ListPage';
|