@pega/custom-dx-components 2.0.24 → 2.0.25
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/README.md +1 -1
- package/package.json +3 -5
- package/src/cli.js +0 -18
- package/src/constants.js +2 -32
- package/src/tasks/authenticate/helper.js +8 -91
- package/src/tasks/authenticate/index.js +56 -125
- package/src/tasks/create/index.js +63 -59
- package/src/tasks/create/templates/Constellation/Field/Boolean/boolean-format.js.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Boolean/demo.stories.jsx.mustache +16 -33
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +2 -1
- package/src/tasks/create/templates/Constellation/Field/Date/date.js.mustache +67 -179
- package/src/tasks/create/templates/Constellation/Field/Date/demo.stories.jsx.mustache +17 -46
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +1 -3
- package/src/tasks/create/templates/Constellation/Field/DateTime/date-time.js.mustache +1 -0
- package/src/tasks/create/templates/Constellation/Field/DateTime/{date-utils.js.mustache → date-utils.js} +0 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/date.js.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Field/DateTime/demo.stories.jsx.mustache +17 -46
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +0 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal/demo.stories.jsx.mustache +17 -22
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/demo.stories.jsx.mustache +17 -26
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +4 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/demo.stories.jsx.mustache +17 -22
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +2 -8
- package/src/tasks/create/templates/Constellation/Field/Integer/demo.stories.jsx.mustache +17 -22
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +1 -2
- package/src/tasks/create/templates/Constellation/Field/Picklist/demo.stories.jsx.mustache +16 -50
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +1 -44
- package/src/tasks/create/templates/Constellation/Field/Picklist/picklist.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text/demo.stories.jsx.mustache +16 -23
- package/src/tasks/create/templates/Constellation/Field/Text-Email/demo.stories.jsx.mustache +17 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +2 -44
- package/src/tasks/create/templates/Constellation/Field/Text-Email/text-email.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/{StatusWork.jsx → StatusWork.js} +1 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Input/demo.stories.jsx.mustache +17 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +3 -46
- package/src/tasks/create/templates/Constellation/Field/Text-Input/text-input.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/demo.stories.jsx.mustache +17 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +2 -44
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/text-paragraph.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/demo.stories.jsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +3 -47
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/text-phone.js.mustache +43 -0
- package/src/tasks/create/templates/Constellation/Field/Text-URL/demo.stories.jsx.mustache +17 -19
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +1 -1
- package/src/tasks/create/templates/Constellation/Field/Text-URL/{text-url.jsx.mustache → text-url.js.mustache} +1 -2
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/demo.stories.jsx.mustache +17 -30
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/time-of-day.js.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +29 -14
- package/src/tasks/create/templates/Constellation/Template/DETAILS/utils.js.mustache +77 -3
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +29 -14
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/utils.js.mustache +74 -3
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +10 -6
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +8 -10
- package/src/tasks/create/templates/Constellation/Template/PAGE/{GetNextWork.jsx.mustache → GetNextWork.js.mustache} +0 -6
- package/src/tasks/create/templates/Constellation/Template/PAGE/index.jsx.mustache +7 -9
- package/src/tasks/create/templates/Constellation/Template/PAGE/utils.js.mustache +1 -4
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +0 -1
- package/src/tasks/create/templates/Constellation/Widget/PAGE/index.jsx.mustache +8 -8
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Avatar.jsx.mustache → Avatar.js.mustache} +0 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/{Operator.jsx.mustache → Operator.js.mustache} +1 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +9 -9
- package/src/tasks/delete/helper.js +0 -4
- package/src/tasks/delete/index.js +0 -4
- package/src/tasks/index.js +0 -3
- package/src/tasks/init/index.js +3 -3
- package/src/tasks/init/template/.eslintrc.json +5 -186
- package/src/tasks/init/template/README.md +59 -75
- package/src/tasks/init/template/package.json.mustache +6 -21
- package/src/tasks/init/template/tasks.config.json +4 -16
- package/src/tasks/list/index.js +0 -4
- package/src/tasks/{bundle → publish/bundle}/builder/webpack.config.js +2 -0
- package/src/tasks/{bundle → publish/bundle}/index.js +2 -2
- package/src/tasks/publish/index.js +1 -14
- package/src/util.js +6 -11
- package/src/auth.js +0 -573
- package/src/tasks/build/helper.js +0 -123
- package/src/tasks/build/index.js +0 -54
- package/src/tasks/create/templates/Constellation/Field/Boolean/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Date/DateFormatter.js.mustache +0 -61
- package/src/tasks/create/templates/Constellation/Field/Date/FormattedText.jsx.mustache +0 -41
- package/src/tasks/create/templates/Constellation/Field/Date/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Field/DateTime/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Field/Decimal/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Integer/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Picklist/mock.stories.js.mustache +0 -67
- package/src/tasks/create/templates/Constellation/Field/Text/mock.stories.js.mustache +0 -13
- package/src/tasks/create/templates/Constellation/Field/Text-Email/mock.stories.js.mustache +0 -22
- package/src/tasks/create/templates/Constellation/Field/Text-Input/mock.stories.js.mustache +0 -21
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/mock.stories.js.mustache +0 -20
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/mock.stories.js.mustache +0 -37
- package/src/tasks/create/templates/Constellation/Field/Text-URL/mock.stories.js.mustache +0 -22
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/mock.stories.js.mustache +0 -20
- package/src/tasks/create/templates/Constellation/Template/DETAILS/StatusWork.jsx.mustache +0 -26
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +0 -118
- package/src/tasks/create/templates/Constellation/Template/DETAILS/mock.stories.js.mustache +0 -179
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/StatusWork.jsx.mustache +0 -26
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +0 -123
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/mock.stories.js.mustache +0 -215
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +0 -93
- package/src/tasks/create/templates/Constellation/Template/FORM/mock.stories.js.mustache +0 -125
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +0 -100
- package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache +0 -131
- package/src/tasks/create/templates/Constellation/Template/PAGE/demo.stories.jsx.mustache +0 -101
- package/src/tasks/create/templates/Constellation/Template/PAGE/mock.stories.js.mustache +0 -94
- package/src/tasks/create/templates/Constellation/Widget/CASE/demo.stories.jsx.mustache +0 -78
- package/src/tasks/create/templates/Constellation/Widget/CASE/mock.stories.js.mustache +0 -390
- package/src/tasks/create/templates/Constellation/Widget/PAGE/demo.stories.jsx.mustache +0 -30
- package/src/tasks/create/templates/Constellation/Widget/PAGE/mock.stories.js.mustache +0 -23
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/demo.stories.jsx.mustache +0 -68
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/mock.stories.js.mustache +0 -51
- package/src/tasks/delete-all/helper.js +0 -175
- package/src/tasks/delete-all/index.js +0 -49
- package/src/tasks/init/template/.eslintignore +0 -8
- package/src/tasks/linter/index.js +0 -46
- package/src/tasks/publish-all/helper.js +0 -139
- package/src/tasks/publish-all/index.js +0 -84
- /package/src/tasks/{bundle → publish/bundle}/builder/index.js +0 -0
- /package/src/tasks/{bundle → publish/bundle}/builder/modules.js +0 -0
- /package/src/tasks/{bundle → publish/bundle}/builder/paths.js +0 -0
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
|
-
|
|
3
|
-
import {{COMPONENT_CLASS_NAME}} from './index.jsx';
|
|
4
|
-
import { DateInput, Input, FieldValueList, Text } from '@pega/cosmos-react-core';
|
|
5
|
-
import { PhoneInput as CosmosPhone } from '@pega/cosmos-react-core';
|
|
6
|
-
import { pyReviewRaw, regionChildrenResolved } from './mock.stories';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: '{{COMPONENT_CLASS_NAME}}',
|
|
10
|
-
decorators: [withKnobs],
|
|
11
|
-
component: {{COMPONENT_CLASS_NAME}}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const renderField = resolvedProps => {
|
|
15
|
-
const { displayMode, value = '', label = '' } = resolvedProps;
|
|
16
|
-
|
|
17
|
-
const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
|
|
18
|
-
|
|
19
|
-
let val =
|
|
20
|
-
value !== '' ? (
|
|
21
|
-
<Text variant='h1' as='span'>
|
|
22
|
-
{value}
|
|
23
|
-
</Text>
|
|
24
|
-
) : (
|
|
25
|
-
''
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
{{! pick new delimiteres for mustache }}
|
|
29
|
-
{{=<% %>=}}
|
|
30
|
-
|
|
31
|
-
if (label === 'Service Date') val = <DateInput value={value} style={{ fontSize: '14px' }}></DateInput>;
|
|
32
|
-
|
|
33
|
-
if (label === 'Email') val = <Input type='email' value={value} style={{ fontSize: '14px' }}></Input>;
|
|
34
|
-
|
|
35
|
-
if (label === 'First Name' || label === 'Last Name' || label === 'Middle Name')
|
|
36
|
-
val = <Input value={value} style={{ fontSize: '14px' }}></Input>;
|
|
37
|
-
|
|
38
|
-
if (label === 'Phone Number') val = <CosmosPhone value={value} style={{ fontSize: '14px' }}></CosmosPhone>;
|
|
39
|
-
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
40
|
-
|
|
41
|
-
if (variant === 'inline') {
|
|
42
|
-
val = value || <span aria-hidden='true'>––</span>;
|
|
43
|
-
} else {
|
|
44
|
-
val = (
|
|
45
|
-
<Text variant='h1' as='span'>
|
|
46
|
-
{val}
|
|
47
|
-
</Text>
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
return <FieldValueList variant={variant} fields={[{ name: label, value: val }]} />;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export const base{{COMPONENT_CLASS_NAME}} = () => {
|
|
55
|
-
const props = {
|
|
56
|
-
NumCols: 1,
|
|
57
|
-
template: 'DefaultForm',
|
|
58
|
-
getPConnect: () => {
|
|
59
|
-
return {
|
|
60
|
-
getChildren: () => {
|
|
61
|
-
return pyReviewRaw.children;
|
|
62
|
-
},
|
|
63
|
-
createComponent: config => {
|
|
64
|
-
// eslint-disable-next-line default-case
|
|
65
|
-
switch (config.config.value) {
|
|
66
|
-
case '@P .FirstName':
|
|
67
|
-
return renderField(regionChildrenResolved[0]);
|
|
68
|
-
case '@P .MiddleName':
|
|
69
|
-
return renderField(regionChildrenResolved[1]);
|
|
70
|
-
case '@P .LastName':
|
|
71
|
-
return renderField(regionChildrenResolved[2]);
|
|
72
|
-
case '@P .Email':
|
|
73
|
-
return renderField(regionChildrenResolved[3]);
|
|
74
|
-
case '@P .PhoneNumber':
|
|
75
|
-
return renderField(regionChildrenResolved[4]);
|
|
76
|
-
case '@P .ServiceDate':
|
|
77
|
-
return renderField(regionChildrenResolved[5]);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const regionAChildren = pyReviewRaw.children[0].children.map(child => {
|
|
85
|
-
return props.getPConnect().createComponent(child);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<>
|
|
90
|
-
<{{COMPONENT_CLASS_NAME}} {...props}>{regionAChildren}</{{COMPONENT_CLASS_NAME}}>
|
|
91
|
-
</>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
export const pyReviewRaw = {
|
|
2
|
-
name: 'CollectInformation',
|
|
3
|
-
type: 'View',
|
|
4
|
-
config: {
|
|
5
|
-
template: 'DefaultForm',
|
|
6
|
-
ruleClass: 'OM5W9U-SampleApp-Work-Test',
|
|
7
|
-
localeReference: '@LR OM5W9U-SAMPLEAPP-WORK-TEST!VIEW!COLLECTINFORMATION',
|
|
8
|
-
context: '@P .pyViewContext'
|
|
9
|
-
},
|
|
10
|
-
children: [
|
|
11
|
-
{
|
|
12
|
-
name: 'Fields',
|
|
13
|
-
type: 'Region',
|
|
14
|
-
children: [
|
|
15
|
-
{
|
|
16
|
-
type: 'TextInput',
|
|
17
|
-
config: {
|
|
18
|
-
value: '@P .FirstName',
|
|
19
|
-
label: '@L First Name'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: 'TextInput',
|
|
24
|
-
config: {
|
|
25
|
-
value: '@P .MiddleName',
|
|
26
|
-
label: '@L Middle Name'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
type: 'TextInput',
|
|
31
|
-
config: {
|
|
32
|
-
value: '@P .LastName',
|
|
33
|
-
label: '@L Last Name'
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
type: 'Email',
|
|
38
|
-
config: {
|
|
39
|
-
value: '@P .Email',
|
|
40
|
-
label: '@L Email'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
type: 'Phone',
|
|
45
|
-
config: {
|
|
46
|
-
value: '@P .PhoneNumber',
|
|
47
|
-
label: '@L Phone Number',
|
|
48
|
-
datasource: {
|
|
49
|
-
source: '@DATASOURCE D_pyCountryCallingCodeList.pxResults',
|
|
50
|
-
fields: {
|
|
51
|
-
value: '@P .pyCallingCode'
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
type: 'Date',
|
|
58
|
-
config: {
|
|
59
|
-
value: '@P .ServiceDate',
|
|
60
|
-
label: '@L Service Date'
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
classID: 'OM5W9U-SampleApp-Work-Test'
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const regionChildrenResolved = [
|
|
70
|
-
{
|
|
71
|
-
readOnly: undefined,
|
|
72
|
-
value: 'John',
|
|
73
|
-
label: 'First Name',
|
|
74
|
-
hasSuggestions: false
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
readOnly: undefined,
|
|
78
|
-
value: '',
|
|
79
|
-
label: 'Middle Name',
|
|
80
|
-
hasSuggestions: false
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
readOnly: undefined,
|
|
84
|
-
value: 'Doe',
|
|
85
|
-
label: 'Last Name',
|
|
86
|
-
hasSuggestions: false
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
readOnly: undefined,
|
|
90
|
-
value: 'John@doe.com',
|
|
91
|
-
label: 'Email',
|
|
92
|
-
hasSuggestions: false
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
readOnly: undefined,
|
|
96
|
-
value: '+16397975093',
|
|
97
|
-
label: 'Phone Number',
|
|
98
|
-
datasource: {
|
|
99
|
-
fields: {
|
|
100
|
-
value: undefined
|
|
101
|
-
},
|
|
102
|
-
source: [
|
|
103
|
-
{
|
|
104
|
-
value: '+1'
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
value: '+91'
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
value: '+48'
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
value: '+44'
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
hasSuggestions: false
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
readOnly: undefined,
|
|
121
|
-
value: '2023-01-25',
|
|
122
|
-
label: 'Service Date',
|
|
123
|
-
hasSuggestions: false
|
|
124
|
-
}
|
|
125
|
-
];
|
package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
|
-
|
|
3
|
-
import {{COMPONENT_CLASS_NAME}} from './index.jsx';
|
|
4
|
-
import { DateInput, Input, FieldValueList, Text } from '@pega/cosmos-react-core';
|
|
5
|
-
import { PhoneInput as CosmosPhone } from '@pega/cosmos-react-core';
|
|
6
|
-
import { pyReviewRaw, regionChildrenResolved } from './mock.stories';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: '{{COMPONENT_CLASS_NAME}}',
|
|
10
|
-
decorators: [withKnobs],
|
|
11
|
-
component: {{COMPONENT_CLASS_NAME}}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const renderField = resolvedProps => {
|
|
15
|
-
const { displayMode, value = '', label = '' } = resolvedProps;
|
|
16
|
-
|
|
17
|
-
const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
|
|
18
|
-
|
|
19
|
-
let val =
|
|
20
|
-
value !== '' ? (
|
|
21
|
-
<Text variant='h1' as='span'>
|
|
22
|
-
{value}
|
|
23
|
-
</Text>
|
|
24
|
-
) : (
|
|
25
|
-
''
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
{{! pick new delimiteres for mustache }}
|
|
29
|
-
{{=<% %>=}}
|
|
30
|
-
|
|
31
|
-
if (label === 'Service Date')
|
|
32
|
-
val = <DateInput value={value} style={{ fontSize: '14px' }}></DateInput>;
|
|
33
|
-
|
|
34
|
-
if (label === 'Email')
|
|
35
|
-
val = <Input type='email' value={value} style={{ fontSize: '14px' }}></Input>;
|
|
36
|
-
|
|
37
|
-
if (label === 'First Name' || label === 'Last Name' || label === 'Middle Name')
|
|
38
|
-
val = <Input value={value} style={{ fontSize: '14px' }}></Input>;
|
|
39
|
-
|
|
40
|
-
if (label === 'Phone Number')
|
|
41
|
-
val = <CosmosPhone value={value} style={{ fontSize: '14px' }}></CosmosPhone>;
|
|
42
|
-
|
|
43
|
-
<%={{ }}=%> {{! revert delimiteres for mustache }}
|
|
44
|
-
|
|
45
|
-
if (variant === 'inline') {
|
|
46
|
-
val = value || <span aria-hidden='true'>––</span>;
|
|
47
|
-
} else {
|
|
48
|
-
val = (
|
|
49
|
-
<Text variant='h1' as='span'>
|
|
50
|
-
{val}
|
|
51
|
-
</Text>
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
return <FieldValueList variant={variant} fields={[{ name: label, value: val }]} />;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export const base{{COMPONENT_CLASS_NAME}} = () => {
|
|
59
|
-
const props = {
|
|
60
|
-
template: 'DefaultForm',
|
|
61
|
-
getPConnect: () => {
|
|
62
|
-
return {
|
|
63
|
-
getChildren: () => {
|
|
64
|
-
return pyReviewRaw.children;
|
|
65
|
-
},
|
|
66
|
-
createComponent: config => {
|
|
67
|
-
// eslint-disable-next-line default-case
|
|
68
|
-
switch (config.config.value) {
|
|
69
|
-
case '@P .FirstName':
|
|
70
|
-
return renderField(regionChildrenResolved[0]);
|
|
71
|
-
case '@P .MiddleName':
|
|
72
|
-
return renderField(regionChildrenResolved[1]);
|
|
73
|
-
case '@P .LastName':
|
|
74
|
-
return renderField(regionChildrenResolved[2]);
|
|
75
|
-
case '@P .Email':
|
|
76
|
-
return renderField(regionChildrenResolved[3]);
|
|
77
|
-
case '@P .PhoneNumber':
|
|
78
|
-
return renderField(regionChildrenResolved[4]);
|
|
79
|
-
case '@P .ServiceDate':
|
|
80
|
-
return renderField(regionChildrenResolved[5]);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const regionAChildren = pyReviewRaw.children[0].children.map(child => {
|
|
88
|
-
return props.getPConnect().createComponent(child);
|
|
89
|
-
});
|
|
90
|
-
const regionBChildren = pyReviewRaw.children[1].children.map(child => {
|
|
91
|
-
return props.getPConnect().createComponent(child);
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<{{COMPONENT_CLASS_NAME}} {...props}>
|
|
96
|
-
{regionAChildren}
|
|
97
|
-
{regionBChildren}
|
|
98
|
-
</{{COMPONENT_CLASS_NAME}}>
|
|
99
|
-
);
|
|
100
|
-
};
|
package/src/tasks/create/templates/Constellation/Template/FORM-region/mock.stories.js.mustache
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
export const pyReviewRaw = {
|
|
2
|
-
name: 'CollectInformation',
|
|
3
|
-
type: 'View',
|
|
4
|
-
config: {
|
|
5
|
-
template: 'DefaultForm',
|
|
6
|
-
ruleClass: 'OM5W9U-SampleApp-Work-Test',
|
|
7
|
-
localeReference: '@LR OM5W9U-SAMPLEAPP-WORK-TEST!VIEW!COLLECTINFORMATION',
|
|
8
|
-
context: '@P .pyViewContext'
|
|
9
|
-
},
|
|
10
|
-
children: [
|
|
11
|
-
{
|
|
12
|
-
name: 'A',
|
|
13
|
-
type: 'Region',
|
|
14
|
-
children: [
|
|
15
|
-
{
|
|
16
|
-
type: 'TextInput',
|
|
17
|
-
config: {
|
|
18
|
-
value: '@P .FirstName',
|
|
19
|
-
label: '@L First Name'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: 'TextInput',
|
|
24
|
-
config: {
|
|
25
|
-
value: '@P .MiddleName',
|
|
26
|
-
label: '@L Middle Name'
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
type: 'TextInput',
|
|
31
|
-
config: {
|
|
32
|
-
value: '@P .LastName',
|
|
33
|
-
label: '@L Last Name'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'B',
|
|
40
|
-
type: 'Region',
|
|
41
|
-
children: [
|
|
42
|
-
{
|
|
43
|
-
type: 'Email',
|
|
44
|
-
config: {
|
|
45
|
-
value: '@P .Email',
|
|
46
|
-
label: '@L Email'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
type: 'Phone',
|
|
51
|
-
config: {
|
|
52
|
-
value: '@P .PhoneNumber',
|
|
53
|
-
label: '@L Phone Number',
|
|
54
|
-
datasource: {
|
|
55
|
-
source: '@DATASOURCE D_pyCountryCallingCodeList.pxResults',
|
|
56
|
-
fields: {
|
|
57
|
-
value: '@P .pyCallingCode'
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
type: 'Date',
|
|
64
|
-
config: {
|
|
65
|
-
value: '@P .ServiceDate',
|
|
66
|
-
label: '@L Service Date'
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
classID: 'OM5W9U-SampleApp-Work-Test'
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export const regionChildrenResolved = [
|
|
76
|
-
{
|
|
77
|
-
readOnly: undefined,
|
|
78
|
-
value: 'John',
|
|
79
|
-
label: 'First Name',
|
|
80
|
-
hasSuggestions: false
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
readOnly: undefined,
|
|
84
|
-
value: '',
|
|
85
|
-
label: 'Middle Name',
|
|
86
|
-
hasSuggestions: false
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
readOnly: undefined,
|
|
90
|
-
value: 'Doe',
|
|
91
|
-
label: 'Last Name',
|
|
92
|
-
hasSuggestions: false
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
readOnly: undefined,
|
|
96
|
-
value: 'John@doe.com',
|
|
97
|
-
label: 'Email',
|
|
98
|
-
hasSuggestions: false
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
readOnly: undefined,
|
|
102
|
-
value: '+16397975093',
|
|
103
|
-
label: 'Phone Number',
|
|
104
|
-
datasource: {
|
|
105
|
-
fields: {
|
|
106
|
-
value: undefined
|
|
107
|
-
},
|
|
108
|
-
source: [
|
|
109
|
-
{
|
|
110
|
-
value: '+1'
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
value: '+91'
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
value: '+48'
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
value: '+44'
|
|
120
|
-
}
|
|
121
|
-
]
|
|
122
|
-
},
|
|
123
|
-
hasSuggestions: false
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
readOnly: undefined,
|
|
127
|
-
value: '2023-01-25',
|
|
128
|
-
label: 'Service Date',
|
|
129
|
-
hasSuggestions: false
|
|
130
|
-
}
|
|
131
|
-
];
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { withKnobs } from '@storybook/addon-knobs';
|
|
2
|
-
|
|
3
|
-
import { AppAnnouncement as PegaAppAnnouncement } from '@pega/cosmos-react-work';
|
|
4
|
-
|
|
5
|
-
import {{COMPONENT_CLASS_NAME}} from './index.jsx';
|
|
6
|
-
import { pyHome1Resolved, pyHome1Raw } from './mock.stories.js';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: '{{COMPONENT_CLASS_NAME}}',
|
|
10
|
-
decorators: [withKnobs],
|
|
11
|
-
component: {{COMPONENT_CLASS_NAME}}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const base{{COMPONENT_CLASS_NAME}} = () => {
|
|
15
|
-
if (!window.PCore) {
|
|
16
|
-
window.PCore = {};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
window.PCore.getLocaleUtils = () => {
|
|
20
|
-
return {
|
|
21
|
-
getLocaleValue: val => {
|
|
22
|
-
return val;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const configProps = pyHome1Resolved.children[0].children[0].config;
|
|
28
|
-
|
|
29
|
-
const props = {
|
|
30
|
-
useConfigurableLayout: false,
|
|
31
|
-
enableGetNextWork: pyHome1Raw.config.enableGetNextWork,
|
|
32
|
-
icon: pyHome1Raw.config.icon,
|
|
33
|
-
title: 'Page Template',
|
|
34
|
-
|
|
35
|
-
getPConnect: () => {
|
|
36
|
-
return {
|
|
37
|
-
getStateProps: () => {
|
|
38
|
-
return {};
|
|
39
|
-
},
|
|
40
|
-
getActionsApi: () => {
|
|
41
|
-
return {
|
|
42
|
-
getNextWork: () => {
|
|
43
|
-
return new Promise(resolve => {
|
|
44
|
-
resolve({});
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
updateFieldValue: () => {/* nothing */},
|
|
48
|
-
triggerFieldChange: () => {/* nothing */}
|
|
49
|
-
};
|
|
50
|
-
},
|
|
51
|
-
getChildren: () => {
|
|
52
|
-
return pyHome1Raw.children;
|
|
53
|
-
},
|
|
54
|
-
getComponentName: () => {
|
|
55
|
-
return '';
|
|
56
|
-
},
|
|
57
|
-
getLocalizedValue: value => {
|
|
58
|
-
return value;
|
|
59
|
-
},
|
|
60
|
-
getRawMetadata: () => {
|
|
61
|
-
return pyHome1Raw;
|
|
62
|
-
},
|
|
63
|
-
createComponent: config => {
|
|
64
|
-
if (config.type === 'AppAnnouncement') {
|
|
65
|
-
return (
|
|
66
|
-
<PegaAppAnnouncement
|
|
67
|
-
heading='Announcements'
|
|
68
|
-
description={configProps.description}
|
|
69
|
-
whatsNewLink={configProps.whatsnewlink}
|
|
70
|
-
image={configProps.image.replace(/ /g, '+')}
|
|
71
|
-
datasource={configProps.datasource}
|
|
72
|
-
label={configProps.label}
|
|
73
|
-
getPConnect={() => {
|
|
74
|
-
return {
|
|
75
|
-
getChildren: () => {
|
|
76
|
-
return pyHome1Resolved.children;
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}}
|
|
80
|
-
/>
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
ignoreSuggestion: () => {/* nothing */},
|
|
85
|
-
acceptSuggestion: () => {/* nothing */},
|
|
86
|
-
setInheritedProps: () => {/* nothing */},
|
|
87
|
-
resolveConfigProps: () => {/* nothing */}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
const regionAChildren = pyHome1Raw.children[0].children.map(child => {
|
|
93
|
-
return props.getPConnect().createComponent(child);
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
<>
|
|
98
|
-
<{{COMPONENT_CLASS_NAME}} {...props}>{regionAChildren}</{{COMPONENT_CLASS_NAME}}>
|
|
99
|
-
</>
|
|
100
|
-
);
|
|
101
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
export const pyHome1Raw = {
|
|
2
|
-
name: 'pyHome1',
|
|
3
|
-
type: 'View',
|
|
4
|
-
config: {
|
|
5
|
-
type: 'landingpage',
|
|
6
|
-
template: 'OneColumnPage',
|
|
7
|
-
icon: 'home-solid',
|
|
8
|
-
title: '@ENV APPLICATION_DESC',
|
|
9
|
-
ruleClass: 'DIXL-MediaCo-UIPages',
|
|
10
|
-
localeReference: '@LR DIXL-MEDIACO-UIPAGES!PAGE!PYHOME1',
|
|
11
|
-
enableGetNextWork: true,
|
|
12
|
-
context: 'pyPortal'
|
|
13
|
-
},
|
|
14
|
-
children: [
|
|
15
|
-
{
|
|
16
|
-
name: 'A',
|
|
17
|
-
type: 'Region',
|
|
18
|
-
children: [
|
|
19
|
-
{
|
|
20
|
-
type: 'AppAnnouncement',
|
|
21
|
-
config: {
|
|
22
|
-
label: '@L App announcement',
|
|
23
|
-
description:
|
|
24
|
-
"We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos.",
|
|
25
|
-
whatsnewlink: 'https://design.pega.com',
|
|
26
|
-
image:
|
|
27
|
-
'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI+PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uNjNBNC4zMiA0LjMyIDAgMCAwIDIzLjMxIDIgMy4xNyAzLjE3IDAgMCAwIDIwIDUuMjdhMy4xNiAzLjE2IDAgMCAwIDEgMi4zOSAzLjA3IDMuMDcgMCAwIDAgMi4xNy44NCA0LjYgNC42IDAgMCAwIDIuMDktLjVWNi4xOWgtMi4yVjQuMzhoNC4yNXY0LjU2YTUuNDEgNS40MSAwIDAgMS00LjA4IDEuNTdBNS4zNSA1LjM1IDAgMCAxIDE5LjQzIDlhNS4wNSA1LjA1IDAgMCAxLTEuNTYtMy43NCA1LjIxIDUuMjEgMCAwIDEgMS41Ni0zLjc2QTUuMzEgNS4zMSAwIDAgMSAyMy4xOCAwem0xMS4yOS40Mmw0LjEzIDkuNzloLTIuMjVMMzUuNDggOGgtNC4wNmwtLjkgMi4xOGgtMi4yTDMyLjUxLjQyem0uMjUgNS43MkwzMy40NCAzbC0xLjI5IDMuMTR6bTMtNWEuNzEuNzEgMCAwIDEtLjc0Ljc1LjcxLjcxIDAgMCAxLS43My0uNzUuNzMuNzMgMCAwIDEgLjc1LS43Mi43Mi43MiAwIDAgMSAuNzUuNzF6TTM3IC41M2EuNTkuNTkgMCAwIDAtLjYuNi42MS42MSAwIDEgMCAxLjIxIDAgLjYuNiAwIDAgMC0uNjEtLjZ6bS0uMjQgMVYuNzFIMzdjLjEyIDAgLjE4LjA2LjI1LjA2YS4yMS4yMSAwIDAgMSAuMDcuMTguMTkuMTkgMCAwIDEtLjA3LjE4cy0uMDcuMDgtLjEzLjA4bC4yNi4zNmgtLjJMMzcgMS4yOGgtLjF2LjI5em0uMTMtLjQ0aC4yM2EuMjYuMjYgMCAwIDAgLjA3LS4wOWgtLjA2Yy0uMDUtLjE3LS4wNS0uMTctLjEzLS4xN2gtLjF6Ii8+PC9zdmc+',
|
|
28
|
-
datasource: {
|
|
29
|
-
source: '@DATASOURCE D_pyAnnouncements.pxResults',
|
|
30
|
-
fields: {
|
|
31
|
-
name: '@P .pyLabel'
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
classID: 'DIXL-MediaCo-UIPages'
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const pyHome1Resolved = {
|
|
43
|
-
name: 'pyHome1',
|
|
44
|
-
type: 'View',
|
|
45
|
-
config: {
|
|
46
|
-
type: 'landingpage',
|
|
47
|
-
template: 'OneColumnPage',
|
|
48
|
-
icon: 'home-solid',
|
|
49
|
-
title: '@ENV APPLICATION_DESC',
|
|
50
|
-
ruleClass: 'DIXL-MediaCo-UIPages',
|
|
51
|
-
localeReference: '@LR DIXL-MEDIACO-UIPAGES!PAGE!PYHOME1',
|
|
52
|
-
enableGetNextWork: true,
|
|
53
|
-
context: 'pyPortal'
|
|
54
|
-
},
|
|
55
|
-
children: [
|
|
56
|
-
{
|
|
57
|
-
name: 'A',
|
|
58
|
-
type: 'Region',
|
|
59
|
-
getPConnect: () => {
|
|
60
|
-
return {
|
|
61
|
-
getComponentName: () => {
|
|
62
|
-
return '';
|
|
63
|
-
},
|
|
64
|
-
getComponent: () => {
|
|
65
|
-
return pyHome1Resolved.children[0];
|
|
66
|
-
},
|
|
67
|
-
getConfigProps: () => {
|
|
68
|
-
return {};
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
},
|
|
72
|
-
children: [
|
|
73
|
-
{
|
|
74
|
-
type: 'AppAnnouncement',
|
|
75
|
-
config: {
|
|
76
|
-
label: '@L App announcement',
|
|
77
|
-
description:
|
|
78
|
-
"We've launched a brand new experience to accelerate your workflow. Check out the guides to help you get the most of Cosmos.",
|
|
79
|
-
whatsnewlink: 'https://design.pega.com',
|
|
80
|
-
image:
|
|
81
|
-
'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzOSAxMSI+PHRpdGxlPlBlZ2EgdGV4dC1vbmx5IGxvZ288L3RpdGxlPjxwYXRoIHN0eWxlPSJmaWxsLW9wYWNpdHk6IC4yNTsiIGZpbGw9IiNmZmYiIGQ9Ik03LjcyIDMuODJjMCAyLjI1LTEuNzggMy40MS00IDMuNDFoLTEuNnYzSDBWLjQyaDMuOTRjMi4zNiAwIDMuNzggMS4zOSAzLjc4IDMuNHptLTQtMS40N2gtMS42djNoMS43QTEuNDcgMS40NyAwIDAgMCA1LjUgMy44MmMwLS45MS0uNjUtMS40Ny0xLjc1LTEuNDd6bTcuNjggNS45MWg1LjN2Mkg5LjI5Vi40Mmg3LjM4djEuOTNoLTUuMjR2Mmg0LjI0djEuOWgtNC4yNHpNMjMuMTggMGE1IDUgMCAwIDEgMy41NyAxLjI4TDI1LjYzIDIuOGEzLjc4IDMuNzggMCAwIDAtMS4wNS0uNjNBNC4zMiA0LjMyIDAgMCAwIDIzLjMxIDIgMy4xNyAzLjE3IDAgMCAwIDIwIDUuMjdhMy4xNiAzLjE2IDAgMCAwIDEgMi4zOSAzLjA3IDMuMDcgMCAwIDAgMi4xNy44NCA0LjYgNC42IDAgMCAwIDIuMDktLjVWNi4xOWgtMi4yVjQuMzhoNC4yNXY0LjU2YTUuNDEgNS40MSAwIDAgMS00LjA4IDEuNTdBNS4zNSA1LjM1IDAgMCAxIDE5LjQzIDlhNS4wNSA1LjA1IDAgMCAxLTEuNTYtMy43NCA1LjIxIDUuMjEgMCAwIDEgMS41Ni0zLjc2QTUuMzEgNS4zMSAwIDAgMSAyMy4xOCAwem0xMS4yOS40Mmw0LjEzIDkuNzloLTIuMjVMMzUuNDggOGgtNC4wNmwtLjkgMi4xOGgtMi4yTDMyLjUxLjQyem0uMjUgNS43MkwzMy40NCAzbC0xLjI5IDMuMTR6bTMtNWEuNzEuNzEgMCAwIDEtLjc0Ljc1LjcxLjcxIDAgMCAxLS43My0uNzUuNzMuNzMgMCAwIDEgLjc1LS43Mi43Mi43MiAwIDAgMSAuNzUuNzF6TTM3IC41M2EuNTkuNTkgMCAwIDAtLjYuNi42MS42MSAwIDEgMCAxLjIxIDAgLjYuNiAwIDAgMC0uNjEtLjZ6bS0uMjQgMVYuNzFIMzdjLjEyIDAgLjE4LjA2LjI1LjA2YS4yMS4yMSAwIDAgMSAuMDcuMTguMTkuMTkgMCAwIDEtLjA3LjE4cy0uMDcuMDgtLjEzLjA4bC4yNi4zNmgtLjJMMzcgMS4yOGgtLjF2LjI5em0uMTMtLjQ0aC4yM2EuMjYuMjYgMCAwIDAgLjA3LS4wOWgtLjA2Yy0uMDUtLjE3LS4wNS0uMTctLjEzLS4xN2gtLjF6Ii8+PC9zdmc+',
|
|
82
|
-
datasource: {
|
|
83
|
-
source: '@DATASOURCE D_pyAnnouncements.pxResults',
|
|
84
|
-
fields: {
|
|
85
|
-
name: '@P .pyLabel'
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
]
|
|
91
|
-
}
|
|
92
|
-
],
|
|
93
|
-
classID: 'DIXL-MediaCo-UIPages'
|
|
94
|
-
};
|