@pega/react-sdk-components 0.23.24 → 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.
@@ -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(declarative?: any): React.Components<Props, State>;
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":";AAsKA;;;;;GAKG;AACH,4FAoKC"}
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
- import React, { Children, Component, createElement } from "react";
2
- // import { render, unmountComponentAtNode } from "react-dom";
3
- import PropTypes from "prop-types";
4
- import { connect, shallowEqual } from "react-redux";
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 "./Context/StoreContext";
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 "./helpers/sdk_component_map";
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
- // JA - testing
19
- // const theCompName = c11nEnv.getComponentName();
20
- // console.log(`in connect mapStateToProps callback for: ${theCompName}`);
21
- // if ( theCompName === "ViewContainer" || theCompName === "View") {
22
- // debugger;
23
- // }
24
- if (typeof component.additionalProps === "object") {
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 === "function") {
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
- // eslint-disable-next-line no-undef
57
- if (!shallowEqual(next[key], prev[key]) || (next.routingInfo && !PCore.isDeepEqual(next.routingInfo, prev.routingInfo))) {
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 === ".pyStatusWork") {
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
- return true;
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 = (c11nEnv, declarative) => {
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
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
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 = (declarative = false) => {
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
- this.children = [];
158
- this.c11nEnv = this.props.getPConnect();
159
- this.initialize();
160
- this.state = { hasError: false };
161
- this.Control = getComponent(this.c11nEnv, declarative);
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
- let theDisplayName = this.Control.displayName;
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("onChange", this.changeHandler);
197
- this.c11nEnv.setAction("onBlur", this.eventHandler);
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
- addChildren(child) {
210
- this.configProps.children.push(createElement(createPConnectComponent(), child));
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
- /* This should be called only once per component instance
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
- this.c11nEnv = getPConnect();
219
- this.configProps = {};
220
- this.eventHandler = this.eventHandler.bind(this);
221
- this.changeHandler = this.changeHandler.bind(this);
222
- this.processActions(this.c11nEnv);
223
- this.propsToChild = {};
224
- this.configProps.children = [];
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, visibility, additionalProps, ...otherProps } = this.props;
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("SdkConstellationReady", () => {
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 (React.createElement(PConnectComp, { ...{
282
- ...c11nEnv,
283
- ...c11nEnv.getPConnect().getConfigProps(),
284
- ...c11nEnv.getPConnect().getActions(),
285
- additionalProps
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("component-loader", async (componentNames = []) => {
298
+ PCore.getAssetLoader().register('component-loader', async (componentNames = []) => {
290
299
  const promises = [];
291
- componentNames.forEach((comp) => {
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, "script"));
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((module) => {
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((script) => {
315
+ ComponentMap[comp].scripts.forEach(script => {
307
316
  promises.push(
308
317
  // eslint-disable-next-line no-undef
309
- PCore.getAssetLoader().getLoader()(script, "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
- in case there is a single failure.
317
- Using allSettled to allow Promise to be resolved even if there are failed components
318
- Note : This is a liberty taken at component loader and unwise to be used at
319
- asset loader which will still use Promise.all
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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AK,CAAC;oBAC1I,oCAAoC;oBACpC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;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,C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AC,MAAM,EAAE;wBACnE,YAAY,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;4BAC1C,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,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"]}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import PropTypes from 'prop-types';
3
3
  import './View.css';
4
- declare function View(props: any): JSX.Element;
4
+ declare function View(props: any): "" | JSX.Element;
5
5
  declare namespace View {
6
6
  var defaultProps: {
7
7
  label: undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAWnC,OAAO,YAAY,CAAC;AAmBpB,iBAAwB,IAAI,CAAC,KAAK,KAAA,eAqGjC;kBArGuB,IAAI;;;;;;;;;;;;;;;;;eAAJ,IAAI"}
1
+ {"version":3,"file":"View.d.ts","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":";AACA,OAAO,SAAS,MAAM,YAAY,CAAC;AAWnC,OAAO,YAAY,CAAC;AAmBpB,iBAAwB,IAAI,CAAC,KAAK,KAAA,oBA4GjC;kBA5GuB,IAAI;;;;;;;;;;;;;;;;;eAAJ,IAAI"}
@@ -24,7 +24,7 @@ const NO_HEADER_TEMPLATES = [
24
24
  'Confirmation'
25
25
  ];
26
26
  export default function View(props) {
27
- const { children, template, getPConnect, mode } = props;
27
+ const { children, template, getPConnect, mode, visibility, name: pageName } = props;
28
28
  let { label, showLabel = false } = props;
29
29
  // Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views
30
30
  // Putting this logic here instead of copy/paste in every Form template index.js
@@ -35,6 +35,12 @@ export default function View(props) {
35
35
  if (isEmbeddedDataView && showLabel === undefined) {
36
36
  showLabel = true;
37
37
  }
38
+ const key = `${getPConnect().getContextName()}_${getPConnect().getPageReference()}_${pageName}`;
39
+ // As long as the template is defined in the dependencies of the view
40
+ // it will be loaded, otherwise fall back to single column
41
+ if (visibility === false) {
42
+ return '';
43
+ }
38
44
  // As long as the template is defined in the dependencies of the view
39
45
  // it will be loaded, otherwise fall back to single column
40
46
  // JA - React SDK not using LazyComponentMap yet
@@ -76,7 +82,7 @@ export default function View(props) {
76
82
  // for debugging/investigation
77
83
  // console.log(`View rendering template: ${template}`);
78
84
  // spreading because all props should go to the template
79
- let RenderedTemplate = React.createElement(ViewTemplate, { ...props }, children);
85
+ let RenderedTemplate = React.createElement(ViewTemplate, { key: key, ...props }, children);
80
86
  if (FORMTEMPLATES.includes(template) && showLabel) {
81
87
  // Original:
82
88
  // RenderedTemplate = (
@@ -1 +1 @@
1
- {"version":3,"file":"View.js","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,wDAAwD;AACxD,sEAAsE;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,oDAAoD;AAEpD,OAAO,YAAY,CAAC;AACpB,EAAE;AACF,qHAAqH;AACrH,uHAAuH;AACvH,+BAA+B;AAC/B,EAAE;AAEF,MAAM,aAAa,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAC5F,MAAM,mBAAmB,GAAG;IAC1B,SAAS;IACT,aAAa;IACb,SAAS;IACT,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,mBAAmB;IACnB,cAAc;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK;IAChC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACxD,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAEzC,0HAA0H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S,CAAC,IAAI,CAAC;QACjC,SAAS,CAAC,KAAK;KAChB,CAAC,CAAC,0BAA0B;IAC7B,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,iBAAiB;IAC5C,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,SAAS,EAAE,SAAS,CAAC,IAAI;IACzB,IAAI,EAAE,SAAS,CAAC,MAAM;IACtB,KAAK,EAAE,SAAS,CAAC,MAAM;CACxB,CAAC;AAEF,wFAAwF;AACxF,IAAI,CAAC,eAAe,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,EAAE;IAC5C,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC;IAE/C,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,SAAS,GAAG,EAAE,CAAC;IAEnB,QAAQ,QAAQ,EAAE;QAChB,KAAK,aAAa;YAChB,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnC,gDAAgD;YAChD,MAAM,WAAW,GAAG;gBAClB,aAAa,EAAE,SAAS,CAAC,CAAC,CAAC;gBAC3B,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC;aAC9B,CAAC;YACF,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YACnD,MAAM;QAER,KAAK,SAAS;YACZ,SAAS,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACnC,MAAM;QAER;YACE,MAAM;KACT;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n// import { FieldGroup } from \"@pega/cosmos-react-core\";\n// import { LazyMap as LazyComponentMap } from \"../../components_map\";\n\nimport { SdkComponentMap } from '../../../bridge/helpers/sdk_component_map';\nimport ErrorBoundary from '../ErrorBoundary';\n\nimport { getAllFields } from '../../helpers/template-utils';\n\n// Need to import any templates that we might render\n\nimport './View.css';\n//\n// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with\n// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and\n// is totally at your own risk.\n//\n\nconst FORMTEMPLATES = ['OneColumn', 'TwoColumn', 'DefaultForm', 'WideNarrow', 'NarrowWide'];\nconst NO_HEADER_TEMPLATES = [\n 'SubTabs',\n 'SimpleTable',\n 'Details',\n 'DetailsTwoColumn',\n 'DetailsThreeColumn',\n 'NarrowWideDetails',\n 'WideNarrowDetails',\n 'Confirmation'\n];\n\nexport default function View(props) {\n const { children, template, getPConnect, mode } = props;\n let { label, showLabel = false } = props;\n\n // Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views\n // Putting this logic here instead of copy/paste in every Form template index.js\n\n const inheritedProps = getPConnect().getInheritedProps();\n label = inheritedProps.label || label;\n showLabel = inheritedProps.showLabel || showLabel;\n\n const isEmbeddedDataView = mode === 'editable'; // would be better to check the reference child for `context` attribute if possible\n if (isEmbeddedDataView && showLabel === undefined) {\n showLabel = true;\n }\n\n // As long as the template is defined in the dependencies of the view\n // it will be loaded, otherwise fall back to single column\n // JA - React SDK not using LazyComponentMap yet\n if (template /* && LazyComponentMap[template] */) {\n // const ViewTemplate = LazyComponentMap[template];\n let ViewTemplate: any;\n\n if (SdkComponentMap) {\n // This is the node_modules version of react_pconnect!\n const theLocalComponent = SdkComponentMap.getLocalComponentMap()[template];\n if (theLocalComponent !== undefined) {\n // eslint-disable-next-line no-console\n console.log(`View component found ${template}: Local`);\n ViewTemplate = theLocalComponent;\n } else {\n const thePegaProvidedComponent = SdkComponentMap.getPegaProvidedComponentMap()[template];\n if (thePegaProvidedComponent !== undefined) {\n // console.log(`View component found ${template}: Pega-provided`);\n ViewTemplate = thePegaProvidedComponent;\n } else {\n // eslint-disable-next-line no-console\n console.error(`View component can't find template type ${template}`);\n ViewTemplate = ErrorBoundary;\n }\n }\n\n if (template === 'ListView') {\n // special case for ListView - add in a prop\n const bInForm = true;\n props = { ...props, bInForm };\n }\n } else {\n // eslint-disable-next-line no-console\n console.warn(`View: SdkComponentMap expected but not found.`);\n\n // eslint-disable-next-line no-console\n console.error(`View: Trying to render an unknown template: ${template}`);\n }\n\n // for debugging/investigation\n // console.log(`View rendering template: ${template}`);\n\n // spreading because all props should go to the template\n let RenderedTemplate = <ViewTemplate {...props}>{children}</ViewTemplate>;\n\n if (FORMTEMPLATES.includes(template) && showLabel) {\n // Original:\n // RenderedTemplate = (\n // <FieldGroup name={label} style={{ marginBlockStart: \"1rem\" }}>\n // {RenderedTemplate}\n // </FieldGroup>\n // );\n RenderedTemplate = (\n <div\n data-name='RenderedTemplate'\n data-template-type={template}\n /* name */ id='label'\n style={{ marginBlockStart: '1rem' }}\n className='grid-column'\n >\n {RenderedTemplate}\n </div>\n );\n }\n\n return (\n <div className='grid-column'>\n {showLabel && !NO_HEADER_TEMPLATES.includes(template) && (\n <div className='template-title-container'>\n <span>{label}</span>\n </div>\n )}\n {RenderedTemplate}\n </div>\n );\n }\n\n // debugging/investigation help\n // console.log(`View about to render React.Fragment for children: ${children}`);\n\n if (children) {\n return <>{children}</>;\n } else {\n return <div id='View'>View has no children.</div>;\n }\n}\n\nView.defaultProps = {\n label: undefined,\n showLabel: undefined,\n mode: undefined\n};\n\nView.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.array\n ]) /* array might be empty */,\n template: PropTypes.string /* .isRequired */,\n getPConnect: PropTypes.func.isRequired,\n label: PropTypes.string,\n showLabel: PropTypes.bool,\n mode: PropTypes.string,\n title: PropTypes.string\n};\n\n// Adapted from Constellation DX Component to add in additional props for some templates\nView.additionalProps = (state, getPConnect) => {\n const thePConn = getPConnect();\n const { template } = thePConn.getConfigProps();\n\n let propObj = {};\n let allFields = {};\n\n switch (template) {\n case 'CaseSummary':\n allFields = getAllFields(thePConn);\n // eslint-disable-next-line no-case-declarations\n const unresFields = {\n primaryFields: allFields[0],\n secondaryFields: allFields[1]\n };\n propObj = thePConn.resolveConfigProps(unresFields);\n break;\n\n case 'Details':\n allFields = getAllFields(thePConn);\n propObj = { fields: allFields[0] };\n break;\n\n default:\n break;\n }\n\n return propObj;\n};\n"]}
1
+ {"version":3,"file":"View.js","sourceRoot":"","sources":["../../../../src/components/infra/View/View.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,wDAAwD;AACxD,sEAAsE;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,oDAAoD;AAEpD,OAAO,YAAY,CAAC;AACpB,EAAE;AACF,qHAAqH;AACrH,uHAAuH;AACvH,+BAA+B;AAC/B,EAAE;AAEF,MAAM,aAAa,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;AAC5F,MAAM,mBAAmB,GAAG;IAC1B,SAAS;IACT,aAAa;IACb,SAAS;IACT,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;IACnB,mBAAmB;IACnB,cAAc;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK;IAChC,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACpF,IAAI,EAAE,KAAK,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC;IAEzC,0HAA0H;IAC1H,gFAAgF;IAEhF,MAAM,cAAc,GAAG,WAAW,EAA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AC;YACnC,MAAM;QAER;YACE,MAAM;KACT;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n// import { FieldGroup } from \"@pega/cosmos-react-core\";\n// import { LazyMap as LazyComponentMap } from \"../../components_map\";\n\nimport { SdkComponentMap } from '../../../bridge/helpers/sdk_component_map';\nimport ErrorBoundary from '../ErrorBoundary';\n\nimport { getAllFields } from '../../helpers/template-utils';\n\n// Need to import any templates that we might render\n\nimport './View.css';\n//\n// WARNING: It is not expected that this file should be modified. It is part of infrastructure code that works with\n// Redux and creation/update of Redux containers and PConnect. Modifying this code could have undesireable results and\n// is totally at your own risk.\n//\n\nconst FORMTEMPLATES = ['OneColumn', 'TwoColumn', 'DefaultForm', 'WideNarrow', 'NarrowWide'];\nconst NO_HEADER_TEMPLATES = [\n 'SubTabs',\n 'SimpleTable',\n 'Details',\n 'DetailsTwoColumn',\n 'DetailsThreeColumn',\n 'NarrowWideDetails',\n 'WideNarrowDetails',\n 'Confirmation'\n];\n\nexport default function View(props) {\n const { children, template, getPConnect, mode, visibility, name: pageName } = props;\n let { label, showLabel = false } = props;\n\n // Get the inherited props from the parent to determine label settings. For 8.6, this is only for embedded data form views\n // Putting this logic here instead of copy/paste in every Form template index.js\n\n const inheritedProps = getPConnect().getInheritedProps();\n label = inheritedProps.label || label;\n showLabel = inheritedProps.showLabel || showLabel;\n\n const isEmbeddedDataView = mode === 'editable'; // would be better to check the reference child for `context` attribute if possible\n if (isEmbeddedDataView && showLabel === undefined) {\n showLabel = true;\n }\n\n const key = `${getPConnect().getContextName()}_${getPConnect().getPageReference()}_${pageName}`;\n // As long as the template is defined in the dependencies of the view\n // it will be loaded, otherwise fall back to single column\n if (visibility === false) {\n return '';\n }\n\n // As long as the template is defined in the dependencies of the view\n // it will be loaded, otherwise fall back to single column\n // JA - React SDK not using LazyComponentMap yet\n if (template /* && LazyComponentMap[template] */) {\n // const ViewTemplate = LazyComponentMap[template];\n let ViewTemplate: any;\n\n if (SdkComponentMap) {\n // This is the node_modules version of react_pconnect!\n const theLocalComponent = SdkComponentMap.getLocalComponentMap()[template];\n if (theLocalComponent !== undefined) {\n // eslint-disable-next-line no-console\n console.log(`View component found ${template}: Local`);\n ViewTemplate = theLocalComponent;\n } else {\n const thePegaProvidedComponent = SdkComponentMap.getPegaProvidedComponentMap()[template];\n if (thePegaProvidedComponent !== undefined) {\n // console.log(`View component found ${template}: Pega-provided`);\n ViewTemplate = thePegaProvidedComponent;\n } else {\n // eslint-disable-next-line no-console\n console.error(`View component can't find template type ${template}`);\n ViewTemplate = ErrorBoundary;\n }\n }\n\n if (template === 'ListView') {\n // special case for ListView - add in a prop\n const bInForm = true;\n props = { ...props, bInForm };\n }\n } else {\n // eslint-disable-next-line no-console\n console.warn(`View: SdkComponentMap expected but not found.`);\n\n // eslint-disable-next-line no-console\n console.error(`View: Trying to render an unknown template: ${template}`);\n }\n\n // for debugging/investigation\n // console.log(`View rendering template: ${template}`);\n\n // spreading because all props should go to the template\n let RenderedTemplate = <ViewTemplate key={key} {...props}>{children}</ViewTemplate>;\n\n if (FORMTEMPLATES.includes(template) && showLabel) {\n // Original:\n // RenderedTemplate = (\n // <FieldGroup name={label} style={{ marginBlockStart: \"1rem\" }}>\n // {RenderedTemplate}\n // </FieldGroup>\n // );\n RenderedTemplate = (\n <div\n data-name='RenderedTemplate'\n data-template-type={template}\n /* name */ id='label'\n style={{ marginBlockStart: '1rem' }}\n className='grid-column'\n >\n {RenderedTemplate}\n </div>\n );\n }\n\n return (\n <div className='grid-column'>\n {showLabel && !NO_HEADER_TEMPLATES.includes(template) && (\n <div className='template-title-container'>\n <span>{label}</span>\n </div>\n )}\n {RenderedTemplate}\n </div>\n );\n }\n\n // debugging/investigation help\n // console.log(`View about to render React.Fragment for children: ${children}`);\n\n if (children) {\n return <>{children}</>;\n } else {\n return <div id='View'>View has no children.</div>;\n }\n}\n\nView.defaultProps = {\n label: undefined,\n showLabel: undefined,\n mode: undefined\n};\n\nView.propTypes = {\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.array\n ]) /* array might be empty */,\n template: PropTypes.string /* .isRequired */,\n getPConnect: PropTypes.func.isRequired,\n label: PropTypes.string,\n showLabel: PropTypes.bool,\n mode: PropTypes.string,\n title: PropTypes.string\n};\n\n// Adapted from Constellation DX Component to add in additional props for some templates\nView.additionalProps = (state, getPConnect) => {\n const thePConn = getPConnect();\n const { template } = thePConn.getConfigProps();\n\n let propObj = {};\n let allFields = {};\n\n switch (template) {\n case 'CaseSummary':\n allFields = getAllFields(thePConn);\n // eslint-disable-next-line no-case-declarations\n const unresFields = {\n primaryFields: allFields[0],\n secondaryFields: allFields[1]\n };\n propObj = thePConn.resolveConfigProps(unresFields);\n break;\n\n case 'Details':\n allFields = getAllFields(thePConn);\n propObj = { fields: allFields[0] };\n break;\n\n default:\n break;\n }\n\n return propObj;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"FieldGroupTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx"],"names":[],"mappings":";AAEA,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,iBAAwB,kBAAkB,CAAC,KAAK,KAAA,eAkF/C;kBAlFuB,kBAAkB;;;;;;;;;;;;;;;;;eAAlB,kBAAkB"}
1
+ {"version":3,"file":"FieldGroupTemplate.d.ts","sourceRoot":"","sources":["../../../../src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx"],"names":[],"mappings":";AAEA,OAAO,SAAS,MAAM,YAAY,CAAC;AAQnC,iBAAwB,kBAAkB,CAAC,KAAK,KAAA,eAqF/C;kBArFuB,kBAAkB;;;;;;;;;;;;;;;;;eAAlB,kBAAkB"}
@@ -54,7 +54,10 @@ export default function FieldGroupTemplate(props) {
54
54
  }
55
55
  pConn.setInheritedProp('displayMode', 'LABELS_LEFT');
56
56
  const memoisedReadOnlyList = useMemo(() => {
57
- return referenceList.map((item, index) => (React.createElement(FieldGroup, { key: item[heading], name: fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}` }, buildView(pConn, index, lookForChildInConfig))));
57
+ return referenceList.map((item, index) => {
58
+ const key = item[heading] || `field-group-row-${index}`;
59
+ return (React.createElement(FieldGroup, { key: key, name: fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}` }, buildView(pConn, index, lookForChildInConfig)));
60
+ });
58
61
  }, []);
59
62
  return React.createElement("div", null, memoisedReadOnlyList);
60
63
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FieldGroupTemplate.js","sourceRoot":"","sources":["../../../../src/components/template/FieldGroupTemplate/FieldGroupTemplate.tsx"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,OAAO,UAAU,MAAM,wCAAwC,CAAC;AAChE,OAAO,cAAc,MAAM,4CAA4C,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAI9E,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,KAAK;IAC9C,MAAM,EACJ,aAAa,EACb,UAAU,EACV,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,WAAW,EACX,cAAc,EAAE,YAAY,EAC7B,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,YAAY,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAC7C,KAAK,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACrC,MAAM,aAAa,GAAG,GAAG,KAAK,CAAC,gBAAgB,EAAE,GAAG,YAAY,EAAE,CAAC;IACnE,MAAM,cAAc,GAAG,UAAU,KAAK,UAAU,IAAI,WAAW,KA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AC,CACnC,CACd,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,iCAAM,oBAAoB,CAAO,CAAC;AAC3C,CAAC;AAED,kBAAkB,CAAC,YAAY,GAAG;IAChC,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,SAAS;CACvB,CAAC;AAEF,kBAAkB,CAAC,SAAS,GAAG;IAC7B,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC;IACxC,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACvC,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,oBAAoB,EAAE,SAAS,CAAC,IAAI;IACpC,WAAW,EAAE,SAAS,CAAC,MAAM;CAC9B,CAAC","sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks */\nimport React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport FieldGroup from '../../designSystemExtension/FieldGroup';\nimport FieldGroupList from '../../designSystemExtension/FieldGroupList';\nimport { getReferenceList, buildView } from '../../helpers/field-group-utils';\n\ndeclare const PCore: any;\n\nexport default function FieldGroupTemplate(props) {\n const {\n referenceList,\n renderMode,\n contextClass,\n getPConnect,\n lookForChildInConfig,\n heading,\n displayMode,\n fieldHeader,\n allowTableEdit: allowAddEdit\n } = props;\n const pConn = getPConnect();\n const resolvedList = getReferenceList(pConn);\n pConn.setReferenceList(resolvedList);\n const pageReference = `${pConn.getPageReference()}${resolvedList}`;\n const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';\n const HEADING = heading ?? 'Row';\n\n const getDynamicHeaderProp = (item, index) => {\n if (fieldHeader === 'propertyRef' && heading && item[heading.substring(1)]) {\n return item[heading.substring(1)];\n }\n return `Row ${index + 1}`;\n };\n\n const addRecord = () => {\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);\n } else {\n pConn.getListActions().insert({ classID: contextClass }, referenceList.length);\n }\n };\n\n if (!isReadonlyMode) {\n const addFieldGroupItem = () => {\n addRecord();\n };\n const deleteFieldGroupItem = index => {\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n pConn.getListActions().deleteEntry(index, pageReference);\n } else {\n pConn.getListActions().deleteEntry(index);\n }\n };\n if (referenceList.length === 0 && allowAddEdit !== false) {\n addFieldGroupItem();\n }\n\n const MemoisedChildren = useMemo(() => {\n return referenceList.map((item, index) => ({\n id: index,\n name:\n fieldHeader === 'propertyRef'\n ? getDynamicHeaderProp(item, index)\n : `${HEADING} ${index + 1}`,\n children: buildView(pConn, index, lookForChildInConfig)\n }));\n }, [referenceList?.length]);\n\n return (\n <FieldGroupList\n items={MemoisedChildren}\n onAdd={allowAddEdit !== false ? addFieldGroupItem : undefined}\n onDelete={allowAddEdit !== false ? deleteFieldGroupItem : undefined}\n />\n );\n }\n\n pConn.setInheritedProp('displayMode', 'LABELS_LEFT');\n const memoisedReadOnlyList = useMemo(() => {\n return referenceList.map((item, index) => (\n <FieldGroup\n key={item[heading]}\n name={fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`}\n >\n {buildView(pConn, index, lookForChildInConfig)}\n </FieldGroup>\n ));\n }, []);\n\n return <div>{memoisedReadOnlyList}</div>;\n}\n\nFieldGroupTemplate.defaultProps = {\n referenceList: [],\n heading: undefined,\n contextClass: null,\n displayMode: undefined\n};\n\nFieldGroupTemplate.propTypes = {\n referenceList: PropTypes.arrayOf(Object),\n contextClass: PropTypes.string,\n getPConnect: PropTypes.func.isRequired,\n renderMode: PropTypes.string.isRequired,\n heading: PropTypes.string,\n lookForChildInConfig: PropTypes.bool,\n displayMode: PropTypes.string\n};\n"]}
1
+ {"version":3,"file":"FieldGroupTemplate.js","source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MAAM,CAAC;IACxC,YAAY,EAAE,SAAS,CAAC,MAAM;IAC9B,WAAW,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU;IACtC,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACvC,OAAO,EAAE,SAAS,CAAC,MAAM;IACzB,oBAAoB,EAAE,SAAS,CAAC,IAAI;IACpC,WAAW,EAAE,SAAS,CAAC,MAAM;CAC9B,CAAC","sourcesContent":["/* eslint-disable react-hooks/rules-of-hooks */\nimport React, { useMemo } from 'react';\nimport PropTypes from 'prop-types';\n\nimport FieldGroup from '../../designSystemExtension/FieldGroup';\nimport FieldGroupList from '../../designSystemExtension/FieldGroupList';\nimport { getReferenceList, buildView } from '../../helpers/field-group-utils';\n\ndeclare const PCore: any;\n\nexport default function FieldGroupTemplate(props) {\n const {\n referenceList,\n renderMode,\n contextClass,\n getPConnect,\n lookForChildInConfig,\n heading,\n displayMode,\n fieldHeader,\n allowTableEdit: allowAddEdit\n } = props;\n const pConn = getPConnect();\n const resolvedList = getReferenceList(pConn);\n pConn.setReferenceList(resolvedList);\n const pageReference = `${pConn.getPageReference()}${resolvedList}`;\n const isReadonlyMode = renderMode === 'ReadOnly' || displayMode === 'LABELS_LEFT';\n const HEADING = heading ?? 'Row';\n\n const getDynamicHeaderProp = (item, index) => {\n if (fieldHeader === 'propertyRef' && heading && item[heading.substring(1)]) {\n return item[heading.substring(1)];\n }\n return `Row ${index + 1}`;\n };\n\n const addRecord = () => {\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n pConn.getListActions().insert({ classID: contextClass }, referenceList.length, pageReference);\n } else {\n pConn.getListActions().insert({ classID: contextClass }, referenceList.length);\n }\n };\n\n if (!isReadonlyMode) {\n const addFieldGroupItem = () => {\n addRecord();\n };\n const deleteFieldGroupItem = index => {\n if (PCore.getPCoreVersion()?.includes('8.7')) {\n pConn.getListActions().deleteEntry(index, pageReference);\n } else {\n pConn.getListActions().deleteEntry(index);\n }\n };\n if (referenceList.length === 0 && allowAddEdit !== false) {\n addFieldGroupItem();\n }\n\n const MemoisedChildren = useMemo(() => {\n return referenceList.map((item, index) => ({\n id: index,\n name:\n fieldHeader === 'propertyRef'\n ? getDynamicHeaderProp(item, index)\n : `${HEADING} ${index + 1}`,\n children: buildView(pConn, index, lookForChildInConfig)\n }));\n }, [referenceList?.length]);\n\n return (\n <FieldGroupList\n items={MemoisedChildren}\n onAdd={allowAddEdit !== false ? addFieldGroupItem : undefined}\n onDelete={allowAddEdit !== false ? deleteFieldGroupItem : undefined}\n />\n );\n }\n\n pConn.setInheritedProp('displayMode', 'LABELS_LEFT');\n const memoisedReadOnlyList = useMemo(() => {\n return referenceList.map((item, index) => {\n const key = item[heading] || `field-group-row-${index}`;\n return (\n <FieldGroup\n key={key}\n name={fieldHeader === 'propertyRef' ? getDynamicHeaderProp(item, index) : `${HEADING} ${index + 1}`}\n >\n {buildView(pConn, index, lookForChildInConfig)}\n </FieldGroup>\n );\n });\n }, []);\n\n return <div>{memoisedReadOnlyList}</div>;\n}\n\nFieldGroupTemplate.defaultProps = {\n referenceList: [],\n heading: undefined,\n contextClass: null,\n displayMode: undefined\n};\n\nFieldGroupTemplate.propTypes = {\n referenceList: PropTypes.arrayOf(Object),\n contextClass: PropTypes.string,\n getPConnect: PropTypes.func.isRequired,\n renderMode: PropTypes.string.isRequired,\n heading: PropTypes.string,\n lookForChildInConfig: PropTypes.bool,\n displayMode: PropTypes.string\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pega/react-sdk-components",
3
- "version": "0.23.24",
3
+ "version": "0.23.25",
4
4
  "description": "React SDK Infrastructure: bridge and components",
5
5
  "_filesComment": "During packing, npm ignores everything NOT in the files list",
6
6
  "files": [