@pega/custom-dx-components 23.1.12 → 24.1.10
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/README.md +1 -1
- package/package.json +1 -1
- package/src/cli.js +8 -2
- package/src/constants.js +9 -0
- package/src/tasks/build-all/helper.js +6 -0
- package/src/tasks/build-comp/helper.js +8 -0
- package/src/tasks/build-jest-assets/index.js +171 -0
- package/src/tasks/bundle/builder/webpack.config.js +15 -1
- package/src/tasks/create/index.js +3 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.tsx.mustache +3 -13
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.tsx.mustache +8 -5
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.tsx.mustache +8 -19
- package/src/tasks/create/templates/Constellation/Field/Date/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.tsx.mustache +7 -18
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.tsx.mustache +1 -7
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.tsx.mustache +2 -9
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.ts.mustache +2 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/config.json.mustache +64 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache +104 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/index.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/mock.ts.mustache +5 -0
- package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/styles.ts.mustache +8 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Field/Integer/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.tsx.mustache +2 -6
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Picklist/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/demo.stories.tsx.mustache +2 -8
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache +11 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist-RadioButtons/demo.stories.tsx.mustache +1 -7
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.tsx.mustache +0 -3
- package/src/tasks/create/templates/Constellation/Field/Text/index.tsx.mustache +94 -4
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.tsx +3 -9
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.tsx.mustache +2 -5
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.tsx.mustache +1 -5
- package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.ts.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.tsx.mustache +5 -15
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Avatar.tsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/DetailsRender.tsx.mustache +55 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/HighlightRender.tsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/Operator.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.tsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.tsx.mustache +79 -25
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.tsx.mustache +51 -40
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.ts.mustache +78 -20
- package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.ts.mustache +16 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Avatar.tsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/DetailsRender.tsx.mustache +55 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/HighlightRender.tsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/Operator.tsx.mustache +218 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.tsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.tsx.mustache +96 -27
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.tsx.mustache +42 -39
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.ts.mustache +68 -10
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.ts.mustache +15 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/DetailsRender.tsx +59 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.tsx.mustache +5 -3
- package/src/tasks/create/templates/Constellation/Template/FORM/index.tsx.mustache +31 -5
- package/src/tasks/create/templates/Constellation/Template/FORM-region/DetailsRender.tsx +59 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.tsx.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.tsx.mustache +29 -7
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.tsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.tsx.mustache +4 -3
- package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -2
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.tsx.mustache +3 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.tsx.mustache +91 -13
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.tsx.mustache +67 -5
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.tsx.mustache +5 -4
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/PConnProps.d.ts.mustache +46 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/config.json.mustache +32 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/demo.stories.tsx.mustache +103 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/index.tsx.mustache +216 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/mock.ts.mustache +5 -0
- package/src/tasks/create/templates/Launchpad/Field/Icon-Button-URL/styles.ts.mustache +8 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/PConnProps.d.ts.mustache +46 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/demo.stories.tsx.mustache +120 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/index.tsx.mustache +109 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/mock.ts.mustache +25 -0
- package/src/tasks/create/templates/Launchpad/Widget/PAGE/styles.ts.mustache +8 -0
- package/src/tasks/create-all/index.js +3 -0
- package/src/tasks/index.js +1 -0
- package/src/tasks/init/template/.storybook/preview.js +3 -0
- package/src/tasks/init/template/package.json.mustache +7 -6
- package/src/tasks/init/template/tsconfig.build.json +3 -1
- package/src/tasks/publish/helper.js +6 -0
- package/src/tasks/publish-all/helper.js +6 -0
- package/src/tasks/validator/index.js +7 -1
- package/src/util.js +18 -0
- package/tests/assets/components/create/Pega_DXIL_MyDetails.zip +0 -0
- package/tests/assets/components/create/Pega_DXIL_MyTestText/demo.stories.tsx +0 -3
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.tsx +94 -4
- package/tests/assets/components/create/_components.md +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.tsx +8 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/demo.stories.tsx +3 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/mock.ts +2 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/index.tsx +48 -37
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/mock.ts +78 -20
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/styles.ts +16 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails.zip +0 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.tsx +28 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/config.json +64 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +104 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/index.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPage/localizations.json +4 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/demo.stories.tsx +91 -13
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPageWidget/index.tsx +67 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/index.tsx +11 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MySearchbox/utils.ts +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/demo.stories.tsx +0 -3
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.tsx +94 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/mock.ts +1 -0
- package/tests/assets/components/createAll/Constellation/_components.md +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/demo.stories.tsx +3 -13
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.tsx +8 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/demo.stories.tsx +2 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/mock.ts +2 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/demo.stories.tsx +8 -19
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/demo.stories.tsx +7 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.tsx +79 -25
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/index.tsx +48 -37
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/mock.ts +78 -20
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/styles.ts +16 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails.zip +0 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.tsx +5 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.tsx +28 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/PConnProps.d.ts +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/config.json +32 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/demo.stories.tsx +103 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/index.tsx +213 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/mock.ts +5 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyIconButtonURL/styles.ts +8 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/GetNextWork.tsx +2 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/demo.stories.tsx +4 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPage/localizations.json +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/demo.stories.tsx +88 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageWidget/index.tsx +67 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/demo.stories.tsx +2 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -6
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyRadioButtons/demo.stories.tsx +1 -7
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/demo.stories.tsx +2 -8
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/index.tsx +11 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MySearchbox/utils.ts +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/demo.stories.tsx +0 -3
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.tsx +94 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/StatusWork.tsx +3 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +5 -15
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.tsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Avatar.tsx +78 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/DetailsRender.tsx +52 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/HighlightRender.tsx +46 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/Operator.tsx +215 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/StatusWork.tsx +17 -19
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +96 -27
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/index.tsx +39 -36
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/mock.ts +68 -10
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/styles.ts +15 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/DetailsRender.tsx +59 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +4 -2
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.tsx +23 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/demo.stories.tsx +1 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/mock.ts +1 -0
- package/tests/assets/components/createAll/Launchpad/_components.md +1 -0
|
@@ -23,9 +23,6 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
23
23
|
|
|
24
24
|
const props = {
|
|
25
25
|
value,
|
|
26
|
-
placeholder: configProps.placeholder,
|
|
27
|
-
label: configProps.label,
|
|
28
|
-
testId: configProps.testId,
|
|
29
26
|
hasSuggestions: configProps.hasSuggestions,
|
|
30
27
|
|
|
31
28
|
getPConnect: () => {
|
|
@@ -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 Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
|
7
15
|
// interface for props
|
|
8
16
|
interface {{COMPONENT_CLASS_NAME}}Props 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 {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
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
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
95
|
+
) : (
|
|
96
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
97
|
+
<FieldValueList
|
|
98
|
+
variant={hideLabel ? 'stacked' : variant}
|
|
99
|
+
data-testid={testId}
|
|
100
|
+
fields={[{ id: '1', name: hideLabel ? '' : label, value: displayComp }]}
|
|
101
|
+
/>
|
|
102
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
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
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
117
|
+
<FieldValueList
|
|
118
|
+
variant='stacked'
|
|
119
|
+
data-testid={testId}
|
|
120
|
+
fields={[{ id: '2', name: hideLabel ? '' : label, value: val }]}
|
|
121
|
+
/>
|
|
122
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
123
|
+
);
|
|
124
|
+
}
|
|
125
|
+
|
|
36
126
|
return (
|
|
37
127
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
38
128
|
<Input
|
|
@@ -20,13 +20,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
20
20
|
|
|
21
21
|
const props = {
|
|
22
22
|
value: configProps.value,
|
|
23
|
-
label: configProps.label,
|
|
24
|
-
placeholder: configProps.placeholder,
|
|
25
|
-
helperText: configProps.helperText,
|
|
26
|
-
testId: configProps.testId,
|
|
27
23
|
hasSuggestions: configProps.hasSuggestions,
|
|
28
24
|
fieldMetadata,
|
|
29
|
-
validatemessage: '',
|
|
30
25
|
getPConnect: () => {
|
|
31
26
|
return {
|
|
32
27
|
getStateProps: () => {
|
|
@@ -64,5 +59,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
|
64
59
|
status: configProps.status,
|
|
65
60
|
hideLabel: configProps.hideLabel,
|
|
66
61
|
displayMode: configProps.displayMode,
|
|
62
|
+
variant: configProps.variant,
|
|
67
63
|
validatemessage: configProps.validatemessage
|
|
68
64
|
};
|
|
@@ -128,7 +128,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
128
128
|
}
|
|
129
129
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
130
130
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
131
|
-
displayComp
|
|
131
|
+
{displayComp}
|
|
132
132
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
133
133
|
) : (
|
|
134
134
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Status } from '@pega/cosmos-react-core';
|
|
4
4
|
|
|
5
|
-
export default function StatusWorkRenderer({ value }
|
|
5
|
+
export default function StatusWorkRenderer({ value }: any) {
|
|
6
6
|
// need to cast variant
|
|
7
|
-
let variant
|
|
7
|
+
let variant: 'success' | 'urgent' | 'warn' | 'pending' | 'info';
|
|
8
8
|
variant = 'info';
|
|
9
9
|
|
|
10
10
|
const warnStrings = ['fail', 'cancel', 'reject', 'revoke', 'stopped', 'warn'];
|
|
@@ -22,11 +22,5 @@ export default function StatusWorkRenderer({ value } : any) {
|
|
|
22
22
|
variant = 'pending';
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<Status type='rectangle' variant={variant} >
|
|
29
|
-
{value}
|
|
30
|
-
</Status>
|
|
31
|
-
);
|
|
25
|
+
return <Status variant={variant}>{value}</Status>;
|
|
32
26
|
}
|
|
@@ -20,13 +20,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
20
20
|
|
|
21
21
|
const props = {
|
|
22
22
|
value: configProps.value,
|
|
23
|
-
placeholder: configProps.placeholder,
|
|
24
|
-
label: configProps.label,
|
|
25
|
-
helperText: configProps.helperText,
|
|
26
|
-
testId: configProps.testId,
|
|
27
23
|
hasSuggestions: configProps.hasSuggestions,
|
|
28
24
|
fieldMetadata,
|
|
29
|
-
validatemessage: '',
|
|
30
25
|
getPConnect: () => {
|
|
31
26
|
return {
|
|
32
27
|
getStateProps: () => {
|
|
@@ -64,5 +59,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
|
64
59
|
status: configProps.status,
|
|
65
60
|
hideLabel: configProps.hideLabel,
|
|
66
61
|
displayMode: configProps.displayMode,
|
|
62
|
+
variant: configProps.variant,
|
|
67
63
|
validatemessage: configProps.validatemessage
|
|
68
64
|
};
|
|
@@ -143,7 +143,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
143
143
|
displayComp = textFormatter(formatter, value);
|
|
144
144
|
}
|
|
145
145
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
146
|
-
<Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
146
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
147
147
|
) : (
|
|
148
148
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
149
149
|
<FieldValueList
|
package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.tsx.mustache
CHANGED
|
@@ -20,13 +20,8 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
20
20
|
|
|
21
21
|
const props = {
|
|
22
22
|
value: configProps.value,
|
|
23
|
-
placeholder: configProps.placeholder,
|
|
24
|
-
label: configProps.label,
|
|
25
|
-
helperText: configProps.helperText,
|
|
26
|
-
testId: configProps.testId,
|
|
27
23
|
hasSuggestions: configProps.hasSuggestions,
|
|
28
24
|
fieldMetadata,
|
|
29
|
-
validatemessage: '',
|
|
30
25
|
getPConnect: () => {
|
|
31
26
|
return {
|
|
32
27
|
getStateProps: () => {
|
|
@@ -64,5 +59,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
|
64
59
|
status: configProps.status,
|
|
65
60
|
hideLabel: configProps.hideLabel,
|
|
66
61
|
displayMode: configProps.displayMode,
|
|
62
|
+
variant: configProps.variant,
|
|
67
63
|
validatemessage: configProps.validatemessage
|
|
68
64
|
};
|
|
@@ -126,7 +126,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
126
126
|
}
|
|
127
127
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
128
128
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
129
|
-
displayComp
|
|
129
|
+
{displayComp}
|
|
130
130
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
131
131
|
) : (
|
|
132
132
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -19,12 +19,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
19
19
|
|
|
20
20
|
const props = {
|
|
21
21
|
value: configProps.value,
|
|
22
|
-
placeholder: configProps.placeholder,
|
|
23
|
-
label: configProps.label,
|
|
24
|
-
testId: configProps.testId,
|
|
25
22
|
hasSuggestions: configProps.hasSuggestions,
|
|
26
|
-
datasource: configProps.datasource,
|
|
27
|
-
validatemessage: '',
|
|
28
23
|
getPConnect: () => {
|
|
29
24
|
return {
|
|
30
25
|
getStateProps: () => {
|
|
@@ -52,6 +47,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
52
47
|
};
|
|
53
48
|
|
|
54
49
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
50
|
+
datasource: configProps.datasource,
|
|
55
51
|
label: configProps.label,
|
|
56
52
|
helperText: configProps.helperText,
|
|
57
53
|
placeholder: configProps.placeholder,
|
|
@@ -62,5 +58,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
|
62
58
|
status: configProps.status,
|
|
63
59
|
hideLabel: configProps.hideLabel,
|
|
64
60
|
displayMode: configProps.displayMode,
|
|
61
|
+
variant: configProps.variant,
|
|
65
62
|
validatemessage: configProps.validatemessage
|
|
66
63
|
};
|
|
@@ -164,7 +164,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
164
164
|
}
|
|
165
165
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
166
166
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
167
|
-
displayComp
|
|
167
|
+
{displayComp}
|
|
168
168
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
169
169
|
) : (
|
|
170
170
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -19,12 +19,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
19
19
|
|
|
20
20
|
const props = {
|
|
21
21
|
value: configProps.value,
|
|
22
|
-
placeholder: configProps.placeholder,
|
|
23
|
-
label: configProps.label,
|
|
24
|
-
helperText: configProps.helperText,
|
|
25
|
-
testId: configProps.testId,
|
|
26
22
|
hasSuggestions: configProps.hasSuggestions,
|
|
27
|
-
validatemessage: '',
|
|
28
23
|
getPConnect: () => {
|
|
29
24
|
return {
|
|
30
25
|
getStateProps: () => {
|
|
@@ -62,5 +57,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
|
62
57
|
status: configProps.status,
|
|
63
58
|
hideLabel: configProps.hideLabel,
|
|
64
59
|
displayMode: configProps.displayMode,
|
|
60
|
+
variant: configProps.variant,
|
|
65
61
|
validatemessage: configProps.validatemessage
|
|
66
62
|
};
|
|
@@ -15,6 +15,9 @@ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
|
|
|
15
15
|
|
|
16
16
|
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
17
17
|
const props = {
|
|
18
|
+
value: configProps.value,
|
|
19
|
+
additionalProps: configProps.additionalProps,
|
|
20
|
+
hasSuggestions: configProps.hasSuggestions,
|
|
18
21
|
getPConnect: () => {
|
|
19
22
|
return {
|
|
20
23
|
getActionsApi: () => {
|
|
@@ -37,21 +40,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
37
40
|
ignoreSuggestion: () => {/* nothing */},
|
|
38
41
|
clearErrorMessages: () => {/* nothing */}
|
|
39
42
|
};
|
|
40
|
-
}
|
|
41
|
-
value: configProps.value,
|
|
42
|
-
validatemessage: configProps.validatemessage,
|
|
43
|
-
label: configProps.label,
|
|
44
|
-
hideLabel: configProps.hideLabel,
|
|
45
|
-
helperText: configProps.helperText,
|
|
46
|
-
withSeconds: configProps.withSeconds,
|
|
47
|
-
testId: configProps.testId,
|
|
48
|
-
additionalProps: configProps.additionalProps,
|
|
49
|
-
displayMode: configProps.displayMode,
|
|
50
|
-
variant: configProps.variant,
|
|
51
|
-
hasSuggestions: configProps.hasSuggestions,
|
|
52
|
-
disabled: configProps.disabled,
|
|
53
|
-
readOnly: configProps.readOnly,
|
|
54
|
-
required: configProps.required
|
|
43
|
+
}
|
|
55
44
|
};
|
|
56
45
|
|
|
57
46
|
return (
|
|
@@ -72,5 +61,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
|
72
61
|
status: configProps.status,
|
|
73
62
|
hideLabel: configProps.hideLabel,
|
|
74
63
|
displayMode: configProps.displayMode,
|
|
64
|
+
variant: configProps.variant,
|
|
75
65
|
validatemessage: configProps.validatemessage
|
|
76
66
|
};
|
|
@@ -140,7 +140,7 @@ function {{COMPONENT_CLASS_NAME}} (props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
140
140
|
);
|
|
141
141
|
switch (displayMode) {
|
|
142
142
|
case 'DISPLAY_ONLY': {
|
|
143
|
-
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
143
|
+
return ( <Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
144
144
|
}
|
|
145
145
|
case 'LABELS_LEFT': {
|
|
146
146
|
return (
|
|
@@ -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 {{COMPONENT_CLASS_NAME}}AvatarProps 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: {{COMPONENT_CLASS_NAME}}AvatarProps) {
|
|
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,55 @@
|
|
|
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
|
+
{{! pick new delimiters for mustache }}
|
|
35
|
+
{{=<% %>=}}
|
|
36
|
+
displayComp = (
|
|
37
|
+
<Fragment key={key1}>
|
|
38
|
+
<FieldValueList
|
|
39
|
+
style={{ columnGap: '0'}}
|
|
40
|
+
variant={hideLabel ? 'stacked' : variant}
|
|
41
|
+
data-testid={testId}
|
|
42
|
+
fields={[{ id: '1', name: hideLabel ? '' : label, value: displayEl }]}
|
|
43
|
+
/>
|
|
44
|
+
</Fragment>
|
|
45
|
+
);
|
|
46
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
47
|
+
|
|
48
|
+
displayCompArr.push(displayComp);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return <>{displayCompArr}</>;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default DetailsRender;
|
package/src/tasks/create/templates/Constellation/Template/DETAILS/HighlightRender.tsx.mustache
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
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 = getPConnect().resolveConfigProps(field.config);
|
|
22
|
+
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
const reactField = getPConnect().createComponent(field);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
{{! pick new delimiters for mustache }}
|
|
28
|
+
{{=<% %>=}}
|
|
29
|
+
<FieldValueList
|
|
30
|
+
style={{ width: 'auto' }}
|
|
31
|
+
variant='stacked'
|
|
32
|
+
data-testid={field.testId}
|
|
33
|
+
fields={[
|
|
34
|
+
{
|
|
35
|
+
id: '2',
|
|
36
|
+
name: configProps.hideLabel ? '' : configProps.label,
|
|
37
|
+
value: (
|
|
38
|
+
<Text variant='h1' as='span'>
|
|
39
|
+
{reactField}
|
|
40
|
+
</Text>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
]}
|
|
44
|
+
/>
|
|
45
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default HighlightRender;
|