@pega/custom-dx-components 25.1.10-alpha-0.13 → 25.1.10

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.
Files changed (66) hide show
  1. package/README.md +9 -2
  2. package/package.json +4 -4
  3. package/src/tasks/build-comp/index.js +1 -1
  4. package/src/tasks/build-jest-assets/index.js +1 -1
  5. package/src/tasks/build-lib/helper.js +1 -1
  6. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/config.json.mustache +146 -0
  7. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/demo.stories.tsx.mustache +61 -0
  8. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/demo.test.tsx.mustache +23 -0
  9. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/event-utils.ts.mustache +18 -0
  10. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/index.tsx.mustache +246 -0
  11. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/mock.ts.mustache +40 -0
  12. package/src/tasks/create/templates/Launchpad/Field/Text-Phone/styles.ts.mustache +8 -0
  13. package/src/tasks/create/templates/Launchpad/Template/FORM/DefaultForm.svg +29 -0
  14. package/src/tasks/create/templates/Launchpad/Template/FORM/DetailsRender.tsx.mustache +59 -0
  15. package/src/tasks/create/templates/Launchpad/Template/FORM/config.json.mustache +45 -0
  16. package/src/tasks/create/templates/Launchpad/Template/FORM/demo.stories.tsx.mustache +255 -0
  17. package/src/tasks/create/templates/Launchpad/Template/FORM/demo.test.tsx.mustache +40 -0
  18. package/src/tasks/create/templates/Launchpad/Template/FORM/index.tsx.mustache +75 -0
  19. package/src/tasks/create/templates/Launchpad/Template/FORM/mock.ts.mustache +135 -0
  20. package/src/tasks/create/templates/Launchpad/Template/FORM/styles.ts.mustache +8 -0
  21. package/src/tasks/create/templates/Launchpad/Template/FORM-region/DetailsRender.tsx.mustache +59 -0
  22. package/src/tasks/create/templates/Launchpad/Template/FORM-region/TwoColumn.svg +38 -0
  23. package/src/tasks/create/templates/Launchpad/Template/FORM-region/config.json.mustache +27 -0
  24. package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.stories.tsx.mustache +272 -0
  25. package/src/tasks/create/templates/Launchpad/Template/FORM-region/demo.test.tsx.mustache +56 -0
  26. package/src/tasks/create/templates/Launchpad/Template/FORM-region/index.tsx.mustache +80 -0
  27. package/src/tasks/create/templates/Launchpad/Template/FORM-region/mock.ts.mustache +141 -0
  28. package/src/tasks/create/templates/Launchpad/Template/FORM-region/styles.ts.mustache +8 -0
  29. package/src/tasks/create-lib/index.js +3 -3
  30. package/src/tasks/create-version/index.js +1 -1
  31. package/src/tasks/delete/helper.js +1 -1
  32. package/src/tasks/delete-all/helper.js +2 -2
  33. package/src/tasks/delete-pub/helper.js +3 -3
  34. package/src/tasks/delete-pub/index.js +3 -3
  35. package/src/tasks/export-archive/index.js +7 -7
  36. package/src/tasks/import-archive/helper.js +6 -6
  37. package/src/tasks/import-archive/index.js +8 -8
  38. package/src/tasks/import-comp/index.js +1 -1
  39. package/src/tasks/init/template/README.md +9 -2
  40. package/src/tasks/init/template/package.json.mustache +7 -7
  41. package/src/tasks/linter/index.js +1 -1
  42. package/src/tasks/list-lib/index.js +4 -4
  43. package/src/tasks/move/index.js +7 -7
  44. package/src/tasks/publish/index.js +17 -9
  45. package/src/tasks/publish-lib/index.js +11 -4
  46. package/src/tasks/rename/index.js +2 -2
  47. package/src/tasks/rename-lib/index.js +1 -1
  48. package/src/tasks/restore-config/index.js +1 -1
  49. package/src/tasks/show-help/index.js +12 -6
  50. package/src/tasks/switch-lib/index.js +2 -2
  51. package/src/tasks/switch-version/index.js +1 -1
  52. package/src/tasks/validator/index.js +2 -2
  53. package/src/util.js +23 -18
  54. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyForm/mock.ts +0 -4
  55. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/config.json +1 -6
  56. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyPhone/mock.ts +1 -6
  57. package/tests/assets/original/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/mock.ts +0 -4
  58. package/tests/assets/original/components/createAll/Constellation/shared/suggestions-handler.ts +0 -9
  59. package/tests/assets/original/components/createAll/Launchpad/shared/suggestions-handler.ts +0 -9
  60. /package/{tests/assets/original/components/create/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/PConnProps.d.ts.mustache} +0 -0
  61. /package/{tests/assets/original/components/create/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/create-nonce.ts.mustache} +0 -0
  62. /package/{tests/assets/original/components/create/shared/suggestions-handler.ts → src/tasks/create/templates/Launchpad/Field/Text-Phone/suggestions-handler.ts.mustache} +0 -0
  63. /package/{tests/assets/original/components/createAll/Launchpad/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Template/FORM/PConnProps.d.ts.mustache} +0 -0
  64. /package/{tests/assets/original/components/createAll/Launchpad/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Template/FORM/create-nonce.ts.mustache} +0 -0
  65. /package/{tests/assets/original/components/createAll/Constellation/shared/PConnProps.d.ts → src/tasks/create/templates/Launchpad/Template/FORM-region/PConnProps.d.ts.mustache} +0 -0
  66. /package/{tests/assets/original/components/createAll/Constellation/shared/create-nonce.ts → src/tasks/create/templates/Launchpad/Template/FORM-region/create-nonce.ts.mustache} +0 -0
