@pega/dx-component-builder-sdk 0.1.47 → 0.1.49
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/package.json +3 -2
- package/src/auth.js +726 -508
- package/src/cli.js +1 -1
- package/src/constants.js +728 -2
- package/src/tasks/authenticate/index.js +12 -2
- package/src/tasks/build/helper.js +10 -6
- package/src/tasks/build/index.js +76 -22
- package/src/tasks/build-all/helper.js +16 -11
- package/src/tasks/build-all/index.js +106 -42
- package/src/tasks/bundle/{builder → builderAngular}/paths.js +3 -2
- package/src/tasks/bundle/builderAngular/webpack.config.js +342 -0
- package/src/tasks/bundle/builderAssociated/index.js +218 -0
- package/src/tasks/bundle/builderAssociated/modules.js +139 -0
- package/src/tasks/bundle/builderAssociated/paths.js +51 -0
- package/src/tasks/bundle/{builder → builderAssociated}/webpack.config.js +5 -4
- package/src/tasks/bundle/builderReact/index.js +218 -0
- package/src/tasks/bundle/builderReact/modules.js +139 -0
- package/src/tasks/bundle/builderReact/paths.js +51 -0
- package/src/tasks/bundle/builderReact/webpack.config.js +337 -0
- package/src/tasks/bundle/index.js +122 -5
- package/src/tasks/create/index.js +54 -12
- package/src/tasks/create/templates/Constellation/field/Boolean/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Date/DateFormatter.js.mustache +7 -7
- package/src/tasks/create/templates/Constellation/field/Date/date.js.mustache +8 -8
- package/src/tasks/create/templates/Constellation/field/Date/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/DateTime/date-time.js.mustache +10 -10
- package/src/tasks/create/templates/Constellation/field/DateTime/date-utils.js.mustache +6 -5
- package/src/tasks/create/templates/Constellation/field/DateTime/date.js.mustache +6 -3
- package/src/tasks/create/templates/Constellation/field/DateTime/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Decimal/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Decimal-Currency/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/index.jsx.mustache +4 -4
- package/src/tasks/create/templates/Constellation/field/Decimal-Percentage/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Integer/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/field/Integer/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Picklist/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Email/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Input/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Paragraph/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-Phone/index.jsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/field/Text-Phone/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/Text-URL/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/field/TimeOfDay/styles.js.mustache +14 -0
- package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/time-of-day.js.mustache +6 -5
- package/src/tasks/create/templates/Constellation/template/DETAILS/demo.stories.jsx.mustache +20 -6
- package/src/tasks/create/templates/Constellation/template/DETAILS/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS/mock.stories.js.mustache +20 -10
- package/src/tasks/create/templates/Constellation/template/DETAILS/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/demo.stories.jsx.mustache +20 -7
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/mock.stories.js.mustache +28 -13
- package/src/tasks/create/templates/Constellation/template/DETAILS-region/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/FORM/demo.stories.jsx.mustache +92 -16
- package/src/tasks/create/templates/Constellation/template/FORM/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/FORM/mock.stories.js.mustache +24 -12
- package/src/tasks/create/templates/Constellation/template/FORM/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/FORM-region/demo.stories.jsx.mustache +91 -13
- package/src/tasks/create/templates/Constellation/template/FORM-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/template/FORM-region/mock.stories.js.mustache +24 -12
- package/src/tasks/create/templates/Constellation/template/FORM-region/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/template/PAGE/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/Constellation/template/PAGE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/CASE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/PAGE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/Operator.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/widget/PAGE-CASE/styles.js.mustache +13 -6
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +42 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.scss.mustache +24 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +165 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/config.json.mustache +87 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/demo.stories.jsx.mustache +56 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/mock.stories.js.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/config.json.mustache +147 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.html.mustache +35 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +209 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/config.json.mustache +204 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.ts.mustache +177 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/config.json.mustache +94 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.html.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal/decimal.component.ts.mustache +170 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/config.json.mustache +125 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Currency/decimal-currency.component.ts.mustache +175 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/config.json.mustache +94 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Decimal-Percentage/decimal-percentage.component.ts.mustache +176 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/config.json.mustache +88 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.html.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Integer/integer.component.ts.mustache +180 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/config.json.mustache +86 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.scss.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Picklist/picklist.component.ts.mustache +195 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.html.mustache +17 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.scss.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text/text.component.ts.mustache +145 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Email/text-email.component.ts.mustache +175 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Input/text.component.ts.mustache +177 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/config.json.mustache +83 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.html.mustache +31 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Paragraph/text-paragraph.component.ts.mustache +179 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/config.json.mustache +95 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.scss.mustache +81 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-Phone/text-phone.component.ts.mustache +194 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/config.json.mustache +111 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.spec.ts.mustache +26 -0
- package/src/tasks/create/templates/SDK-Angular/field/Text-URL/text-url.component.ts.mustache +174 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.html.mustache +30 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.scss.mustache +20 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/field/TimeOfDay/time-of-day.component.ts.mustache +172 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/config.json.mustache +21 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/demo.stories.jsx.mustache +71 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.html.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.scss.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +121 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/mock.stories.js.mustache +294 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/TwoColumnDetails.svg +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/config.json.mustache +27 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/demo.stories.jsx.mustache +73 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.html.mustache +6 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.scss.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/details.component.ts.mustache +92 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS-region/mock.stories.js.mustache +290 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/DefaultForm.svg +29 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/config.json.mustache +45 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/demo.stories.jsx.mustache +215 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.html.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.scss.mustache +33 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.ts.mustache +71 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/TwoColumn.svg +38 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/config.json.mustache +49 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/demo.stories.jsx.mustache +183 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.html.mustache +16 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.scss.mustache +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/form.component.ts.mustache +26 -0
- package/src/tasks/create/templates/SDK-Angular/template/FORM-region/mock.stories.js.mustache +132 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/OneColumnPage.svg +28 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/config.json.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/demo.stories.jsx.mustache +80 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/mock.stories.js.mustache +115 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.html.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.scss.mustache +3 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/template/PAGE/page.component.ts.mustache +63 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.html.mustache +15 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.scss.mustache +22 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/case.component.ts.mustache +111 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/config.json.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/demo.stories.jsx.mustache +70 -0
- package/src/tasks/create/templates/SDK-Angular/widget/CASE/mock.stories.js.mustache +390 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/config.json.mustache +59 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/demo.stories.jsx.mustache +29 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/mock.stories.js.mustache +23 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.html.mustache +17 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.scss.mustache +19 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/page.component.ts.mustache +32 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE/pagecomponent.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/config.json.mustache +66 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/demo.stories.jsx.mustache +52 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/mock.stories.js.mustache +52 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.html.mustache +28 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.scss.mustache +137 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.spec.ts.mustache +25 -0
- package/src/tasks/create/templates/SDK-Angular/widget/PAGE-CASE/page-case.component.ts.mustache +115 -0
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Date/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/DateTime/index.tsx.mustache +6 -7
- package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.jsx.mustache +5 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +78 -28
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Integer/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Picklist/demo.stories.jsx.mustache +13 -0
- package/src/tasks/create/templates/SDK-React/field/Picklist/index.tsx.mustache +30 -10
- package/src/tasks/create/templates/SDK-React/field/Text/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Email/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Input/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/index.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/index.tsx.mustache +6 -5
- package/src/tasks/create/templates/SDK-React/field/Text-URL/index.tsx.mustache +11 -0
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/config.json.mustache +135 -0
- package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/index.tsx.mustache +12 -1
- package/src/tasks/create/templates/SDK-React/template/DETAILS/index.tsx.mustache +7 -3
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/index.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/template/FORM/index.tsx.mustache +30 -20
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.jsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.jsx.mustache +1 -0
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +4 -3
- package/src/tasks/create/templates/SDK-React/widget/PAGE/index.tsx.mustache +7 -7
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.jsx.mustache +2 -10
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +138 -36
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/mock.stories.js.mustache +1 -1
- package/src/tasks/create-all/index.js +112 -56
- package/src/tasks/delete/helper.js +88 -24
- package/src/tasks/delete/index.js +17 -8
- package/src/tasks/delete-all/helper.js +88 -25
- package/src/tasks/delete-all/index.js +15 -6
- package/src/tasks/list/helper.js +2 -3
- package/src/tasks/list/index.js +14 -7
- package/src/tasks/map/map.js +212 -20
- package/src/tasks/map-all/index.js +19 -2
- package/src/tasks/override/index.js +140 -79
- package/src/tasks/override-all/index.js +54 -6
- package/src/tasks/publish/helper.js +94 -51
- package/src/tasks/publish/index.js +87 -34
- package/src/tasks/publish-all/helper.js +97 -58
- package/src/tasks/publish-all/index.js +127 -48
- package/src/tasks/rename/index.js +184 -111
- package/src/tasks/validator/index.js +31 -7
- package/src/util.js +187 -39
- package/src/tasks/create/templates/Constellation/field/TimeofDay/styles.js.mustache +0 -7
- /package/src/tasks/bundle/{builder → builderAngular}/index.js +0 -0
- /package/src/tasks/bundle/{builder → builderAngular}/modules.js +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/index.jsx.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
- /package/src/tasks/create/templates/Constellation/field/{TimeofDay → TimeOfDay}/suggestions-handler.js +0 -0
- /package/src/tasks/create/templates/{SDK-React/field/TimeofDay → SDK-Angular/field/TimeOfDay}/config.json.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/demo.stories.jsx.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/mock.stories.js.mustache +0 -0
- /package/src/tasks/create/templates/SDK-React/field/{TimeofDay → TimeOfDay}/styles.js.mustache +0 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { Component, OnInit, Input, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
5
|
+
import { MatNativeDateModule } from '@angular/material/core';
|
|
6
|
+
import { MatInputModule } from '@angular/material/input';
|
|
7
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
8
|
+
import { interval } from 'rxjs';
|
|
9
|
+
import { AngularPConnectService } from '@pega/angular-sdk-library';
|
|
10
|
+
import { Utils } from '@pega/angular-sdk-library';
|
|
11
|
+
import { TextComponent } from '@pega/angular-sdk-library';
|
|
12
|
+
import { FieldValueListComponent } from '@pega/angular-sdk-library';
|
|
13
|
+
|
|
14
|
+
declare const window: any;
|
|
15
|
+
|
|
16
|
+
@Component({
|
|
17
|
+
selector: 'app-{{COMPONENT_CLASS_NAME_KEBAB}}',
|
|
18
|
+
templateUrl: './{{COMPONENT_CLASS_NAME_KEBAB}}.component.html',
|
|
19
|
+
styleUrls: ['./{{COMPONENT_CLASS_NAME_KEBAB}}.component.scss'],
|
|
20
|
+
standalone: true,
|
|
21
|
+
imports: [
|
|
22
|
+
CommonModule,
|
|
23
|
+
ReactiveFormsModule,
|
|
24
|
+
MatFormFieldModule,
|
|
25
|
+
MatInputModule,
|
|
26
|
+
MatDatepickerModule,
|
|
27
|
+
MatNativeDateModule,
|
|
28
|
+
TextComponent,
|
|
29
|
+
FieldValueListComponent
|
|
30
|
+
]
|
|
31
|
+
})
|
|
32
|
+
export class {{COMPONENT_CLASS_NAME}}Component implements OnInit {
|
|
33
|
+
@Input() pConn$: any;
|
|
34
|
+
@Input() formGroup$: FormGroup;
|
|
35
|
+
|
|
36
|
+
// Used with AngularPConnect
|
|
37
|
+
angularPConnectData: any = {};
|
|
38
|
+
configProps$: Object;
|
|
39
|
+
label$: string = '';
|
|
40
|
+
value$: any;
|
|
41
|
+
bRequired$: boolean = false;
|
|
42
|
+
bReadonly$: boolean = false;
|
|
43
|
+
bDisabled$: boolean = false;
|
|
44
|
+
bVisible$: boolean = true;
|
|
45
|
+
displayMode$: string = '';
|
|
46
|
+
controlName$: string;
|
|
47
|
+
bHasForm$: boolean = true;
|
|
48
|
+
componentReference: string = '';
|
|
49
|
+
testId: string = '';
|
|
50
|
+
|
|
51
|
+
fieldControl = new FormControl('', null);
|
|
52
|
+
|
|
53
|
+
constructor(
|
|
54
|
+
private angularPConnect: AngularPConnectService,
|
|
55
|
+
private cdRef: ChangeDetectorRef,
|
|
56
|
+
private utils: Utils
|
|
57
|
+
) {}
|
|
58
|
+
|
|
59
|
+
ngOnInit(): void {
|
|
60
|
+
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
61
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
62
|
+
this.controlName$ = this.angularPConnect.getComponentID(this);
|
|
63
|
+
|
|
64
|
+
// Then, continue on with other initialization
|
|
65
|
+
// call updateSelf when initializing
|
|
66
|
+
//this.updateSelf();
|
|
67
|
+
this.checkAndUpdate();
|
|
68
|
+
|
|
69
|
+
if (this.formGroup$ != null) {
|
|
70
|
+
// add control to formGroup
|
|
71
|
+
this.formGroup$.addControl(this.controlName$, this.fieldControl);
|
|
72
|
+
this.fieldControl.setValue(this.value$);
|
|
73
|
+
this.bHasForm$ = true;
|
|
74
|
+
} else {
|
|
75
|
+
this.bReadonly$ = true;
|
|
76
|
+
this.bHasForm$ = false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
ngOnDestroy(): void {
|
|
81
|
+
if (this.formGroup$ != null) {
|
|
82
|
+
this.formGroup$.removeControl(this.controlName$);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
86
|
+
this.angularPConnectData.unsubscribeFn();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Callback passed when subscribing to store change
|
|
91
|
+
onStateChange() {
|
|
92
|
+
this.checkAndUpdate();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
checkAndUpdate() {
|
|
96
|
+
// Should always check the bridge to see if the component should
|
|
97
|
+
// update itself (re-render)
|
|
98
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
99
|
+
|
|
100
|
+
// ONLY call updateSelf when the component should update
|
|
101
|
+
if (bUpdateSelf) {
|
|
102
|
+
this.updateSelf();
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// updateSelf
|
|
107
|
+
updateSelf(): void {
|
|
108
|
+
// starting very simple...
|
|
109
|
+
// moved this from ngOnInit() and call this from there instead...
|
|
110
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
|
|
111
|
+
|
|
112
|
+
if (this.configProps$['value'] != undefined) {
|
|
113
|
+
let sDateValue: any = '';
|
|
114
|
+
sDateValue = this.configProps$['value'];
|
|
115
|
+
|
|
116
|
+
if (sDateValue != '') {
|
|
117
|
+
if (typeof sDateValue == 'object') {
|
|
118
|
+
sDateValue = sDateValue.toISOString();
|
|
119
|
+
} else if (sDateValue.indexOf('/') < 0) {
|
|
120
|
+
// if we have the "pega" format, then for display, convert to standard format (US)
|
|
121
|
+
// sDateValue = this.formatDate(sDateValue);
|
|
122
|
+
sDateValue = this.utils.generateDate(sDateValue, 'Date-Long-Custom-YYYY');
|
|
123
|
+
}
|
|
124
|
+
this.value$ = new Date(sDateValue);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
this.testId = this.configProps$['testId'];
|
|
128
|
+
this.label$ = this.configProps$['label'];
|
|
129
|
+
this.displayMode$ = this.configProps$['displayMode'];
|
|
130
|
+
|
|
131
|
+
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
132
|
+
setTimeout(() => {
|
|
133
|
+
if (this.configProps$['required'] != null) {
|
|
134
|
+
this.bRequired$ = this.utils.getBooleanValue(this.configProps$['required']);
|
|
135
|
+
}
|
|
136
|
+
this.cdRef.detectChanges();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
if (this.configProps$['visibility'] != null) {
|
|
140
|
+
this.bVisible$ = this.utils.getBooleanValue(this.configProps$['visibility']);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// disabled
|
|
144
|
+
if (this.configProps$['disabled'] != undefined) {
|
|
145
|
+
this.bDisabled$ = this.utils.getBooleanValue(this.configProps$['disabled']);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (this.bDisabled$) {
|
|
149
|
+
this.fieldControl.disable();
|
|
150
|
+
} else {
|
|
151
|
+
this.fieldControl.enable();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (this.configProps$['readOnly'] != null) {
|
|
155
|
+
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$['readOnly']);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
this.componentReference = this.pConn$.getStateProps().value;
|
|
159
|
+
|
|
160
|
+
// trigger display of error message with field control
|
|
161
|
+
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
162
|
+
let timer = interval(100).subscribe(() => {
|
|
163
|
+
this.fieldControl.setErrors({ message: true });
|
|
164
|
+
this.fieldControl.markAsTouched();
|
|
165
|
+
|
|
166
|
+
timer.unsubscribe();
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
fieldOnDateChange(event: any, sValue: string) {
|
|
172
|
+
// this comes from the date pop up
|
|
173
|
+
if (typeof event.value == 'object') {
|
|
174
|
+
// convert date to pega "date" format
|
|
175
|
+
event.value = event.value.toISOString();
|
|
176
|
+
}
|
|
177
|
+
this.angularPConnectData.actions.onChange(this, { value: event.value });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
fieldOnClick(event: any) {}
|
|
181
|
+
|
|
182
|
+
fieldOnBlur(event: any) {
|
|
183
|
+
// PConnect wants to use eventHandler for onBlur
|
|
184
|
+
if (typeof event.value == 'object') {
|
|
185
|
+
event.value = event.value.toISOString();
|
|
186
|
+
// convert date to pega "date" format
|
|
187
|
+
event.value = event.value.toISOString();
|
|
188
|
+
}
|
|
189
|
+
this.angularPConnectData.actions.onBlur(this, { value: event.value });
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
hasErrors() {
|
|
193
|
+
return this.fieldControl.status === 'INVALID';
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
getErrorMessage() {
|
|
197
|
+
let errMessage: string = '';
|
|
198
|
+
// look for validation messages for json, pre-defined or just an error pushed from workitem (400)
|
|
199
|
+
if (this.fieldControl.hasError('message')) {
|
|
200
|
+
errMessage = this.angularPConnectData.validateMessage;
|
|
201
|
+
return errMessage;
|
|
202
|
+
} else if (this.fieldControl.hasError('required')) {
|
|
203
|
+
errMessage = 'You must enter a value';
|
|
204
|
+
} else if (this.fieldControl.errors) {
|
|
205
|
+
errMessage = `${this.fieldControl.errors.matDatepickerParse.text} is not a valid date value`;
|
|
206
|
+
}
|
|
207
|
+
return errMessage;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
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": "LABEL",
|
|
57
|
+
"label": "Year range",
|
|
58
|
+
"variant": "secondary"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"format": "INLINE",
|
|
62
|
+
"elements": [
|
|
63
|
+
{
|
|
64
|
+
"key": "next",
|
|
65
|
+
"format": "LABEL",
|
|
66
|
+
"label": "Next",
|
|
67
|
+
"variant": "secondary"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"key": "nextYears",
|
|
71
|
+
"format": "NUMBER",
|
|
72
|
+
"label": "",
|
|
73
|
+
"name": "nextYearRange",
|
|
74
|
+
"min": 0
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"key": "year",
|
|
78
|
+
"format": "LABEL",
|
|
79
|
+
"label": "years",
|
|
80
|
+
"variant": "secondary"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"format": "INLINE",
|
|
86
|
+
"elements": [
|
|
87
|
+
{
|
|
88
|
+
"key": "previous",
|
|
89
|
+
"format": "LABEL",
|
|
90
|
+
"label": "Previous",
|
|
91
|
+
"variant": "secondary"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"key": "previousYears",
|
|
95
|
+
"format": "NUMBER",
|
|
96
|
+
"label": "",
|
|
97
|
+
"name": "previousYearRange",
|
|
98
|
+
"min": 0
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"key": "year",
|
|
102
|
+
"format": "LABEL",
|
|
103
|
+
"label": "years",
|
|
104
|
+
"variant": "secondary"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
"name": "showWeekNumber",
|
|
110
|
+
"label": "Display week numbers on calendar",
|
|
111
|
+
"format": "BOOLEAN"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"format": "SELECT",
|
|
115
|
+
"name": "pickerInterval",
|
|
116
|
+
"label": "Time picker",
|
|
117
|
+
"defaultValue": "30",
|
|
118
|
+
"source": [
|
|
119
|
+
{
|
|
120
|
+
"key": "5",
|
|
121
|
+
"value": "5 min"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"key": "10",
|
|
125
|
+
"value": "10 min"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"key": "15",
|
|
129
|
+
"value": "15 min"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"key": "20",
|
|
133
|
+
"value": "20 min"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"key": "30",
|
|
137
|
+
"value": "30 min"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"key": "60",
|
|
141
|
+
"value": "1 hr"
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "helperText",
|
|
147
|
+
"label": "Helper text",
|
|
148
|
+
"format": "TEXT"
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"label": "Read-only settings",
|
|
154
|
+
"format": "GROUP",
|
|
155
|
+
"properties": [
|
|
156
|
+
{
|
|
157
|
+
"name": "showAsFormattedText",
|
|
158
|
+
"label": "Show as formatted text",
|
|
159
|
+
"format": "BOOLEAN"
|
|
160
|
+
}
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"label": "Conditions",
|
|
165
|
+
"format": "GROUP",
|
|
166
|
+
"properties": [
|
|
167
|
+
{
|
|
168
|
+
"name": "required",
|
|
169
|
+
"label": "Required",
|
|
170
|
+
"format": "REQUIRED",
|
|
171
|
+
"visibility": "(!readOnly = true)"
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"name": "disabled",
|
|
175
|
+
"label": "Disabled",
|
|
176
|
+
"format": "DISABLED",
|
|
177
|
+
"visibility": "(!readOnly = true)"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"name": "visibility",
|
|
181
|
+
"label": "Visibility",
|
|
182
|
+
"format": "VISIBILITY"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"label": "Advanced",
|
|
188
|
+
"format": "GROUP",
|
|
189
|
+
"collapsible": true,
|
|
190
|
+
"properties": [
|
|
191
|
+
{
|
|
192
|
+
"name": "testId",
|
|
193
|
+
"label": "Test ID",
|
|
194
|
+
"format": "TEXT",
|
|
195
|
+
"ignorePattern": "[^-_\\p{N}\\p{L}]",
|
|
196
|
+
"includeAnnotations": false
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
],
|
|
201
|
+
"defaultConfig": {
|
|
202
|
+
"label": "@L $this.label"
|
|
203
|
+
}
|
|
204
|
+
}
|
package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.html.mustache
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<div *ngIf="displayMode$; else noDisplayMode">
|
|
2
|
+
<app-field-value-list [label$]="label$" [value$]="value$" [displayMode$]="displayMode$"></app-field-value-list>
|
|
3
|
+
</div>
|
|
4
|
+
{{! pick new delimiters for mustache }}
|
|
5
|
+
{{=<% %>=}}
|
|
6
|
+
<ng-template #noDisplayMode>
|
|
7
|
+
<div *ngIf="!bReadonly$ && bHasForm$; else noEdit">
|
|
8
|
+
<div [formGroup]="formGroup$" *ngIf="bVisible$">
|
|
9
|
+
<mat-form-field class="psdk-full-width">
|
|
10
|
+
<mat-label>{{ label$ }}</mat-label>
|
|
11
|
+
<input
|
|
12
|
+
matInput
|
|
13
|
+
[attr.data-test-id]="testId"
|
|
14
|
+
[placeholder]=""
|
|
15
|
+
type="datetime-local"
|
|
16
|
+
[value]="value$"
|
|
17
|
+
[required]="bRequired$"
|
|
18
|
+
[formControlName]="controlName$"
|
|
19
|
+
(click)="fieldOnClick($event)"
|
|
20
|
+
(change)="fieldOnChange($event)"
|
|
21
|
+
(blur)="fieldOnBlur($event)"
|
|
22
|
+
/>
|
|
23
|
+
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error>
|
|
24
|
+
</mat-form-field>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</ng-template>
|
|
28
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
29
|
+
<ng-template #noEdit>
|
|
30
|
+
<app-text [pConn$]="pConn$" [formatAs$]="'date-time'"></app-text>
|
|
31
|
+
</ng-template>
|
package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.scss.mustache
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.psdk-full-width {
|
|
2
|
+
width: 100%;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.psdk-label-readonly {
|
|
6
|
+
font-size: 1rem;
|
|
7
|
+
display: block;
|
|
8
|
+
transform: translateY(-1.28125em) scale(0.75) perspective(100px) translateZ(0.001px);
|
|
9
|
+
-ms-transform: translateY(-1.28125em) scale(0.75);
|
|
10
|
+
width: 133.33333%;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.psdk-data-readonly {
|
|
14
|
+
padding-top: 0.625rem;
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::ng-deep .mat-mdc-form-field-infix {
|
|
19
|
+
width: auto;
|
|
20
|
+
}
|
package/src/tasks/create/templates/SDK-Angular/field/DateTime/date-time.component.spec.ts.mustache
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { {{COMPONENT_CLASS_NAME}}Component } from './{{COMPONENT_CLASS_NAME_KEBAB}}.component';
|
|
4
|
+
|
|
5
|
+
describe('{{COMPONENT_CLASS_NAME}}Component', () => {
|
|
6
|
+
let component: {{COMPONENT_CLASS_NAME}}Component;
|
|
7
|
+
let fixture: ComponentFixture<{{COMPONENT_CLASS_NAME}}Component>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ {{COMPONENT_CLASS_NAME}}Component ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent({{COMPONENT_CLASS_NAME}}Component);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Component, OnInit, Input, ChangeDetectorRef } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { MatInputModule } from '@angular/material/input';
|
|
5
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
6
|
+
import { interval } from 'rxjs';
|
|
7
|
+
import { AngularPConnectService } from '@pega/angular-sdk-library';
|
|
8
|
+
import { Utils } from '@pega/angular-sdk-library';
|
|
9
|
+
import { TextComponent } from '@pega/angular-sdk-library';
|
|
10
|
+
import { FieldValueListComponent } from '@pega/angular-sdk-library';
|
|
11
|
+
|
|
12
|
+
declare const window: any;
|
|
13
|
+
|
|
14
|
+
@Component({
|
|
15
|
+
selector: 'app-{{COMPONENT_CLASS_NAME_KEBAB}}',
|
|
16
|
+
templateUrl: './{{COMPONENT_CLASS_NAME_KEBAB}}.component.html',
|
|
17
|
+
styleUrls: ['./{{COMPONENT_CLASS_NAME_KEBAB}}.component.scss'],
|
|
18
|
+
standalone: true,
|
|
19
|
+
imports: [CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, TextComponent, FieldValueListComponent]
|
|
20
|
+
})
|
|
21
|
+
export class {{COMPONENT_CLASS_NAME}}Component implements OnInit {
|
|
22
|
+
@Input() pConn$: any;
|
|
23
|
+
@Input() formGroup$: FormGroup;
|
|
24
|
+
|
|
25
|
+
// Used with AngularPConnect
|
|
26
|
+
angularPConnectData: any = {};
|
|
27
|
+
configProps$: Object;
|
|
28
|
+
|
|
29
|
+
label$: string = '';
|
|
30
|
+
value$: any;
|
|
31
|
+
bRequired$: boolean = false;
|
|
32
|
+
bReadonly$: boolean = false;
|
|
33
|
+
bDisabled$: boolean = false;
|
|
34
|
+
bVisible$: boolean = true;
|
|
35
|
+
displayMode$: string = '';
|
|
36
|
+
controlName$: string;
|
|
37
|
+
bHasForm$: boolean = true;
|
|
38
|
+
componentReference: string = '';
|
|
39
|
+
testId: string = '';
|
|
40
|
+
|
|
41
|
+
fieldControl = new FormControl('', null);
|
|
42
|
+
|
|
43
|
+
constructor(
|
|
44
|
+
private angularPConnect: AngularPConnectService,
|
|
45
|
+
private cdRef: ChangeDetectorRef,
|
|
46
|
+
private utils: Utils
|
|
47
|
+
) {}
|
|
48
|
+
|
|
49
|
+
ngOnInit(): void {
|
|
50
|
+
// First thing in initialization is registering and subscribing to the AngularPConnect service
|
|
51
|
+
this.angularPConnectData = this.angularPConnect.registerAndSubscribeComponent(this, this.onStateChange);
|
|
52
|
+
this.controlName$ = this.angularPConnect.getComponentID(this);
|
|
53
|
+
// Then, continue on with other initialization
|
|
54
|
+
// call updateSelf when initializing
|
|
55
|
+
//this.updateSelf();
|
|
56
|
+
this.checkAndUpdate();
|
|
57
|
+
|
|
58
|
+
if (this.formGroup$ != null) {
|
|
59
|
+
// add control to formGroup
|
|
60
|
+
this.formGroup$.addControl(this.controlName$, this.fieldControl);
|
|
61
|
+
this.fieldControl.setValue(this.value$);
|
|
62
|
+
this.bHasForm$ = true;
|
|
63
|
+
} else {
|
|
64
|
+
this.bReadonly$ = true;
|
|
65
|
+
this.bHasForm$ = false;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
ngOnDestroy(): void {
|
|
70
|
+
if (this.formGroup$ != null) {
|
|
71
|
+
this.formGroup$.removeControl(this.controlName$);
|
|
72
|
+
}
|
|
73
|
+
if (this.angularPConnectData.unsubscribeFn) {
|
|
74
|
+
this.angularPConnectData.unsubscribeFn();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Callback passed when subscribing to store change
|
|
79
|
+
onStateChange() {
|
|
80
|
+
this.checkAndUpdate();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
checkAndUpdate() {
|
|
84
|
+
// Should always check the bridge to see if the component should
|
|
85
|
+
// update itself (re-render)
|
|
86
|
+
const bUpdateSelf = this.angularPConnect.shouldComponentUpdate(this);
|
|
87
|
+
|
|
88
|
+
// ONLY call updateSelf when the component should update
|
|
89
|
+
if (bUpdateSelf) {
|
|
90
|
+
this.updateSelf();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// updateSelf
|
|
95
|
+
updateSelf(): void {
|
|
96
|
+
// starting very simple...
|
|
97
|
+
// moved this from ngOnInit() and call this from there instead...
|
|
98
|
+
this.configProps$ = this.pConn$.resolveConfigProps(this.pConn$.getConfigProps());
|
|
99
|
+
|
|
100
|
+
this.label$ = this.configProps$['label'];
|
|
101
|
+
this.displayMode$ = this.configProps$['displayMode'];
|
|
102
|
+
this.testId = this.configProps$['testId'];
|
|
103
|
+
if (this.configProps$['value'] != undefined) {
|
|
104
|
+
const value = this.configProps$['value'];
|
|
105
|
+
this.value$ = value ? value.replace('Z', '') : value;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// timeout and detectChanges to avoid ExpressionChangedAfterItHasBeenCheckedError
|
|
109
|
+
setTimeout(() => {
|
|
110
|
+
if (this.configProps$['required'] != null) {
|
|
111
|
+
this.bRequired$ = this.utils.getBooleanValue(this.configProps$['required']);
|
|
112
|
+
}
|
|
113
|
+
this.cdRef.detectChanges();
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
if (this.configProps$['visibility'] != null) {
|
|
117
|
+
this.bVisible$ = this.utils.getBooleanValue(this.configProps$['visibility']);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
// disabled
|
|
121
|
+
if (this.configProps$['disabled'] != undefined) {
|
|
122
|
+
this.bDisabled$ = this.utils.getBooleanValue(this.configProps$['disabled']);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (this.bDisabled$) {
|
|
126
|
+
this.fieldControl.disable();
|
|
127
|
+
} else {
|
|
128
|
+
this.fieldControl.enable();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (this.configProps$['readOnly'] != null) {
|
|
132
|
+
this.bReadonly$ = this.utils.getBooleanValue(this.configProps$['readOnly']);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
this.componentReference = this.pConn$.getStateProps().value;
|
|
136
|
+
|
|
137
|
+
// trigger display of error message with field control
|
|
138
|
+
if (this.angularPConnectData.validateMessage != null && this.angularPConnectData.validateMessage != '') {
|
|
139
|
+
let timer = interval(100).subscribe(() => {
|
|
140
|
+
this.fieldControl.setErrors({ message: true });
|
|
141
|
+
this.fieldControl.markAsTouched();
|
|
142
|
+
|
|
143
|
+
timer.unsubscribe();
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
fieldOnChange(event: any) {
|
|
149
|
+
if (event.target.value) {
|
|
150
|
+
event.value = event.target.value;
|
|
151
|
+
}
|
|
152
|
+
this.angularPConnectData.actions.onChange(this, event);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
fieldOnClick(event: any) {}
|
|
156
|
+
|
|
157
|
+
fieldOnBlur(event: any) {
|
|
158
|
+
// PConnect wants to use eventHandler for onBlur
|
|
159
|
+
if (event.target.value) event.value = event.target.value;
|
|
160
|
+
|
|
161
|
+
this.angularPConnectData.actions.onBlur(this, event);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
getErrorMessage() {
|
|
165
|
+
let errMessage: string = '';
|
|
166
|
+
// look for validation messages for json, pre-defined or just an error pushed from workitem (400)
|
|
167
|
+
if (this.fieldControl.hasError('message')) {
|
|
168
|
+
errMessage = this.angularPConnectData.validateMessage;
|
|
169
|
+
return errMessage;
|
|
170
|
+
} else if (this.fieldControl.hasError('required')) {
|
|
171
|
+
errMessage = 'You must enter a value';
|
|
172
|
+
} else if (this.fieldControl.errors) {
|
|
173
|
+
errMessage = this.fieldControl.errors.toString();
|
|
174
|
+
}
|
|
175
|
+
return errMessage;
|
|
176
|
+
}
|
|
177
|
+
}
|