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