@@ -0,0 +1,38 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="100px" height="70px" viewBox="0 0 100 70" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>2-col icon</title>
4
+ <g id="Views" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="Artboard-Copy-2" transform="translate(-198.000000, -207.000000)">
6
+ <g id="2-col--icon" transform="translate(198.000000, 207.000000)">
7
+ <rect id="bg" stroke="#A5A8BC" stroke-width="0.5" fill="#E7E9EB" x="0.25" y="0.25" width="99.5" height="69.5"></rect>
8
+ <g id="white" transform="translate(3.000000, 3.000000)" fill="#FFFFFF">
9
+ <rect id="Rectangle" x="0" y="0" width="94" height="66.5"></rect>
10
+ </g>
11
+ <g id="gray" transform="translate(6.000000, 6.000000)" fill="#8084A7">
12
+ <rect id="Rectangle" x="0" y="0" width="42" height="7.8"></rect>
13
+ <rect id="Rectangle-Copy-18" x="0" y="11.7" width="42" height="7.8"></rect>
14
+ <rect id="Rectangle-Copy-19" x="0" y="23.4" width="42" height="7.8"></rect>
15
+ <rect id="Rectangle-Copy-20" x="0" y="35.1" width="42" height="7.8"></rect>
16
+ <rect id="Rectangle-Copy-21" x="0" y="46.8" width="42" height="7.8"></rect>
17
+ <rect id="Rectangle-Copy-22" x="0" y="58.5" width="42" height="5"></rect>
18
+ <rect id="Rectangle-Copy" x="46" y="2.66453526e-15" width="42" height="7.8"></rect>
19
+ <rect id="Rectangle-Copy-27" x="46" y="11.7" width="42" height="7.8"></rect>
20
+ <rect id="Rectangle-Copy-26" x="46" y="23.4" width="42" height="7.8"></rect>
21
+ <rect id="Rectangle-Copy-25" x="46" y="35.1" width="42" height="7.8"></rect>
22
+ <rect id="Rectangle-Copy-24" x="46" y="46.8" width="42" height="7.8"></rect>
23
+ <rect id="Rectangle-Copy-23" x="46" y="58.5" width="42" height="5"></rect>
24
+ </g>
25
+ <g id="labels" transform="translate(16.000000, 11.000000)">
26
+ <circle id="Oval-Copy-3" fill="#FFFFFF" cx="10.5" cy="10.8076923" r="10.5"></circle>
27
+ <text id="A" font-family="OpenSans-Semibold, Open Sans" font-size="11" font-weight="500" fill="#56566F">
28
+ <tspan x="6.75" y="14">A</tspan>
29
+ </text>
30
+ <circle id="Oval-Copy-4" fill="#FFFFFF" cx="56.5" cy="10.8076923" r="10.5"></circle>
31
+ <text id="B" font-family="OpenSans-Semibold, Open Sans" font-size="11" font-weight="500" fill="#56566F">
32
+ <tspan x="52.75" y="14">B</tspan>
33
+ </text>
34
+ </g>
35
+ </g>
36
+ </g>
37
+ </g>
38
+ </svg>
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "{{COMPONENT_KEY}}",
3
+ "label": "{{COMPONENT_LABEL}}",
4
+ "description": "{{DESCRIPTION}}",
5
+ "organization": "{{ORGANIZATION}}",
6
+ "version": "{{VERSION}}",
7
+ "library": "{{LIBRARY}}",
8
+ "componentKey": "{{COMPONENT_KEY}}",
9
+ "type": "{{TYPE}}",
10
+ "subtype": {{{SUB_TYPE}}},
11
+ "subtypeLabel": "{{SUB_TYPE_LABEL}}",
12
+ "icon": "TwoColumn.svg",
13
+ "properties": [
14
+ {
15
+ "name": "A",
16
+ "label": "Region A",
17
+ "format": "CONTENTPICKER",
18
+ "allowCreatingGroup": true
19
+ },
20
+ {
21
+ "name": "B",
22
+ "label": "Region B",
23
+ "format": "CONTENTPICKER",
24
+ "allowCreatingGroup": true
25
+ }
26
+ ]
27
+ }
@@ -0,0 +1,272 @@
1
+ // @ts-nocheck
2
+ import { useState } from 'react';
3
+ import type { Meta, StoryObj } from '@storybook/react';
4
+
5
+ import {{COMPONENT_CLASS_NAME}} from './index';
6
+ import { DateInput, Input, FieldValueList, Text } from '@pega/cosmos-react-core';
7
+ import { PhoneInput as CosmosPhone } from '@pega/cosmos-react-core';
8
+ import { pyReviewRaw, regionChildrenResolved } from './mock';
9
+
10
+ const meta: Meta<typeof {{COMPONENT_CLASS_NAME}}> = {
11
+ title: '{{COMPONENT_CLASS_NAME}}',
12
+ component: {{COMPONENT_CLASS_NAME}},
13
+ excludeStories: /.*Data$/,
14
+ parameters: {
15
+ type: 'TwoColumnForm'
16
+ }
17
+ };
18
+
19
+ export default meta;
20
+ type Story = StoryObj<typeof {{COMPONENT_CLASS_NAME}}>;
21
+
22
+ const renderField = resolvedProps => {
23
+ const { displayMode, value = '', label = '', key, readOnly } = resolvedProps;
24
+
25
+ // eslint-disable-next-line react-hooks/rules-of-hooks
26
+ const [inputValue, setInputValue] = useState(value);
27
+ // eslint-disable-next-line react-hooks/rules-of-hooks
28
+ const [phoneValue, setPhoneValue] = useState('+16397975093');
29
+
30
+ const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
31
+
32
+ let val =
33
+ value !== '' ? (
34
+ <Text
35
+ variant='h1'
36
+ as='span'
37
+ key={key}
38
+ onChange={e => {
39
+ setInputValue(e.target.value);
40
+ }}
41
+ >
42
+ {inputValue}
43
+ </Text>
44
+ ) : (
45
+ ''
46
+ );
47
+
48
+ {{! pick new delimiters for mustache }}
49
+ {{=<% %>=}}
50
+
51
+ if (label === 'Service Date')
52
+ val = (
53
+ <DateInput
54
+ value={inputValue}
55
+ style={{ fontSize: '14px' }}
56
+ key={key}
57
+ onChange={dateVal => {
58
+ const { valueAsISOString: date } = dateVal;
59
+ const trimmedDate = date ? date.substring(0, date.indexOf('T')) : date;
60
+ setInputValue(trimmedDate);
61
+ }}
62
+ />
63
+ );
64
+
65
+ if (label === 'Email')
66
+ val = (
67
+ <Input
68
+ type='email'
69
+ value={inputValue}
70
+ style={{ fontSize: '14px' }}
71
+ key={key}
72
+ onChange={e => {
73
+ setInputValue(e.target.value);
74
+ }}
75
+ />
76
+ );
77
+
78
+ if (label === 'First Name' || label === 'Last Name' || label === 'Middle Name')
79
+ val = (
80
+ <Input
81
+ value={inputValue}
82
+ style={{ fontSize: '14px' }}
83
+ key={key}
84
+ onChange={e => {
85
+ setInputValue(e.target.value);
86
+ }}
87
+ />
88
+ );
89
+
90
+ if (label === 'Phone Number')
91
+ val = (
92
+ <CosmosPhone
93
+ value={phoneValue}
94
+ showCountryCode
95
+ style={{ fontSize: '14px' }}
96
+ key={key}
97
+ onChange={phoneVal => {
98
+ setPhoneValue(phoneVal);
99
+ }}
100
+ />
101
+ );
102
+
103
+ <%={{ }}=%> {{! revert delimiters for mustache }}
104
+
105
+ if (variant === 'inline') {
106
+ val = value || (
107
+ <span
108
+ aria-hidden='true'
109
+ key={key}
110
+ onChange={e => {
111
+ setInputValue(e.target.value);
112
+ }}
113
+ >
114
+ &ndash;&ndash;
115
+ </span>
116
+ );
117
+ } else {
118
+ val = (
119
+ <Text
120
+ variant='h1'
121
+ as='span'
122
+ key={key}
123
+ onChange={e => {
124
+ setInputValue(e.target.value);
125
+ }}
126
+ >
127
+ {val}
128
+ </Text>
129
+ );
130
+ }
131
+ if (readOnly) {
132
+ return {
133
+ getPConnect: () => {
134
+ return {
135
+ getRawMetadata: () => {
136
+ return {};
137
+ },
138
+ resolveConfigProps: props => {
139
+ return props;
140
+ },
141
+ getConfigProps: () => {
142
+ return {
143
+ value: '',
144
+ label: label,
145
+ displayMode: 'LABELS_LEFT'
146
+ };
147
+ },
148
+ getComponent: () => {
149
+ return val;
150
+ }
151
+ };
152
+ }
153
+ };
154
+ }
155
+ return (
156
+ <FieldValueList
157
+ variant={variant}
158
+ fields={[{ name: label, value: val }]}
159
+ key={key}
160
+ onChange={() => {
161
+ /* nothing */
162
+ }}
163
+ />
164
+ );
165
+ };
166
+
167
+ export const Base{{COMPONENT_CLASS_NAME}}: Story = args => {
168
+ const { readOnly } = args;
169
+
170
+ const props = {
171
+ readOnly: readOnly,
172
+ getPConnect: () => {
173
+ return {
174
+ getChildren: () => {
175
+ return pyReviewRaw.children;
176
+ },
177
+ getInheritedProps: () => {
178
+ return pyReviewRaw.config.inheritedProps;
179
+ },
180
+ createComponent: config => {
181
+ // eslint-disable-next-line default-case
182
+ switch (config.config.value) {
183
+ case '@P .FirstName':
184
+ return renderField({
185
+ ...regionChildrenResolved[0],
186
+ readOnly,
187
+ displayMode: readOnly ? 'LABELS_LEFT' : ''
188
+ });
189
+ case '@P .MiddleName':
190
+ return renderField({
191
+ ...regionChildrenResolved[1],
192
+ readOnly,
193
+ displayMode: readOnly ? 'LABELS_LEFT' : ''
194
+ });
195
+ case '@P .LastName':
196
+ return renderField({
197
+ ...regionChildrenResolved[2],
198
+ readOnly,
199
+ displayMode: readOnly ? 'LABELS_LEFT' : ''
200
+ });
201
+ case '@P .Email':
202
+ return renderField({
203
+ ...regionChildrenResolved[3],
204
+ readOnly,
205
+ displayMode: readOnly ? 'LABELS_LEFT' : ''
206
+ });
207
+ case '@P .PhoneNumber':
208
+ return renderField({
209
+ ...regionChildrenResolved[4],
210
+ readOnly,
211
+ displayMode: readOnly ? 'LABELS_LEFT' : ''
212
+ });
213
+ case '@P .ServiceDate':
214
+ return renderField({
215
+ ...regionChildrenResolved[5],
216
+ readOnly,
217
+ displayMode: readOnly ? 'LABELS_LEFT' : ''
218
+ });
219
+ }
220
+ }
221
+ };
222
+ }
223
+ };
224
+
225
+ const regionAChildren = readOnly
226
+ ? {
227
+ props: {
228
+ getPConnect: () => {
229
+ return {
230
+ getChildren: () => {
231
+ return pyReviewRaw.children[0].children.map(child => {
232
+ return props.getPConnect().createComponent(child);
233
+ });
234
+ }
235
+ };
236
+ }
237
+ }
238
+ }
239
+ : pyReviewRaw.children[0].children.map(child => {
240
+ return props.getPConnect().createComponent(child);
241
+ });
242
+
243
+ const regionBChildren = readOnly
244
+ ? {
245
+ props: {
246
+ getPConnect: () => {
247
+ return {
248
+ getChildren: () => {
249
+ return pyReviewRaw.children[1].children.map(child => {
250
+ return props.getPConnect().createComponent(child);
251
+ });
252
+ }
253
+ };
254
+ }
255
+ }
256
+ }
257
+ : pyReviewRaw.children[1].children.map(child => {
258
+ return props.getPConnect().createComponent(child);
259
+ });
260
+
261
+ return (
262
+ <{{COMPONENT_CLASS_NAME}} {...props} {...args}>
263
+ {[regionAChildren, regionBChildren]}
264
+ </{{COMPONENT_CLASS_NAME}}>
265
+ );
266
+ };
267
+
268
+ Base{{COMPONENT_CLASS_NAME}}.args = {
269
+ readOnly: false,
270
+ showLabel: true,
271
+ label: 'Form Region template',
272
+ };
@@ -0,0 +1,56 @@
1
+ // import { expect, test } from '@jest/globals';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { composeStories } from '@storybook/react';
4
+ import '@testing-library/jest-dom';
5
+
6
+ import * as DemoStories from './demo.stories';
7
+
8
+ const { Base{{COMPONENT_CLASS_NAME}} } = composeStories(DemoStories);
9
+
10
+ test('renders {{COMPONENT_CLASS_NAME}}', async () => {
11
+ render(<Base{{COMPONENT_CLASS_NAME}} />);
12
+ expect(await screen.findByText('Form Region template')).toBeVisible();
13
+
14
+ // labels
15
+ expect(await screen.findByText('First Name')).toBeVisible();
16
+ expect(await screen.findByText('Middle Name')).toBeVisible();
17
+ expect(await screen.findByText('Last Name')).toBeVisible();
18
+ expect(await screen.findByText('Email')).toBeVisible();
19
+ expect(await screen.findByText('Phone Number')).toBeVisible();
20
+ expect(await screen.findByText('Service Date')).toBeVisible();
21
+
22
+ const inputElements = screen.getAllByTestId(':input:control');
23
+ expect((inputElements[0] as HTMLInputElement).value).toBe('John');
24
+ expect((inputElements[1] as HTMLInputElement).value).toBe('');
25
+ expect((inputElements[2] as HTMLInputElement).value).toBe('Doe');
26
+ expect((inputElements[3] as HTMLInputElement).value).toBe('John@doe.com');
27
+
28
+ const myPhone = (screen.getByTestId(':phone-input:control') as HTMLInputElement).value;
29
+ expect(myPhone).toContain('(639) 797-5093');
30
+
31
+ const myClearMonth = (screen.getByTestId(':date-input:control-month') as HTMLInputElement).value;
32
+ expect(myClearMonth).toContain('01');
33
+
34
+ const myClearDay = (screen.getByTestId(':date-input:control-day') as HTMLInputElement).value;
35
+ expect(myClearDay).toContain('25');
36
+
37
+ const myClearYear = (screen.getByTestId(':date-input:control-year') as HTMLInputElement).value;
38
+ expect(myClearYear).toContain('2023');
39
+
40
+ // verify 2 columns
41
+ const fieldSet = screen.getByRole('group');
42
+
43
+ // <fieldset>
44
+ // <legend></legend>
45
+ // <div>
46
+ // <div>
47
+ // <div> 2 divs (columns) </div>
48
+ // </div>
49
+ // </div>
50
+ // </fieldset>
51
+
52
+ // eslint-disable-next-line testing-library/no-node-access
53
+ expect(fieldSet.children[1].children[0].children[0].children).toHaveLength(2);
54
+
55
+
56
+ });
@@ -0,0 +1,80 @@
1
+ import { Grid, Flex, FieldGroup, withConfiguration } from '@pega/cosmos-react-core';
2
+
3
+ import type { PConnFieldProps } from './PConnProps';
4
+ import './create-nonce';
5
+ import DetailsRender from './DetailsRender';
6
+
7
+ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
8
+
9
+ // interface for props
10
+ interface {{COMPONENT_CLASS_NAME}}Props extends PConnFieldProps {
11
+ // If any, enter additional props that only exist on TextInput here
12
+ showLabel: boolean;
13
+ children: any;
14
+ }
15
+
16
+ // props passed in combination of props from property panel (config.json) and run time props from Constellation
17
+ // any default values in config.pros should be set in defaultProps at bottom of this file
18
+ function {{COMPONENT_CLASS_NAME}}(props: {{COMPONENT_CLASS_NAME}}Props) {
19
+
20
+
21
+ const { children = [], label, showLabel, getPConnect, readOnly, displayMode } = props;
22
+ const propsToUse = { label, showLabel, ...getPConnect().getInheritedProps() };
23
+
24
+ const numRegions = children?.length;
25
+ const gridRepeat = "repeat(".concat(numRegions).concat(", 1fr)");
26
+ const gridContainer = {"colGap" : 6};
27
+ // @ts-ignore
28
+ gridContainer.cols = gridRepeat;
29
+ // @ts-ignore
30
+ gridContainer.alignItems = 'start';
31
+
32
+ const flexContainer = {direction: 'column'};
33
+ // @ts-ignore
34
+ flexContainer.gap = 2;
35
+
36
+ if (readOnly && readOnly === true || displayMode && displayMode === 'DISPLAY_ONLY') {
37
+ return (
38
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
39
+ {{! pick new delimiters for mustache }}
40
+ {{=<% %>=}}
41
+ <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
42
+ <Grid container={gridContainer} data-testid={`column-count-${numRegions}`}>
43
+ {children.map((child: any, i: number) => (
44
+ <Flex
45
+ // @ts-ignore
46
+ container={{ direction: 'column', alignItems: 'normal', colGap: 1, rowGap: 1.5 }}
47
+ key={`r-${i + 1}`}
48
+ >
49
+ <DetailsRender child={child} />
50
+ </Flex>
51
+ ))}
52
+ </Grid>
53
+ </FieldGroup>
54
+ <%={{ }}=%> {{! revert delimiters for mustache }}
55
+ </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
56
+ );
57
+ }
58
+
59
+ return (
60
+ <Styled{{COMPONENT_CLASS_NAME}}Wrapper>
61
+ {{! pick new delimiters for mustache }}
62
+ {{=<% %>=}}
63
+ <FieldGroup name={propsToUse.showLabel ? propsToUse.label : ''}>
64
+ <Grid container={gridContainer}>
65
+ {children.map((child: any, i: number) => (
66
+ // @ts-ignore
67
+ <Flex container={flexContainer} key={`r-${i + 1}`}>
68
+ {child}
69
+ </Flex>
70
+ ))}
71
+ </Grid>
72
+ </FieldGroup>
73
+ <%={{ }}=%> {{! revert delimiters for mustache }}
74
+ </Styled{{COMPONENT_CLASS_NAME}}Wrapper>
75
+ );
76
+
77
+ }
78
+
79
+
80
+ export default withConfiguration({{COMPONENT_CLASS_NAME}});
@@ -0,0 +1,141 @@
1
+
2
+ // @ts-nocheck
3
+ export const pyReviewRaw = {
4
+ name: 'CollectInformation',
5
+ type: 'View',
6
+ config: {
7
+ template: 'DefaultForm',
8
+ ruleClass: 'OM5W9U-SampleApp-Work-Test',
9
+ localeReference: '@LR OM5W9U-SAMPLEAPP-WORK-TEST!VIEW!COLLECTINFORMATION',
10
+ context: '@P .pyViewContext'
11
+ },
12
+ children: [
13
+ {
14
+ name: 'A',
15
+ type: 'Region',
16
+ children: [
17
+ {
18
+ type: 'TextInput',
19
+ config: {
20
+ value: '@P .FirstName',
21
+ label: '@L First Name',
22
+ key: 'FirstName'
23
+ }
24
+ },
25
+ {
26
+ type: 'TextInput',
27
+ config: {
28
+ value: '@P .MiddleName',
29
+ label: '@L Middle Name',
30
+ key: 'MiddleName'
31
+ }
32
+ },
33
+ {
34
+ type: 'TextInput',
35
+ config: {
36
+ value: '@P .LastName',
37
+ label: '@L Last Name',
38
+ key: 'LastName'
39
+ }
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ name: 'B',
45
+ type: 'Region',
46
+ children: [
47
+ {
48
+ type: 'Email',
49
+ config: {
50
+ value: '@P .Email',
51
+ label: '@L Email',
52
+ key: 'Email'
53
+ }
54
+ },
55
+ {
56
+ type: 'Phone',
57
+ config: {
58
+ value: '@P .PhoneNumber',
59
+ label: '@L Phone Number',
60
+ datasource: {
61
+ },
62
+ key: 'PhoneNumber'
63
+ }
64
+ },
65
+ {
66
+ type: 'Date',
67
+ config: {
68
+ value: '@P .ServiceDate',
69
+ label: '@L Service Date',
70
+ key: 'ServiceDate'
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ ],
76
+ classID: 'OM5W9U-SampleApp-Work-Test'
77
+ };
78
+
79
+ export const regionChildrenResolved = [
80
+ {
81
+ readOnly: undefined,
82
+ value: 'John',
83
+ label: 'First Name',
84
+ hasSuggestions: false,
85
+ key: 'First Name'
86
+ },
87
+ {
88
+ readOnly: undefined,
89
+ value: '',
90
+ label: 'Middle Name',
91
+ hasSuggestions: false,
92
+ key: 'Middle Name'
93
+ },
94
+ {
95
+ readOnly: undefined,
96
+ value: 'Doe',
97
+ label: 'Last Name',
98
+ hasSuggestions: false,
99
+ key: 'Last Name'
100
+ },
101
+ {
102
+ readOnly: undefined,
103
+ value: 'John@doe.com',
104
+ label: 'Email',
105
+ hasSuggestions: false,
106
+ key: 'Email'
107
+ },
108
+ {
109
+ readOnly: undefined,
110
+ value: '+16397975093',
111
+ label: 'Phone Number',
112
+ datasource: {
113
+ fields: {
114
+ value: undefined
115
+ },
116
+ source: [
117
+ {
118
+ value: '+1'
119
+ },
120
+ {
121
+ value: '+91'
122
+ },
123
+ {
124
+ value: '+48'
125
+ },
126
+ {
127
+ value: '+44'
128
+ }
129
+ ]
130
+ },
131
+ hasSuggestions: false,
132
+ key: 'Phone Number'
133
+ },
134
+ {
135
+ readOnly: undefined,
136
+ value: '2023-01-25',
137
+ label: 'Service Date',
138
+ hasSuggestions: false,
139
+ key: 'Service Date'
140
+ }
141
+ ];
@@ -0,0 +1,8 @@
1
+ // individual style, comment out above, and uncomment here and add styles
2
+ import styled, { css } from 'styled-components';
3
+
4
+ export default styled.div(() => {
5
+ return css`
6
+ margin: 0px 0;
7
+ `;
8
+ });
@@ -41,7 +41,7 @@ export default async options => {
41
41
  await showVersion();
42
42
  await cleanUpTemp();
43
43
 
44
- // if we have choosen to use INPUT CONFIG FILE
44
+ // if we have chosen to use INPUT CONFIG FILE
45
45
  // process and exit
46
46
  if (useInputConfig) {
47
47
  const inputConfig = await getInputConfigForCommand("createLib");
@@ -100,7 +100,7 @@ export default async options => {
100
100
  await zipVersionAndArchive(newOrgLib, version);
101
101
 
102
102
  // if didn't have an archive, in case you currently have components there
103
- // update the config jsons
103
+ // update the config json
104
104
  if (!hasArch) {
105
105
  await updateAllComponentsConfig(version);
106
106
  if (okToUpgrade) {
@@ -235,7 +235,7 @@ addDebugLog("createLibrary", "", "+");
235
235
  await zipVersionAndArchive(newOrgLib, version);
236
236
 
237
237
  // if didn't have an archive, in case you currently have components there
238
- // update the config jsons
238
+ // update the config json
239
239
 
240
240
 
241
241
  if (!hasArch) {
@@ -54,7 +54,7 @@ addDebugLog("createVersion", "", "+");
54
54
  const currentDirectory = process.cwd();
55
55
  const componentDirectory = join (currentDirectory, "src", "components");
56
56
 
57
- // if we have choosen to use INPUT CONFIG FILE
57
+ // if we have chosen to use INPUT CONFIG FILE
58
58
  // process and no inputs
59
59
  if (useInputConfig) {
60
60
  const inputConfig = await getInputConfigForCommand("createLibVersion");
@@ -97,7 +97,7 @@ addDebugLog("getLaunchPadFilterQuestions", "", "");
97
97
  }
98
98
 
99
99
  export const deleteLocalComponents = async (sourceOfComponents, options) => {
100
- addDebugLog("deleteLocalComponents", `sourceOfComponnents: ${sourceOfComponents}`, "" );
100
+ addDebugLog("deleteLocalComponents", `sourceOfComponents: ${sourceOfComponents}`, "" );
101
101
  const localComponents = await getComponents();
102
102
 
103
103
  if (localComponents.length > 0) {
@@ -92,7 +92,7 @@ addDebugLog("getLaunchPadFilterQuestions", "", "");
92
92
  }
93
93
 
94
94
  export const deleteLocalComponents = async (sourceOfComponents, options) => {
95
- addDebugLog("deleteLocalComponents", `sourceOfCompnents: ${sourceOfComponents}`, "");
95
+ addDebugLog("deleteLocalComponents", `sourceOfComponents: ${sourceOfComponents}`, "");
96
96
  const localComponents = await getComponents();
97
97
 
98
98
  // eslint-disable-next-line no-restricted-syntax, guard-for-in
@@ -136,7 +136,7 @@ addDebugLog("deleteLocalComponents", `sourceOfCompnents: ${sourceOfComponents}`,
136
136
  };
137
137
 
138
138
  export const deleteServerComponents = async (sourceOfComponents, answers) => {
139
- addDebugLog("deleteServerComponents", `sourceOfCompnents: ${sourceOfComponents}`, "");
139
+ addDebugLog("deleteServerComponents", `sourceOfComponents: ${sourceOfComponents}`, "");
140
140
  const defaultPegaServerConfig = await getPegaServerConfig();
141
141
  const isLaunchpad = defaultPegaServerConfig.serverType === 'launchpad';
142
142