@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,73 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { Avatar as CosmosAvatar } from '@pega/cosmos-react-core';
|
|
4
|
+
|
|
5
|
+
function Avatar(props) {
|
|
6
|
+
const { metaObj, showStatus } = props;
|
|
7
|
+
const [imageBlobUrl, setImageBlobUrl] = useState(null);
|
|
8
|
+
let userName;
|
|
9
|
+
let userIdentifier;
|
|
10
|
+
|
|
11
|
+
// TODO Below if conditions can be removed once we have apis to get worklist/mywork info
|
|
12
|
+
// This is non CaseView case (Dashboard, MyWork etc)
|
|
13
|
+
if (!metaObj) {
|
|
14
|
+
userName = PCore.getEnvironmentInfo().getOperatorName();
|
|
15
|
+
userIdentifier = PCore.getEnvironmentInfo().getOperatorIdentifier();
|
|
16
|
+
} else {
|
|
17
|
+
userName = metaObj.name;
|
|
18
|
+
userIdentifier = metaObj.ID;
|
|
19
|
+
}
|
|
20
|
+
if (!userName && userIdentifier) {
|
|
21
|
+
userName = userIdentifier;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const imageKey = !metaObj ? PCore.getEnvironmentInfo().getOperatorImageInsKey() : metaObj.image;
|
|
26
|
+
if (imageKey) {
|
|
27
|
+
PCore.getAssetLoader()
|
|
28
|
+
.getSvcImage(imageKey)
|
|
29
|
+
.then((blob) => window.URL.createObjectURL(blob))
|
|
30
|
+
.then((imagePath) => setImageBlobUrl(imagePath));
|
|
31
|
+
}
|
|
32
|
+
}, []);
|
|
33
|
+
|
|
34
|
+
if (showStatus) {
|
|
35
|
+
const currentState = PCore.getMessagingServiceManager().getUserPresence().getUserState(userIdentifier);
|
|
36
|
+
const [userState, setUserState] = useState(currentState === 'online' ? 'active' : 'inactive');
|
|
37
|
+
|
|
38
|
+
const handleUserStateChange = ({ state }) => {
|
|
39
|
+
setUserState(state === 'online' ? 'active' : 'inactive');
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const subId = PCore.getMessagingServiceManager()
|
|
44
|
+
.getUserPresence()
|
|
45
|
+
.subscribe(userIdentifier, handleUserStateChange);
|
|
46
|
+
|
|
47
|
+
return function cleanup() {
|
|
48
|
+
PCore.getMessagingServiceManager().getUserPresence().unsubscribe(userIdentifier, subId);
|
|
49
|
+
};
|
|
50
|
+
}, []);
|
|
51
|
+
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl} status={userState} />;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Do not render when userName does not exists
|
|
55
|
+
// TODO : In CNR case, pxRequestor is not available, please remove this condition once it populates
|
|
56
|
+
if (!userName) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return <CosmosAvatar name={userName} imageSrc={imageBlobUrl} />;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
Avatar.propTypes = {
|
|
64
|
+
metaObj: PropTypes.objectOf(PropTypes.any),
|
|
65
|
+
showStatus: PropTypes.bool
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Avatar.defaultProps = {
|
|
69
|
+
metaObj: null,
|
|
70
|
+
showStatus: false
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default Avatar;
|
|
@@ -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,239 @@
|
|
|
1
|
+
import { useState, useEffect, Fragment } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Link,
|
|
4
|
+
Button,
|
|
5
|
+
Popover,
|
|
6
|
+
Flex,
|
|
7
|
+
useOuterEvent,
|
|
8
|
+
useElement,
|
|
9
|
+
Progress,
|
|
10
|
+
FormField,
|
|
11
|
+
useTheme
|
|
12
|
+
} from '@pega/cosmos-react-core';
|
|
13
|
+
import { Glimpse } from '@pega/cosmos-react-work';
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
15
|
+
|
|
16
|
+
import Avatar from './Avatar';
|
|
17
|
+
|
|
18
|
+
const Operator = (props) => {
|
|
19
|
+
const { id, name, label, testId, helperText, externalUser, metaObj } = props;
|
|
20
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
21
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
22
|
+
const [popoverTarget, setPopoverTarget] = useState(null);
|
|
23
|
+
const [popoverEl, setPopoverEl] = useElement(null);
|
|
24
|
+
const [popoverContent, setpopoverContent] = useState(null);
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
|
|
27
|
+
/* If the id has changed, we need to reset the popover */
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
setPopoverTarget(null);
|
|
30
|
+
}, [id]);
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
{{! pick new delimiteres for mustache }}
|
|
34
|
+
{{=<% %>=}}
|
|
35
|
+
|
|
36
|
+
const OperatorPreview = () => {
|
|
37
|
+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
|
|
38
|
+
const localeCategory = 'Operator';
|
|
39
|
+
setpopoverContent(
|
|
40
|
+
<Progress variant='ring' message={localizedVal('Loading operator...', localeCategory)} placement='local' />
|
|
41
|
+
);
|
|
42
|
+
if (externalUser && externalUser.classID !== 'Data-Party-Operator') {
|
|
43
|
+
const fields = [
|
|
44
|
+
{
|
|
45
|
+
id: 'pyFirstName',
|
|
46
|
+
name: localizedVal('Name', localeCategory),
|
|
47
|
+
value: externalUser.name
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: 'pyEmail1',
|
|
51
|
+
name: localizedVal('Email', localeCategory),
|
|
52
|
+
value:
|
|
53
|
+
externalUser.email !== '' ? <Link href={`mailto:${externalUser.email}`}>{externalUser.email}</Link> : ''
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'pyPhoneNumber',
|
|
57
|
+
name: localizedVal('Phone', localeCategory),
|
|
58
|
+
value: externalUser.phone !== '' ? <Link href={`tel:${externalUser.phone}`}>{externalUser.phone}</Link> : ''
|
|
59
|
+
}
|
|
60
|
+
];
|
|
61
|
+
setIsLoading(false);
|
|
62
|
+
setpopoverContent(
|
|
63
|
+
<Glimpse
|
|
64
|
+
visual={
|
|
65
|
+
<Avatar
|
|
66
|
+
metaObj={{
|
|
67
|
+
name: externalUser.name
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
70
|
+
}
|
|
71
|
+
primary={externalUser.name}
|
|
72
|
+
secondary={[externalUser.position]}
|
|
73
|
+
fields={fields}
|
|
74
|
+
/>
|
|
75
|
+
);
|
|
76
|
+
} else {
|
|
77
|
+
const { getOperatorDetails } = PCore.getUserApi();
|
|
78
|
+
getOperatorDetails(id)
|
|
79
|
+
.then((res) => {
|
|
80
|
+
if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {
|
|
81
|
+
const fields = [
|
|
82
|
+
{
|
|
83
|
+
id: 'pyOrganization',
|
|
84
|
+
name: localizedVal('Organization', localeCategory),
|
|
85
|
+
value: res.data.pyOperatorInfo.pyOrganization
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 'pyTelephone',
|
|
89
|
+
name: localizedVal('Telephone', localeCategory),
|
|
90
|
+
value:
|
|
91
|
+
res.data.pyOperatorInfo.pyTelephone !== '' ? (
|
|
92
|
+
<Link href={`tel:${res.data.pyOperatorInfo.pyTelephone}`}>
|
|
93
|
+
{res.data.pyOperatorInfo.pyTelephone}
|
|
94
|
+
</Link>
|
|
95
|
+
) : (
|
|
96
|
+
''
|
|
97
|
+
)
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'pyEmailAddress',
|
|
101
|
+
name: localizedVal('Email address', localeCategory),
|
|
102
|
+
value:
|
|
103
|
+
res.data.pyOperatorInfo.pyEmailAddress !== '' ? (
|
|
104
|
+
<Link href={`mailto:${res.data.pyOperatorInfo.pyEmailAddress}`}>
|
|
105
|
+
{res.data.pyOperatorInfo.pyEmailAddress}
|
|
106
|
+
</Link>
|
|
107
|
+
) : (
|
|
108
|
+
''
|
|
109
|
+
)
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: 'ReportToUserName',
|
|
113
|
+
name: localizedVal('Reports to', localeCategory),
|
|
114
|
+
value: res.data.pyOperatorInfo.pyReportToUserName
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
setIsLoading(false);
|
|
118
|
+
setpopoverContent(
|
|
119
|
+
<Glimpse
|
|
120
|
+
visual={
|
|
121
|
+
<Avatar
|
|
122
|
+
metaObj={{
|
|
123
|
+
image: res.data.pyOperatorInfo.pyImageInsKey || '',
|
|
124
|
+
name: res.data.pyOperatorInfo.pyUserName
|
|
125
|
+
}}
|
|
126
|
+
/>
|
|
127
|
+
}
|
|
128
|
+
primary={res.data.pyOperatorInfo.pyUserName}
|
|
129
|
+
secondary={[res.data.pyOperatorInfo.pyPosition]}
|
|
130
|
+
fields={fields}
|
|
131
|
+
/>
|
|
132
|
+
);
|
|
133
|
+
} else {
|
|
134
|
+
setIsLoading(false);
|
|
135
|
+
setpopoverContent(<Flex container={{ pad: 1 }}>{localizedVal('Operator not found', localeCategory)}</Flex>);
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
.catch(() => {
|
|
139
|
+
setIsLoading(false);
|
|
140
|
+
setpopoverContent(
|
|
141
|
+
<Flex container={{ pad: 1 }}>{localizedVal('Error loading the operator profile', localeCategory)}</Flex>
|
|
142
|
+
);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
148
|
+
|
|
149
|
+
const clickAction = (e) => {
|
|
150
|
+
setPopoverTarget(e.currentTarget);
|
|
151
|
+
setIsOpen(!isOpen);
|
|
152
|
+
if (popoverTarget === null) {
|
|
153
|
+
OperatorPreview();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
const hidePopover = () => {
|
|
158
|
+
if (isOpen) {
|
|
159
|
+
setIsOpen(false);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
useOuterEvent('mousedown', [popoverEl, popoverTarget], hidePopover); // Call the method on clicking outside these elements
|
|
163
|
+
const hideOnEscape = (e) => {
|
|
164
|
+
if (e.key === 'Escape') hidePopover(); // Call the method when Escape key is pressed
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const comp = (
|
|
168
|
+
<Fragment>
|
|
169
|
+
{metaObj ? (
|
|
170
|
+
<Button
|
|
171
|
+
variant='text'
|
|
172
|
+
aria-haspopup
|
|
173
|
+
aria-expanded={isOpen}
|
|
174
|
+
onClick={clickAction}
|
|
175
|
+
onKeyDown={hideOnEscape}
|
|
176
|
+
data-test-id={testId}
|
|
177
|
+
style={label !== null ? { width: 'max-content', height: theme.components.input.height } : undefined}
|
|
178
|
+
>
|
|
179
|
+
<Avatar metaObj={metaObj}></Avatar>
|
|
180
|
+
</Button>
|
|
181
|
+
) : (
|
|
182
|
+
<Button
|
|
183
|
+
variant='link'
|
|
184
|
+
aria-haspopup
|
|
185
|
+
aria-expanded={isOpen}
|
|
186
|
+
onClick={clickAction}
|
|
187
|
+
onKeyDown={hideOnEscape}
|
|
188
|
+
data-test-id={testId}
|
|
189
|
+
style={label !== null ? { width: 'max-content', height: theme.components.input.height } : undefined}
|
|
190
|
+
>
|
|
191
|
+
{name}
|
|
192
|
+
</Button>
|
|
193
|
+
)}
|
|
194
|
+
|
|
195
|
+
{isOpen && (
|
|
196
|
+
<Popover
|
|
197
|
+
ref={setPopoverEl}
|
|
198
|
+
groupId='operator'
|
|
199
|
+
target={popoverTarget}
|
|
200
|
+
placement='bottom-start'
|
|
201
|
+
style={isLoading ? { position: 'relative', width: '10rem', minHeight: '4rem' } : undefined}
|
|
202
|
+
strategy='fixed'
|
|
203
|
+
>
|
|
204
|
+
{popoverContent}
|
|
205
|
+
</Popover>
|
|
206
|
+
)}
|
|
207
|
+
</Fragment>
|
|
208
|
+
);
|
|
209
|
+
|
|
210
|
+
if (label !== null) {
|
|
211
|
+
return (
|
|
212
|
+
<FormField label={label} info={helperText}>
|
|
213
|
+
{comp}
|
|
214
|
+
</FormField>
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return comp;
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
Operator.propTypes = {
|
|
222
|
+
name: PropTypes.string,
|
|
223
|
+
id: PropTypes.string,
|
|
224
|
+
label: PropTypes.string,
|
|
225
|
+
testId: PropTypes.string,
|
|
226
|
+
helperText: PropTypes.string,
|
|
227
|
+
metaObj: PropTypes.object
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
Operator.defaultProps = {
|
|
231
|
+
name: '',
|
|
232
|
+
id: '',
|
|
233
|
+
label: null,
|
|
234
|
+
testId: null,
|
|
235
|
+
helperText: null,
|
|
236
|
+
metaObj: null
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
export default Operator;
|
|
@@ -0,0 +1,66 @@
|
|
|
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": "title",
|
|
16
|
+
"label": "Label value",
|
|
17
|
+
"format": "TEXT"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"format": "SELECT",
|
|
21
|
+
"label": "Usage",
|
|
22
|
+
"name": "label",
|
|
23
|
+
"defaultValue": "Create operator",
|
|
24
|
+
"localize": true,
|
|
25
|
+
"source": [
|
|
26
|
+
{
|
|
27
|
+
"key": "Create operator",
|
|
28
|
+
"value": "Create operator"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"key": "Update operator",
|
|
32
|
+
"value": "Update operator"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"key": "Resolve operator",
|
|
36
|
+
"value": "Resolve operator"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
{
|
|
42
|
+
"label": "Conditions",
|
|
43
|
+
"format": "GROUP",
|
|
44
|
+
"properties": [
|
|
45
|
+
{
|
|
46
|
+
"name": "visibility",
|
|
47
|
+
"label": "Visibility",
|
|
48
|
+
"format": "VISIBILITY"
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"defaultConfig": {
|
|
54
|
+
"label": "Create operator",
|
|
55
|
+
"title": "Create operator",
|
|
56
|
+
"createLabel": "@L Created",
|
|
57
|
+
"updateLabel": "@L Updated",
|
|
58
|
+
"createOperator": "@USER .pxCreateOperator",
|
|
59
|
+
"updateOperator": "@USER .pxUpdateOperator",
|
|
60
|
+
"createDateTime": "@P .pxCreateDateTime",
|
|
61
|
+
"updateDateTime": "@P .pxUpdateDateTime",
|
|
62
|
+
"resolveLabel": "@L Resolved",
|
|
63
|
+
"resolveOperator": "@USER .pyResolvedUserID",
|
|
64
|
+
"resolveDateTime": "@P .pyResolvedTimestamp"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Fragment, memo } from 'react';
|
|
2
|
+
import { DateTimeDisplay, Card, CardHeader, CardContent, Flex } from '@pega/cosmos-react-core';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
|
|
5
|
+
// includes in bundle
|
|
6
|
+
import Operator from './Operator';
|
|
7
|
+
|
|
8
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
// Duplicated runtime code from Constellation Design System Component
|
|
12
|
+
|
|
13
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
14
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
15
|
+
export default function {{COMPONENT_CLASS_NAME}}(props) {
|
|
16
|
+
|
|
17
|
+
const {
|
|
18
|
+
getPConnect,
|
|
19
|
+
title,
|
|
20
|
+
label,
|
|
21
|
+
createLabel,
|
|
22
|
+
updateLabel,
|
|
23
|
+
createOperator,
|
|
24
|
+
updateOperator,
|
|
25
|
+
createDateTime,
|
|
26
|
+
updateDateTime,
|
|
27
|
+
resolveLabel,
|
|
28
|
+
resolveOperator,
|
|
29
|
+
resolveDateTime,
|
|
30
|
+
hideLabel,
|
|
31
|
+
defVal
|
|
32
|
+
} = props;
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const [_label, user, dateTimeValue] =
|
|
36
|
+
label === 'Create operator'
|
|
37
|
+
? [createLabel, createOperator, createDateTime]
|
|
38
|
+
: label === 'Update operator'
|
|
39
|
+
? [updateLabel, updateOperator, updateDateTime]
|
|
40
|
+
: [resolveLabel, resolveOperator, resolveDateTime];
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
return user.userId && user.userName ? (
|
|
45
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
46
|
+
<Card>
|
|
47
|
+
<CardHeader>{title}</CardHeader>
|
|
48
|
+
<CardContent>
|
|
49
|
+
{{! pick new delimiteres for mustache }} {{=<% %>=}}
|
|
50
|
+
<Flex container={{ direction: 'row'}}>
|
|
51
|
+
<Operator label={hideLabel ? null : _label} name={user.userName} id={user.userId} getPConnect={getPConnect} />
|
|
52
|
+
|
|
53
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
54
|
+
{dateTimeValue && (
|
|
55
|
+
<Fragment>
|
|
56
|
+
{' '}
|
|
57
|
+
<DateTimeDisplay value={dateTimeValue} variant='relative' />
|
|
58
|
+
</Fragment>
|
|
59
|
+
)}
|
|
60
|
+
</Flex>
|
|
61
|
+
</CardContent>
|
|
62
|
+
</Card>
|
|
63
|
+
|
|
64
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
65
|
+
) : (
|
|
66
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
67
|
+
defVal
|
|
68
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
76
|
+
"label": "Create operator",
|
|
77
|
+
"title": "Create operator",
|
|
78
|
+
createLabel: null,
|
|
79
|
+
updateLabel: null,
|
|
80
|
+
createOperator: null,
|
|
81
|
+
updateOperator: null,
|
|
82
|
+
createDateTime: null,
|
|
83
|
+
updateDateTime: null,
|
|
84
|
+
resolveLabel: null,
|
|
85
|
+
resolveOperator: null,
|
|
86
|
+
resolveDateTime: null,
|
|
87
|
+
hideLabel: false,
|
|
88
|
+
defVal: '––'
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
92
|
+
getPConnect: PropTypes.func.isRequired,
|
|
93
|
+
label: PropTypes.string,
|
|
94
|
+
createLabel: PropTypes.string,
|
|
95
|
+
updateLabel: PropTypes.string,
|
|
96
|
+
resolveLabel: PropTypes.string,
|
|
97
|
+
createOperator: PropTypes.objectOf(PropTypes.any),
|
|
98
|
+
updateOperator: PropTypes.objectOf(PropTypes.any),
|
|
99
|
+
resolveOperator: PropTypes.objectOf(PropTypes.any),
|
|
100
|
+
createDateTime: PropTypes.string,
|
|
101
|
+
updateDateTime: PropTypes.string,
|
|
102
|
+
resolveDateTime: PropTypes.string,
|
|
103
|
+
hideLabel: PropTypes.bool
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with
|
|
107
|
+
// same key value pairs in obj. hence using custom comparison function on when to re-render
|
|
108
|
+
//const comparisonFn = (prevProps, nextProps) => {
|
|
109
|
+
// return prevProps.updateDateTime === nextProps.updateDateTime;
|
|
110
|
+
//};
|
|
@@ -0,0 +1,73 @@
|
|
|
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-checkbox-active.svg",
|
|
13
|
+
"properties": [
|
|
14
|
+
{
|
|
15
|
+
"name": "label",
|
|
16
|
+
"label": "Field label",
|
|
17
|
+
"format": "TEXT"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "hideLabel",
|
|
21
|
+
"label": "Hide Label",
|
|
22
|
+
"format": "BOOLEAN"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "readOnly",
|
|
26
|
+
"label": "Edit mode",
|
|
27
|
+
"format": "READONLY"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"label": "Input settings",
|
|
31
|
+
"format": "GROUP",
|
|
32
|
+
"visibility": "(!readOnly = true)",
|
|
33
|
+
"properties": [
|
|
34
|
+
{
|
|
35
|
+
"name": "caption",
|
|
36
|
+
"label": "Caption",
|
|
37
|
+
"format": "TEXT"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "helperText",
|
|
41
|
+
"label": "Helper text",
|
|
42
|
+
"format": "TEXT"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"label": "Conditions",
|
|
48
|
+
"format": "GROUP",
|
|
49
|
+
"properties": [
|
|
50
|
+
{
|
|
51
|
+
"name": "required",
|
|
52
|
+
"label": "Required",
|
|
53
|
+
"format": "REQUIRED",
|
|
54
|
+
"visibility": "(!readOnly = true)"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "disabled",
|
|
58
|
+
"label": "Disabled",
|
|
59
|
+
"format": "DISABLED",
|
|
60
|
+
"visibility": "(!readOnly = true)"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"name": "visibility",
|
|
64
|
+
"label": "Visibility",
|
|
65
|
+
"format": "VISIBILITY"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"defaultConfig": {
|
|
71
|
+
"label": "@L $this.label"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { withKnobs, text, boolean } from '@storybook/addon-knobs';
|
|
3
|
+
|
|
4
|
+
import {{COMPONENT_CLASS_NAME}} from './index.jsx';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: '{{COMPONENT_CLASS_NAME}}',
|
|
8
|
+
decorators: [withKnobs],
|
|
9
|
+
component: {{COMPONENT_CLASS_NAME}}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const Base{{COMPONENT_CLASS_NAME}} = () => {
|
|
13
|
+
const [value, setValue] = useState('test value');
|
|
14
|
+
|
|
15
|
+
const props = {
|
|
16
|
+
getPConnect: () => {
|
|
17
|
+
return {
|
|
18
|
+
getActionsApi: () => {
|
|
19
|
+
return {
|
|
20
|
+
updateFieldValue: (propName, theValue) => {
|
|
21
|
+
setValue(theValue);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
getStateProps: () => {
|
|
26
|
+
return { value: '.name' };
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
value,
|
|
31
|
+
placeholder: text('Placeholder', 'Test placeholder'),
|
|
32
|
+
disabled: boolean('Disabled', false),
|
|
33
|
+
readOnly: boolean('Disabled', false),
|
|
34
|
+
required: boolean('Disabled', false),
|
|
35
|
+
label: text('Label', 'Sample Label'),
|
|
36
|
+
testId: text('Test id', 'text-12344566')
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
<{{COMPONENT_CLASS_NAME}} {...props} />
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
};
|