@pega/custom-dx-components 0.23.14 → 0.23.16
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/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +15 -3
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +10 -1
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +19 -3
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +18 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +18 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +18 -3
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +19 -3
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +20 -3
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +25 -3
- package/src/tasks/create/templates/Constellation/Field/Text/index.jsx.mustache +4 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +19 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +15 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +15 -3
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +18 -3
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +18 -3
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.jsx.mustache +20 -4
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +18 -12
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +12 -9
- package/src/tasks/create/templates/Constellation/Widget/CASE/config.json.mustache +1 -1
- package/src/tasks/create/templates/Launchpad/Widget/CASE/config.json.mustache +1 -1
- package/src/tasks/init/index.js +5 -5
- package/src/tasks/init/template/jest.config.cjs +21 -0
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/tests/assets/components/create/Pega_DXIL_MyTestText/index.jsx +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.jsx +17 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCaseWidget/config.json +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.jsx +19 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +10 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.jsx +20 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.jsx +19 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.jsx +19 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.jsx +20 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/index.jsx +15 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.jsx +21 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.jsx +16 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.jsx +20 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.jsx +19 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.jsx +26 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyText/index.jsx +5 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.jsx +16 -4
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.jsx +21 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/index.jsx +12 -9
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.jsx +19 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.jsx +17 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCaseWidget/config.json +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.jsx +19 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +10 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.jsx +20 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.jsx +19 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.jsx +19 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.jsx +20 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/index.jsx +15 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.jsx +21 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.jsx +16 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.jsx +20 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.jsx +19 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.jsx +26 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyText/index.jsx +5 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.jsx +16 -4
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.jsx +21 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/index.jsx +12 -9
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.jsx +19 -4
- package/tests/functional/localCreateBuildAllDeleteAll.test.js +2 -2
- package/tests/functional/localCreateBuildDelete.test.js +1 -1
- package/tests/functional/localCreatePublishAllDeleteAll.test.js +2 -2
- package/tests/functional/localCreatePublishDelete.test.js +2 -1
package/package.json
CHANGED
|
@@ -29,12 +29,21 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
29
29
|
displayMode,
|
|
30
30
|
variant,
|
|
31
31
|
trueLabel,
|
|
32
|
-
falseLabel
|
|
32
|
+
falseLabel,
|
|
33
|
+
fieldMetadata
|
|
33
34
|
} = props;
|
|
34
35
|
const pConn = getPConnect();
|
|
35
36
|
const actions = pConn.getActionsApi();
|
|
36
37
|
const propName = pConn.getStateProps().value;
|
|
37
38
|
|
|
39
|
+
const fieldAdditionalInfo = fieldMetadata?.additionalInformation;
|
|
40
|
+
const additionalInfo = fieldAdditionalInfo
|
|
41
|
+
? {
|
|
42
|
+
heading: caption,
|
|
43
|
+
content: fieldAdditionalInfo
|
|
44
|
+
}
|
|
45
|
+
: undefined;
|
|
46
|
+
|
|
38
47
|
let { readOnly, required, disabled } = props;
|
|
39
48
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
40
49
|
(prop) => prop === true || (typeof prop === 'string' && prop === 'true')
|
|
@@ -62,6 +71,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
62
71
|
pConn.getValidationApi().validate(event.target.checked);
|
|
63
72
|
}}
|
|
64
73
|
data-testid={testId}
|
|
74
|
+
additionalInfo={additionalInfo}
|
|
65
75
|
/>
|
|
66
76
|
);
|
|
67
77
|
|
|
@@ -144,7 +154,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
144
154
|
variant: 'inline',
|
|
145
155
|
displayValue: 'Yes/No',
|
|
146
156
|
trueLabel: '',
|
|
147
|
-
falseLabel: ''
|
|
157
|
+
falseLabel: '',
|
|
158
|
+
fieldMetadata: {}
|
|
148
159
|
};
|
|
149
160
|
|
|
150
161
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -164,7 +175,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
164
175
|
variant: PropTypes.string,
|
|
165
176
|
displayValue: PropTypes.string,
|
|
166
177
|
trueLabel: PropTypes.string,
|
|
167
|
-
falseLabel: PropTypes.string
|
|
178
|
+
falseLabel: PropTypes.string,
|
|
179
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any)
|
|
168
180
|
};
|
|
169
181
|
|
|
170
182
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -117,6 +117,11 @@
|
|
|
117
117
|
"name": "helperText",
|
|
118
118
|
"label": "Helper text",
|
|
119
119
|
"format": "TEXT"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"name": "enableAdditionalInformation",
|
|
123
|
+
"label": "Enable additional information on field",
|
|
124
|
+
"format": "BOOLEAN"
|
|
120
125
|
}
|
|
121
126
|
]
|
|
122
127
|
},
|
|
@@ -141,7 +146,11 @@
|
|
|
141
146
|
},
|
|
142
147
|
{
|
|
143
148
|
"key": "DateTime-Long",
|
|
144
|
-
"value": "Date
|
|
149
|
+
"value": "Date (Long)"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"key": "DateTime-Short",
|
|
153
|
+
"value": "Date (Short)"
|
|
145
154
|
},
|
|
146
155
|
{
|
|
147
156
|
"key": "DateTime-Since",
|
|
@@ -38,7 +38,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
38
38
|
additionalProps,
|
|
39
39
|
displayMode,
|
|
40
40
|
variant,
|
|
41
|
-
hasSuggestions
|
|
41
|
+
hasSuggestions,
|
|
42
|
+
fieldMetadata,
|
|
43
|
+
enableAdditionalInformation
|
|
42
44
|
} = props;
|
|
43
45
|
|
|
44
46
|
let {formatter} = props;
|
|
@@ -182,6 +184,15 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
182
184
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
183
185
|
);
|
|
184
186
|
} else {
|
|
187
|
+
const fieldDescription = fieldMetadata?.description;
|
|
188
|
+
const additionalInfo =
|
|
189
|
+
enableAdditionalInformation && fieldDescription
|
|
190
|
+
? {
|
|
191
|
+
heading: label,
|
|
192
|
+
content: fieldDescription
|
|
193
|
+
}
|
|
194
|
+
: undefined;
|
|
195
|
+
|
|
185
196
|
dateComponent = (
|
|
186
197
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
187
198
|
<DateInput
|
|
@@ -189,6 +200,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
189
200
|
label={label}
|
|
190
201
|
labelHidden={hideLabel}
|
|
191
202
|
info={validatemessage || helperText}
|
|
203
|
+
additionalInfo={additionalInfo}
|
|
192
204
|
status={status}
|
|
193
205
|
value={value || undefined}
|
|
194
206
|
disabled={disabled}
|
|
@@ -228,7 +240,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
228
240
|
displayMode: null,
|
|
229
241
|
variant: "inline",
|
|
230
242
|
formatter: "defaultDate",
|
|
231
|
-
hasSuggestions: false
|
|
243
|
+
hasSuggestions: false,
|
|
244
|
+
fieldMetadata: {},
|
|
245
|
+
enableAdditionalInformation: false
|
|
232
246
|
};
|
|
233
247
|
|
|
234
248
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -250,7 +264,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
250
264
|
displayMode: PropTypes.string,
|
|
251
265
|
variant: PropTypes.string,
|
|
252
266
|
formatter: PropTypes.string,
|
|
253
|
-
hasSuggestions: PropTypes.bool
|
|
267
|
+
hasSuggestions: PropTypes.bool,
|
|
268
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
269
|
+
enableAdditionalInformation: PropTypes.bool
|
|
254
270
|
};
|
|
255
271
|
|
|
256
272
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -40,12 +40,22 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
40
40
|
additionalProps,
|
|
41
41
|
displayMode,
|
|
42
42
|
variant,
|
|
43
|
-
hasSuggestions
|
|
43
|
+
hasSuggestions,
|
|
44
|
+
fieldMetadata,
|
|
45
|
+
enableAdditionalInformation
|
|
44
46
|
} = props;
|
|
45
47
|
let { formatter } = props;
|
|
46
48
|
const pConn = getPConnect();
|
|
47
49
|
const actions = pConn.getActionsApi();
|
|
48
50
|
const propName = pConn.getStateProps().value;
|
|
51
|
+
const fieldDescription = fieldMetadata?.description;
|
|
52
|
+
const additionalInfo =
|
|
53
|
+
enableAdditionalInformation && fieldDescription
|
|
54
|
+
? {
|
|
55
|
+
heading: label,
|
|
56
|
+
content: fieldDescription
|
|
57
|
+
}
|
|
58
|
+
: undefined;
|
|
49
59
|
|
|
50
60
|
const environmentInfo = PCore.getEnvironmentInfo();
|
|
51
61
|
const timezone = environmentInfo && environmentInfo.getTimeZone();
|
|
@@ -181,6 +191,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
181
191
|
label={label}
|
|
182
192
|
labelHidden={hideLabel}
|
|
183
193
|
info={validatemessage || helperText}
|
|
194
|
+
additionalInfo={additionalInfo}
|
|
184
195
|
status={status}
|
|
185
196
|
value={DateTimeFormatter.convertToTimezone(value, { timezone }) || undefined}
|
|
186
197
|
withSeconds={withSeconds}
|
|
@@ -223,7 +234,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
223
234
|
displayMode: null,
|
|
224
235
|
variant: "inline",
|
|
225
236
|
Format: "defaultDateTime",
|
|
226
|
-
hasSuggestions: false
|
|
237
|
+
hasSuggestions: false,
|
|
238
|
+
fieldMetadata: {},
|
|
239
|
+
enableAdditionalInformation: false
|
|
227
240
|
};
|
|
228
241
|
|
|
229
242
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -248,7 +261,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
248
261
|
variant: PropTypes.string,
|
|
249
262
|
formatter: PropTypes.string,
|
|
250
263
|
Format: PropTypes.string,
|
|
251
|
-
hasSuggestions: PropTypes.bool
|
|
264
|
+
hasSuggestions: PropTypes.bool,
|
|
265
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
266
|
+
enableAdditionalInformation: PropTypes.bool
|
|
252
267
|
};
|
|
253
268
|
|
|
254
269
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -30,7 +30,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
30
30
|
notation,
|
|
31
31
|
currencyISOCode,
|
|
32
32
|
isTableFormatter,
|
|
33
|
-
hasSuggestions
|
|
33
|
+
hasSuggestions,
|
|
34
|
+
fieldMetadata,
|
|
35
|
+
enableAdditionalInformation
|
|
34
36
|
} = props;
|
|
35
37
|
let { showGroupSeparators } = props;
|
|
36
38
|
let { currencyDisplay } = props;
|
|
@@ -38,6 +40,14 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
38
40
|
const actions = pConn.getActionsApi();
|
|
39
41
|
const propName = pConn.getStateProps().value;
|
|
40
42
|
const [decimalValue, setDecimalValue] = useState(value?.toString());
|
|
43
|
+
const fieldDescription = fieldMetadata?.description;
|
|
44
|
+
const additionalInfo =
|
|
45
|
+
enableAdditionalInformation && fieldDescription
|
|
46
|
+
? {
|
|
47
|
+
heading: label,
|
|
48
|
+
content: fieldDescription
|
|
49
|
+
}
|
|
50
|
+
: undefined;
|
|
41
51
|
const hasValueChange = useRef(false);
|
|
42
52
|
|
|
43
53
|
let { readOnly, required, disabled } = props;
|
|
@@ -190,6 +200,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
190
200
|
numberOfDecimals={numberOfDecimals}
|
|
191
201
|
showGroupSeparators={showGroupSeparators}
|
|
192
202
|
data-testid={testId}
|
|
203
|
+
additionalInfo={additionalInfo}
|
|
193
204
|
onChange={(enteredValue) => {
|
|
194
205
|
if (hasSuggestions) {
|
|
195
206
|
setStatus(undefined);
|
|
@@ -239,7 +250,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
239
250
|
currencyDisplay: 'symbol',
|
|
240
251
|
currencyDecimalPrecision: 'auto',
|
|
241
252
|
isTableFormatter: false,
|
|
242
|
-
hasSuggestions: false
|
|
253
|
+
hasSuggestions: false,
|
|
254
|
+
fieldMetadata: {},
|
|
255
|
+
enableAdditionalInformation: false
|
|
243
256
|
};
|
|
244
257
|
|
|
245
258
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -267,7 +280,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
267
280
|
currencyDisplay: PropTypes.string,
|
|
268
281
|
currencyDecimalPrecision: PropTypes.string,
|
|
269
282
|
isTableFormatter: PropTypes.bool,
|
|
270
|
-
hasSuggestions: PropTypes.bool
|
|
283
|
+
hasSuggestions: PropTypes.bool,
|
|
284
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
285
|
+
enableAdditionalInformation: PropTypes.bool
|
|
271
286
|
};
|
|
272
287
|
|
|
273
288
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -46,13 +46,23 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
46
46
|
negative,
|
|
47
47
|
notation,
|
|
48
48
|
isTableFormatter,
|
|
49
|
-
hasSuggestions
|
|
49
|
+
hasSuggestions,
|
|
50
|
+
fieldMetadata,
|
|
51
|
+
enableAdditionalInformation
|
|
50
52
|
} = props;
|
|
51
53
|
let { currencyDisplay } = props;
|
|
52
54
|
const pConn = getPConnect();
|
|
53
55
|
const actions = pConn.getActionsApi();
|
|
54
56
|
const propName = pConn.getStateProps().value;
|
|
55
57
|
const [currencyValue, setCurrencyValue] = useState(() => formatValue(value));
|
|
58
|
+
const fieldDescription = fieldMetadata?.description;
|
|
59
|
+
const additionalInfo =
|
|
60
|
+
enableAdditionalInformation && fieldDescription
|
|
61
|
+
? {
|
|
62
|
+
heading: label,
|
|
63
|
+
content: fieldDescription
|
|
64
|
+
}
|
|
65
|
+
: undefined;
|
|
56
66
|
|
|
57
67
|
let { readOnly, required, disabled } = props;
|
|
58
68
|
|
|
@@ -214,6 +224,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
214
224
|
readOnly={readOnly}
|
|
215
225
|
required={required}
|
|
216
226
|
data-testid={testId}
|
|
227
|
+
additionalInfo={additionalInfo}
|
|
217
228
|
onChange={(enteredValue) => {
|
|
218
229
|
if (hasSuggestions) {
|
|
219
230
|
setStatus(undefined);
|
|
@@ -263,7 +274,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
263
274
|
currencyDecimalPrecision: 'auto',
|
|
264
275
|
isTableFormatter: false,
|
|
265
276
|
alwaysShowISOCode: false,
|
|
266
|
-
hasSuggestions: false
|
|
277
|
+
hasSuggestions: false,
|
|
278
|
+
fieldMetadata: {},
|
|
279
|
+
enableAdditionalInformation: false
|
|
267
280
|
};
|
|
268
281
|
|
|
269
282
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -293,7 +306,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
293
306
|
currencyDecimalPrecision: PropTypes.string,
|
|
294
307
|
isTableFormatter: PropTypes.bool,
|
|
295
308
|
alwaysShowISOCode: PropTypes.bool,
|
|
296
|
-
hasSuggestions: PropTypes.bool
|
|
309
|
+
hasSuggestions: PropTypes.bool,
|
|
310
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
311
|
+
enableAdditionalInformation: PropTypes.bool
|
|
297
312
|
};
|
|
298
313
|
|
|
299
314
|
export default {{COMPONENT_CLASS_NAME}};
|
package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache
CHANGED
|
@@ -35,13 +35,24 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
35
35
|
variant,
|
|
36
36
|
formatter,
|
|
37
37
|
isTableFormatter,
|
|
38
|
-
hasSuggestions
|
|
38
|
+
hasSuggestions,
|
|
39
|
+
fieldMetadata,
|
|
40
|
+
enableAdditionalInformation
|
|
39
41
|
} = props;
|
|
40
42
|
let { showGroupSeparators } = props;
|
|
41
43
|
const pConn = getPConnect();
|
|
42
44
|
const actions = pConn.getActionsApi();
|
|
43
45
|
const propName = pConn.getStateProps().value;
|
|
44
46
|
const [percentageValue, setPercentageValue] = useState(value?.toString());
|
|
47
|
+
const fieldDescription = fieldMetadata?.description;
|
|
48
|
+
const additionalInfo =
|
|
49
|
+
enableAdditionalInformation && fieldDescription
|
|
50
|
+
? {
|
|
51
|
+
heading: label,
|
|
52
|
+
content: fieldDescription
|
|
53
|
+
}
|
|
54
|
+
: undefined;
|
|
55
|
+
|
|
45
56
|
const hasValueChange = useRef(false);
|
|
46
57
|
|
|
47
58
|
let { readOnly, required, disabled } = props;
|
|
@@ -198,6 +209,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
198
209
|
label={label}
|
|
199
210
|
labelHidden={hideLabel}
|
|
200
211
|
info={validatemessage || helperText}
|
|
212
|
+
additionalInfo={additionalInfo}
|
|
201
213
|
value={percentageValue}
|
|
202
214
|
status={status}
|
|
203
215
|
placeholder={placeholder}
|
|
@@ -252,7 +264,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
252
264
|
currencyISOCode: 'USD',
|
|
253
265
|
formatter: '',
|
|
254
266
|
isTableFormatter: false,
|
|
255
|
-
hasSuggestions: false
|
|
267
|
+
hasSuggestions: false,
|
|
268
|
+
fieldMetadata: {},
|
|
269
|
+
enableAdditionalInformation: false
|
|
256
270
|
};
|
|
257
271
|
|
|
258
272
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -275,7 +289,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
275
289
|
formatter: PropTypes.string,
|
|
276
290
|
currencyISOCode: PropTypes.string,
|
|
277
291
|
isTableFormatter: PropTypes.bool,
|
|
278
|
-
hasSuggestions: PropTypes.bool
|
|
292
|
+
hasSuggestions: PropTypes.bool,
|
|
293
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
294
|
+
enableAdditionalInformation: PropTypes.bool
|
|
279
295
|
};
|
|
280
296
|
|
|
281
297
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -37,7 +37,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
37
37
|
negative,
|
|
38
38
|
notation,
|
|
39
39
|
isTableFormatter,
|
|
40
|
-
hasSuggestions
|
|
40
|
+
hasSuggestions,
|
|
41
|
+
fieldMetadata,
|
|
42
|
+
enableAdditionalInformation
|
|
41
43
|
} = props;
|
|
42
44
|
let { showGroupSeparators } = props;
|
|
43
45
|
let { currencyDisplay } = props;
|
|
@@ -46,6 +48,15 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
46
48
|
const propName = pConn.getStateProps().value;
|
|
47
49
|
const [integerValue, setIntegerValue] = useState(value?.toString());
|
|
48
50
|
const sliderDefaultValue = !defaultValue && defaultValue !== 0 ? max : defaultValue;
|
|
51
|
+
const fieldDescription = fieldMetadata?.description;
|
|
52
|
+
const additionalInfo =
|
|
53
|
+
enableAdditionalInformation && fieldDescription
|
|
54
|
+
? {
|
|
55
|
+
heading: label,
|
|
56
|
+
content: fieldDescription
|
|
57
|
+
}
|
|
58
|
+
: undefined;
|
|
59
|
+
|
|
49
60
|
const hasValueChange = useRef(false);
|
|
50
61
|
|
|
51
62
|
|
|
@@ -210,6 +221,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
210
221
|
label={label}
|
|
211
222
|
labelHidden={hideLabel}
|
|
212
223
|
info={validatemessage || helperText}
|
|
224
|
+
additionalInfo={additionalInfo}
|
|
213
225
|
value={!integerValue ? sliderDefaultValue : Number(integerValue)}
|
|
214
226
|
status={status}
|
|
215
227
|
placeholder={placeholder}
|
|
@@ -237,6 +249,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
237
249
|
label={label}
|
|
238
250
|
labelHidden={hideLabel}
|
|
239
251
|
info={validatemessage || helperText}
|
|
252
|
+
additionalInfo={additionalInfo}
|
|
240
253
|
value={integerValue}
|
|
241
254
|
status={status}
|
|
242
255
|
placeholder={displayAs === 'input' ? placeholder : ''}
|
|
@@ -295,7 +308,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
295
308
|
currencyDisplay: 'symbol',
|
|
296
309
|
currencyDecimalPrecision: 'auto',
|
|
297
310
|
isTableFormatter: false,
|
|
298
|
-
hasSuggestions: false
|
|
311
|
+
hasSuggestions: false,
|
|
312
|
+
fieldMetadata: {},
|
|
313
|
+
enableAdditionalInformation: false
|
|
299
314
|
};
|
|
300
315
|
|
|
301
316
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -330,7 +345,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
330
345
|
currencyDisplay: PropTypes.string,
|
|
331
346
|
currencyDecimalPrecision: PropTypes.string,
|
|
332
347
|
isTableFormatter: PropTypes.bool,
|
|
333
|
-
hasSuggestions: PropTypes.bool
|
|
348
|
+
hasSuggestions: PropTypes.bool,
|
|
349
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
350
|
+
enableAdditionalInformation: PropTypes.bool
|
|
334
351
|
};
|
|
335
352
|
|
|
336
353
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -96,7 +96,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
96
96
|
variant,
|
|
97
97
|
fieldMetadata,
|
|
98
98
|
isTableFormatter,
|
|
99
|
-
hasSuggestions
|
|
99
|
+
hasSuggestions,
|
|
100
|
+
enableAdditionalInformation,
|
|
101
|
+
additionalInfo
|
|
100
102
|
} = props;
|
|
101
103
|
const { formatter } = props;
|
|
102
104
|
const pConnect = getPConnect();
|
|
@@ -105,6 +107,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
105
107
|
const className = pConnect.getCaseInfo().getClassName();
|
|
106
108
|
const refName = propName?.slice(propName.lastIndexOf('.') + 1);
|
|
107
109
|
|
|
110
|
+
const fieldDescription = fieldMetadata?.description;
|
|
111
|
+
|
|
108
112
|
let { readOnly, required, disabled } = props;
|
|
109
113
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
110
114
|
(prop) => prop === true || (typeof prop === 'string' && prop === 'true')
|
|
@@ -262,6 +266,12 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
262
266
|
suggestionsHandler(accepted, pConnect, setStatus);
|
|
263
267
|
};
|
|
264
268
|
|
|
269
|
+
// In case of User Reference additionalInfo prop is directly passed down
|
|
270
|
+
const additionalInfoProp = additionalInfo || {
|
|
271
|
+
heading: label,
|
|
272
|
+
content: fieldDescription
|
|
273
|
+
};
|
|
274
|
+
|
|
265
275
|
return (
|
|
266
276
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
267
277
|
<Select
|
|
@@ -290,6 +300,11 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
290
300
|
pConnect.getValidationApi().validate(event.target.value);
|
|
291
301
|
}}
|
|
292
302
|
onResolveSuggestion={onResolveSuggestionHandler}
|
|
303
|
+
{...(additionalInfo || (enableAdditionalInformation && fieldDescription)
|
|
304
|
+
? {
|
|
305
|
+
additionalInfo: additionalInfoProp
|
|
306
|
+
}
|
|
307
|
+
: {})}
|
|
293
308
|
>
|
|
294
309
|
{items}
|
|
295
310
|
</Select>
|
|
@@ -316,7 +331,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
316
331
|
variant: 'inline',
|
|
317
332
|
formatter: '',
|
|
318
333
|
isTableFormatter: false,
|
|
319
|
-
hasSuggestions: false
|
|
334
|
+
hasSuggestions: false,
|
|
335
|
+
enableAdditionalInformation: false,
|
|
336
|
+
additionalInfo: null
|
|
320
337
|
};
|
|
321
338
|
|
|
322
339
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -345,7 +362,12 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
345
362
|
variant: PropTypes.string,
|
|
346
363
|
formatter: PropTypes.string,
|
|
347
364
|
isTableFormatter: PropTypes.bool,
|
|
348
|
-
hasSuggestions: PropTypes.bool
|
|
365
|
+
hasSuggestions: PropTypes.bool,
|
|
366
|
+
enableAdditionalInformation: PropTypes.bool,
|
|
367
|
+
additionalInfo: PropTypes.shape({
|
|
368
|
+
heading: PropTypes.string,
|
|
369
|
+
content: PropTypes.string
|
|
370
|
+
})
|
|
349
371
|
};
|
|
350
372
|
|
|
351
373
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { Input
|
|
2
|
+
import { Input } from '@pega/cosmos-react-core';
|
|
3
3
|
|
|
4
4
|
import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ import Styled{{COMPONENT_CLASS_NAME}}Wrapper from './styles';
|
|
|
9
9
|
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
10
10
|
// any default values in config.pros should be set in defaultProps at bottom of this file
|
|
11
11
|
const {{COMPONENT_CLASS_NAME}} = props => {
|
|
12
|
-
const { getPConnect, value, placeholder, disabled, readOnly, required, label, testId } = props;
|
|
12
|
+
const { getPConnect, value, placeholder, disabled, readOnly, required, label, hideLabel, testId } = props;
|
|
13
13
|
|
|
14
14
|
const pConn = getPConnect();
|
|
15
15
|
const actions = pConn.getActionsApi();
|
|
@@ -22,10 +22,11 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
22
22
|
|
|
23
23
|
return (
|
|
24
24
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
25
|
-
<Label>{label}</Label>
|
|
26
25
|
<Input
|
|
27
26
|
type='text'
|
|
28
27
|
value={value}
|
|
28
|
+
label={label}
|
|
29
|
+
labelHidden={hideLabel}
|
|
29
30
|
placeholder={placeholder}
|
|
30
31
|
disabled={disabled}
|
|
31
32
|
readOnly={readOnly}
|
|
@@ -70,12 +70,23 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
70
70
|
additionalProps,
|
|
71
71
|
variant,
|
|
72
72
|
isTableFormatter,
|
|
73
|
-
hasSuggestions
|
|
73
|
+
hasSuggestions,
|
|
74
|
+
fieldMetadata,
|
|
75
|
+
enableAdditionalInformation
|
|
74
76
|
} = props;
|
|
75
77
|
const { formatter } = props;
|
|
76
78
|
const pConn = getPConnect();
|
|
77
79
|
const actions = pConn.getActionsApi();
|
|
78
80
|
const propName = pConn.getStateProps().value;
|
|
81
|
+
const fieldDescription = fieldMetadata?.description;
|
|
82
|
+
const additionalInfo =
|
|
83
|
+
enableAdditionalInformation && fieldDescription
|
|
84
|
+
? {
|
|
85
|
+
heading: label,
|
|
86
|
+
content: fieldDescription
|
|
87
|
+
}
|
|
88
|
+
: undefined;
|
|
89
|
+
|
|
79
90
|
const hasValueChange = useRef(false);
|
|
80
91
|
|
|
81
92
|
|
|
@@ -157,6 +168,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
157
168
|
label={label}
|
|
158
169
|
labelHidden={hideLabel}
|
|
159
170
|
info={validatemessage || helperText}
|
|
171
|
+
additionalInfo={additionalInfo}
|
|
160
172
|
value={inputValue}
|
|
161
173
|
status={status}
|
|
162
174
|
placeholder={placeholder}
|
|
@@ -205,7 +217,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
205
217
|
variant: 'inline',
|
|
206
218
|
formatter: '',
|
|
207
219
|
isTableFormatter: false,
|
|
208
|
-
hasSuggestions: false
|
|
220
|
+
hasSuggestions: false,
|
|
221
|
+
fieldMetadata: {},
|
|
222
|
+
enableAdditionalInformation: false
|
|
209
223
|
};
|
|
210
224
|
|
|
211
225
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -225,7 +239,9 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
225
239
|
variant: PropTypes.string,
|
|
226
240
|
formatter: PropTypes.string,
|
|
227
241
|
isTableFormatter: PropTypes.bool,
|
|
228
|
-
hasSuggestions: PropTypes.bool
|
|
242
|
+
hasSuggestions: PropTypes.bool,
|
|
243
|
+
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
244
|
+
enableAdditionalInformation: PropTypes.bool
|
|
229
245
|
};
|
|
230
246
|
|
|
231
247
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -73,13 +73,15 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
73
73
|
displayAsStatus,
|
|
74
74
|
variant,
|
|
75
75
|
hasSuggestions,
|
|
76
|
-
isTableFormatter
|
|
76
|
+
isTableFormatter,
|
|
77
|
+
enableAdditionalInformation
|
|
77
78
|
} = props;
|
|
78
79
|
const { formatter } = props;
|
|
79
80
|
const pConn = getPConnect();
|
|
80
81
|
const actions = pConn.getActionsApi();
|
|
81
82
|
const propName = pConn.getStateProps().value;
|
|
82
83
|
const maxLength = fieldMetadata?.maxLength;
|
|
84
|
+
const fieldDescription = fieldMetadata?.description;
|
|
83
85
|
const hasValueChange = useRef(false);
|
|
84
86
|
|
|
85
87
|
let { value, readOnly, required, disabled } = props;
|
|
@@ -189,6 +191,14 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
189
191
|
}
|
|
190
192
|
}}
|
|
191
193
|
onResolveSuggestion={onResolveSuggestionHandler}
|
|
194
|
+
{...(enableAdditionalInformation && fieldDescription
|
|
195
|
+
? {
|
|
196
|
+
additionalInfo: {
|
|
197
|
+
heading: label,
|
|
198
|
+
content: fieldDescription
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
: {})}
|
|
192
202
|
/>
|
|
193
203
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
194
204
|
);
|
|
@@ -211,7 +221,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
211
221
|
variant: 'inline',
|
|
212
222
|
formatter: '',
|
|
213
223
|
isTableFormatter: false,
|
|
214
|
-
hasSuggestions: false
|
|
224
|
+
hasSuggestions: false,
|
|
225
|
+
enableAdditionalInformation: false
|
|
215
226
|
};
|
|
216
227
|
|
|
217
228
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -233,7 +244,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
233
244
|
variant: PropTypes.string,
|
|
234
245
|
formatter: PropTypes.string,
|
|
235
246
|
isTableFormatter: PropTypes.bool,
|
|
236
|
-
hasSuggestions: PropTypes.bool
|
|
247
|
+
hasSuggestions: PropTypes.bool,
|
|
248
|
+
enableAdditionalInformation: PropTypes.bool
|
|
237
249
|
};
|
|
238
250
|
|
|
239
251
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -71,7 +71,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
71
71
|
additionalProps,
|
|
72
72
|
variant,
|
|
73
73
|
isTableFormatter,
|
|
74
|
-
hasSuggestions
|
|
74
|
+
hasSuggestions,
|
|
75
|
+
enableAdditionalInformation
|
|
75
76
|
} = props;
|
|
76
77
|
const { formatter } = props;
|
|
77
78
|
const pConn = getPConnect();
|
|
@@ -79,6 +80,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
79
80
|
const propName = pConn.getStateProps().value;
|
|
80
81
|
const maxLength = fieldMetadata?.maxLength;
|
|
81
82
|
const hasValueChange = useRef(false);
|
|
83
|
+
const fieldDescription = fieldMetadata?.description;
|
|
82
84
|
|
|
83
85
|
|
|
84
86
|
// BUG-547602: Temporary type coercion for 8.5 until DXAPIs are enhanced to pass original pxViewMetadata JSON, respecting boolean primitives
|
|
@@ -183,6 +185,14 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
183
185
|
}
|
|
184
186
|
}}
|
|
185
187
|
onResolveSuggestion={onResolveSuggestionHandler}
|
|
188
|
+
{...(enableAdditionalInformation && fieldDescription
|
|
189
|
+
? {
|
|
190
|
+
additionalInfo: {
|
|
191
|
+
heading: label,
|
|
192
|
+
content: fieldDescription
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
: {})}
|
|
186
196
|
/>
|
|
187
197
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
188
198
|
);
|
|
@@ -204,7 +214,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
204
214
|
variant: 'inline',
|
|
205
215
|
formatter: '',
|
|
206
216
|
isTableFormatter: false,
|
|
207
|
-
hasSuggestions: false
|
|
217
|
+
hasSuggestions: false,
|
|
218
|
+
enableAdditionalInformation: false
|
|
208
219
|
};
|
|
209
220
|
|
|
210
221
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -225,7 +236,8 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
225
236
|
variant: PropTypes.string,
|
|
226
237
|
formatter: PropTypes.string,
|
|
227
238
|
isTableFormatter: PropTypes.bool,
|
|
228
|
-
hasSuggestions: PropTypes.bool
|
|
239
|
+
hasSuggestions: PropTypes.bool,
|
|
240
|
+
enableAdditionalInformation: PropTypes.bool
|
|
229
241
|
};
|
|
230
242
|
|
|
231
243
|
export default {{COMPONENT_CLASS_NAME}};
|