@pega/react-sdk-components 0.23.23 → 0.23.25
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/bridge/react_pconnect.d.ts +2 -1
- package/lib/bridge/react_pconnect.d.ts.map +1 -1
- package/lib/bridge/react_pconnect.js +117 -108
- package/lib/bridge/react_pconnect.js.map +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.js +1 -1
- package/lib/components/designSystemExtension/Banner/Banner.js.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.css +36 -0
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts +4 -0
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.d.ts.map +1 -0
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +17 -0
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -0
- package/lib/components/designSystemExtension/WssQuickCreate/index.d.ts +2 -0
- package/lib/components/designSystemExtension/WssQuickCreate/index.d.ts.map +1 -0
- package/lib/components/designSystemExtension/WssQuickCreate/index.js +2 -0
- package/lib/components/designSystemExtension/WssQuickCreate/index.js.map +1 -0
- package/lib/components/infra/View/View.d.ts +1 -1
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +8 -2
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +0 -1
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.css +5 -0
- package/lib/components/template/DefaultForm/DefaultForm.d.ts +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.js +16 -15
- package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +4 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.css +6 -0
- package/lib/components/template/WssNavBar/WssNavBar.js +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts +3 -0
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -0
- package/lib/components/widget/QuickCreate/QuickCreate.js +45 -0
- package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -0
- package/lib/components/widget/QuickCreate/index.d.ts +2 -0
- package/lib/components/widget/QuickCreate/index.d.ts.map +1 -0
- package/lib/components/widget/QuickCreate/index.js +2 -0
- package/lib/components/widget/QuickCreate/index.js.map +1 -0
- package/lib/sdk-pega-component-map.d.ts +4 -0
- package/lib/sdk-pega-component-map.js +5 -1
- package/lib/sdk-pega-component-map.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export function setVisibilityForList(c11nEnv: any, visibility: any): void;
|
|
1
2
|
export default createPConnectComponent;
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
@@ -5,5 +6,5 @@ export default createPConnectComponent;
|
|
|
5
6
|
* @returns {React.Components<Props, State>}
|
|
6
7
|
|
|
7
8
|
*/
|
|
8
|
-
declare function createPConnectComponent(
|
|
9
|
+
declare function createPConnectComponent(): React.Components<Props, State>;
|
|
9
10
|
//# sourceMappingURL=react_pconnect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react_pconnect.d.ts","sourceRoot":"","sources":["../../src/bridge/react_pconnect.jsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"react_pconnect.d.ts","sourceRoot":"","sources":["../../src/bridge/react_pconnect.jsx"],"names":[],"mappings":"AAoCO,0EAUN;;AAqID;;;;;GAKG;AACH,2EA4JC"}
|
|
@@ -1,49 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import PropTypes from
|
|
4
|
-
import { connect, shallowEqual } from
|
|
1
|
+
/* eslint-disable max-classes-per-file */
|
|
2
|
+
import React, { Component, createElement } from 'react';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { connect, shallowEqual } from 'react-redux';
|
|
5
5
|
import ComponentMap, { LazyMap as LazyComponentMap } from '../components_map'; // was '../../../../../src/components_map';
|
|
6
|
-
import StoreContext from
|
|
6
|
+
import StoreContext from './Context/StoreContext';
|
|
7
7
|
// const pathToComponents = "../../../../../src/components"; /* When bridge was local, it was "../components" */
|
|
8
8
|
// For now, NOT doing lazy loading - needs some work on the loader to work with TypeScript
|
|
9
9
|
// As we add components, we'll need to import them here and add to the switch statement
|
|
10
10
|
// below in getComponent!
|
|
11
11
|
import ErrorBoundary from '../components/infra/ErrorBoundary';
|
|
12
|
-
import { SdkComponentMap } from
|
|
12
|
+
import { SdkComponentMap } from './helpers/sdk_component_map';
|
|
13
|
+
const isClassIDCompare = (key, prev) => {
|
|
14
|
+
return !(key === 'classID' && !prev[key]);
|
|
15
|
+
};
|
|
16
|
+
const routingInfoCompare = (next, prev) => {
|
|
17
|
+
return ('routingInfo' in next &&
|
|
18
|
+
(!shallowEqual(next.routingInfo, prev.routingInfo) ||
|
|
19
|
+
// eslint-disable-next-line no-undef
|
|
20
|
+
!PCore.isDeepEqual(next.routingInfo, prev.routingInfo)));
|
|
21
|
+
};
|
|
22
|
+
/** Generate unique id for elements */
|
|
23
|
+
const createUID = () => {
|
|
24
|
+
return `_${Math.random().toString(36).slice(2, 11)}`;
|
|
25
|
+
};
|
|
26
|
+
export const setVisibilityForList = (c11nEnv, visibility) => {
|
|
27
|
+
const { selectionMode, selectionList, renderMode, referenceList } = c11nEnv.getComponentConfig();
|
|
28
|
+
// usecase:multiselect, fieldgroup, editable table
|
|
29
|
+
if (
|
|
30
|
+
// eslint-disable-next-line no-undef
|
|
31
|
+
(selectionMode === PCore.getConstants().LIST_SELECTION_MODE.MULTI && selectionList) ||
|
|
32
|
+
(renderMode === 'Editable' && referenceList)) {
|
|
33
|
+
c11nEnv.getListActions().setVisibility(visibility);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
function withVisibility(WrappedComponent) {
|
|
37
|
+
// eslint-disable-next-line react/prefer-stateless-function
|
|
38
|
+
return class extends Component {
|
|
39
|
+
render() {
|
|
40
|
+
const { visibility } = this.props;
|
|
41
|
+
if (visibility === false) {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
return React.createElement(WrappedComponent, { ...this.props });
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
13
48
|
const connectRedux = (component, c11nEnv) => {
|
|
14
|
-
// console.log(`in connectRedux: ${component.name}`);
|
|
15
49
|
return connect((state, ownProps) => {
|
|
16
50
|
let addProps = {};
|
|
17
51
|
const obj = {};
|
|
18
|
-
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
52
|
+
// Need to use ownProps pconnect since c11nEnv is stale and prior to re-render
|
|
53
|
+
if (!ownProps.getPConnect) {
|
|
54
|
+
// eslint-disable-next-line no-console
|
|
55
|
+
console.error('connectRedux ownProps are not defined');
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
c11nEnv = ownProps.getPConnect();
|
|
59
|
+
}
|
|
60
|
+
if (typeof component.additionalProps === 'object') {
|
|
25
61
|
addProps = c11nEnv.resolveConfigProps(component.additionalProps);
|
|
26
62
|
}
|
|
27
|
-
else if (typeof component.additionalProps ===
|
|
63
|
+
else if (typeof component.additionalProps === 'function') {
|
|
28
64
|
addProps = c11nEnv.resolveConfigProps(component.additionalProps(state, ownProps.getPConnect));
|
|
29
65
|
}
|
|
30
|
-
// const obj = c11nEnv.getConfigProps();
|
|
31
66
|
c11nEnv.getConfigProps(obj);
|
|
32
|
-
// console.log(`connectRedux: connect callback: ${c11nEnv.getComponentName()}`);
|
|
33
|
-
// debugging/investigation help
|
|
34
|
-
// if (obj.routingInfo) {
|
|
35
|
-
// console.log( `${theCompName}: BEFORE populateAdditionalProps: obj.routingInfo: ${JSON.stringify(obj.routingInfo)}`);
|
|
36
|
-
// }
|
|
37
67
|
// populate additional props which are component specific and not present in configurations
|
|
38
68
|
// This block can be removed once all these props will be added as part of configs
|
|
39
69
|
c11nEnv.populateAdditionalProps(obj);
|
|
40
|
-
// debugging/investigation help
|
|
41
|
-
// if (obj.routingInfo) {
|
|
42
|
-
// console.log( `${theCompName}: AFTER populateAdditionalProps: obj.routingInfo: ${JSON.stringify(obj.routingInfo)}`);
|
|
43
|
-
// // if (theCompName === "ViewContainer") {
|
|
44
|
-
// // debugger;
|
|
45
|
-
// // }
|
|
46
|
-
// }
|
|
47
70
|
return {
|
|
48
71
|
...obj,
|
|
49
72
|
...addProps
|
|
@@ -53,19 +76,15 @@ const connectRedux = (component, c11nEnv) => {
|
|
|
53
76
|
areStatePropsEqual: (next, prev) => {
|
|
54
77
|
const allStateProps = c11nEnv.getStateProps();
|
|
55
78
|
for (const key in allStateProps) {
|
|
56
|
-
|
|
57
|
-
|
|
79
|
+
if ((isClassIDCompare(key, prev) && !shallowEqual(next[key], prev[key])) ||
|
|
80
|
+
// eslint-disable-next-line no-undef
|
|
81
|
+
(next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))) {
|
|
58
82
|
return false;
|
|
59
83
|
}
|
|
60
84
|
}
|
|
61
|
-
/* TODO For some rawConfig we are not getting routingInfo under allStateProps */
|
|
62
|
-
// eslint-disable-next-line no-undef
|
|
63
|
-
if ('routingInfo' in next && (!shallowEqual(next.routingInfo, prev.routingInfo) || !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
85
|
// For CaseSummary (when status === ".pyStatusWork"), we need to compare changes in
|
|
67
86
|
// primaryFields and secondary Fields
|
|
68
|
-
if (allStateProps.status ===
|
|
87
|
+
if (allStateProps.status === '.pyStatusWork') {
|
|
69
88
|
for (const key in prev) {
|
|
70
89
|
// eslint-disable-next-line no-undef
|
|
71
90
|
if (!PCore.isDeepEqual(next[key], prev[key])) {
|
|
@@ -73,11 +92,12 @@ const connectRedux = (component, c11nEnv) => {
|
|
|
73
92
|
}
|
|
74
93
|
}
|
|
75
94
|
}
|
|
76
|
-
|
|
95
|
+
/* TODO For some rawConfig we are not getting routingInfo under allStateProps */
|
|
96
|
+
return !routingInfoCompare(next, prev);
|
|
77
97
|
}
|
|
78
98
|
})(component);
|
|
79
99
|
};
|
|
80
|
-
const getComponent =
|
|
100
|
+
const getComponent = c11nEnv => {
|
|
81
101
|
// PCore is defined in pxBootstrapShell - eventually will be exported in place of constellationCore
|
|
82
102
|
// eslint-disable-next-line no-undef
|
|
83
103
|
const ComponentsRegistry = PCore.getComponentsRegistry();
|
|
@@ -85,7 +105,7 @@ const getComponent = (c11nEnv, declarative) => {
|
|
|
85
105
|
const componentObj = ComponentsRegistry.getComponent(type);
|
|
86
106
|
const componentType = (componentObj && componentObj.component) || type;
|
|
87
107
|
// JEA - modifying logic before bailing to RootContainer logic to work around async loading problem
|
|
88
|
-
let component = LazyComponentMap[componentType] /* || window[componentType]
|
|
108
|
+
let component = LazyComponentMap[componentType]; /* || window[componentType] */
|
|
89
109
|
// NOTE: Until we get lazy loading working, maintain this for each component we add
|
|
90
110
|
if (component === undefined) {
|
|
91
111
|
if (SdkComponentMap) {
|
|
@@ -121,18 +141,10 @@ const getComponent = (c11nEnv, declarative) => {
|
|
|
121
141
|
console.log(`getComponent doesn't have an entry for component ${component}`);
|
|
122
142
|
component = ErrorBoundary;
|
|
123
143
|
}
|
|
124
|
-
// Declarative components already connected to redux so return without connect.
|
|
125
|
-
if (declarative) {
|
|
126
|
-
return component;
|
|
127
|
-
}
|
|
128
144
|
if (c11nEnv.isConditionExist()) {
|
|
129
|
-
|
|
130
|
-
component = connectRedux(createPConnectComponent(true), c11nEnv);
|
|
131
|
-
}
|
|
132
|
-
else {
|
|
133
|
-
component = connectRedux(component, c11nEnv);
|
|
145
|
+
return connectRedux(withVisibility(component), c11nEnv);
|
|
134
146
|
}
|
|
135
|
-
return component;
|
|
147
|
+
return connectRedux(component, c11nEnv);
|
|
136
148
|
};
|
|
137
149
|
/**
|
|
138
150
|
*
|
|
@@ -140,7 +152,7 @@ const getComponent = (c11nEnv, declarative) => {
|
|
|
140
152
|
* @returns {React.Components<Props, State>}
|
|
141
153
|
|
|
142
154
|
*/
|
|
143
|
-
const createPConnectComponent = (
|
|
155
|
+
const createPConnectComponent = () => {
|
|
144
156
|
/**
|
|
145
157
|
* JEA - add Type info via JSdoc syntax...
|
|
146
158
|
* @extends {React.Components<Props, State>}
|
|
@@ -154,19 +166,16 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
154
166
|
class PConnect extends Component {
|
|
155
167
|
constructor(props) {
|
|
156
168
|
super(props);
|
|
157
|
-
|
|
158
|
-
this.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.
|
|
169
|
+
const { getPConnect } = this.props;
|
|
170
|
+
this.state = {
|
|
171
|
+
hasError: false
|
|
172
|
+
};
|
|
173
|
+
this.eventHandler = this.eventHandler.bind(this);
|
|
174
|
+
this.changeHandler = this.changeHandler.bind(this);
|
|
175
|
+
this.c11nEnv = getPConnect();
|
|
176
|
+
this.Control = getComponent(this.c11nEnv);
|
|
162
177
|
this.actionsAPI = this.c11nEnv.getActionsApi();
|
|
163
|
-
|
|
164
|
-
if (theDisplayName === undefined) {
|
|
165
|
-
// In some case (ex: RadioButtons), displayName isn't defined. So,
|
|
166
|
-
// When this happens, use getComponentName() instead
|
|
167
|
-
theDisplayName = this.c11nEnv.getComponentName();
|
|
168
|
-
}
|
|
169
|
-
// console.log( `PConnect constructor: ${theDisplayName}`);
|
|
178
|
+
this.processActions(this.c11nEnv);
|
|
170
179
|
}
|
|
171
180
|
static getDerivedStateFromError(error) {
|
|
172
181
|
// Update state so the next render will show the fallback UI.
|
|
@@ -177,6 +186,7 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
177
186
|
}
|
|
178
187
|
componentDidMount() {
|
|
179
188
|
this.c11nEnv.addFormField();
|
|
189
|
+
setVisibilityForList(this.c11nEnv, true);
|
|
180
190
|
}
|
|
181
191
|
componentDidCatch(error, info) {
|
|
182
192
|
// eslint-disable-next-line no-console
|
|
@@ -185,6 +195,7 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
185
195
|
componentWillUnmount() {
|
|
186
196
|
if (this.c11nEnv.removeFormField) {
|
|
187
197
|
this.c11nEnv.removeFormField();
|
|
198
|
+
setVisibilityForList(this.c11nEnv, false);
|
|
188
199
|
}
|
|
189
200
|
}
|
|
190
201
|
/*
|
|
@@ -193,8 +204,8 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
193
204
|
*/
|
|
194
205
|
processActions() {
|
|
195
206
|
if (this.c11nEnv.isEditable()) {
|
|
196
|
-
this.c11nEnv.setAction(
|
|
197
|
-
this.c11nEnv.setAction(
|
|
207
|
+
this.c11nEnv.setAction('onChange', this.changeHandler);
|
|
208
|
+
this.c11nEnv.setAction('onBlur', this.eventHandler);
|
|
198
209
|
}
|
|
199
210
|
}
|
|
200
211
|
// Using separate handle for change as in case of dropdown, native click is mapped to react change
|
|
@@ -206,34 +217,30 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
206
217
|
this.actionsAPI.eventHandler(this.c11nEnv, event);
|
|
207
218
|
// getActionProcessor().eventHandler(this.c11nEnv, event);
|
|
208
219
|
}
|
|
209
|
-
|
|
210
|
-
this.
|
|
220
|
+
createChildren() {
|
|
221
|
+
const { getPConnect } = this.props;
|
|
222
|
+
if (getPConnect().hasChildren() && getPConnect().getChildren()) {
|
|
223
|
+
return getPConnect()
|
|
224
|
+
.getChildren()
|
|
225
|
+
.map(childProps => React.createElement(PConnect, { ...childProps }));
|
|
226
|
+
}
|
|
227
|
+
return null;
|
|
211
228
|
}
|
|
212
|
-
|
|
213
|
-
* this.props.__internal is to have info like propertiesMap, isExpressionExist, isWhenExist
|
|
214
|
-
* which would be used to call redux connect for re-render purpose on state change
|
|
215
|
-
*/
|
|
216
|
-
initialize() {
|
|
229
|
+
getKey() {
|
|
217
230
|
const { getPConnect } = this.props;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (this.c11nEnv.hasChildren()) {
|
|
226
|
-
const children = this.c11nEnv.getChildren() || [];
|
|
227
|
-
children.forEach((child) => this.addChildren(child));
|
|
228
|
-
this.configProps.children = Children.toArray(this.configProps.children);
|
|
231
|
+
const viewName = getPConnect().getConfigProps().name || getPConnect().getCurrentView();
|
|
232
|
+
let key = !viewName
|
|
233
|
+
? createUID()
|
|
234
|
+
: `${viewName}!${getPConnect().getCurrentClassID() || createUID()}`;
|
|
235
|
+
// In the case of pyDetails the key must be unigue for each instance
|
|
236
|
+
if (viewName && viewName.toUpperCase() === 'PYDETAILS') {
|
|
237
|
+
key += `!${getPConnect().getCaseInfo().getID()}`;
|
|
229
238
|
}
|
|
239
|
+
return key.toUpperCase();
|
|
230
240
|
}
|
|
231
241
|
render() {
|
|
232
242
|
const { hasError } = this.state;
|
|
233
|
-
const { getPConnect,
|
|
234
|
-
if (visibility === false) {
|
|
235
|
-
return null;
|
|
236
|
-
}
|
|
243
|
+
const { getPConnect, additionalProps, ...otherProps } = this.props;
|
|
237
244
|
if (hasError) {
|
|
238
245
|
// You can render any custom fallback UI
|
|
239
246
|
// console.log(`react_pconnect error: used to return: <ErrorBoundary getPConnect={() => this.c11nEnv} isInternalError />`);
|
|
@@ -244,13 +251,16 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
244
251
|
const finalProps = {
|
|
245
252
|
...props,
|
|
246
253
|
getPConnect,
|
|
247
|
-
...this.configProps,
|
|
248
254
|
...actions,
|
|
249
255
|
additionalProps,
|
|
250
256
|
...otherProps
|
|
251
257
|
};
|
|
258
|
+
// If the new component is a reference node then mark with a unique key
|
|
259
|
+
if (['reference', 'View'].includes(getPConnect().getComponentName()) && !finalProps.key) {
|
|
260
|
+
finalProps.key = this.getKey();
|
|
261
|
+
}
|
|
252
262
|
// console.log(`react_pconnect: used to return: <this.Control {...finalProps} />`);
|
|
253
|
-
return React.createElement(this.Control, { ...finalProps });
|
|
263
|
+
return React.createElement(this.Control, { ...finalProps }, this.createChildren());
|
|
254
264
|
}
|
|
255
265
|
}
|
|
256
266
|
// eslint-disable-next-line react/static-property-placement
|
|
@@ -259,7 +269,6 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
259
269
|
// meta: PropTypes.object.isRequired,
|
|
260
270
|
// configObject: PropTypes.object.isRequired,
|
|
261
271
|
getPConnect: PropTypes.func.isRequired,
|
|
262
|
-
visibility: PropTypes.bool /* .isRequired */,
|
|
263
272
|
additionalProps: PropTypes.shape({
|
|
264
273
|
noLabel: PropTypes.bool,
|
|
265
274
|
readOnly: PropTypes.bool
|
|
@@ -269,55 +278,55 @@ const createPConnectComponent = (declarative = false) => {
|
|
|
269
278
|
// eslint-disable-next-line react/static-property-placement
|
|
270
279
|
PConnect.defaultProps = {
|
|
271
280
|
additionalProps: {},
|
|
272
|
-
validatemessage:
|
|
281
|
+
validatemessage: ''
|
|
273
282
|
};
|
|
274
283
|
return PConnect;
|
|
275
284
|
};
|
|
276
285
|
// Move these into SdkConstellationReady so PCore is available
|
|
277
|
-
document.addEventListener(
|
|
286
|
+
document.addEventListener('SdkConstellationReady', () => {
|
|
278
287
|
// eslint-disable-next-line no-undef
|
|
279
288
|
PCore.registerComponentCreator((c11nEnv, additionalProps = {}) => {
|
|
280
289
|
const PConnectComp = createPConnectComponent();
|
|
281
|
-
return
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
290
|
+
return createElement(PConnectComp, {
|
|
291
|
+
...c11nEnv,
|
|
292
|
+
...c11nEnv.getPConnect().getConfigProps(),
|
|
293
|
+
...c11nEnv.getPConnect().getActions(),
|
|
294
|
+
...{ additionalProps }
|
|
295
|
+
});
|
|
287
296
|
});
|
|
288
297
|
// eslint-disable-next-line no-undef
|
|
289
|
-
PCore.getAssetLoader().register(
|
|
298
|
+
PCore.getAssetLoader().register('component-loader', async (componentNames = []) => {
|
|
290
299
|
const promises = [];
|
|
291
|
-
componentNames.forEach(
|
|
300
|
+
componentNames.forEach(comp => {
|
|
292
301
|
if (/^[A-Z]/.test(comp) && !LazyComponentMap[comp]) {
|
|
293
302
|
if (!ComponentMap[comp]) {
|
|
294
303
|
// eslint-disable-next-line no-undef
|
|
295
304
|
const srcUrl = `${PCore.getAssetLoader().getConstellationServiceUrl()}/v860/${PCore.getAssetLoader().getAppAlias()}/component/${comp}.js`;
|
|
296
305
|
// eslint-disable-next-line no-undef
|
|
297
|
-
promises.push(PCore.getAssetLoader().getLoader()(srcUrl,
|
|
306
|
+
promises.push(PCore.getAssetLoader().getLoader()(srcUrl, 'script'));
|
|
298
307
|
}
|
|
299
308
|
else {
|
|
300
309
|
if (ComponentMap[comp].modules && ComponentMap[comp].modules.length) {
|
|
301
|
-
ComponentMap[comp].modules.forEach(
|
|
310
|
+
ComponentMap[comp].modules.forEach(module => {
|
|
302
311
|
LazyComponentMap[comp] = module;
|
|
303
312
|
});
|
|
304
313
|
}
|
|
305
314
|
if (ComponentMap[comp].scripts && ComponentMap[comp].scripts.length) {
|
|
306
|
-
ComponentMap[comp].scripts.forEach(
|
|
315
|
+
ComponentMap[comp].scripts.forEach(script => {
|
|
307
316
|
promises.push(
|
|
308
317
|
// eslint-disable-next-line no-undef
|
|
309
|
-
PCore.getAssetLoader().getLoader()(script,
|
|
318
|
+
PCore.getAssetLoader().getLoader()(script, 'script'));
|
|
310
319
|
});
|
|
311
320
|
}
|
|
312
321
|
}
|
|
313
322
|
}
|
|
314
323
|
});
|
|
315
324
|
/* Promise.all rejects or accepts all or none. This causes entire component loader to fail
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
325
|
+
in case there is a single failure.
|
|
326
|
+
Using allSettled to allow Promise to be resolved even if there are failed components
|
|
327
|
+
Note : This is a liberty taken at component loader and unwise to be used at
|
|
328
|
+
asset loader which will still use Promise.all
|
|
329
|
+
*/
|
|
321
330
|
await Promise.allSettled(promises);
|
|
322
331
|
});
|
|
323
332
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react_pconnect.js","sourceRoot":"","sources":["../../src/bridge/react_pconnect.jsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAClE,8DAA8D;AAC9D,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,YAAY,EAAE,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC,CAAC,2CAA2C;AAC1H,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD,iHAAiH;AAEjH,0FAA0F;AAC1F,uFAAuF;AACvF,4BAA4B;AAE5B,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,EAAE;IAE1C,qDAAqD;IAErD,OAAO,OAAO,CACZ,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QAClB,IAAI,QAAQ,GAAG,EAAE,CAAC;QAClB,MAAM,GAAG,GAAG,EAAE,CAAC;QAGf,eAAe;QACf,kDAAkD;QAClD,0EAA0E;QAC1E,oEAAoE;QACpE,cAAc;QACd,IAAI;QAEJ,IAAI,OAAO,SAAS,CAAC,eAAe,KAAK,QAAQ,EAAE;YACjD,QAAQ,GAAG,OAAO,CAAC,kBAAkB,CAAC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AC;iBACrE;qBAAM;oBACL,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;wBACnE,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;4BAC5C,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;wBAClC,CAAC,CAAC,CAAC;qBACJ;oBACD,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;wBACnE,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;4BAC5C,QAAQ,CAAC,IAAI;4BACX,oCAAoC;4BACpC,KAAK,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CACrD,CAAC;wBACJ,CAAC,CAAC,CAAC;qBACJ;iBACF;aACF;QACH,CAAC,CAAC,CAAC;QACH;;;;;UAKE;QACF,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC;AAGvC;;mDAEmD;AACnD,4BAA4B;AAC5B,mBAAmB;AACnB,YAAY;AACZ,4BAA4B;AAC5B,qBAAqB;AACrB,KAAK","sourcesContent":["import React, { Children, Component, createElement } from \"react\";\n// import { render, unmountComponentAtNode } from \"react-dom\";\nimport PropTypes from \"prop-types\";\nimport { connect, shallowEqual } from \"react-redux\";\n\nimport ComponentMap, { LazyMap as LazyComponentMap } from '../components_map'; // was '../../../../../src/components_map';\nimport StoreContext from \"./Context/StoreContext\";\n\n// const pathToComponents = \"../../../../../src/components\"; /* When bridge was local, it was \"../components\" */\n\n// For now, NOT doing lazy loading - needs some work on the loader to work with TypeScript\n// As we add components, we'll need to import them here and add to the switch statement\n// below in getComponent!\n\nimport ErrorBoundary from '../components/infra/ErrorBoundary';\n\nimport { SdkComponentMap } from \"./helpers/sdk_component_map\";\n\nconst connectRedux = (component, c11nEnv) => {\n\n // console.log(`in connectRedux: ${component.name}`);\n\n return connect(\n (state, ownProps) => {\n let addProps = {};\n const obj = {};\n\n\n // JA - testing\n // const theCompName = c11nEnv.getComponentName();\n // console.log(`in connect mapStateToProps callback for: ${theCompName}`);\n // if ( theCompName === \"ViewContainer\" || theCompName === \"View\") {\n // debugger;\n // }\n\n if (typeof component.additionalProps === \"object\") {\n addProps = c11nEnv.resolveConfigProps(component.additionalProps);\n } else if (typeof component.additionalProps === \"function\") {\n addProps = c11nEnv.resolveConfigProps(\n component.additionalProps(state, ownProps.getPConnect)\n );\n }\n\n // const obj = c11nEnv.getConfigProps();\n c11nEnv.getConfigProps(obj);\n\n // console.log(`connectRedux: connect callback: ${c11nEnv.getComponentName()}`);\n\n // debugging/investigation help\n // if (obj.routingInfo) {\n // console.log( `${theCompName}: BEFORE populateAdditionalProps: obj.routingInfo: ${JSON.stringify(obj.routingInfo)}`);\n // }\n\n // populate additional props which are component specific and not present in configurations\n // This block can be removed once all these props will be added as part of configs\n c11nEnv.populateAdditionalProps(obj);\n\n // debugging/investigation help\n // if (obj.routingInfo) {\n // console.log( `${theCompName}: AFTER populateAdditionalProps: obj.routingInfo: ${JSON.stringify(obj.routingInfo)}`);\n // // if (theCompName === \"ViewContainer\") {\n // // debugger;\n // // }\n // }\n\n return {\n ...obj,\n ...addProps\n };\n },\n null,\n null,\n {\n context: StoreContext,\n areStatePropsEqual: (next,prev) => {\n const allStateProps = c11nEnv.getStateProps();\n for(const key in allStateProps){\n // eslint-disable-next-line no-undef\n if(!shallowEqual(next[key], prev[key]) || (next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))){\n return false;\n }\n }\n /* TODO For some rawConfig we are not getting routingInfo under allStateProps */\n // eslint-disable-next-line no-undef\n if('routingInfo' in next && (!shallowEqual(next.routingInfo, prev.routingInfo) || !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))){\n return false;\n }\n\n // For CaseSummary (when status === \".pyStatusWork\"), we need to compare changes in\n // primaryFields and secondary Fields\n if (allStateProps.status === \".pyStatusWork\") {\n for(const key in prev){\n // eslint-disable-next-line no-undef\n if (!PCore.isDeepEqual(next[key], prev[key])) {\n return false;\n }\n }\n }\n\n return true;\n }\n }\n )(component);\n};\n\n\nconst getComponent = (c11nEnv, declarative) => {\n // PCore is defined in pxBootstrapShell - eventually will be exported in place of constellationCore\n // eslint-disable-next-line no-undef\n const ComponentsRegistry = PCore.getComponentsRegistry();\n const type = c11nEnv.getComponentName();\n\n const componentObj = ComponentsRegistry.getComponent(type);\n const componentType = (componentObj && componentObj.component) || type;\n\n // JEA - modifying logic before bailing to RootContainer logic to work around async loading problem\n let component =\n LazyComponentMap[componentType] /* || window[componentType] */;\n\n // NOTE: Until we get lazy loading working, maintain this for each component we add\n if (component === undefined) {\n if (SdkComponentMap) {\n // This is the node_modules version of react_pconnect!\n const theLocalComponent = SdkComponentMap.getLocalComponentMap()[componentType];\n if ( theLocalComponent !== undefined) {\n // eslint-disable-next-line no-console\n console.log(`react_pconnect getComponent found ${componentType}: Local`);\n component = theLocalComponent\n } else {\n const thePegaProvidedComponent = SdkComponentMap.getPegaProvidedComponentMap()[componentType];\n if ( thePegaProvidedComponent !== undefined) {\n // console.log(`react_pconnect getComponent found ${componentType}: Pega-provided`);\n component = thePegaProvidedComponent;\n } else {\n // eslint-disable-next-line no-console\n console.error(`react_pconnect: getComponent doesn't have an entry for type ${type}`);\n component = ErrorBoundary;\n }\n }\n } else {\n // We no longer handle the \"old\" switch statement that was here in the original packaging.\n // All components seen here need to be in the SdkComponentMap\n // eslint-disable-next-line no-console\n console.error(`SdkComponentMap not defined! Unable to process component: ${componentType}`);\n \n }\n } else {\n // eslint-disable-next-line no-console\n console.log( `getComponent doesn't have an entry for component ${component}`);\n component = ErrorBoundary;\n }\n\n // Declarative components already connected to redux so return without connect.\n if (declarative) {\n return component;\n }\n\n if (c11nEnv.isConditionExist()) {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n component = connectRedux(createPConnectComponent(true), c11nEnv);\n } else {\n component = connectRedux(component, c11nEnv);\n }\n return component;\n};\n\n/**\n * \n * @param {*} declarative \n * @returns {React.Components<Props, State>}\n\n */\nconst createPConnectComponent = (declarative=false) => {\n /**\n * JEA - add Type info via JSdoc syntax...\n * @extends {React.Components<Props, State>}\n * createPConnectComponent - Class to create/initialize a PConnect (c11nEnv) object\n * to pre-process meta data of each componnet.\n * - Wraps each child in a component with PConnect\n * - Process all actions and make them avaiable in props\n * - Filters all properties in metadata and keeps them\n * __internal for re-render process through connect\n */\n class PConnect extends Component {\n constructor(props) {\n super(props);\n this.children = [];\n this.c11nEnv = this.props.getPConnect();\n this.initialize();\n this.state = { hasError: false };\n this.Control = getComponent(this.c11nEnv, declarative);\n this.actionsAPI = this.c11nEnv.getActionsApi();\n\n let theDisplayName = this.Control.displayName;\n if (theDisplayName === undefined) {\n // In some case (ex: RadioButtons), displayName isn't defined. So,\n // When this happens, use getComponentName() instead\n theDisplayName = this.c11nEnv.getComponentName();\n }\n\n // console.log( `PConnect constructor: ${theDisplayName}`);\n }\n\n static getDerivedStateFromError(error) {\n // Update state so the next render will show the fallback UI.\n return {\n hasError: true,\n error\n };\n }\n\n componentDidMount() {\n this.c11nEnv.addFormField();\n }\n\n componentDidCatch(error, info) {\n // eslint-disable-next-line no-console\n console.error(\n `Error while Rendering the component ${this.componentName} : `,\n error,\n info.componentStack\n );\n }\n\n componentWillUnmount() {\n if (this.c11nEnv.removeFormField) {\n this.c11nEnv.removeFormField();\n }\n }\n\n /*\n * processActions to see all actions in meta and adds event in props.\n * Attaches common handler (eventHandler) for all actions.\n */\n processActions() {\n if (this.c11nEnv.isEditable()) {\n this.c11nEnv.setAction(\"onChange\", this.changeHandler);\n this.c11nEnv.setAction(\"onBlur\", this.eventHandler);\n }\n }\n\n // Using separate handle for change as in case of dropdown, native click is mapped to react change\n changeHandler(event) {\n this.actionsAPI.changeHandler(this.c11nEnv, event);\n // getActionProcessor().changeHandler(this.c11nEnv, event);\n }\n\n eventHandler(event) {\n this.actionsAPI.eventHandler(this.c11nEnv, event);\n // getActionProcessor().eventHandler(this.c11nEnv, event);\n }\n\n addChildren(child) {\n this.configProps.children.push(createElement(createPConnectComponent(), child));\n }\n\n /* This should be called only once per component instance\n * this.props.__internal is to have info like propertiesMap, isExpressionExist, isWhenExist\n * which would be used to call redux connect for re-render purpose on state change\n */\n initialize() {\n const { getPConnect } = this.props;\n this.c11nEnv = getPConnect();\n this.configProps = {};\n this.eventHandler = this.eventHandler.bind(this);\n this.changeHandler = this.changeHandler.bind(this);\n this.processActions(this.c11nEnv);\n this.propsToChild = {};\n\n this.configProps.children = [];\n\n if (this.c11nEnv.hasChildren()) {\n const children = this.c11nEnv.getChildren() || [];\n children.forEach((child) => this.addChildren(child));\n this.configProps.children = Children.toArray(\n this.configProps.children\n );\n }\n }\n\n render() {\n const { hasError } = this.state;\n const {\n getPConnect,\n visibility,\n additionalProps,\n ...otherProps\n } = this.props;\n\n if (visibility === false) {\n return null;\n }\n if (hasError) {\n // You can render any custom fallback UI\n // console.log(`react_pconnect error: used to return: <ErrorBoundary getPConnect={() => this.c11nEnv} isInternalError />`);\n return <ErrorBoundary getPConnect={() => this.c11nEnv} isInternalError />;\n }\n\n const props = this.c11nEnv.getConfigProps();\n const actions = this.c11nEnv.getActions();\n const finalProps = {\n ...props,\n getPConnect,\n ...this.configProps,\n ...actions,\n additionalProps,\n ...otherProps\n };\n\n // console.log(`react_pconnect: used to return: <this.Control {...finalProps} />`);\n\n return <this.Control {...finalProps} />;\n }\n }\n\n // eslint-disable-next-line react/static-property-placement\n PConnect.propTypes = {\n // __internal: PropTypes.object.isRequired,\n // meta: PropTypes.object.isRequired,\n // configObject: PropTypes.object.isRequired,\n getPConnect: PropTypes.func.isRequired,\n visibility: PropTypes.bool/* .isRequired */,\n additionalProps: PropTypes.shape({\n noLabel: PropTypes.bool,\n readOnly: PropTypes.bool\n }),\n validatemessage: PropTypes.string\n };\n\n // eslint-disable-next-line react/static-property-placement\n PConnect.defaultProps = {\n additionalProps: {},\n validatemessage: \"\"\n };\n\n return PConnect;\n};\n\n\n// Move these into SdkConstellationReady so PCore is available\ndocument.addEventListener(\"SdkConstellationReady\", () => {\n\n // eslint-disable-next-line no-undef\n PCore.registerComponentCreator((c11nEnv, additionalProps = {}) => {\n const PConnectComp = createPConnectComponent();\n return (\n <PConnectComp {\n ...{\n ...c11nEnv,\n ...c11nEnv.getPConnect().getConfigProps(),\n ...c11nEnv.getPConnect().getActions(),\n additionalProps\n }}\n />\n );\n });\n\n // eslint-disable-next-line no-undef\n PCore.getAssetLoader().register(\n \"component-loader\",\n async (componentNames = []) => {\n const promises = [];\n componentNames.forEach((comp) => {\n if (/^[A-Z]/.test(comp) && !LazyComponentMap[comp]) {\n if (!ComponentMap[comp]) {\n // eslint-disable-next-line no-undef\n const srcUrl = `${PCore.getAssetLoader().getConstellationServiceUrl()}/v860/${PCore.getAssetLoader().getAppAlias()}/component/${comp}.js`;\n // eslint-disable-next-line no-undef\n promises.push(PCore.getAssetLoader().getLoader()(srcUrl, \"script\"));\n } else {\n if (ComponentMap[comp].modules && ComponentMap[comp].modules.length) {\n ComponentMap[comp].modules.forEach((module) => {\n LazyComponentMap[comp] = module;\n });\n }\n if (ComponentMap[comp].scripts && ComponentMap[comp].scripts.length) {\n ComponentMap[comp].scripts.forEach((script) => {\n promises.push(\n // eslint-disable-next-line no-undef\n PCore.getAssetLoader().getLoader()(script, \"script\")\n );\n });\n }\n }\n }\n });\n /* Promise.all rejects or accepts all or none. This causes entire component loader to fail\n in case there is a single failure.\n Using allSettled to allow Promise to be resolved even if there are failed components\n Note : This is a liberty taken at component loader and unwise to be used at\n asset loader which will still use Promise.all\n */\n await Promise.allSettled(promises);\n }\n );\n});\n\nexport default createPConnectComponent;\n\n\n/* These APIs need to be exposed for authoring bridge\nWill be removed when pxbootstrap and constellation_bridge is cleaned up\nto use single bootstrap file from constellation */\n// window.authoringUtils = {\n// createElement,\n// render,\n// unmountComponentAtNode,\n// LazyComponentMap\n// };\n"]}
|
|
1
|
+
{"version":3,"file":"react_pconnect.js","sourceRoot":"","sources":["../../src/bridge/react_pconnect.jsx"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACxD,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,YAAY,EAAE,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,mBAAmB,CAAC,CAAC,2CAA2C;AAC1H,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAElD,iHAAiH;AAEjH,0FAA0F;AAC1F,uFAAuF;AACvF,4BAA4B;AAE5B,OAAO,aAAa,MAAM,mCAAmC,CAAC;AAE9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;IACrC,OAAO,CAAC,CAAC,GAAG,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;IACxC,OAAO,CACL,aAAa,IAAI,IAAI;QACrB,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC;YAChD,oCAAoC;YACpC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAC1D,CAAC;AACJ,CAAC,CAAC;AAEF,sCAAsC;AACtC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G,MAAM,CAAC;wBAClC,CAAC,CAAC,CAAC;qBACJ;oBACD,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE;wBACnE,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;4BAC1C,QAAQ,CAAC,IAAI;4BACX,oCAAoC;4BACpC,KAAK,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CACrD,CAAC;wBACJ,CAAC,CAAC,CAAC;qBACJ;iBACF;aACF;QACH,CAAC,CAAC,CAAC;QACH;;;;;YAKI;QACJ,MAAM,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,eAAe,uBAAuB,CAAC;AAEvC;;mDAEmD;AACnD,4BAA4B;AAC5B,mBAAmB;AACnB,YAAY;AACZ,4BAA4B;AAC5B,qBAAqB;AACrB,KAAK","sourcesContent":["/* eslint-disable max-classes-per-file */\nimport React, { Component, createElement } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect, shallowEqual } from 'react-redux';\n\nimport ComponentMap, { LazyMap as LazyComponentMap } from '../components_map'; // was '../../../../../src/components_map';\nimport StoreContext from './Context/StoreContext';\n\n// const pathToComponents = \"../../../../../src/components\"; /* When bridge was local, it was \"../components\" */\n\n// For now, NOT doing lazy loading - needs some work on the loader to work with TypeScript\n// As we add components, we'll need to import them here and add to the switch statement\n// below in getComponent!\n\nimport ErrorBoundary from '../components/infra/ErrorBoundary';\n\nimport { SdkComponentMap } from './helpers/sdk_component_map';\n\nconst isClassIDCompare = (key, prev) => {\n return !(key === 'classID' && !prev[key]);\n};\n\nconst routingInfoCompare = (next, prev) => {\n return (\n 'routingInfo' in next &&\n (!shallowEqual(next.routingInfo, prev.routingInfo) ||\n // eslint-disable-next-line no-undef\n !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))\n );\n};\n\n/** Generate unique id for elements */\nconst createUID = () => {\n return `_${Math.random().toString(36).slice(2, 11)}`;\n};\n\nexport const setVisibilityForList = (c11nEnv, visibility) => {\n const { selectionMode, selectionList, renderMode, referenceList } = c11nEnv.getComponentConfig();\n // usecase:multiselect, fieldgroup, editable table\n if (\n // eslint-disable-next-line no-undef\n (selectionMode === PCore.getConstants().LIST_SELECTION_MODE.MULTI && selectionList) ||\n (renderMode === 'Editable' && referenceList)\n ) {\n c11nEnv.getListActions().setVisibility(visibility);\n }\n};\n\nfunction withVisibility(WrappedComponent) {\n // eslint-disable-next-line react/prefer-stateless-function\n return class extends Component {\n render() {\n const { visibility } = this.props;\n\n if (visibility === false) {\n return null;\n }\n return <WrappedComponent {...this.props} />;\n }\n };\n}\n\nconst connectRedux = (component, c11nEnv) => {\n return connect(\n (state, ownProps) => {\n let addProps = {};\n const obj = {};\n // Need to use ownProps pconnect since c11nEnv is stale and prior to re-render\n if (!ownProps.getPConnect) {\n // eslint-disable-next-line no-console\n console.error('connectRedux ownProps are not defined');\n } else {\n c11nEnv = ownProps.getPConnect();\n }\n\n if (typeof component.additionalProps === 'object') {\n addProps = c11nEnv.resolveConfigProps(component.additionalProps);\n } else if (typeof component.additionalProps === 'function') {\n addProps = c11nEnv.resolveConfigProps(\n component.additionalProps(state, ownProps.getPConnect)\n );\n }\n\n c11nEnv.getConfigProps(obj);\n\n // populate additional props which are component specific and not present in configurations\n // This block can be removed once all these props will be added as part of configs\n c11nEnv.populateAdditionalProps(obj);\n\n return {\n ...obj,\n ...addProps\n };\n },\n null,\n null,\n {\n context: StoreContext,\n areStatePropsEqual: (next, prev) => {\n const allStateProps = c11nEnv.getStateProps();\n for (const key in allStateProps) {\n if (\n (isClassIDCompare(key, prev) && !shallowEqual(next[key], prev[key])) ||\n // eslint-disable-next-line no-undef\n (next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))\n ) {\n return false;\n }\n }\n\n // For CaseSummary (when status === \".pyStatusWork\"), we need to compare changes in\n // primaryFields and secondary Fields\n if (allStateProps.status === '.pyStatusWork') {\n for (const key in prev) {\n // eslint-disable-next-line no-undef\n if (!PCore.isDeepEqual(next[key], prev[key])) {\n return false;\n }\n }\n }\n /* TODO For some rawConfig we are not getting routingInfo under allStateProps */\n return !routingInfoCompare(next, prev);\n }\n }\n )(component);\n};\n\nconst getComponent = c11nEnv => {\n // PCore is defined in pxBootstrapShell - eventually will be exported in place of constellationCore\n // eslint-disable-next-line no-undef\n const ComponentsRegistry = PCore.getComponentsRegistry();\n const type = c11nEnv.getComponentName();\n\n const componentObj = ComponentsRegistry.getComponent(type);\n const componentType = (componentObj && componentObj.component) || type;\n\n // JEA - modifying logic before bailing to RootContainer logic to work around async loading problem\n let component = LazyComponentMap[componentType]; /* || window[componentType] */\n\n // NOTE: Until we get lazy loading working, maintain this for each component we add\n if (component === undefined) {\n if (SdkComponentMap) {\n // This is the node_modules version of react_pconnect!\n const theLocalComponent = SdkComponentMap.getLocalComponentMap()[componentType];\n if (theLocalComponent !== undefined) {\n // eslint-disable-next-line no-console\n console.log(`react_pconnect getComponent found ${componentType}: Local`);\n component = theLocalComponent;\n } else {\n const thePegaProvidedComponent =\n SdkComponentMap.getPegaProvidedComponentMap()[componentType];\n if (thePegaProvidedComponent !== undefined) {\n // console.log(`react_pconnect getComponent found ${componentType}: Pega-provided`);\n component = thePegaProvidedComponent;\n } else {\n // eslint-disable-next-line no-console\n console.error(`react_pconnect: getComponent doesn't have an entry for type ${type}`);\n component = ErrorBoundary;\n }\n }\n } else {\n // We no longer handle the \"old\" switch statement that was here in the original packaging.\n // All components seen here need to be in the SdkComponentMap\n // eslint-disable-next-line no-console\n console.error(`SdkComponentMap not defined! Unable to process component: ${componentType}`);\n }\n } else {\n // eslint-disable-next-line no-console\n console.log(`getComponent doesn't have an entry for component ${component}`);\n component = ErrorBoundary;\n }\n\n if (c11nEnv.isConditionExist()) {\n return connectRedux(withVisibility(component), c11nEnv);\n }\n\n return connectRedux(component, c11nEnv);\n};\n\n/**\n *\n * @param {*} declarative\n * @returns {React.Components<Props, State>}\n\n */\nconst createPConnectComponent = () => {\n /**\n * JEA - add Type info via JSdoc syntax...\n * @extends {React.Components<Props, State>}\n * createPConnectComponent - Class to create/initialize a PConnect (c11nEnv) object\n * to pre-process meta data of each componnet.\n * - Wraps each child in a component with PConnect\n * - Process all actions and make them avaiable in props\n * - Filters all properties in metadata and keeps them\n * __internal for re-render process through connect\n */\n class PConnect extends Component {\n constructor(props) {\n super(props);\n const { getPConnect } = this.props;\n this.state = {\n hasError: false\n };\n\n this.eventHandler = this.eventHandler.bind(this);\n this.changeHandler = this.changeHandler.bind(this);\n\n this.c11nEnv = getPConnect();\n this.Control = getComponent(this.c11nEnv);\n this.actionsAPI = this.c11nEnv.getActionsApi();\n\n this.processActions(this.c11nEnv);\n }\n\n static getDerivedStateFromError(error) {\n // Update state so the next render will show the fallback UI.\n return {\n hasError: true,\n error\n };\n }\n\n componentDidMount() {\n this.c11nEnv.addFormField();\n setVisibilityForList(this.c11nEnv, true);\n }\n\n componentDidCatch(error, info) {\n // eslint-disable-next-line no-console\n console.error(\n `Error while Rendering the component ${this.componentName} : `,\n error,\n info.componentStack\n );\n }\n\n componentWillUnmount() {\n if (this.c11nEnv.removeFormField) {\n this.c11nEnv.removeFormField();\n setVisibilityForList(this.c11nEnv, false);\n }\n }\n\n /*\n * processActions to see all actions in meta and adds event in props.\n * Attaches common handler (eventHandler) for all actions.\n */\n processActions() {\n if (this.c11nEnv.isEditable()) {\n this.c11nEnv.setAction('onChange', this.changeHandler);\n this.c11nEnv.setAction('onBlur', this.eventHandler);\n }\n }\n\n // Using separate handle for change as in case of dropdown, native click is mapped to react change\n changeHandler(event) {\n this.actionsAPI.changeHandler(this.c11nEnv, event);\n // getActionProcessor().changeHandler(this.c11nEnv, event);\n }\n\n eventHandler(event) {\n this.actionsAPI.eventHandler(this.c11nEnv, event);\n // getActionProcessor().eventHandler(this.c11nEnv, event);\n }\n\n createChildren() {\n const { getPConnect } = this.props;\n if (getPConnect().hasChildren() && getPConnect().getChildren()) {\n return getPConnect()\n .getChildren()\n .map(childProps => <PConnect {...childProps} />);\n }\n return null;\n }\n\n getKey() {\n const { getPConnect } = this.props;\n const viewName = getPConnect().getConfigProps().name || getPConnect().getCurrentView();\n let key = !viewName\n ? createUID()\n : `${viewName}!${getPConnect().getCurrentClassID() || createUID()}`;\n\n // In the case of pyDetails the key must be unigue for each instance\n if (viewName && viewName.toUpperCase() === 'PYDETAILS') {\n key += `!${getPConnect().getCaseInfo().getID()}`;\n }\n\n return key.toUpperCase();\n }\n\n render() {\n const { hasError } = this.state;\n const { getPConnect, additionalProps, ...otherProps } = this.props;\n\n if (hasError) {\n // You can render any custom fallback UI\n // console.log(`react_pconnect error: used to return: <ErrorBoundary getPConnect={() => this.c11nEnv} isInternalError />`);\n return <ErrorBoundary getPConnect={() => this.c11nEnv} isInternalError />;\n }\n\n const props = this.c11nEnv.getConfigProps();\n const actions = this.c11nEnv.getActions();\n const finalProps = {\n ...props,\n getPConnect,\n ...actions,\n additionalProps,\n ...otherProps\n };\n\n // If the new component is a reference node then mark with a unique key\n if (['reference', 'View'].includes(getPConnect().getComponentName()) && !finalProps.key) {\n finalProps.key = this.getKey();\n }\n\n // console.log(`react_pconnect: used to return: <this.Control {...finalProps} />`);\n\n return <this.Control {...finalProps}>{this.createChildren()}</this.Control>;\n }\n }\n\n // eslint-disable-next-line react/static-property-placement\n PConnect.propTypes = {\n // __internal: PropTypes.object.isRequired,\n // meta: PropTypes.object.isRequired,\n // configObject: PropTypes.object.isRequired,\n getPConnect: PropTypes.func.isRequired,\n additionalProps: PropTypes.shape({\n noLabel: PropTypes.bool,\n readOnly: PropTypes.bool\n }),\n validatemessage: PropTypes.string\n };\n\n // eslint-disable-next-line react/static-property-placement\n PConnect.defaultProps = {\n additionalProps: {},\n validatemessage: ''\n };\n\n return PConnect;\n};\n\n// Move these into SdkConstellationReady so PCore is available\ndocument.addEventListener('SdkConstellationReady', () => {\n // eslint-disable-next-line no-undef\n PCore.registerComponentCreator((c11nEnv, additionalProps = {}) => {\n const PConnectComp = createPConnectComponent();\n return createElement(PConnectComp, {\n ...c11nEnv,\n ...c11nEnv.getPConnect().getConfigProps(),\n ...c11nEnv.getPConnect().getActions(),\n ...{ additionalProps }\n });\n });\n\n // eslint-disable-next-line no-undef\n PCore.getAssetLoader().register('component-loader', async (componentNames = []) => {\n const promises = [];\n componentNames.forEach(comp => {\n if (/^[A-Z]/.test(comp) && !LazyComponentMap[comp]) {\n if (!ComponentMap[comp]) {\n // eslint-disable-next-line no-undef\n const srcUrl = `${PCore.getAssetLoader().getConstellationServiceUrl()}/v860/${PCore.getAssetLoader().getAppAlias()}/component/${comp}.js`;\n // eslint-disable-next-line no-undef\n promises.push(PCore.getAssetLoader().getLoader()(srcUrl, 'script'));\n } else {\n if (ComponentMap[comp].modules && ComponentMap[comp].modules.length) {\n ComponentMap[comp].modules.forEach(module => {\n LazyComponentMap[comp] = module;\n });\n }\n if (ComponentMap[comp].scripts && ComponentMap[comp].scripts.length) {\n ComponentMap[comp].scripts.forEach(script => {\n promises.push(\n // eslint-disable-next-line no-undef\n PCore.getAssetLoader().getLoader()(script, 'script')\n );\n });\n }\n }\n }\n });\n /* Promise.all rejects or accepts all or none. This causes entire component loader to fail\n in case there is a single failure.\n Using allSettled to allow Promise to be resolved even if there are failed components\n Note : This is a liberty taken at component loader and unwise to be used at\n asset loader which will still use Promise.all\n */\n await Promise.allSettled(promises);\n });\n});\n\nexport default createPConnectComponent;\n\n/* These APIs need to be exposed for authoring bridge\nWill be removed when pxbootstrap and constellation_bridge is cleaned up\nto use single bootstrap file from constellation */\n// window.authoringUtils = {\n// createElement,\n// render,\n// unmountComponentAtNode,\n// LazyComponentMap\n// };\n"]}
|
|
@@ -4,7 +4,7 @@ import './Banner.css';
|
|
|
4
4
|
export default function Banner(props) {
|
|
5
5
|
const { a, b, banner } = props;
|
|
6
6
|
const { title, message, backgroundImage } = banner;
|
|
7
|
-
return (React.createElement("div",
|
|
7
|
+
return (React.createElement("div", { style: { marginBottom: '2rem' } },
|
|
8
8
|
React.createElement("div", { className: 'background-image-style', style: { backgroundImage: `url(${backgroundImage})` } },
|
|
9
9
|
React.createElement("div", { className: 'background-style content' },
|
|
10
10
|
React.createElement("div", null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/Banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK;IAClC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC/B,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IACnD,OAAO,CACL;
|
|
1
|
+
{"version":3,"file":"Banner.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/Banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,wBAAwB,CAAC;AAC1C,OAAO,cAAc,CAAC;AAEtB,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK;IAClC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC/B,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,CAAC;IACnD,OAAO,CACL,6BAAK,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE;QAClC,6BACE,SAAS,EAAC,wBAAwB,EAClC,KAAK,EAAE,EAAE,eAAe,EAAE,OAAO,eAAe,GAAG,EAAE;YAErD,6BAAK,SAAS,EAAC,0BAA0B;gBACvC;oBACE,4BAAI,SAAS,EAAC,OAAO,IAAE,KAAK,CAAM;oBAClC,2BAAG,SAAS,EAAC,SAAS,IAAE,OAAO,CAAK,CAChC,CACF,CACF;QACN,6BAAK,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;YAC7B,oBAAC,IAAI,IAAC,SAAS,QAAC,IAAI,QAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;gBACrC,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IACxC,CAAC,CACG;gBACP,oBAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,IACxC,CAAC,CACG,CACF,CACH,CACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport Grid from '@material-ui/core/Grid';\nimport './Banner.css';\n\nexport default function Banner(props) {\n const { a, b, banner } = props;\n const { title, message, backgroundImage } = banner;\n return (\n <div style={{ marginBottom: '2rem' }}>\n <div\n className='background-image-style'\n style={{ backgroundImage: `url(${backgroundImage})` }}\n >\n <div className='background-style content'>\n <div>\n <h1 className='title'>{title}</h1>\n <p className='message'>{message}</p>\n </div>\n </div>\n </div>\n <div style={{ padding: '1rem' }}>\n <Grid container item xs={12} spacing={1}>\n <Grid item xs={8} style={{ padding: '1em' }}>\n {a}\n </Grid>\n <Grid item xs={4} style={{ padding: '1em' }}>\n {b}\n </Grid>\n </Grid>\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.quick-link-ul-list {
|
|
2
|
+
list-style: none;
|
|
3
|
+
padding: 0;
|
|
4
|
+
grid-template-columns: repeat(3, 1fr);
|
|
5
|
+
display: grid;
|
|
6
|
+
gap: calc(1rem);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.quick-link-list {
|
|
10
|
+
background-color: #3f51b5;
|
|
11
|
+
color: white;
|
|
12
|
+
border-radius: 8px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.quick-link-button {
|
|
16
|
+
text-transform: capitalize !important;
|
|
17
|
+
font-size: 16px !important;
|
|
18
|
+
color: white !important;
|
|
19
|
+
padding: calc(0.5rem * 2) !important;
|
|
20
|
+
height: 6rem;
|
|
21
|
+
width: 100%;
|
|
22
|
+
justify-content: start !important;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.quick-link-icon {
|
|
26
|
+
width: 1em;
|
|
27
|
+
height: 1em;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
filter: invert(100%);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.quick-link-button-span {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: 0.5rem;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WssQuickCreate.d.ts","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":";AAEA,OAAO,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK,KAAA,eAuB3C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from '@material-ui/core';
|
|
3
|
+
import './WssQuickCreate.css';
|
|
4
|
+
export default function WssQuickCreate(props) {
|
|
5
|
+
const { heading, actions } = props;
|
|
6
|
+
return (React.createElement("div", null,
|
|
7
|
+
React.createElement("h1", null, heading),
|
|
8
|
+
React.createElement("ul", { className: 'quick-link-ul-list' }, actions &&
|
|
9
|
+
actions.map(element => {
|
|
10
|
+
return (React.createElement("li", { className: 'quick-link-list', key: element.label },
|
|
11
|
+
React.createElement(Button, { className: 'quick-link-button', onClick: element.onClick },
|
|
12
|
+
React.createElement("span", { className: 'quick-link-button-span' },
|
|
13
|
+
element.icon && React.createElement("img", { className: 'quick-link-icon', src: element.icon }),
|
|
14
|
+
React.createElement("span", null, element.label)))));
|
|
15
|
+
}))));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=WssQuickCreate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WssQuickCreate.js","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/WssQuickCreate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,sBAAsB,CAAC;AAE9B,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,KAAK;IAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAEnC,OAAO,CACL;QACE,gCAAK,OAAO,CAAM;QAClB,4BAAI,SAAS,EAAC,oBAAoB,IAC/B,OAAO;YACN,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE;gBACpB,OAAO,CACP,4BAAI,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,KAAK;oBAChD,oBAAC,MAAM,IAAC,SAAS,EAAC,mBAAmB,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO;wBAC5D,8BAAM,SAAS,EAAC,wBAAwB;4BACrC,OAAO,CAAC,IAAI,IAAI,6BAAK,SAAS,EAAC,iBAAiB,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,GAAG;4BACtE,kCAAO,OAAO,CAAC,KAAK,CAAQ,CACvB,CACA,CACN,CACJ,CAAC;YACJ,CAAC,CAAC,CACD,CACD,CACP,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { Button } from '@material-ui/core';\nimport './WssQuickCreate.css';\n\nexport default function WssQuickCreate(props) {\n const { heading, actions } = props;\n\n return (\n <div>\n <h1>{heading}</h1>\n <ul className='quick-link-ul-list'>\n {actions &&\n actions.map(element => {\n return (\n <li className='quick-link-list' key={element.label}>\n <Button className='quick-link-button' onClick={element.onClick}>\n <span className='quick-link-button-span'>\n {element.icon && <img className='quick-link-icon' src={element.icon}/>}\n <span>{element.label}</span>\n </span>\n </Button>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/designSystemExtension/WssQuickCreate/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
|