@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
@@ -5,9 +5,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.StatusDropdown = void 0;
8
+ exports["default"] = void 0;
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _hooks = require("@zohodesk/hooks");
11
13
 
12
14
  var _defaultProps = require("../../../../list/status/StatusDropdown/props/defaultProps");
13
15
 
@@ -15,527 +17,420 @@ var _propTypes = require("../../../../list/status/StatusDropdown/props/propTypes
15
17
 
16
18
  var _icons = require("@zohodesk/icons");
17
19
 
18
- var _Popup = _interopRequireDefault(require("@zohodesk/components/lib/Popup/Popup"));
20
+ var _Popup = _interopRequireDefault(require("@zohodesk/components/es/v1/Popup/Popup"));
19
21
 
20
- var _Layout = require("@zohodesk/components/lib/Layout");
22
+ var _Layout = require("@zohodesk/components/es/v1/Layout");
21
23
 
22
- var _DropDownHeading = _interopRequireDefault(require("@zohodesk/components/lib/DropDown/DropDownHeading"));
24
+ var _DropDownHeading = _interopRequireDefault(require("@zohodesk/components/es/v1/DropDown/DropDownHeading"));
23
25
 
24
- var _TextBoxIcon = _interopRequireDefault(require("@zohodesk/components/lib/TextBoxIcon/TextBoxIcon"));
26
+ var _TextBoxIcon = _interopRequireDefault(require("@zohodesk/components/es/v1/TextBoxIcon/TextBoxIcon"));
25
27
 
26
28
  var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"));
27
29
 
28
30
  var _EmptySearch = _interopRequireDefault(require("@zohodesk/svg/lib/emptystate/version3/EmptySearch"));
29
31
 
30
- var _Common = require("@zohodesk/components/lib/utils/Common.js");
32
+ var _Common = require("@zohodesk/components/es/utils/Common");
31
33
 
32
- var _TextBox = _interopRequireDefault(require("@zohodesk/components/lib/TextBox/TextBox"));
34
+ var _TextBox = _interopRequireDefault(require("@zohodesk/components/es/v1/TextBox/TextBox"));
33
35
 
34
36
  var _CommonEmptyState = _interopRequireDefault(require("../../../emptystate/CommonEmptyState/CommonEmptyState"));
35
37
 
36
38
  var _StatusListItem = _interopRequireDefault(require("../StatusListItem/StatusListItem"));
37
39
 
38
- var _commonModule = _interopRequireDefault(require("@zohodesk/components/lib/common/common.module.css"));
40
+ var _commonModule = _interopRequireDefault(require("@zohodesk/components/es/common/common.module.css"));
39
41
 
40
- var _ResponsiveDropBox = _interopRequireDefault(require("@zohodesk/components/lib/ResponsiveDropBox/ResponsiveDropBox"));
42
+ var _ResponsiveDropBox = _interopRequireDefault(require("@zohodesk/components/es/v1/ResponsiveDropBox/ResponsiveDropBox"));
41
43
 
42
- var _CustomResponsive = require("@zohodesk/components/lib/Responsive/CustomResponsive");
44
+ var _CustomResponsive = require("@zohodesk/components/es/v1/Responsive/CustomResponsive");
43
45
 
44
- var _IdProvider = require("@zohodesk/components/lib/Provider/IdProvider");
46
+ var _IdProvider = require("@zohodesk/components/es/v1/Provider/IdProvider");
45
47
 
46
- var _semanticButtonModule = _interopRequireDefault(require("@zohodesk/components/lib/semantic/Button/semanticButton.module.css"));
48
+ var _semanticButtonModule = _interopRequireDefault(require("@zohodesk/components/es/semantic/Button/semanticButton.module.css"));
47
49
 
48
50
  var _StatusDropdownModule = _interopRequireDefault(require("../../../../list/status/StatusDropdown/StatusDropdown.module.css"));
49
51
 
50
52
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
51
53
 
52
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
53
-
54
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
54
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
55
+
56
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
57
+
58
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
59
+
60
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
61
+
62
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
63
+
64
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
65
+
66
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
67
+
68
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
69
+
70
+ function StatusDropdown(props) {
71
+ var value = props.value,
72
+ removeClose = props.removeClose,
73
+ boxSize = props.boxSize,
74
+ keyName = props.keyName,
75
+ idName = props.idName,
76
+ title = props.title,
77
+ isSearch = props.isSearch,
78
+ isArrow = props.isArrow,
79
+ placeHolderText = props.placeHolderText,
80
+ className = props.className,
81
+ right = props.right,
82
+ left = props.left,
83
+ top = props.top,
84
+ bottom = props.bottom,
85
+ isOpen = props.isPopupOpen,
86
+ isPopupReady = props.isPopupReady,
87
+ position = props.position,
88
+ getTargetRef = props.getTargetRef,
89
+ getContainerRef = props.getContainerRef,
90
+ dataId = props.dataId,
91
+ searchBoxSize = props.searchBoxSize,
92
+ searchEmptyHint = props.searchEmptyHint,
93
+ searchErrorText = props.searchErrorText,
94
+ activeStyle = props.activeStyle,
95
+ _props$showOnHover = props.showOnHover,
96
+ showOnHover = _props$showOnHover === void 0 ? false : _props$showOnHover,
97
+ isDisabled = props.isDisabled,
98
+ showIconOnHover = props.showIconOnHover,
99
+ isReadOnly = props.isReadOnly,
100
+ hoverStyle = props.hoverStyle,
101
+ isEditable = props.isEditable,
102
+ needTick = props.needTick,
103
+ dataTitle = props.dataTitle,
104
+ isDataLoaded = props.isDataLoaded,
105
+ children = props.children,
106
+ targetAlign = props.targetAlign,
107
+ needResponsive = props.needResponsive,
108
+ arrowIconPosition = props.arrowIconPosition,
109
+ statusColor = props.statusColor,
110
+ _props$needExternalPo = props.needExternalPopupState,
111
+ needExternalPopupState = _props$needExternalPo === void 0 ? false : _props$needExternalPo,
112
+ _props$isPopupActive = props.isPopupActive,
113
+ isPopupActive = _props$isPopupActive === void 0 ? false : _props$isPopupActive,
114
+ needMultiLineText = props.needMultiLineText,
115
+ boxPosition = props.boxPosition,
116
+ togglePopup = props.togglePopup,
117
+ onTogglePopup = props.onTogglePopup,
118
+ onClick = props.onClick,
119
+ onSelectLabel = props.onSelectLabel,
120
+ isNextOptions = props.isNextOptions,
121
+ getNextOptions = props.getNextOptions,
122
+ options = props.options,
123
+ _props$a11y = props.a11y,
124
+ a11y = _props$a11y === void 0 ? {} : _props$a11y;
125
+
126
+ var _useState = (0, _react.useState)(options),
127
+ _useState2 = _slicedToArray(_useState, 2),
128
+ optionsList = _useState2[0],
129
+ setOptionsList = _useState2[1];
130
+
131
+ var _useState3 = (0, _react.useState)(0),
132
+ _useState4 = _slicedToArray(_useState3, 2),
133
+ selectedIndex = _useState4[0],
134
+ setSelectedIndex = _useState4[1];
135
+
136
+ var _useState5 = (0, _react.useState)(''),
137
+ _useState6 = _slicedToArray(_useState5, 2),
138
+ searchString = _useState6[0],
139
+ setSearchString = _useState6[1];
140
+
141
+ var hiddenInput = (0, _react.useRef)(null);
142
+ var searchInput = (0, _react.useRef)(null);
143
+ var optionsContainer = (0, _react.useRef)(null);
144
+ var dropdown = (0, _react.useRef)({});
145
+ var getAriaId = (0, _IdProvider.useUniqueId)();
146
+ var _a11y$tabIndex = a11y.tabIndex,
147
+ tabIndex = _a11y$tabIndex === void 0 ? 0 : _a11y$tabIndex,
148
+ ariaLabelledby = a11y.ariaLabelledby,
149
+ ariaLabel = a11y.ariaLabel;
150
+ var isPopupOpen = needExternalPopupState ? isPopupActive && isOpen : isOpen;
151
+ var containerClass = "".concat(className ? className : '', " ").concat(isPopupReady ? activeStyle ? activeStyle : '' : showIconOnHover ? _StatusDropdownModule["default"].hoverIcon : '', " ").concat(isDisabled ? _commonModule["default"].disabled : isReadOnly ? _StatusDropdownModule["default"].readOnly : !isEditable ? _StatusDropdownModule["default"].cursorDefault : !showOnHover ? "".concat(_StatusDropdownModule["default"].cursor, " ").concat(hoverStyle ? hoverStyle : '') : "".concat(hoverStyle ? hoverStyle : '', " ").concat(_StatusDropdownModule["default"].cursorDefault));
152
+ var ariaTitleId = getAriaId();
153
+
154
+ function emptySearchSVG() {
155
+ return /*#__PURE__*/_react["default"].createElement(_EmptySearch["default"], {
156
+ size: "small"
157
+ });
158
+ }
55
159
 
56
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
160
+ function handleInputRef(el) {
161
+ hiddenInput.current = el;
162
+ }
57
163
 
58
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
164
+ function itemRef(ele, index, id) {
165
+ dropdown.current["suggestion_".concat(id)] = ele;
166
+ }
59
167
 
60
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
168
+ function searchInputRef(el) {
169
+ searchInput.current = el;
170
+ }
61
171
 
62
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
172
+ function handleTogglePopup(e) {
173
+ !isPopupOpen && onSelectLabel && onSelectLabel(e);
174
+ onTogglePopup && onTogglePopup(isPopupOpen);
175
+ togglePopup(e, boxPosition);
176
+ }
63
177
 
64
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
178
+ function scrollContentRef(el) {
179
+ if (isPopupOpen) {
180
+ optionsContainer.current = el;
181
+ }
182
+ }
65
183
 
66
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
184
+ function onSelect(element, e) {
185
+ onClick && onClick(e, element);
186
+ onTogglePopup && onTogglePopup(isPopupOpen);
187
+ togglePopup(e);
188
+ }
67
189
 
68
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
190
+ function handleKeyDown(e) {
191
+ var keyCode = e.keyCode;
192
+ var totalIndex = optionsList.length;
69
193
 
70
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
194
+ if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
195
+ e.preventDefault(); //prevent body scroll
196
+ }
71
197
 
72
- var StatusDropdown = /*#__PURE__*/function (_React$Component) {
73
- _inherits(StatusDropdown, _React$Component);
198
+ if (isPopupReady) {
199
+ switch (keyCode) {
200
+ case 40:
201
+ if (selectedIndex === totalIndex - 1) {
202
+ setSelectedIndex(0);
203
+ } else {
204
+ if (selectedIndex === totalIndex - 3) {
205
+ isNextOptions && getNextOptions && getNextOptions();
206
+ }
74
207
 
75
- var _super = _createSuper(StatusDropdown);
208
+ setSelectedIndex(selectedIndex + 1);
209
+ }
76
210
 
77
- function StatusDropdown(props) {
78
- var _this;
211
+ break;
79
212
 
80
- _classCallCheck(this, StatusDropdown);
213
+ case 38:
214
+ if (selectedIndex === 0) {
215
+ setSelectedIndex(totalIndex - 1);
216
+ } else {
217
+ setSelectedIndex(selectedIndex - 1);
218
+ }
81
219
 
82
- _this = _super.call(this, props);
83
- _this.state = {
84
- searchString: '',
85
- selectedIndex: 0,
86
- options: props.options
87
- };
88
- _this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
89
- _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
90
- _this.onSelect = _this.onSelect.bind(_assertThisInitialized(_this));
91
- _this.handleTogglePopup = _this.handleTogglePopup.bind(_assertThisInitialized(_this));
92
- _this.onSearchClear = _this.onSearchClear.bind(_assertThisInitialized(_this));
93
- _this.searchList = _this.searchList.bind(_assertThisInitialized(_this));
94
- _this.scrollContentRef = _this.scrollContentRef.bind(_assertThisInitialized(_this));
95
- _this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_this));
96
- _this.searchInputRef = _this.searchInputRef.bind(_assertThisInitialized(_this));
97
- _this.itemRef = _this.itemRef.bind(_assertThisInitialized(_this));
98
- _this.inputRef = _this.inputRef.bind(_assertThisInitialized(_this));
99
- _this.handleScroll = _this.handleScroll.bind(_assertThisInitialized(_this));
100
- _this.emptySearchSVG = _this.emptySearchSVG.bind(_assertThisInitialized(_this));
101
- _this.getAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
102
- return _this;
103
- }
220
+ break;
104
221
 
105
- _createClass(StatusDropdown, [{
106
- key: "emptySearchSVG",
107
- value: function emptySearchSVG() {
108
- return /*#__PURE__*/_react["default"].createElement(_EmptySearch["default"], {
109
- size: "small"
110
- });
111
- }
112
- }, {
113
- key: "inputRef",
114
- value: function inputRef(el) {
115
- this.hiddenInput = el;
116
- }
117
- }, {
118
- key: "itemRef",
119
- value: function itemRef(ele, index, id) {
120
- this["suggestion_".concat(id)] = ele;
121
- }
122
- }, {
123
- key: "searchInputRef",
124
- value: function searchInputRef(el) {
125
- this.searchInput = el;
126
- }
127
- }, {
128
- key: "handleTogglePopup",
129
- value: function handleTogglePopup(e) {
130
- var _this$props = this.props,
131
- togglePopup = _this$props.togglePopup,
132
- boxPosition = _this$props.boxPosition,
133
- onSelectLabel = _this$props.onSelectLabel,
134
- isPopupOpen = _this$props.isPopupOpen,
135
- onTogglePopup = _this$props.onTogglePopup;
136
- !isPopupOpen && onSelectLabel && onSelectLabel(e);
137
- onTogglePopup && onTogglePopup(isPopupOpen);
138
- togglePopup(e, boxPosition);
139
- }
140
- }, {
141
- key: "scrollContentRef",
142
- value: function scrollContentRef(el) {
143
- var isPopupOpen = this.props.isPopupOpen;
222
+ case 13:
223
+ onClick && onClick(optionsList[selectedIndex].name, e);
224
+ onTogglePopup && onTogglePopup(isPopupOpen);
225
+ togglePopup(e, boxPosition);
226
+ break;
144
227
 
145
- if (isPopupOpen) {
146
- this.optionsContainer = el;
228
+ default:
229
+ break;
147
230
  }
148
- }
149
- }, {
150
- key: "UNSAFE_componentWillReceiveProps",
151
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
152
- if (nextProps.options.length != this.props.options.length) {
153
- this.setState({
154
- options: nextProps.options
155
- });
231
+ } else {
232
+ if (keyCode === 13 || keyCode === 40) {
233
+ togglePopup(e, boxPosition);
156
234
  }
157
235
  }
158
- }, {
159
- key: "onSelect",
160
- value: function onSelect(element, e) {
161
- var _this$props2 = this.props,
162
- onClick = _this$props2.onClick,
163
- togglePopup = _this$props2.togglePopup,
164
- isPopupOpen = _this$props2.isPopupOpen,
165
- onTogglePopup = _this$props2.onTogglePopup;
166
- onClick && onClick(e, element);
167
- onTogglePopup && onTogglePopup(isPopupOpen);
168
- togglePopup(e);
169
- }
170
- }, {
171
- key: "componentDidUpdate",
172
- value: function componentDidUpdate(prevProps) {
173
- var _this2 = this;
174
-
175
- var _this$props3 = this.props,
176
- isPopupOpen = _this$props3.isPopupOpen,
177
- isSearch = _this$props3.isSearch,
178
- idName = _this$props3.idName;
179
- var _this$state = this.state,
180
- selectedIndex = _this$state.selectedIndex,
181
- options = _this$state.options;
182
-
183
- if (prevProps.isPopupOpen != isPopupOpen) {
184
- setTimeout(function () {
185
- isPopupOpen && isSearch ? _this2.searchInput && _this2.searchInput.focus() : _this2.hiddenInput && _this2.hiddenInput.focus();
186
- }, 10);
187
- }
188
-
189
- var mergeOptions = options;
190
- var option = mergeOptions[selectedIndex];
191
- var id = option && option[idName] || {};
192
- var selSuggestion = this["suggestion_".concat(id)];
236
+ }
193
237
 
194
- if (isPopupOpen) {
195
- this.optionsContainer && (0, _Common.scrollTo)(this.optionsContainer, selSuggestion);
196
- }
238
+ function searchList(value) {
239
+ var foptions = options.filter(function (dept) {
240
+ return dept[keyName].toLowerCase().indexOf(value.toLowerCase()) != -1;
241
+ });
242
+ return foptions;
243
+ }
197
244
 
198
- if (!prevProps.isPopupOpen && this.props.isPopupOpen) {
199
- this.onSearchClear();
200
- }
201
- }
202
- }, {
203
- key: "handleKeyDown",
204
- value: function handleKeyDown(e) {
205
- var keyCode = e.keyCode;
206
- var _this$state2 = this.state,
207
- selectedIndex = _this$state2.selectedIndex,
208
- options = _this$state2.options;
209
- var totalIndex = options.length;
210
- var _this$props4 = this.props,
211
- togglePopup = _this$props4.togglePopup,
212
- onClick = _this$props4.onClick,
213
- boxPosition = _this$props4.boxPosition,
214
- isPopupReady = _this$props4.isPopupReady,
215
- isNextOptions = _this$props4.isNextOptions,
216
- getNextOptions = _this$props4.getNextOptions,
217
- onTogglePopup = _this$props4.onTogglePopup,
218
- isPopupOpen = _this$props4.isPopupOpen;
219
-
220
- if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
221
- e.preventDefault(); //prevent body scroll
222
- }
245
+ function handleChange(value, e) {
246
+ var foptions = searchList(value);
247
+ setSearchString(value);
248
+ setSelectedIndex(-1);
249
+ setOptionsList(foptions);
250
+ }
223
251
 
224
- if (isPopupReady) {
225
- switch (keyCode) {
226
- case 40:
227
- if (selectedIndex === totalIndex - 1) {
228
- this.setState({
229
- selectedIndex: 0
230
- });
231
- } else {
232
- if (selectedIndex === totalIndex - 3) {
233
- isNextOptions && getNextOptions && getNextOptions();
234
- }
235
-
236
- this.setState({
237
- selectedIndex: selectedIndex + 1
238
- });
239
- }
252
+ function onSearchClear() {
253
+ var foptions = searchList('');
254
+ setSearchString('');
255
+ setOptionsList(foptions);
256
+ }
240
257
 
241
- break;
242
-
243
- case 38:
244
- if (selectedIndex === 0) {
245
- this.setState({
246
- selectedIndex: totalIndex - 1
247
- });
248
- } else {
249
- this.setState({
250
- selectedIndex: selectedIndex - 1
251
- });
252
- }
258
+ function handleMouseEnter(id, value, index, e) {
259
+ setSelectedIndex(index);
260
+ }
253
261
 
254
- break;
262
+ function handleScroll(e) {
263
+ if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
264
+ isNextOptions && getNextOptions && getNextOptions(e);
265
+ }
266
+ }
255
267
 
256
- case 13:
257
- onClick && onClick(options[selectedIndex].name, e);
258
- onTogglePopup && onTogglePopup(isPopupOpen);
259
- togglePopup(e, boxPosition);
260
- break;
268
+ function responsiveFunc(_ref) {
269
+ var mediaQueryOR = _ref.mediaQueryOR;
270
+ return {
271
+ tabletMode: mediaQueryOR([{
272
+ maxWidth: 700
273
+ }])
274
+ };
275
+ }
261
276
 
262
- default:
263
- break;
264
- }
265
- } else {
266
- if (keyCode === 13 || keyCode === 40) {
267
- togglePopup(e, boxPosition);
268
- }
269
- }
270
- }
271
- }, {
272
- key: "searchList",
273
- value: function searchList(value) {
274
- var _this$props5 = this.props,
275
- options = _this$props5.options,
276
- keyName = _this$props5.keyName;
277
- var foptions = options.filter(function (dept) {
278
- return dept[keyName].toLowerCase().indexOf(value.toLowerCase()) != -1;
279
- });
280
- return foptions;
277
+ (0, _hooks.useEffectCallOnlyAfterState)(function () {
278
+ setOptionsList(options);
279
+ }, [options.length]);
280
+ (0, _hooks.useEffectCallOnlyAfterState)(function () {
281
+ setTimeout(function () {
282
+ isPopupOpen && isSearch ? searchInput.current && searchInput.current.focus() : hiddenInput.current && hiddenInput.current.focus();
283
+ }, 10);
284
+ var mergeOptions = optionsList;
285
+ var option = mergeOptions[selectedIndex];
286
+ var id = option && option[idName] || {};
287
+ var selSuggestion = dropdown.current["suggestion_".concat(id)];
288
+
289
+ if (isPopupOpen) {
290
+ optionsContainer.current && (0, _Common.scrollTo)(optionsContainer.current, selSuggestion);
291
+ onSearchClear();
281
292
  }
282
- }, {
283
- key: "handleChange",
284
- value: function handleChange(value, e) {
285
- var foptions = this.searchList(value);
286
- this.setState({
287
- searchString: value,
288
- selectedIndex: -1,
289
- options: foptions
290
- });
291
- }
292
- }, {
293
- key: "onSearchClear",
294
- value: function onSearchClear() {
295
- var foptions = this.searchList('');
296
- this.setState({
297
- searchString: '',
298
- options: foptions
299
- });
300
- }
301
- }, {
302
- key: "handleMouseEnter",
303
- value: function handleMouseEnter(id, value, index, e) {
304
- this.setState({
305
- selectedIndex: index
306
- });
307
- }
308
- }, {
309
- key: "handleScroll",
310
- value: function handleScroll(e) {
311
- var _this$props6 = this.props,
312
- isNextOptions = _this$props6.isNextOptions,
313
- getNextOptions = _this$props6.getNextOptions;
314
-
315
- if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
316
- isNextOptions && getNextOptions && getNextOptions(e);
293
+ }, [isPopupOpen]);
294
+ return /*#__PURE__*/_react["default"].createElement("div", {
295
+ className: _StatusDropdownModule["default"].posRel,
296
+ onMouseEnter: showOnHover && !isDisabled && !isReadOnly && isEditable ? handleTogglePopup : undefined,
297
+ onMouseLeave: showOnHover && !isDisabled && !isReadOnly && isEditable ? handleTogglePopup : undefined
298
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
299
+ tagName: "button",
300
+ alignBox: "row",
301
+ className: "".concat(_StatusDropdownModule["default"].container, " ").concat(containerClass, " ").concat(_semanticButtonModule["default"].buttonReset),
302
+ onMouseDown: !showOnHover && !isDisabled && !isReadOnly && isEditable ? handleTogglePopup : null,
303
+ eleRef: getTargetRef,
304
+ align: targetAlign,
305
+ isCover: false,
306
+ dataId: dataId,
307
+ onClick: removeClose,
308
+ disabled: isDisabled || isReadOnly ? true : false,
309
+ "aria-haspopup": true,
310
+ "aria-expanded": isPopupOpen && isEditable ? true : false,
311
+ tabIndex: tabIndex,
312
+ "aria-labelledby": ariaLabelledby,
313
+ "aria-label": ariaLabel,
314
+ "aria-disabled": isDisabled || isReadOnly
315
+ }, isEditable ? /*#__PURE__*/_react["default"].createElement("div", {
316
+ className: _StatusDropdownModule["default"].hiddenInput
317
+ }, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
318
+ type: "text",
319
+ inputRef: handleInputRef,
320
+ onKeyDown: handleKeyDown,
321
+ needAppearance: false,
322
+ placeHolder: placeHolderText
323
+ })) : null, children ? children : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
324
+ className: "".concat(_StatusDropdownModule["default"].value, " toggleDropText"),
325
+ shrink: true,
326
+ tagName: "span",
327
+ "data-title": dataTitle
328
+ }, value), isEditable ? /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
329
+ "aria-hidden": true,
330
+ size: "7",
331
+ name: "ZD-down",
332
+ iconClass: 'toggleDropIcon'.concat(" ", _StatusDropdownModule["default"].arrow, " ").concat(_StatusDropdownModule["default"]["".concat(arrowIconPosition, "_arrow")]),
333
+ dataId: "statusdownarrow"
334
+ }) : null), isPopupOpen && isEditable ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
335
+ query: responsiveFunc,
336
+ responsiveId: "Helmet"
337
+ }, function (_ref2) {
338
+ var tabletMode = _ref2.tabletMode;
339
+ return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
340
+ boxPosition: position,
341
+ isActive: isPopupReady,
342
+ onClick: removeClose,
343
+ size: boxSize,
344
+ right: right,
345
+ left: left,
346
+ top: top,
347
+ bottom: bottom,
348
+ isArrow: isArrow,
349
+ isAnimate: true,
350
+ getRef: getContainerRef,
351
+ customClass: {
352
+ customDropBoxWrap: _StatusDropdownModule["default"].dropBoxContainer
353
+ },
354
+ needResponsive: needResponsive,
355
+ isResponsivePadding: true
356
+ }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isSearch ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
357
+ className: _StatusDropdownModule["default"].search
358
+ }, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
359
+ placeHolder: placeHolderText,
360
+ onChange: handleChange,
361
+ value: searchString,
362
+ onClear: onSearchClear,
363
+ size: searchBoxSize,
364
+ inputRef: searchInputRef,
365
+ onKeyDown: handleKeyDown,
366
+ a11y: {
367
+ ariaHaspopup: true,
368
+ ariaExpanded: true,
369
+ role: 'combobox',
370
+ ariaActivedescendant: value,
371
+ ariaOwns: ariaTitleId
317
372
  }
