@pega/dx-component-builder-sdk 0.24.2 → 0.24.3

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.
Files changed (168) hide show
  1. package/package.json +1 -1
  2. package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +94 -4
  3. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/config.json +1 -1
  4. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -1
  5. package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +1 -1
  6. package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
  7. package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
  8. package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +36 -26
  9. package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +33 -19
  10. package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
  11. package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +33 -18
  12. package/tests/assets/sdk-r/components/create/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
  13. package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +11 -1
  14. package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +2 -1
  15. package/tests/assets/sdk-r/components/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
  16. package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
  17. package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
  18. package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +2 -2
  19. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +2 -1
  20. package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  21. package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +1 -1
  22. package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/utils/index.ts +2 -7
  23. package/tests/assets/sdk-r/components/create/override-sdk/template/Details/Details.tsx +1 -1
  24. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
  25. package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
  26. package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
  27. package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +4 -2
  28. package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  29. package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
  30. package/tests/assets/sdk-r/components/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
  31. package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
  32. package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  33. package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
  34. package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +3 -2
  35. package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
  36. package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
  37. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
  38. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
  39. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +99 -0
  40. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/index.tsx +201 -0
  41. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
  42. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
  43. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/index.tsx +0 -1
  44. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/date.ts +15 -37
  45. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +11 -0
  46. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +3 -0
  47. package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/index.tsx +94 -4
  48. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
  49. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
  50. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
  51. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Operator.tsx +215 -0
  52. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +77 -23
  53. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/index.tsx +48 -37
  54. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/mock.ts +78 -20
  55. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/styles.ts +16 -0
  56. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
  57. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/index.tsx +28 -5
  58. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
  59. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/localizations.json +4 -2
  60. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
  61. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
  62. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
  63. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
  64. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +95 -26
  65. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
  66. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
  67. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
  68. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
  69. package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
  70. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +87 -6
  71. package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/index.tsx +67 -5
  72. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/demo.stories.tsx +1 -1
  73. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/mock.ts +8 -8
  74. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/config.json +1 -1
  75. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +1 -1
  76. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +44 -34
  77. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/mock.ts +1 -1
  78. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +2 -2
  79. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/mock.ts +7 -7
  80. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -1
  81. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +2 -3
  82. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/mock.ts +6 -6
  83. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +48 -32
  84. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/mock.ts +1 -1
  85. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/config.json +1 -1
  86. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/mock.ts +1 -1
  87. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/config.json +64 -0
  88. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +91 -0
  89. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +157 -0
  90. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/mock.ts +4 -0
  91. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/styles.js +7 -0
  92. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/config.json +1 -1
  93. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +16 -17
  94. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/mock.ts +1 -1
  95. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +1 -3
  96. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/mock.ts +1 -1
  97. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/config.json +1 -1
  98. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +34 -19
  99. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/mock.ts +1 -1
  100. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +1 -2
  101. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +23 -23
  102. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/mock.ts +0 -1
  103. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/config.json +1 -1
  104. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +0 -1
  105. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/mock.ts +1 -1
  106. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/config.json +1 -1
  107. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +0 -1
  108. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/mock.ts +1 -1
  109. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +4 -4
  110. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +0 -2
  111. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/mock.ts +6 -6
  112. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +1 -2
  113. package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/mock.ts +1 -1
  114. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +1 -7
  115. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +4 -9
  116. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/mock.ts +181 -165
  117. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/config.json +1 -1
  118. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +0 -1
  119. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +11 -13
  120. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/utils.ts +1 -1
  121. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/OneColumn.tsx +12 -13
  122. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -1
  123. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/index.tsx +3 -5
  124. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/mock.ts +8 -9
  125. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -6
  126. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -9
  127. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +207 -163
  128. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +0 -2
  129. package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/mock.ts +121 -122
  130. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/config.json +2 -2
  131. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +0 -1
  132. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
  133. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +1 -2
  134. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +0 -1
  135. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/mock.ts +0 -1
  136. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/config.json +43 -43
  137. package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/mock.ts +1 -1
  138. package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
  139. package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
  140. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +36 -26
  141. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +33 -19
  142. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
  143. package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +33 -18
  144. package/tests/assets/sdk-r/components/createAll/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
  145. package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +11 -1
  146. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +2 -1
  147. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
  148. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
  149. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
  150. package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +2 -2
  151. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +2 -1
  152. package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
  153. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +1 -1
  154. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/utils/index.ts +2 -7
  155. package/tests/assets/sdk-r/components/createAll/override-sdk/template/Details/Details.tsx +1 -1
  156. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
  157. package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
  158. package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
  159. package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +4 -2
  160. package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
  161. package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
  162. package/tests/assets/sdk-r/components/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
  163. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
  164. package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
  165. package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
  166. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +3 -2
  167. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
  168. package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
