@pega/custom-dx-components 0.23.16 → 0.23.18
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 +5 -5
- package/src/tasks/create/templates/Constellation/Field/Boolean/index.jsx.mustache +2 -14
- package/src/tasks/create/templates/Constellation/Field/Date/config.json.mustache +0 -5
- package/src/tasks/create/templates/Constellation/Field/Date/index.jsx.mustache +3 -18
- package/src/tasks/create/templates/Constellation/Field/DateTime/index.jsx.mustache +3 -18
- package/src/tasks/create/templates/Constellation/Field/Decimal/index.jsx.mustache +5 -20
- package/src/tasks/create/templates/Constellation/Field/Decimal-Currency/index.jsx.mustache +5 -19
- package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache +7 -22
- package/src/tasks/create/templates/Constellation/Field/Integer/index.jsx.mustache +5 -21
- package/src/tasks/create/templates/Constellation/Field/Picklist/index.jsx.mustache +3 -24
- package/src/tasks/create/templates/Constellation/Field/Text-Email/index.jsx.mustache +3 -18
- package/src/tasks/create/templates/Constellation/Field/Text-Input/index.jsx.mustache +3 -15
- package/src/tasks/create/templates/Constellation/Field/Text-Paragraph/index.jsx.mustache +3 -16
- package/src/tasks/create/templates/Constellation/Field/Text-Phone/index.jsx.mustache +3 -18
- package/src/tasks/create/templates/Constellation/Field/Text-URL/index.jsx.mustache +3 -18
- package/src/tasks/create/templates/Constellation/Field/TimeofDay/index.jsx.mustache +3 -18
- package/src/tasks/create/templates/Constellation/Template/DETAILS/demo.stories.jsx.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/demo.stories.jsx.mustache +3 -0
- package/src/tasks/create/templates/Constellation/Template/DETAILS-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/FORM/demo.stories.jsx.mustache +5 -2
- package/src/tasks/create/templates/Constellation/Template/FORM/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Template/FORM-region/demo.stories.jsx.mustache +5 -2
- package/src/tasks/create/templates/Constellation/Template/FORM-region/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Widget/CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/Operator.jsx.mustache +2 -2
- package/src/tasks/create/templates/Constellation/Widget/PAGE-CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Launchpad/Widget/CASE/index.jsx.mustache +2 -2
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/Operator.jsx.mustache +2 -2
- package/src/tasks/create/templates/Launchpad/Widget/PAGE-CASE/index.jsx.mustache +2 -2
- package/src/tasks/init/template/package.json.mustache +1 -1
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyBoolean/index.jsx +2 -14
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyCurrency/index.jsx +3 -17
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/config.json +0 -5
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDate/index.jsx +3 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDateTime/index.jsx +3 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDecimal/index.jsx +3 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyEmail/index.jsx +3 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyInteger/index.jsx +3 -19
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyParagraph/index.jsx +3 -16
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPercentage/index.jsx +3 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPhone/index.jsx +3 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyPicklist/index.jsx +3 -24
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTextInput/index.jsx +3 -15
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTimeOfDay/index.jsx +3 -18
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Constellation/Pega_DXIL_MyURL/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyBoolean/index.jsx +2 -14
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyCurrency/index.jsx +3 -17
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/config.json +0 -5
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDate/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDateTime/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDecimal/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyEmail/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyInteger/index.jsx +3 -19
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPageCaseWidget/index.jsx +1 -1
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyParagraph/index.jsx +3 -16
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPercentage/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPhone/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyPicklist/index.jsx +3 -24
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTextInput/index.jsx +3 -15
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTimeOfDay/index.jsx +3 -18
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnDetails/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyTwoColumnForm/demo.stories.jsx +3 -0
- package/tests/assets/components/createAll/Launchpad/Pega_DXIL_MyURL/index.jsx +3 -18
- package/tests/functional/localCreateBuildAllDeleteAll.test.js +13 -4
- package/tests/functional/localCreatePublishAllDeleteAll.test.js +13 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/custom-dx-components",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.18",
|
|
4
4
|
"description": "Utility for building custom UI components",
|
|
5
5
|
"bin": "./bin/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"type": "module",
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@babel/core": "^7.
|
|
19
|
-
"@babel/plugin-
|
|
20
|
-
"@babel/preset-react": "^7.
|
|
18
|
+
"@babel/core": "^7.23.3",
|
|
19
|
+
"@babel/plugin-transform-class-properties": "^7.23.3",
|
|
20
|
+
"@babel/preset-react": "^7.23.3",
|
|
21
21
|
"adm-zip": "^0.5.9",
|
|
22
22
|
"ajv": "^8.12.0",
|
|
23
23
|
"ajv-keywords": "^5.1.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"custom-components"
|
|
65
65
|
],
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@babel/preset-env": "^7.
|
|
67
|
+
"@babel/preset-env": "^7.23.3",
|
|
68
68
|
"@pega/configs": "^0.4.0",
|
|
69
69
|
"@pega/prettier-config": "^0.5.3",
|
|
70
70
|
"@types/jest": "^29.5.3",
|
|
@@ -29,21 +29,12 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
29
29
|
displayMode,
|
|
30
30
|
variant,
|
|
31
31
|
trueLabel,
|
|
32
|
-
falseLabel
|
|
33
|
-
fieldMetadata
|
|
32
|
+
falseLabel
|
|
34
33
|
} = props;
|
|
35
34
|
const pConn = getPConnect();
|
|
36
35
|
const actions = pConn.getActionsApi();
|
|
37
36
|
const propName = pConn.getStateProps().value;
|
|
38
37
|
|
|
39
|
-
const fieldAdditionalInfo = fieldMetadata?.additionalInformation;
|
|
40
|
-
const additionalInfo = fieldAdditionalInfo
|
|
41
|
-
? {
|
|
42
|
-
heading: caption,
|
|
43
|
-
content: fieldAdditionalInfo
|
|
44
|
-
}
|
|
45
|
-
: undefined;
|
|
46
|
-
|
|
47
38
|
let { readOnly, required, disabled } = props;
|
|
48
39
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
49
40
|
(prop) => prop === true || (typeof prop === 'string' && prop === 'true')
|
|
@@ -71,7 +62,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
71
62
|
pConn.getValidationApi().validate(event.target.checked);
|
|
72
63
|
}}
|
|
73
64
|
data-testid={testId}
|
|
74
|
-
additionalInfo={additionalInfo}
|
|
75
65
|
/>
|
|
76
66
|
);
|
|
77
67
|
|
|
@@ -155,7 +145,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
155
145
|
displayValue: 'Yes/No',
|
|
156
146
|
trueLabel: '',
|
|
157
147
|
falseLabel: '',
|
|
158
|
-
fieldMetadata: {}
|
|
159
148
|
};
|
|
160
149
|
|
|
161
150
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -175,8 +164,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
175
164
|
variant: PropTypes.string,
|
|
176
165
|
displayValue: PropTypes.string,
|
|
177
166
|
trueLabel: PropTypes.string,
|
|
178
|
-
falseLabel: PropTypes.string
|
|
179
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any)
|
|
167
|
+
falseLabel: PropTypes.string
|
|
180
168
|
};
|
|
181
169
|
|
|
182
170
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -38,9 +38,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
38
38
|
additionalProps,
|
|
39
39
|
displayMode,
|
|
40
40
|
variant,
|
|
41
|
-
hasSuggestions
|
|
42
|
-
fieldMetadata,
|
|
43
|
-
enableAdditionalInformation
|
|
41
|
+
hasSuggestions
|
|
44
42
|
} = props;
|
|
45
43
|
|
|
46
44
|
let {formatter} = props;
|
|
@@ -184,14 +182,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
184
182
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
185
183
|
);
|
|
186
184
|
} 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
186
|
dateComponent = (
|
|
197
187
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -200,7 +190,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
200
190
|
label={label}
|
|
201
191
|
labelHidden={hideLabel}
|
|
202
192
|
info={validatemessage || helperText}
|
|
203
|
-
additionalInfo={additionalInfo}
|
|
204
193
|
status={status}
|
|
205
194
|
value={value || undefined}
|
|
206
195
|
disabled={disabled}
|
|
@@ -240,9 +229,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
240
229
|
displayMode: null,
|
|
241
230
|
variant: "inline",
|
|
242
231
|
formatter: "defaultDate",
|
|
243
|
-
hasSuggestions: false
|
|
244
|
-
fieldMetadata: {},
|
|
245
|
-
enableAdditionalInformation: false
|
|
232
|
+
hasSuggestions: false
|
|
246
233
|
};
|
|
247
234
|
|
|
248
235
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -264,9 +251,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
264
251
|
displayMode: PropTypes.string,
|
|
265
252
|
variant: PropTypes.string,
|
|
266
253
|
formatter: PropTypes.string,
|
|
267
|
-
hasSuggestions: PropTypes.bool
|
|
268
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
269
|
-
enableAdditionalInformation: PropTypes.bool
|
|
254
|
+
hasSuggestions: PropTypes.bool
|
|
270
255
|
};
|
|
271
256
|
|
|
272
257
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -40,22 +40,12 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
40
40
|
additionalProps,
|
|
41
41
|
displayMode,
|
|
42
42
|
variant,
|
|
43
|
-
hasSuggestions
|
|
44
|
-
fieldMetadata,
|
|
45
|
-
enableAdditionalInformation
|
|
43
|
+
hasSuggestions
|
|
46
44
|
} = props;
|
|
47
45
|
let { formatter } = props;
|
|
48
46
|
const pConn = getPConnect();
|
|
49
47
|
const actions = pConn.getActionsApi();
|
|
50
48
|
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;
|
|
59
49
|
|
|
60
50
|
const environmentInfo = PCore.getEnvironmentInfo();
|
|
61
51
|
const timezone = environmentInfo && environmentInfo.getTimeZone();
|
|
@@ -191,7 +181,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
191
181
|
label={label}
|
|
192
182
|
labelHidden={hideLabel}
|
|
193
183
|
info={validatemessage || helperText}
|
|
194
|
-
additionalInfo={additionalInfo}
|
|
195
184
|
status={status}
|
|
196
185
|
value={DateTimeFormatter.convertToTimezone(value, { timezone }) || undefined}
|
|
197
186
|
withSeconds={withSeconds}
|
|
@@ -234,9 +223,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
234
223
|
displayMode: null,
|
|
235
224
|
variant: "inline",
|
|
236
225
|
Format: "defaultDateTime",
|
|
237
|
-
hasSuggestions: false
|
|
238
|
-
fieldMetadata: {},
|
|
239
|
-
enableAdditionalInformation: false
|
|
226
|
+
hasSuggestions: false
|
|
240
227
|
};
|
|
241
228
|
|
|
242
229
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -261,9 +248,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
261
248
|
variant: PropTypes.string,
|
|
262
249
|
formatter: PropTypes.string,
|
|
263
250
|
Format: PropTypes.string,
|
|
264
|
-
hasSuggestions: PropTypes.bool
|
|
265
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
266
|
-
enableAdditionalInformation: PropTypes.bool
|
|
251
|
+
hasSuggestions: PropTypes.bool
|
|
267
252
|
};
|
|
268
253
|
|
|
269
254
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -30,9 +30,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
30
30
|
notation,
|
|
31
31
|
currencyISOCode,
|
|
32
32
|
isTableFormatter,
|
|
33
|
-
hasSuggestions
|
|
34
|
-
fieldMetadata,
|
|
35
|
-
enableAdditionalInformation
|
|
33
|
+
hasSuggestions
|
|
36
34
|
} = props;
|
|
37
35
|
let { showGroupSeparators } = props;
|
|
38
36
|
let { currencyDisplay } = props;
|
|
@@ -40,14 +38,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
40
38
|
const actions = pConn.getActionsApi();
|
|
41
39
|
const propName = pConn.getStateProps().value;
|
|
42
40
|
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;
|
|
51
41
|
const hasValueChange = useRef(false);
|
|
52
42
|
|
|
53
43
|
let { readOnly, required, disabled } = props;
|
|
@@ -110,7 +100,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
110
100
|
}
|
|
111
101
|
|
|
112
102
|
|
|
113
|
-
{{! pick new
|
|
103
|
+
{{! pick new delimiters for mustache }}
|
|
114
104
|
{{=<% %>=}}
|
|
115
105
|
|
|
116
106
|
const displayComp =
|
|
@@ -138,7 +128,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
138
128
|
/>
|
|
139
129
|
);
|
|
140
130
|
|
|
141
|
-
<%={{ }}=%> {{! revert
|
|
131
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
142
132
|
|
|
143
133
|
switch (displayMode) {
|
|
144
134
|
case 'DISPLAY_ONLY': {
|
|
@@ -200,7 +190,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
200
190
|
numberOfDecimals={numberOfDecimals}
|
|
201
191
|
showGroupSeparators={showGroupSeparators}
|
|
202
192
|
data-testid={testId}
|
|
203
|
-
additionalInfo={additionalInfo}
|
|
204
193
|
onChange={(enteredValue) => {
|
|
205
194
|
if (hasSuggestions) {
|
|
206
195
|
setStatus(undefined);
|
|
@@ -250,9 +239,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
250
239
|
currencyDisplay: 'symbol',
|
|
251
240
|
currencyDecimalPrecision: 'auto',
|
|
252
241
|
isTableFormatter: false,
|
|
253
|
-
hasSuggestions: false
|
|
254
|
-
fieldMetadata: {},
|
|
255
|
-
enableAdditionalInformation: false
|
|
242
|
+
hasSuggestions: false
|
|
256
243
|
};
|
|
257
244
|
|
|
258
245
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -280,9 +267,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
280
267
|
currencyDisplay: PropTypes.string,
|
|
281
268
|
currencyDecimalPrecision: PropTypes.string,
|
|
282
269
|
isTableFormatter: PropTypes.bool,
|
|
283
|
-
hasSuggestions: PropTypes.bool
|
|
284
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
285
|
-
enableAdditionalInformation: PropTypes.bool
|
|
270
|
+
hasSuggestions: PropTypes.bool
|
|
286
271
|
};
|
|
287
272
|
|
|
288
273
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -46,23 +46,13 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
46
46
|
negative,
|
|
47
47
|
notation,
|
|
48
48
|
isTableFormatter,
|
|
49
|
-
hasSuggestions
|
|
50
|
-
fieldMetadata,
|
|
51
|
-
enableAdditionalInformation
|
|
49
|
+
hasSuggestions
|
|
52
50
|
} = props;
|
|
53
51
|
let { currencyDisplay } = props;
|
|
54
52
|
const pConn = getPConnect();
|
|
55
53
|
const actions = pConn.getActionsApi();
|
|
56
54
|
const propName = pConn.getStateProps().value;
|
|
57
55
|
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;
|
|
66
56
|
|
|
67
57
|
let { readOnly, required, disabled } = props;
|
|
68
58
|
|
|
@@ -105,7 +95,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
105
95
|
|
|
106
96
|
const displayValue = !value && value !== 0 ? undefined : Number(currencyValue);
|
|
107
97
|
|
|
108
|
-
{{! pick new
|
|
98
|
+
{{! pick new delimiters for mustache }}
|
|
109
99
|
{{=<% %>=}}
|
|
110
100
|
|
|
111
101
|
displayComp = (
|
|
@@ -161,7 +151,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
161
151
|
);
|
|
162
152
|
}
|
|
163
153
|
|
|
164
|
-
<%={{ }}=%> {{! revert
|
|
154
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
165
155
|
|
|
166
156
|
switch (displayMode) {
|
|
167
157
|
case 'DISPLAY_ONLY': {
|
|
@@ -224,7 +214,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
224
214
|
readOnly={readOnly}
|
|
225
215
|
required={required}
|
|
226
216
|
data-testid={testId}
|
|
227
|
-
additionalInfo={additionalInfo}
|
|
228
217
|
onChange={(enteredValue) => {
|
|
229
218
|
if (hasSuggestions) {
|
|
230
219
|
setStatus(undefined);
|
|
@@ -275,8 +264,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
275
264
|
isTableFormatter: false,
|
|
276
265
|
alwaysShowISOCode: false,
|
|
277
266
|
hasSuggestions: false,
|
|
278
|
-
fieldMetadata: {}
|
|
279
|
-
enableAdditionalInformation: false
|
|
267
|
+
fieldMetadata: {}
|
|
280
268
|
};
|
|
281
269
|
|
|
282
270
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -306,9 +294,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
306
294
|
currencyDecimalPrecision: PropTypes.string,
|
|
307
295
|
isTableFormatter: PropTypes.bool,
|
|
308
296
|
alwaysShowISOCode: PropTypes.bool,
|
|
309
|
-
hasSuggestions: PropTypes.bool
|
|
310
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
311
|
-
enableAdditionalInformation: PropTypes.bool
|
|
297
|
+
hasSuggestions: PropTypes.bool
|
|
312
298
|
};
|
|
313
299
|
|
|
314
300
|
export default {{COMPONENT_CLASS_NAME}};
|
package/src/tasks/create/templates/Constellation/Field/Decimal-Percentage/index.jsx.mustache
CHANGED
|
@@ -35,23 +35,13 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
35
35
|
variant,
|
|
36
36
|
formatter,
|
|
37
37
|
isTableFormatter,
|
|
38
|
-
hasSuggestions
|
|
39
|
-
fieldMetadata,
|
|
40
|
-
enableAdditionalInformation
|
|
38
|
+
hasSuggestions
|
|
41
39
|
} = props;
|
|
42
40
|
let { showGroupSeparators } = props;
|
|
43
41
|
const pConn = getPConnect();
|
|
44
42
|
const actions = pConn.getActionsApi();
|
|
45
43
|
const propName = pConn.getStateProps().value;
|
|
46
44
|
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
46
|
const hasValueChange = useRef(false);
|
|
57
47
|
|
|
@@ -112,7 +102,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
112
102
|
}
|
|
113
103
|
}
|
|
114
104
|
|
|
115
|
-
{{! pick new
|
|
105
|
+
{{! pick new delimiters for mustache }}
|
|
116
106
|
{{=<% %>=}}
|
|
117
107
|
|
|
118
108
|
displayComp = (
|
|
@@ -143,7 +133,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
143
133
|
);
|
|
144
134
|
}
|
|
145
135
|
|
|
146
|
-
<%={{ }}=%> {{! revert
|
|
136
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
147
137
|
|
|
148
138
|
return displayMode === 'DISPLAY_ONLY' ? (
|
|
149
139
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -160,7 +150,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
160
150
|
);
|
|
161
151
|
}
|
|
162
152
|
|
|
163
|
-
{{! pick new
|
|
153
|
+
{{! pick new delimiters for mustache }}
|
|
164
154
|
{{=<% %>=}}
|
|
165
155
|
|
|
166
156
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
@@ -175,7 +165,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
175
165
|
/>
|
|
176
166
|
);
|
|
177
167
|
|
|
178
|
-
<%={{ }}=%> {{! revert
|
|
168
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
179
169
|
|
|
180
170
|
return (
|
|
181
171
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -209,7 +199,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
209
199
|
label={label}
|
|
210
200
|
labelHidden={hideLabel}
|
|
211
201
|
info={validatemessage || helperText}
|
|
212
|
-
additionalInfo={additionalInfo}
|
|
213
202
|
value={percentageValue}
|
|
214
203
|
status={status}
|
|
215
204
|
placeholder={placeholder}
|
|
@@ -264,9 +253,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
264
253
|
currencyISOCode: 'USD',
|
|
265
254
|
formatter: '',
|
|
266
255
|
isTableFormatter: false,
|
|
267
|
-
hasSuggestions: false
|
|
268
|
-
fieldMetadata: {},
|
|
269
|
-
enableAdditionalInformation: false
|
|
256
|
+
hasSuggestions: false
|
|
270
257
|
};
|
|
271
258
|
|
|
272
259
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -289,9 +276,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
289
276
|
formatter: PropTypes.string,
|
|
290
277
|
currencyISOCode: PropTypes.string,
|
|
291
278
|
isTableFormatter: PropTypes.bool,
|
|
292
|
-
hasSuggestions: PropTypes.bool
|
|
293
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
294
|
-
enableAdditionalInformation: PropTypes.bool
|
|
279
|
+
hasSuggestions: PropTypes.bool
|
|
295
280
|
};
|
|
296
281
|
|
|
297
282
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -37,9 +37,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
37
37
|
negative,
|
|
38
38
|
notation,
|
|
39
39
|
isTableFormatter,
|
|
40
|
-
hasSuggestions
|
|
41
|
-
fieldMetadata,
|
|
42
|
-
enableAdditionalInformation
|
|
40
|
+
hasSuggestions
|
|
43
41
|
} = props;
|
|
44
42
|
let { showGroupSeparators } = props;
|
|
45
43
|
let { currencyDisplay } = props;
|
|
@@ -48,14 +46,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
48
46
|
const propName = pConn.getStateProps().value;
|
|
49
47
|
const [integerValue, setIntegerValue] = useState(value?.toString());
|
|
50
48
|
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
50
|
const hasValueChange = useRef(false);
|
|
61
51
|
|
|
@@ -123,7 +113,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
123
113
|
}
|
|
124
114
|
}
|
|
125
115
|
|
|
126
|
-
{{! pick new
|
|
116
|
+
{{! pick new delimiters for mustache }}
|
|
127
117
|
{{=<% %>=}}
|
|
128
118
|
|
|
129
119
|
const displayComp =
|
|
@@ -152,7 +142,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
152
142
|
/>
|
|
153
143
|
);
|
|
154
144
|
|
|
155
|
-
<%={{ }}=%> {{! revert
|
|
145
|
+
<%={{ }}=%> {{! revert delimiters for mustache }}
|
|
156
146
|
|
|
157
147
|
switch (displayMode) {
|
|
158
148
|
case 'DISPLAY_ONLY': {
|
|
@@ -221,7 +211,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
221
211
|
label={label}
|
|
222
212
|
labelHidden={hideLabel}
|
|
223
213
|
info={validatemessage || helperText}
|
|
224
|
-
additionalInfo={additionalInfo}
|
|
225
214
|
value={!integerValue ? sliderDefaultValue : Number(integerValue)}
|
|
226
215
|
status={status}
|
|
227
216
|
placeholder={placeholder}
|
|
@@ -249,7 +238,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
249
238
|
label={label}
|
|
250
239
|
labelHidden={hideLabel}
|
|
251
240
|
info={validatemessage || helperText}
|
|
252
|
-
additionalInfo={additionalInfo}
|
|
253
241
|
value={integerValue}
|
|
254
242
|
status={status}
|
|
255
243
|
placeholder={displayAs === 'input' ? placeholder : ''}
|
|
@@ -308,9 +296,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
308
296
|
currencyDisplay: 'symbol',
|
|
309
297
|
currencyDecimalPrecision: 'auto',
|
|
310
298
|
isTableFormatter: false,
|
|
311
|
-
hasSuggestions: false
|
|
312
|
-
fieldMetadata: {},
|
|
313
|
-
enableAdditionalInformation: false
|
|
299
|
+
hasSuggestions: false
|
|
314
300
|
};
|
|
315
301
|
|
|
316
302
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -345,9 +331,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
345
331
|
currencyDisplay: PropTypes.string,
|
|
346
332
|
currencyDecimalPrecision: PropTypes.string,
|
|
347
333
|
isTableFormatter: PropTypes.bool,
|
|
348
|
-
hasSuggestions: PropTypes.bool
|
|
349
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
350
|
-
enableAdditionalInformation: PropTypes.bool
|
|
334
|
+
hasSuggestions: PropTypes.bool
|
|
351
335
|
};
|
|
352
336
|
|
|
353
337
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -96,9 +96,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
96
96
|
variant,
|
|
97
97
|
fieldMetadata,
|
|
98
98
|
isTableFormatter,
|
|
99
|
-
hasSuggestions
|
|
100
|
-
enableAdditionalInformation,
|
|
101
|
-
additionalInfo
|
|
99
|
+
hasSuggestions
|
|
102
100
|
} = props;
|
|
103
101
|
const { formatter } = props;
|
|
104
102
|
const pConnect = getPConnect();
|
|
@@ -107,8 +105,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
107
105
|
const className = pConnect.getCaseInfo().getClassName();
|
|
108
106
|
const refName = propName?.slice(propName.lastIndexOf('.') + 1);
|
|
109
107
|
|
|
110
|
-
const fieldDescription = fieldMetadata?.description;
|
|
111
|
-
|
|
112
108
|
let { readOnly, required, disabled } = props;
|
|
113
109
|
[readOnly, required, disabled] = [readOnly, required, disabled].map(
|
|
114
110
|
(prop) => prop === true || (typeof prop === 'string' && prop === 'true')
|
|
@@ -266,11 +262,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
266
262
|
suggestionsHandler(accepted, pConnect, setStatus);
|
|
267
263
|
};
|
|
268
264
|
|
|
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
266
|
return (
|
|
276
267
|
<Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
@@ -300,11 +291,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
300
291
|
pConnect.getValidationApi().validate(event.target.value);
|
|
301
292
|
}}
|
|
302
293
|
onResolveSuggestion={onResolveSuggestionHandler}
|
|
303
|
-
{...(additionalInfo || (enableAdditionalInformation && fieldDescription)
|
|
304
|
-
? {
|
|
305
|
-
additionalInfo: additionalInfoProp
|
|
306
|
-
}
|
|
307
|
-
: {})}
|
|
308
294
|
>
|
|
309
295
|
{items}
|
|
310
296
|
</Select>
|
|
@@ -331,9 +317,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
331
317
|
variant: 'inline',
|
|
332
318
|
formatter: '',
|
|
333
319
|
isTableFormatter: false,
|
|
334
|
-
hasSuggestions: false
|
|
335
|
-
enableAdditionalInformation: false,
|
|
336
|
-
additionalInfo: null
|
|
320
|
+
hasSuggestions: false
|
|
337
321
|
};
|
|
338
322
|
|
|
339
323
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -362,12 +346,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
362
346
|
variant: PropTypes.string,
|
|
363
347
|
formatter: PropTypes.string,
|
|
364
348
|
isTableFormatter: PropTypes.bool,
|
|
365
|
-
hasSuggestions: PropTypes.bool
|
|
366
|
-
enableAdditionalInformation: PropTypes.bool,
|
|
367
|
-
additionalInfo: PropTypes.shape({
|
|
368
|
-
heading: PropTypes.string,
|
|
369
|
-
content: PropTypes.string
|
|
370
|
-
})
|
|
349
|
+
hasSuggestions: PropTypes.bool
|
|
371
350
|
};
|
|
372
351
|
|
|
373
352
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -70,22 +70,12 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
70
70
|
additionalProps,
|
|
71
71
|
variant,
|
|
72
72
|
isTableFormatter,
|
|
73
|
-
hasSuggestions
|
|
74
|
-
fieldMetadata,
|
|
75
|
-
enableAdditionalInformation
|
|
73
|
+
hasSuggestions
|
|
76
74
|
} = props;
|
|
77
75
|
const { formatter } = props;
|
|
78
76
|
const pConn = getPConnect();
|
|
79
77
|
const actions = pConn.getActionsApi();
|
|
80
78
|
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
80
|
const hasValueChange = useRef(false);
|
|
91
81
|
|
|
@@ -168,7 +158,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
168
158
|
label={label}
|
|
169
159
|
labelHidden={hideLabel}
|
|
170
160
|
info={validatemessage || helperText}
|
|
171
|
-
additionalInfo={additionalInfo}
|
|
172
161
|
value={inputValue}
|
|
173
162
|
status={status}
|
|
174
163
|
placeholder={placeholder}
|
|
@@ -217,9 +206,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
217
206
|
variant: 'inline',
|
|
218
207
|
formatter: '',
|
|
219
208
|
isTableFormatter: false,
|
|
220
|
-
hasSuggestions: false
|
|
221
|
-
fieldMetadata: {},
|
|
222
|
-
enableAdditionalInformation: false
|
|
209
|
+
hasSuggestions: false
|
|
223
210
|
};
|
|
224
211
|
|
|
225
212
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -239,9 +226,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
239
226
|
variant: PropTypes.string,
|
|
240
227
|
formatter: PropTypes.string,
|
|
241
228
|
isTableFormatter: PropTypes.bool,
|
|
242
|
-
hasSuggestions: PropTypes.bool
|
|
243
|
-
fieldMetadata: PropTypes.objectOf(PropTypes.any),
|
|
244
|
-
enableAdditionalInformation: PropTypes.bool
|
|
229
|
+
hasSuggestions: PropTypes.bool
|
|
245
230
|
};
|
|
246
231
|
|
|
247
232
|
export default {{COMPONENT_CLASS_NAME}};
|
|
@@ -73,15 +73,13 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
73
73
|
displayAsStatus,
|
|
74
74
|
variant,
|
|
75
75
|
hasSuggestions,
|
|
76
|
-
isTableFormatter
|
|
77
|
-
enableAdditionalInformation
|
|
76
|
+
isTableFormatter
|
|
78
77
|
} = props;
|
|
79
78
|
const { formatter } = props;
|
|
80
79
|
const pConn = getPConnect();
|
|
81
80
|
const actions = pConn.getActionsApi();
|
|
82
81
|
const propName = pConn.getStateProps().value;
|
|
83
82
|
const maxLength = fieldMetadata?.maxLength;
|
|
84
|
-
const fieldDescription = fieldMetadata?.description;
|
|
85
83
|
const hasValueChange = useRef(false);
|
|
86
84
|
|
|
87
85
|
let { value, readOnly, required, disabled } = props;
|
|
@@ -191,14 +189,6 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
191
189
|
}
|
|
192
190
|
}}
|
|
193
191
|
onResolveSuggestion={onResolveSuggestionHandler}
|
|
194
|
-
{...(enableAdditionalInformation && fieldDescription
|
|
195
|
-
? {
|
|
196
|
-
additionalInfo: {
|
|
197
|
-
heading: label,
|
|
198
|
-
content: fieldDescription
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
: {})}
|
|
202
192
|
/>
|
|
203
193
|
</Styled{{COMPONENT_CLASS_NAME}}Wrapper>
|
|
204
194
|
);
|
|
@@ -221,8 +211,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
221
211
|
variant: 'inline',
|
|
222
212
|
formatter: '',
|
|
223
213
|
isTableFormatter: false,
|
|
224
|
-
hasSuggestions: false
|
|
225
|
-
enableAdditionalInformation: false
|
|
214
|
+
hasSuggestions: false
|
|
226
215
|
};
|
|
227
216
|
|
|
228
217
|
{{COMPONENT_CLASS_NAME}}.propTypes = {
|
|
@@ -244,8 +233,7 @@ const {{COMPONENT_CLASS_NAME}} = props => {
|
|
|
244
233
|
variant: PropTypes.string,
|
|
245
234
|
formatter: PropTypes.string,
|
|
246
235
|
isTableFormatter: PropTypes.bool,
|
|
247
|
-
hasSuggestions: PropTypes.bool
|
|
248
|
-
enableAdditionalInformation: PropTypes.bool
|
|
236
|
+
hasSuggestions: PropTypes.bool
|
|
249
237
|
};
|
|
250
238
|
|
|
251
239
|
export default {{COMPONENT_CLASS_NAME}};
|