318
- }
319
- }, {
320
- key: "responsiveFunc",
321
- value: function responsiveFunc(_ref) {
322
- var mediaQueryOR = _ref.mediaQueryOR;
323
- return {
324
- tabletMode: mediaQueryOR([{
325
- maxWidth: 700
326
- }])
327
- };
328
- }
329
- }, {
330
- key: "render",
331
- value: function render() {
332
- var _this3 = this;
333
-
334
- var _this$state3 = this.state,
335
- options = _this$state3.options,
336
- selectedIndex = _this$state3.selectedIndex;
337
- var _this$props7 = this.props,
338
- value = _this$props7.value,
339
- removeClose = _this$props7.removeClose,
340
- boxSize = _this$props7.boxSize,
341
- keyName = _this$props7.keyName,
342
- idName = _this$props7.idName,
343
- title = _this$props7.title,
344
- isSearch = _this$props7.isSearch,
345
- isArrow = _this$props7.isArrow,
346
- placeHolderText = _this$props7.placeHolderText,
347
- className = _this$props7.className,
348
- right = _this$props7.right,
349
- left = _this$props7.left,
350
- top = _this$props7.top,
351
- bottom = _this$props7.bottom,
352
- isOpen = _this$props7.isPopupOpen,
353
- isPopupReady = _this$props7.isPopupReady,
354
- position = _this$props7.position,
355
- getTargetRef = _this$props7.getTargetRef,
356
- getContainerRef = _this$props7.getContainerRef,
357
- dataId = _this$props7.dataId,
358
- searchBoxSize = _this$props7.searchBoxSize,
359
- searchEmptyHint = _this$props7.searchEmptyHint,
360
- searchErrorText = _this$props7.searchErrorText,
361
- activeStyle = _this$props7.activeStyle,
362
- _this$props7$showOnHo = _this$props7.showOnHover,
363
- showOnHover = _this$props7$showOnHo === void 0 ? false : _this$props7$showOnHo,
364
- isDisabled = _this$props7.isDisabled,
365
- showIconOnHover = _this$props7.showIconOnHover,
366
- isReadOnly = _this$props7.isReadOnly,
367
- hoverStyle = _this$props7.hoverStyle,
368
- isEditable = _this$props7.isEditable,
369
- needTick = _this$props7.needTick,
370
- dataTitle = _this$props7.dataTitle,
371
- isDataLoaded = _this$props7.isDataLoaded,
372
- children = _this$props7.children,
373
- targetAlign = _this$props7.targetAlign,
374
- needResponsive = _this$props7.needResponsive,
375
- arrowIconPosition = _this$props7.arrowIconPosition,
376
- statusColor = _this$props7.statusColor,
377
- _this$props7$needExte = _this$props7.needExternalPopupState,
378
- needExternalPopupState = _this$props7$needExte === void 0 ? false : _this$props7$needExte,
379
- _this$props7$isPopupA = _this$props7.isPopupActive,
380
- isPopupActive = _this$props7$isPopupA === void 0 ? false : _this$props7$isPopupA,
381
- needMultiLineText = _this$props7.needMultiLineText,
382
- _this$props7$a11y = _this$props7.a11y,
383
- a11y = _this$props7$a11y === void 0 ? {} : _this$props7$a11y;
384
- var _a11y$tabIndex = a11y.tabIndex,
385
- tabIndex = _a11y$tabIndex === void 0 ? 0 : _a11y$tabIndex,
386
- ariaLabelledby = a11y.ariaLabelledby,
387
- ariaLabel = a11y.ariaLabel;
388
- var isPopupOpen = needExternalPopupState ? isPopupActive && isOpen : isOpen;
389
- var searchString = this.state.searchString;
390
- var containerClass = "".concat(className ? className : '', " ").concat(isPopupReady ? activeStyle ? activeStyle : '' : showIconOnHover ? _StatusDropdownModule["default"].hoverIcon : '', " ").concat(isDisabled ? _commonModule["default"].disabled : isReadOnly ? _StatusDropdownModule["default"].readOnly : !isEditable ? _StatusDropdownModule["default"].cursorDefault : !showOnHover ? "".concat(_StatusDropdownModule["default"].cursor, " ").concat(hoverStyle ? hoverStyle : '') : "".concat(hoverStyle ? hoverStyle : '', " ").concat(_StatusDropdownModule["default"].cursorDefault));
391
- var ariaTitleId = this.getAriaId();
392
- return /*#__PURE__*/_react["default"].createElement("div", {
393
- className: _StatusDropdownModule["default"].posRel,
394
- onMouseEnter: showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : undefined,
395
- onMouseLeave: showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : undefined
396
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
397
- tagName: "button",
398
- alignBox: "row",
399
- className: "".concat(_StatusDropdownModule["default"].container, " ").concat(containerClass, " ").concat(_semanticButtonModule["default"].buttonReset),
400
- onMouseDown: !showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : null,
401
- eleRef: getTargetRef,
402
- align: targetAlign,
403
- isCover: false,
404
- dataId: dataId,
405
- onClick: removeClose,
406
- disabled: isDisabled || isReadOnly ? true : false,
407
- "aria-haspopup": true,
408
- "aria-expanded": isPopupOpen && isEditable ? true : false,
409
- tabIndex: tabIndex,
410
- "aria-labelledby": ariaLabelledby,
411
- "aria-label": ariaLabel,
412
- "aria-disabled": isDisabled || isReadOnly
413
- }, isEditable ? /*#__PURE__*/_react["default"].createElement("div", {
414
- className: _StatusDropdownModule["default"].hiddenInput
415
- }, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
416
- type: "text",
417
- inputRef: this.inputRef,
418
- onKeyDown: this.handleKeyDown,
419
- needAppearance: false,
420
- placeHolder: placeHolderText
421
- })) : null, children ? children : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
422
- className: "".concat(_StatusDropdownModule["default"].value, " toggleDropText"),
423
- shrink: true,
424
- tagName: "span",
425
- "data-title": dataTitle
426
- }, value), isEditable ? /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
427
- "aria-hidden": true,
428
- size: "7",
429
- name: "ZD-down",
430
- iconClass: 'toggleDropIcon'.concat(" ", _StatusDropdownModule["default"].arrow, " ").concat(_StatusDropdownModule["default"]["".concat(arrowIconPosition, "_arrow")]),
431
- dataId: "statusdownarrow"
432
- }) : null), isPopupOpen && isEditable ? /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
433
- query: this.responsiveFunc,
434
- responsiveId: "Helmet"
435
- }, function (_ref2) {
436
- var tabletMode = _ref2.tabletMode;
437
- return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], {
438
- boxPosition: position,
439
- isActive: isPopupReady,
440
- onClick: removeClose,
441
- size: boxSize,
442
- right: right,
443
- left: left,
444
- top: top,
445
- bottom: bottom,
446
- isArrow: isArrow,
447
- isAnimate: true,
448
- getRef: getContainerRef,
449
- customClass: {
450
- customDropBoxWrap: _StatusDropdownModule["default"].dropBoxContainer
451
- },
452
- needResponsive: needResponsive,
453
- isResponsivePadding: true
454
- }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isSearch ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
455
- className: _StatusDropdownModule["default"].search
456
- }, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
457
- placeHolder: placeHolderText,
458
- onChange: _this3.handleChange,
459
- value: searchString,
460
- onClear: _this3.onSearchClear,
461
- size: searchBoxSize,
462
- inputRef: _this3.searchInputRef,
463
- onKeyDown: _this3.handleKeyDown,
464
- a11y: {
465
- ariaHaspopup: true,
466
- ariaExpanded: true,
467
- role: 'combobox',
468
- ariaActivedescendant: value,
469
- ariaOwns: ariaTitleId
470
- }
471
- })) : null, title && options.length != 0 && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
472
- className: _StatusDropdownModule["default"].title
473
- }, /*#__PURE__*/_react["default"].createElement(_DropDownHeading["default"], {
474
- htmlId: ariaTitleId,
475
- text: title,
476
- a11y: {
477
- role: 'heading'
478
- }
479
- })), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
480
- scroll: "vertical",
481
- flexible: true,
482
- shrink: true,
483
- dataId: "".concat(dataId, "_list"),
484
- preventParentScroll: "vertical",
485
- className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt),
486
- eleRef: _this3.scrollContentRef,
487
- onScroll: _this3.handleScroll,
488
- role: isSearch ? 'listbox' : 'menu',
489
- "aria-labelledby": ariaTitleId,
490
- tabindex: "0"
491
- }, options.length != 0 && isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, options.map(function (item, i) {
492
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
493
- key: i
494
- }, /*#__PURE__*/_react["default"].createElement(_StatusListItem["default"], {
495
- dataId: "dataid_".concat(i),
496
- value: item[keyName],
497
- id: item[idName],
498
- active: value === item[keyName],
499
- onClick: _this3.onSelect.bind(_this3, item),
500
- index: i,
501
- highlight: selectedIndex === i,
502
- needTick: needTick,
503
- needBorder: false,
504
- onMouseEnter: _this3.handleMouseEnter,
505
- getRef: _this3.itemRef,
506
- bulletColor: item[statusColor],
507
- title: item[keyName],
508
- needMultiLineText: needMultiLineText,
509
- a11y: {
510
- role: isSearch ? 'option' : 'menuitem',
511
- ariaSelected: value === item[keyName]
512
- }
513
- }));
514
- })) : isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_CommonEmptyState["default"], {
515
- className: _StatusDropdownModule["default"].svgWrapper,
516
- title: searchErrorText || 'No results',
517
- description: searchEmptyHint,
518
- size: "small",
519
- getEmptyState: _this3.emptySearchSVG
520
- }) : /*#__PURE__*/_react["default"].createElement("div", {
521
- className: _StatusDropdownModule["default"].loader
522
- }, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)))));
523
- }) : null);
524
- }
525
- }]);
526
-
527
- return StatusDropdown;
528
- }(_react["default"].Component); // if (__DOCS__) {
529
- // StatusDropdown.docs = {
530
- // componentGroup: 'Molecule'
531
- // };
532
- // }
533
-
373
+ })) : null, title && optionsList.length != 0 && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
374
+ className: _StatusDropdownModule["default"].title
375
+ }, /*#__PURE__*/_react["default"].createElement(_DropDownHeading["default"], {
376
+ htmlId: ariaTitleId,
377
+ text: title,
378
+ a11y: {
379
+ role: 'heading'
380
+ }
381
+ })), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
382
+ scroll: "vertical",
383
+ flexible: true,
384
+ shrink: true,
385
+ dataId: "".concat(dataId, "_list"),
386
+ preventParentScroll: "vertical",
387
+ className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt),
388
+ eleRef: scrollContentRef,
389
+ onScroll: handleScroll,
390
+ role: isSearch ? 'listbox' : 'menu',
391
+ "aria-labelledby": ariaTitleId,
392
+ tabindex: "0"
393
+ }, optionsList.length != 0 && isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, optionsList.map(function (item, i) {
394
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
395
+ key: i
396
+ }, /*#__PURE__*/_react["default"].createElement(_StatusListItem["default"], {
397
+ dataId: "dataid_".concat(i),
398
+ value: item[keyName],
399
+ id: item[idName],
400
+ active: value === item[keyName],
401
+ onClick: function onClick(e) {
402
+ return onSelect(item, e);
403
+ },
404
+ index: i,
405
+ highlight: selectedIndex === i,
406
+ needTick: needTick,
407
+ needBorder: false,
408
+ onMouseEnter: handleMouseEnter,
409
+ getRef: itemRef,
410
+ bulletColor: item[statusColor],
411
+ title: item[keyName],
412
+ needMultiLineText: needMultiLineText,
413
+ a11y: {
414
+ role: isSearch ? 'option' : 'menuitem',
415
+ ariaSelected: value === item[keyName]
416
+ }
417
+ }));
418
+ })) : isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_CommonEmptyState["default"], {
419
+ className: _StatusDropdownModule["default"].svgWrapper,
420
+ title: searchErrorText || 'No results',
421
+ description: searchEmptyHint,
422
+ size: "small",
423
+ getEmptyState: emptySearchSVG
424
+ }) : /*#__PURE__*/_react["default"].createElement("div", {
425
+ className: _StatusDropdownModule["default"].loader
426
+ }, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)))));
427
+ }) : null);
428
+ }
534
429
 
535
- exports.StatusDropdown = StatusDropdown;
536
430
  StatusDropdown.defaultProps = _defaultProps.defaultProps;
537
431
  StatusDropdown.propTypes = _propTypes.propTypes;
538
-
539
- var _default = (0, _Popup["default"])(StatusDropdown);
540
-
432
+ var StatusDropdown_Component = (0, _Popup["default"])(StatusDropdown);
433
+ StatusDropdown_Component.defaultProps = StatusDropdown.defaultProps;
434
+ StatusDropdown_Component.propTypes = StatusDropdown.propTypes;
435
+ var _default = StatusDropdown_Component;
541
436
  exports["default"] = _default;