@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.
- package/package.json +1 -1
- package/tests/assets/sdk-r/components/create/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +94 -4
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/config.json +1 -1
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -1
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
- package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +36 -26
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +33 -19
- package/tests/assets/sdk-r/components/create/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +33 -18
- package/tests/assets/sdk-r/components/create/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/UserReference/UserReference.tsx +11 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +2 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DataReference/DataReference.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/utils/index.ts +2 -7
- package/tests/assets/sdk-r/components/create/override-sdk/template/Details/Details.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +4 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +3 -2
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +99 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/index.tsx +201 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/date.ts +15 -37
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/index.tsx +11 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MySearchbox/utils.ts +3 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyText/index.tsx +94 -4
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/demo.stories.tsx +77 -23
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/index.tsx +48 -37
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/mock.ts +78 -20
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyDetails/styles.ts +16 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyForm/index.tsx +28 -5
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyPage/localizations.json +4 -2
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +95 -26
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/template/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +87 -6
- package/tests/assets/sdk-r/components/createAll/custom-constellation/widget/Pega_DXIL_MyPageWidget/index.tsx +67 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/mock.ts +8 -8
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +44 -34
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/mock.ts +7 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +2 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/mock.ts +6 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +48 -32
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/config.json +64 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +91 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/index.tsx +157 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/mock.ts +4 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyIconButtonURL/styles.js +7 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +1 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +34 -19
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +23 -23
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/mock.ts +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +4 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +0 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/mock.ts +6 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +1 -7
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +4 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/mock.ts +181 -165
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/config.json +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +11 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/utils.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/OneColumn.tsx +12 -13
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/demo.stories.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/index.tsx +3 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/mock.ts +8 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +1 -6
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +4 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/mock.ts +207 -163
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +0 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/mock.ts +121 -122
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/config.json +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/mock.ts +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/config.json +43 -43
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/mock.ts +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/CaseSummaryFields/CaseSummaryFields.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +36 -26
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +33 -19
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Multiselect/Multiselect.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +33 -18
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/ScalarList/ScalarList.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/UserReference/UserReference.tsx +11 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DashboardFilter/DashboardFilter.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/DeferLoad/DeferLoad.tsx +5 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/MultiStep/MultiStep.tsx +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DataReference/DataReference.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/utils/index.ts +2 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/Details/Details.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsThreeColumn/DetailsThreeColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DetailsTwoColumn/DetailsTwoColumn.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/FieldGroupTemplate/FieldGroupTemplate.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +4 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/MultiReferenceReadOnly/MultiReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/NarrowWideDetails/NarrowWideDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/PromotedFilters/PromotedFilters.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +4 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SingleReferenceReadOnly/SingleReferenceReadOnly.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrowDetails/WideNarrowDetails.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +1 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
1
|
import dayjs from 'dayjs';
|
|
3
2
|
import relativeTime from 'dayjs/plugin/relativeTime.js';
|
|
4
3
|
import localizedFormat from 'dayjs/plugin/localizedFormat.js';
|
|
@@ -35,18 +34,9 @@ const constellationToCosmosFormatterMap = new Map([
|
|
|
35
34
|
[
|
|
36
35
|
DATE_TYPES.DATE,
|
|
37
36
|
new Map([
|
|
38
|
-
[
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
],
|
|
42
|
-
[
|
|
43
|
-
formatConstants.DateTimeShort,
|
|
44
|
-
{ format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.DATE }
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
formatConstants.DateTimeSince,
|
|
48
|
-
{ format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.RELATIVE }
|
|
49
|
-
],
|
|
37
|
+
[formatConstants.DateTimeLong, { format: COSMOS_FORMAT_CONSTANTS.LONG, variant: COSMOS_VARIANT_CONSTANTS.DATE_TIME }],
|
|
38
|
+
[formatConstants.DateTimeShort, { format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.DATE }],
|
|
39
|
+
[formatConstants.DateTimeSince, { format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.RELATIVE }],
|
|
50
40
|
[formatConstants.DateDefault, { format: COSMOS_FORMAT_CONSTANTS.LONG, variant: COSMOS_VARIANT_CONSTANTS.DATE }]
|
|
51
41
|
])
|
|
52
42
|
],
|
|
@@ -60,22 +50,10 @@ const constellationToCosmosFormatterMap = new Map([
|
|
|
60
50
|
[
|
|
61
51
|
DATE_TYPES.DATE_TIME,
|
|
62
52
|
new Map([
|
|
63
|
-
[
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
],
|
|
67
|
-
[
|
|
68
|
-
formatConstants.DateTimeShort,
|
|
69
|
-
{ format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.DATE }
|
|
70
|
-
],
|
|
71
|
-
[
|
|
72
|
-
formatConstants.DateTimeSince,
|
|
73
|
-
{ format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.RELATIVE }
|
|
74
|
-
],
|
|
75
|
-
[
|
|
76
|
-
formatConstants.DateTimeLong,
|
|
77
|
-
{ format: COSMOS_FORMAT_CONSTANTS.LONG, variant: COSMOS_VARIANT_CONSTANTS.DATE_TIME }
|
|
78
|
-
],
|
|
53
|
+
[formatConstants.DateTimeDefault, { format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.DATE_TIME }],
|
|
54
|
+
[formatConstants.DateTimeShort, { format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.DATE }],
|
|
55
|
+
[formatConstants.DateTimeSince, { format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.RELATIVE }],
|
|
56
|
+
[formatConstants.DateTimeLong, { format: COSMOS_FORMAT_CONSTANTS.LONG, variant: COSMOS_VARIANT_CONSTANTS.DATE_TIME }],
|
|
79
57
|
[formatConstants.TimeOnly, { format: COSMOS_FORMAT_CONSTANTS.SHORT, variant: COSMOS_VARIANT_CONSTANTS.TIME }]
|
|
80
58
|
])
|
|
81
59
|
]
|
|
@@ -85,13 +63,14 @@ const types = ['fromNow', 'customFormat'];
|
|
|
85
63
|
// value should be in ISO 8601 format.
|
|
86
64
|
function DateFormatter(
|
|
87
65
|
value,
|
|
88
|
-
//
|
|
89
|
-
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
68
|
+
{ type = types[1], format = 'DD/MM/YYYY', timezone, fieldType } = {}
|
|
69
|
+
) {
|
|
90
70
|
if (!value) return value;
|
|
91
71
|
switch (type) {
|
|
92
72
|
case types[1]:
|
|
93
|
-
if (timezone && !(fieldType === 'Date' || fieldType === 'Date only'))
|
|
94
|
-
return dayjs(value).tz(timezone).format(format); // Date only value should be formatted without timezone
|
|
73
|
+
if (timezone && !(fieldType === 'Date' || fieldType === 'Date only')) return dayjs(value).tz(timezone).format(format); // Date only value should be formatted without timezone
|
|
95
74
|
return dayjs(value).format(format);
|
|
96
75
|
case types[0]:
|
|
97
76
|
return dayjs(value).from(dayjs());
|
|
@@ -129,8 +108,8 @@ function DateFormatter(
|
|
|
129
108
|
export function format(value, options) {
|
|
130
109
|
if (!value) return null;
|
|
131
110
|
const { type, locale, timezone, formatter, translate } = options;
|
|
132
|
-
// eslint-disable-next-line
|
|
133
|
-
const { format, variant } = constellationToCosmosFormatterMap.get(type).get(formatter);
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
112
|
+
const { format, variant } = (constellationToCosmosFormatterMap.get(type) as any).get(formatter);
|
|
134
113
|
return formatDateTime(parseToDate(value), {
|
|
135
114
|
t: translate,
|
|
136
115
|
locale,
|
|
@@ -154,8 +133,7 @@ export default {
|
|
|
154
133
|
})
|
|
155
134
|
: value;
|
|
156
135
|
},
|
|
157
|
-
convertFromTimezone: (value, timezone) =>
|
|
158
|
-
value && timezone ? dayjs.tz(value, timezone).utc().format('YYYY-MM-DDTHH:mm:ss[Z]') : value,
|
|
136
|
+
convertFromTimezone: (value, timezone) => (value && timezone ? dayjs.tz(value, timezone).utc().format('YYYY-MM-DDTHH:mm:ss[Z]') : value),
|
|
159
137
|
Date: (value, options) => DateFormatter(value, { type: 'customFormat', ...options }),
|
|
160
138
|
'Date-Default': (value, options) => format(value, { ...options, formatter: 'Date-Default' }),
|
|
161
139
|
'Date-Time-Default': (value, options) => format(value, { ...options, formatter: 'Date-Time-Default' }),
|
|
@@ -645,12 +645,14 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
645
645
|
PCore.getDataApi()
|
|
646
646
|
.init(dataConfig, contextName)
|
|
647
647
|
.then(dataObj => {
|
|
648
|
+
// @ts-ignore
|
|
648
649
|
setDataApiObj(dataObj);
|
|
649
650
|
// To avoid calling doSearch if someone types/pastes value before the API call is made
|
|
650
651
|
if (!filterValue)
|
|
651
652
|
doSearch(
|
|
652
653
|
'',
|
|
653
654
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
655
|
+
// @ts-ignore
|
|
654
656
|
dataObj,
|
|
655
657
|
setItems as any,
|
|
656
658
|
setLoading,
|
|
@@ -677,6 +679,7 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
677
679
|
PCore.getDataApi()
|
|
678
680
|
.init(dataConfig, contextName)
|
|
679
681
|
.then(dataObj => {
|
|
682
|
+
// @ts-ignore
|
|
680
683
|
setDataApiObj(dataObj);
|
|
681
684
|
// To avoid calling doSearch if someone types/pastes value before the API call is made
|
|
682
685
|
if (!filterValue) {
|
|
@@ -692,6 +695,7 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
692
695
|
doSearch(
|
|
693
696
|
'',
|
|
694
697
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
698
|
+
// @ts-ignore
|
|
695
699
|
dataObj,
|
|
696
700
|
setItems as any,
|
|
697
701
|
setLoading,
|
|
@@ -711,6 +715,7 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
711
715
|
doSearch(
|
|
712
716
|
'',
|
|
713
717
|
getDisplayFieldsMetaData(dataConfig.columns),
|
|
718
|
+
// @ts-ignore
|
|
714
719
|
dataObj,
|
|
715
720
|
setItems as any,
|
|
716
721
|
setLoading,
|
|
@@ -770,10 +775,14 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
770
775
|
PCore.getDataApi()
|
|
771
776
|
.init(dataConfig, contextName)
|
|
772
777
|
.then(dataObj => {
|
|
778
|
+
// @ts-ignore
|
|
773
779
|
setDataApiObj(dataObj);
|
|
780
|
+
// @ts-ignore
|
|
774
781
|
buildColumnForDisplayValue(dataObj);
|
|
775
782
|
// SET matchPosition to EQUALS to return exact matching record
|
|
783
|
+
// @ts-ignore
|
|
776
784
|
dataObj.matchPosition = 'equals';
|
|
785
|
+
// @ts-ignore
|
|
777
786
|
dataObj
|
|
778
787
|
.fetchData(value)
|
|
779
788
|
.then((displayResponse: { data: Array<never> }) => {
|
|
@@ -822,11 +831,13 @@ function PegaDxilMySearchbox(props: PegaDxilMySearchboxProps) {
|
|
|
822
831
|
setSelected(searchedItem[0]);
|
|
823
832
|
setActualValue(value);
|
|
824
833
|
// RESET matchPosition
|
|
834
|
+
// @ts-ignore
|
|
825
835
|
dataObj.matchPosition = dataConfig.matchPosition;
|
|
826
836
|
})
|
|
827
837
|
.catch(() => {
|
|
828
838
|
setActualValue(value);
|
|
829
839
|
// RESET matchPosition
|
|
840
|
+
// @ts-ignore
|
|
830
841
|
dataObj.matchPosition = dataConfig.matchPosition;
|
|
831
842
|
});
|
|
832
843
|
});
|
|
@@ -181,7 +181,9 @@ export const updatePropertiesForNewRecord = (
|
|
|
181
181
|
setDataApiObj(dataObj);
|
|
182
182
|
buildColumnForDisplayValue(dataObj);
|
|
183
183
|
// SET matchPosition to EQUALS to return exact matching record
|
|
184
|
+
// @ts-ignore
|
|
184
185
|
dataObj.matchPosition = 'equals';
|
|
186
|
+
// @ts-ignore
|
|
185
187
|
dataObj
|
|
186
188
|
.fetchData(newCaseId)
|
|
187
189
|
// @ts-ignore
|
|
@@ -212,6 +214,7 @@ export const updatePropertiesForNewRecord = (
|
|
|
212
214
|
})
|
|
213
215
|
.finally(() => {
|
|
214
216
|
// RESET matchPosition
|
|
217
|
+
// @ts-ignore
|
|
215
218
|
dataObj.matchPosition = dataConfig.matchPosition;
|
|
216
219
|
});
|
|
217
220
|
});
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Input,
|
|
3
|
+
FieldValueList,
|
|
4
|
+
Text,
|
|
5
|
+
EmailDisplay,
|
|
6
|
+
PhoneDisplay,
|
|
7
|
+
URLDisplay,
|
|
8
|
+
withConfiguration
|
|
9
|
+
} from '@pega/cosmos-react-core';
|
|
2
10
|
|
|
3
11
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
12
|
|
|
@@ -7,7 +15,9 @@ import StyledPegaDxilMyTextWrapper from './styles';
|
|
|
7
15
|
// interface for props
|
|
8
16
|
interface PegaDxilMyTextProps extends PConnFieldProps {
|
|
9
17
|
// If any, enter additional props that only exist on TextInput here
|
|
10
|
-
|
|
18
|
+
isTableFormatter?: boolean;
|
|
19
|
+
formatter: string;
|
|
20
|
+
variant?: any;
|
|
11
21
|
}
|
|
12
22
|
|
|
13
23
|
// interface for StateProps object
|
|
@@ -16,23 +26,103 @@ interface StateProps {
|
|
|
16
26
|
hasSuggestions: boolean;
|
|
17
27
|
}
|
|
18
28
|
|
|
19
|
-
|
|
29
|
+
export const formatExists = (formatterVal: string) => {
|
|
30
|
+
const formatterValues = [
|
|
31
|
+
'TextInput',
|
|
32
|
+
'WorkStatus',
|
|
33
|
+
'RichText',
|
|
34
|
+
'Email',
|
|
35
|
+
'Phone',
|
|
36
|
+
'URL',
|
|
37
|
+
'Operator'
|
|
38
|
+
];
|
|
39
|
+
let isformatter = false;
|
|
40
|
+
if (formatterValues.includes(formatterVal)) {
|
|
41
|
+
isformatter = true;
|
|
42
|
+
}
|
|
43
|
+
return isformatter;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const textFormatter = (formatter: string, value: string) => {
|
|
47
|
+
let displayComponent: any = null;
|
|
48
|
+
switch (formatter) {
|
|
49
|
+
case 'TextInput': {
|
|
50
|
+
displayComponent = value;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case 'Email': {
|
|
54
|
+
displayComponent = <EmailDisplay value={value} displayText={value} variant='link' />;
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
case 'Phone': {
|
|
58
|
+
displayComponent = <PhoneDisplay value={value} variant='link' />;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
case 'URL': {
|
|
62
|
+
displayComponent = (
|
|
63
|
+
<URLDisplay target='_blank' value={value} displayText={value} variant='link' />
|
|
64
|
+
);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
// no default
|
|
68
|
+
}
|
|
69
|
+
return displayComponent;
|
|
70
|
+
};
|
|
20
71
|
|
|
21
72
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
22
73
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
23
74
|
function PegaDxilMyText(props: PegaDxilMyTextProps) {
|
|
24
|
-
const { getPConnect, value, placeholder, disabled = false, readOnly = false, required = false, label, hideLabel = false, testId } = props;
|
|
75
|
+
const { getPConnect, value, placeholder, disabled = false, displayMode, readOnly = false, required = false, label, hideLabel = false, testId, isTableFormatter = false, variant = 'inline' } = props;
|
|
25
76
|
|
|
26
77
|
const pConn = getPConnect();
|
|
27
78
|
const actions = pConn.getActionsApi();
|
|
28
79
|
const stateProps = pConn.getStateProps() as StateProps;
|
|
29
80
|
const propName: string = stateProps.value;
|
|
81
|
+
const { formatter } = props;
|
|
30
82
|
|
|
31
83
|
const handleOnChange = (event: any) => {
|
|
32
84
|
const { value: updatedValue } = event.target;
|
|
33
85
|
actions.updateFieldValue(propName, updatedValue);
|
|
34
86
|
};
|
|
35
87
|
|
|
88
|
+
if (displayMode === 'LABELS_LEFT' || displayMode === 'DISPLAY_ONLY') {
|
|
89
|
+
let displayComp = value || <span aria-hidden='true'>––</span>;
|
|
90
|
+
if (isTableFormatter && formatExists(formatter)) {
|
|
91
|
+
displayComp = textFormatter(formatter, value);
|
|
92
|
+
}
|
|
93
|
+
return displayMode === 'DISPLAY_ONLY' ? (
|
|
94
|
+
<StyledPegaDxilMyTextWrapper> {displayComp} </StyledPegaDxilMyTextWrapper>
|
|
95
|
+
) : (
|
|
96
|
+
<StyledPegaDxilMyTextWrapper>
|
|
97
|
+
<FieldValueList
|
|
98
|
+
variant={hideLabel ? 'stacked' : variant}
|
|
99
|
+
data-testid={testId}
|
|
100
|
+
fields={[{ id: '1', name: hideLabel ? '' : label, value: displayComp }]}
|
|
101
|
+
/>
|
|
102
|
+
</StyledPegaDxilMyTextWrapper>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
107
|
+
const isValDefined = typeof value !== 'undefined' && value !== '';
|
|
108
|
+
const val = isValDefined ? (
|
|
109
|
+
<Text variant='h1' as='span'>
|
|
110
|
+
{value}
|
|
111
|
+
</Text>
|
|
112
|
+
) : (
|
|
113
|
+
''
|
|
114
|
+
);
|
|
115
|
+
return (
|
|
116
|
+
<StyledPegaDxilMyTextWrapper>
|
|
117
|
+
<FieldValueList
|
|
118
|
+
variant='stacked'
|
|
119
|
+
data-testid={testId}
|
|
120
|
+
fields={[{ id: '2', name: hideLabel ? '' : label, value: val }]}
|
|
121
|
+
/>
|
|
122
|
+
</StyledPegaDxilMyTextWrapper>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
36
126
|
return (
|
|
37
127
|
<StyledPegaDxilMyTextWrapper>
|
|
38
128
|
<Input
|
|
@@ -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 PegaDxilMyDetailsAvatarProps 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: PegaDxilMyDetailsAvatarProps) {
|
|
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;
|