@pega/dx-component-builder-sdk 0.23.14 → 0.23.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/constants.js +8 -0
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.html.mustache +5 -1
- package/src/tasks/create/templates/SDK-Angular/field/Boolean/boolean.component.ts.mustache +6 -0
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.html.mustache +5 -1
- package/src/tasks/create/templates/SDK-Angular/field/Date/date.component.ts.mustache +7 -0
- package/src/tasks/create/templates/SDK-Angular/template/DETAILS/details.component.ts.mustache +2 -1
- package/src/tasks/create/templates/SDK-Angular/template/FORM/form.component.scss.mustache +14 -5
- package/src/tasks/create/templates/SDK-React/field/Boolean/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Date/demo.stories.tsx.mustache +17 -15
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +15 -14
- package/src/tasks/create/templates/SDK-React/field/Decimal/demo.stories.tsx.mustache +15 -14
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +1 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/demo.stories.tsx.mustache +14 -12
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/demo.stories.tsx.mustache +2 -2
- package/src/tasks/create/templates/SDK-React/field/Integer/demo.stories.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Picklist/demo.stories.tsx.mustache +2 -3
- package/src/tasks/create/templates/SDK-React/field/Picklist-Autocomplete/demo.stories.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/field/Picklist-RadioButtons/demo.stories.tsx.mustache +6 -4
- package/src/tasks/create/templates/SDK-React/field/Text/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Text-Email/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Text-Input/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/Text-Paragraph/demo.stories.tsx.mustache +8 -5
- package/src/tasks/create/templates/SDK-React/field/Text-Phone/demo.stories.tsx.mustache +6 -4
- package/src/tasks/create/templates/SDK-React/field/Text-URL/demo.stories.tsx.mustache +8 -4
- package/src/tasks/create/templates/SDK-React/field/TimeOfDay/demo.stories.tsx.mustache +6 -4
- package/src/tasks/create/templates/SDK-React/template/DETAILS/demo.stories.tsx.mustache +22 -22
- package/src/tasks/create/templates/SDK-React/template/DETAILS-region/demo.stories.tsx.mustache +17 -17
- package/src/tasks/create/templates/SDK-React/template/FORM/demo.stories.tsx.mustache +30 -18
- package/src/tasks/create/templates/SDK-React/template/FORM-region/demo.stories.tsx.mustache +50 -24
- package/src/tasks/create/templates/SDK-React/template/PAGE/demo.stories.tsx.mustache +37 -21
- package/src/tasks/create/templates/SDK-React/widget/CASE/demo.stories.tsx.mustache +22 -10
- package/src/tasks/create/templates/SDK-React/widget/PAGE/demo.stories.tsx.mustache +3 -4
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +21 -9
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.html +21 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.scss +18 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/field-group/field-group.component.ts +24 -0
- package/tests/assets/sdk-a/components/create/override-sdk/designSystemExtension/material-details-fields/material-details-fields.component.html +8 -2
- package/tests/assets/sdk-a/components/create/override-sdk/field/check-box/check-box.component.html +5 -1
- package/tests/assets/sdk-a/components/create/override-sdk/field/check-box/check-box.component.ts +6 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/date/date.component.html +5 -1
- package/tests/assets/sdk-a/components/create/override-sdk/field/date/date.component.ts +7 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/config-ext.json +8 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.html +25 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.scss +0 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/create/override-sdk/field/group/group.component.ts +84 -0
- package/tests/assets/sdk-a/components/create/override-sdk/template/app-shell/app-shell.component.ts +2 -2
- package/tests/assets/sdk-a/components/create/override-sdk/template/case-view/case-view.component.ts +1 -1
- package/tests/assets/sdk-a/components/create/override-sdk/template/default-form/default-form.component.scss +9 -5
- package/tests/assets/sdk-a/components/create/override-sdk/template/details/details.component.ts +2 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-boolean/pega-dxil-my-boolean.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-boolean/pega-dxil-my-boolean.component.ts +6 -0
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/pega-dxil-my-date.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/field/pega-dxil-my-date/pega-dxil-my-date.component.ts +7 -0
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-details/pega-dxil-my-details.component.ts +2 -1
- package/tests/assets/sdk-a/components/createAll/custom-sdk/template/pega-dxil-my-form/pega-dxil-my-form.component.scss +14 -5
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.html +21 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.scss +18 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/field-group/field-group.component.ts +24 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/designSystemExtension/material-details-fields/material-details-fields.component.html +8 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/check-box/check-box.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/check-box/check-box.component.ts +6 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/date/date.component.html +5 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/date/date.component.ts +7 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/config-ext.json +8 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.html +25 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.scss +0 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.spec.ts +21 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/field/group/group.component.ts +84 -0
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/app-shell/app-shell.component.ts +2 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/case-view/case-view.component.ts +1 -1
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/default-form/default-form.component.scss +9 -5
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/details/details.component.ts +2 -1
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/create/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +15 -16
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +35 -6
- package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +7 -4
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +37 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/config-ext.json +8 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/index.tsx +1 -0
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +14 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/DefaultForm/DefaultForm.css +6 -2
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +19 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/FileUtility/FileUtility.tsx +22 -16
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/PConnProps.d.ts +46 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +54 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +73 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +15 -0
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +15 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +23 -21
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/demo.stories.tsx +14 -12
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/demo.stories.tsx +17 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDate/index.tsx +21 -23
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +15 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/index.tsx +20 -22
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/demo.stories.tsx +15 -14
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyEmail/index.tsx +23 -24
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/demo.stories.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyInteger/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/demo.stories.tsx +8 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyParagraph/index.tsx +18 -19
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/demo.stories.tsx +2 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/demo.stories.tsx +6 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPhone/index.tsx +33 -34
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/demo.stories.tsx +2 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPicklist/index.tsx +0 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/demo.stories.tsx +6 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyRadiobuttons/index.tsx +22 -23
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/demo.stories.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MySearchbox/index.tsx +28 -29
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/config.json +83 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +59 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +101 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +16 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/styles.js +7 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyText/index.tsx +15 -16
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTextInput/index.tsx +15 -16
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/demo.stories.tsx +6 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTimeOfDay/index.tsx +1 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/demo.stories.tsx +8 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyURL/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/demo.stories.tsx +22 -22
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyDetails/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/demo.stories.tsx +56 -18
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyForm/index.tsx +3 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/demo.stories.tsx +37 -21
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyPage/index.tsx +4 -5
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/demo.stories.tsx +17 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnDetails/index.tsx +16 -17
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/demo.stories.tsx +50 -24
- package/tests/assets/sdk-r/components/createAll/custom-sdk/template/Pega_DXIL_MyTwoColumnForm/index.tsx +8 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/demo.stories.tsx +22 -10
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +10 -11
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +21 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +34 -34
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/demo.stories.tsx +3 -4
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx +23 -24
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/FieldGroup/FieldGroup.tsx +35 -6
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +7 -4
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +37 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/config-ext.json +8 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/index.tsx +1 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +14 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/DefaultForm/DefaultForm.css +6 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +19 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/FileUtility/FileUtility.tsx +22 -16
|
@@ -14,42 +14,67 @@ const meta: Meta<typeof PegaDxilMyTwoColumnForm> = {
|
|
|
14
14
|
component: PegaDxilMyTwoColumnForm,
|
|
15
15
|
excludeStories: /.*Data$/,
|
|
16
16
|
parameters: {
|
|
17
|
-
type:
|
|
18
|
-
}
|
|
17
|
+
type: 'TwoColumnForm'
|
|
18
|
+
}
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export default meta;
|
|
22
22
|
type Story = StoryObj<typeof PegaDxilMyTwoColumnForm>;
|
|
23
23
|
|
|
24
24
|
const renderField = resolvedProps => {
|
|
25
|
-
const { displayMode, value = '', label = '', onChange} = resolvedProps;
|
|
25
|
+
const { displayMode, value = '', label = '', onChange } = resolvedProps;
|
|
26
26
|
|
|
27
27
|
const variant = displayMode === 'LABELS_LEFT' ? 'inline' : 'stacked';
|
|
28
28
|
let val: any = '';
|
|
29
29
|
if (label === 'Service Date')
|
|
30
|
-
val =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
val = (
|
|
31
|
+
<MuiPickersUtilsProvider utils={DayjsUtils}>
|
|
32
|
+
<KeyboardDatePicker
|
|
33
|
+
variant='inline'
|
|
34
|
+
inputVariant='outlined'
|
|
35
|
+
placeholder='mm/dd/yyyy'
|
|
36
|
+
fullWidth
|
|
37
|
+
format='MM/DD/YYYY'
|
|
38
|
+
mask='__/__/____'
|
|
39
|
+
size='small'
|
|
40
|
+
label={label}
|
|
41
|
+
value={value || null}
|
|
42
|
+
onChange={onChange}
|
|
43
|
+
/>
|
|
44
|
+
</MuiPickersUtilsProvider>
|
|
45
|
+
);
|
|
43
46
|
|
|
44
47
|
|
|
45
48
|
if (label === 'Email')
|
|
46
|
-
val =
|
|
49
|
+
val = (
|
|
50
|
+
<TextField
|
|
51
|
+
type='email'
|
|
52
|
+
fullWidth
|
|
53
|
+
value={value}
|
|
54
|
+
size='small'
|
|
55
|
+
variant='outlined'
|
|
56
|
+
style={{ fontSize: '14px' }}
|
|
57
|
+
label={label}
|
|
58
|
+
onChange={onChange}
|
|
59
|
+
/>
|
|
60
|
+
);
|
|
47
61
|
|
|
48
62
|
if (label === 'First Name' || label === 'Last Name' || label === 'Middle Name')
|
|
49
63
|
val = <TextField value={value} fullWidth size='small' variant='outlined' style={{ fontSize: '14px' }} label={label} onChange={onChange} />;
|
|
50
64
|
|
|
51
65
|
if (label === 'Phone Number')
|
|
52
|
-
val =
|
|
66
|
+
val = (
|
|
67
|
+
<MuiPhoneNumber
|
|
68
|
+
value={value}
|
|
69
|
+
fullWidth
|
|
70
|
+
variant='outlined'
|
|
71
|
+
size='small'
|
|
72
|
+
style={{ fontSize: '14px' }}
|
|
73
|
+
defaultCountry='us'
|
|
74
|
+
label={label}
|
|
75
|
+
onChange={onChange}
|
|
76
|
+
/>
|
|
77
|
+
);
|
|
53
78
|
|
|
54
79
|
|
|
55
80
|
if (variant === 'inline') {
|
|
@@ -59,7 +84,7 @@ const renderField = resolvedProps => {
|
|
|
59
84
|
return <span key={label}>{val}</span>;
|
|
60
85
|
};
|
|
61
86
|
|
|
62
|
-
export const BasePegaDxilMyTwoColumnForm: Story =
|
|
87
|
+
export const BasePegaDxilMyTwoColumnForm: Story = args => {
|
|
63
88
|
const [firstName, setFirstName] = useState('John');
|
|
64
89
|
const [middleName, setMiddleName] = useState('');
|
|
65
90
|
const [lastName, setLastName] = useState('Joe');
|
|
@@ -140,7 +165,6 @@ export const BasePegaDxilMyTwoColumnForm: Story = (args) => {
|
|
|
140
165
|
const changeValue = date && date.isValid() ? date.toISOString() : null;
|
|
141
166
|
setServiceDate(changeValue);
|
|
142
167
|
}
|
|
143
|
-
|
|
144
168
|
}
|
|
145
169
|
];
|
|
146
170
|
const props = {
|
|
@@ -179,10 +203,12 @@ export const BasePegaDxilMyTwoColumnForm: Story = (args) => {
|
|
|
179
203
|
return props.getPConnect().createComponent(child);
|
|
180
204
|
});
|
|
181
205
|
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
206
|
+
return (
|
|
207
|
+
<PegaDxilMyTwoColumnForm {...props} {...args}>
|
|
208
|
+
{regionAChildren}
|
|
209
|
+
{regionBChildren}
|
|
210
|
+
</PegaDxilMyTwoColumnForm>
|
|
211
|
+
);
|
|
186
212
|
};
|
|
187
213
|
|
|
188
214
|
BasePegaDxilMyTwoColumnForm.args = {};
|
|
@@ -21,7 +21,6 @@ const useStyles = makeStyles(() => ({
|
|
|
21
21
|
// Duplicated runtime code from React SDK
|
|
22
22
|
|
|
23
23
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
24
|
-
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
25
24
|
export default function PegaDxilMyTwoColumnForm(props: PropsWithChildren<PegaDxilMyTwoColumnFormProps>) {
|
|
26
25
|
const classes = useStyles();
|
|
27
26
|
|
|
@@ -50,14 +49,14 @@ export default function PegaDxilMyTwoColumnForm(props: PropsWithChildren<PegaDxi
|
|
|
50
49
|
|
|
51
50
|
return (
|
|
52
51
|
<StyledPegaDxilMyTwoColumnFormWrapper>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
<Grid container spacing={1}>
|
|
53
|
+
<Grid item xs={12} md={aSize} className={classes.colStyles}>
|
|
54
|
+
{childrenToRender[0]}
|
|
55
|
+
</Grid>
|
|
56
|
+
<Grid item xs={12} md={bSize} className={classes.colStyles}>
|
|
57
|
+
{childrenToRender[1]}
|
|
58
|
+
</Grid>
|
|
56
59
|
</Grid>
|
|
57
|
-
<Grid item xs={12} md={bSize} className={classes.colStyles}>
|
|
58
|
-
{childrenToRender[1]}
|
|
59
|
-
</Grid>
|
|
60
|
-
</Grid>
|
|
61
60
|
</StyledPegaDxilMyTwoColumnFormWrapper>
|
|
62
61
|
);
|
|
63
|
-
}
|
|
62
|
+
}
|
|
@@ -5,14 +5,14 @@ import { historyData } from './mock';
|
|
|
5
5
|
|
|
6
6
|
window.PCore = {
|
|
7
7
|
...window.PCore,
|
|
8
|
-
getDataApiUtils: ()
|
|
8
|
+
getDataApiUtils: (): any => {
|
|
9
9
|
return {
|
|
10
10
|
getData: (): any => {
|
|
11
11
|
return new Promise(resolve => {
|
|
12
12
|
resolve(historyData);
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
},
|
|
17
17
|
getConstants: (): any => {
|
|
18
18
|
return {
|
|
@@ -21,7 +21,7 @@ window.PCore = {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
25
|
|
|
26
26
|
const meta: Meta<typeof PegaDxilMyCaseWidget> = {
|
|
27
27
|
title: 'PegaDxilMyCaseWidget',
|
|
@@ -32,7 +32,7 @@ const meta: Meta<typeof PegaDxilMyCaseWidget> = {
|
|
|
32
32
|
export default meta;
|
|
33
33
|
type Story = StoryObj<typeof PegaDxilMyCaseWidget>;
|
|
34
34
|
|
|
35
|
-
export const BasePegaDxilMyCaseWidget: Story =
|
|
35
|
+
export const BasePegaDxilMyCaseWidget: Story = args => {
|
|
36
36
|
|
|
37
37
|
const props = {
|
|
38
38
|
label: 'Case history',
|
|
@@ -50,14 +50,26 @@ export const BasePegaDxilMyCaseWidget: Story = (args) => {
|
|
|
50
50
|
},
|
|
51
51
|
getActionsApi: () => {
|
|
52
52
|
return {
|
|
53
|
-
updateFieldValue: () => {
|
|
54
|
-
|
|
53
|
+
updateFieldValue: () => {
|
|
54
|
+
/* nothing */
|
|
55
|
+
},
|
|
56
|
+
triggerFieldChange: () => {
|
|
57
|
+
/* nothing */
|
|
58
|
+
}
|
|
55
59
|
};
|
|
56
60
|
},
|
|
57
|
-
ignoreSuggestion: () => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
ignoreSuggestion: () => {
|
|
62
|
+
/* nothing */
|
|
63
|
+
},
|
|
64
|
+
acceptSuggestion: () => {
|
|
65
|
+
/* nothing */
|
|
66
|
+
},
|
|
67
|
+
setInheritedProps: () => {
|
|
68
|
+
/* nothing */
|
|
69
|
+
},
|
|
70
|
+
resolveConfigProps: () => {
|
|
71
|
+
/* nothing */
|
|
72
|
+
}
|
|
61
73
|
};
|
|
62
74
|
}
|
|
63
75
|
};
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx
CHANGED
|
@@ -39,7 +39,6 @@ const StyledTableCell = withStyles((theme: Theme) =>
|
|
|
39
39
|
// Case widget example is a "history table"
|
|
40
40
|
|
|
41
41
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
42
|
-
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
43
42
|
export default function PegaDxilMyCaseWidget(props: PegaDxilMyCaseWidgetProps) {
|
|
44
43
|
const { getPConnect } = props;
|
|
45
44
|
const thePConn = getPConnect();
|
|
@@ -164,15 +163,15 @@ export default function PegaDxilMyCaseWidget(props: PegaDxilMyCaseWidgetProps) {
|
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
return (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
166
|
+
<StyledPegaDxilMyCaseWidgetWrapper>
|
|
167
|
+
<div id='CaseHistory'>
|
|
168
|
+
<TableContainer>
|
|
169
|
+
<Table>
|
|
170
|
+
<TableHead>{getTableHeader()}</TableHead>
|
|
171
|
+
<TableBody>{getTableData()}</TableBody>
|
|
172
|
+
</Table>
|
|
173
|
+
</TableContainer>
|
|
174
|
+
</div>
|
|
176
175
|
</StyledPegaDxilMyCaseWidgetWrapper>
|
|
177
176
|
);
|
|
178
|
-
}
|
|
177
|
+
}
|
|
@@ -14,7 +14,7 @@ window.PCore = {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
|
|
19
19
|
const meta: Meta<typeof PegaDxilMyPageCaseWidget> = {
|
|
20
20
|
title: 'PegaDxilMyPageCaseWidget',
|
|
@@ -25,21 +25,33 @@ const meta: Meta<typeof PegaDxilMyPageCaseWidget> = {
|
|
|
25
25
|
export default meta;
|
|
26
26
|
type Story = StoryObj<typeof PegaDxilMyPageCaseWidget>;
|
|
27
27
|
|
|
28
|
-
export const BasePegaDxilMyPageCaseWidget: Story =
|
|
28
|
+
export const BasePegaDxilMyPageCaseWidget: Story = args => {
|
|
29
29
|
|
|
30
30
|
const props = {
|
|
31
31
|
getPConnect: () => {
|
|
32
32
|
return {
|
|
33
33
|
getActionsApi: () => {
|
|
34
34
|
return {
|
|
35
|
-
updateFieldValue: () => {
|
|
36
|
-
|
|
35
|
+
updateFieldValue: () => {
|
|
36
|
+
/* nothing */
|
|
37
|
+
},
|
|
38
|
+
triggerFieldChange: () => {
|
|
39
|
+
/* nothing */
|
|
40
|
+
}
|
|
37
41
|
};
|
|
38
42
|
},
|
|
39
|
-
ignoreSuggestion: () => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
ignoreSuggestion: () => {
|
|
44
|
+
/* nothing */
|
|
45
|
+
},
|
|
46
|
+
acceptSuggestion: () => {
|
|
47
|
+
/* nothing */
|
|
48
|
+
},
|
|
49
|
+
setInheritedProps: () => {
|
|
50
|
+
/* nothing */
|
|
51
|
+
},
|
|
52
|
+
resolveConfigProps: () => {
|
|
53
|
+
/* nothing */
|
|
54
|
+
}
|
|
43
55
|
};
|
|
44
56
|
}
|
|
45
57
|
};
|
|
@@ -49,4 +61,4 @@ export const BasePegaDxilMyPageCaseWidget: Story = (args) => {
|
|
|
49
61
|
|
|
50
62
|
BasePegaDxilMyPageCaseWidget.args = {
|
|
51
63
|
...caseOpConfig
|
|
52
|
-
}
|
|
64
|
+
};
|
|
@@ -13,13 +13,13 @@ import { PConnProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
|
13
13
|
|
|
14
14
|
interface PegaDxilMyPageCaseWidgetProps extends PConnProps {
|
|
15
15
|
// If any, enter additional props that only exist on this component
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
label: string;
|
|
17
|
+
createDateTime: string;
|
|
18
|
+
createLabel: string;
|
|
19
|
+
createOperator: { userName: string; userId: string };
|
|
20
|
+
updateDateTime: string;
|
|
21
|
+
updateLabel: string;
|
|
22
|
+
updateOperator: { userName: string; userId: string };
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const useStyles = makeStyles(theme => ({
|
|
@@ -38,7 +38,6 @@ const useStyles = makeStyles(theme => ({
|
|
|
38
38
|
// Page Case Widget example
|
|
39
39
|
|
|
40
40
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
41
|
-
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
42
41
|
export default function PegaDxilMyPageCaseWidget(props: PegaDxilMyPageCaseWidgetProps) {
|
|
43
42
|
// const componentName = "Operator";
|
|
44
43
|
const classes = useStyles();
|
|
@@ -192,31 +191,32 @@ export default function PegaDxilMyPageCaseWidget(props: PegaDxilMyPageCaseWidget
|
|
|
192
191
|
// End of popover-related
|
|
193
192
|
|
|
194
193
|
return (
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
194
|
+
<StyledPegaDxilMyPageCaseWidgetWrapper>
|
|
195
|
+
<>
|
|
196
|
+
<TextField
|
|
197
|
+
defaultValue={caseOpName}
|
|
198
|
+
label={caseOpLabel}
|
|
199
|
+
onClick={showOperatorDetails}
|
|
200
|
+
InputProps={{
|
|
201
|
+
readOnly: true,
|
|
202
|
+
disableUnderline: true,
|
|
203
|
+
inputProps: { style: { cursor: 'pointer' } }
|
|
204
|
+
}}
|
|
205
|
+
/>
|
|
206
|
+
<br />
|
|
207
|
+
{Utils.generateDateTime(caseTime, 'DateTime-Since')}
|
|
208
|
+
<Popover
|
|
209
|
+
id={popoverId}
|
|
210
|
+
open={popoverOpen}
|
|
211
|
+
anchorEl={popoverAnchorEl}
|
|
212
|
+
onClose={handlePopoverClose}
|
|
213
|
+
anchorOrigin={{ vertical: 'bottom', horizontal: 'center' }}
|
|
214
|
+
transformOrigin={{ vertical: 'top', horizontal: 'center' }}
|
|
215
|
+
PaperProps={{ style: { maxWidth: '45ch' } }}
|
|
216
|
+
>
|
|
217
|
+
{getPopoverGrid()}
|
|
218
|
+
</Popover>
|
|
219
|
+
</>
|
|
220
220
|
</StyledPegaDxilMyPageCaseWidgetWrapper>
|
|
221
221
|
);
|
|
222
|
-
}
|
|
222
|
+
}
|
|
@@ -12,8 +12,7 @@ const meta: Meta<typeof PegaDxilMyPageWidget> = {
|
|
|
12
12
|
export default meta;
|
|
13
13
|
type Story = StoryObj<typeof PegaDxilMyPageWidget>;
|
|
14
14
|
|
|
15
|
-
export const BasePegaDxilMyPageWidget: Story =
|
|
16
|
-
|
|
15
|
+
export const BasePegaDxilMyPageWidget: Story = args => {
|
|
17
16
|
const props = {
|
|
18
17
|
datasource: configProps.datasource,
|
|
19
18
|
whatsnewlink: configProps.whatsnewlink
|
|
@@ -24,5 +23,5 @@ export const BasePegaDxilMyPageWidget: Story = (args) => {
|
|
|
24
23
|
|
|
25
24
|
BasePegaDxilMyPageWidget.args = {
|
|
26
25
|
header: configProps.header,
|
|
27
|
-
description: configProps.description
|
|
28
|
-
}
|
|
26
|
+
description: configProps.description
|
|
27
|
+
};
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageWidget/index.tsx
CHANGED
|
@@ -25,7 +25,6 @@ const useStyles = makeStyles(theme => ({
|
|
|
25
25
|
// Page Widget example is the "App Announcment"
|
|
26
26
|
|
|
27
27
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
28
|
-
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
29
28
|
export default function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
30
29
|
const { header = '', description = '', datasource = [], whatsnewlink = '' } = props;
|
|
31
30
|
let details = [];
|
|
@@ -42,28 +41,28 @@ export default function PegaDxilMyPageWidget(props: PegaDxilMyPageWidgetProps) {
|
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
return (
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
44
|
+
<StyledPegaDxilMyPageWidgetWrapper>
|
|
45
|
+
<Card title='AppAnnouncement' className={classes.root}>
|
|
46
|
+
<CardHeader title={<Typography variant='h6'>{header}</Typography>} />
|
|
47
|
+
<CardContent>
|
|
48
|
+
<Typography variant='body1' gutterBottom>
|
|
49
|
+
{description}
|
|
50
|
+
</Typography>
|
|
51
|
+
{details.map((itm, idx) => {
|
|
52
|
+
const theKey = `AppAnn-item-${idx}`;
|
|
53
|
+
return (
|
|
54
|
+
<Typography key={theKey} variant='body2'>
|
|
55
|
+
- {itm}
|
|
56
|
+
</Typography>
|
|
57
|
+
);
|
|
58
|
+
})}
|
|
59
|
+
</CardContent>
|
|
60
|
+
<CardActions>
|
|
61
|
+
<Button color='primary' onClick={handleClick} size='small'>
|
|
62
|
+
See what's new
|
|
63
|
+
</Button>
|
|
64
|
+
</CardActions>
|
|
65
|
+
</Card>
|
|
67
66
|
</StyledPegaDxilMyPageWidgetWrapper>
|
|
68
67
|
);
|
|
69
|
-
}
|
|
68
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { PropsWithChildren, useState } from 'react';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import KeyboardArrowRightIcon from '@material-ui/icons/KeyboardArrowRight';
|
|
5
|
+
import KeyboardArrowDownIcon from '@material-ui/icons/KeyboardArrowDown';
|
|
4
6
|
|
|
5
7
|
// FieldGroupProps is one of the few components that does NOT have getPConnect.
|
|
6
8
|
// So, no need to extend PConnProps
|
|
7
9
|
interface FieldGroupProps {
|
|
8
10
|
// If any, enter additional props that only exist on this component
|
|
9
|
-
name
|
|
11
|
+
name?: string;
|
|
12
|
+
collapsible?: boolean;
|
|
13
|
+
instructions?: string;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
const useStyles = makeStyles(theme => ({
|
|
@@ -23,12 +27,22 @@ const useStyles = makeStyles(theme => ({
|
|
|
23
27
|
},
|
|
24
28
|
fullWidth: {
|
|
25
29
|
width: '100%'
|
|
30
|
+
},
|
|
31
|
+
fieldGroupHeader: {
|
|
32
|
+
display: 'flex',
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
gap: '5px',
|
|
35
|
+
cursor: collapsible => (collapsible ? 'pointer' : 'auto')
|
|
36
|
+
},
|
|
37
|
+
instructionText: {
|
|
38
|
+
padding: '5px 0'
|
|
26
39
|
}
|
|
27
40
|
}));
|
|
28
41
|
|
|
29
42
|
export default function FieldGroup(props: PropsWithChildren<FieldGroupProps>) {
|
|
30
|
-
const { children, name } = props;
|
|
31
|
-
const classes = useStyles();
|
|
43
|
+
const { children, name, collapsible = false, instructions } = props;
|
|
44
|
+
const classes = useStyles(collapsible);
|
|
45
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
32
46
|
|
|
33
47
|
const descAndChildren = (
|
|
34
48
|
<Grid container>
|
|
@@ -36,15 +50,30 @@ export default function FieldGroup(props: PropsWithChildren<FieldGroupProps>) {
|
|
|
36
50
|
</Grid>
|
|
37
51
|
);
|
|
38
52
|
|
|
53
|
+
const headerClickHandler = () => {
|
|
54
|
+
setCollapsed(current => !current);
|
|
55
|
+
};
|
|
56
|
+
|
|
39
57
|
return (
|
|
40
58
|
<Grid container spacing={4} justifyContent='space-between'>
|
|
41
59
|
<Grid item style={{ width: '100%' }}>
|
|
42
60
|
{name && (
|
|
43
61
|
<div className={classes.fieldMargin}>
|
|
44
|
-
|
|
62
|
+
{collapsible ? (
|
|
63
|
+
<span id='field-group-header' className={classes.fieldGroupHeader} onClick={headerClickHandler}>
|
|
64
|
+
{collapsed ? <KeyboardArrowRightIcon /> : <KeyboardArrowDownIcon />}
|
|
65
|
+
<b>{name}</b>
|
|
66
|
+
</span>
|
|
67
|
+
) : (
|
|
68
|
+
<b>{name}</b>
|
|
69
|
+
)}
|
|
45
70
|
</div>
|
|
46
71
|
)}
|
|
47
|
-
{
|
|
72
|
+
{instructions && instructions !== 'none' && (
|
|
73
|
+
// eslint-disable-next-line react/no-danger
|
|
74
|
+
<div key='instructions' className={classes.instructionText} dangerouslySetInnerHTML={{ __html: instructions }} />
|
|
75
|
+
)}
|
|
76
|
+
{!collapsed && descAndChildren}
|
|
48
77
|
</Grid>
|
|
49
78
|
</Grid>
|
|
50
79
|
);
|
|
@@ -10,6 +10,8 @@ interface CheckboxProps extends Omit<PConnFieldProps, 'value'> {
|
|
|
10
10
|
value?: boolean;
|
|
11
11
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
12
12
|
caption?: string;
|
|
13
|
+
trueLabel?: string;
|
|
14
|
+
falseLabel?: string;
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export default function CheckboxComponent(props: CheckboxProps) {
|
|
@@ -18,7 +20,6 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
18
20
|
|
|
19
21
|
const {
|
|
20
22
|
getPConnect,
|
|
21
|
-
label,
|
|
22
23
|
value = false,
|
|
23
24
|
readOnly,
|
|
24
25
|
testId,
|
|
@@ -28,7 +29,9 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
28
29
|
helperText,
|
|
29
30
|
validatemessage,
|
|
30
31
|
displayMode,
|
|
31
|
-
hideLabel
|
|
32
|
+
hideLabel,
|
|
33
|
+
trueLabel,
|
|
34
|
+
falseLabel
|
|
32
35
|
} = props;
|
|
33
36
|
const helperTextToDisplay = validatemessage || helperText;
|
|
34
37
|
|
|
@@ -45,11 +48,11 @@ export default function CheckboxComponent(props: CheckboxProps) {
|
|
|
45
48
|
}, [value]);
|
|
46
49
|
|
|
47
50
|
if (displayMode === 'LABELS_LEFT') {
|
|
48
|
-
return <FieldValueList name={hideLabel ? '' :
|
|
51
|
+
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} />;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
52
|
-
return <FieldValueList name={hideLabel ? '' :
|
|
55
|
+
return <FieldValueList name={hideLabel ? '' : caption} value={value ? trueLabel : falseLabel} variant='stacked' />;
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
const handleChange = event => {
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactElement, useMemo } from 'react';
|
|
2
|
+
import { Grid } from '@material-ui/core';
|
|
3
|
+
import FieldGroup from '@pega/react-sdk-components/lib/components/designSystemExtension/FieldGroup';
|
|
4
|
+
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
5
|
+
|
|
6
|
+
interface GroupProps extends PConnFieldProps {
|
|
7
|
+
children: ReactElement[];
|
|
8
|
+
heading: string;
|
|
9
|
+
showHeading: boolean;
|
|
10
|
+
instructions?: string;
|
|
11
|
+
collapsible: boolean;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default function Group(props: GroupProps) {
|
|
16
|
+
const { children, heading, showHeading, instructions, collapsible, displayMode, type } = props;
|
|
17
|
+
|
|
18
|
+
const isReadOnly = displayMode === 'LABELS_LEFT';
|
|
19
|
+
|
|
20
|
+
const content = useMemo(() => {
|
|
21
|
+
return (
|
|
22
|
+
<Grid container spacing={2}>
|
|
23
|
+
{children?.map(child => (
|
|
24
|
+
<Grid item xs={12} key={child.key}>
|
|
25
|
+
{child}
|
|
26
|
+
</Grid>
|
|
27
|
+
))}
|
|
28
|
+
</Grid>
|
|
29
|
+
);
|
|
30
|
+
}, [children, type, isReadOnly]);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<FieldGroup name={showHeading ? heading : undefined} collapsible={collapsible} instructions={instructions}>
|
|
34
|
+
{content}
|
|
35
|
+
</FieldGroup>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './Group';
|