@pega/react-sdk-components 8.23.10 → 8.23.11-debug2
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/lib/bridge/Context/StoreContext.d.ts +3 -2
- package/lib/bridge/Context/StoreContext.d.ts.map +1 -1
- package/lib/bridge/Context/StoreContext.js +2 -3
- package/lib/bridge/Context/StoreContext.js.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.d.ts +1 -0
- package/lib/bridge/helpers/sdk_component_map.d.ts.map +1 -1
- package/lib/bridge/helpers/sdk_component_map.js +22 -0
- package/lib/bridge/helpers/sdk_component_map.js.map +1 -1
- package/lib/bridge/react_pconnect.d.ts.map +1 -1
- package/lib/bridge/react_pconnect.js +2 -14
- package/lib/bridge/react_pconnect.js.map +1 -1
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts +13 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js +26 -0
- package/lib/components/designSystemExtension/AlertBanner/AlertBanner.js.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/index.d.ts +2 -0
- package/lib/components/designSystemExtension/AlertBanner/index.d.ts.map +1 -0
- package/lib/components/designSystemExtension/AlertBanner/index.js +2 -0
- package/lib/components/designSystemExtension/AlertBanner/index.js.map +1 -0
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.d.ts.map +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js +1 -1
- package/lib/components/designSystemExtension/FieldGroupList/FieldGroupList.js.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.d.ts.map +1 -1
- package/lib/components/designSystemExtension/Operator/Operator.js +12 -10
- package/lib/components/designSystemExtension/Operator/Operator.js.map +1 -1
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js +2 -2
- package/lib/components/designSystemExtension/WssQuickCreate/WssQuickCreate.js.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.d.ts.map +1 -1
- package/lib/components/field/CancelAlert/CancelAlert.js +9 -7
- package/lib/components/field/CancelAlert/CancelAlert.js.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.d.ts.map +1 -1
- package/lib/components/field/Checkbox/Checkbox.js +3 -3
- package/lib/components/field/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts +1 -1
- package/lib/components/field/Currency/currency-utils.d.ts.map +1 -1
- package/lib/components/field/Currency/currency-utils.js.map +1 -1
- package/lib/components/field/Date/Date.d.ts.map +1 -1
- package/lib/components/field/Date/Date.js +11 -5
- package/lib/components/field/Date/Date.js.map +1 -1
- package/lib/components/field/DateTime/DateTime.js +1 -1
- package/lib/components/field/DateTime/DateTime.js.map +1 -1
- package/lib/components/field/Decimal/Decimal.d.ts.map +1 -1
- package/lib/components/field/Decimal/Decimal.js +41 -8
- package/lib/components/field/Decimal/Decimal.js.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.d.ts.map +1 -1
- package/lib/components/field/Dropdown/Dropdown.js +21 -7
- package/lib/components/field/Dropdown/Dropdown.js.map +1 -1
- package/lib/components/field/Phone/Phone.d.ts.map +1 -1
- package/lib/components/field/Phone/Phone.js +2 -1
- package/lib/components/field/Phone/Phone.js.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.d.ts.map +1 -1
- package/lib/components/field/RadioButtons/RadioButtons.js +17 -4
- package/lib/components/field/RadioButtons/RadioButtons.js.map +1 -1
- package/lib/components/field/SemanticLink/utils.d.ts.map +1 -1
- package/lib/components/field/SemanticLink/utils.js.map +1 -1
- package/lib/components/field/TextInput/TextInput.d.ts.map +1 -1
- package/lib/components/field/TextInput/TextInput.js +20 -3
- package/lib/components/field/TextInput/TextInput.js.map +1 -1
- package/lib/components/field/Time/Time.d.ts.map +1 -1
- package/lib/components/field/Time/Time.js +6 -2
- package/lib/components/field/Time/Time.js.map +1 -1
- package/lib/components/field/URL/URL.d.ts.map +1 -1
- package/lib/components/field/URL/URL.js +6 -2
- package/lib/components/field/URL/URL.js.map +1 -1
- package/lib/components/field/UserReference/UserReference.d.ts.map +1 -1
- package/lib/components/field/UserReference/UserReference.js.map +1 -1
- package/lib/components/helpers/attachmentHelpers.d.ts +5 -5
- package/lib/components/helpers/attachmentHelpers.d.ts.map +1 -1
- package/lib/components/helpers/attachmentHelpers.js +2 -2
- package/lib/components/helpers/attachmentHelpers.js.map +1 -1
- package/lib/components/helpers/auth.d.ts.map +1 -1
- package/lib/components/helpers/auth.js +13 -3
- package/lib/components/helpers/auth.js.map +1 -1
- package/lib/components/helpers/authManager.d.ts.map +1 -1
- package/lib/components/helpers/authManager.js +15 -12
- package/lib/components/helpers/authManager.js.map +1 -1
- package/lib/components/helpers/case-utils.d.ts +20 -0
- package/lib/components/helpers/case-utils.d.ts.map +1 -0
- package/lib/components/helpers/case-utils.js +81 -0
- package/lib/components/helpers/case-utils.js.map +1 -0
- package/lib/components/helpers/common-utils.d.ts +2 -0
- package/lib/components/helpers/common-utils.d.ts.map +1 -0
- package/lib/components/helpers/common-utils.js +5 -0
- package/lib/components/helpers/common-utils.js.map +1 -0
- package/lib/components/helpers/config_access.d.ts.map +1 -1
- package/lib/components/helpers/config_access.js +75 -82
- package/lib/components/helpers/config_access.js.map +1 -1
- package/lib/components/helpers/data_page.d.ts.map +1 -1
- package/lib/components/helpers/data_page.js.map +1 -1
- package/lib/components/helpers/date-format-utils.d.ts.map +1 -1
- package/lib/components/helpers/date-format-utils.js +23 -14
- package/lib/components/helpers/date-format-utils.js.map +1 -1
- package/lib/components/helpers/event-utils.d.ts +1 -1
- package/lib/components/helpers/event-utils.d.ts.map +1 -1
- package/lib/components/helpers/event-utils.js.map +1 -1
- package/lib/components/helpers/field-group-utils.d.ts +15 -2
- package/lib/components/helpers/field-group-utils.d.ts.map +1 -1
- package/lib/components/helpers/field-group-utils.js +3 -3
- package/lib/components/helpers/field-group-utils.js.map +1 -1
- package/lib/components/helpers/formatters/Boolean.d.ts +3 -3
- package/lib/components/helpers/formatters/Boolean.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Boolean.js.map +1 -1
- package/lib/components/helpers/formatters/Currency.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Currency.js +4 -3
- package/lib/components/helpers/formatters/Currency.js.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.d.ts +1132 -1399
- package/lib/components/helpers/formatters/CurrencyMap.d.ts.map +1 -1
- package/lib/components/helpers/formatters/CurrencyMap.js.map +1 -1
- package/lib/components/helpers/formatters/Date.d.ts.map +1 -1
- package/lib/components/helpers/formatters/Date.js +1 -1
- package/lib/components/helpers/formatters/Date.js.map +1 -1
- package/lib/components/helpers/formatters/common.d.ts +2 -2
- package/lib/components/helpers/formatters/common.d.ts.map +1 -1
- package/lib/components/helpers/formatters/common.js +4 -5
- package/lib/components/helpers/formatters/common.js.map +1 -1
- package/lib/components/helpers/formatters/index.d.ts +1 -1
- package/lib/components/helpers/formatters/index.d.ts.map +1 -1
- package/lib/components/helpers/formatters/index.js.map +1 -1
- package/lib/components/helpers/reactContextHelpers.d.ts +3 -2
- package/lib/components/helpers/reactContextHelpers.d.ts.map +1 -1
- package/lib/components/helpers/reactContextHelpers.js.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.d.ts +2 -2
- package/lib/components/helpers/simpleTableHelpers.d.ts.map +1 -1
- package/lib/components/helpers/simpleTableHelpers.js +5 -2
- package/lib/components/helpers/simpleTableHelpers.js.map +1 -1
- package/lib/components/helpers/state-utils.d.ts +4 -0
- package/lib/components/helpers/state-utils.d.ts.map +1 -0
- package/lib/components/helpers/state-utils.js +36 -0
- package/lib/components/helpers/state-utils.js.map +1 -0
- package/lib/components/helpers/template-utils.d.ts.map +1 -1
- package/lib/components/helpers/template-utils.js +0 -1
- package/lib/components/helpers/template-utils.js.map +1 -1
- package/lib/components/helpers/utils.d.ts +1 -1
- package/lib/components/helpers/utils.d.ts.map +1 -1
- package/lib/components/helpers/utils.js +9 -3
- package/lib/components/helpers/utils.js.map +1 -1
- package/lib/components/helpers/versionHelpers.d.ts +0 -6
- package/lib/components/helpers/versionHelpers.d.ts.map +1 -1
- package/lib/components/helpers/versionHelpers.js +0 -6
- package/lib/components/helpers/versionHelpers.js.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.d.ts.map +1 -1
- package/lib/components/infra/ActionButtons/ActionButtons.js +4 -2
- package/lib/components/infra/ActionButtons/ActionButtons.js.map +1 -1
- package/lib/components/infra/Assignment/Assignment.d.ts +1 -0
- package/lib/components/infra/Assignment/Assignment.d.ts.map +1 -1
- package/lib/components/infra/Assignment/Assignment.js +27 -15
- package/lib/components/infra/Assignment/Assignment.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js +17 -9
- package/lib/components/infra/Containers/FlowContainer/FlowContainer.js.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.d.ts +12 -12
- package/lib/components/infra/Containers/FlowContainer/helpers.d.ts.map +1 -1
- package/lib/components/infra/Containers/FlowContainer/helpers.js +17 -16
- package/lib/components/infra/Containers/FlowContainer/helpers.js.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js +17 -8
- package/lib/components/infra/Containers/ModalViewContainer/ModalViewContainer.js.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.d.ts.map +1 -1
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js +4 -2
- package/lib/components/infra/Containers/ViewContainer/ViewContainer.js.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/DashboardFilter.js.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.d.ts.map +1 -1
- package/lib/components/infra/DashboardFilter/filterUtils.js.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.d.ts.map +1 -1
- package/lib/components/infra/DeferLoad/DeferLoad.js.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.d.ts.map +1 -1
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js +7 -4
- package/lib/components/infra/ErrorBoundary/ErrorBoundary.js.map +1 -1
- package/lib/components/infra/MultiStep/MultiStep.js +2 -2
- package/lib/components/infra/MultiStep/MultiStep.js.map +1 -1
- package/lib/components/infra/NavBar/NavBar.d.ts.map +1 -1
- package/lib/components/infra/NavBar/NavBar.js +6 -4
- package/lib/components/infra/NavBar/NavBar.js.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.d.ts.map +1 -1
- package/lib/components/infra/RootContainer/RootContainer.js +12 -15
- package/lib/components/infra/RootContainer/RootContainer.js.map +1 -1
- package/lib/components/infra/Stages/Stages.d.ts.map +1 -1
- package/lib/components/infra/Stages/Stages.js +2 -1
- package/lib/components/infra/Stages/Stages.js.map +1 -1
- package/lib/components/infra/View/View.d.ts +1 -1
- package/lib/components/infra/View/View.d.ts.map +1 -1
- package/lib/components/infra/View/View.js +6 -34
- package/lib/components/infra/View/View.js.map +1 -1
- package/lib/components/template/AppShell/AppShell.d.ts.map +1 -1
- package/lib/components/template/AppShell/AppShell.js +8 -8
- package/lib/components/template/AppShell/AppShell.js.map +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts +1 -1
- package/lib/components/template/CaseView/CaseView.d.ts.map +1 -1
- package/lib/components/template/CaseView/CaseView.js +37 -28
- package/lib/components/template/CaseView/CaseView.js.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts +3 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.d.ts.map +1 -1
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js +13 -8
- package/lib/components/template/CaseViewActionsMenu/CaseViewActionsMenu.js.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.d.ts.map +1 -1
- package/lib/components/template/Confirmation/Confirmation.js.map +1 -1
- package/lib/components/template/DataReference/DataReference.d.ts.map +1 -1
- package/lib/components/template/DataReference/DataReference.js.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.d.ts.map +1 -1
- package/lib/components/template/DefaultForm/DefaultForm.js +9 -5
- package/lib/components/template/DefaultForm/DefaultForm.js.map +1 -1
- package/lib/components/template/DefaultForm/utils/index.d.ts +3 -0
- package/lib/components/template/DefaultForm/utils/index.d.ts.map +1 -0
- package/lib/components/template/DefaultForm/utils/index.js +27 -0
- package/lib/components/template/DefaultForm/utils/index.js.map +1 -0
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.d.ts.map +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js +1 -1
- package/lib/components/template/FieldGroupTemplate/FieldGroupTemplate.js.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.d.ts +1 -90
- package/lib/components/template/ListView/DefaultViewMeta.d.ts.map +1 -1
- package/lib/components/template/ListView/DefaultViewMeta.js.map +1 -1
- package/lib/components/template/ListView/ListView.d.ts.map +1 -1
- package/lib/components/template/ListView/ListView.js +1 -1
- package/lib/components/template/ListView/ListView.js.map +1 -1
- package/lib/components/template/ListView/hooks.d.ts.map +1 -1
- package/lib/components/template/ListView/hooks.js +0 -1
- package/lib/components/template/ListView/hooks.js.map +1 -1
- package/lib/components/template/ListView/utils.d.ts +28 -16
- package/lib/components/template/ListView/utils.d.ts.map +1 -1
- package/lib/components/template/ListView/utils.js +1 -2
- package/lib/components/template/ListView/utils.js.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.d.ts.map +1 -1
- package/lib/components/template/MultiReferenceReadOnly/MultiReferenceReadOnly.js.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.d.ts.map +1 -1
- package/lib/components/template/PromotedFilters/PromotedFilters.js +2 -2
- package/lib/components/template/PromotedFilters/PromotedFilters.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTable/SimpleTable.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js +3 -3
- package/lib/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.js.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.d.ts.map +1 -1
- package/lib/components/template/SimpleTable/SimpleTableSelect/SimpleTableSelect.js.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.d.ts.map +1 -1
- package/lib/components/template/SubTabs/tabUtils.js.map +1 -1
- package/lib/components/template/WssNavBar/WssNavBar.js +2 -2
- package/lib/components/template/WssNavBar/WssNavBar.js.map +1 -1
- package/lib/components/widget/Attachment/Attachment.css +15 -3
- package/lib/components/widget/Attachment/Attachment.d.ts.map +1 -1
- package/lib/components/widget/Attachment/Attachment.js +29 -25
- package/lib/components/widget/Attachment/Attachment.js.map +1 -1
- package/lib/components/widget/CaseHistory/CaseHistory.js +3 -3
- package/lib/components/widget/CaseHistory/CaseHistory.js.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.d.ts.map +1 -1
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js +17 -17
- package/lib/components/widget/FileUtility/FileUtility/FileUtility.js.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.d.ts.map +1 -1
- package/lib/components/widget/QuickCreate/QuickCreate.js +2 -2
- package/lib/components/widget/QuickCreate/QuickCreate.js.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.d.ts.map +1 -1
- package/lib/components/widget/SummaryItem/SummaryItem.js +2 -2
- package/lib/components/widget/SummaryItem/SummaryItem.js.map +1 -1
- package/lib/components/widget/ToDo/ToDo.d.ts.map +1 -1
- package/lib/components/widget/ToDo/ToDo.js +10 -6
- package/lib/components/widget/ToDo/ToDo.js.map +1 -1
- package/lib/components_map.d.ts +3 -3
- package/lib/components_map.d.ts.map +1 -1
- package/lib/components_map.js +819 -818
- package/lib/components_map.js.map +1 -1
- package/lib/doc/KeyReleaseUpdates.md +44 -9
- package/package.json +1 -1
|
@@ -4,13 +4,26 @@ import Utils from '../../helpers/utils';
|
|
|
4
4
|
import handleEvent from '../../helpers/event-utils';
|
|
5
5
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
6
6
|
export default function RadioButtons(props) {
|
|
7
|
-
const { getPConnect, label, value = '', readOnly, validatemessage, helperText, status, required, inline, displayMode, hideLabel } = props;
|
|
7
|
+
const { getPConnect, label, value = '', readOnly, validatemessage, helperText, status, required, inline, displayMode, hideLabel, fieldMetadata } = props;
|
|
8
8
|
const [theSelectedButton, setSelectedButton] = useState(value);
|
|
9
9
|
const thePConn = getPConnect();
|
|
10
10
|
const theConfigProps = thePConn.getConfigProps();
|
|
11
11
|
const actionsApi = thePConn.getActionsApi();
|
|
12
12
|
const propName = thePConn.getStateProps().value;
|
|
13
13
|
const helperTextToDisplay = validatemessage || helperText;
|
|
14
|
+
const className = thePConn.getCaseInfo().getClassName();
|
|
15
|
+
let configProperty = thePConn.getRawMetadata()?.config?.value || '';
|
|
16
|
+
configProperty = configProperty.startsWith('@P') ? configProperty.substring(3) : configProperty;
|
|
17
|
+
configProperty = configProperty.startsWith('.') ? configProperty.substring(1) : configProperty;
|
|
18
|
+
const metaData = Array.isArray(fieldMetadata)
|
|
19
|
+
? fieldMetadata.filter(field => field?.classID === className)[0]
|
|
20
|
+
: fieldMetadata;
|
|
21
|
+
let displayName = metaData?.datasource?.propertyForDisplayText;
|
|
22
|
+
displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);
|
|
23
|
+
const localeContext = metaData?.datasource?.tableType === 'DataPage' ? 'datapage' : 'associated';
|
|
24
|
+
const localeClass = localeContext === 'datapage' ? '@baseclass' : className;
|
|
25
|
+
const localeName = localeContext === 'datapage' ? metaData?.datasource?.name : configProperty;
|
|
26
|
+
const localePath = localeContext === 'datapage' ? displayName : localeName;
|
|
14
27
|
// theOptions will be an array of JSON objects that are literally key/value pairs.
|
|
15
28
|
// Ex: [ {key: "Basic", value: "Basic"} ]
|
|
16
29
|
const theOptions = Utils.getOptionList(theConfigProps, thePConn.getDataObject());
|
|
@@ -19,10 +32,10 @@ export default function RadioButtons(props) {
|
|
|
19
32
|
setSelectedButton(value);
|
|
20
33
|
}, [value]);
|
|
21
34
|
if (displayMode === 'LABELS_LEFT') {
|
|
22
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
|
|
35
|
+
return (React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)) }));
|
|
23
36
|
}
|
|
24
37
|
if (displayMode === 'STACKED_LARGE_VAL') {
|
|
25
|
-
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value, variant: 'stacked' });
|
|
38
|
+
return (React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: thePConn.getLocalizedValue(value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)), variant: 'stacked' }));
|
|
26
39
|
}
|
|
27
40
|
const handleChange = event => {
|
|
28
41
|
handleEvent(actionsApi, 'changeNblur', propName, event.target.value);
|
|
@@ -33,7 +46,7 @@ export default function RadioButtons(props) {
|
|
|
33
46
|
return (React.createElement(FormControl, { error: status === 'error', required: required },
|
|
34
47
|
React.createElement(FormLabel, { component: 'legend' }, label),
|
|
35
48
|
React.createElement(RadioGroup, { value: theSelectedButton, onChange: handleChange, onBlur: !readOnly ? handleBlur : undefined, row: inline }, theOptions.map(theOption => {
|
|
36
|
-
return (React.createElement(FormControlLabel, { value: theOption.key, key: theOption.key, label: theOption.value, control: React.createElement(Radio, { key: theOption.key, color: 'primary', disabled: readOnly }) }));
|
|
49
|
+
return (React.createElement(FormControlLabel, { value: theOption.key, key: theOption.key, label: thePConn.getLocalizedValue(theOption.value, localePath, thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)), control: React.createElement(Radio, { key: theOption.key, color: 'primary', disabled: readOnly }) }));
|
|
37
50
|
})),
|
|
38
51
|
React.createElement(FormHelperText, null, helperTextToDisplay)));
|
|
39
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioButtons.js","sourceRoot":"","sources":["../../../../src/components/field/RadioButtons/RadioButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK;IACxC,MAAM,EACJ,WAAW,EACX,KAAK,EACL,KAAK,GAAG,EAAE,EACV,QAAQ,EACR,eAAe,EACf,UAAU,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,WAAW,EACX,SAAS,
|
|
1
|
+
{"version":3,"file":"RadioButtons.js","sourceRoot":"","sources":["../../../../src/components/field/RadioButtons/RadioButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EACL,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,WAAW,MAAM,2BAA2B,CAAC;AACpD,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,YAAY,C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AAS,CAAC,GAAG,EAAE,KAAK,EAAC,SAAS,EAAC,QAAQ,EAAE,QAAQ,GAAI,GAC1E,CACH,CAAC;QACJ,CAAC,CAAC,CACS;QACb,oBAAC,cAAc,QAAE,mBAAmB,CAAkB,CAC1C,CACf,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport {\n Radio,\n RadioGroup,\n FormControl,\n FormControlLabel,\n FormLabel,\n FormHelperText\n} from '@material-ui/core';\n\nimport Utils from '../../helpers/utils';\nimport handleEvent from '../../helpers/event-utils';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\nexport default function RadioButtons(props) {\n const {\n getPConnect,\n label,\n value = '',\n readOnly,\n validatemessage,\n helperText,\n status,\n required,\n inline,\n displayMode,\n hideLabel,\n fieldMetadata\n } = props;\n const [theSelectedButton, setSelectedButton] = useState(value);\n\n const thePConn = getPConnect();\n const theConfigProps = thePConn.getConfigProps();\n const actionsApi = thePConn.getActionsApi();\n const propName = thePConn.getStateProps().value;\n const helperTextToDisplay = validatemessage || helperText;\n const className = thePConn.getCaseInfo().getClassName();\n\n let configProperty = thePConn.getRawMetadata()?.config?.value || '';\n configProperty = configProperty.startsWith('@P') ? configProperty.substring(3) : configProperty;\n configProperty = configProperty.startsWith('.') ? configProperty.substring(1) : configProperty;\n\n const metaData = Array.isArray(fieldMetadata)\n ? fieldMetadata.filter(field => field?.classID === className)[0]\n : fieldMetadata;\n let displayName = metaData?.datasource?.propertyForDisplayText;\n displayName = displayName?.slice(displayName.lastIndexOf('.') + 1);\n const localeContext = metaData?.datasource?.tableType === 'DataPage' ? 'datapage' : 'associated';\n const localeClass = localeContext === 'datapage' ? '@baseclass' : className;\n const localeName = localeContext === 'datapage' ? metaData?.datasource?.name : configProperty;\n const localePath = localeContext === 'datapage' ? displayName : localeName;\n\n // theOptions will be an array of JSON objects that are literally key/value pairs.\n // Ex: [ {key: \"Basic\", value: \"Basic\"} ]\n const theOptions = Utils.getOptionList(theConfigProps, thePConn.getDataObject());\n\n useEffect(() => {\n // This update theSelectedButton which will update the UI to show the selected button correctly\n setSelectedButton(value);\n }, [value]);\n\n if (displayMode === 'LABELS_LEFT') {\n return (\n <FieldValueList\n name={hideLabel ? '' : label}\n value={thePConn.getLocalizedValue(\n value,\n localePath,\n thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)\n )}\n />\n );\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return (\n <FieldValueList\n name={hideLabel ? '' : label}\n value={thePConn.getLocalizedValue(\n value,\n localePath,\n thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)\n )}\n variant='stacked'\n />\n );\n }\n\n const handleChange = event => {\n handleEvent(actionsApi, 'changeNblur', propName, event.target.value);\n };\n\n const handleBlur = event => {\n thePConn.getValidationApi().validate(event.target.value);\n };\n\n return (\n <FormControl error={status === 'error'} required={required}>\n <FormLabel component='legend'>{label}</FormLabel>\n <RadioGroup\n value={theSelectedButton}\n onChange={handleChange}\n onBlur={!readOnly ? handleBlur : undefined}\n row={inline}\n >\n {theOptions.map(theOption => {\n return (\n <FormControlLabel\n value={theOption.key}\n key={theOption.key}\n label={thePConn.getLocalizedValue(\n theOption.value,\n localePath,\n thePConn.getLocaleRuleNameFromKeys(localeClass, localeContext, localeName)\n )}\n control={<Radio key={theOption.key} color='primary' disabled={readOnly} />}\n />\n );\n })}\n </RadioGroup>\n <FormHelperText>{helperTextToDisplay}</FormHelperText>\n </FormControl>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/field/SemanticLink/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/components/field/SemanticLink/utils.ts"],"names":[],"mappings":"AAGA,iBAAS,oBAAoB,CAAC,QAAQ,KAAA,EAAE,uBAAuB,KAAA;;;;;;EA0C9D;AAED,iBAAS,eAAe,CAAC,IAAI,KAAA,WAE5B;;;;;AAED,wBAAyD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/field/SemanticLink/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/components/field/SemanticLink/utils.ts"],"names":[],"mappings":"AAGA,SAAS,oBAAoB,CAAC,QAAQ,EAAE,uBAAuB;IAC7D,IAAI,CAAC,QAAQ,EAAE;QACb,MAAM,KAAK,CAAC,gCAAgC,CAAC,CAAC;KAC/C;IAED,IAAI,WAAW,GAAG,EAAE,CAAC;IACrB,MAAM,OAAO,GAAG,EAAE,CAAC;IACnB,MAAM,aAAa,GAAG,QAAQ,CAAC,gBAAgB,EAAE,CAAC;IAClD,MAAM,eAAe,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACnD,IAAI,aAAa,CAAC;IAElB,IAAI,aAAa,EAAE;QACjB;;;UAGE;QACF,MAAM,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE/C,kEAAkE;QAClE,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;QACxD,yDAAyD;QACzD,MAAM,UAAU,GAAG,mBAAmB,CAAC;QAEvC,IAAI,eAAe,GAAG,uBAAuB,KAAK,IAAI,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QACvG,MAAM,cAAc,GAAG,iBAAiB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/D,eAAe,GAAG,cAAc;YAC9B,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;YACzC,CAAC,CAAC,eAAe,CAAC;QACpB,aAAa,GAAG,QAAQ,CAAC,gBAAgB,CAAC,eAAe,CAAC,CAAC;KAC5D;IAED,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,UAAU,EAAE;QAC/C,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,aAAa,CAAC,UAAU,CAAC;QACtD,WAAW,GAAG,IAAI,CAAC;QACnB,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;YACrD,MAAM,QAAQ,GAAG,uBAAuB,KAAK,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAA;YACvI,OAAO,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC;SAClD;QACD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,OAAO,EAAE,CAAC;KACxD;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,eAAe,CAAC,IAAI;IAC3B,OAAO,IAAI,KAAK,EAAE,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC;AAC5D,CAAC;AAED,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,CAAC","sourcesContent":["// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 2 errors)\ndeclare const PCore: any;\n\nfunction getDataReferenceInfo(pConnect, dataRelationshipContext) {\n if (!pConnect) {\n throw Error(\"PConnect parameter is required\");\n }\n\n let dataContext = \"\";\n const payload = {};\n const pageReference = pConnect.getPageReference();\n const annotationUtils = PCore.getAnnotationUtils();\n let fieldMetadata;\n\n if (pageReference) {\n /*\n For page list the page refernce will be something like caseInfo.content.EmployeeRef[1].\n Need to extract EmployeeRef from caseInfo.content.EmployeeRef[1]\n */\n const propertySplit = pageReference.split(\".\");\n\n // Regex to match if the property is list type. Eg: EmployeeRef[1]\n const listPropertyRegex = /([a-z|A-Z]*[[][\\d]*)[\\]]$/gm;\n // Regex to match [1] part of the property EmployeeRef[1]\n const indexRegex = /([[][\\d]*[\\]])+/gm;\n\n let contextProperty = dataRelationshipContext !== null ? dataRelationshipContext : propertySplit.pop();\n const isListProperty = listPropertyRegex.test(contextProperty);\n contextProperty = isListProperty\n ? contextProperty.replace(indexRegex, \"\")\n : contextProperty;\n fieldMetadata = pConnect.getFieldMetadata(contextProperty);\n }\n\n if (!!fieldMetadata && fieldMetadata.datasource) {\n const { name, parameters } = fieldMetadata.datasource;\n dataContext = name;\n for (const [key, value] of Object.entries(parameters)) {\n const property = dataRelationshipContext !== null ? annotationUtils.getPropertyName(value) : annotationUtils.getLeafPropertyName(value)\n payload[key] = pConnect.getValue(`.${property}`);\n }\n return { dataContext, dataContextParameters: payload };\n }\n\n return {};\n}\n\nfunction isLinkTextEmpty(text) {\n return text === \"\" || text === undefined || text === null;\n}\n\nexport default { getDataReferenceInfo, isLinkTextEmpty };\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../src/components/field/TextInput/TextInput.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../../../src/components/field/TextInput/TextInput.tsx"],"names":[],"mappings":";AAKA,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,KAAK,KAAA,eA6EtC"}
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { TextField } from '@material-ui/core';
|
|
3
3
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
4
|
+
import handleEvent from '../../helpers/event-utils';
|
|
4
5
|
export default function TextInput(props) {
|
|
5
|
-
const { label, required, disabled, value = '', validatemessage, status,
|
|
6
|
+
const { getPConnect, label, required, disabled, value = '', validatemessage, status,
|
|
7
|
+
/* onChange, onBlur */
|
|
8
|
+
readOnly, testId, fieldMetadata, helperText, displayMode, hideLabel } = props;
|
|
9
|
+
const pConn = getPConnect();
|
|
10
|
+
const actions = pConn.getActionsApi();
|
|
11
|
+
const propName = pConn.getStateProps().value;
|
|
6
12
|
const helperTextToDisplay = validatemessage || helperText;
|
|
13
|
+
const [inputValue, setInputValue] = useState();
|
|
7
14
|
const maxLength = fieldMetadata?.maxLength;
|
|
8
15
|
let readOnlyProp = {}; // Note: empty if NOT ReadOnly
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setInputValue(value);
|
|
18
|
+
}, [value]);
|
|
9
19
|
if (displayMode === 'LABELS_LEFT') {
|
|
10
20
|
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
|
|
11
21
|
}
|
|
@@ -19,6 +29,13 @@ export default function TextInput(props) {
|
|
|
19
29
|
testProp = {
|
|
20
30
|
'data-test-id': testId
|
|
21
31
|
};
|
|
22
|
-
|
|
32
|
+
function handleChange(event) {
|
|
33
|
+
// update internal value
|
|
34
|
+
setInputValue(event?.target?.value);
|
|
35
|
+
}
|
|
36
|
+
function handleBlur() {
|
|
37
|
+
handleEvent(actions, 'changeNblur', propName, inputValue);
|
|
38
|
+
}
|
|
39
|
+
return (React.createElement(TextField, { fullWidth: true, variant: readOnly ? 'standard' : 'outlined', helperText: helperTextToDisplay, placeholder: '', size: 'small', required: required, disabled: disabled, onChange: handleChange, onBlur: !readOnly ? handleBlur : undefined, error: status === 'error', label: label, value: inputValue, InputProps: { ...readOnlyProp, inputProps: { maxLength, ...testProp } } }));
|
|
23
40
|
}
|
|
24
41
|
//# sourceMappingURL=TextInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../src/components/field/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../../src/components/field/TextInput/TextInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS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,EAAE,KAAK,EAAE,OAAO,EAAC,SAAS,GAAG,CAAC;KACzF;IAED,IAAI,QAAQ,EAAE;QACZ,YAAY,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KACnC;IAED,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,QAAQ,GAAG;QACT,cAAc,EAAE,MAAM;KACvB,CAAC;IAEF,SAAS,YAAY,CAAC,KAAK;QACzB,wBAAwB;QACxB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACtC,CAAC;IAED,SAAS,UAAU;QACjB,WAAW,CAAC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,CACL,oBAAC,SAAS,IACR,SAAS,QACT,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAC3C,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAC,EAAE,EACd,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAC1C,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,UAAU,EACjB,UAAU,EAAE,EAAE,GAAG,YAAY,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,GAAG,QAAQ,EAAE,EAAE,GACvE,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React, { useState, useEffect } from 'react';\nimport { TextField } from '@material-ui/core';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\nimport handleEvent from '../../helpers/event-utils';\n\nexport default function TextInput(props) {\n const {\n getPConnect,\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n /* onChange, onBlur */\n readOnly,\n testId,\n fieldMetadata,\n helperText,\n displayMode,\n hideLabel\n } = props;\n\n const pConn = getPConnect();\n const actions = pConn.getActionsApi();\n const propName = pConn.getStateProps().value;\n\n const helperTextToDisplay = validatemessage || helperText;\n\n const [inputValue, setInputValue] = useState();\n const maxLength = fieldMetadata?.maxLength;\n\n let readOnlyProp = {}; // Note: empty if NOT ReadOnly\n\n useEffect(() => {\n setInputValue(value);\n }, [value]);\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n if (readOnly) {\n readOnlyProp = { readOnly: true };\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n function handleChange(event) {\n // update internal value\n setInputValue(event?.target?.value);\n }\n\n function handleBlur() {\n handleEvent(actions, 'changeNblur', propName, inputValue);\n }\n\n return (\n <TextField\n fullWidth\n variant={readOnly ? 'standard' : 'outlined'}\n helperText={helperTextToDisplay}\n placeholder=''\n size='small'\n required={required}\n disabled={disabled}\n onChange={handleChange}\n onBlur={!readOnly ? handleBlur : undefined}\n error={status === 'error'}\n label={label}\n value={inputValue}\n InputProps={{ ...readOnlyProp, inputProps: { maxLength, ...testProp } }}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Time/Time.tsx"],"names":[],"mappings":";AAOA,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../../src/components/field/Time/Time.tsx"],"names":[],"mappings":";AAOA,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK,KAAA,eAyEjC"}
|
|
@@ -5,7 +5,7 @@ import dayjs from 'dayjs';
|
|
|
5
5
|
import AccessTimeIcon from '@material-ui/icons/AccessTime';
|
|
6
6
|
import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
7
7
|
export default function Time(props) {
|
|
8
|
-
const { label, required, disabled, value, validatemessage, status, onChange, readOnly, helperText, displayMode, hideLabel } = props;
|
|
8
|
+
const { label, required, disabled, value, validatemessage, status, onChange, readOnly, helperText, displayMode, hideLabel, testId } = props;
|
|
9
9
|
const helperTextToDisplay = validatemessage || helperText;
|
|
10
10
|
if (displayMode === 'LABELS_LEFT') {
|
|
11
11
|
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
|
|
@@ -16,6 +16,10 @@ export default function Time(props) {
|
|
|
16
16
|
if (readOnly) {
|
|
17
17
|
return React.createElement(TextInput, { ...props });
|
|
18
18
|
}
|
|
19
|
+
let testProp = {};
|
|
20
|
+
testProp = {
|
|
21
|
+
'data-test-id': testId
|
|
22
|
+
};
|
|
19
23
|
const handleChange = date => {
|
|
20
24
|
const theValue = date && date.isValid() ? date.format('HH:mm') : null;
|
|
21
25
|
onChange({ value: theValue });
|
|
@@ -29,6 +33,6 @@ export default function Time(props) {
|
|
|
29
33
|
// TODO: Keyboard doesn't work in the minute field, it updates one digit then jump to am/pm field
|
|
30
34
|
// try an older version of the lib or use DateTimePicker
|
|
31
35
|
//
|
|
32
|
-
return (React.createElement(KeyboardTimePicker, { variant: 'inline', inputVariant: 'outlined', placeholder: 'hh:mm am', keyboardIcon: React.createElement(AccessTimeIcon, null), fullWidth: true, required: required, disabled: disabled, error: status === 'error', helperText: helperTextToDisplay, minutesStep: 5, size: 'small', label: label, autoOk: true, mask: '__:__ _m', format: 'hh:mm a', value: timeValue, onChange: handleChange }));
|
|
36
|
+
return (React.createElement(KeyboardTimePicker, { variant: 'inline', inputVariant: 'outlined', placeholder: 'hh:mm am', keyboardIcon: React.createElement(AccessTimeIcon, null), fullWidth: true, required: required, disabled: disabled, error: status === 'error', helperText: helperTextToDisplay, minutesStep: 5, size: 'small', label: label, autoOk: true, mask: '__:__ _m', format: 'hh:mm a', value: timeValue, onChange: handleChange, InputProps: { inputProps: { ...testProp } } }));
|
|
33
37
|
}
|
|
34
38
|
//# sourceMappingURL=Time.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../../src/components/field/Time/Time.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK;IAChC,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,
|
|
1
|
+
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../../../src/components/field/Time/Time.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAC3D,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,KAAK;IAChC,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,eAAe,EACf,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACT,MAAM,EACP,GAAG,KAAK,CAAC;IACV,MAAM,mBAAmB,GAAG,eAAe,IAAI,UAAU,CAAC;IAE1D,IAAI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jB,OAAO,EAAC,QAAQ,EAChB,YAAY,EAAC,UAAU,EACvB,WAAW,EAAC,UAAU,EACtB,YAAY,EAAE,oBAAC,cAAc,OAAG,EAChC,SAAS,QACT,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAE,CAAC,EACd,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,MAAM,QACN,IAAI,EAAC,UAAU,EACf,MAAM,EAAC,SAAS,EAChB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,YAAY,EACtB,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,GAAG,QAAQ,EAAE,EAAE,GAC3C,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { KeyboardTimePicker } from '@material-ui/pickers';\nimport TextInput from '../TextInput';\nimport dayjs from 'dayjs';\nimport AccessTimeIcon from '@material-ui/icons/AccessTime';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\nexport default function Time(props) {\n const {\n label,\n required,\n disabled,\n value,\n validatemessage,\n status,\n onChange,\n readOnly,\n helperText,\n displayMode,\n hideLabel,\n testId\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n if (readOnly) {\n return <TextInput {...props} />;\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n const handleChange = date => {\n const theValue = date && date.isValid() ? date.format('HH:mm') : null;\n onChange({ value: theValue });\n };\n\n let timeValue: any = null;\n if (value) {\n const timeArray = value.split(':').map(itm => Number(itm));\n timeValue = dayjs().hour(timeArray[0]).minute(timeArray[1]);\n }\n\n //\n // TODO: Keyboard doesn't work in the minute field, it updates one digit then jump to am/pm field\n // try an older version of the lib or use DateTimePicker\n //\n\n return (\n <KeyboardTimePicker\n variant='inline'\n inputVariant='outlined'\n placeholder='hh:mm am'\n keyboardIcon={<AccessTimeIcon />}\n fullWidth\n required={required}\n disabled={disabled}\n error={status === 'error'}\n helperText={helperTextToDisplay}\n minutesStep={5}\n size='small'\n label={label}\n autoOk\n mask='__:__ _m'\n format='hh:mm a'\n value={timeValue}\n onChange={handleChange}\n InputProps={{ inputProps: { ...testProp } }}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"URL.d.ts","sourceRoot":"","sources":["../../../../src/components/field/URL/URL.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,KAAA,
|
|
1
|
+
{"version":3,"file":"URL.d.ts","sourceRoot":"","sources":["../../../../src/components/field/URL/URL.tsx"],"names":[],"mappings":";AAQA,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,KAAA,eAsDzC"}
|
|
@@ -6,7 +6,7 @@ import FieldValueList from '../../designSystemExtension/FieldValueList';
|
|
|
6
6
|
// Otherwise, we were getting all kinds of weird errors when we
|
|
7
7
|
// referred to URL as a component.
|
|
8
8
|
export default function URLComponent(props) {
|
|
9
|
-
const { label, required, disabled, value = '', validatemessage, status, onChange, onBlur, readOnly, helperText, displayMode, hideLabel } = props;
|
|
9
|
+
const { label, required, disabled, value = '', validatemessage, status, onChange, onBlur, readOnly, testId, helperText, displayMode, hideLabel } = props;
|
|
10
10
|
const helperTextToDisplay = validatemessage || helperText;
|
|
11
11
|
if (displayMode === 'LABELS_LEFT') {
|
|
12
12
|
return React.createElement(FieldValueList, { name: hideLabel ? '' : label, value: value });
|
|
@@ -17,6 +17,10 @@ export default function URLComponent(props) {
|
|
|
17
17
|
if (readOnly) {
|
|
18
18
|
return React.createElement(TextInput, { ...props });
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
let testProp = {};
|
|
21
|
+
testProp = {
|
|
22
|
+
'data-test-id': testId
|
|
23
|
+
};
|
|
24
|
+
return (React.createElement(TextField, { type: 'url', fullWidth: true, variant: 'outlined', helperText: helperTextToDisplay, placeholder: '', size: 'small', required: required, disabled: disabled, onChange: onChange, onBlur: !readOnly ? onBlur : undefined, error: status === 'error', label: label, value: value, InputProps: { inputProps: { ...testProp } } }));
|
|
21
25
|
}
|
|
22
26
|
//# sourceMappingURL=URL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"URL.js","sourceRoot":"","sources":["../../../../src/components/field/URL/URL.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,cAAc,MAAM,4CAA4C,CAAC;AAExE,gEAAgE;AAChE,gEAAgE;AAChE,mCAAmC;AACnC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK;IACxC,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,GAAG,EAAE,EACV,eAAe,EACf,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,UAAU,EACV,WAAW,EACX,SAAS,EACV,GAAG,KAAK,CAAC;IACV,MAAM,mBAAmB,GAAG,eAAe,IAAI,UAAU,CAAC;IAE1D,IAAI,WAAW,KAAK,aAAa,EAAE;QACjC,OAAO,oBAAC,cAAc,IAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;KACvE;IAED,IAAI,WAAW,KAAK,mBAAmB,EAAE;QACvC,OAAO,oBAAC,cAAc,IAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAA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,KAAK,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;KACvE;IAED,IAAI,WAAW,KAAK,mBAAmB,EAAE;QACvC,OAAO,oBAAC,cAAc,IAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAC,SAAS,GAAG,CAAC;KACzF;IAED,IAAI,QAAQ,EAAE;QACZ,OAAO,oBAAC,SAAS,OAAK,KAAK,GAAI,CAAC;KACjC;IAED,IAAI,QAAQ,GAAG,EAAE,CAAC;IAElB,QAAQ,GAAG;QACT,cAAc,EAAE,MAAM;KACvB,CAAC;IAEF,OAAO,CACL,oBAAC,SAAS,IACR,IAAI,EAAC,KAAK,EACV,SAAS,QACT,OAAO,EAAC,UAAU,EAClB,UAAU,EAAE,mBAAmB,EAC/B,WAAW,EAAC,EAAE,EACd,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACtC,KAAK,EAAE,MAAM,KAAK,OAAO,EACzB,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,GAAG,QAAQ,EAAE,EAAE,GAC3C,CACH,CAAC;AACJ,CAAC","sourcesContent":["import React from 'react';\nimport { TextField } from '@material-ui/core';\nimport TextInput from '../TextInput';\nimport FieldValueList from '../../designSystemExtension/FieldValueList';\n\n// NOTE: that we had to change the name from URL to URLComponent\n// Otherwise, we were getting all kinds of weird errors when we\n// referred to URL as a component.\nexport default function URLComponent(props) {\n const {\n label,\n required,\n disabled,\n value = '',\n validatemessage,\n status,\n onChange,\n onBlur,\n readOnly,\n testId,\n helperText,\n displayMode,\n hideLabel\n } = props;\n const helperTextToDisplay = validatemessage || helperText;\n\n if (displayMode === 'LABELS_LEFT') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} />;\n }\n\n if (displayMode === 'STACKED_LARGE_VAL') {\n return <FieldValueList name={hideLabel ? '' : label} value={value} variant='stacked' />;\n }\n\n if (readOnly) {\n return <TextInput {...props} />;\n }\n\n let testProp = {};\n\n testProp = {\n 'data-test-id': testId\n };\n\n return (\n <TextField\n type='url'\n fullWidth\n variant='outlined'\n helperText={helperTextToDisplay}\n placeholder=''\n size='small'\n required={required}\n disabled={disabled}\n onChange={onChange}\n onBlur={!readOnly ? onBlur : undefined}\n error={status === 'error'}\n label={label}\n value={value}\n InputProps={{ inputProps: { ...testProp } }}\n />\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserReference.d.ts","sourceRoot":"","sources":["../../../../src/components/field/UserReference/UserReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AACnE,OAAO,SAAS,MAAM,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"UserReference.d.ts","sourceRoot":"","sources":["../../../../src/components/field/UserReference/UserReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8C,MAAM,OAAO,CAAC;AACnE,OAAO,SAAS,MAAM,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqMnC,wBAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserReference.js","sourceRoot":"","sources":["../../../../src/components/field/UserReference/UserReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,Y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AAE,QAAQ;IACjB,SAAS,EAAE,KAAK;CACjB,CAAC;AAEF,oGAAoG;AACpG,2FAA2F;AAC3F,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC5C,OAAO,CACL,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;QACzD,SAAS,CAAC,eAAe,KAAK,SAAS,CAAC,eAAe;QACvD,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAC1C,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import React, { Fragment, memo, useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Typography } from '@material-ui/core';\nimport AutoComplete from '../AutoComplete';\nimport Dropdown from '../Dropdown';\nimport { getUserId, isUserNameAvailable } from './UserReferenceUtils';\n\ndeclare const PCore: any;\nconst DROPDOWN_LIST = 'Drop-down list';\nconst SEARCH_BOX = 'Search box';\n\nconst UserReference = props => {\n const {\n label,\n displayAs,\n getPConnect,\n value,\n testId,\n helperText,\n validatemessage,\n placeholder,\n showAsFormattedText,\n additionalProps,\n hideLabel,\n readOnly,\n required,\n disabled,\n onChange\n } = props;\n const [dropDownDataSource, setDropDownDataSource] = useState([]);\n const [userName, setUserName] = useState('');\n const OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP();\n const userId = getUserId(value);\n\n useEffect(() => {\n if (userId && readOnly && showAsFormattedText) {\n if (isUserNameAvailable(value)) {\n setUserName(value.userName);\n } else {\n // if same user ref field is referred in view as editable & readonly formatted text\n // referenced users won't be available, so get user details from dx api\n const { getOperatorDetails } = PCore.getUserApi();\n getOperatorDetails(userId).then(res => {\n if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {\n setUserName(res.data.pyOperatorInfo.pyUserName);\n }\n });\n }\n } else if (displayAs === DROPDOWN_LIST) {\n const queryPayload = {\n dataViewName: OPERATORS_DP\n };\n PCore.getRestClient()\n .invokeRestApi('getListData', { queryPayload })\n .then(res => {\n const ddDataSource = res.data.data.map(listItem => ({\n key: listItem.pyUserIdentifier,\n value: listItem.pyUserName\n }));\n setDropDownDataSource(ddDataSource);\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [displayAs, readOnly, showAsFormattedText, value]);\n\n let userReferenceComponent: any = null;\n\n if (readOnly && showAsFormattedText) {\n if (userId) {\n userReferenceComponent = (\n <Fragment>\n {/*\n TODO: This has to be replaced with Operator Component\n */}\n <div>\n <Typography variant='caption'>{label}</Typography>\n <Typography variant='body1'>{userName}</Typography>\n </div>\n </Fragment>\n );\n }\n } else {\n if (displayAs === SEARCH_BOX) {\n const columns = [\n {\n value: 'pyUserName',\n display: 'true',\n useForSearch: true,\n primary: 'true'\n },\n {\n value: 'pyUserIdentifier',\n setProperty: 'Associated property',\n key: 'true',\n display: 'true',\n secondary: 'true',\n useForSearch: 'true'\n }\n ];\n\n userReferenceComponent = (\n <AutoComplete\n additionalProps={additionalProps}\n label={label}\n getPConnect={getPConnect}\n datasource={OPERATORS_DP}\n listType='datapage'\n columns={columns}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n value={userId}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n if (displayAs === DROPDOWN_LIST) {\n userReferenceComponent = (\n <Dropdown\n additionalProps={additionalProps}\n datasource={dropDownDataSource}\n listType='associated'\n getPConnect={getPConnect}\n label={label}\n value={userId}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n }\n\n return userReferenceComponent;\n};\n\nUserReference.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n displayAs: PropTypes.string,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.objectOf(PropTypes.any)]),\n testId: PropTypes.string,\n placeholder: PropTypes.string,\n helperText: PropTypes.string,\n disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n validatemessage: PropTypes.string,\n showAsFormattedText: PropTypes.bool,\n additionalProps: PropTypes.objectOf(PropTypes.any),\n hideLabel: PropTypes.bool\n};\n\nUserReference.defaultProps = {\n displayAs: null,\n label: null,\n value: null,\n readOnly: false,\n testId: null,\n placeholder: null,\n helperText: null,\n disabled: false,\n required: false,\n validatemessage: null,\n showAsFormattedText: false,\n additionalProps: {},\n variant: 'inline',\n hideLabel: false\n};\n\n// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with\n// same key value pairs in obj. hence using custom comparison function on when to re-render\nconst comparisonFn = (prevProps, nextProps) => {\n return (\n getUserId(prevProps.value) === getUserId(nextProps.value) &&\n prevProps.validatemessage === nextProps.validatemessage &&\n prevProps.required === nextProps.required &&\n prevProps.disabled === nextProps.disabled &&\n prevProps.readOnly === nextProps.readOnly\n );\n};\n\nexport default memo(UserReference, comparisonFn);\n"]}
|
|
1
|
+
{"version":3,"file":"UserReference.js","sourceRoot":"","sources":["../../../../src/components/field/UserReference/UserReference.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnE,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAC3C,OAAO,QA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,CAAC;AAEF,oGAAoG;AACpG,2FAA2F;AAC3F,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,EAAE;IAC5C,OAAO,CACL,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC;QACzD,SAAS,CAAC,eAAe,KAAK,SAAS,CAAC,eAAe;QACvD,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ;QACzC,SAAS,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAC1C,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import React, { Fragment, memo, useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { Typography } from '@material-ui/core';\nimport AutoComplete from '../AutoComplete';\nimport Dropdown from '../Dropdown';\nimport { getUserId, isUserNameAvailable } from './UserReferenceUtils';\n\n// Remove this and use \"real\" PCore type once .d.ts is fixed (currently shows 1 errors)\ndeclare const PCore: any;\n\nconst DROPDOWN_LIST = 'Drop-down list';\nconst SEARCH_BOX = 'Search box';\n\nconst UserReference = props => {\n const {\n label,\n displayAs,\n getPConnect,\n value,\n testId,\n helperText,\n validatemessage,\n placeholder,\n showAsFormattedText,\n additionalProps,\n hideLabel,\n readOnly,\n required,\n disabled,\n onChange\n } = props;\n const [dropDownDataSource, setDropDownDataSource] = useState([]);\n const [userName, setUserName] = useState('');\n const OPERATORS_DP = PCore.getEnvironmentInfo().getDefaultOperatorDP();\n const userId = getUserId(value);\n\n useEffect(() => {\n if (userId && readOnly && showAsFormattedText) {\n if (isUserNameAvailable(value)) {\n setUserName(value.userName);\n } else {\n // if same user ref field is referred in view as editable & readonly formatted text\n // referenced users won't be available, so get user details from dx api\n const { getOperatorDetails } = PCore.getUserApi();\n getOperatorDetails(userId).then(res => {\n if (res.data && res.data.pyOperatorInfo && res.data.pyOperatorInfo.pyUserName) {\n setUserName(res.data.pyOperatorInfo.pyUserName);\n }\n });\n }\n } else if (displayAs === DROPDOWN_LIST) {\n const queryPayload = {\n dataViewName: OPERATORS_DP\n };\n PCore.getRestClient()\n .invokeRestApi('getListData', { queryPayload })\n .then(res => {\n const ddDataSource = res.data.data.map(listItem => ({\n key: listItem.pyUserIdentifier,\n value: listItem.pyUserName\n }));\n setDropDownDataSource(ddDataSource);\n })\n .catch(err => {\n // eslint-disable-next-line no-console\n console.error(err);\n });\n }\n }, [displayAs, readOnly, showAsFormattedText, value]);\n\n let userReferenceComponent: any = null;\n\n if (readOnly && showAsFormattedText) {\n if (userId) {\n userReferenceComponent = (\n <Fragment>\n {/*\n TODO: This has to be replaced with Operator Component\n */}\n <div>\n <Typography variant='caption'>{label}</Typography>\n <Typography variant='body1'>{userName}</Typography>\n </div>\n </Fragment>\n );\n }\n } else {\n if (displayAs === SEARCH_BOX) {\n const columns = [\n {\n value: 'pyUserName',\n display: 'true',\n useForSearch: true,\n primary: 'true'\n },\n {\n value: 'pyUserIdentifier',\n setProperty: 'Associated property',\n key: 'true',\n display: 'true',\n secondary: 'true',\n useForSearch: 'true'\n }\n ];\n\n userReferenceComponent = (\n <AutoComplete\n additionalProps={additionalProps}\n label={label}\n getPConnect={getPConnect}\n datasource={OPERATORS_DP}\n listType='datapage'\n columns={columns}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n value={userId}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n if (displayAs === DROPDOWN_LIST) {\n userReferenceComponent = (\n <Dropdown\n additionalProps={additionalProps}\n datasource={dropDownDataSource}\n listType='associated'\n getPConnect={getPConnect}\n label={label}\n value={userId}\n testId={testId}\n placeholder={placeholder}\n readOnly={readOnly}\n disabled={disabled}\n required={required}\n helperText={helperText}\n validatemessage={validatemessage}\n hideLabel={hideLabel}\n onChange={onChange}\n />\n );\n }\n }\n\n return userReferenceComponent;\n};\n\nUserReference.propTypes = {\n getPConnect: PropTypes.func.isRequired,\n displayAs: PropTypes.string,\n label: PropTypes.string,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.objectOf(PropTypes.any)]),\n testId: PropTypes.string,\n placeholder: PropTypes.string,\n helperText: PropTypes.string,\n disabled: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n readOnly: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n required: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n validatemessage: PropTypes.string,\n showAsFormattedText: PropTypes.bool,\n additionalProps: PropTypes.objectOf(PropTypes.any),\n hideLabel: PropTypes.bool\n};\n\nUserReference.defaultProps = {\n displayAs: null,\n label: null,\n value: null,\n readOnly: false,\n testId: null,\n placeholder: null,\n helperText: null,\n disabled: false,\n required: false,\n validatemessage: null,\n showAsFormattedText: false,\n additionalProps: {},\n variant: 'inline',\n hideLabel: false\n};\n\n// as objects are there in props, shallow comparision fails & re-rendering of comp happens even with\n// same key value pairs in obj. hence using custom comparison function on when to re-render\nconst comparisonFn = (prevProps, nextProps) => {\n return (\n getUserId(prevProps.value) === getUserId(nextProps.value) &&\n prevProps.validatemessage === nextProps.validatemessage &&\n prevProps.required === nextProps.required &&\n prevProps.disabled === nextProps.disabled &&\n prevProps.readOnly === nextProps.readOnly\n );\n};\n\nexport default memo(UserReference, comparisonFn);\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
1
|
+
export declare const validateMaxSize: (fileObj: any, maxSizeInMB: any) => boolean;
|
|
2
|
+
export declare const fileDownload: (data: any, fileName: any, ext: any) => void;
|
|
3
|
+
export declare const getIconFromFileType: (fileType: any) => string;
|
|
4
|
+
export declare const getIconForAttachment: (inThis: any, attachment: any) => any;
|
|
5
|
+
export declare const buildFilePropsFromResponse: (respObj: any) => {
|
|
6
6
|
props: {
|
|
7
7
|
meta: string;
|
|
8
8
|
name: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachmentHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.
|
|
1
|
+
{"version":3,"file":"attachmentHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,6CAG3B,CAAC;AAEF,eAAO,MAAM,YAAY,8CAQxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,2BAyB/B,CAAC;AAEF,eAAO,MAAM,oBAAoB,WAAW,GAAG,cAAc,GAAG,QAa/D,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;CAWtC,CAAC"}
|
|
@@ -43,11 +43,11 @@ export const getIconFromFileType = (fileType) => {
|
|
|
43
43
|
}
|
|
44
44
|
return icon;
|
|
45
45
|
};
|
|
46
|
-
export const getIconForAttachment = (attachment) => {
|
|
46
|
+
export const getIconForAttachment = (inThis, attachment) => {
|
|
47
47
|
let icon;
|
|
48
48
|
switch (attachment.type) {
|
|
49
49
|
case "FILE":
|
|
50
|
-
icon =
|
|
50
|
+
icon = inThis.getIconFromFileType(attachment.mimeType);
|
|
51
51
|
break;
|
|
52
52
|
case "URL":
|
|
53
53
|
icon = "chain";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attachmentHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.
|
|
1
|
+
{"version":3,"file":"attachmentHelpers.js","sourceRoot":"","sources":["../../../src/components/helpers/attachmentHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;IACtD,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,O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,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;QACtD,CAAC,CAAC;QAEF,IAAI,UAAU,CAAC,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC,EAAE;YACxC,IAAI,GAAG,cAAc,CAAC;SACvB;aAAM,IAAI,UAAU,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,EAAE;YAClE,IAAI,GAAG,mBAAmB,CAAC;SAC5B;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,MAAU,EAAG,UAAc,EAAE,EAAE;IAClE,IAAI,IAAI,CAAC;IACT,QAAQ,UAAU,CAAC,IAAI,EAAE;QACvB,KAAK,MAAM;YACT,IAAI,GAAG,MAAM,CAAC,mBAAmB,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACvD,MAAM;QACR,KAAK,KAAK;YACR,IAAI,GAAG,OAAO,CAAC;YACf,MAAM;QACR;YACE,IAAI,GAAG,cAAc,CAAC;KACzB;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,OAAO,EAAE,EAAE;IACpD,OAAO;QACL,KAAK,EAAE;YACL,IAAI,EAAE,GAAG,OAAO,CAAC,cAAc,KAAK,OAAO,CAAC,gBAAgB,EAAE;YAC9D,IAAI,EAAE,OAAO,CAAC,YAAY;YAC1B,IAAI,EAAE,mBAAmB,CAAC,OAAO,CAAC,mBAAmB,CAAC;SACvD;QACD,aAAa,EAAE;YACb,GAAG,OAAO;SACX;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import download from 'downloadjs';\n\nexport const validateMaxSize = (fileObj, maxSizeInMB) => {\n const fileSize = (fileObj.size / 1048576).toFixed(2);\n return parseFloat(fileSize) < parseFloat(maxSizeInMB);\n};\n\nexport const fileDownload = (data, fileName, ext) => {\n const name = ext ? `${fileName}.${ext}` : fileName;\n // Temp fix: downloading EMAIl type attachment as html file\n if (ext === 'html') {\n download(data, name, 'text/html');\n } else {\n download(atob(data), name);\n }\n};\n\nexport const getIconFromFileType = (fileType) => {\n let icon = 'document-doc';\n if (!fileType) return icon;\n if (fileType.startsWith('audio')) {\n icon = 'audio';\n } else if (fileType.startsWith('video')) {\n icon = 'video';\n } else if (fileType.startsWith('image')) {\n icon = 'picture';\n } else if (fileType.includes('pdf')) {\n icon = 'document-pdf';\n } else {\n const [, subtype] = fileType.split('/');\n const foundMatch = (sources) => {\n return sources.some((key) => subtype.includes(key));\n };\n\n if (foundMatch(['excel', 'spreadsheet'])) {\n icon = 'document-xls';\n } else if (foundMatch(['zip', 'compressed', 'gzip', 'rar', 'tar'])) {\n icon = 'document-compress';\n }\n }\n\n return icon;\n};\n\nexport const getIconForAttachment = (inThis:any , attachment:any) => {\n let icon;\n switch (attachment.type) {\n case \"FILE\":\n icon = inThis.getIconFromFileType(attachment.mimeType);\n break;\n case \"URL\":\n icon = \"chain\";\n break;\n default:\n icon = \"document-doc\";\n }\n return icon;\n};\n\nexport const buildFilePropsFromResponse = (respObj) => {\n return {\n props: {\n meta: `${respObj.pyCategoryName}, ${respObj.pxCreateOperator}`,\n name: respObj.pyAttachName,\n icon: getIconFromFileType(respObj.pyMimeFileExtension)\n },\n responseProps: {\n ...respObj\n }\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/auth.js"],"names":[],"mappings":";AAAA;IAEE,8BAIC;IAHG,iBAA8B;IAC9B,mBAAsB;IAI1B,qBAgBC;IADG,8BAAmC;IAgDvC,
|
|
1
|
+
{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/components/helpers/auth.js"],"names":[],"mappings":";AAAA;IAEE,8BAIC;IAHG,iBAA8B;IAC9B,mBAAsB;IAI1B,qBAgBC;IADG,8BAAmC;IAgDvC,sBAoMC;IAGD,sBAOC;IAID,sCAoDC;IAGD,+CAqCC;IAED,qEA4CC;IAID,6CAwBC;;CA0CF"}
|
|
@@ -57,6 +57,8 @@ class PegaAuth {
|
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
59
|
myWindow.postMessage({ type: "PegaAuth" }, redirectOrigin);
|
|
60
|
+
// eslint-disable-next-line no-console
|
|
61
|
+
console.log(`authjs(login): loaded a page in popup window...sending 'PegaAuth' message. redirectOrigin: ${redirectOrigin}`);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
catch (e) {
|
|
@@ -186,7 +188,13 @@ class PegaAuth {
|
|
|
186
188
|
}
|
|
187
189
|
else {
|
|
188
190
|
clearInterval(checkWindowClosed);
|
|
189
|
-
|
|
191
|
+
try {
|
|
192
|
+
myWindow.close();
|
|
193
|
+
}
|
|
194
|
+
catch (e) {
|
|
195
|
+
// eslint-disable-next-line no-console
|
|
196
|
+
console.warn(`attempt to close opened window failed`);
|
|
197
|
+
}
|
|
190
198
|
}
|
|
191
199
|
resolve(token);
|
|
192
200
|
})
|
|
@@ -197,8 +205,10 @@ class PegaAuth {
|
|
|
197
205
|
/* Handler to receive the auth code */
|
|
198
206
|
authMessageReceiver = (event) => {
|
|
199
207
|
// Check origin to make sure it is the redirect origin
|
|
200
|
-
if (event.origin !== redirectOrigin)
|
|
201
|
-
|
|
208
|
+
if (event.origin !== redirectOrigin) {
|
|
209
|
+
// eslint-disable-next-line no-console
|
|
210
|
+
console.info(`Received event from unexpected origin: ${event.origin} (was expecting: ${redirectOrigin})`);
|
|
211
|
+
}
|
|
202
212
|
if (!event.data || !event.data.type || event.data.type !== "PegaAuth")
|
|
203
213
|
return;
|
|
204
214
|
// eslint-disable-next-line no-console
|