@pega/custom-dx-components 23.1.13 → 24.1.11
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 +1 -1
- package/src/constants.js +4 -0
- package/src/tasks/build-all/helper.js +6 -0
- package/src/tasks/build-comp/helper.js +8 -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/DateTime/demo.stories.tsx.mustache +7 -18
- 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/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/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/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/Picklist/demo.stories.tsx.mustache +2 -6
- 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-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/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/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/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/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/init/template/.storybook/preview.js +3 -0
- package/src/tasks/init/template/package.json.mustache +6 -6
- package/src/tasks/init/template/tsconfig.build.json +3 -1
- package/src/tasks/promote-webpack/webpack.config.js +26 -0
- package/src/tasks/revert-webpack/index.js +1 -5
- package/src/tasks/validator/index.js +7 -1
- package/src/util.js +72 -33
- 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/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/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_MyDateTime/demo.stories.tsx +7 -18
- 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/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_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_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/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/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/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/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/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_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/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/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_MyDateTime/demo.stories.tsx +7 -18
- 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/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_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_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/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/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/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/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/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_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
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Icon,
|
|
4
|
+
Button,
|
|
5
|
+
withConfiguration,
|
|
6
|
+
registerIcon,
|
|
7
|
+
Table,
|
|
8
|
+
Label,
|
|
9
|
+
Link,
|
|
10
|
+
URLDisplay
|
|
11
|
+
} from '@pega/cosmos-react-core';
|
|
12
|
+
import type { PConnFieldProps } from './PConnProps';
|
|
13
|
+
|
|
14
|
+
// IMPORTANT
|
|
15
|
+
// To use Icons, need to individually import the icon file form @pega/cosmos-react-core (see path below)
|
|
16
|
+
// Icons filename is kabab case (file-name), where as the icon you import is camel case (fileName)
|
|
17
|
+
// Icons need to be registered (camel case), and then used (kabab case)
|
|
18
|
+
import * as listNumber from '@pega/cosmos-react-core/lib/components/Icon/icons/list-number.icon';
|
|
19
|
+
import * as arrowRight from '@pega/cosmos-react-core/lib/components/Icon/icons/arrow-right.icon';
|
|
20
|
+
import * as globe from '@pega/cosmos-react-core/lib/components/Icon/icons/globe.icon';
|
|
21
|
+
|
|
22
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
23
|
+
|
|
24
|
+
// interface for props
|
|
25
|
+
interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
26
|
+
// If any, enter additional props that only exist on TextInput here
|
|
27
|
+
countryCode: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const textFormatter = (value: string) => {
|
|
31
|
+
const displayComponent = (
|
|
32
|
+
<URLDisplay target='_blank' value={value} displayText={value} variant='link' />
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
return displayComponent;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// *************
|
|
39
|
+
// This component is meant to be an example of usage (Icon, Button, Link, etc.) and NOT meant to be
|
|
40
|
+
// used "as is"
|
|
41
|
+
//
|
|
42
|
+
// In this example, Icon is shown on its own and inside a Button
|
|
43
|
+
// Though an Icon can have an "onClick" event is it recommended if you want to click on it,
|
|
44
|
+
// to put it in a Button (shown below), so you can have a tooltip and hover style or put it
|
|
45
|
+
// in a Link (shown below) as a URL.
|
|
46
|
+
//
|
|
47
|
+
// For the button, the click will get a list of states for a given country and display in a
|
|
48
|
+
// table below. The table display will toggle with the click of the button icon. Example shows
|
|
49
|
+
// how to handle click, retrieve data from PCore and display it.
|
|
50
|
+
//
|
|
51
|
+
// Globe icon is an icon placed in a Link element. The Link element to use an icon internally. (NOTE: In general
|
|
52
|
+
// the Link element shows the open icon to the left of the link text, but here we are using
|
|
53
|
+
// another icon, so with "icon" specified in the Link element, the open icon doesn't show)
|
|
54
|
+
// Link elements do not handle bad urls well, so we have a simple validator to prevent the Link element
|
|
55
|
+
// from getting most bad urls.
|
|
56
|
+
//
|
|
57
|
+
// NOTE: because icons have to be imported and registered, you can NOT put the icon name
|
|
58
|
+
// inside the config.json and let the user pick it, if it is not already part of your
|
|
59
|
+
// import and registration (can't be done on the fly)
|
|
60
|
+
// **************
|
|
61
|
+
|
|
62
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
63
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
64
|
+
function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
65
|
+
const { value, displayMode, countryCode = 'USA', getPConnect, testId } = props;
|
|
66
|
+
const [statelist, setStatelist] = useState([]);
|
|
67
|
+
const [showTable, setShowTable] = useState(false);
|
|
68
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
69
|
+
const [validUrl, setValidUrl] = useState('about:blank');
|
|
70
|
+
const PConnect = getPConnect();
|
|
71
|
+
const dataViewName = 'D_pyStateList';
|
|
72
|
+
const context = PConnect.getContextName();
|
|
73
|
+
|
|
74
|
+
// IMPORTANT: need to register icons used in camel case
|
|
75
|
+
registerIcon(listNumber, arrowRight, globe);
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
// setting up columns for the work list table
|
|
79
|
+
const columns = [
|
|
80
|
+
{ renderer: 'stateName', label: PConnect.getLocalizedValue('State name', '', '') },
|
|
81
|
+
{ renderer: 'stateCode', label: PConnect.getLocalizedValue('State code', '', '') }
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
// toggle showing table and getting table data
|
|
85
|
+
function showHideTable() {
|
|
86
|
+
setShowTable(prevShowTable => !prevShowTable);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// check if url is valid (simple)
|
|
90
|
+
function validateUrl(href: string) {
|
|
91
|
+
return /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(
|
|
92
|
+
href
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Testing to see if value entered is valid url, if not can't use it.
|
|
97
|
+
// Reason for this code is that you can NOT pass to Link component
|
|
98
|
+
// a bad url, or it will error out.
|
|
99
|
+
// For example: Since the value is the property field,
|
|
100
|
+
// it could be entered from another component and thus as it is
|
|
101
|
+
// entered (typed in), it won't be valid until it is all entered.
|
|
102
|
+
// NOTE: can't have a blank value for the url as the Link element will error out
|
|
103
|
+
// in App studio preview
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (validateUrl(value)) {
|
|
106
|
+
setValidUrl(value);
|
|
107
|
+
} else {
|
|
108
|
+
setValidUrl('about:blank');
|
|
109
|
+
}
|
|
110
|
+
}, [value]);
|
|
111
|
+
|
|
112
|
+
// going to get data for worklist to put into a table
|
|
113
|
+
// data comes from calling a PCore function to get
|
|
114
|
+
// get data from a data page and a PConnect function
|
|
115
|
+
// to get getContextName
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
const params = { pyCountry: countryCode };
|
|
118
|
+
|
|
119
|
+
// only retrieve table data if table is shown
|
|
120
|
+
if (showTable) {
|
|
121
|
+
PCore.getDataPageUtils()
|
|
122
|
+
.getDataAsync(dataViewName, context, params, null, null)
|
|
123
|
+
// @ts-ignore
|
|
124
|
+
.then((response: any) => {
|
|
125
|
+
setIsLoading(false);
|
|
126
|
+
// table requires an index or will get setExtraStackFrame error
|
|
127
|
+
if (response.data !== null) {
|
|
128
|
+
setStatelist(
|
|
129
|
+
response.data.map((entry: any, index: number) => {
|
|
130
|
+
// mapping the data into the column names
|
|
131
|
+
// MUST have an id/index or will get a setExtraStackFrame error
|
|
132
|
+
// put a key in the table
|
|
133
|
+
return {
|
|
134
|
+
stateName: entry.pyLabel,
|
|
135
|
+
stateCode: entry.pyStateCode,
|
|
136
|
+
id: index
|
|
137
|
+
};
|
|
138
|
+
})
|
|
139
|
+
);
|
|
140
|
+
} else {
|
|
141
|
+
setStatelist([]);
|
|
142
|
+
setIsLoading(false);
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
.catch((error: any) => {
|
|
146
|
+
setStatelist([]);
|
|
147
|
+
setIsLoading(false);
|
|
148
|
+
console.log(error);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}, [context, countryCode, showTable]);
|
|
152
|
+
|
|
153
|
+
// when DISPLAY_ONLY, in this example we will just show the URL.
|
|
154
|
+
if (displayMode === 'DISPLAY_ONLY') {
|
|
155
|
+
const displayComp = textFormatter(validUrl);
|
|
156
|
+
return (
|
|
157
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
163
|
+
{{! pick new delimiters for mustache }}
|
|
164
|
+
{{=<% %>=}}
|
|
165
|
+
<div style={{ display: 'flex' }} data-testid={testId}>
|
|
166
|
+
<Icon
|
|
167
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
168
|
+
// icon name is kabab case
|
|
169
|
+
name='arrow-right'
|
|
170
|
+
role='img'
|
|
171
|
+
aria-label='arrow right'
|
|
172
|
+
/>
|
|
173
|
+
<Label style={{ margin: '0.1rem' }}>
|
|
174
|
+
{' '}
|
|
175
|
+
{PConnect.getLocalizedValue('State list for', '', '')}{' '}
|
|
176
|
+
{PConnect.getLocalizedValue(`${countryCode}`, '', '')}{' '}
|
|
177
|
+
</Label>
|
|
178
|
+
<Button
|
|
179
|
+
icon
|
|
180
|
+
label={PConnect.getLocalizedValue('Click to show/hide state list', '', '')}
|
|
181
|
+
variant='link'
|
|
182
|
+
compact={false}
|
|
183
|
+
onClick={showHideTable}
|
|
184
|
+
>
|
|
185
|
+
<Icon
|
|
186
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
187
|
+
// icon name is kabab case
|
|
188
|
+
name='list-number'
|
|
189
|
+
role='img'
|
|
190
|
+
aria-label='numbered list'
|
|
191
|
+
/>
|
|
192
|
+
</Button>
|
|
193
|
+
<Link href={validUrl} variant='link' label={validUrl} icon>
|
|
194
|
+
<Icon
|
|
195
|
+
style={{ height: '1.5rem', width: '1.5rem' }}
|
|
196
|
+
// icon name is kabab case
|
|
197
|
+
name='globe'
|
|
198
|
+
role='img'
|
|
199
|
+
aria-label='open link'
|
|
200
|
+
/>
|
|
201
|
+
</Link>
|
|
202
|
+
</div>
|
|
203
|
+
{showTable && (
|
|
204
|
+
<Table
|
|
205
|
+
title={PConnect.getLocalizedValue('State list', '', '')}
|
|
206
|
+
columns={columns}
|
|
207
|
+
data={statelist}
|
|
208
|
+
loading={isLoading}
|
|
209
|
+
loadingMessage={PConnect.getLocalizedValue('Loading state list', '', '')}
|
|
210
|
+
/>
|
|
211
|
+
)}
|
|
212
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
213
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
export default withConfiguration({{COMPONENT_CLASS_NAME}});
|
|
@@ -19,14 +19,8 @@ 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
|
-
showGroupSeparators: configProps.showGroupSeparators,
|
|
26
22
|
hasSuggestions: configProps.hasSuggestions,
|
|
27
|
-
testId: configProps.testId,
|
|
28
23
|
fieldMetadata,
|
|
29
|
-
validatemessage: '',
|
|
30
24
|
getPConnect: () => {
|
|
31
25
|
return {
|
|
32
26
|
getStateProps: () => {
|
|
@@ -56,6 +50,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
56
50
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
57
51
|
label: configProps.label,
|
|
58
52
|
helperText: configProps.helperText,
|
|
53
|
+
placeholder: configProps.placeholder,
|
|
59
54
|
showGroupSeparators: configProps.showGroupSeparators,
|
|
60
55
|
testId: configProps.testId,
|
|
61
56
|
readOnly: configProps.readOnly,
|
|
@@ -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
|
};
|
|
@@ -23,14 +23,8 @@ 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
|
-
helperText: configProps.helperText,
|
|
29
|
-
datasource: configProps.datasource,
|
|
30
|
-
testId: configProps.testId,
|
|
31
26
|
hasSuggestions: configProps.hasSuggestions,
|
|
32
27
|
fieldMetadata,
|
|
33
|
-
validatemessage: '',
|
|
34
28
|
getPConnect: () => {
|
|
35
29
|
return {
|
|
36
30
|
getConfigProps: () => {
|
|
@@ -84,6 +78,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
84
78
|
};
|
|
85
79
|
|
|
86
80
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
81
|
+
datasource: configProps.datasource,
|
|
87
82
|
label: configProps.label,
|
|
88
83
|
helperText: configProps.helperText,
|
|
89
84
|
placeholder: configProps.placeholder,
|
|
@@ -94,5 +89,6 @@ Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
|
94
89
|
status: configProps.status,
|
|
95
90
|
hideLabel: configProps.hideLabel,
|
|
96
91
|
displayMode: configProps.displayMode,
|
|
92
|
+
variant: configProps.variant,
|
|
97
93
|
validatemessage: configProps.validatemessage
|
|
98
94
|
};
|
|
@@ -24,19 +24,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
24
24
|
|
|
25
25
|
const props = {
|
|
26
26
|
value,
|
|
27
|
-
placeholder: configProps.placeholder,
|
|
28
|
-
label: configProps.label,
|
|
29
|
-
helperText: configProps.helperText,
|
|
30
|
-
datasource: configProps.datasource,
|
|
31
|
-
testId: configProps.testId,
|
|
32
27
|
hasSuggestions: configProps.hasSuggestions,
|
|
33
28
|
columns: [],
|
|
34
|
-
isTableFormatter: false,
|
|
35
29
|
listType: 'associated',
|
|
36
|
-
parameters: {},
|
|
37
30
|
datasourceMetadata,
|
|
38
31
|
fieldMetadata,
|
|
39
|
-
validatemessage: '',
|
|
40
32
|
getPConnect: () => {
|
|
41
33
|
return {
|
|
42
34
|
getConfigProps: () => {
|
|
@@ -93,9 +85,11 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
93
85
|
};
|
|
94
86
|
|
|
95
87
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
88
|
+
datasource: configProps.datasource,
|
|
96
89
|
label: configProps.label,
|
|
97
90
|
helperText: configProps.helperText,
|
|
98
91
|
placeholder: configProps.placeholder,
|
|
92
|
+
parameters: {},
|
|
99
93
|
isTableFormatter: false,
|
|
100
94
|
testId: configProps.testId,
|
|
101
95
|
readOnly: configProps.readOnly,
|
package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/index.tsx.mustache
CHANGED
|
@@ -645,12 +645,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
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 {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
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 {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
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 {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
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 {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
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 {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
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
|
});
|
package/src/tasks/create/templates/Constellation/Field/Picklist-Autocomplete/utils.ts.mustache
CHANGED
|
@@ -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
|
});
|
|
@@ -23,15 +23,8 @@ 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
|
-
helperText: configProps.helperText,
|
|
29
|
-
datasource: configProps.datasource,
|
|
30
|
-
inline: configProps.inline,
|
|
31
|
-
testId: configProps.testId,
|
|
32
26
|
hasSuggestions: configProps.hasSuggestions,
|
|
33
27
|
fieldMetadata,
|
|
34
|
-
validatemessage: '',
|
|
35
28
|
getPConnect: () => {
|
|
36
29
|
return {
|
|
37
30
|
getConfigProps: () => {
|
|
@@ -88,6 +81,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
88
81
|
};
|
|
89
82
|
|
|
90
83
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
84
|
+
datasource: configProps.datasource,
|
|
91
85
|
label: configProps.label,
|
|
92
86
|
helperText: configProps.helperText,
|
|
93
87
|
placeholder: configProps.placeholder,
|
|
@@ -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
|
};
|
|
@@ -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
|
};
|