@@ -6,3 +6,19 @@ export default styled.div(() => {
6
6
  margin: 0px 0;
7
7
  `;
8
8
  });
9
+
10
+ export const StyledDetailsGridContainer = styled.div(() => {
11
+ return css`
12
+ margin-line-start: 1;
13
+ `;
14
+ });
15
+
16
+
17
+ export const StyledHighlightedFieldsHrLine = styled.hr(() => {
18
+ return css`
19
+ line: {
20
+ margin: '0.75rem 0';
21
+ opacity: '50%'
22
+ }
23
+ `;
24
+ });
@@ -0,0 +1,59 @@
1
+ import { Fragment, ReactElement } from 'react';
2
+ import { FieldValueList } from '@pega/cosmos-react-core';
3
+
4
+ interface DetailsRenderProps {
5
+ children?: never;
6
+ child: NonNullable<ReactElement>;
7
+ }
8
+
9
+ const DetailsRender = (props: DetailsRenderProps) => {
10
+ const { child } = props;
11
+
12
+ const kids = child.props.getPConnect().getChildren();
13
+
14
+ const displayCompArr: ReactElement[] = [];
15
+
16
+ Object.values(kids).forEach((value: any) => {
17
+ const { type } = value.getPConnect().getRawMetadata();
18
+ const { hideLabel, variant, testId, label } = value
19
+ .getPConnect()
20
+ .resolveConfigProps(value.getPConnect().getConfigProps());
21
+
22
+ let displayComp;
23
+ const key = JSON.stringify(value.getPConnect());
24
+
25
+ if (type === 'reference') {
26
+ const refElement = value.getPConnect().getComponent();
27
+
28
+ displayCompArr.push(refElement);
29
+ } else {
30
+ const element = value.getPConnect().getComponent();
31
+ const displayEl = <Fragment key={key}>{element}</Fragment>;
32
+
33
+ const fvlStyle = {
34
+ myColGap: {
35
+ columnGap: '0',
36
+ marginLineStart: 0
37
+ }
38
+ };
39
+
40
+ // const myEl = <div>boo</div>;
41
+ displayComp = (
42
+ <Fragment key={key}>
43
+ <FieldValueList
44
+ style={fvlStyle.myColGap}
45
+ variant={hideLabel ? 'stacked' : variant}
46
+ data-testid={testId}
47
+ fields={[{ id: '1', name: hideLabel ? '' : label, value: displayEl }]}
48
+ />
49
+ </Fragment>
50
+ );
51
+
52
+ displayCompArr.push(displayComp);
53
+ }
54
+ });
55
+
56
+ return <>{displayCompArr}</>;
57
+ };
58
+
59
+ export default DetailsRender;
@@ -1,7 +1,8 @@
1
- import { Grid, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
1
+ import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
2
2
 
3
3
 
4
4
  import type { PConnFieldProps } from './PConnProps';
5
+ import DetailsRender from './DetailsRender';
5
6
 
6
7
  import StyledPegaDxilMyFormWrapper from './styles';
7
8
 
@@ -13,19 +14,41 @@ interface PegaDxilMyFormProps extends PConnFieldProps {
13
14
  children: any;
14
15
  }
15
16
 
16
- // Duplicated runtime code from Constellation Design System Component
17
-
18
17
  // props passed in combination of props from property panel (config.json) and run time props from Constellation
19
18
  // any default values in config.pros should be set in defaultProps at bottom of this file
20
19
  function PegaDxilMyForm(props: PegaDxilMyFormProps) {
21
20
 
22
- const { children = [], NumCols = '1', label, showLabel, getPConnect } = props;
21
+ const { children = [], NumCols = '1', label, showLabel, getPConnect, readOnly, displayMode } = props;
23
22
  const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
24
23
 
25
24
  const nCols = parseInt(NumCols, 10);
26
25
 
27
- // console.log(`Rendering ${getPConnect()?.getComponentName()} with ${template} with ${children?.length} Region(s)`);
28
26
 
27
+ if (readOnly && readOnly === true && displayMode && displayMode === 'DISPLAY_ONLY') {
28
+ const numRegions = '1';
29
+ const gridRepeat = 'repeat('.concat(numRegions).concat(', 1fr)');
30
+ const gridContainer = { colGap: 0, 'margin-line-start': 0 };
31
+ // @ts-ignore
32
+ gridContainer.cols = gridRepeat;
33
+
34
+ return (
35
+ <StyledPegaDxilMyFormWrapper>
36
+ <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
37
+ <Grid container={gridContainer} data-testid={`column-count-${numRegions}`}>
38
+ {children.map((child: any, i: number) => (
39
+ <Flex
40
+ // @ts-ignore
41
+ container={{ direction: 'column', alignItems: 'normal', colGap: 1, rowGap: 1.5 }}
42
+ key={`r-${i + 1}`}
43
+ >
44
+ <DetailsRender child={child} />
45
+ </Flex>
46
+ ))}
47
+ </Grid>
48
+ </FieldGroup>
49
+ </StyledPegaDxilMyFormWrapper>
50
+ );
51
+ }
29
52
  return (
30
53
  <StyledPegaDxilMyFormWrapper>
31
54
  <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
@@ -18,6 +18,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
18
18
  const toasterCtx = useToaster();
19
19
 
20
20
  const localizedVal = PCore.getLocaleUtils().getLocaleValue;
21
+ const localeCategory = 'Case';
21
22
 
22
23
  const getNextWork = () => {
23
24
 
@@ -30,7 +31,7 @@ export default function GetNextWork(props: PegaDxilMyPageWorkProps) {
30
31
  console.log(err);
31
32
  if (err[0].status === 404) {
32
33
  toasterCtx.push({
33
- content: localizedVal('No task currently available')
34
+ content: localizedVal('No task currently available', localeCategory)
34
35
  });
35
36
  }
36
37
  });
@@ -1,4 +1,6 @@
1
1
  {
2
- "Get next work" : "Get next work",
3
- "No task currently available" : "No task currently available"
2
+ "fields" : {
3
+ "Get next work" : "Get next work",
4
+ "No task currently available" : "No task currently available"
5
+ }
4
6
  }
@@ -0,0 +1,78 @@
1
+ /* eslint-disable react-hooks/rules-of-hooks */
2
+ import React from 'react';
3
+ import { useEffect, useState } from 'react';
4
+ import { Avatar as CosmosAvatar, withConfiguration } from '@pega/cosmos-react-core';
5
+ import type { PConnFieldProps } from './PConnProps';
6
+
7
+
8
+ // interface for props
9
+ interface PegaDxilMyTwoColumnDetailsAvatarProps extends PConnFieldProps {
10
+ // If any, enter additional props that only exist on TextInput here
11
+ metaObj: any;
12
+ showStatus: boolean;
13
+
14
+ }
15
+
16
+ function Avatar(props: PegaDxilMyTwoColumnDetailsAvatarProps) {
17
+ const { metaObj, showStatus = false } = props;
18
+ const [imageBlobUrl, setImageBlobUrl] = useState(null);
19
+ let userName: string;
20
+ let userIdentifier: string;
21
+
22
+ // TODO Below if conditions can be removed once we have apis to get worklist/mywork info
23
+ // This is non CaseView case (Dashboard, MyWork etc)
24
+ if (!metaObj) {
25
+ userName = PCore.getEnvironmentInfo().getOperatorName();
26
+ userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
27
+ } else {
28
+ userName = metaObj.name;
29
+ userIdentifier = metaObj.ID;
30
+ }
31
+ if (!userName && userIdentifier) {
32
+ userName = userIdentifier;
33
+ }
34
+
35
+ useEffect(() => {
36
+ const imageKey = !metaObj ? PCore.getEnvironmentInfo().getOperatorImageInsKey() : metaObj.image;
37
+ if (imageKey) {
38
+ PCore.getAssetLoader()
39
+ .getSvcImage(imageKey)
40
+ .then((blob) => window.URL.createObjectURL(blob))
41
+ .then((imagePath) => setImageBlobUrl(imagePath as React.SetStateAction<any>));
42
+ }
43
+ }, [metaObj]);
44
+
45
+ if (showStatus) {
46
+ const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
47
+ const [userState, setUserState]: any = useState(currentState === 'online' ? 'active' : 'inactive');
48
+
49
+ // @ts-ignore
50
+ const handleUserStateChange = ({ state }) => {
51
+ setUserState(state === 'online' ? 'active' : 'inactive');
52
+ };
53
+
54
+ useEffect(() => {
55
+ const subId = PCore.getMessagingServiceManager()
56
+ .getUserPresence()
57
+ // @ts-ignore
58
+ .subscribe(userIdentifier, handleUserStateChange);
59
+
60
+ return function cleanup() {
61
+ PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
62
+ };
63
+ }, [userIdentifier, handleUserStateChange]);
64
+ // @ts-ignore
65
+ return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} status={userState} />;
66
+ }
67
+
68
+ // Do not render when userName does not exists
69
+ // TODO : In CNR case, pxRequestor is not available, please remove this condition once it populates
70
+ if (!userName) {
71
+ return null;
72
+ }
73
+
74
+ return <CosmosAvatar name={userName} imageSrc={imageBlobUrl as React.SetStateAction<any>} />;
75
+ }
76
+
77
+
78
+ export default withConfiguration(Avatar);
@@ -0,0 +1,52 @@
1
+ import { Fragment, ReactElement } from 'react';
2
+ import { FieldValueList } from '@pega/cosmos-react-core';
3
+
4
+ interface DetailsRenderProps {
5
+ children?: never;
6
+ child: NonNullable<ReactElement>;
7
+ }
8
+
9
+ const DetailsRender = (props: DetailsRenderProps) => {
10
+ const { child } = props;
11
+
12
+ const kids = child.props.getPConnect().getChildren();
13
+
14
+ const displayCompArr: ReactElement[] = [];
15
+
16
+ Object.values(kids).forEach((value: any, i :number) => {
17
+ const { type } = value.getPConnect().getRawMetadata();
18
+ const { hideLabel, variant, testId, label } = value
19
+ .getPConnect()
20
+ .resolveConfigProps(value.getPConnect().getConfigProps());
21
+
22
+ let displayComp;
23
+ const key = JSON.stringify(value.getPConnect());
24
+ const key1 = key.concat(`-${i}`);
25
+
26
+ if (type === 'reference') {
27
+ const refElement = value.getPConnect().getComponent();
28
+
29
+ displayCompArr.push(refElement);
30
+ } else {
31
+ const element = value.getPConnect().getComponent();
32
+ const displayEl = <Fragment key={key}>{element}</Fragment>;
33
+
34
+ displayComp = (
35
+ <Fragment key={key1}>
36
+ <FieldValueList
37
+ style={{ columnGap: '0'}}
38
+ variant={hideLabel ? 'stacked' : variant}
39
+ data-testid={testId}
40
+ fields={[{ id: '1', name: hideLabel ? '' : label, value: displayEl }]}
41
+ />
42
+ </Fragment>
43
+ );
44
+
45
+ displayCompArr.push(displayComp);
46
+ }
47
+ });
48
+
49
+ return <>{displayCompArr}</>;
50
+ };
51
+
52
+ export default DetailsRender;
@@ -0,0 +1,46 @@
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import React from 'react';
3
+ import { FieldValueList, Text } from '@pega/cosmos-react-core';
4
+ import type { PConnProps } from './PConnProps';
5
+
6
+ interface HighlightRenderProps extends PConnProps {
7
+ field?: any;
8
+ }
9
+
10
+ const HighlightRender = (props: HighlightRenderProps) => {
11
+ const { getPConnect, field } = props;
12
+
13
+ field.config.displayMode = 'DISPLAY_ONLY';
14
+
15
+ // Mark as status display when using pyStatusWork
16
+ if (field.config?.value === '@P .pyStatusWork') {
17
+ field.type = 'TextInput';
18
+ field.config.displayAsStatus = true;
19
+ }
20
+
21
+ const configProps: any = getPConnect().resolveConfigProps(field.config);
22
+
23
+ // @ts-ignore
24
+ const reactField = getPConnect().createComponent(field);
25
+
26
+ return (
27
+ <FieldValueList
28
+ style={{ width: 'auto' }}
29
+ variant='stacked'
30
+ data-testid={field.testId}
31
+ fields={[
32
+ {
33
+ id: '2',
34
+ name: configProps.hideLabel ? '' : configProps.label,
35
+ value: (
36
+ <Text variant='h1' as='span'>
37
+ {reactField}
38
+ </Text>
39
+ )
40
+ }
41
+ ]}
42
+ />
43
+ );
44
+ };
45
+
46
+ export default HighlightRender;
@@ -0,0 +1,215 @@
1
+ // @ts-nocheck
2
+ import { useState, useEffect, Fragment } from 'react';
3
+ import {
4
+ Link,
5
+ Button,
6
+ Popover,
7
+ useOuterEvent,
8
+ useElement,
9
+ Progress,
10
+ FormField,
11
+ useTheme,
12
+ withConfiguration
13
+ } from '@pega/cosmos-react-core';
14
+ import { Glimpse } from '@pega/cosmos-react-work';
15
+ import { EmailDisplay } from '@pega/cosmos-react-core';
16
+
17
+ import type { PConnFieldProps } from './PConnProps';
18
+
19
+ import Avatar from './Avatar';
20
+
21
+
22
+ // interface for props
23
+ interface PegaDxilMyTwoColumnDetailsOperatorProps extends PConnFieldProps {
24
+ // If any, enter additional props that only exist on TextInput here
25
+ name: string;
26
+ id: string;
27
+ label: string;
28
+ metaObj: any;
29
+ externalUser: any;
30
+ }
31
+
32
+ let pTarget = null;
33
+
34
+ function Operator(props: PegaDxilMyTwoColumnDetailsOperatorProps) {
35
+ const { id, name, label, testId, helperText, externalUser, metaObj } = props;
36
+ const [isOpen, setIsOpen] = useState(false);
37
+ const [isLoading, setIsLoading] = useState(true);
38
+ const [popoverEl, setPopoverEl] = useElement(null);
39
+ const [popoverContent, setpopoverContent] = useState(null);
40
+ const theme: any = useTheme();
41
+
42
+ /* If the id has changed, we need to reset the popover */
43
+ useEffect(() => {
44
+ pTarget = null;
45
+ }, [id]);
46
+
47
+
48
+
49
+ const OperatorPreview = () => {
50
+ const localizedVal = PCore.getLocaleUtils().getLocaleValue;
51
+ const localeCategory = 'Operator';
52
+ setpopoverContent(
53
+ <Progress variant='ring' message={localizedVal('Loading operator...', localeCategory)} placement='local' />
54
+ );
55
+ if (externalUser && externalUser.classID !== 'Data-Party-Operator') {
56
+ const fields = [
57
+ {
58
+ id: 'pyFirstName',
59
+ name: localizedVal('Name', localeCategory),
60
+ value: externalUser.name
61
+ },
62
+ {
63
+ id: 'pyEmail1',
64
+ name: localizedVal('Email', localeCategory),
65
+ value:
66
+ externalUser.email !== '' ? <Link href={`mailto:${externalUser.email}`}>{externalUser.email}</Link> : ''
67
+ },
68
+ {
69
+ id: 'pyPhoneNumber',
70
+ name: localizedVal('Phone', localeCategory),
71
+ value: externalUser.phone !== '' ? <Link href={`tel:${externalUser.phone}`}>{externalUser.phone}</Link> : ''
72
+ }
73
+ ];
74
+ setIsLoading(false);
75
+ setpopoverContent(
76
+ <Glimpse
77
+ visual={
78
+ <Avatar
79
+ metaObj={{
80
+ name: externalUser.name
81
+ }}
82
+ />
83
+ }
84
+ primary={externalUser.name}
85
+ secondary={[externalUser.position]}
86
+ fields={fields}
87
+ target={pTarget}
88
+ />
89
+ );
90
+ } else {
91
+ return PCore.getUserApi()
92
+ .getOperatorDetails(id, true)
93
+ .then(res => {
94
+ if (res.data?.pyOperatorInfo) {
95
+ const fields = [];
96
+ const data = res.data;
97
+ if (data.pyOperatorInfo && data.pyOperatorInfo.pyUserName) {
98
+ fields.push({
99
+ id: 'Name',
100
+ name: localizedVal('Name', localeCategory),
101
+ value: data.pyOperatorInfo.pyUserName
102
+ });
103
+ }
104
+ if (data.pyOperatorInfo && data.pyOperatorInfo.pyEmailAddress) {
105
+ fields.push({
106
+ id: 'Email',
107
+ name: localizedVal('Email address', localeCategory),
108
+ value: <EmailDisplay value={data.pyOperatorInfo.pyEmailAddress} />
109
+ });
110
+ }
111
+ const opAvatar = (
112
+ <Avatar
113
+ metaObj={{
114
+ image: '',
115
+ name: data.pyOperatorInfo.pyUserName
116
+ }}
117
+ />
118
+ );
119
+
120
+ setIsLoading(false);
121
+ setpopoverContent(
122
+ <Glimpse
123
+ heading={{
124
+ primary: data.pyOperatorInfo.pyUserName,
125
+ secondary: data.pyOperatorInfo.pyEmailAddress,
126
+ visual: opAvatar
127
+ }}
128
+ fields={fields}
129
+ target={pTarget}
130
+ onDismiss={() => {pTarget = null;}}
131
+ />
132
+ );
133
+ }
134
+ });
135
+ }
136
+ };
137
+
138
+
139
+ const clickAction = (e: any) => {
140
+
141
+ setIsOpen(!isOpen);
142
+ if (pTarget === null) {
143
+ pTarget = e.currentTarget;
144
+ OperatorPreview();
145
+ }
146
+ };
147
+
148
+ const hidePopover = () => {
149
+ if (isOpen) {
150
+ setIsOpen(false);
151
+ }
152
+ };
153
+
154
+ useOuterEvent('mousedown', [popoverEl], hidePopover); // Call the method on clicking outside these elements
155
+
156
+ const hideOnEscape = (e: any) => {
157
+ if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed
158
+ };
159
+
160
+ const comp = (
161
+ <Fragment>
162
+ {metaObj ? (
163
+ <Button
164
+ variant='text'
165
+ aria-haspopup
166
+ aria-expanded={isOpen}
167
+ onClick={clickAction}
168
+ onKeyDown={hideOnEscape}
169
+ data-test-id={testId}
170
+ style={label !== null ? { width: 'max-content', height: theme.components.input.height } : undefined}
171
+ >
172
+ <Avatar {...props} />
173
+ </Button>
174
+ ) : (
175
+ <Button
176
+ variant='link'
177
+ aria-haspopup
178
+ aria-expanded={isOpen}
179
+ onClick={clickAction}
180
+ onKeyDown={hideOnEscape}
181
+ data-test-id={testId}
182
+ style={label !== null ? { width: 'max-content', height: theme.components.input.height } : undefined}
183
+ >
184
+ {name}
185
+ </Button>
186
+ )}
187
+
188
+ {isOpen && (
189
+ <Popover
190
+ ref={setPopoverEl}
191
+ groupId='operator'
192
+ target={pTarget}
193
+ placement='bottom-start'
194
+ style={isLoading ? { position: 'relative', width: '10rem', minHeight: '4rem' } : undefined}
195
+ strategy='fixed'
196
+ >
197
+ {popoverContent}
198
+ </Popover>
199
+ )}
200
+ </Fragment>
201
+ );
202
+
203
+ if (label !== null) {
204
+ return (
205
+ <FormField label={label} info={helperText}>
206
+ {comp}
207
+ </FormField>
208
+ );
209
+ }
210
+
211
+ return comp;
212
+ };
213
+
214
+
215
+ export default withConfiguration(Operator);