@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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
|
|
2
2
|
|
|
3
3
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
|
+
import DetailsRender from './DetailsRender';
|
|
4
5
|
|
|
5
6
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
7
|
|
|
@@ -11,19 +12,17 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
|
11
12
|
children: any;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
// Duplicated runtime code from Constellation Design System Component
|
|
15
|
-
|
|
16
15
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
17
16
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
18
17
|
function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
const { children = [], label, showLabel, getPConnect } = props;
|
|
20
|
+
const { children = [], label, showLabel, getPConnect, readOnly, displayMode } = props;
|
|
22
21
|
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
23
22
|
|
|
24
23
|
const numRegions = children?.length;
|
|
25
24
|
const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
|
|
26
|
-
const gridContainer = {"colGap" :
|
|
25
|
+
const gridContainer = {"colGap" : 6};
|
|
27
26
|
// @ts-ignore
|
|
28
27
|
gridContainer.cols = gridRepeat;
|
|
29
28
|
// @ts-ignore
|
|
@@ -33,10 +32,33 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
33
32
|
// @ts-ignore
|
|
34
33
|
flexContainer.gap = 2;
|
|
35
34
|
|
|
35
|
+
if (readOnly && readOnly === true && displayMode && displayMode === 'DISPLAY_ONLY') {
|
|
36
|
+
return (
|
|
37
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
38
|
+
{{! pick new delimiters for mustache }}
|
|
39
|
+
{{=<% %>=}}
|
|
40
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
41
|
+
<Grid container={gridContainer} data-testid={`column-count-${numRegions}`}>
|
|
42
|
+
{children.map((child: any, i: number) => (
|
|
43
|
+
<Flex
|
|
44
|
+
// @ts-ignore
|
|
45
|
+
container={{ direction: 'column', alignItems: 'normal', colGap: 1, rowGap: 1.5 }}
|
|
46
|
+
key={`r-${i + 1}`}
|
|
47
|
+
>
|
|
48
|
+
<DetailsRender child={child} />
|
|
49
|
+
</Flex>
|
|
50
|
+
))}
|
|
51
|
+
</Grid>
|
|
52
|
+
</FieldGroup>
|
|
53
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
54
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
36
58
|
return (
|
|
37
59
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
38
|
-
|
|
39
|
-
|
|
60
|
+
{{! pick new delimiters for mustache }}
|
|
61
|
+
{{=<% %>=}}
|
|
40
62
|
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
41
63
|
<Grid container={gridContainer}>
|
|
42
64
|
{children.map((child: any, i: number) => (
|
|
@@ -47,7 +69,7 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
47
69
|
))}
|
|
48
70
|
</Grid>
|
|
49
71
|
</FieldGroup>
|
|
50
|
-
|
|
72
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
51
73
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
52
74
|
);
|
|
53
75
|
|
|
@@ -18,6 +18,7 @@ export default function GetNextWork(props: {{COMPONENT_CLASS_NAME}}WorkProps) {
|
|
|
18
18
|
const toasterCtx = useToaster();
|
|
19
19
|
|
|
20
20
|
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
21
|
+
const localeCategory = 'Case';
|
|
21
22
|
|
|
22
23
|
const getNextWork = () => {
|
|
23
24
|
|
|
@@ -30,7 +31,7 @@ export default function GetNextWork(props: {{COMPONENT_CLASS_NAME}}WorkProps) {
|
|
|
30
31
|
console.log(err);
|
|
31
32
|
if (err[0].status === 404) {
|
|
32
33
|
toasterCtx.push({
|
|
33
|
-
content: localizedVal('No task currently available')
|
|
34
|
+
content: localizedVal('No task currently available', localeCategory)
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
});
|
|
@@ -35,9 +35,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
35
35
|
|
|
36
36
|
const props = {
|
|
37
37
|
useConfigurableLayout: false,
|
|
38
|
-
enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
|
|
39
38
|
icon: pyHome1Raw.config.icon,
|
|
40
|
-
title: 'Page Template',
|
|
41
39
|
|
|
42
40
|
getPConnect: () => {
|
|
43
41
|
return {
|
|
@@ -108,4 +106,7 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
108
106
|
);
|
|
109
107
|
};
|
|
110
108
|
|
|
111
|
-
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
109
|
+
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
110
|
+
title: 'Page Template',
|
|
111
|
+
enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
|
|
112
|
+
};
|
|
@@ -49,7 +49,6 @@ window.PCore.getDataApiUtils = () => {
|
|
|
49
49
|
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
50
50
|
|
|
51
51
|
const props = {
|
|
52
|
-
label: 'Case history',
|
|
53
52
|
|
|
54
53
|
getPConnect: () => {
|
|
55
54
|
return {
|
|
@@ -83,4 +82,6 @@ return (
|
|
|
83
82
|
);
|
|
84
83
|
};
|
|
85
84
|
|
|
86
|
-
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
85
|
+
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
86
|
+
label: 'Case history',
|
|
87
|
+
};
|
|
@@ -17,25 +17,103 @@ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
|
|
|
17
17
|
export default meta;
|
|
18
18
|
type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
|
|
19
19
|
|
|
20
|
+
if (!window.PCore) {
|
|
21
|
+
window.PCore = {};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const worklistData = {
|
|
25
|
+
data: {
|
|
26
|
+
data: [
|
|
27
|
+
{
|
|
28
|
+
pxProcessName: 'Loan',
|
|
29
|
+
pxRefObjectInsName: ' A-8002',
|
|
30
|
+
pyAssignmentStatus: 'New',
|
|
31
|
+
pxTaskLabel: 'Details'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
pxProcessName: 'Loan',
|
|
35
|
+
pxRefObjectInsName: ' A-7001',
|
|
36
|
+
pyAssignmentStatus: 'Open',
|
|
37
|
+
pxTaskLabel: 'Info'
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
pxProcessName: 'Loan',
|
|
41
|
+
pxRefObjectInsName: ' A-9000',
|
|
42
|
+
pyAssignmentStatus: 'Open',
|
|
43
|
+
pxTaskLabel: 'Amount'
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
window.PCore.getDataApiUtils = () => {
|
|
50
|
+
return {
|
|
51
|
+
getData: () => {
|
|
52
|
+
return new Promise(resolve => {
|
|
53
|
+
resolve(worklistData);
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
getDataAsync: () => {
|
|
57
|
+
return new Promise(resolve => {
|
|
58
|
+
resolve(worklistData);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
20
66
|
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
21
67
|
|
|
22
68
|
const props = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
69
|
+
...configProps,
|
|
70
|
+
getPConnect: () => {
|
|
71
|
+
return {
|
|
72
|
+
getValue: value => {
|
|
73
|
+
return value;
|
|
74
|
+
},
|
|
75
|
+
getContextName: () => {
|
|
76
|
+
return 'app/primary_1';
|
|
77
|
+
},
|
|
78
|
+
getLocalizedValue: value => {
|
|
79
|
+
return value;
|
|
80
|
+
},
|
|
81
|
+
getActionsApi: () => {
|
|
82
|
+
return {
|
|
83
|
+
updateFieldValue: () => {
|
|
84
|
+
/* nothing */
|
|
85
|
+
},
|
|
86
|
+
triggerFieldChange: () => {
|
|
87
|
+
/* nothing */
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
ignoreSuggestion: () => {
|
|
92
|
+
/* nothing */
|
|
93
|
+
},
|
|
94
|
+
acceptSuggestion: () => {
|
|
95
|
+
/* nothing */
|
|
96
|
+
},
|
|
97
|
+
setInheritedProps: () => {
|
|
98
|
+
/* nothing */
|
|
99
|
+
},
|
|
100
|
+
resolveConfigProps: () => {
|
|
101
|
+
/* nothing */
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
};
|
|
30
106
|
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
107
|
+
return (
|
|
108
|
+
<>
|
|
109
|
+
<{{COMPONENT_CLASS_NAME}} {...props} {...args} />
|
|
110
|
+
</>
|
|
111
|
+
);
|
|
36
112
|
};
|
|
37
113
|
|
|
38
114
|
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
39
115
|
header: configProps.header,
|
|
40
|
-
description: configProps.description
|
|
116
|
+
description: configProps.description,
|
|
117
|
+
whatsnewlink: configProps.whatsnewlink,
|
|
118
|
+
datasource: configProps.datasource,
|
|
41
119
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { withConfiguration, Table } from '@pega/cosmos-react-core';
|
|
2
3
|
import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
|
|
3
4
|
import type { PConnFieldProps } from './PConnProps';
|
|
4
5
|
|
|
@@ -14,14 +15,17 @@ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
|
|
|
14
15
|
image: string;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
// Duplicated runtime code from Constellation Design System Component
|
|
19
|
-
|
|
20
18
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
21
19
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
22
20
|
function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
23
21
|
|
|
24
|
-
const { header, description, datasource = [], whatsnewlink, image } = props;
|
|
22
|
+
const { header, description, datasource = [], whatsnewlink, image, getPConnect } = props;
|
|
23
|
+
const [worklist, setWorklist] = useState([]);
|
|
24
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
25
|
+
const PConnect = getPConnect();
|
|
26
|
+
const dataViewName = 'D_pyMyWorkList';
|
|
27
|
+
const context = PConnect.getContextName();
|
|
28
|
+
|
|
25
29
|
let details = [];
|
|
26
30
|
// @ts-ignore
|
|
27
31
|
if (datasource && datasource.source) {
|
|
@@ -30,6 +34,56 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
30
34
|
return item.name;
|
|
31
35
|
});
|
|
32
36
|
}
|
|
37
|
+
|
|
38
|
+
// setting up columns for the work list table
|
|
39
|
+
const columns = [
|
|
40
|
+
{ renderer: 'caseType', label: PConnect.getLocalizedValue('Case type', '', '') },
|
|
41
|
+
{ renderer: 'insKey', label: PConnect.getLocalizedValue('Key', '', '') },
|
|
42
|
+
{ renderer: 'status', label: PConnect.getLocalizedValue('Status', '', '') },
|
|
43
|
+
{ renderer: 'stage', label: PConnect.getLocalizedValue('Stage', '', '') }
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
// going to get data for worklist to put into a table
|
|
47
|
+
// data comes from calling a PCore function to get
|
|
48
|
+
// get data from a data page and a PConnect function
|
|
49
|
+
// to get getContextName
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
|
|
52
|
+
PCore.getDataApiUtils()
|
|
53
|
+
.getData(dataViewName, {}, context)
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
.then((response: any) => {
|
|
56
|
+
setIsLoading(false);
|
|
57
|
+
if (response.data.data !== null) {
|
|
58
|
+
// table requires an index or will get setExtraStackFrame error
|
|
59
|
+
setWorklist(
|
|
60
|
+
response.data.data.map((entry: any, index: number) => {
|
|
61
|
+
// mapping the data into the column names
|
|
62
|
+
// MUST have an id/index or will get a setExtraStackFrame error
|
|
63
|
+
// put a key in the table
|
|
64
|
+
return {
|
|
65
|
+
caseType: entry.pxProcessName,
|
|
66
|
+
insKey: entry.pxRefObjectInsName,
|
|
67
|
+
status: entry.pyAssignmentStatus,
|
|
68
|
+
stage: entry.pxTaskLabel,
|
|
69
|
+
id: index
|
|
70
|
+
};
|
|
71
|
+
})
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
setWorklist([]);
|
|
76
|
+
setIsLoading(false);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
})
|
|
80
|
+
.catch((error: any) => {
|
|
81
|
+
setWorklist([]);
|
|
82
|
+
setIsLoading(false);
|
|
83
|
+
console.log(error);
|
|
84
|
+
});
|
|
85
|
+
}, [context]);
|
|
86
|
+
|
|
33
87
|
return (
|
|
34
88
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
35
89
|
<PegaAppAnnouncement
|
|
@@ -39,6 +93,14 @@ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
|
|
|
39
93
|
whatsNewLink={whatsnewlink}
|
|
40
94
|
image={image.replace(/ /g, '+')}
|
|
41
95
|
/>
|
|
96
|
+
<br />
|
|
97
|
+
<Table
|
|
98
|
+
title={PConnect.getLocalizedValue('Work list', '', '')}
|
|
99
|
+
columns={columns}
|
|
100
|
+
data={worklist}
|
|
101
|
+
loading={isLoading}
|
|
102
|
+
loadingMessage={PConnect.getLocalizedValue('Loading Work list', '', '')}
|
|
103
|
+
/>
|
|
42
104
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
43
105
|
);
|
|
44
106
|
|
|
@@ -41,13 +41,10 @@ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
|
41
41
|
|
|
42
42
|
const props = {
|
|
43
43
|
label: configProps.label,
|
|
44
|
-
createLabel: configProps.createLabel,
|
|
45
|
-
updateLabel: configProps.updateLabel,
|
|
46
44
|
createOperator: configProps.createOperator,
|
|
47
45
|
updateOperator: configProps.updateOperator,
|
|
48
46
|
createDateTime: configProps.createDateTime,
|
|
49
47
|
updateDateTime: configProps.updateDateTime,
|
|
50
|
-
hideLabel: configProps.hideLabel,
|
|
51
48
|
|
|
52
49
|
getPConnect: () => {
|
|
53
50
|
return {
|
|
@@ -72,4 +69,8 @@ return (
|
|
|
72
69
|
);
|
|
73
70
|
};
|
|
74
71
|
|
|
75
|
-
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
72
|
+
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
73
|
+
createLabel: configProps.createLabel,
|
|
74
|
+
updateLabel: configProps.updateLabel,
|
|
75
|
+
hideLabel: configProps.hideLabel
|
|
76
|
+
};
|
|
@@ -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,32 @@
|
|
|
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
|
+
"label": "Advanced",
|
|
16
|
+
"format": "GROUP",
|
|
17
|
+
"collapsible": true,
|
|
18
|
+
"properties": [
|
|
19
|
+
{
|
|
20
|
+
"name": "testId",
|
|
21
|
+
"label": "Test ID",
|
|
22
|
+
"format": "TEXT",
|
|
23
|
+
"ignorePattern": "[^-_\\p{N}\\p{L}]",
|
|
24
|
+
"includeAnnotations": false
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"defaultConfig": {
|
|
30
|
+
"label": "@L $this.label"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
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 countrylistData = {
|
|
23
|
+
data: [
|
|
24
|
+
{
|
|
25
|
+
Name: 'United States of America',
|
|
26
|
+
ShortName: 'USA'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
Name: 'Canada',
|
|
30
|
+
ShortName: 'CAN'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
Name: 'Mexico',
|
|
34
|
+
ShortName: 'MEX'
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
window.PCore.getDataPageUtils = () => {
|
|
40
|
+
return {
|
|
41
|
+
getData: () => {
|
|
42
|
+
return new Promise(resolve => {
|
|
43
|
+
resolve(countrylistData);
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
getDataAsync: () => {
|
|
47
|
+
return new Promise(resolve => {
|
|
48
|
+
resolve(countrylistData);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
|
|
55
|
+
|
|
56
|
+
const props = {
|
|
57
|
+
getPConnect: () => {
|
|
58
|
+
return {
|
|
59
|
+
getValue: value => {
|
|
60
|
+
return value;
|
|
61
|
+
},
|
|
62
|
+
getContextName: () => {
|
|
63
|
+
return 'app/primary_1';
|
|
64
|
+
},
|
|
65
|
+
getLocalizedValue: value => {
|
|
66
|
+
return value;
|
|
67
|
+
},
|
|
68
|
+
getActionsApi: () => {
|
|
69
|
+
return {
|
|
70
|
+
updateFieldValue: () => {
|
|
71
|
+
/* nothing */
|
|
72
|
+
},
|
|
73
|
+
triggerFieldChange: () => {
|
|
74
|
+
/* nothing */
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
ignoreSuggestion: () => {
|
|
79
|
+
/* nothing */
|
|
80
|
+
},
|
|
81
|
+
acceptSuggestion: () => {
|
|
82
|
+
/* nothing */
|
|
83
|
+
},
|
|
84
|
+
setInheritedProps: () => {
|
|
85
|
+
/* nothing */
|
|
86
|
+
},
|
|
87
|
+
resolveConfigProps: () => {
|
|
88
|
+
/* nothing */
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<>
|
|
96
|
+
<{{COMPONENT_CLASS_NAME}} {...props} {...args} />
|
|
97
|
+
</>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
Base{{COMPONENT_CLASS_NAME}}.args = {
|
|
102
|
+
|
|
103
|
+
};
|