@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
package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/PConnProps.d.ts.mustache
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {PConnect } from '@pega/pcore-pconnect-typedefs';
|
|
2
|
+
|
|
3
|
+
// PConnProps.d.ts
|
|
4
|
+
// This gives us a place to have each component (which is most DX Components) that is
|
|
5
|
+
// expected to have a getPConnect extend its props (from BaseProps)
|
|
6
|
+
// such that every component will be expected to have a getPConnect() function
|
|
7
|
+
// that returns a PConnect object. (new/better way of doing .propTypes).
|
|
8
|
+
// This PConnProps can be extended to include other props that we know are in every component
|
|
9
|
+
export interface PConnProps {
|
|
10
|
+
// getPConnect should exist for every C11n component. (add @ts-ignore in special cases where it isn't)
|
|
11
|
+
getPConnect: () => typeof PConnect;
|
|
12
|
+
|
|
13
|
+
// Allow any/all other key/value pairs in the BaseProps for now
|
|
14
|
+
// TODO: refine which other props are always expected for various component
|
|
15
|
+
// types and consider further interface "subclassing". For example, we may
|
|
16
|
+
// want to create a "BasePropsForm" that gives guidance on required, readonly, etc.
|
|
17
|
+
// and any other props that every Form component expects.
|
|
18
|
+
// For example, see the PConnFieldProps below.
|
|
19
|
+
// NOTE: if you uncomment the line below, the PConnProps type will allow
|
|
20
|
+
// otherwise undefined types to appear. This can be helpful for debugging
|
|
21
|
+
// or when adding new components whose types aren't yet known.
|
|
22
|
+
// [key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// PConnFieldProps extends PConnProps to bring in the common properties that are
|
|
27
|
+
// associated with most field components (ex: Dropdown, TextInput, etc.) in the
|
|
28
|
+
// components/field directory
|
|
29
|
+
export interface PConnFieldProps extends PConnProps {
|
|
30
|
+
label: string,
|
|
31
|
+
required: boolean,
|
|
32
|
+
disabled: boolean,
|
|
33
|
+
value: any,
|
|
34
|
+
validatemessage: string,
|
|
35
|
+
status?: string,
|
|
36
|
+
onChange?: any,
|
|
37
|
+
onBlur?: any,
|
|
38
|
+
readOnly: boolean,
|
|
39
|
+
testId: string,
|
|
40
|
+
helperText: string,
|
|
41
|
+
displayMode?: string,
|
|
42
|
+
hideLabel: boolean,
|
|
43
|
+
placeholder?: string,
|
|
44
|
+
fieldMetadata?: any,
|
|
45
|
+
additionalProps?: any
|
|
46
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{COMPONENT_KEY}}",
|
|
3
|
+
"label": "{{COMPONENT_LABEL}}",
|
|
4
|
+
"description": "{{DESCRIPTION}}",
|
|
5
|
+
"organization": "{{ORGANIZATION}}",
|
|
6
|
+
"version": "{{VERSION}}",
|
|
7
|
+
"library": "{{LIBRARY}}",
|
|
8
|
+
"allowedApplications": {{{ALLOWEDAPPS}}},
|
|
9
|
+
"componentKey": "{{COMPONENT_KEY}}",
|
|
10
|
+
"type": "{{TYPE}}",
|
|
11
|
+
"subtype": {{{SUB_TYPE}}},
|
|
12
|
+
"icon": "images/pz-url-active.svg",
|
|
13
|
+
"properties": [
|
|
14
|
+
{
|
|
15
|
+
"format": "SELECT",
|
|
16
|
+
"name": "countryCode",
|
|
17
|
+
"label": "Country code",
|
|
18
|
+
"defaultValue": "USA",
|
|
19
|
+
"source": [
|
|
20
|
+
{
|
|
21
|
+
"key": "USA",
|
|
22
|
+
"value": "United States"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"key": "CAN",
|
|
26
|
+
"value": "Canada"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"key": "AUS",
|
|
30
|
+
"value": "Australia"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"key": "JPN",
|
|
34
|
+
"value": "Japan"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"key": "IND",
|
|
38
|
+
"value": "India"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"key": "TUR",
|
|
42
|
+
"value": "Turkey"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"label": "Advanced",
|
|
48
|
+
"format": "GROUP",
|
|
49
|
+
"collapsible": true,
|
|
50
|
+
"properties": [
|
|
51
|
+
{
|
|
52
|
+
"name": "testId",
|
|
53
|
+
"label": "Test ID",
|
|
54
|
+
"format": "TEXT",
|
|
55
|
+
"ignorePattern": "[^-_\\p{N}\\p{L}]",
|
|
56
|
+
"includeAnnotations": false
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"defaultConfig": {
|
|
62
|
+
"label": "@L $this.label"
|
|
63
|
+
}
|
|
64
|
+
}
|
package/src/tasks/create/templates/Constellation/Field/Icon-Button-URL/demo.stories.tsx.mustache
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
|
|
2
|
+
/* eslint-disable react/jsx-no-useless-fragment */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
5
|
+
|
|
6
|
+
import {{COMPONENT_CLASS_NAME}} from './index';
|
|
7
|
+
import { stateProps, configProps } from './mock';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
|
|
10
|
+
title: '{{COMPONENT_CLASS_NAME}}',
|
|
11
|
+
component: {{COMPONENT_CLASS_NAME}},
|
|
12
|
+
excludeStories: /.*Data$/
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
|
|
17
|
+
|
|
18
|
+
if (!window.PCore) {
|
|
19
|
+
window.PCore = {};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const statelistData = {
|
|
23
|
+
data: [
|
|
24
|
+
{
|
|
25
|
+
pyLabel: 'Massachusetts',
|
|
26
|
+
pyStateCode: 'MA'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
pyLabel: 'Rhode Island',
|
|
30
|
+
pyStateCode: 'RI'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
pyLabel: 'Connecticut',
|
|
34
|
+
pyStateCode: 'CT'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
window.PCore.getDataPageUtils = () => {
|
|
40
|
+
return {
|
|
41
|
+
getData: () => {
|
|
42
|
+
return new Promise(resolve => {
|
|
43
|
+
resolve(statelistData);
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
getDataAsync: () => {
|
|
47
|
+
return new Promise(resolve => {
|
|
48
|
+
resolve(statelistData);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
55
|
+
|
|
56
|
+
const props = {
|
|
57
|
+
countryCode: configProps.countryCode,
|
|
58
|
+
getPConnect: () => {
|
|
59
|
+
return {
|
|
60
|
+
getValue: value => {
|
|
61
|
+
return value;
|
|
62
|
+
},
|
|
63
|
+
getContextName: () => {
|
|
64
|
+
return 'app/primary_1';
|
|
65
|
+
},
|
|
66
|
+
getLocalizedValue: value => {
|
|
67
|
+
return value;
|
|
68
|
+
},
|
|
69
|
+
getActionsApi: () => {
|
|
70
|
+
return {
|
|
71
|
+
updateFieldValue: () => {
|
|
72
|
+
/* nothing */
|
|
73
|
+
},
|
|
74
|
+
triggerFieldChange: () => {
|
|
75
|
+
/* nothing */
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
ignoreSuggestion: () => {
|
|
80
|
+
/* nothing */
|
|
81
|
+
},
|
|
82
|
+
acceptSuggestion: () => {
|
|
83
|
+
/* nothing */
|
|
84
|
+
},
|
|
85
|
+
setInheritedProps: () => {
|
|
86
|
+
/* nothing */
|
|
87
|
+
},
|
|
88
|
+
resolveConfigProps: () => {
|
|
89
|
+
/* nothing */
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<>
|
|
97
|
+
<{{COMPONENT_CLASS_NAME}} {...props} {...args} />
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
103
|
+
countryCode: configProps.countryCode
|
|
104
|
+
};
|
|
@@ -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
|
};
|
|
@@ -187,7 +187,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
187
187
|
|
|
188
188
|
switch (displayMode) {
|
|
189
189
|
case 'DISPLAY_ONLY': {
|
|
190
|
-
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> displayComp </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
190
|
+
return (<Styled{{COMPONENT_CLASS_NAME}}Wrapper> {displayComp} </Styled{{COMPONENT_CLASS_NAME}}Wrapper>);
|
|
191
191
|
}
|
|
192
192
|
case 'LABELS_LEFT': {
|
|
193
193
|
return (
|
|
@@ -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
|
};
|
|
@@ -256,7 +256,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
256
256
|
|
|
257
257
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
258
258
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
259
|
-
displayComp
|
|
259
|
+
{displayComp}
|
|
260
260
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
261
261
|
) : (
|
|
262
262
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -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,
|