@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,147 @@
|
|
|
1
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
4
|
+
import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
// Duplicated runtime code from React SDK
|
|
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: any) {
|
|
16
|
+
const {
|
|
17
|
+
label,
|
|
18
|
+
required,
|
|
19
|
+
disabled,
|
|
20
|
+
value = '',
|
|
21
|
+
validatemessage,
|
|
22
|
+
status,
|
|
23
|
+
onChange,
|
|
24
|
+
onBlur,
|
|
25
|
+
readOnly,
|
|
26
|
+
testId,
|
|
27
|
+
helperText,
|
|
28
|
+
displayMode
|
|
29
|
+
} = props;
|
|
30
|
+
const helperTextToDisplay = validatemessage || helperText;
|
|
31
|
+
|
|
32
|
+
let testProp = {};
|
|
33
|
+
|
|
34
|
+
testProp = {
|
|
35
|
+
'data-test-id': testId
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
if(displayMode === 'LABELS_LEFT'){
|
|
39
|
+
const field = {
|
|
40
|
+
[label]: value
|
|
41
|
+
};
|
|
42
|
+
return <FieldValueList item={field}/>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (readOnly) {
|
|
46
|
+
const disableDropdown = true;
|
|
47
|
+
return (
|
|
48
|
+
<div>
|
|
49
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
50
|
+
<MuiPhoneNumber
|
|
51
|
+
fullWidth
|
|
52
|
+
helperText={helperTextToDisplay}
|
|
53
|
+
placeholder=''
|
|
54
|
+
size='small'
|
|
55
|
+
required={required}
|
|
56
|
+
disabled={disabled}
|
|
57
|
+
onChange={onChange}
|
|
58
|
+
error={status === 'error'}
|
|
59
|
+
label={label}
|
|
60
|
+
value={value}
|
|
61
|
+
{{! pick new delimiteres for mustache }}
|
|
62
|
+
{{=<% %>=}}
|
|
63
|
+
InputProps={{
|
|
64
|
+
readOnly: true
|
|
65
|
+
}}
|
|
66
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
67
|
+
disableDropdown={disableDropdown}
|
|
68
|
+
/>
|
|
69
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
70
|
+
</div>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
const handleChange = inputVal => {
|
|
76
|
+
let phoneValue = inputVal && inputVal.replace(/\D+/g, '');
|
|
77
|
+
phoneValue = `+${phoneValue}`;
|
|
78
|
+
onChange({ value: phoneValue });
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const handleBlur = event => {
|
|
82
|
+
const phoneValue = event?.target?.value;
|
|
83
|
+
event.target.value = `+${phoneValue && phoneValue.replace(/\D+/g, '')}`;
|
|
84
|
+
onBlur(event);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
90
|
+
<MuiPhoneNumber
|
|
91
|
+
fullWidth
|
|
92
|
+
variant='outlined'
|
|
93
|
+
helperText={helperTextToDisplay}
|
|
94
|
+
placeholder=''
|
|
95
|
+
size='small'
|
|
96
|
+
defaultCountry='us'
|
|
97
|
+
required={required}
|
|
98
|
+
disabled={disabled}
|
|
99
|
+
onChange={handleChange}
|
|
100
|
+
onBlur={handleBlur}
|
|
101
|
+
error={status === 'error'}
|
|
102
|
+
label={label}
|
|
103
|
+
value={value}
|
|
104
|
+
{{! pick new delimiteres for mustache }}
|
|
105
|
+
{{=<% %>=}}
|
|
106
|
+
InputProps={{ ...testProp }}
|
|
107
|
+
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
108
|
+
/>
|
|
109
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
114
|
+
value: '',
|
|
115
|
+
placeholder: '',
|
|
116
|
+
validatemessage: '',
|
|
117
|
+
helperText: '',
|
|
118
|
+
displayAsStatus: false,
|
|
119
|
+
hideLabel: false,
|
|
120
|
+
disabled: false,
|
|
121
|
+
readOnly: false,
|
|
122
|
+
required: false,
|
|
123
|
+
testId: null,
|
|
124
|
+
displayMode: null,
|
|
125
|
+
variant: 'inline',
|
|
126
|
+
formatter: '',
|
|
127
|
+
hasSuggestions: false
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
131
|
+
value: PropTypes.string,
|
|
132
|
+
placeholder: PropTypes.string,
|
|
133
|
+
displayMode: PropTypes.string,
|
|
134
|
+
displayAsStatus: PropTypes.bool,
|
|
135
|
+
label: PropTypes.string.isRequired,
|
|
136
|
+
hideLabel: PropTypes.bool,
|
|
137
|
+
getPConnect: PropTypes.func.isRequired,
|
|
138
|
+
validatemessage: PropTypes.string,
|
|
139
|
+
helperText: PropTypes.string,
|
|
140
|
+
disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
141
|
+
readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
142
|
+
required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
143
|
+
testId: PropTypes.string,
|
|
144
|
+
variant: PropTypes.string,
|
|
145
|
+
formatter: PropTypes.string,
|
|
146
|
+
hasSuggestions: PropTypes.bool
|
|
147
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
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-text-input-active.svg",
|
|
13
|
+
"properties": [
|
|
14
|
+
{
|
|
15
|
+
"name": "label",
|
|
16
|
+
"label": "Field label",
|
|
17
|
+
"format": "TEXT",
|
|
18
|
+
"required": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "readOnly",
|
|
22
|
+
"label": "Edit mode",
|
|
23
|
+
"format": "READONLY"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"label": "Column settings",
|
|
27
|
+
"format": "GROUP",
|
|
28
|
+
"visibility": "@VIEWTYPE == 'MultiRecordDisplayAsTable'",
|
|
29
|
+
"properties": [
|
|
30
|
+
{
|
|
31
|
+
"name": "columnWidth",
|
|
32
|
+
"label": "Column width",
|
|
33
|
+
"format": "SELECT",
|
|
34
|
+
"source": [
|
|
35
|
+
{
|
|
36
|
+
"key": "auto",
|
|
37
|
+
"value": "Auto"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"key": "custom",
|
|
41
|
+
"value": "Custom"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "width",
|
|
47
|
+
"label": "Width (px)",
|
|
48
|
+
"format": "NUMBER",
|
|
49
|
+
"visibility": "$this.columnWidth == 'custom'"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"label": "Input settings",
|
|
55
|
+
"format": "GROUP",
|
|
56
|
+
"visibility": "(!readOnly = true)",
|
|
57
|
+
"properties": [
|
|
58
|
+
{
|
|
59
|
+
"name": "placeholder",
|
|
60
|
+
"label": "Placeholder",
|
|
61
|
+
"format": "TEXT"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "helperText",
|
|
65
|
+
"label": "Helper text",
|
|
66
|
+
"format": "TEXT"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"label": "Conditions",
|
|
72
|
+
"format": "GROUP",
|
|
73
|
+
"properties": [
|
|
74
|
+
{
|
|
75
|
+
"name": "required",
|
|
76
|
+
"label": "Required",
|
|
77
|
+
"format": "REQUIRED",
|
|
78
|
+
"visibility": "(!readOnly = true)"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "disabled",
|
|
82
|
+
"label": "Disabled",
|
|
83
|
+
"format": "DISABLED",
|
|
84
|
+
"visibility": "(!readOnly = true)"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"name": "visibility",
|
|
88
|
+
"label": "Visibility",
|
|
89
|
+
"format": "VISIBILITY"
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"label": "Advanced",
|
|
95
|
+
"format": "GROUP",
|
|
96
|
+
"collapsible": true,
|
|
97
|
+
"properties": [
|
|
98
|
+
{
|
|
99
|
+
"name": "testId",
|
|
100
|
+
"label": "Test ID",
|
|
101
|
+
"format": "TEXT",
|
|
102
|
+
"ignorePattern": "[^-_\\p{N}\\p{L}]",
|
|
103
|
+
"includeAnnotations": false
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"defaultConfig": {
|
|
109
|
+
"label": "@L $this.label"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TextField } from '@material-ui/core';
|
|
4
|
+
import TextInput from '@pega/react-sdk-components/lib/components/forms/TextInput';
|
|
5
|
+
import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
// Duplicated runtime code from React SDK
|
|
13
|
+
|
|
14
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
15
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
16
|
+
export default function {{COMPONENT_CLASS_NAME}}(props: any) {
|
|
17
|
+
const {
|
|
18
|
+
label,
|
|
19
|
+
required,
|
|
20
|
+
disabled,
|
|
21
|
+
value = '',
|
|
22
|
+
validatemessage,
|
|
23
|
+
status,
|
|
24
|
+
onChange,
|
|
25
|
+
onBlur,
|
|
26
|
+
readOnly,
|
|
27
|
+
helperText,
|
|
28
|
+
displayMode
|
|
29
|
+
} = props;
|
|
30
|
+
const helperTextToDisplay = validatemessage || helperText;
|
|
31
|
+
|
|
32
|
+
if(displayMode === 'LABELS_LEFT'){
|
|
33
|
+
const field = {
|
|
34
|
+
[label]: value
|
|
35
|
+
};
|
|
36
|
+
return <FieldValueList item={field}/>
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (readOnly) {
|
|
40
|
+
return <TextInput {...props} />;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
45
|
+
<TextField
|
|
46
|
+
type='url'
|
|
47
|
+
fullWidth
|
|
48
|
+
variant='outlined'
|
|
49
|
+
helperText={helperTextToDisplay}
|
|
50
|
+
placeholder=''
|
|
51
|
+
size='small'
|
|
52
|
+
required={required}
|
|
53
|
+
disabled={disabled}
|
|
54
|
+
onChange={onChange}
|
|
55
|
+
onBlur={onBlur}
|
|
56
|
+
error={status === 'error'}
|
|
57
|
+
label={label}
|
|
58
|
+
value={value}
|
|
59
|
+
/>
|
|
60
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
65
|
+
value: '',
|
|
66
|
+
placeholder: '',
|
|
67
|
+
validatemessage: '',
|
|
68
|
+
helperText: '',
|
|
69
|
+
displayAsStatus: false,
|
|
70
|
+
hideLabel: false,
|
|
71
|
+
disabled: false,
|
|
72
|
+
readOnly: false,
|
|
73
|
+
required: false,
|
|
74
|
+
testId: null,
|
|
75
|
+
displayMode: null,
|
|
76
|
+
variant: 'inline',
|
|
77
|
+
formatter: '',
|
|
78
|
+
hasSuggestions: false
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
82
|
+
value: PropTypes.string,
|
|
83
|
+
placeholder: PropTypes.string,
|
|
84
|
+
displayMode: PropTypes.string,
|
|
85
|
+
displayAsStatus: PropTypes.bool,
|
|
86
|
+
label: PropTypes.string.isRequired,
|
|
87
|
+
hideLabel: PropTypes.bool,
|
|
88
|
+
getPConnect: PropTypes.func.isRequired,
|
|
89
|
+
validatemessage: PropTypes.string,
|
|
90
|
+
helperText: PropTypes.string,
|
|
91
|
+
disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
92
|
+
readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
93
|
+
required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
94
|
+
testId: PropTypes.string,
|
|
95
|
+
variant: PropTypes.string,
|
|
96
|
+
formatter: PropTypes.string,
|
|
97
|
+
hasSuggestions: PropTypes.bool
|
|
98
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
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-date-time-active.svg",
|
|
13
|
+
"properties": [
|
|
14
|
+
{
|
|
15
|
+
"name": "label",
|
|
16
|
+
"label": "Field label",
|
|
17
|
+
"format": "TEXT",
|
|
18
|
+
"required": true
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "readOnly",
|
|
22
|
+
"label": "Edit mode",
|
|
23
|
+
"format": "READONLY"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"format": "SELECT",
|
|
27
|
+
"name": "clockFormat",
|
|
28
|
+
"label": "Clock",
|
|
29
|
+
"defaultValue": "use locale",
|
|
30
|
+
"source": [
|
|
31
|
+
{
|
|
32
|
+
"key": 0,
|
|
33
|
+
"value": "use locale"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"key": 12,
|
|
37
|
+
"value": "12 hours"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"key": 24,
|
|
41
|
+
"value": "24 hours"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "withSeconds",
|
|
47
|
+
"label": "Display Seconds",
|
|
48
|
+
"format": "BOOLEAN"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"label": "Input settings",
|
|
52
|
+
"format": "GROUP",
|
|
53
|
+
"visibility": "(!readOnly = true)",
|
|
54
|
+
"properties": [
|
|
55
|
+
{
|
|
56
|
+
"format": "SELECT",
|
|
57
|
+
"name": "pickerInterval",
|
|
58
|
+
"label": "Time picker",
|
|
59
|
+
"defaultValue": "30",
|
|
60
|
+
"source": [
|
|
61
|
+
{
|
|
62
|
+
"key": "5",
|
|
63
|
+
"value": "5 min"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"key": "10",
|
|
67
|
+
"value": "10 min"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "15",
|
|
71
|
+
"value": "15 min"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"key": "20",
|
|
75
|
+
"value": "20 min"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"key": "30",
|
|
79
|
+
"value": "30 min"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"key": "60",
|
|
83
|
+
"value": "1 hr"
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "helperText",
|
|
89
|
+
"label": "Helper text",
|
|
90
|
+
"format": "TEXT"
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"label": "Conditions",
|
|
96
|
+
"format": "GROUP",
|
|
97
|
+
"properties": [
|
|
98
|
+
{
|
|
99
|
+
"name": "required",
|
|
100
|
+
"label": "Required",
|
|
101
|
+
"format": "REQUIRED",
|
|
102
|
+
"visibility": "(!readOnly = true)"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"name": "disabled",
|
|
106
|
+
"label": "Disabled",
|
|
107
|
+
"format": "DISABLED",
|
|
108
|
+
"visibility": "(!readOnly = true)"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "visibility",
|
|
112
|
+
"label": "Visibility",
|
|
113
|
+
"format": "VISIBILITY"
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"defaultConfig": {
|
|
119
|
+
"label": "@L $this.label"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import TextInput from '@pega/react-sdk-components/lib/components/forms/TextInput';
|
|
4
|
+
import { KeyboardTimePicker } from '@material-ui/pickers';
|
|
5
|
+
import dayjs from 'dayjs';
|
|
6
|
+
import AccessTimeIcon from '@material-ui/icons/AccessTime';
|
|
7
|
+
import FieldValueList from '@pega/react-sdk-components/lib/components/designSystemExtensions/FieldValueList';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
|
+
|
|
10
|
+
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// Duplicated runtime code from React SDK
|
|
14
|
+
|
|
15
|
+
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
16
|
+
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
17
|
+
export default function {{COMPONENT_CLASS_NAME}}(props: any) {
|
|
18
|
+
const {
|
|
19
|
+
label,
|
|
20
|
+
required,
|
|
21
|
+
disabled,
|
|
22
|
+
value,
|
|
23
|
+
validatemessage,
|
|
24
|
+
status,
|
|
25
|
+
onChange,
|
|
26
|
+
readOnly,
|
|
27
|
+
helperText,
|
|
28
|
+
displayMode
|
|
29
|
+
} = props;
|
|
30
|
+
const helperTextToDisplay = validatemessage || helperText;
|
|
31
|
+
|
|
32
|
+
if (displayMode === 'LABELS_LEFT') {
|
|
33
|
+
const field = {
|
|
34
|
+
[label]: value
|
|
35
|
+
};
|
|
36
|
+
return <FieldValueList item={field} />;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (readOnly) {
|
|
40
|
+
return <TextInput {...props} />;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const handleChange = date => {
|
|
44
|
+
const theValue = date && date.isValid() ? date.format('HH:mm') : null;
|
|
45
|
+
onChange({ value: theValue });
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
let timeValue: any = null;
|
|
49
|
+
if (value) {
|
|
50
|
+
const timeArray = value.split(':').map(itm => Number(itm));
|
|
51
|
+
timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//
|
|
55
|
+
// TODO: Keyboard doesn't work in the minute field, it updates one digit then jump to am/pm field
|
|
56
|
+
// try an older version of the lib or use DateTimePicker
|
|
57
|
+
//
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
61
|
+
<KeyboardTimePicker
|
|
62
|
+
variant='inline'
|
|
63
|
+
inputVariant='outlined'
|
|
64
|
+
placeholder='hh:mm am'
|
|
65
|
+
keyboardIcon={<AccessTimeIcon />}
|
|
66
|
+
fullWidth
|
|
67
|
+
required={required}
|
|
68
|
+
disabled={disabled}
|
|
69
|
+
error={status === 'error'}
|
|
70
|
+
helperText={helperTextToDisplay}
|
|
71
|
+
minutesStep={5}
|
|
72
|
+
size='small'
|
|
73
|
+
label={label}
|
|
74
|
+
autoOk
|
|
75
|
+
mask='__:__ _m'
|
|
76
|
+
format='hh:mm a'
|
|
77
|
+
value={timeValue}
|
|
78
|
+
onChange={handleChange}
|
|
79
|
+
/>
|
|
80
|
+
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
{{COMPONENT_CLASS_NAME}}.defaultProps = {
|
|
85
|
+
value: '',
|
|
86
|
+
placeholder: '',
|
|
87
|
+
validatemessage: '',
|
|
88
|
+
helperText: '',
|
|
89
|
+
displayAsStatus: false,
|
|
90
|
+
hideLabel: false,
|
|
91
|
+
disabled: false,
|
|
92
|
+
readOnly: false,
|
|
93
|
+
required: false,
|
|
94
|
+
testId: null,
|
|
95
|
+
displayMode: null,
|
|
96
|
+
variant: 'inline',
|
|
97
|
+
formatter: '',
|
|
98
|
+
isTableFormatter: false,
|
|
99
|
+
hasSuggestions: false
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
103
|
+
value: PropTypes.string,
|
|
104
|
+
placeholder: PropTypes.string,
|
|
105
|
+
displayMode: PropTypes.string,
|
|
106
|
+
displayAsStatus: PropTypes.bool,
|
|
107
|
+
label: PropTypes.string.isRequired,
|
|
108
|
+
hideLabel: PropTypes.bool,
|
|
109
|
+
getPConnect: PropTypes.func.isRequired,
|
|
110
|
+
validatemessage: PropTypes.string,
|
|
111
|
+
helperText: PropTypes.string,
|
|
112
|
+
disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
113
|
+
readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
114
|
+
required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
|
|
115
|
+
testId: PropTypes.string,
|
|
116
|
+
variant: PropTypes.string,
|
|
117
|
+
formatter: PropTypes.string,
|
|
118
|
+
isTableFormatter: PropTypes.bool,
|
|
119
|
+
hasSuggestions: PropTypes.bool
|
|
120
|
+
};
|