@pega/dx-component-builder-sdk 0.1.0
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/.access_token +1 -0
- package/.agilestudio +3 -0
- package/.eslintrc.json +18 -0
- package/.prettierignore +2 -0
- package/.prettierrc.json +1 -0
- package/LICENSE +185 -0
- package/README.md +199 -0
- package/bin/index.js +5 -0
- package/cspell.json +26 -0
- package/package.json +67 -0
- package/src/cli.js +104 -0
- package/src/constants.js +134 -0
- package/src/tasks/authenticate/helper.js +60 -0
- package/src/tasks/authenticate/index.js +81 -0
- package/src/tasks/build/helper.js +125 -0
- package/src/tasks/build/index.js +52 -0
- package/src/tasks/bundle/builder/index.js +218 -0
- package/src/tasks/bundle/builder/modules.js +139 -0
- package/src/tasks/bundle/builder/paths.js +50 -0
- package/src/tasks/bundle/builder/webpack.config.js +336 -0
- package/src/tasks/bundle/index.js +65 -0
- package/src/tasks/create/index.js +380 -0
- package/src/tasks/create/template/config.json.mustache +62 -0
- package/src/tasks/create/template/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/template/index.jsx.mustache +55 -0
- package/src/tasks/create/template/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/Boolean.js.mustache +38 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +26 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/config.json.mustache +145 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +171 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +195 -0
- package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +327 -0
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +254 -0
- package/src/tasks/create/templates/Constellation/Field/Date/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Date/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/config.json.mustache +256 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +93 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js +286 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +327 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +252 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/config.json.mustache +278 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +272 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/config.json.mustache +291 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +300 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/config.json.mustache +93 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +275 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/config.json.mustache +347 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +335 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/config.json.mustache +114 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +308 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text/config.json.mustache +62 -0
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text/index.jsx.mustache +60 -0
- package/src/tasks/create/templates/Constellation/Field/Text/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +189 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/StatusWork.js +27 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +196 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/config.json.mustache +111 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +189 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/config.json.mustache +123 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +223 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/config.json.mustache +237 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/event-utils.js.mustache +18 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +232 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/text-url.js.mustache +172 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/config.json.mustache +185 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.jsx.mustache +213 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/suggestions-handler.js +10 -0
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +286 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/OneColumnDetails.svg +22 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +35 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +88 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +155 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/TwoColumnDetails.svg +28 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/config.json.mustache +42 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +88 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +155 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +49 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +51 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.js.mustache +29 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +32 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +68 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +226 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +75 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.js.mustache +73 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.js.mustache +239 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +66 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +110 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/Field/__components.md +4 -0
- package/src/tasks/create/templates/SDK-Angular/Template/__components.md +4 -0
- package/src/tasks/create/templates/SDK-Angular/Widget/__components.md +4 -0
- package/src/tasks/create/templates/SDK-React/Field/Boolean/config.json.mustache +73 -0
- package/src/tasks/create/templates/SDK-React/Field/Boolean/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Boolean/index.tsx.mustache +109 -0
- package/src/tasks/create/templates/SDK-React/Field/Boolean/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Date/config.json.mustache +133 -0
- package/src/tasks/create/templates/SDK-React/Field/Date/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Date/index.tsx.mustache +122 -0
- package/src/tasks/create/templates/SDK-React/Field/Date/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/DateTime/config.json.mustache +190 -0
- package/src/tasks/create/templates/SDK-React/Field/DateTime/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/DateTime/index.tsx.mustache +112 -0
- package/src/tasks/create/templates/SDK-React/Field/DateTime/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal/config.json.mustache +80 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal/index.tsx.mustache +105 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/config.json.mustache +111 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/index.tsx.mustache +131 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Currency/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/config.json.mustache +80 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/index.tsx.mustache +128 -0
- package/src/tasks/create/templates/SDK-React/Field/Decimal-Percentage/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Integer/config.json.mustache +74 -0
- package/src/tasks/create/templates/SDK-React/Field/Integer/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Integer/index.tsx.mustache +124 -0
- package/src/tasks/create/templates/SDK-React/Field/Integer/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Picklist/config.json.mustache +72 -0
- package/src/tasks/create/templates/SDK-React/Field/Picklist/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Picklist/index.tsx.mustache +141 -0
- package/src/tasks/create/templates/SDK-React/Field/Picklist/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Text/config.json.mustache +69 -0
- package/src/tasks/create/templates/SDK-React/Field/Text/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Text/index.tsx.mustache +119 -0
- package/src/tasks/create/templates/SDK-React/Field/Text/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Email/config.json.mustache +69 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Email/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Email/index.tsx.mustache +121 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Email/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Input/config.json.mustache +69 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Input/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Input/index.tsx.mustache +119 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Input/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/config.json.mustache +69 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/index.tsx.mustache +123 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Paragraph/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Phone/config.json.mustache +81 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Phone/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Phone/index.tsx.mustache +147 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-Phone/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-URL/config.json.mustache +111 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-URL/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-URL/index.tsx.mustache +98 -0
- package/src/tasks/create/templates/SDK-React/Field/Text-URL/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Field/TimeofDay/config.json.mustache +121 -0
- package/src/tasks/create/templates/SDK-React/Field/TimeofDay/demo.stories.jsx.mustache +44 -0
- package/src/tasks/create/templates/SDK-React/Field/TimeofDay/index.tsx.mustache +120 -0
- package/src/tasks/create/templates/SDK-React/Field/TimeofDay/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS/config.json.mustache +21 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS/index.tsx.mustache +45 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/TwoColumnDetails.svg +28 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/index.tsx.mustache +53 -0
- package/src/tasks/create/templates/SDK-React/Template/DETAILS-region/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM/DefaultForm.css +25 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM/index.tsx.mustache +63 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM-region/config.json.mustache +49 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM-region/index.tsx.mustache +69 -0
- package/src/tasks/create/templates/SDK-React/Template/FORM-region/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Template/PAGE/OneColumn.tsx.mustache +32 -0
- package/src/tasks/create/templates/SDK-React/Template/PAGE/OneColumnPage.svg +28 -0
- package/src/tasks/create/templates/SDK-React/Template/PAGE/config.json.mustache +32 -0
- package/src/tasks/create/templates/SDK-React/Template/PAGE/index.tsx.mustache +31 -0
- package/src/tasks/create/templates/SDK-React/Template/PAGE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-React/Widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/SDK-React/Widget/CASE/index.tsx.mustache +183 -0
- package/src/tasks/create/templates/SDK-React/Widget/CASE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE/index.tsx.mustache +78 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/config.json.mustache +66 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/index.tsx.mustache +239 -0
- package/src/tasks/create/templates/SDK-React/Widget/PAGE-CASE/styles.js.mustache +7 -0
- package/src/tasks/create/templates/SDK-WebComponents/Field/__components.md +4 -0
- package/src/tasks/create/templates/SDK-WebComponents/Template/__components.md +4 -0
- package/src/tasks/create/templates/SDK-WebComponents/Widget/__components.md +4 -0
- package/src/tasks/delete/helper.js +122 -0
- package/src/tasks/delete/index.js +45 -0
- package/src/tasks/delete-all/helper.js +177 -0
- package/src/tasks/delete-all/index.js +45 -0
- package/src/tasks/index.js +11 -0
- package/src/tasks/linter/index.js +46 -0
- package/src/tasks/list/helper.js +118 -0
- package/src/tasks/list/index.js +51 -0
- package/src/tasks/map/map.js +118 -0
- package/src/tasks/publish/helper.js +147 -0
- package/src/tasks/publish/index.js +72 -0
- package/src/tasks/publish-all/helper.js +139 -0
- package/src/tasks/publish-all/index.js +84 -0
- package/src/tasks/update/index.js +5 -0
- package/src/tasks/upgrade/index.js +31 -0
- package/src/tasks/validator/index.js +216 -0
- package/src/util.js +442 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Fragment } from 'react';
|
|
2
|
+
import { Grid, Flex, FieldGroup } from '@pega/cosmos-react-core';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
|
+
|
|
7
|
+
// includes in bundle
|
|
8
|
+
import { getAllFields } from './utils';
|
|
9
|
+
|
|
10
|
+
// Duplicated runtime code from Constellation Design System Component
|
|
11
|
+
|
|
12
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
13
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
14
|
+
export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
15
|
+
|
|
16
|
+
const { getPConnect, children, label, showLabel, showHighlightedData } = props;
|
|
17
|
+
const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
|
|
18
|
+
|
|
19
|
+
const numRegions = getAllFields(getPConnect)?.length;
|
|
20
|
+
const gridRepeat = 'repeat(' + numRegions + ', 1fr)';
|
|
21
|
+
let gridContainer = {};
|
|
22
|
+
gridContainer.cols = gridRepeat;
|
|
23
|
+
gridContainer.alignItems = 'start';
|
|
24
|
+
gridContainer.colGap = 1;
|
|
25
|
+
|
|
26
|
+
let gridHighlightContainer = {};
|
|
27
|
+
gridHighlightContainer.cols = gridRepeat;
|
|
28
|
+
gridHighlightContainer.alignItems = 'start';
|
|
29
|
+
gridHighlightContainer.gap = 2;
|
|
30
|
+
gridHighlightContainer.pad = [0, 0, 2, 0];
|
|
31
|
+
|
|
32
|
+
// Set up highlighted data to pass in return if is set to show, need raw metadata to pass to createComponent
|
|
33
|
+
let highlightedDataArr = [];
|
|
34
|
+
if (showHighlightedData) {
|
|
35
|
+
const { highlightedData = [] } = getPConnect().getRawMetadata().config;
|
|
36
|
+
highlightedDataArr = highlightedData.map((field) => {
|
|
37
|
+
field.config.displayMode = 'STACKED_LARGE_VAL';
|
|
38
|
+
|
|
39
|
+
// Mark as status display when using pyStatusWork
|
|
40
|
+
if (field.config.value === '@P .pyStatusWork') {
|
|
41
|
+
field.type = 'TextInput';
|
|
42
|
+
field.config.displayAsStatus = true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return getPConnect().createComponent(field);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
51
|
+
{{! pick new delimiteres for mustache }}
|
|
52
|
+
{{=<% %>=}}
|
|
53
|
+
<FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
|
|
54
|
+
{showHighlightedData && highlightedDataArr.length > 0 && (
|
|
55
|
+
<Grid container={gridHighlightContainer}
|
|
56
|
+
data-testid={`highlighted-column-count-${numRegions}`}>
|
|
57
|
+
{highlightedDataArr.map((child, i) => (
|
|
58
|
+
<Fragment key={`hf-${i + 1}`}>{child}</Fragment>
|
|
59
|
+
))}
|
|
60
|
+
</Grid>
|
|
61
|
+
)}
|
|
62
|
+
<Grid container={gridContainer} data-testid={`column-count-${numRegions}`} >
|
|
63
|
+
{children.map((child, i) => (
|
|
64
|
+
<Flex container={{ direction: 'column'}} key={`r-${i + 1}`}>
|
|
65
|
+
{child}
|
|
66
|
+
</Flex>
|
|
67
|
+
))}
|
|
68
|
+
</Grid>
|
|
69
|
+
</FieldGroup>
|
|
70
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
71
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
77
|
+
label: undefined,
|
|
78
|
+
showLabel: true,
|
|
79
|
+
showHighlightedData: false
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
84
|
+
showLabel: PropTypes.bool,
|
|
85
|
+
label: PropTypes.string,
|
|
86
|
+
getPConnect: PropTypes.func.isRequired,
|
|
87
|
+
showHighlightedData: PropTypes.bool
|
|
88
|
+
};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { useContext, createContext } from 'react';
|
|
2
|
+
import { connect, Provider, shallowEqual } from 'react-redux';
|
|
3
|
+
import { createUID } from '@pega/cosmos-react-core';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Given the PConnect object of a Template component, retrieve the children
|
|
9
|
+
* metadata of all regions.
|
|
10
|
+
* @param {Function} pConnect PConnect of a Template component.
|
|
11
|
+
*/
|
|
12
|
+
export function getAllFields(pConnect) {
|
|
13
|
+
const metadata = pConnect().getRawMetadata();
|
|
14
|
+
if (!metadata.children) {
|
|
15
|
+
return [];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let allFields = [];
|
|
19
|
+
|
|
20
|
+
const makeField = (f) => ({
|
|
21
|
+
...pConnect().resolveConfigProps(f.config),
|
|
22
|
+
type: f.type
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const hasRegions = !!metadata.children[0]?.children;
|
|
26
|
+
if (hasRegions) {
|
|
27
|
+
allFields = metadata.children.map((region) =>
|
|
28
|
+
region.children.map((field) => {
|
|
29
|
+
// Do not resolve the config props if is status work, instead create component here as status badge and mark as status display
|
|
30
|
+
if (field.config?.value === '@P .pyStatusWork') {
|
|
31
|
+
field.type = 'TextInput';
|
|
32
|
+
field.config.displayAsStatus = true;
|
|
33
|
+
return pConnect().createComponent(field);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return makeField(field);
|
|
37
|
+
})
|
|
38
|
+
);
|
|
39
|
+
} else {
|
|
40
|
+
allFields = metadata.children.map(makeField);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return allFields;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export function getFilteredFields(getPConnect) {
|
|
49
|
+
let primaryFieldsRaw;
|
|
50
|
+
let secondaryFieldsRaw;
|
|
51
|
+
const metadata = getPConnect().getRawMetadata();
|
|
52
|
+
const hasRegions = !!metadata.children[0]?.children;
|
|
53
|
+
if (hasRegions) {
|
|
54
|
+
primaryFieldsRaw = metadata.children[0].children;
|
|
55
|
+
secondaryFieldsRaw = metadata.children[1].children;
|
|
56
|
+
} else {
|
|
57
|
+
[primaryFieldsRaw, secondaryFieldsRaw] = metadata.children;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Filter out fields that are not visible and unsupported types for primary fields (for CaseSummary)
|
|
61
|
+
primaryFieldsRaw = primaryFieldsRaw.filter((item) => {
|
|
62
|
+
const resolvedItem = getPConnect().resolveConfigProps(item.config);
|
|
63
|
+
return resolvedItem.visibility !== false && item.type !== 'TextContent';
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
secondaryFieldsRaw = secondaryFieldsRaw.filter((item) => {
|
|
67
|
+
const resolvedItem = getPConnect().resolveConfigProps(item.config);
|
|
68
|
+
return resolvedItem.visibility !== false && item.type !== 'TextContent';
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return [primaryFieldsRaw, secondaryFieldsRaw];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Returns ConfigurableLayout mapped content. With pre-populated default layout configs.
|
|
76
|
+
* @param {object[]} regionData template children item.
|
|
77
|
+
* @returns {object[]} ConfigurableLayout content.
|
|
78
|
+
*/
|
|
79
|
+
export function getLayoutDataFromRegion(regionData) {
|
|
80
|
+
const defaultLayoutConfig = {
|
|
81
|
+
width: 'full',
|
|
82
|
+
fillAvailable: true,
|
|
83
|
+
minWidth: [300, 'px']
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
return regionData.props
|
|
87
|
+
?.getPConnect()
|
|
88
|
+
?.getChildren()
|
|
89
|
+
?.map((item, index) => {
|
|
90
|
+
const itemPConnect = item?.getPConnect();
|
|
91
|
+
|
|
92
|
+
return {
|
|
93
|
+
id: itemPConnect?.getComponentName() ? `${itemPConnect.getComponentName()}--${index}` : `item--${index}`,
|
|
94
|
+
content: itemPConnect?.getComponent(),
|
|
95
|
+
layoutConfig: {
|
|
96
|
+
...defaultLayoutConfig,
|
|
97
|
+
...itemPConnect?.getConfigProps().layoutConfig
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Determine if the current view is the view of the case step/assignment.
|
|
105
|
+
* @param {Function} pConnect PConnect object for the component
|
|
106
|
+
*/
|
|
107
|
+
export function getIsAssignmentView(pConnect) {
|
|
108
|
+
// Get caseInfo content from the store which contains the view info about the current assignment/step
|
|
109
|
+
// TODO To be replaced with pConnect.getCaseInfo().getCurrentAssignmentView when it's available
|
|
110
|
+
const assignmentViewClass = pConnect.getValue(PCore.getConstants().CASE_INFO.CASE_INFO_CLASSID);
|
|
111
|
+
const assignmentViewName = pConnect.getValue(PCore.getConstants().CASE_INFO.ASSIGNMENTACTION_ID);
|
|
112
|
+
|
|
113
|
+
const assignmentViewId = `${assignmentViewName}!${assignmentViewClass}`;
|
|
114
|
+
|
|
115
|
+
// Get the info about the current view from pConnect
|
|
116
|
+
const currentViewId = `${pConnect.getCurrentView()}!${pConnect.getCurrentClassID()}`;
|
|
117
|
+
|
|
118
|
+
return assignmentViewId === currentViewId;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A hook that gets the instructions content for a view.
|
|
123
|
+
* @param {Function} pConnect PConnect object for the component
|
|
124
|
+
* @param {string} [instructions="casestep"] 'casestep', 'none', or the html content of a Rule-UI-Paragraph rule (processed via core's paragraph annotation handler)
|
|
125
|
+
*/
|
|
126
|
+
export function getInstructions(pConnect, instructions = 'casestep') {
|
|
127
|
+
const caseStepInstructions = pConnect.getValue(PCore.getConstants().CASE_INFO.INSTRUCTIONS);
|
|
128
|
+
|
|
129
|
+
// Determine if this view is the current assignment/step view
|
|
130
|
+
const isCurrentAssignmentView = getIsAssignmentView(pConnect);
|
|
131
|
+
|
|
132
|
+
// Case step instructions
|
|
133
|
+
if (instructions === 'casestep' && isCurrentAssignmentView && caseStepInstructions?.length) {
|
|
134
|
+
return caseStepInstructions;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// No instructions
|
|
138
|
+
if (instructions === 'none') {
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// If the annotation wasn't processed correctly, don't return any instruction text
|
|
143
|
+
if (instructions?.startsWith('@PARAGRAPH')) {
|
|
144
|
+
console.error('@PARAGRAPH annotation was not processed. Hiding custom instructions.');
|
|
145
|
+
return undefined;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Custom instructions from the view
|
|
149
|
+
// The raw metadata for `instructions` will be something like '@PARAGRAPH .SomeParagraphRule' but
|
|
150
|
+
// it is evaluated by core logic to the content
|
|
151
|
+
if (instructions !== 'casestep' && instructions !== 'none') {
|
|
152
|
+
return instructions;
|
|
153
|
+
}
|
|
154
|
+
return undefined;
|
|
155
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="100px" height="70px" viewBox="0 0 100 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>2 col copy</title>
|
|
4
|
+
<g id="Views" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g id="Template-icons" transform="translate(-320.000000, -925.000000)">
|
|
6
|
+
<g id="2-col--copy" transform="translate(320.000000, 925.000000)">
|
|
7
|
+
<rect id="bg" stroke="#A5A8BC" stroke-width="0.5" fill="#E7E9EB" x="0.25" y="0.25" width="99.5" height="69.5"></rect>
|
|
8
|
+
<g id="white" transform="translate(3.000000, 3.000000)" fill="#FFFFFF">
|
|
9
|
+
<rect id="Rectangle" x="0" y="0" width="94" height="66.5"></rect>
|
|
10
|
+
</g>
|
|
11
|
+
<g id="gray-copy-2" transform="translate(6.000000, 6.000000)" fill="#8084A7">
|
|
12
|
+
<rect id="Rectangle" x="0" y="-2.84217094e-14" width="42" height="11.8"></rect>
|
|
13
|
+
<rect id="Rectangle" x="46" y="-2.84217094e-14" width="42" height="11.8"></rect>
|
|
14
|
+
<rect id="Rectangle-Copy-5" x="0" y="16" width="42" height="11.8"></rect>
|
|
15
|
+
<rect id="Rectangle-Copy-3" x="46" y="16" width="42" height="11.8"></rect>
|
|
16
|
+
<rect id="Rectangle-Copy-15" x="0" y="32" width="42" height="11.8"></rect>
|
|
17
|
+
<rect id="Rectangle-Copy-14" x="46" y="32" width="42" height="11.8"></rect>
|
|
18
|
+
<rect id="Rectangle-Copy-17" x="0" y="48" width="42" height="11.8"></rect>
|
|
19
|
+
<rect id="Rectangle-Copy-16" x="46" y="48" width="42" height="11.8"></rect>
|
|
20
|
+
</g>
|
|
21
|
+
<g id="Group-7" transform="translate(28.000000, 11.000000)">
|
|
22
|
+
<path id="Line-12-Copy" d="M35.1666667,42.75 L47.1666667,48.5 L35.1666667,54.25 L35.166,49.25 L-0.25,49.25 L-0.25,47.75 L35.166,47.75 L35.1666667,42.75 Z" fill="#1E1F27" fill-rule="nonzero"></path>
|
|
23
|
+
<line x1="0.5" y1="48.5" x2="43.5" y2="32.5" id="Line" stroke="#1E1F27" stroke-width="1.5" stroke-linecap="square"></line>
|
|
24
|
+
<line x1="43.5" y1="32.5" x2="1.5" y2="32.5" id="Line-2" stroke="#1E1F27" stroke-width="1.5" stroke-linecap="square"></line>
|
|
25
|
+
</g>
|
|
26
|
+
</g>
|
|
27
|
+
</g>
|
|
28
|
+
</g>
|
|
29
|
+
</svg>
|
|
@@ -0,0 +1,45 @@
|
|
|
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": "DefaultForm.svg",
|
|
13
|
+
"properties": [
|
|
14
|
+
{
|
|
15
|
+
"format": "SELECT",
|
|
16
|
+
"name": "NumCols",
|
|
17
|
+
"label": "Number of columns",
|
|
18
|
+
"defaultValue": "1",
|
|
19
|
+
"source": [
|
|
20
|
+
{ "key": "1", "value": "One" },
|
|
21
|
+
{ "key": "2", "value": "Two" },
|
|
22
|
+
{ "key": "3", "value": "Three" }
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"format": "SELECT",
|
|
27
|
+
"name": "templateOverrideMode",
|
|
28
|
+
"label": "Template for embedded views",
|
|
29
|
+
"defaultValue": "USE_TEMPLATE",
|
|
30
|
+
"source": [
|
|
31
|
+
{ "key": "USE_TEMPLATE", "value": "Use template" },
|
|
32
|
+
{ "key": "IGNORE_TEMPLATE", "value": "Ignore template" }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"format": "INSTRUCTIONS"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "Fields",
|
|
40
|
+
"label": "Fields",
|
|
41
|
+
"format": "CONTENTPICKER",
|
|
42
|
+
"allowCreatingGroup": true
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { Grid , Flex } from '@pega/cosmos-react-core';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// Duplicated runtime code from Constellation Design System Component
|
|
9
|
+
|
|
10
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
11
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
12
|
+
export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const { getPConnect, children, template, label, NumCols } = props;
|
|
16
|
+
|
|
17
|
+
let nCols = parseInt(NumCols);
|
|
18
|
+
|
|
19
|
+
//console.log(`Rendering ${getPConnect()?.getComponentName()} with ${template} with ${children?.length} Region(s)`);
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
23
|
+
{{! pick new delimiteres for mustache }}
|
|
24
|
+
{{=<% %>=}}
|
|
25
|
+
<Grid container={{
|
|
26
|
+
cols: `repeat(${nCols}, minmax(0, 1fr))`,
|
|
27
|
+
gap: 2,
|
|
28
|
+
wrap: `wrap`
|
|
29
|
+
}}>
|
|
30
|
+
{children}
|
|
31
|
+
</Grid>
|
|
32
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
33
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
39
|
+
NumCols: 1,
|
|
40
|
+
templateOverrideMode: 'USE_TEMPLATE',
|
|
41
|
+
children: []
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
45
|
+
label: PropTypes.string,
|
|
46
|
+
getPConnect: PropTypes.func.isRequired,
|
|
47
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
48
|
+
template: PropTypes.string.isRequired
|
|
49
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="100px" height="70px" viewBox="0 0 100 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>2-col icon</title>
|
|
4
|
+
<g id="Views" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g id="Artboard-Copy-2" transform="translate(-198.000000, -207.000000)">
|
|
6
|
+
<g id="2-col--icon" transform="translate(198.000000, 207.000000)">
|
|
7
|
+
<rect id="bg" stroke="#A5A8BC" stroke-width="0.5" fill="#E7E9EB" x="0.25" y="0.25" width="99.5" height="69.5"></rect>
|
|
8
|
+
<g id="white" transform="translate(3.000000, 3.000000)" fill="#FFFFFF">
|
|
9
|
+
<rect id="Rectangle" x="0" y="0" width="94" height="66.5"></rect>
|
|
10
|
+
</g>
|
|
11
|
+
<g id="gray" transform="translate(6.000000, 6.000000)" fill="#8084A7">
|
|
12
|
+
<rect id="Rectangle" x="0" y="0" width="42" height="7.8"></rect>
|
|
13
|
+
<rect id="Rectangle-Copy-18" x="0" y="11.7" width="42" height="7.8"></rect>
|
|
14
|
+
<rect id="Rectangle-Copy-19" x="0" y="23.4" width="42" height="7.8"></rect>
|
|
15
|
+
<rect id="Rectangle-Copy-20" x="0" y="35.1" width="42" height="7.8"></rect>
|
|
16
|
+
<rect id="Rectangle-Copy-21" x="0" y="46.8" width="42" height="7.8"></rect>
|
|
17
|
+
<rect id="Rectangle-Copy-22" x="0" y="58.5" width="42" height="5"></rect>
|
|
18
|
+
<rect id="Rectangle-Copy" x="46" y="2.66453526e-15" width="42" height="7.8"></rect>
|
|
19
|
+
<rect id="Rectangle-Copy-27" x="46" y="11.7" width="42" height="7.8"></rect>
|
|
20
|
+
<rect id="Rectangle-Copy-26" x="46" y="23.4" width="42" height="7.8"></rect>
|
|
21
|
+
<rect id="Rectangle-Copy-25" x="46" y="35.1" width="42" height="7.8"></rect>
|
|
22
|
+
<rect id="Rectangle-Copy-24" x="46" y="46.8" width="42" height="7.8"></rect>
|
|
23
|
+
<rect id="Rectangle-Copy-23" x="46" y="58.5" width="42" height="5"></rect>
|
|
24
|
+
</g>
|
|
25
|
+
<g id="labels" transform="translate(16.000000, 11.000000)">
|
|
26
|
+
<circle id="Oval-Copy-3" fill="#FFFFFF" cx="10.5" cy="10.8076923" r="10.5"></circle>
|
|
27
|
+
<text id="A" font-family="OpenSans-Semibold, Open Sans" font-size="11" font-weight="500" fill="#56566F">
|
|
28
|
+
<tspan x="6.75" y="14">A</tspan>
|
|
29
|
+
</text>
|
|
30
|
+
<circle id="Oval-Copy-4" fill="#FFFFFF" cx="56.5" cy="10.8076923" r="10.5"></circle>
|
|
31
|
+
<text id="B" font-family="OpenSans-Semibold, Open Sans" font-size="11" font-weight="500" fill="#56566F">
|
|
32
|
+
<tspan x="52.75" y="14">B</tspan>
|
|
33
|
+
</text>
|
|
34
|
+
</g>
|
|
35
|
+
</g>
|
|
36
|
+
</g>
|
|
37
|
+
</g>
|
|
38
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
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": "TwoColumn.svg",
|
|
13
|
+
"properties": [
|
|
14
|
+
{
|
|
15
|
+
"name": "A",
|
|
16
|
+
"label": "Region A",
|
|
17
|
+
"format": "CONTENTPICKER",
|
|
18
|
+
"allowCreatingGroup": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "B",
|
|
22
|
+
"label": "Region B",
|
|
23
|
+
"format": "CONTENTPICKER",
|
|
24
|
+
"allowCreatingGroup": true
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { Grid , Flex } from '@pega/cosmos-react-core';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
// Duplicated runtime code from Constellation Design System Component
|
|
9
|
+
|
|
10
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
11
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
12
|
+
export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
const { getPConnect, children, template, label } = props;
|
|
16
|
+
|
|
17
|
+
const numRegions = children?.length;
|
|
18
|
+
const gridRepeat = 'repeat(' + numRegions + ', 1fr)';
|
|
19
|
+
let gridContainer = {};
|
|
20
|
+
gridContainer.cols = gridRepeat;
|
|
21
|
+
gridContainer.alignItems = 'start';
|
|
22
|
+
gridContainer.colGap = 1;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
27
|
+
{{! pick new delimiteres for mustache }}
|
|
28
|
+
{{=<% %>=}}
|
|
29
|
+
<Grid container={gridContainer}>
|
|
30
|
+
{children.map((child, i) => (
|
|
31
|
+
<Flex container={{ direction: 'column'}} key={`r-${i + 1}`}>
|
|
32
|
+
{child}
|
|
33
|
+
</Flex>
|
|
34
|
+
))}
|
|
35
|
+
</Grid>
|
|
36
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
37
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
43
|
+
children: []
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
47
|
+
label: PropTypes.string,
|
|
48
|
+
getPConnect: PropTypes.func.isRequired,
|
|
49
|
+
children: PropTypes.arrayOf(PropTypes.node).isRequired,
|
|
50
|
+
template: PropTypes.string.isRequired
|
|
51
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Button, useToaster } from '@pega/cosmos-react-core';
|
|
2
|
+
|
|
3
|
+
export default function GetNextWork(props) {
|
|
4
|
+
const { getPConnect, variant } = props;
|
|
5
|
+
|
|
6
|
+
const toasterCtx = useToaster();
|
|
7
|
+
|
|
8
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
9
|
+
|
|
10
|
+
const getNextWork = () => {
|
|
11
|
+
getPConnect()
|
|
12
|
+
.getActionsApi()
|
|
13
|
+
.getNextWork()
|
|
14
|
+
.catch((err) => {
|
|
15
|
+
console.log(err);
|
|
16
|
+
if (err[0].status === 404) {
|
|
17
|
+
toasterCtx.push({
|
|
18
|
+
content: localizedVal('No task currently available')
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Button variant={variant} onClick={getNextWork}>
|
|
26
|
+
{getPConnect().getLocalizedValue('Get next work')}
|
|
27
|
+
</Button>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="100px" height="70px" viewBox="0 0 100 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>1 col </title>
|
|
4
|
+
<defs>
|
|
5
|
+
<rect id="path-1" x="0" y="0" width="100" height="70"></rect>
|
|
6
|
+
</defs>
|
|
7
|
+
<g id="Concepts" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
8
|
+
<g id="Templates" transform="translate(-98.000000, -108.000000)">
|
|
9
|
+
<g id="Change-template" transform="translate(42.000000, 36.000000)">
|
|
10
|
+
<g id="1-col-" transform="translate(56.000000, 72.000000)">
|
|
11
|
+
<mask id="mask-2" fill="white">
|
|
12
|
+
<use xlink:href="#path-1"></use>
|
|
13
|
+
</mask>
|
|
14
|
+
<rect stroke="#A5A8BC" stroke-width="0.5" x="0.25" y="0.25" width="99.5" height="69.5"></rect>
|
|
15
|
+
<g id="white" mask="url(#mask-2)" fill="#FFFFFF">
|
|
16
|
+
<g transform="translate(3.000000, 3.000000)" id="Rectangle">
|
|
17
|
+
<rect x="0" y="0" width="94" height="66.5"></rect>
|
|
18
|
+
</g>
|
|
19
|
+
</g>
|
|
20
|
+
<g id="gray" mask="url(#mask-2)" fill="#8084A7">
|
|
21
|
+
<g transform="translate(6.000000, 6.000000)" id="Rectangle">
|
|
22
|
+
<rect x="0" y="-2.84217094e-14" width="88" height="77.8"></rect>
|
|
23
|
+
</g>
|
|
24
|
+
</g>
|
|
25
|
+
<g id="labels" mask="url(#mask-2)" font-family="OpenSans-Semibold, Open Sans" font-size="11" font-weight="500">
|
|
26
|
+
<g transform="translate(44.000000, 17.000000)" id="A">
|
|
27
|
+
<text>
|
|
28
|
+
<tspan x="0.75" y="12" fill="#FFFFFF">A</tspan>
|
|
29
|
+
</text>
|
|
30
|
+
</g>
|
|
31
|
+
</g>
|
|
32
|
+
</g>
|
|
33
|
+
</g>
|
|
34
|
+
</g>
|
|
35
|
+
</g>
|
|
36
|
+
</svg>
|
|
@@ -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": "OneColumnPage.svg",
|
|
13
|
+
"properties": [
|
|
14
|
+
{
|
|
15
|
+
"name": "useConfigurableLayout",
|
|
16
|
+
"label": "Use inline layout for insights",
|
|
17
|
+
"format": "BOOLEAN"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "enableGetNextWork",
|
|
21
|
+
"label": "Enable Get next work",
|
|
22
|
+
"format": "BOOLEAN"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "A",
|
|
26
|
+
"label": "Region A",
|
|
27
|
+
"format": "CONTENTPICKER",
|
|
28
|
+
"addTypeList": ["Widgets", "Views", "Insights"]
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"defaultConfig": {}
|
|
32
|
+
}
|