@zohodesk/dot 1.2.4 → 1.3.0
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/.cli/PropLessFiles.html +1 -1
- package/.cli/PropValidationExcludeFilesArray.js +1 -1
- package/.cli/propValidation_report.html +1 -1
- package/README.md +9 -0
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +12 -12
- package/coverage/coverage-summary.json +12 -12
- package/coverage/index.html +1 -1
- package/es/Drawer/Drawer.js +3 -2
- package/es/v1/ActionButton/ActionButton.js +11 -8
- package/es/v1/AlphabeticList/AlphabeticList.js +2 -2
- package/es/v1/Attachment/Attachment.js +1 -1
- package/es/v1/AttachmentViewer/AttachmentViewer.js +4 -4
- package/es/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/es/v1/Drawer/Drawer.js +6 -6
- package/es/v1/FlipCard/FlipCard.js +4 -4
- package/es/v1/FormAction/FormAction.js +1 -1
- package/es/v1/FreezeLayer/FreezeLayer.js +3 -3
- package/es/v1/{version2/GlobalNotification → GlobalNotification}/GlobalNotification.js +7 -7
- package/es/v1/IconButton/IconButton.js +3 -3
- package/es/v1/ImportantNotes/ImportantNotes.js +1 -1
- package/es/v1/Loader/Loader.js +1 -1
- package/es/v1/MessageBanner/MessageBanner.js +1 -1
- package/es/v1/NewStar/NewStar.js +1 -1
- package/es/v1/Separator/Separator.js +1 -1
- package/es/v1/TagWithIcon/TagWithIcon.js +1 -1
- package/es/v1/ToastMessage/ToastMessage.js +4 -4
- package/es/v1/Upload/Upload.js +1 -1
- package/es/v1/{version2 → alert}/AlertClose/AlertClose.js +1 -1
- package/es/v1/alert/AlertHeader/AlertHeader.js +58 -49
- package/es/v1/alert/AlertLookup/AlertLookup.js +101 -41
- package/es/v1/avatar/AvatarClose/AvatarClose.js +1 -1
- package/es/v1/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/es/v1/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/es/v1/avatar/AvatarThread/AvatarThread.js +1 -1
- package/es/v1/avatar/AvatarUser/AvatarUser.js +1 -1
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +18 -15
- package/es/v1/errorstate/Inconvenience/Inconvenience.js +53 -80
- package/es/v1/{version2/errorstate → errorstate}/OopsSomethingMiss/OopsSomethingMiss.js +6 -6
- package/es/v1/{version2/errorstate → errorstate}/UnableToProcessRequest/UnableToProcessRequest.js +6 -6
- package/es/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +54 -73
- package/es/v1/{version2/errorstate → errorstate}/UrlNotFound/UrlNotFound.js +6 -6
- package/es/v1/{version2/errorstate → errorstate}/WillBeRightBack/WillBeRightBack.js +6 -6
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +102 -118
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +128 -154
- package/es/v1/form/fields/DateField/DateField.js +131 -162
- package/es/v1/form/fields/FieldContainer/FieldContainer.js +52 -57
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +144 -168
- package/es/v1/form/fields/PhoneField/PhoneField.js +128 -156
- package/es/v1/form/fields/RadioField/RadioField.js +2 -2
- package/es/v1/form/fields/SelectField/SelectField.js +3 -3
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +8 -8
- package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +8 -5
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/es/v1/form/fields/TextEditor/TextEditor.js +1 -1
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +3 -3
- package/es/v1/form/fields/TextareaField/TextareaField.js +3 -3
- package/es/v1/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/es/v1/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/es/v1/list/AvatarFlip/AvatarFlip.js +61 -64
- package/es/v1/list/BluePrintStatus/BluePrintStatus.js +11 -18
- package/es/v1/list/Comment/Comment.js +25 -32
- package/es/v1/list/DepartmentDropDown/DepartmentDropDown.js +57 -72
- package/es/v1/list/Dot/Dot.js +9 -16
- package/es/v1/list/DotNew/DotNew.js +11 -18
- package/es/v1/list/GridStencils/GridStencils.js +21 -24
- package/es/v1/list/Icons/AddNewIcon.js +19 -22
- package/es/v1/list/Icons/CompleteIcon.js +21 -24
- package/es/v1/list/Icons/DeleteIcon.js +22 -25
- package/es/v1/list/Icons/EditIcon.js +22 -25
- package/es/v1/list/Icons/FloatingIcons.js +12 -19
- package/es/v1/list/Icons/ReadUnreadIcon.js +24 -27
- package/es/v1/list/Icons/SmartIcon.js +20 -23
- package/es/v1/list/ListLayout/ListLayout.js +54 -68
- package/es/v1/list/ListStencils/ListStencils.js +28 -31
- package/es/v1/list/SecondaryText/AccountName.js +1 -1
- package/es/v1/list/SecondaryText/ContactName.js +1 -1
- package/es/v1/list/SecondryPanel/SecondryPanel.js +1 -2
- package/es/v1/list/Thread/Thread.js +1 -1
- package/es/v1/list/UserTime/UserTime.js +1 -1
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +266 -357
- package/es/v1/list/status/StatusListItem/StatusListItem.js +5 -5
- package/es/v1/lookup/Lookup/Lookup.js +4 -3
- package/es/v1/lookup/Section/Section.js +1 -1
- package/es/v1/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/es/v1/lookup/header/Search/Search.js +3 -3
- package/es/v1/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/es/v1/lookup/header/ViewDropDown/ViewDropDown.js +10 -9
- package/es/v1/{version2/notification → notification}/DesktopNotification/DesktopNotification.js +6 -6
- package/es/v1/{version2/notification → notification}/DesktopNotificationHeader/DesktopNotificationHeader.js +6 -6
- package/es/v1/setup/header/Button/Button.js +1 -1
- package/es/v1/setup/header/Link/Link.js +1 -1
- package/es/v1/setup/header/Search/Search.js +1 -1
- package/es/v1/setup/table/Table/Table.js +1 -1
- package/es/v1/setup/table/TableBody/TableBody.js +1 -1
- package/es/v1/setup/table/TableData/TableData.js +1 -1
- package/es/v1/setup/table/TableHead/TableHead.js +1 -1
- package/es/v1/setup/table/TableRow/TableRow.js +1 -1
- package/lib/Drawer/Drawer.js +3 -2
- package/lib/v1/ActionButton/ActionButton.js +11 -9
- package/lib/v1/AlphabeticList/AlphabeticList.js +2 -4
- package/lib/v1/Attachment/Attachment.js +1 -1
- package/lib/v1/AttachmentViewer/AttachmentViewer.js +4 -4
- package/lib/v1/ChannelIcon/ChannelIcon.js +1 -1
- package/lib/v1/Drawer/Drawer.js +6 -6
- package/lib/v1/FlipCard/FlipCard.js +4 -4
- package/lib/v1/FormAction/FormAction.js +1 -1
- package/lib/v1/FreezeLayer/FreezeLayer.js +3 -3
- package/lib/v1/{version2/GlobalNotification → GlobalNotification}/GlobalNotification.js +7 -7
- package/lib/v1/IconButton/IconButton.js +3 -3
- package/lib/v1/ImportantNotes/ImportantNotes.js +1 -1
- package/lib/v1/Loader/Loader.js +1 -1
- package/lib/v1/MessageBanner/MessageBanner.js +1 -1
- package/lib/v1/NewStar/NewStar.js +1 -1
- package/lib/v1/Separator/Separator.js +1 -1
- package/lib/v1/TagWithIcon/TagWithIcon.js +1 -1
- package/lib/v1/ToastMessage/ToastMessage.js +4 -4
- package/lib/v1/Upload/Upload.js +1 -1
- package/lib/v1/{version2 → alert}/AlertClose/AlertClose.js +1 -1
- package/lib/v1/alert/AlertHeader/AlertHeader.js +68 -50
- package/lib/v1/alert/AlertLookup/AlertLookup.js +109 -42
- package/lib/v1/avatar/AvatarClose/AvatarClose.js +1 -1
- package/lib/v1/avatar/AvatarCollision/AvatarCollision.js +1 -1
- package/lib/v1/avatar/AvatarIcon/AvatarIcon.js +2 -2
- package/lib/v1/avatar/AvatarStatus/AvatarStatus.js +1 -1
- package/lib/v1/avatar/AvatarThread/AvatarThread.js +1 -1
- package/lib/v1/avatar/AvatarUser/AvatarUser.js +1 -1
- package/lib/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +2 -2
- package/lib/v1/dropdown/ToggleDropDown/ToggleDropDown.js +18 -16
- package/lib/v1/errorstate/Inconvenience/Inconvenience.js +53 -115
- package/lib/v1/{version2/errorstate → errorstate}/OopsSomethingMiss/OopsSomethingMiss.js +6 -6
- package/lib/v1/{version2/errorstate → errorstate}/UnableToProcessRequest/UnableToProcessRequest.js +6 -6
- package/lib/v1/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +54 -108
- package/lib/v1/{version2/errorstate → errorstate}/UrlNotFound/UrlNotFound.js +6 -6
- package/lib/v1/{version2/errorstate → errorstate}/WillBeRightBack/WillBeRightBack.js +6 -6
- package/lib/v1/form/fields/CheckBoxField/CheckBoxField.js +107 -159
- package/lib/v1/form/fields/CurrencyField/CurrencyField.js +152 -193
- package/lib/v1/form/fields/DateField/DateField.js +140 -206
- package/lib/v1/form/fields/FieldContainer/FieldContainer.js +60 -91
- package/lib/v1/form/fields/MultiSelectField/MultiSelectField.js +168 -228
- package/lib/v1/form/fields/PhoneField/PhoneField.js +150 -193
- package/lib/v1/form/fields/RadioField/RadioField.js +2 -2
- package/lib/v1/form/fields/SelectField/SelectField.js +3 -3
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +8 -8
- package/lib/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +11 -8
- package/lib/v1/form/fields/TextBoxField/TextBoxField.js +3 -3
- package/lib/v1/form/fields/TextEditor/TextEditor.js +1 -1
- package/lib/v1/form/fields/TextEditorField/TextEditorField.js +1 -1
- package/lib/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +3 -3
- package/lib/v1/form/fields/TextareaField/TextareaField.js +3 -3
- package/lib/v1/form/fields/ValidationMessage/ValidationMessage.js +2 -2
- package/lib/v1/layout/SetupDetailLayout/SetupDetailLayout.js +1 -1
- package/lib/v1/layout/SubtabLayout/SubtabLayout.js +2 -2
- package/lib/v1/list/AvatarFlip/AvatarFlip.js +61 -106
- package/lib/v1/list/BluePrintStatus/BluePrintStatus.js +11 -51
- package/lib/v1/list/Comment/Comment.js +24 -69
- package/lib/v1/list/DepartmentDropDown/DepartmentDropDown.js +67 -122
- package/lib/v1/list/Dot/Dot.js +9 -54
- package/lib/v1/list/DotNew/DotNew.js +11 -56
- package/lib/v1/list/GridStencils/GridStencils.js +21 -62
- package/lib/v1/list/Icons/AddNewIcon.js +19 -60
- package/lib/v1/list/Icons/CompleteIcon.js +21 -62
- package/lib/v1/list/Icons/DeleteIcon.js +22 -63
- package/lib/v1/list/Icons/EditIcon.js +22 -63
- package/lib/v1/list/Icons/FloatingIcons.js +17 -62
- package/lib/v1/list/Icons/ReadUnreadIcon.js +24 -65
- package/lib/v1/list/Icons/SmartIcon.js +20 -65
- package/lib/v1/list/ListLayout/ListLayout.js +53 -116
- package/lib/v1/list/ListStencils/ListStencils.js +33 -72
- package/lib/v1/list/SecondaryText/AccountName.js +1 -1
- package/lib/v1/list/SecondaryText/ContactName.js +1 -1
- package/lib/v1/list/SecondryPanel/SecondryPanel.js +3 -5
- package/lib/v1/list/Thread/Thread.js +1 -1
- package/lib/v1/list/UserTime/UserTime.js +1 -1
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +367 -472
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +5 -5
- package/lib/v1/lookup/Lookup/Lookup.js +5 -3
- package/lib/v1/lookup/Section/Section.js +1 -1
- package/lib/v1/lookup/header/ModuleHeader/ModuleHeader.js +1 -1
- package/lib/v1/lookup/header/Search/Search.js +3 -3
- package/lib/v1/lookup/header/TicketHeader/TicketHeader.js +1 -1
- package/lib/v1/lookup/header/ViewDropDown/ViewDropDown.js +10 -9
- package/lib/v1/{version2/notification → notification}/DesktopNotification/DesktopNotification.js +6 -6
- package/lib/v1/{version2/notification → notification}/DesktopNotificationHeader/DesktopNotificationHeader.js +6 -6
- package/lib/v1/setup/header/Button/Button.js +1 -1
- package/lib/v1/setup/header/Link/Link.js +1 -1
- package/lib/v1/setup/header/Search/Search.js +1 -1
- package/lib/v1/setup/table/Table/Table.js +1 -1
- package/lib/v1/setup/table/TableBody/TableBody.js +1 -1
- package/lib/v1/setup/table/TableData/TableData.js +1 -1
- package/lib/v1/setup/table/TableHead/TableHead.js +1 -1
- package/lib/v1/setup/table/TableRow/TableRow.js +1 -1
- package/package.json +8 -8
- package/result.json +1 -1
- package/es/v1/errorstate/LinkText/LinkText.js +0 -29
- package/es/v1/errorstate/NoRequestFound/NoRequestFound.js +0 -84
- package/es/v1/errorstate/PermissionPlay/PermissionPlay.js +0 -83
- package/es/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +0 -84
- package/es/v1/errorstate/UnableToProcess/UnableToProcess.js +0 -86
- package/es/v1/errorstate/WillBack/WillBack.js +0 -75
- package/es/v1/errorstate/index.js +0 -8
- package/es/v1/version2/errorstate/Inconvenience/Inconvenience.js +0 -63
- package/es/v1/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +0 -65
- package/es/v1/version2/index.js +0 -12
- package/es/v1/version2/lookup/AlertHeader/AlertHeader.js +0 -79
- package/es/v1/version2/lookup/AlertLookup/AlertLookup.js +0 -164
- package/lib/v1/errorstate/LinkText/LinkText.js +0 -80
- package/lib/v1/errorstate/NoRequestFound/NoRequestFound.js +0 -135
- package/lib/v1/errorstate/PermissionPlay/PermissionPlay.js +0 -134
- package/lib/v1/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +0 -135
- package/lib/v1/errorstate/UnableToProcess/UnableToProcess.js +0 -137
- package/lib/v1/errorstate/WillBack/WillBack.js +0 -125
- package/lib/v1/errorstate/index.js +0 -71
- package/lib/v1/version2/errorstate/Inconvenience/Inconvenience.js +0 -79
- package/lib/v1/version2/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +0 -81
- package/lib/v1/version2/index.js +0 -58
- package/lib/v1/version2/lookup/AlertHeader/AlertHeader.js +0 -104
- package/lib/v1/version2/lookup/AlertLookup/AlertLookup.js +0 -185
- /package/es/v1/{version2 → alert}/alertIcons/AlarmAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/AlertIcons.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/DangerAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/ErrorAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/InfoAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/NotificationAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/SuccessAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/WarningAlertIcon.js +0 -0
- /package/es/v1/{version2 → alert}/alertIcons/index.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/AlarmAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/AlertIcons.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/DangerAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/ErrorAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/InfoAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/NotificationAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/SuccessAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/WarningAlertIcon.js +0 -0
- /package/lib/v1/{version2 → alert}/alertIcons/index.js +0 -0
|
@@ -1,71 +1,66 @@
|
|
|
1
1
|
/**** Libraries ****/
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { memo } from 'react';
|
|
3
3
|
import { defaultProps } from '../../../../form/fields/FieldContainer/props/defaultProps';
|
|
4
4
|
import { propTypes } from '../../../../form/fields/FieldContainer/props/propTypes';
|
|
5
5
|
/**** Components ****/
|
|
6
6
|
|
|
7
|
-
import { Container } from '@zohodesk/components/
|
|
7
|
+
import { Container } from '@zohodesk/components/es/v1/Layout';
|
|
8
8
|
/**** Icons ****/
|
|
9
9
|
|
|
10
10
|
import { Icon } from '@zohodesk/icons';
|
|
11
11
|
/**** CSS ****/
|
|
12
12
|
|
|
13
13
|
import style from '../../../../form/fields/Fields.module.css';
|
|
14
|
-
export default class FieldContainer extends PureComponent {
|
|
15
|
-
constructor(props) {
|
|
16
|
-
super(props);
|
|
17
|
-
}
|
|
18
14
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
15
|
+
function FieldContainer(props) {
|
|
16
|
+
let {
|
|
17
|
+
children,
|
|
18
|
+
ePhiData,
|
|
19
|
+
isLocked,
|
|
20
|
+
lockedInfoText,
|
|
21
|
+
infoText,
|
|
22
|
+
dataId,
|
|
23
|
+
renderProps,
|
|
24
|
+
alignContainer,
|
|
25
|
+
dataSelectorId
|
|
26
|
+
} = props;
|
|
27
|
+
let {
|
|
28
|
+
ePhiTitle = '',
|
|
29
|
+
ePhiText = '',
|
|
30
|
+
ePhiStatus = false
|
|
31
|
+
} = ePhiData;
|
|
32
|
+
let {
|
|
33
|
+
start: renderStart = null,
|
|
34
|
+
middle: renderMiddle = null,
|
|
35
|
+
end: renderEnd = null
|
|
36
|
+
} = renderProps;
|
|
37
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
38
|
+
align: alignContainer,
|
|
39
|
+
alignBox: "row",
|
|
40
|
+
isCover: false,
|
|
41
|
+
dataSelectorId: dataSelectorId
|
|
42
|
+
}, renderStart ? renderStart() : null, children, renderMiddle ? renderMiddle() : null, infoText ? /*#__PURE__*/React.createElement(Icon, {
|
|
43
|
+
name: "ZD-GN-info",
|
|
44
|
+
iconClass: style.infoIcon,
|
|
45
|
+
title: infoText,
|
|
46
|
+
size: "15"
|
|
47
|
+
}) : null, isLocked ? /*#__PURE__*/React.createElement(Icon, {
|
|
48
|
+
name: "ZD-GN-lock",
|
|
49
|
+
size: "13",
|
|
50
|
+
iconClass: style.lockIcon,
|
|
51
|
+
title: lockedInfoText
|
|
52
|
+
}) : null, ePhiStatus ? /*#__PURE__*/React.createElement("span", {
|
|
53
|
+
"data-title": ePhiTitle,
|
|
54
|
+
"data-id": `${dataId}_ePHI`,
|
|
55
|
+
"data-test-id": `${dataId}_ePHI`,
|
|
56
|
+
className: style.ePhiTag
|
|
57
|
+
}, ePhiText) : null, renderEnd ? renderEnd() : null);
|
|
58
|
+
} // const MomoizedFieldContainer = memo(FieldContainer);
|
|
59
|
+
// export default MomoizedFieldContainer;
|
|
60
|
+
// MomoizedFieldContainer.propTypes = propTypes;
|
|
61
|
+
// MomoizedFieldContainer.defaultProps = defaultProps;
|
|
62
|
+
|
|
63
63
|
|
|
64
|
-
}
|
|
65
64
|
FieldContainer.propTypes = propTypes;
|
|
66
|
-
FieldContainer.defaultProps = defaultProps;
|
|
67
|
-
|
|
68
|
-
// componentGroup: 'Form Fields',
|
|
69
|
-
// folderName: 'General'
|
|
70
|
-
// };
|
|
71
|
-
// }
|
|
65
|
+
FieldContainer.defaultProps = defaultProps;
|
|
66
|
+
export default FieldContainer;
|
|
@@ -1,73 +1,105 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
/**** Libraries ****/
|
|
4
|
-
import React, {
|
|
4
|
+
import React, { memo, useRef } from 'react';
|
|
5
5
|
import { defaultProps } from '../../../../form/fields/MultiSelectField/props/defaultProps';
|
|
6
6
|
import { propTypes } from '../../../../form/fields/MultiSelectField/props/propTypes';
|
|
7
7
|
/**** Components ****/
|
|
8
8
|
|
|
9
|
-
import Label from '@zohodesk/components/
|
|
10
|
-
import MultiSelect from '@zohodesk/components/
|
|
9
|
+
import Label from '@zohodesk/components/es/v1/Label/Label';
|
|
10
|
+
import MultiSelect from '@zohodesk/components/es/v1/MultiSelect/MultiSelect';
|
|
11
11
|
import ValidationMessage from '../ValidationMessage/ValidationMessage';
|
|
12
|
-
import {
|
|
12
|
+
import { useUniqueId } from '@zohodesk/components/es/v1/Provider/IdProvider';
|
|
13
13
|
import FieldContainer from '../FieldContainer/FieldContainer';
|
|
14
14
|
/** CSS */
|
|
15
15
|
|
|
16
16
|
import style from '../../../../form/fields/Fields.module.css';
|
|
17
|
-
export default class MultiSelectField extends PureComponent {
|
|
18
|
-
constructor(props) {
|
|
19
|
-
super(props);
|
|
20
|
-
this.handleChange = this.handleChange.bind(this);
|
|
21
|
-
this.handleGetRef = this.handleGetRef.bind(this);
|
|
22
|
-
this.onDropBoxOpen = this.onDropBoxOpen.bind(this); // this.handleLabelClick = this.handleLabelClick.bind(this);
|
|
23
17
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
function MultiSelectField(props) {
|
|
19
|
+
let {
|
|
20
|
+
labelName,
|
|
21
|
+
id,
|
|
22
|
+
isMandatory,
|
|
23
|
+
options,
|
|
24
|
+
selectedOptions,
|
|
25
|
+
needSelectAll,
|
|
26
|
+
selectAllText,
|
|
27
|
+
isAnimate,
|
|
28
|
+
emptyMessage,
|
|
29
|
+
size,
|
|
30
|
+
variant,
|
|
31
|
+
textBoxSize,
|
|
32
|
+
animationStyle,
|
|
33
|
+
validationMessage,
|
|
34
|
+
validationPalette,
|
|
35
|
+
isReadOnly,
|
|
36
|
+
errorType,
|
|
37
|
+
isDisabled,
|
|
38
|
+
title,
|
|
39
|
+
dataId,
|
|
40
|
+
dataSelectorId,
|
|
41
|
+
validationRuleMessage,
|
|
42
|
+
validationRulePalette,
|
|
43
|
+
onKeyDown,
|
|
44
|
+
infoText,
|
|
45
|
+
borderColor,
|
|
46
|
+
placeHolder,
|
|
47
|
+
fieldSize,
|
|
48
|
+
valueField,
|
|
49
|
+
textField,
|
|
50
|
+
isNextOptions,
|
|
51
|
+
isSearching,
|
|
52
|
+
popupGroup,
|
|
53
|
+
labelPalette,
|
|
54
|
+
palette,
|
|
55
|
+
lockedInfoText,
|
|
56
|
+
isLocked,
|
|
57
|
+
htmlId,
|
|
58
|
+
children,
|
|
59
|
+
customChildrenClass,
|
|
60
|
+
onFocus,
|
|
61
|
+
customProps,
|
|
62
|
+
i18nKeys,
|
|
63
|
+
renderLabelProps,
|
|
64
|
+
onChange,
|
|
65
|
+
onDropBoxOpen,
|
|
66
|
+
onSearch,
|
|
67
|
+
getNextOptions,
|
|
68
|
+
getRef
|
|
69
|
+
} = props;
|
|
70
|
+
const {
|
|
71
|
+
LabelProps = {},
|
|
72
|
+
MultiSelectProps = {},
|
|
73
|
+
ValidationMessageProps1 = {},
|
|
74
|
+
ValidationMessageProps2 = {}
|
|
75
|
+
} = customProps;
|
|
76
|
+
const getNextId = useUniqueId();
|
|
77
|
+
const multiSelectBox = useRef(null);
|
|
78
|
+
let isDarkPalette = palette === 'dark';
|
|
79
|
+
let uniqueId = htmlId ? htmlId : getNextId();
|
|
28
80
|
|
|
29
|
-
handleChange(selectedValueIds, selectedValues) {
|
|
30
|
-
let {
|
|
31
|
-
id,
|
|
32
|
-
onChange
|
|
33
|
-
} = this.props;
|
|
81
|
+
function handleChange(selectedValueIds, selectedValues) {
|
|
34
82
|
onChange && onChange(id, selectedValueIds, selectedValues);
|
|
35
83
|
}
|
|
36
84
|
|
|
37
|
-
|
|
38
|
-
let {
|
|
39
|
-
onDropBoxOpen,
|
|
40
|
-
id
|
|
41
|
-
} = this.props;
|
|
85
|
+
function handleDropBoxOpen() {
|
|
42
86
|
return onDropBoxOpen && onDropBoxOpen(id);
|
|
43
87
|
}
|
|
44
88
|
|
|
45
|
-
|
|
46
|
-
let {
|
|
47
|
-
onSearch,
|
|
48
|
-
id
|
|
49
|
-
} = this.props;
|
|
89
|
+
function handleSearch(searchStr) {
|
|
50
90
|
return onSearch && onSearch(searchStr, {
|
|
51
91
|
id
|
|
52
92
|
});
|
|
53
93
|
}
|
|
54
94
|
|
|
55
|
-
|
|
56
|
-
let {
|
|
57
|
-
getNextOptions,
|
|
58
|
-
id
|
|
59
|
-
} = this.props;
|
|
95
|
+
function handleGetNextOptions(searchStr) {
|
|
60
96
|
return getNextOptions && getNextOptions(searchStr, {
|
|
61
97
|
id
|
|
62
98
|
});
|
|
63
99
|
}
|
|
64
100
|
|
|
65
|
-
handleGetRef(el) {
|
|
66
|
-
|
|
67
|
-
getRef,
|
|
68
|
-
id
|
|
69
|
-
} = this.props;
|
|
70
|
-
this.multiSelectBox = el;
|
|
101
|
+
function handleGetRef(el) {
|
|
102
|
+
multiSelectBox.current = el;
|
|
71
103
|
getRef && getRef(el, id);
|
|
72
104
|
} // handleLabelClick() {
|
|
73
105
|
// let { isFocusOnLabelClick } = this.props;
|
|
@@ -81,133 +113,77 @@ export default class MultiSelectField extends PureComponent {
|
|
|
81
113
|
// }
|
|
82
114
|
|
|
83
115
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
customClass: `${style.fieldLabel} ${isMandatory ? style.labelMandatory : ''}`,
|
|
155
|
-
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
|
|
156
|
-
htmlFor: uniqueId
|
|
157
|
-
}, LabelProps))), /*#__PURE__*/React.createElement(MultiSelect, _extends({
|
|
158
|
-
options: options,
|
|
159
|
-
onChange: this.handleChange,
|
|
160
|
-
selectedOptions: selectedOptions,
|
|
161
|
-
getRef: this.handleGetRef,
|
|
162
|
-
isReadOnly: isReadOnly,
|
|
163
|
-
needSelectAll: needSelectAll,
|
|
164
|
-
selectAllText: selectAllText,
|
|
165
|
-
isAnimate: isAnimate,
|
|
166
|
-
emptyMessage: emptyMessage,
|
|
167
|
-
textBoxSize: textBoxSize,
|
|
168
|
-
variant: variant,
|
|
169
|
-
size: size,
|
|
170
|
-
animationStyle: animationStyle,
|
|
171
|
-
dataId: dataId,
|
|
172
|
-
onKeyDown: onKeyDown,
|
|
173
|
-
borderColor: borderColor,
|
|
174
|
-
placeHolder: placeHolder,
|
|
175
|
-
isDisabled: isDisabled,
|
|
176
|
-
textField: textField,
|
|
177
|
-
valueField: valueField,
|
|
178
|
-
getNextOptions: this.getNextOptions,
|
|
179
|
-
onSearch: this.onSearch,
|
|
180
|
-
onDropBoxOpen: this.onDropBoxOpen,
|
|
181
|
-
popupGroup: popupGroup,
|
|
182
|
-
isNextOptions: isNextOptions,
|
|
183
|
-
isSearching: isSearching,
|
|
184
|
-
palette: palette,
|
|
185
|
-
i18nKeys: i18nKeys,
|
|
186
|
-
htmlId: uniqueId,
|
|
187
|
-
customChildrenClass: customChildrenClass,
|
|
188
|
-
onFocus: onFocus
|
|
189
|
-
}, MultiSelectProps, {
|
|
190
|
-
ariaLabelledby: uniqueId
|
|
191
|
-
}), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
192
|
-
text: validationMessage,
|
|
193
|
-
palette: validationPalette,
|
|
194
|
-
type: errorType,
|
|
195
|
-
dataId: `${dataId}_ValidationMessage`,
|
|
196
|
-
htmlFor: uniqueId
|
|
197
|
-
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
198
|
-
text: validationRuleMessage,
|
|
199
|
-
palette: validationRulePalette,
|
|
200
|
-
type: errorType,
|
|
201
|
-
dataId: `${dataId}_ValidationRuleMessage`,
|
|
202
|
-
htmlFor: uniqueId
|
|
203
|
-
}, ValidationMessageProps2)));
|
|
204
|
-
}
|
|
116
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
className: `${style.container} ${isDisabled ? style.disabled : isReadOnly ? style.readonly : ''}`,
|
|
118
|
+
"data-title": isDisabled ? title : null,
|
|
119
|
+
"data-selector-id": dataSelectorId
|
|
120
|
+
}, labelName && /*#__PURE__*/React.createElement(FieldContainer, {
|
|
121
|
+
infoText: infoText,
|
|
122
|
+
isLocked: isLocked,
|
|
123
|
+
lockedInfoText: lockedInfoText,
|
|
124
|
+
renderProps: renderLabelProps
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Label, _extends({
|
|
126
|
+
text: labelName,
|
|
127
|
+
id: id,
|
|
128
|
+
size: fieldSize === 'small' ? 'small' : 'medium',
|
|
129
|
+
palette: isDarkPalette ? 'dark' : isMandatory ? 'mandatory' : isDisabled ? 'primary' : labelPalette // onClick={this.handleLabelClick}
|
|
130
|
+
,
|
|
131
|
+
customClass: `${style.fieldLabel} ${isMandatory ? style.labelMandatory : ''}`,
|
|
132
|
+
dataId: isDisabled ? `${dataId}_label_disabled` : isMandatory ? `${dataId}_label_mandatory` : `${dataId}_label`,
|
|
133
|
+
htmlFor: uniqueId
|
|
134
|
+
}, LabelProps))), /*#__PURE__*/React.createElement(MultiSelect, _extends({
|
|
135
|
+
options: options,
|
|
136
|
+
onChange: handleChange,
|
|
137
|
+
selectedOptions: selectedOptions,
|
|
138
|
+
getRef: handleGetRef,
|
|
139
|
+
isReadOnly: isReadOnly,
|
|
140
|
+
needSelectAll: needSelectAll,
|
|
141
|
+
selectAllText: selectAllText,
|
|
142
|
+
isAnimate: isAnimate,
|
|
143
|
+
emptyMessage: emptyMessage,
|
|
144
|
+
textBoxSize: textBoxSize,
|
|
145
|
+
variant: variant,
|
|
146
|
+
size: size,
|
|
147
|
+
animationStyle: animationStyle,
|
|
148
|
+
dataId: dataId,
|
|
149
|
+
onKeyDown: onKeyDown,
|
|
150
|
+
borderColor: borderColor,
|
|
151
|
+
placeHolder: placeHolder,
|
|
152
|
+
isDisabled: isDisabled,
|
|
153
|
+
textField: textField,
|
|
154
|
+
valueField: valueField,
|
|
155
|
+
getNextOptions: handleGetNextOptions,
|
|
156
|
+
onSearch: handleSearch,
|
|
157
|
+
onDropBoxOpen: handleDropBoxOpen,
|
|
158
|
+
popupGroup: popupGroup,
|
|
159
|
+
isNextOptions: isNextOptions,
|
|
160
|
+
isSearching: isSearching,
|
|
161
|
+
palette: palette,
|
|
162
|
+
i18nKeys: i18nKeys,
|
|
163
|
+
htmlId: uniqueId,
|
|
164
|
+
customChildrenClass: customChildrenClass,
|
|
165
|
+
onFocus: onFocus
|
|
166
|
+
}, MultiSelectProps, {
|
|
167
|
+
ariaLabelledby: uniqueId
|
|
168
|
+
}), children ? children : null), validationMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
169
|
+
text: validationMessage,
|
|
170
|
+
palette: validationPalette,
|
|
171
|
+
type: errorType,
|
|
172
|
+
dataId: `${dataId}_ValidationMessage`,
|
|
173
|
+
htmlFor: uniqueId
|
|
174
|
+
}, ValidationMessageProps1)), validationRuleMessage && /*#__PURE__*/React.createElement(ValidationMessage, _extends({
|
|
175
|
+
text: validationRuleMessage,
|
|
176
|
+
palette: validationRulePalette,
|
|
177
|
+
type: errorType,
|
|
178
|
+
dataId: `${dataId}_ValidationRuleMessage`,
|
|
179
|
+
htmlFor: uniqueId
|
|
180
|
+
}, ValidationMessageProps2)));
|
|
181
|
+
} // const MomoizedMultiSelectField = memo(MultiSelectField);
|
|
182
|
+
// export default MomoizedMultiSelectField;
|
|
183
|
+
// MomoizedMultiSelectField.propTypes = propTypes;
|
|
184
|
+
// MomoizedMultiSelectField.defaultProps = defaultProps;
|
|
185
|
+
|
|
205
186
|
|
|
206
|
-
}
|
|
207
187
|
MultiSelectField.propTypes = propTypes;
|
|
208
|
-
MultiSelectField.defaultProps = defaultProps;
|
|
209
|
-
|
|
210
|
-
// componentGroup: 'Form Fields',
|
|
211
|
-
// folderName: 'General'
|
|
212
|
-
// };
|
|
213
|
-
// }
|
|
188
|
+
MultiSelectField.defaultProps = defaultProps;
|
|
189
|
+
export default MultiSelectField;
|