@pega/custom-dx-components 0.0.1 → 0.23.2
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/.vscode/extensions.json +1 -1
- package/README.md +6 -189
- package/package.json +34 -32
- package/src/auth.js +608 -0
- package/src/cli.js +42 -0
- package/src/constants.js +125 -8
- package/src/tasks/authenticate/helper.js +91 -8
- package/src/tasks/authenticate/index.js +169 -49
- package/src/tasks/build/helper.js +122 -0
- package/src/tasks/build/index.js +54 -0
- package/src/tasks/build-all/helper.js +70 -0
- package/src/tasks/build-all/index.js +79 -0
- package/src/tasks/{publish/bundle → bundle}/builder/index.js +49 -5
- package/src/tasks/{publish/bundle → bundle}/builder/webpack.config.js +5 -3
- package/src/tasks/{publish/bundle → bundle}/index.js +2 -2
- package/src/tasks/create/index.js +87 -64
- 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 +146 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +61 -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 +170 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/mock.stories.js.mustache +21 -0
- package/src/tasks/create/templates/Constellation/Field/Boolean/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +61 -0
- package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +41 -0
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +196 -0
- package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +439 -0
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +73 -0
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +256 -0
- package/src/tasks/create/templates/Constellation/Field/Date/mock.stories.js.mustache +23 -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 +257 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +92 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-utils.js.mustache +287 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +328 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +73 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +254 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/mock.stories.js.mustache +23 -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 +279 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +49 -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 +273 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal/mock.stories.js.mustache +21 -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 +292 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +53 -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 +299 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.stories.js.mustache +23 -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 +94 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +49 -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 +281 -0
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.stories.js.mustache +21 -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 +348 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +49 -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 +336 -0
- package/src/tasks/create/templates/Constellation/Field/Integer/mock.stories.js.mustache +21 -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 +115 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +78 -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 +351 -0
- package/src/tasks/create/templates/Constellation/Field/Picklist/mock.stories.js.mustache +67 -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/{template → templates/Constellation/Field/Text}/config.json.mustache +15 -5
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +51 -0
- package/src/tasks/create/{template → templates/Constellation/Field/Text}/index.jsx.mustache +5 -0
- package/src/tasks/create/templates/Constellation/Field/Text/mock.stories.js.mustache +13 -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 +112 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +48 -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 +231 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.stories.js.mustache +22 -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-Input/StatusWork.jsx +26 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/config.json.mustache +112 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +48 -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 +239 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.stories.js.mustache +21 -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-Paragraph/config.json.mustache +112 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +48 -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 +231 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.stories.js.mustache +20 -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-Phone/config.json.mustache +124 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +46 -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 +267 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.stories.js.mustache +37 -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-URL/config.json.mustache +238 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +46 -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/mock.stories.js.mustache +22 -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.jsx.mustache +173 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/config.json.mustache +186 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/demo.stories.jsx.mustache +57 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/index.jsx.mustache +213 -0
- package/src/tasks/create/templates/Constellation/Field/TimeOfDay/mock.stories.js.mustache +20 -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 +287 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/OneColumnDetails.svg +22 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.jsx.mustache +26 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/config.json.mustache +36 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +132 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +86 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.stories.js.mustache +189 -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 +152 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.jsx.mustache +26 -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 +43 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +136 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +86 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.stories.js.mustache +230 -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 +46 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +169 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +45 -0
- package/src/tasks/create/templates/Constellation/Template/FORM/mock.stories.js.mustache +137 -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 +28 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +178 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache +143 -0
- package/src/tasks/create/templates/Constellation/Template/FORM-region/styles.js.mustache +7 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/GetNextWork.jsx.mustache +35 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/config.json.mustache +33 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +102 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +70 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/localizations.json.mustache +4 -0
- package/src/tasks/create/templates/Constellation/Template/PAGE/mock.stories.js.mustache +94 -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 +229 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +24 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +78 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +76 -0
- package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +390 -0
- package/src/tasks/create/{template → templates/Constellation/Widget/CASE}/styles.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/config.json.mustache +60 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +30 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +48 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +23 -0
- package/src/tasks/{init/template/src/components/Organization_Library_VideoPlayer/styles.js → create/templates/Constellation/Widget/PAGE/styles.js.mustache} +3 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Avatar.jsx.mustache +75 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/OneColumnPage.svg +36 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.jsx.mustache +240 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/config.json.mustache +67 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +68 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +110 -0
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.stories.js.mustache +51 -0
- package/src/tasks/{init/template/src/components/Organization_Library_MediaURL/MediaURL.styles.ts → create/templates/Constellation/Widget/PAGE-CASE/styles.js.mustache} +3 -1
- package/src/tasks/create-all/index.js +398 -0
- package/src/tasks/delete/helper.js +6 -4
- package/src/tasks/delete/index.js +4 -0
- package/src/tasks/delete-all/helper.js +153 -0
- package/src/tasks/delete-all/index.js +49 -0
- package/src/tasks/generate-ai/aiPrompt.txt.mustache +23 -0
- package/src/tasks/generate-ai/aiPromptDavinci.txt.mustache +14 -0
- package/src/tasks/generate-ai/helper.js +357 -0
- package/src/tasks/generate-ai/index.js +34 -0
- package/src/tasks/index.js +7 -0
- package/src/tasks/init/index.js +9 -3
- package/src/tasks/init/template/.eslintignore +8 -0
- package/src/tasks/init/template/.eslintrc.json +186 -5
- package/src/tasks/init/template/.vscode/extensions.json +1 -1
- package/src/tasks/init/template/README.md +80 -61
- package/src/tasks/init/template/keys/DX-ComponentDev.zip +0 -0
- package/src/tasks/init/template/keys/dxcb.crt +32 -0
- package/src/tasks/init/template/keys/dxcb.key +51 -0
- package/src/tasks/init/template/package.json.mustache +44 -21
- package/src/tasks/init/template/src/components/_components.md +1 -0
- package/src/tasks/init/template/tasks.config.json +19 -5
- package/src/tasks/init/template/templateNPMRC.txt +8 -0
- package/src/tasks/linter/index.js +46 -0
- package/src/tasks/list/helper.js +19 -6
- package/src/tasks/list/index.js +4 -0
- package/src/tasks/publish/helper.js +13 -4
- package/src/tasks/publish/index.js +14 -1
- package/src/tasks/publish-all/helper.js +154 -0
- package/src/tasks/publish-all/index.js +95 -0
- package/src/tasks/rename/index.js +314 -0
- package/src/tasks/validator/index.js +291 -18
- package/src/util.js +372 -6
- package/src/tasks/create/template/demo.stories.jsx.mustache +0 -44
- package/src/tasks/init/template/src/components/MBTAList/MBTAList.stories.tsx +0 -10
- package/src/tasks/init/template/src/components/MBTAList/MBTAList.tsx +0 -122
- package/src/tasks/init/template/src/components/MBTAList/icons/accessible.icon.tsx +0 -14
- package/src/tasks/init/template/src/components/MBTAList/icons/bus.icon.tsx +0 -13
- package/src/tasks/init/template/src/components/MBTAList/icons/mbta.icon.tsx +0 -10
- package/src/tasks/init/template/src/components/MBTAList/icons/subway.icon.tsx +0 -14
- package/src/tasks/init/template/src/components/MBTAList/index.ts +0 -2
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURL.stories.tsx +0 -19
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURL.types.ts +0 -10
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURLDisplay.tsx +0 -25
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/MediaURLInput.tsx +0 -24
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/config.json +0 -13
- package/src/tasks/init/template/src/components/Organization_Library_MediaURL/index.ts +0 -2
- package/src/tasks/init/template/src/components/Organization_Library_VideoPlayer/config.json +0 -44
- package/src/tasks/init/template/src/components/Organization_Library_VideoPlayer/demo.stories.jsx +0 -40
- package/src/tasks/init/template/src/components/Organization_Library_VideoPlayer/index.jsx +0 -42
- /package/src/tasks/{publish/bundle → bundle}/builder/modules.js +0 -0
- /package/src/tasks/{publish/bundle → bundle}/builder/paths.js +0 -0
package/.vscode/extensions.json
CHANGED
package/README.md
CHANGED
|
@@ -8,197 +8,14 @@ This project provides you with an environment to extend Constellation by giving
|
|
|
8
8
|
|
|
9
9
|
Ensure you have access to the following in your system:
|
|
10
10
|
|
|
11
|
-
- Pega Infinity Server version 8.7
|
|
11
|
+
- Pega Infinity Server version 8.7 or later
|
|
12
12
|
|
|
13
|
-
- Git version 2.30
|
|
13
|
+
- Git version 2.30 or later
|
|
14
14
|
|
|
15
|
-
- System node version
|
|
15
|
+
- System node version 18
|
|
16
16
|
|
|
17
|
-
- System npm version
|
|
17
|
+
- System npm version 8
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Latest Documentation
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
1. Enter the following command to initialize the project.
|
|
24
|
-
`npx @pega/custom-ui-components init`
|
|
25
|
-
|
|
26
|
-
2. If prompted, enter `y` to install the Custom UI Components package.
|
|
27
|
-
You will then be asked to set up the project by entering the required details.
|
|
28
|
-
|
|
29
|
-
3. Enter the following details:
|
|
30
|
-
- Name of the project (required)
|
|
31
|
-
Example - `mycustomcomponents`
|
|
32
|
-
- Name of the organization (required)
|
|
33
|
-
Example - `customorg`
|
|
34
|
-
- Version (required)
|
|
35
|
-
Example - `1.0.0`
|
|
36
|
-
- Description of the project (optional)
|
|
37
|
-
Example - `This project is intended to create and publish a custom component.`
|
|
38
|
-
- Git repository URL (optional)
|
|
39
|
-
Example - `https://git.custom-components.io/custom-cc.git`
|
|
40
|
-
- Author (optional)
|
|
41
|
-
Example - `Michelle`
|
|
42
|
-
|
|
43
|
-
The workspace is now set up to create custom components and publish them to the server.
|
|
44
|
-
|
|
45
|
-
## Create custom components
|
|
46
|
-
|
|
47
|
-
Create custom components using the following procedure:
|
|
48
|
-
|
|
49
|
-
1. Enter the following command to create a component:
|
|
50
|
-
`npm run create`
|
|
51
|
-
You will then be asked to enter or review the following details of the component:
|
|
52
|
-
- Name of the component (required)
|
|
53
|
-
Example - `customcomp0`
|
|
54
|
-
- Name of component label (required)
|
|
55
|
-
Example - `custom component`
|
|
56
|
-
- Name of the library (required)
|
|
57
|
-
Example - `basic`
|
|
58
|
-
- Component version (required)
|
|
59
|
-
Example - `0.0.1`
|
|
60
|
-
- Type of component (required)
|
|
61
|
-
Example - `Field`
|
|
62
|
-
- Sub-type of component (required)
|
|
63
|
-
Example - `Text`
|
|
64
|
-
- Description of the component (optional)
|
|
65
|
-
Example - `This is a customized searchbox that filters data.`
|
|
66
|
-
The component is created in the following path: _/Users/your_user_name/project_name/src/components/component_name_
|
|
67
|
-
You can also pre-configure the values for the above options in a tasks.config.json file as shown below.
|
|
68
|
-
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"component": {
|
|
72
|
-
"library": "basic",
|
|
73
|
-
"type": "field",
|
|
74
|
-
"subtype": "text",
|
|
75
|
-
"description": "basic field for capturing textual data",
|
|
76
|
-
"icon": "basic-field-text.svg"
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
>**Note**:
|
|
81
|
-
Alternatively, you can enter the following command to skip entering the details of the component now and can manually enter the details in the config.json file after the component is created:
|
|
82
|
-
`npm run create <enter_component_name>`
|
|
83
|
-
|
|
84
|
-
A _src/components_ folder is created and the necessary files required to build the component are initialized as seen below.
|
|
85
|
-
|
|
86
|
-
```sh
|
|
87
|
-
├── src
|
|
88
|
-
├── components
|
|
89
|
-
├── <component_name>
|
|
90
|
-
├── index.js
|
|
91
|
-
├── demo.stories.js
|
|
92
|
-
├── config.json
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
The *index.js* file contains the actual component rendering logic.
|
|
97
|
-
The *demo.stories.js* file contains the demo that can be viewed in the storybook.
|
|
98
|
-
The *config.json* file contains the mapping of properties for configuring the auto generated property panel. This property panel appears in AppStudio when an application is being authored to use the custom component.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
2. Enter the following command to start the storybook to view the demo.
|
|
102
|
-
`npm start`
|
|
103
|
-
|
|
104
|
-
3. Modify the source files to build your own component. You can also install and import third-party libraries if required for your component.
|
|
105
|
-
|
|
106
|
-
The custom component is now created. We use the information provided to create uniquely namespaced components in this convention - `<organization>_<library>_<component name>`.
|
|
107
|
-
|
|
108
|
-
## Authenticate the user
|
|
109
|
-
Before we publish the custom component to the Pega Infinity Server, authenticate the user to access the resources in the Pega Infinity Server.
|
|
110
|
-
|
|
111
|
-
>**Note**:
|
|
112
|
-
It is required that you configure a value for clientId, clientSecret, and accessTokenUri.
|
|
113
|
-
1. Login to Pega Infinity Server, navigate to Records / Security / OAuth 2.0 Client Registration landing page and open the *DX-CustomComponents* record.
|
|
114
|
-
2. Click **Regenerate Client Secret**, download the Client Credentials (as the Client ID, Client Secret, and Access token endpoint will be needed), and save the record.
|
|
115
|
-
3. Update the the task.config.json file with these downloaded values:
|
|
116
|
-
```json
|
|
117
|
-
"server-config": {
|
|
118
|
-
"server": "https://127.0.0.1:8080/prweb",
|
|
119
|
-
"user": "customcomponentoperator",
|
|
120
|
-
"password": "pwd",
|
|
121
|
-
"clientId": "<mention client ID here>",
|
|
122
|
-
"clientSecret": "<mention client secret here>",
|
|
123
|
-
"accessTokenUri": "https://127.0.0.1:8080/prweb/PRRestService/oauth2/v1/token"
|
|
124
|
-
},
|
|
125
|
-
```
|
|
126
|
-
4. Enter the following command to initiate authentication.
|
|
127
|
-
`npm run authenticate`
|
|
128
|
-
|
|
129
|
-
The user is now authenticated and can proceed to either publish or list the components.
|
|
130
|
-
|
|
131
|
-
## Publish custom components
|
|
132
|
-
Enter the following command to publish custom components to Pega Infinity Server:
|
|
133
|
-
`npm run publish`
|
|
134
|
-
Publish the finalized custom components changes to Pega Infinity Server so that it can be discoverable in authoring (design palette).
|
|
135
|
-
You will then be asked to enter the following details:
|
|
136
|
-
|
|
137
|
-
- The component to be published to Pega Infinity Server. It will be updated if the component exists.
|
|
138
|
-
- The name of the ruleset where the component must be published.
|
|
139
|
-
- The version of the ruleset where the component must be published.
|
|
140
|
-
- Specify if the development build should be generated for debugging.
|
|
141
|
-
You can also pre-configure the values for the above options in a tasks.config.json file as shown below. The server, user name, and password must be pre-configured.
|
|
142
|
-
|
|
143
|
-
```json
|
|
144
|
-
{
|
|
145
|
-
"components-server-config": {
|
|
146
|
-
"server": "http://127.0.0.1:8080/prweb",
|
|
147
|
-
"user": "customcomponentoperator",
|
|
148
|
-
"password": "pwd"
|
|
149
|
-
"rulesetName": "TestPega-C11nGall",
|
|
150
|
-
"rulesetVersion": "01-01-03",
|
|
151
|
-
"sourceOfComponents": "Server",
|
|
152
|
-
"devBuild": false,
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
```
|
|
156
|
-
When the component is successfully published, you can use the newly published component in App Studio's view authoring.
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
>**Note**:
|
|
160
|
-
The Rule-UI-Component instance (with component name) is created on the Pega Infinity Server after publishing the component.
|
|
161
|
-
|
|
162
|
-
## List custom components
|
|
163
|
-
View the available components in the local machine or the server.
|
|
164
|
-
|
|
165
|
-
Enter the following command to list custom components:
|
|
166
|
-
`npm run list`
|
|
167
|
-
|
|
168
|
-
You will then be asked to enter the following details:
|
|
169
|
-
|
|
170
|
-
- List components from Server or Local?
|
|
171
|
-
Example - `Server`
|
|
172
|
-
|
|
173
|
-
The custom components will now be listed in the terminal.
|
|
174
|
-
|
|
175
|
-
## Delete custom components
|
|
176
|
-
Delete the available or published components in the local machine or the server.
|
|
177
|
-
|
|
178
|
-
Enter the following command to delete custom components:
|
|
179
|
-
`npm run delete`
|
|
180
|
-
|
|
181
|
-
You will then be asked to enter the following details:
|
|
182
|
-
|
|
183
|
-
- Delete components from Server or Local?
|
|
184
|
-
Example - `Local`
|
|
185
|
-
|
|
186
|
-
- Select component to delete
|
|
187
|
-
The list of available components in the following path will be displayed: _/Users/your_user_name/project_name/src/components
|
|
188
|
-
Select the component to be deleted from this list.
|
|
189
|
-
|
|
190
|
-
- Are you sure?
|
|
191
|
-
Example - `yes`
|
|
192
|
-
|
|
193
|
-
>**Note**:
|
|
194
|
-
If you choose to delete components from the server, the successfully published components along with their ruleset name and ruleset version from the Pega Infinity Server will be displayed. Select the component to be deleted from this list.
|
|
195
|
-
|
|
196
|
-
## View existing custom components in storybook
|
|
197
|
-
View custom components in a storybook by performing the following procedure:
|
|
198
|
-
1. Enter the following command to open the project.
|
|
199
|
-
`cd <enter your project's name>`
|
|
200
|
-
|
|
201
|
-
2. Enter the following command to start the storybook in development mode.
|
|
202
|
-
`npm start`
|
|
203
|
-
|
|
204
|
-
The storybook is launched in a browser where you can view the components working in isolation.
|
|
21
|
+
Find the latest documentation on using **DX Component Builder** [here](https://docs.pega.com/bundle/constellation-dx-components-88/page/constellation-dx-components/custom-components/lifecycle-dx-cosmos-components.html)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/custom-dx-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.2",
|
|
4
4
|
"description": "Utility for building custom UI components",
|
|
5
5
|
"bin": "./bin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,44 +13,47 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"sideEffects": false,
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@babel/core": "^7.
|
|
17
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
18
|
-
"@babel/preset-env": "^7.
|
|
19
|
-
"@babel/preset-react": "^7.
|
|
16
|
+
"@babel/core": "^7.19.1",
|
|
17
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
18
|
+
"@babel/preset-env": "^7.19.1",
|
|
19
|
+
"@babel/preset-react": "^7.18.6",
|
|
20
20
|
"adm-zip": "^0.5.9",
|
|
21
|
-
"ajv": "^8.
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"css-
|
|
21
|
+
"ajv": "^8.12.0",
|
|
22
|
+
"ajv-keywords": "^5.1.0",
|
|
23
|
+
"arg": "^5.0.2",
|
|
24
|
+
"babel-loader": "^8.2.5",
|
|
25
|
+
"chalk": "^5.0.1",
|
|
26
|
+
"compression-webpack-plugin": "^10.0.0",
|
|
27
|
+
"css-loader": "6.7.1",
|
|
28
|
+
"css-minimizer-webpack-plugin": "^5.0.0",
|
|
29
|
+
"eslint": "^8.4.1",
|
|
28
30
|
"execa": "^6.1.0",
|
|
29
31
|
"file-loader": "6.2.0",
|
|
30
|
-
"fs-extra": "^10.
|
|
32
|
+
"fs-extra": "^10.1.0",
|
|
31
33
|
"gitignore": "^0.7.0",
|
|
32
|
-
"inquirer": "^
|
|
34
|
+
"inquirer": "^9.1.1",
|
|
33
35
|
"listr": "^0.14.3",
|
|
34
|
-
"mini-css-extract-plugin": "2.
|
|
36
|
+
"mini-css-extract-plugin": "2.6.1",
|
|
35
37
|
"mustache": "^4.2.0",
|
|
36
38
|
"ncp": "^2.0.0",
|
|
37
|
-
"node-fetch": "^3.2.
|
|
38
|
-
"
|
|
39
|
+
"node-fetch": "^3.2.10",
|
|
40
|
+
"open": "^8.4.2",
|
|
41
|
+
"ora": "^6.1.2",
|
|
39
42
|
"pascalcase": "^2.0.0",
|
|
40
|
-
"postcss": "^8.4.
|
|
41
|
-
"postcss-loader": "
|
|
42
|
-
"postcss-preset-env": "7.
|
|
43
|
+
"postcss": "^8.4.16",
|
|
44
|
+
"postcss-loader": "7.0.1",
|
|
45
|
+
"postcss-preset-env": "7.8.2",
|
|
43
46
|
"prop-types": "^15.8.1",
|
|
44
|
-
"react": "^
|
|
45
|
-
"react-dev-utils": "^12.0.
|
|
46
|
-
"resolve": "1.22.
|
|
47
|
+
"react": "^18.2.0",
|
|
48
|
+
"react-dev-utils": "^12.0.1",
|
|
49
|
+
"resolve": "1.22.1",
|
|
47
50
|
"resolve-url-loader": "^5.0.0",
|
|
48
|
-
"sass-loader": "^
|
|
49
|
-
"terser-webpack-plugin": "5.3.
|
|
50
|
-
"ts-loader": "^9.
|
|
51
|
-
"typescript": "^4.
|
|
51
|
+
"sass-loader": "^13.0.2",
|
|
52
|
+
"terser-webpack-plugin": "5.3.6",
|
|
53
|
+
"ts-loader": "^9.3.1",
|
|
54
|
+
"typescript": "^4.8.3",
|
|
52
55
|
"url-loader": "4.1.1",
|
|
53
|
-
"webpack": "5.
|
|
56
|
+
"webpack": "5.76.1"
|
|
54
57
|
},
|
|
55
58
|
"author": "Custom component dev",
|
|
56
59
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -59,9 +62,8 @@
|
|
|
59
62
|
"custom-components"
|
|
60
63
|
],
|
|
61
64
|
"devDependencies": {
|
|
62
|
-
"@pega/configs": "^0.3
|
|
63
|
-
"cspell": "^
|
|
64
|
-
"
|
|
65
|
-
"prettier": "2.5.1"
|
|
65
|
+
"@pega/configs": "^0.5.3",
|
|
66
|
+
"cspell": "^6.9.0",
|
|
67
|
+
"prettier": "2.7.1"
|
|
66
68
|
}
|
|
67
69
|
}
|