@pega/dx-component-builder-sdk 23.1.12 → 23.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/package.json +1 -1
- package/src/tasks/create/templates/SDK-React/field/Boolean/index.tsx.mustache +3 -2
- package/src/tasks/create/templates/SDK-React/field/DateTime/demo.stories.tsx.mustache +8 -1
- package/src/tasks/create/templates/SDK-React/field/Decimal/index.tsx.mustache +3 -9
- package/src/tasks/create/templates/SDK-React/field/Decimal-Currency/index.tsx.mustache +7 -15
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/demo.stories.tsx.mustache +20 -0
- package/src/tasks/create/templates/SDK-React/field/Decimal-Percentage/index.tsx.mustache +38 -37
- package/src/tasks/create/templates/SDK-React/widget/CASE/index.tsx.mustache +3 -3
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/demo.stories.tsx.mustache +7 -0
- package/src/tasks/create/templates/SDK-React/widget/PAGE-CASE/index.tsx.mustache +5 -3
- package/src/tasks/map/map.js +29 -8
- package/src/tasks/publish/index.js +3 -1
- package/src/tasks/publish-all/index.js +7 -5
- package/tests/assets/sdk-a/components/create/override-sdk/template/list-view/utils.ts +4 -2
- package/tests/assets/sdk-a/components/createAll/override-sdk/template/list-view/utils.ts +4 -2
- package/tests/assets/sdk-r/components/create/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
- package/tests/assets/sdk-r/components/create/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
- package/tests/assets/sdk-r/components/create/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/field/Currency/Currency.tsx +10 -16
- package/tests/assets/sdk-r/components/create/override-sdk/field/Decimal/Decimal.tsx +6 -10
- package/tests/assets/sdk-r/components/create/override-sdk/field/Group/Group.tsx +2 -0
- package/tests/assets/sdk-r/components/create/override-sdk/field/Percentage/Percentage.tsx +41 -36
- package/tests/assets/sdk-r/components/create/override-sdk/infra/Assignment/Assignment.tsx +21 -7
- package/tests/assets/sdk-r/components/create/override-sdk/infra/NavBar/NavBar.tsx +5 -3
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseView/CaseView.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/ListView.tsx +2 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/ListView/utils.ts +3 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
- package/tests/assets/sdk-r/components/create/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
- package/tests/assets/sdk-r/components/create/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
- package/tests/assets/sdk-r/components/create/override-sdk/widget/Attachment/Attachment.tsx +12 -2
- package/tests/assets/sdk-r/components/create/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyBoolean/index.tsx +3 -2
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyCurrency/index.tsx +7 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDateTime/demo.stories.tsx +8 -1
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyDecimal/index.tsx +3 -9
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/demo.stories.tsx +20 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyPercentage/index.tsx +38 -37
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyCaseWidget/index.tsx +3 -3
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/demo.stories.tsx +7 -0
- package/tests/assets/sdk-r/components/createAll/custom-sdk/widget/Pega_DXIL_MyPageCaseWidget/index.tsx +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/designSystemExtension/Operator/Operator.tsx +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/CancelAlert/CancelAlert.tsx +95 -78
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Checkbox/Checkbox.tsx +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Currency/Currency.tsx +10 -16
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Decimal/Decimal.tsx +6 -10
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Group/Group.tsx +2 -0
- package/tests/assets/sdk-r/components/createAll/override-sdk/field/Percentage/Percentage.tsx +41 -36
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/Assignment/Assignment.tsx +21 -7
- package/tests/assets/sdk-r/components/createAll/override-sdk/infra/NavBar/NavBar.tsx +5 -3
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseSummary/CaseSummary.tsx +43 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseView/CaseView.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/CaseViewActionsMenu/CaseViewActionsMenu.tsx +34 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/ListView.tsx +2 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/ListView/utils.ts +3 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/SimpleTableManual/SimpleTableManual.tsx +28 -12
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WideNarrow/WideNarrow.tsx +1 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/template/WssNavBar/WssNavBar.tsx +4 -1
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/Attachment/Attachment.tsx +12 -2
- package/tests/assets/sdk-r/components/createAll/override-sdk/widget/QuickCreate/QuickCreate.tsx +52 -25
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/PConnProps.d.ts +0 -46
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -54
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/index.tsx +0 -73
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/mock.ts +0 -15
- package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyTestText/styles.ts +0 -15
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/config.json +0 -83
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/demo.stories.tsx +0 -59
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx +0 -101
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts +0 -16
- package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/styles.js +0 -7
- /package/src/tasks/create/templates/Constellation/field/Boolean/{demo.stories.jsx.mustache → demo.stories.tsx.mustache} +0 -0
- /package/tests/assets/sdk-r/components/createAll/custom-constellation/field/Pega_DXIL_MyBoolean/{demo.stories.jsx → demo.stories.tsx} +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
|
|
3
|
-
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import PegaDxilMyTestText from './index';
|
|
6
|
-
import { configProps } from './mock';
|
|
7
|
-
|
|
8
|
-
const meta: Meta<typeof PegaDxilMyTestText> = {
|
|
9
|
-
title: 'PegaDxilMyTestText',
|
|
10
|
-
component: PegaDxilMyTestText,
|
|
11
|
-
excludeStories: /.*Data$/
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export default meta;
|
|
15
|
-
type Story = StoryObj<typeof PegaDxilMyTestText>;
|
|
16
|
-
|
|
17
|
-
export const BasePegaDxilMyTestText: Story = args => {
|
|
18
|
-
const [value, setValue] = useState(configProps.value);
|
|
19
|
-
|
|
20
|
-
const props = {
|
|
21
|
-
value,
|
|
22
|
-
placeholder: configProps.placeholder,
|
|
23
|
-
getPConnect: () => {
|
|
24
|
-
return {
|
|
25
|
-
getActionsApi: () => {
|
|
26
|
-
return {
|
|
27
|
-
updateFieldValue: (propName, theValue) => {
|
|
28
|
-
setValue(theValue);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
getStateProps: () => {
|
|
33
|
-
return { value: '.name' };
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
},
|
|
37
|
-
onChange: event => {
|
|
38
|
-
setValue(event.target.value);
|
|
39
|
-
},
|
|
40
|
-
onBlur: () => {
|
|
41
|
-
return configProps.value;
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return <PegaDxilMyTestText {...props} {...args} />;
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
BasePegaDxilMyTestText.args = {
|
|
49
|
-
label: configProps.label,
|
|
50
|
-
helperText: configProps.helperText,
|
|
51
|
-
testId: configProps.testId,
|
|
52
|
-
readOnly: configProps.readOnly,
|
|
53
|
-
disabled: configProps.disabled,
|
|
54
|
-
required: configProps.required,
|
|
55
|
-
status: configProps.status,
|
|
56
|
-
hideLabel: configProps.hideLabel,
|
|
57
|
-
displayMode: configProps.displayMode,
|
|
58
|
-
validatemessage: configProps.validatemessage
|
|
59
|
-
};
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/index.tsx
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from 'react';
|
|
2
|
-
import { TextField } from '@material-ui/core';
|
|
3
|
-
|
|
4
|
-
import handleEvent from '@pega/react-sdk-components/lib/components/helpers/event-utils';
|
|
5
|
-
import { getComponentFromMap } from '@pega/react-sdk-components/lib/bridge/helpers/sdk_component_map';
|
|
6
|
-
import { PConnFieldProps } from '@pega/react-sdk-components/lib/types/PConnProps';
|
|
7
|
-
import StyledPegaDxilMyTestTextWrapper from './styles';
|
|
8
|
-
|
|
9
|
-
interface PegaDxilMyTestTextProps extends PConnFieldProps {
|
|
10
|
-
// If any, enter additional props that only exist on this componentName
|
|
11
|
-
fieldMetadata?: any;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// Duplicated runtime code from React SDK
|
|
15
|
-
|
|
16
|
-
// props passed in combination of props from property panel (config.json) and run time props from Constellation
|
|
17
|
-
export default function PegaDxilMyTestText(props: PegaDxilMyTestTextProps) {
|
|
18
|
-
// Get emitted components from map (so we can get any override that may exist)
|
|
19
|
-
const FieldValueList = getComponentFromMap('FieldValueList');
|
|
20
|
-
|
|
21
|
-
const {
|
|
22
|
-
getPConnect,
|
|
23
|
-
label,
|
|
24
|
-
required,
|
|
25
|
-
disabled,
|
|
26
|
-
value = '',
|
|
27
|
-
validatemessage,
|
|
28
|
-
status,
|
|
29
|
-
/* onChange, onBlur */
|
|
30
|
-
readOnly,
|
|
31
|
-
testId,
|
|
32
|
-
fieldMetadata,
|
|
33
|
-
helperText,
|
|
34
|
-
displayMode,
|
|
35
|
-
hideLabel,
|
|
36
|
-
placeholder
|
|
37
|
-
} = props;
|
|
38
|
-
|
|
39
|
-
const pConn = getPConnect();
|
|
40
|
-
const actions = pConn.getActionsApi();
|
|
41
|
-
const propName = (pConn.getStateProps() as any).value;
|
|
42
|
-
|
|
43
|
-
const helperTextToDisplay = validatemessage || helperText;
|
|
44
|
-
|
|
45
|
-
const [inputValue, setInputValue] = useState('');
|
|
46
|
-
const maxLength = fieldMetadata?.maxLength;
|
|
47
|
-
|
|
48
|
-
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
49
|
-
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
setInputValue(value);
|
|
52
|
-
}, [value]);
|
|
53
|
-
|
|
54
|
-
if (displayMode === 'LABELS_LEFT') {
|
|
55
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} />;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
59
|
-
return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
if (readOnly) {
|
|
63
|
-
readOnlyProp = { readOnly: true };
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let testProp = {};
|
|
67
|
-
|
|
68
|
-
testProp = {
|
|
69
|
-
'data-test-id': testId
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
function handleChange(event) {
|
|
73
|
-
// update internal value
|
|
74
|
-
setInputValue(event?.target?.value);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function handleBlur() {
|
|
78
|
-
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return (
|
|
82
|
-
<StyledPegaDxilMyTestTextWrapper>
|
|
83
|
-
<TextField
|
|
84
|
-
fullWidth
|
|
85
|
-
variant={readOnly ? 'standard' : 'outlined'}
|
|
86
|
-
helperText={helperTextToDisplay}
|
|
87
|
-
placeholder={placeholder ?? ''}
|
|
88
|
-
size='small'
|
|
89
|
-
required={required}
|
|
90
|
-
disabled={disabled}
|
|
91
|
-
onChange={handleChange}
|
|
92
|
-
onBlur={!readOnly ? handleBlur : undefined}
|
|
93
|
-
error={status === 'error'}
|
|
94
|
-
label={label}
|
|
95
|
-
value={inputValue}
|
|
96
|
-
InputProps={{ ...readOnlyProp, inputProps: { maxLength, ...testProp } }}
|
|
97
|
-
/>
|
|
98
|
-
</StyledPegaDxilMyTestTextWrapper>
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
package/tests/assets/sdk-r/components/createAll/custom-sdk/field/Pega_DXIL_MyTestText/mock.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
2
|
-
export const configProps = {
|
|
3
|
-
value: '',
|
|
4
|
-
label: 'Text Sample',
|
|
5
|
-
placeholder: 'Text Placeholder',
|
|
6
|
-
helperText: 'Text Helper Text',
|
|
7
|
-
testId: 'Text-12345678',
|
|
8
|
-
hasSuggestions: false,
|
|
9
|
-
disabled: false,
|
|
10
|
-
readOnly: false,
|
|
11
|
-
required: false,
|
|
12
|
-
displayMode: '',
|
|
13
|
-
status: '',
|
|
14
|
-
hideLabel: false,
|
|
15
|
-
validatemessage: ''
|
|
16
|
-
};
|
|
File without changes
|