@zohodesk/components 1.6.0 → 1.6.2

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 (560) hide show
  1. package/README.md +18 -1
  2. package/_react-cli.config.js +24 -0
  3. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +330 -321
  4. package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +15 -9
  5. package/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css +466 -466
  6. package/assets/Appearance/dark/themes/blue/blue_CTA_DarkTheme.module.css +34 -34
  7. package/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css +33 -29
  8. package/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css +466 -466
  9. package/assets/Appearance/dark/themes/green/green_CTA_DarkTheme.module.css +34 -34
  10. package/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css +33 -29
  11. package/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css +466 -466
  12. package/assets/Appearance/dark/themes/orange/orange_CTA_DarkTheme.module.css +34 -34
  13. package/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css +33 -29
  14. package/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css +466 -466
  15. package/assets/Appearance/dark/themes/red/red_CTA_DarkTheme.module.css +34 -34
  16. package/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css +33 -29
  17. package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css +466 -466
  18. package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkTheme.module.css +34 -34
  19. package/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css +33 -29
  20. package/assets/Appearance/light/mode/Component_LightMode.module.css +330 -321
  21. package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +15 -9
  22. package/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css +466 -466
  23. package/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css +34 -34
  24. package/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css +33 -29
  25. package/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css +466 -466
  26. package/assets/Appearance/light/themes/green/green_CTA_LightTheme.module.css +34 -34
  27. package/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css +33 -29
  28. package/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css +466 -466
  29. package/assets/Appearance/light/themes/orange/orange_CTA_LightTheme.module.css +34 -34
  30. package/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css +33 -29
  31. package/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css +466 -466
  32. package/assets/Appearance/light/themes/red/red_CTA_LightTheme.module.css +34 -34
  33. package/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css +33 -29
  34. package/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css +466 -466
  35. package/assets/Appearance/light/themes/yellow/yellow_CTA_LightTheme.module.css +34 -34
  36. package/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css +33 -29
  37. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +330 -321
  38. package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +15 -9
  39. package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css +466 -466
  40. package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkTheme.module.css +34 -34
  41. package/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css +33 -29
  42. package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css +466 -466
  43. package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkTheme.module.css +34 -34
  44. package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css +33 -29
  45. package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css +466 -466
  46. package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkTheme.module.css +34 -34
  47. package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css +33 -29
  48. package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css +466 -466
  49. package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkTheme.module.css +34 -34
  50. package/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css +33 -29
  51. package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css +466 -466
  52. package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkTheme.module.css +34 -34
  53. package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css +33 -29
  54. package/assets/Contrast/darkContrastLightness.module.css +36 -36
  55. package/assets/Contrast/lightContrastLightness.module.css +36 -36
  56. package/assets/Contrast/pureDarkContrastLightness.module.css +36 -36
  57. package/cbt.config.js +41 -0
  58. package/es/AppContainer/AppContainer.js +9 -10
  59. package/es/Avatar/Avatar.js +5 -4
  60. package/es/Avatar/Avatar.module.css +8 -8
  61. package/es/AvatarTeam/AvatarTeam.js +7 -7
  62. package/es/AvatarTeam/AvatarTeam.module.css +30 -30
  63. package/es/Button/Button.js +6 -5
  64. package/es/Button/css/Button.module.css +19 -19
  65. package/es/Buttongroup/Buttongroup.js +0 -0
  66. package/es/Buttongroup/Buttongroup.module.css +5 -3
  67. package/es/Card/Card.js +0 -0
  68. package/es/CheckBox/CheckBox.js +11 -11
  69. package/es/ColorSelect/ColorMultiSelect.js +4 -2
  70. package/es/ColorSelect/ColorSingleSelect.js +4 -2
  71. package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +4 -3
  72. package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.module.css +2 -2
  73. package/es/ColorSelect/_shared/ColoredTag/ColoredTag.js +4 -2
  74. package/es/ColorSelect/_shared/helpers/renderHelpers.js +6 -4
  75. package/es/DateTime/CalendarView.js +0 -0
  76. package/es/DateTime/DateTime.js +5 -4
  77. package/es/DateTime/DateWidget.js +5 -4
  78. package/es/DateTime/Time.js +11 -12
  79. package/es/DateTime/YearView.js +0 -0
  80. package/es/DateTime/common.js +0 -0
  81. package/es/DateTime/index.js +0 -0
  82. package/es/DateTime/objectUtils.js +0 -0
  83. package/es/DateTime/typeChecker.js +0 -0
  84. package/es/DateTime/validator.js +0 -0
  85. package/es/DropBox/DropBox.js +11 -10
  86. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -3
  87. package/es/DropDown/DropDown.js +1 -2
  88. package/es/DropDown/DropDownHeading.js +0 -0
  89. package/es/DropDown/DropDownHeading.module.css +4 -4
  90. package/es/DropDown/DropDownItem.js +0 -0
  91. package/es/DropDown/DropDownItem.module.css +4 -4
  92. package/es/DropDown/DropDownSearch.js +0 -0
  93. package/es/DropDown/DropDownSearch.module.css +3 -3
  94. package/es/DropDown/DropDownSeparator.js +0 -0
  95. package/es/Label/Label.js +7 -7
  96. package/es/Label/Label.module.css +5 -5
  97. package/es/Layout/Box.js +0 -0
  98. package/es/Layout/Container.js +0 -0
  99. package/es/Layout/utils.js +0 -0
  100. package/es/ListItem/ListContainer.js +5 -6
  101. package/es/ListItem/ListItem.js +5 -4
  102. package/es/ListItem/ListItem.module.css +30 -19
  103. package/es/ListItem/ListItemWithAvatar.js +10 -11
  104. package/es/ListItem/ListItemWithCheckBox.js +5 -4
  105. package/es/ListItem/ListItemWithIcon.js +5 -4
  106. package/es/ListItem/ListItemWithRadio.js +5 -4
  107. package/es/Modal/Modal.js +5 -4
  108. package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -0
  109. package/es/MultiSelect/AdvancedMultiSelect.js +11 -8
  110. package/es/MultiSelect/EmptyState.js +16 -2
  111. package/es/MultiSelect/MultiSelect.js +10 -8
  112. package/es/MultiSelect/MultiSelectWithAvatar.js +7 -4
  113. package/es/MultiSelect/SelectedOptions.js +8 -6
  114. package/es/MultiSelect/Suggestions.js +8 -6
  115. package/es/MultiSelect/props/propTypes.js +3 -0
  116. package/es/Popup/Popup.js +0 -0
  117. package/es/Provider/LibraryContext.js +11 -3
  118. package/es/Radio/Radio.js +11 -11
  119. package/es/Radio/Radio.module.css +9 -8
  120. package/es/Responsive/CustomResponsive.js +0 -0
  121. package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -2
  122. package/es/Ribbon/Ribbon.js +0 -0
  123. package/es/Ribbon/Ribbon.module.css +25 -20
  124. package/es/Select/GroupSelect.js +13 -12
  125. package/es/Select/Select.js +14 -12
  126. package/es/Select/SelectWithAvatar.js +13 -12
  127. package/es/Select/SelectWithIcon.js +10 -8
  128. package/es/Select/props/propTypes.js +3 -0
  129. package/es/Stencils/Stencils.js +0 -0
  130. package/es/Stencils/Stencils.module.css +11 -11
  131. package/es/Switch/Switch.js +8 -8
  132. package/es/Tab/Tab.js +5 -4
  133. package/es/Tab/TabContentWrapper.js +5 -4
  134. package/es/Tab/TabWrapper.js +4 -2
  135. package/es/Tab/Tabs.js +19 -20
  136. package/es/Tag/Tag.js +11 -12
  137. package/es/Tag/Tag.module.css +18 -17
  138. package/es/TextBox/TextBox.js +5 -5
  139. package/es/TextBox/TextBox.module.css +9 -9
  140. package/es/TextBoxIcon/TextBoxIcon.js +4 -2
  141. package/es/TextBoxIcon/TextBoxIcon.module.css +1 -1
  142. package/es/Textarea/Textarea.js +7 -6
  143. package/es/Textarea/Textarea.module.css +18 -18
  144. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -4
  145. package/es/common/avatarsizes.module.css +16 -16
  146. package/es/common/common.module.css +2 -2
  147. package/es/deprecated/PortalLayer/PortalLayer.js +6 -8
  148. package/es/deprecated/Switch/Switch.js +8 -8
  149. package/es/shared/ArrowIcon/ArrowIcon.js +6 -6
  150. package/es/shared/InputFieldLine/InputFieldLine.js +6 -6
  151. package/es/shared/InputFieldLine/InputFieldLine.module.css +2 -2
  152. package/es/utils/Common.js +0 -0
  153. package/es/utils/dropDownUtils.js +0 -0
  154. package/es/v1/Label/Label.js +98 -33
  155. package/es/v1/Label/__tests__/Label.spec.js +214 -0
  156. package/es/v1/Label/__tests__/__snapshots__/Label.spec.js.snap +457 -0
  157. package/es/v1/Label/constants/index.js +8 -0
  158. package/es/v1/Label/css/Label_v1.module.css +42 -0
  159. package/es/v1/Label/css/cssJSLogic.js +44 -0
  160. package/es/v1/Label/props/defaultProps.js +14 -9
  161. package/es/v1/Label/props/propTypes.js +34 -14
  162. package/es/v1/Switch/Switch.js +7 -6
  163. package/es/v1/Switch/css/Switch_v1.module.css +28 -28
  164. package/lib/Avatar/Avatar.module.css +8 -8
  165. package/lib/AvatarTeam/AvatarTeam.js +0 -0
  166. package/lib/AvatarTeam/AvatarTeam.module.css +30 -30
  167. package/lib/Button/Button.js +0 -0
  168. package/lib/Button/css/Button.module.css +19 -19
  169. package/lib/Buttongroup/Buttongroup.js +0 -0
  170. package/lib/Buttongroup/Buttongroup.module.css +5 -3
  171. package/lib/Card/Card.js +0 -0
  172. package/lib/CheckBox/CheckBox.js +0 -0
  173. package/lib/ColorSelect/_shared/ColorIndicator/ColorIndicator.module.css +2 -2
  174. package/lib/DateTime/CalendarView.js +0 -0
  175. package/lib/DateTime/DateTime.js +0 -0
  176. package/lib/DateTime/DateWidget.js +0 -0
  177. package/lib/DateTime/YearView.js +0 -0
  178. package/lib/DateTime/common.js +0 -0
  179. package/lib/DateTime/index.js +0 -0
  180. package/lib/DateTime/objectUtils.js +0 -0
  181. package/lib/DateTime/typeChecker.js +0 -0
  182. package/lib/DateTime/validator.js +0 -0
  183. package/lib/DropBox/DropBox.js +0 -0
  184. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -3
  185. package/lib/DropDown/DropDown.js +0 -0
  186. package/lib/DropDown/DropDownHeading.js +0 -0
  187. package/lib/DropDown/DropDownHeading.module.css +4 -4
  188. package/lib/DropDown/DropDownItem.js +0 -0
  189. package/lib/DropDown/DropDownItem.module.css +4 -4
  190. package/lib/DropDown/DropDownSearch.js +0 -0
  191. package/lib/DropDown/DropDownSearch.module.css +3 -3
  192. package/lib/DropDown/DropDownSeparator.js +0 -0
  193. package/lib/Label/Label.js +0 -0
  194. package/lib/Label/Label.module.css +5 -5
  195. package/lib/Layout/Box.js +0 -0
  196. package/lib/Layout/Container.js +0 -0
  197. package/lib/Layout/utils.js +0 -0
  198. package/lib/ListItem/ListItem.js +0 -0
  199. package/lib/ListItem/ListItem.module.css +30 -19
  200. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +2 -0
  201. package/lib/MultiSelect/AdvancedMultiSelect.js +2 -0
  202. package/lib/MultiSelect/EmptyState.js +17 -2
  203. package/lib/MultiSelect/MultiSelect.js +2 -0
  204. package/lib/MultiSelect/MultiSelectWithAvatar.js +2 -0
  205. package/lib/MultiSelect/props/propTypes.js +3 -0
  206. package/lib/Popup/Popup.js +0 -0
  207. package/lib/Provider/LibraryContext.js +11 -3
  208. package/lib/Radio/Radio.js +0 -0
  209. package/lib/Radio/Radio.module.css +9 -8
  210. package/lib/Responsive/CustomResponsive.js +0 -0
  211. package/lib/Ribbon/Ribbon.js +0 -0
  212. package/lib/Ribbon/Ribbon.module.css +25 -20
  213. package/lib/Select/GroupSelect.js +2 -0
  214. package/lib/Select/Select.js +2 -0
  215. package/lib/Select/SelectWithAvatar.js +2 -0
  216. package/lib/Select/SelectWithIcon.js +2 -0
  217. package/lib/Select/props/propTypes.js +3 -0
  218. package/lib/Stencils/Stencils.js +0 -0
  219. package/lib/Stencils/Stencils.module.css +11 -11
  220. package/lib/Switch/Switch.js +0 -0
  221. package/lib/Tag/Tag.js +0 -0
  222. package/lib/Tag/Tag.module.css +18 -17
  223. package/lib/TextBox/TextBox.js +0 -0
  224. package/lib/TextBox/TextBox.module.css +9 -9
  225. package/lib/TextBoxIcon/TextBoxIcon.js +0 -0
  226. package/lib/TextBoxIcon/TextBoxIcon.module.css +1 -1
  227. package/lib/Textarea/Textarea.js +0 -0
  228. package/lib/Textarea/Textarea.module.css +18 -18
  229. package/lib/common/avatarsizes.module.css +16 -16
  230. package/lib/common/common.module.css +2 -2
  231. package/lib/deprecated/Switch/Switch.js +0 -0
  232. package/lib/shared/InputFieldLine/InputFieldLine.module.css +2 -2
  233. package/lib/utils/Common.js +0 -0
  234. package/lib/utils/dropDownUtils.js +0 -0
  235. package/lib/v1/Label/Label.js +104 -36
  236. package/lib/v1/Label/__tests__/Label.spec.js +221 -0
  237. package/lib/v1/Label/__tests__/__snapshots__/Label.spec.js.snap +457 -0
  238. package/lib/v1/Label/constants/index.js +16 -0
  239. package/lib/v1/Label/css/Label_v1.module.css +42 -0
  240. package/lib/v1/Label/css/cssJSLogic.js +38 -0
  241. package/lib/v1/Label/props/defaultProps.js +16 -11
  242. package/lib/v1/Label/props/propTypes.js +36 -16
  243. package/lib/v1/Switch/css/Switch_v1.module.css +28 -28
  244. package/package.json +15 -20
  245. package/es/v1/Accordion/Accordion.js +0 -66
  246. package/es/v1/Accordion/AccordionItem.js +0 -57
  247. package/es/v1/Accordion/index.js +0 -2
  248. package/es/v1/Accordion/props/defaultProps.js +0 -12
  249. package/es/v1/Accordion/props/propTypes.js +0 -33
  250. package/es/v1/Animation/Animation.js +0 -45
  251. package/es/v1/Animation/props/defaultProps.js +0 -7
  252. package/es/v1/Animation/props/propTypes.js +0 -12
  253. package/es/v1/Animation/utils.js +0 -83
  254. package/es/v1/AppContainer/AppContainer.js +0 -115
  255. package/es/v1/AppContainer/props/defaultProps.js +0 -10
  256. package/es/v1/AppContainer/props/propTypes.js +0 -17
  257. package/es/v1/Avatar/Avatar.js +0 -139
  258. package/es/v1/Avatar/props/defaultProps.js +0 -17
  259. package/es/v1/Avatar/props/propTypes.js +0 -26
  260. package/es/v1/AvatarTeam/AvatarTeam.js +0 -70
  261. package/es/v1/AvatarTeam/props/defaultProps.js +0 -17
  262. package/es/v1/AvatarTeam/props/propTypes.js +0 -27
  263. package/es/v1/Button/Button.js +0 -67
  264. package/es/v1/Button/props/defaultProps.js +0 -18
  265. package/es/v1/Button/props/propTypes.js +0 -28
  266. package/es/v1/Buttongroup/Buttongroup.js +0 -31
  267. package/es/v1/Buttongroup/props/defaultProps.js +0 -6
  268. package/es/v1/Buttongroup/props/propTypes.js +0 -9
  269. package/es/v1/Card/Card.js +0 -237
  270. package/es/v1/Card/index.js +0 -4
  271. package/es/v1/Card/props/defaultProps.js +0 -25
  272. package/es/v1/Card/props/propTypes.js +0 -48
  273. package/es/v1/CheckBox/CheckBox.js +0 -161
  274. package/es/v1/CheckBox/props/defaultProps.js +0 -18
  275. package/es/v1/CheckBox/props/propTypes.js +0 -41
  276. package/es/v1/DateTime/CalendarView.js +0 -254
  277. package/es/v1/DateTime/DateTime.js +0 -779
  278. package/es/v1/DateTime/DateTimePopupFooter.js +0 -47
  279. package/es/v1/DateTime/DateTimePopupHeader.js +0 -105
  280. package/es/v1/DateTime/DateWidget.js +0 -1134
  281. package/es/v1/DateTime/DaysRow.js +0 -32
  282. package/es/v1/DateTime/Time.js +0 -181
  283. package/es/v1/DateTime/YearView.js +0 -264
  284. package/es/v1/DateTime/index.js +0 -1
  285. package/es/v1/DateTime/props/defaultProps.js +0 -63
  286. package/es/v1/DateTime/props/propTypes.js +0 -206
  287. package/es/v1/DropBox/DropBox.js +0 -79
  288. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +0 -133
  289. package/es/v1/DropBox/DropBoxElement/props/defaultProps.js +0 -18
  290. package/es/v1/DropBox/DropBoxElement/props/propTypes.js +0 -51
  291. package/es/v1/DropBox/props/defaultProps.js +0 -14
  292. package/es/v1/DropBox/props/propTypes.js +0 -16
  293. package/es/v1/DropBox/utils/isMobilePopover.js +0 -17
  294. package/es/v1/DropDown/DropDown.js +0 -53
  295. package/es/v1/DropDown/DropDownHeading.js +0 -36
  296. package/es/v1/DropDown/DropDownItem.js +0 -56
  297. package/es/v1/DropDown/DropDownSearch.js +0 -58
  298. package/es/v1/DropDown/DropDownSeparator.js +0 -12
  299. package/es/v1/DropDown/props/defaultProps.js +0 -21
  300. package/es/v1/DropDown/props/propTypes.js +0 -66
  301. package/es/v1/Heading/Heading.js +0 -35
  302. package/es/v1/Heading/props/defaultProps.js +0 -5
  303. package/es/v1/Heading/props/propTypes.js +0 -12
  304. package/es/v1/Layout/Box.js +0 -115
  305. package/es/v1/Layout/Container.js +0 -132
  306. package/es/v1/Layout/index.js +0 -2
  307. package/es/v1/Layout/props/defaultProps.js +0 -16
  308. package/es/v1/Layout/props/propTypes.js +0 -46
  309. package/es/v1/ListItem/ListContainer.js +0 -104
  310. package/es/v1/ListItem/ListItem.js +0 -123
  311. package/es/v1/ListItem/ListItemWithAvatar.js +0 -143
  312. package/es/v1/ListItem/ListItemWithCheckBox.js +0 -104
  313. package/es/v1/ListItem/ListItemWithIcon.js +0 -126
  314. package/es/v1/ListItem/ListItemWithRadio.js +0 -105
  315. package/es/v1/ListItem/index.js +0 -6
  316. package/es/v1/ListItem/props/defaultProps.js +0 -97
  317. package/es/v1/ListItem/props/propTypes.js +0 -202
  318. package/es/v1/Modal/Modal.js +0 -125
  319. package/es/v1/Modal/props/defaultProps.js +0 -3
  320. package/es/v1/Modal/props/propTypes.js +0 -7
  321. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +0 -1092
  322. package/es/v1/MultiSelect/AdvancedMultiSelect.js +0 -583
  323. package/es/v1/MultiSelect/EmptyState.js +0 -64
  324. package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +0 -50
  325. package/es/v1/MultiSelect/MobileHeader/props/defaultProps.js +0 -7
  326. package/es/v1/MultiSelect/MobileHeader/props/propTypes.js +0 -7
  327. package/es/v1/MultiSelect/MultiSelect.js +0 -1119
  328. package/es/v1/MultiSelect/MultiSelectHeader.js +0 -32
  329. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +0 -208
  330. package/es/v1/MultiSelect/SelectedOptions.js +0 -84
  331. package/es/v1/MultiSelect/Suggestions.js +0 -141
  332. package/es/v1/MultiSelect/index.js +0 -4
  333. package/es/v1/MultiSelect/props/defaultProps.js +0 -165
  334. package/es/v1/MultiSelect/props/propTypes.js +0 -322
  335. package/es/v1/PopOver/PopOver.js +0 -176
  336. package/es/v1/PopOver/props/defaultProps.js +0 -7
  337. package/es/v1/PopOver/props/propTypes.js +0 -53
  338. package/es/v1/Popup/Popup.js +0 -644
  339. package/es/v1/Radio/Radio.js +0 -130
  340. package/es/v1/Radio/props/defaultProps.js +0 -15
  341. package/es/v1/Radio/props/propTypes.js +0 -40
  342. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +0 -56
  343. package/es/v1/ResponsiveDropBox/props/defaultProps.js +0 -4
  344. package/es/v1/ResponsiveDropBox/props/propTypes.js +0 -8
  345. package/es/v1/Ribbon/Ribbon.js +0 -33
  346. package/es/v1/Ribbon/props/defaultProps.js +0 -9
  347. package/es/v1/Ribbon/props/propTypes.js +0 -11
  348. package/es/v1/RippleEffect/RippleEffect.js +0 -25
  349. package/es/v1/RippleEffect/props/defaultProps.js +0 -10
  350. package/es/v1/RippleEffect/props/propTypes.js +0 -12
  351. package/es/v1/Select/GroupSelect.js +0 -818
  352. package/es/v1/Select/Select.js +0 -975
  353. package/es/v1/Select/SelectWithAvatar.js +0 -356
  354. package/es/v1/Select/SelectWithIcon.js +0 -545
  355. package/es/v1/Select/index.js +0 -4
  356. package/es/v1/Select/props/defaultProps.js +0 -126
  357. package/es/v1/Select/props/propTypes.js +0 -297
  358. package/es/v1/Stencils/Stencils.js +0 -26
  359. package/es/v1/Stencils/props/defaultProps.js +0 -6
  360. package/es/v1/Stencils/props/propTypes.js +0 -7
  361. package/es/v1/Tab/Tab.js +0 -106
  362. package/es/v1/Tab/TabContent.js +0 -30
  363. package/es/v1/Tab/TabContentWrapper.js +0 -33
  364. package/es/v1/Tab/TabWrapper.js +0 -55
  365. package/es/v1/Tab/Tabs.js +0 -619
  366. package/es/v1/Tab/index.js +0 -5
  367. package/es/v1/Tab/props/defaultProps.js +0 -51
  368. package/es/v1/Tab/props/propTypes.js +0 -117
  369. package/es/v1/Tab/v1Tab.module.css +0 -100
  370. package/es/v1/Tab/v1TabContent.module.css +0 -4
  371. package/es/v1/Tab/v1Tabs.module.css +0 -167
  372. package/es/v1/Tag/Tag.js +0 -140
  373. package/es/v1/Tag/props/defaultProps.js +0 -15
  374. package/es/v1/Tag/props/propTypes.js +0 -36
  375. package/es/v1/TextBox/TextBox.js +0 -160
  376. package/es/v1/TextBox/props/defaultProps.js +0 -20
  377. package/es/v1/TextBox/props/propTypes.js +0 -56
  378. package/es/v1/TextBoxIcon/TextBoxIcon.js +0 -166
  379. package/es/v1/TextBoxIcon/props/defaultProps.js +0 -24
  380. package/es/v1/TextBoxIcon/props/propTypes.js +0 -53
  381. package/es/v1/Textarea/Textarea.js +0 -100
  382. package/es/v1/Textarea/props/defaultProps.js +0 -17
  383. package/es/v1/Textarea/props/propTypes.js +0 -31
  384. package/es/v1/Tooltip/Tooltip.js +0 -530
  385. package/es/v1/Tooltip/props/defaultProps.js +0 -4
  386. package/es/v1/Tooltip/props/propTypes.js +0 -5
  387. package/es/v1/Typography/Typography.js +0 -38
  388. package/es/v1/Typography/css/cssJSLogic.js +0 -56
  389. package/es/v1/Typography/css/v1_Typography.module.css +0 -380
  390. package/es/v1/Typography/props/defaultProps.js +0 -8
  391. package/es/v1/Typography/props/propTypes.js +0 -27
  392. package/es/v1/Typography/utils/index.js +0 -50
  393. package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -69
  394. package/es/v1/VelocityAnimation/VelocityAnimation/props/defaultProps.js +0 -7
  395. package/es/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -12
  396. package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +0 -99
  397. package/es/v1/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +0 -15
  398. package/es/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -19
  399. package/es/v1/semantic/Button/Button.js +0 -53
  400. package/es/v1/semantic/Button/props/defaultProps.js +0 -12
  401. package/es/v1/semantic/Button/props/propTypes.js +0 -22
  402. package/es/v1/semantic/index.js +0 -1
  403. package/lib/v1/Accordion/Accordion.js +0 -98
  404. package/lib/v1/Accordion/AccordionItem.js +0 -68
  405. package/lib/v1/Accordion/index.js +0 -23
  406. package/lib/v1/Accordion/props/defaultProps.js +0 -20
  407. package/lib/v1/Accordion/props/propTypes.js +0 -45
  408. package/lib/v1/Animation/Animation.js +0 -61
  409. package/lib/v1/Animation/props/defaultProps.js +0 -14
  410. package/lib/v1/Animation/props/propTypes.js +0 -23
  411. package/lib/v1/Animation/utils.js +0 -94
  412. package/lib/v1/AppContainer/AppContainer.js +0 -146
  413. package/lib/v1/AppContainer/props/defaultProps.js +0 -17
  414. package/lib/v1/AppContainer/props/propTypes.js +0 -28
  415. package/lib/v1/Avatar/Avatar.js +0 -191
  416. package/lib/v1/Avatar/props/defaultProps.js +0 -24
  417. package/lib/v1/Avatar/props/propTypes.js +0 -37
  418. package/lib/v1/AvatarTeam/AvatarTeam.js +0 -81
  419. package/lib/v1/AvatarTeam/props/defaultProps.js +0 -24
  420. package/lib/v1/AvatarTeam/props/propTypes.js +0 -38
  421. package/lib/v1/Button/Button.js +0 -82
  422. package/lib/v1/Button/props/defaultProps.js +0 -27
  423. package/lib/v1/Button/props/propTypes.js +0 -40
  424. package/lib/v1/Buttongroup/Buttongroup.js +0 -44
  425. package/lib/v1/Buttongroup/props/defaultProps.js +0 -13
  426. package/lib/v1/Buttongroup/props/propTypes.js +0 -20
  427. package/lib/v1/Card/Card.js +0 -269
  428. package/lib/v1/Card/index.js +0 -37
  429. package/lib/v1/Card/props/defaultProps.js +0 -35
  430. package/lib/v1/Card/props/propTypes.js +0 -62
  431. package/lib/v1/CheckBox/CheckBox.js +0 -172
  432. package/lib/v1/CheckBox/props/defaultProps.js +0 -25
  433. package/lib/v1/CheckBox/props/propTypes.js +0 -52
  434. package/lib/v1/DateTime/CalendarView.js +0 -322
  435. package/lib/v1/DateTime/DateTime.js +0 -877
  436. package/lib/v1/DateTime/DateTimePopupFooter.js +0 -96
  437. package/lib/v1/DateTime/DateTimePopupHeader.js +0 -166
  438. package/lib/v1/DateTime/DateWidget.js +0 -1163
  439. package/lib/v1/DateTime/DaysRow.js +0 -81
  440. package/lib/v1/DateTime/Time.js +0 -270
  441. package/lib/v1/DateTime/YearView.js +0 -325
  442. package/lib/v1/DateTime/index.js +0 -15
  443. package/lib/v1/DateTime/props/defaultProps.js +0 -76
  444. package/lib/v1/DateTime/props/propTypes.js +0 -238
  445. package/lib/v1/DropBox/DropBox.js +0 -109
  446. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +0 -146
  447. package/lib/v1/DropBox/DropBoxElement/props/defaultProps.js +0 -25
  448. package/lib/v1/DropBox/DropBoxElement/props/propTypes.js +0 -62
  449. package/lib/v1/DropBox/props/defaultProps.js +0 -30
  450. package/lib/v1/DropBox/props/propTypes.js +0 -35
  451. package/lib/v1/DropBox/utils/isMobilePopover.js +0 -25
  452. package/lib/v1/DropDown/DropDown.js +0 -74
  453. package/lib/v1/DropDown/DropDownHeading.js +0 -47
  454. package/lib/v1/DropDown/DropDownItem.js +0 -75
  455. package/lib/v1/DropDown/DropDownSearch.js +0 -77
  456. package/lib/v1/DropDown/DropDownSeparator.js +0 -24
  457. package/lib/v1/DropDown/props/defaultProps.js +0 -31
  458. package/lib/v1/DropDown/props/propTypes.js +0 -87
  459. package/lib/v1/Heading/Heading.js +0 -53
  460. package/lib/v1/Heading/props/defaultProps.js +0 -12
  461. package/lib/v1/Heading/props/propTypes.js +0 -23
  462. package/lib/v1/Layout/Box.js +0 -128
  463. package/lib/v1/Layout/Container.js +0 -145
  464. package/lib/v1/Layout/index.js +0 -23
  465. package/lib/v1/Layout/props/defaultProps.js +0 -24
  466. package/lib/v1/Layout/props/propTypes.js +0 -58
  467. package/lib/v1/ListItem/ListContainer.js +0 -128
  468. package/lib/v1/ListItem/ListItem.js +0 -138
  469. package/lib/v1/ListItem/ListItemWithAvatar.js +0 -167
  470. package/lib/v1/ListItem/ListItemWithCheckBox.js +0 -126
  471. package/lib/v1/ListItem/ListItemWithIcon.js +0 -143
  472. package/lib/v1/ListItem/ListItemWithRadio.js +0 -127
  473. package/lib/v1/ListItem/index.js +0 -55
  474. package/lib/v1/ListItem/props/defaultProps.js +0 -109
  475. package/lib/v1/ListItem/props/propTypes.js +0 -196
  476. package/lib/v1/Modal/Modal.js +0 -166
  477. package/lib/v1/Modal/props/defaultProps.js +0 -10
  478. package/lib/v1/Modal/props/propTypes.js +0 -18
  479. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +0 -1180
  480. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +0 -649
  481. package/lib/v1/MultiSelect/EmptyState.js +0 -112
  482. package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +0 -62
  483. package/lib/v1/MultiSelect/MobileHeader/props/defaultProps.js +0 -14
  484. package/lib/v1/MultiSelect/MobileHeader/props/propTypes.js +0 -18
  485. package/lib/v1/MultiSelect/MultiSelect.js +0 -1202
  486. package/lib/v1/MultiSelect/MultiSelectHeader.js +0 -78
  487. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +0 -262
  488. package/lib/v1/MultiSelect/SelectedOptions.js +0 -130
  489. package/lib/v1/MultiSelect/Suggestions.js +0 -196
  490. package/lib/v1/MultiSelect/index.js +0 -39
  491. package/lib/v1/MultiSelect/props/defaultProps.js +0 -181
  492. package/lib/v1/MultiSelect/props/propTypes.js +0 -350
  493. package/lib/v1/PopOver/PopOver.js +0 -197
  494. package/lib/v1/PopOver/props/defaultProps.js +0 -15
  495. package/lib/v1/PopOver/props/propTypes.js +0 -66
  496. package/lib/v1/Popup/Popup.js +0 -715
  497. package/lib/v1/Radio/Radio.js +0 -141
  498. package/lib/v1/Radio/props/defaultProps.js +0 -22
  499. package/lib/v1/Radio/props/propTypes.js +0 -51
  500. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +0 -79
  501. package/lib/v1/ResponsiveDropBox/props/defaultProps.js +0 -11
  502. package/lib/v1/ResponsiveDropBox/props/propTypes.js +0 -27
  503. package/lib/v1/Ribbon/Ribbon.js +0 -44
  504. package/lib/v1/Ribbon/props/defaultProps.js +0 -16
  505. package/lib/v1/Ribbon/props/propTypes.js +0 -22
  506. package/lib/v1/RippleEffect/RippleEffect.js +0 -40
  507. package/lib/v1/RippleEffect/props/defaultProps.js +0 -17
  508. package/lib/v1/RippleEffect/props/propTypes.js +0 -23
  509. package/lib/v1/Select/GroupSelect.js +0 -894
  510. package/lib/v1/Select/Select.js +0 -1025
  511. package/lib/v1/Select/SelectWithAvatar.js +0 -406
  512. package/lib/v1/Select/SelectWithIcon.js +0 -607
  513. package/lib/v1/Select/index.js +0 -39
  514. package/lib/v1/Select/props/defaultProps.js +0 -125
  515. package/lib/v1/Select/props/propTypes.js +0 -319
  516. package/lib/v1/Stencils/Stencils.js +0 -43
  517. package/lib/v1/Stencils/props/defaultProps.js +0 -13
  518. package/lib/v1/Stencils/props/propTypes.js +0 -18
  519. package/lib/v1/Tab/Tab.js +0 -132
  520. package/lib/v1/Tab/TabContent.js +0 -42
  521. package/lib/v1/Tab/TabContentWrapper.js +0 -47
  522. package/lib/v1/Tab/TabWrapper.js +0 -89
  523. package/lib/v1/Tab/Tabs.js +0 -688
  524. package/lib/v1/Tab/index.js +0 -47
  525. package/lib/v1/Tab/props/defaultProps.js +0 -62
  526. package/lib/v1/Tab/props/propTypes.js +0 -132
  527. package/lib/v1/Tab/v1Tab.module.css +0 -100
  528. package/lib/v1/Tab/v1TabContent.module.css +0 -4
  529. package/lib/v1/Tab/v1Tabs.module.css +0 -167
  530. package/lib/v1/Tag/Tag.js +0 -160
  531. package/lib/v1/Tag/props/defaultProps.js +0 -22
  532. package/lib/v1/Tag/props/propTypes.js +0 -47
  533. package/lib/v1/TextBox/TextBox.js +0 -175
  534. package/lib/v1/TextBox/props/defaultProps.js +0 -27
  535. package/lib/v1/TextBox/props/propTypes.js +0 -62
  536. package/lib/v1/TextBoxIcon/TextBoxIcon.js +0 -206
  537. package/lib/v1/TextBoxIcon/props/defaultProps.js +0 -31
  538. package/lib/v1/TextBoxIcon/props/propTypes.js +0 -72
  539. package/lib/v1/Textarea/Textarea.js +0 -118
  540. package/lib/v1/Textarea/props/defaultProps.js +0 -24
  541. package/lib/v1/Textarea/props/propTypes.js +0 -42
  542. package/lib/v1/Tooltip/Tooltip.js +0 -599
  543. package/lib/v1/Tooltip/props/defaultProps.js +0 -11
  544. package/lib/v1/Tooltip/props/propTypes.js +0 -16
  545. package/lib/v1/Typography/Typography.js +0 -56
  546. package/lib/v1/Typography/css/cssJSLogic.js +0 -48
  547. package/lib/v1/Typography/css/v1_Typography.module.css +0 -380
  548. package/lib/v1/Typography/props/defaultProps.js +0 -15
  549. package/lib/v1/Typography/props/propTypes.js +0 -38
  550. package/lib/v1/Typography/utils/index.js +0 -59
  551. package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -90
  552. package/lib/v1/VelocityAnimation/VelocityAnimation/props/defaultProps.js +0 -14
  553. package/lib/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -23
  554. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +0 -126
  555. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +0 -22
  556. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -30
  557. package/lib/v1/semantic/Button/Button.js +0 -63
  558. package/lib/v1/semantic/Button/props/defaultProps.js +0 -19
  559. package/lib/v1/semantic/Button/props/propTypes.js +0 -33
  560. package/lib/v1/semantic/index.js +0 -15
@@ -1,1134 +0,0 @@
1
- /**** Libraries ****/
2
- import React from 'react';
3
- import { DateWidget_propTypes } from "./props/propTypes";
4
- import { DateWidget_defaultProps } from "./props/defaultProps";
5
- /**** Components ****/
6
-
7
- import DateTime from "./DateTime";
8
- import Popup from "../Popup/Popup";
9
- import { Icon } from '@zohodesk/icons';
10
- import { Container } from "../Layout";
11
- import TextBoxIcon from "../TextBoxIcon/TextBoxIcon";
12
- /**** CSS ****/
13
-
14
- import style from "../../DateTime/DateWidget.module.css";
15
- /**** Methods ****/
16
-
17
- import validator from "../../DateTime/validator";
18
- import { formatDate } from "../../utils/datetime/common";
19
- import { getIsSupportedKey, arrayIsNotEqual } from "../../DateTime/dateFormatUtils";
20
- import { getDateFormatDetails, getDateFormatSelection, getDateTimeString, getDateDetails, getIsValidDate, getSelectedDate, getDateText } from "../../DateTime/dateFormatUtils/dateFormat";
21
- import { getChangedDay } from "../../DateTime/dateFormatUtils/dayChange";
22
- import { getChangedMonth } from "../../DateTime/dateFormatUtils/monthChange";
23
- import { getChangedYear } from "../../DateTime/dateFormatUtils/yearChange";
24
- import { getChangedHour, getChangedMinute, getChangedNoon } from "../../DateTime/dateFormatUtils/timeChange";
25
- import { getIsEmptyValue } from "../../utils/Common";
26
- /** * Constants ** */
27
-
28
- import { INVALID_DATE, i18nShortMonths, i18nMonths } from "../../DateTime/constants";
29
- /* eslint-disable react/no-unused-prop-types */
30
-
31
- /* eslint css-modules/no-unused-class: [0, { markAsUsed: 'inputLine'] }] */
32
-
33
- class DateWidgetComponent extends React.Component {
34
- constructor(props) {
35
- super(props);
36
- this.handleSelect = this.handleSelect.bind(this);
37
- this.handleTogglePopup = this.handleTogglePopup.bind(this);
38
- this.handleGetDisplayText = this.handleGetDisplayText.bind(this);
39
- this.handleKeyDown = this.handleKeyDown.bind(this);
40
- this.handleFocus = this.handleFocus.bind(this);
41
- this.getValueInputRef = this.getValueInputRef.bind(this);
42
- this.handleGetMethods = this.handleGetMethods.bind(this);
43
- this.handleInputClick = this.handleInputClick.bind(this);
44
- this.handleGetShowValue = this.handleGetShowValue.bind(this);
45
- this.handleSelection = this.handleSelection.bind(this);
46
- this.handleDateType = this.handleDateType.bind(this);
47
- this.handleBlur = this.handleBlur.bind(this);
48
- this.handleGetAllowedType = this.handleGetAllowedType.bind(this);
49
- this.handleDateClear = this.handleDateClear.bind(this);
50
- this.handleDateTimeClear = this.handleDateTimeClear.bind(this);
51
- this.handleMouseDown = this.handleMouseDown.bind(this);
52
- this.handleDateIconClick = this.handleDateIconClick.bind(this);
53
- this.handleSelectionRangeDetails = this.handleSelectionRangeDetails.bind(this);
54
- this.handleBlurSelectionRange = this.handleBlurSelectionRange.bind(this);
55
- this.state = {
56
- selected: '',
57
- displayText: '',
58
- dateFormatDetails: {},
59
- dateFormatSelection: {},
60
- day: '',
61
- month: '',
62
- year: '',
63
- hour: '',
64
- minute: '',
65
- noon: '',
66
- isDateEdited: false,
67
- stateFocusOrder: '',
68
- isError: false,
69
- isFocused: false
70
- };
71
- this.oldFocusOrder = '';
72
- this.focusOrder = '';
73
- this.oldKeyDownAction = ''; //'Arrow' || 'valueTyped'
74
-
75
- this.keyDownAction = ''; //'Arrow' || 'valueTyped'
76
-
77
- this.isMouseDown = false;
78
- }
79
-
80
- componentDidMount() {
81
- const {
82
- validation,
83
- getPopupProps,
84
- isPopupReady
85
- } = this.props;
86
- const {
87
- selected
88
- } = this.state;
89
-
90
- if (validation && validation.validate) {
91
- this.validateOnSelect(selected, this.props);
92
- }
93
-
94
- const {
95
- displayText,
96
- selected: newSelected
97
- } = this.handleGetDisplayText(this.props);
98
- this.setState({
99
- displayText,
100
- selected: newSelected
101
- });
102
- this.handleSelectionRangeDetails(this.props);
103
-
104
- if (getPopupProps) {
105
- getPopupProps({
106
- isPopupReady
107
- });
108
- }
109
- }
110
-
111
- componentDidUpdate(prevProps, prevState) {
112
- const {
113
- selected,
114
- day,
115
- month,
116
- year,
117
- hour,
118
- minute,
119
- noon,
120
- isDateEdited,
121
- stateFocusOrder,
122
- isFocused
123
- } = this.state;
124
- const {
125
- value,
126
- validation,
127
- isPopupReady,
128
- dateFormat = '',
129
- is24Hour,
130
- isHideCurrentYear,
131
- getPopupProps
132
- } = this.props;
133
-
134
- if (validation && validation.validate) {
135
- this.validateOnSelect(selected, this.props);
136
- }
137
-
138
- if (value !== prevProps.value || dateFormat !== prevProps.dateFormat || is24Hour !== prevProps.is24Hour || isHideCurrentYear !== prevProps.isHideCurrentYear) {
139
- const {
140
- displayText,
141
- selected
142
- } = this.handleGetDisplayText(this.props);
143
- this.setState({
144
- selected,
145
- displayText
146
- });
147
-
148
- if (value !== INVALID_DATE) {
149
- this.setState({
150
- day: '',
151
- month: '',
152
- year: '',
153
- hour: '',
154
- minute: '',
155
- noon: '',
156
- isDateEdited: false,
157
- isError: false
158
- });
159
- }
160
- }
161
-
162
- if (prevProps.isPopupReady !== isPopupReady) {
163
- if (isPopupReady) {
164
- this.resetLocalDate && this.resetLocalDate();
165
- }
166
-
167
- if (getPopupProps) {
168
- getPopupProps({
169
- isPopupReady
170
- });
171
- }
172
- }
173
-
174
- const haveLocalValue = [day, month, year, hour, minute, noon].some(value => !getIsEmptyValue(value));
175
-
176
- if (isDateEdited !== haveLocalValue) {
177
- this.setState({
178
- isDateEdited: haveLocalValue
179
- });
180
- }
181
-
182
- if (value !== prevProps.value || dateFormat !== prevProps.dateFormat || is24Hour !== prevProps.is24Hour || arrayIsNotEqual([day, month, year, hour, minute, noon], [prevState.day, prevState.month, prevState.year, prevState.hour, prevState.minute, prevState.noon])) {
183
- this.handleSelectionRangeDetails(this.props);
184
- } // if (stateFocusOrder !== prevState.stateFocusOrder) {
185
-
186
-
187
- isFocused && !getIsEmptyValue(stateFocusOrder) && this.handleSelection(stateFocusOrder);
188
- this.handleBlurSelectionRange(stateFocusOrder, prevState.stateFocusOrder); // }
189
- // if (prevProps.isPopupOpen !== isPopupOpen) {
190
- // if (!isPopupOpen) {
191
- // this.valueInput && this.valueInput.focus({preventScroll:true});
192
- // }
193
- // }
194
- }
195
-
196
- handleSelect(userZoneSelectedTime, fotmattedValue, e) {
197
- const {
198
- id,
199
- onSelect,
200
- closePopupOnly,
201
- validation
202
- } = this.props;
203
-
204
- if (validation && validation.validateOn) {
205
- const {
206
- selected
207
- } = this.state;
208
- this.validateOnSelect(selected, this.props);
209
- }
210
-
211
- onSelect && onSelect(userZoneSelectedTime, id);
212
- this.valueInput && this.valueInput.focus({
213
- preventScroll: true
214
- });
215
- closePopupOnly(e);
216
- }
217
-
218
- validateOnSelect(value, props) {
219
- const defaultCheckPropsRules = ['required'];
220
- const defaultValidateRules = ['required'];
221
- const defaultType = 'onegroup';
222
- const {
223
- validation,
224
- onPassValidation,
225
- onFailValidation
226
- } = props;
227
- const targetTag = this.elementRef;
228
-
229
- if (validation) {
230
- //validateOn won't work here ...
231
- const newValidation = validator.combinePropsValidation(this.props, defaultType, 'onSelect', validation, defaultCheckPropsRules, defaultValidateRules);
232
- const validationObj = {
233
- validation: newValidation,
234
- onPassValidation,
235
- onFailValidation
236
- };
237
- validator.executeValidation(value, targetTag, validationObj, defaultType);
238
- } else {
239
- onPassValidation && onPassValidation(value, targetTag);
240
- }
241
- }
242
-
243
- handleTogglePopup(e, isOpenOnly) {
244
- const {
245
- togglePopup,
246
- defaultPosition = 'bottom',
247
- isPopupOpen,
248
- removeClose
249
- } = this.props;
250
-
251
- if (isOpenOnly) {
252
- if (!isPopupOpen) {
253
- togglePopup(e, `${defaultPosition}Right`);
254
- } else {
255
- removeClose(e);
256
- }
257
- }
258
-
259
- !isOpenOnly && togglePopup(e, `${defaultPosition}Right`);
260
- }
261
-
262
- handleSelectionRangeDetails(props) {
263
- const {
264
- timeZone,
265
- dateFormat,
266
- isDateTime,
267
- value,
268
- is24Hour
269
- } = props;
270
- const {
271
- day,
272
- month,
273
- year,
274
- hour,
275
- minute,
276
- noon
277
- } = this.state;
278
- const selected = value === INVALID_DATE ? '' : value; //New UI Changes
279
-
280
- const dateFormatDetails = getDateFormatDetails(dateFormat, {
281
- isHideCurrentYear: false,
282
- value,
283
- timeZone,
284
- isDateTime
285
- });
286
- const dateFormatSelection = getDateFormatSelection(dateFormatDetails, isDateTime, {
287
- i18nShortMonths,
288
- i18nMonths,
289
- selectedValue: selected,
290
- day,
291
- month,
292
- year,
293
- hour,
294
- minute,
295
- noon,
296
- timeZone,
297
- is24Hour
298
- });
299
- const {
300
- dateFormat: newDateFormat
301
- } = dateFormatDetails;
302
- this.setState({
303
- dateFormatDetails,
304
- dateFormatSelection,
305
- newDateFormat
306
- });
307
- }
308
-
309
- handleGetDisplayText(props) {
310
- const {
311
- timeZone,
312
- dateFormat,
313
- isDateTime,
314
- value,
315
- is24Hour,
316
- isHideCurrentYear
317
- } = props;
318
- const dateFormatDetails = getDateFormatDetails(dateFormat, {
319
- isHideCurrentYear,
320
- value,
321
- timeZone,
322
- isDateTime
323
- });
324
- const {
325
- dateFormat: newDateFormat
326
- } = dateFormatDetails;
327
- let displayText = '';
328
- const selected = value === INVALID_DATE ? '' : value;
329
-
330
- if (selected) {
331
- let format = newDateFormat,
332
- convertedValue = getDateText(value, isDateTime, timeZone);
333
-
334
- if (isDateTime) {
335
- format = `${newDateFormat} ${is24Hour ? 'HH:mm' : 'hh:mm A'}`;
336
- }
337
-
338
- displayText = formatDate(convertedValue, format);
339
- }
340
-
341
- return {
342
- displayText,
343
- selected
344
- };
345
- }
346
-
347
- handleKeyDown(e) {
348
- const {
349
- keyCode
350
- } = e;
351
- const {
352
- isPopupOpen,
353
- isPopupOpenOnEnter,
354
- onKeyDown,
355
- closePopupOnly,
356
- cantEditOnPopupOpen
357
- } = this.props;
358
- const isAllowedDateType = this.handleGetAllowedType();
359
-
360
- if (isPopupOpen) {
361
- if (keyCode === 9 && !isAllowedDateType) {
362
- //on tab click popup close
363
- closePopupOnly(e);
364
- } // ~~~~~~~ handle date navigation in dateTime popup ~~~~~
365
-
366
-
367
- if (isAllowedDateType) {
368
- cantEditOnPopupOpen && this.handleDateType(e);
369
- }
370
- } else if (!isPopupOpen) {
371
- if (isPopupOpenOnEnter && keyCode === 13) {
372
- //onEnter popup open
373
- this.handleTogglePopup(e);
374
- } else if (keyCode === 13) {
375
- //onEnter submit case
376
- onKeyDown && onKeyDown(e);
377
- } else if (isAllowedDateType) {
378
- this.handleDateType(e);
379
- }
380
- }
381
- }
382
-
383
- getValueInputRef(el) {
384
- const {
385
- getRef
386
- } = this.props;
387
- this.valueInput = el;
388
- getRef && getRef(el);
389
- }
390
-
391
- handleFocus() {
392
- const isAllowedDateType = this.handleGetAllowedType();
393
- const {
394
- isMouseDown
395
- } = this;
396
-
397
- if (isAllowedDateType && !isMouseDown) {
398
- const {
399
- dateFormatSelection
400
- } = this.state;
401
- const {
402
- focusedIndex
403
- } = dateFormatSelection;
404
- const {
405
- selectionStart: newSelectionStart,
406
- selectionEnd: newSelectionEnd
407
- } = this.valueInput;
408
- const focusedOrder = focusedIndex[`${newSelectionStart}_${newSelectionEnd}`] || 0;
409
- isAllowedDateType && this.setState({
410
- stateFocusOrder: focusedOrder,
411
- isFocused: true
412
- });
413
- } else if (!isAllowedDateType) {
414
- const {
415
- valueInput
416
- } = this;
417
- document.getSelection().removeAllRanges();
418
- valueInput && valueInput.setSelectionRange(0, 0);
419
- this.setState({
420
- isFocused: true
421
- });
422
- }
423
-
424
- const {
425
- onFocus
426
- } = this.props;
427
- onFocus && onFocus();
428
- }
429
-
430
- handleBlur() {
431
- this.focusOrder = '';
432
- this.oldFocusOrder = '';
433
- this.oldKeyDownAction = '';
434
- this.keyDownAction = '';
435
- this.setState({
436
- isFocused: false
437
- }); // const { valueInput } = this;
438
- // document.getSelection().removeAllRanges();
439
- // valueInput && valueInput.setSelectionRange(0, 0);
440
-
441
- const {
442
- onBlur
443
- } = this.props;
444
- onBlur && onBlur();
445
- }
446
-
447
- handleGetMethods(methods) {
448
- const {
449
- getMethods
450
- } = this.props;
451
- const {
452
- resetLocalDate,
453
- getStateValues,
454
- toggleYearView
455
- } = methods;
456
- this.resetLocalDate = resetLocalDate;
457
- this.getDateTimeStateValues = getStateValues;
458
- this.DateTimeYearViewToggle = toggleYearView;
459
- getMethods && getMethods(methods);
460
- }
461
-
462
- handleDateType(e) {
463
- const {
464
- keyCode,
465
- shiftKey
466
- } = e;
467
- const input = e.target;
468
-
469
- if (getIsSupportedKey(e)) {
470
- e.preventDefault();
471
- }
472
-
473
- const {
474
- isDateTime,
475
- timeZone,
476
- value,
477
- onSelect,
478
- id,
479
- min,
480
- max,
481
- minErrorText,
482
- maxErrorText,
483
- onError,
484
- closePopupOnly,
485
- is24Hour
486
- } = this.props;
487
- const {
488
- dateFormatSelection,
489
- day,
490
- month,
491
- year,
492
- hour,
493
- minute,
494
- noon,
495
- selected,
496
- dateFormatDetails
497
- } = this.state;
498
- const {
499
- focusedIndex,
500
- order
501
- } = dateFormatSelection;
502
- const {
503
- yearInfo
504
- } = dateFormatDetails;
505
- const {
506
- day: selectedDay = '',
507
- month: selectedMonth = '',
508
- year: selectedYear = '',
509
- hour: selectedHour = '',
510
- minute: selectedMinute = '',
511
- noon: selectedNoon = ''
512
- } = getDateDetails(selected, {
513
- day,
514
- month,
515
- year,
516
- hour,
517
- minute,
518
- noon
519
- }, isDateTime, timeZone, {
520
- is24Hour
521
- });
522
- const {
523
- selectionStart: newSelectionStart,
524
- selectionEnd: newSelectionEnd
525
- } = input;
526
- const focusedOrder = focusedIndex[`${newSelectionStart}_${newSelectionEnd}`];
527
- const {
528
- type
529
- } = order[focusedOrder] || {};
530
- this.oldFocusOrder = this.focusOrder;
531
- this.focusOrder = focusedOrder;
532
-
533
- if (keyCode === 38 || keyCode === 40) {
534
- //up arrow && down arrow
535
- this.oldKeyDownAction = this.keyDownAction;
536
- this.keyDownAction = 'Arrow';
537
- } else {
538
- this.oldKeyDownAction = this.keyDownAction;
539
- this.keyDownAction = 'valueTyped';
540
- }
541
-
542
- const focusedOrders = {
543
- focusOrder: this.focusOrder,
544
- oldFocusOrder: this.oldFocusOrder
545
- };
546
- const keyActions = {
547
- oldKeyAction: this.oldKeyDownAction,
548
- keyAction: this.keyDownAction
549
- };
550
- let newDay = selectedDay,
551
- newMonth = selectedMonth,
552
- newYear = selectedYear,
553
- newHour = selectedHour,
554
- newMinute = selectedMinute,
555
- newNoon = selectedNoon,
556
- isValueChanged = false,
557
- newFocusOrder = focusedOrder;
558
-
559
- if (keyCode === 9 && shiftKey && !getIsEmptyValue(focusedOrder) && focusedOrder !== 0) {
560
- e.preventDefault();
561
- this.setState({
562
- stateFocusOrder: focusedOrder - 1
563
- });
564
- } else if (keyCode === 9 && !shiftKey && !getIsEmptyValue(focusedOrder) && order.length - 1 !== focusedOrder) {
565
- e.preventDefault();
566
- this.setState({
567
- stateFocusOrder: focusedOrder + 1
568
- });
569
- } else if (keyCode === 39) {
570
- //arrow right
571
- getIsEmptyValue(focusedOrder) ? this.setState({
572
- stateFocusOrder: 0
573
- }) : this.setState({
574
- stateFocusOrder: focusedOrder + 1
575
- });
576
- } else if (keyCode === 37) {
577
- //arrow left
578
- getIsEmptyValue(focusedOrder) ? this.setState({
579
- stateFocusOrder: order.length - 1
580
- }) : this.setState({
581
- stateFocusOrder: focusedOrder - 1
582
- });
583
- } else if (keyCode === 9) {
584
- //on tab click popup close
585
- closePopupOnly(e);
586
- } else if (type === 'day') {
587
- ({
588
- day: newDay,
589
- isChanged: isValueChanged,
590
- focusOrder: newFocusOrder
591
- } = getChangedDay({
592
- day: selectedDay,
593
- month: selectedMonth,
594
- year: selectedYear
595
- }, e, focusedOrders, keyActions));
596
- } else if (type === 'month') {
597
- ({
598
- /*day: newDay,*/
599
- month: newMonth,
600
- isChanged: isValueChanged,
601
- focusOrder: newFocusOrder
602
- } = getChangedMonth({
603
- day: selectedDay,
604
- month: selectedMonth,
605
- year: selectedYear
606
- }, e, focusedOrders, keyActions));
607
- } else if (type === 'year') {
608
- ({
609
- /*day: newDay,*/
610
- year: newYear,
611
- isChanged: isValueChanged,
612
- focusOrder: newFocusOrder
613
- } = getChangedYear({
614
- day: selectedDay,
615
- month: selectedMonth,
616
- year: selectedYear
617
- }, e, focusedOrders, keyActions, {
618
- yearInfo
619
- }));
620
- } else if (type === 'hour') {
621
- ({
622
- hour: newHour,
623
- isChanged: isValueChanged,
624
- focusOrder: newFocusOrder
625
- } = getChangedHour({
626
- hour: selectedHour
627
- }, e, focusedOrders, keyActions, {
628
- is24Hour
629
- }));
630
- } else if (type === 'minute') {
631
- ({
632
- minute: newMinute,
633
- isChanged: isValueChanged,
634
- focusOrder: newFocusOrder
635
- } = getChangedMinute({
636
- minute: selectedMinute
637
- }, e, focusedOrders, keyActions));
638
- } else if (type === 'noon') {
639
- ({
640
- noon: newNoon,
641
- isChanged: isValueChanged,
642
- focusOrder: newFocusOrder
643
- } = getChangedNoon({
644
- noon: selectedNoon
645
- }, e, focusedOrders, keyActions));
646
- }
647
-
648
- if (isValueChanged) {
649
- const currentValue = {
650
- day: newDay,
651
- month: newMonth,
652
- year: newYear,
653
- hour: newHour,
654
- minute: newMinute,
655
- noon: newNoon
656
- };
657
-
658
- const errorCaseHandle = isEmptyValError => {
659
- this.setState(() => ({
660
- day: newDay,
661
- month: newMonth,
662
- year: newYear,
663
- hour: newHour,
664
- minute: newMinute,
665
- noon: newNoon,
666
- stateFocusOrder: newFocusOrder,
667
- isDateEdited: true,
668
- isError: !isEmptyValError
669
- }));
670
- const newSelected = isEmptyValError ? '' : INVALID_DATE;
671
- value !== newSelected && onSelect && onSelect(newSelected, id);
672
- };
673
-
674
- const {
675
- isError,
676
- isEmptyValError
677
- } = getIsValidDate(currentValue, isDateTime, {
678
- is24Hour
679
- });
680
-
681
- if (isError) {
682
- errorCaseHandle(isEmptyValError);
683
- } else {
684
- const {
685
- selectedValue,
686
- isError: selectedDateError,
687
- errorType
688
- } = getSelectedDate(currentValue, {
689
- min,
690
- max,
691
- timeZone,
692
- isDateTime,
693
- is24Hour
694
- });
695
-
696
- if (selectedDateError) {
697
- if (errorType === 'MIN') {
698
- onError && onError(minErrorText, true);
699
- } else if (errorType === 'MAX') {
700
- onError && onError(maxErrorText, true);
701
- }
702
-
703
- errorCaseHandle();
704
- } else {
705
- this.setState(() => ({
706
- day: '',
707
- month: '',
708
- year: '',
709
- hour: '',
710
- minute: '',
711
- noon: '',
712
- isDateEdited: false,
713
- stateFocusOrder: newFocusOrder,
714
- isError: false
715
- }));
716
- onSelect && onSelect(selectedValue, id);
717
- }
718
- }
719
- }
720
- }
721
-
722
- handleSelection() {
723
- let focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
724
- const isAllowedDateType = this.handleGetAllowedType();
725
-
726
- if (isAllowedDateType) {
727
- const {
728
- dateFormatSelection
729
- } = this.state;
730
- const {
731
- order = {}
732
- } = dateFormatSelection;
733
- let {
734
- index
735
- } = order[focusOrder] || {};
736
-
737
- if (!index) {
738
- focusOrder = 0;
739
- ({
740
- index
741
- } = order[focusOrder] || {});
742
- }
743
-
744
- if (index && this.valueInput) {
745
- document.getSelection().removeAllRanges();
746
- this.valueInput.setSelectionRange(index[0], index[1]);
747
- }
748
- }
749
- }
750
-
751
- handleInputClick(e) {
752
- this.isMouseDown = false;
753
- const {
754
- dateFormatSelection
755
- } = this.state;
756
- const input = e.target;
757
- const {
758
- selectionEnd
759
- } = input;
760
- e.preventDefault();
761
- const {
762
- clickIndex
763
- } = dateFormatSelection;
764
- const focusOrder = clickIndex[selectionEnd] || clickIndex[selectionEnd - 1] || 0;
765
- const isAllowedDateType = this.handleGetAllowedType();
766
-
767
- if (isAllowedDateType) {
768
- this.setState({
769
- stateFocusOrder: focusOrder,
770
- isFocused: true
771
- });
772
- }
773
-
774
- if (!isAllowedDateType) {
775
- this.handleTogglePopup(e);
776
- } else {
777
- const {
778
- isPopupOpenOnClick,
779
- isReadOnly,
780
- isDisabled
781
- } = this.props;
782
-
783
- if (isPopupOpenOnClick && (!isReadOnly || !isDisabled)) {
784
- this.handleTogglePopup(e, true);
785
- }
786
-
787
- const {
788
- isPopupCloseOnClick,
789
- isPopupOpen,
790
- closePopupOnly
791
- } = this.props;
792
-
793
- if (isPopupCloseOnClick && !isPopupOpen) {
794
- closePopupOnly && closePopupOnly(e);
795
- }
796
- }
797
- }
798
-
799
- handleMouseDown() {
800
- this.isMouseDown = true;
801
- }
802
-
803
- handleGetShowValue() {
804
- const {
805
- day,
806
- month,
807
- year,
808
- hour,
809
- minute,
810
- noon,
811
- dateFormatDetails,
812
- displayText,
813
- newDateFormat,
814
- isDateEdited,
815
- isFocused,
816
- selected
817
- } = this.state;
818
- const {
819
- isDateTime,
820
- is24Hour,
821
- isPopupReady,
822
- timeZone,
823
- isPopupOpen
824
- } = this.props;
825
-
826
- if (isDateEdited || isFocused || isPopupReady || isPopupOpen) {
827
- const {
828
- day: selectedDay = '',
829
- month: selectedMonth = '',
830
- year: selectedYear = '',
831
- hour: selectedHour = '',
832
- minute: selectedMinute = '',
833
- noon: selectedNoon = ''
834
- } = getDateDetails(selected, {
835
- day,
836
- month,
837
- year,
838
- hour,
839
- minute,
840
- noon
841
- }, isDateTime, timeZone, {
842
- is24Hour
843
- });
844
- const dateTimeString = getDateTimeString({
845
- day: selectedDay,
846
- month: selectedMonth,
847
- year: selectedYear,
848
- hour: selectedHour,
849
- minute: selectedMinute,
850
- noon: selectedNoon
851
- }, dateFormatDetails, isDateTime, {
852
- i18nShortMonths,
853
- i18nMonths,
854
- is24Hour
855
- });
856
- return dateTimeString;
857
- } else if (displayText) {
858
- return displayText;
859
- }
860
-
861
- const timeFormat = is24Hour ? ' HH:mm' : ' hh:mm --';
862
- const dateTimeFormat = isDateTime ? `${newDateFormat}${timeFormat}` : newDateFormat;
863
- return dateTimeFormat || '';
864
- }
865
-
866
- handleGetAllowedType() {
867
- const {
868
- isReadOnly,
869
- isDisabled,
870
- isEditable
871
- } = this.props;
872
-
873
- if (isEditable) {
874
- if (isReadOnly || isDisabled) {
875
- return false;
876
- }
877
-
878
- return true;
879
- }
880
-
881
- return false;
882
- }
883
-
884
- handleDateClear() {
885
- const {
886
- id,
887
- onSelect,
888
- value
889
- } = this.props;
890
- this.setState({
891
- day: '',
892
- month: '',
893
- year: '',
894
- hour: '',
895
- minute: '',
896
- noon: '',
897
- isDateEdited: false,
898
- stateFocusOrder: 0,
899
- isError: false
900
- });
901
- value && onSelect && onSelect('', id); // this.valueInput && this.valueInput.focus({ preventScroll: true });
902
- }
903
-
904
- handleDateTimeClear(e) {
905
- this.handleDateClear();
906
- const {
907
- closePopupOnly
908
- } = this.props;
909
- closePopupOnly(e);
910
- }
911
-
912
- handleDateIconClick(e) {
913
- this.handleTogglePopup(e);
914
- this.valueInput && this.valueInput.focus({
915
- preventScroll: true
916
- });
917
- }
918
-
919
- handleBlurSelectionRange() {
920
- let focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
921
- let oldFocusOrder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
922
- const isAllowedDateType = this.handleGetAllowedType();
923
-
924
- if (isAllowedDateType) {
925
- // if (focusOrder !== oldFocusOrder) {
926
- const {
927
- dateFormatSelection = {},
928
- isFocused
929
- } = this.state;
930
- const {
931
- order = []
932
- } = dateFormatSelection;
933
- const {
934
- isPopupOpen
935
- } = this.props; // const { type: oldFocusedType = '' } = order[oldFocusOrder] || {};
936
-
937
- const {
938
- type: focusedType = ''
939
- } = order[focusOrder] || {};
940
- const {
941
- /*isActive,*/
942
- isYearView,
943
- isMonthOpen: oldIsMonthOpen
944
- } = this.getDateTimeStateValues();
945
- const yearViewTypes = ['month', 'year'];
946
- const isMonthOpen = focusedType === 'month';
947
-
948
- if (isPopupOpen) {
949
- if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
950
- if (!isFocused && isYearView) {
951
- this.DateTimeYearViewToggle(true, oldIsMonthOpen);
952
- } else {
953
- this.DateTimeYearViewToggle(true, isMonthOpen);
954
- }
955
- } else if (yearViewTypes.indexOf(focusedType) === -1) {
956
- if (!isFocused && isYearView) {
957
- this.DateTimeYearViewToggle(isYearView, oldIsMonthOpen);
958
- } else {
959
- this.DateTimeYearViewToggle(false, false);
960
- }
961
- }
962
- } // }
963
-
964
- }
965
- }
966
-
967
- render() {
968
- const {
969
- removeClose,
970
- minErrorText,
971
- maxErrorText,
972
- min,
973
- max,
974
- placeholder,
975
- isPopupOpen,
976
- isPopupReady,
977
- isDateTime,
978
- position,
979
- textBoxVariant,
980
- textBoxSize,
981
- children = null,
982
- isDisabled,
983
- getContainerRef,
984
- getTargetRef,
985
- timeZone,
986
- isReadOnly,
987
- dataId,
988
- needResponsive,
989
- className,
990
- needBorder,
991
- defaultTime,
992
- needDefaultTime,
993
- borderColor,
994
- i18nKeys,
995
- needErrorOnBlur,
996
- htmlId,
997
- iconOnHover,
998
- is24Hour,
999
- isAbsolutePositioningNeeded,
1000
- positionsOffset,
1001
- targetOffset,
1002
- isRestrictScroll,
1003
- dropBoxPortalId,
1004
- a11y,
1005
- boxSize,
1006
- onError,
1007
- startDate,
1008
- endDate,
1009
- weekStartDay,
1010
- holidays,
1011
- customProps = {}
1012
- } = this.props;
1013
- const {
1014
- DateTimeProps = {},
1015
- TextBoxProps = {}
1016
- } = customProps;
1017
- const {
1018
- selected: value = '',
1019
- isError,
1020
- isDateEdited,
1021
- isFocused
1022
- } = this.state;
1023
- const showValue = this.handleGetShowValue();
1024
- const isAllowedDateType = this.handleGetAllowedType();
1025
- const showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
1026
- const showError = needErrorOnBlur ? isError && !isFocused && !isPopupOpen : isError;
1027
- return /*#__PURE__*/React.createElement("div", {
1028
- className: `${style.container}`
1029
- }, children ? /*#__PURE__*/React.createElement("div", {
1030
- "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : `${dataId}_widget`}`,
1031
- "data-test-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : `${dataId}_widget`}`,
1032
- onClick: isDisabled || isReadOnly ? null : this.handleTogglePopup,
1033
- ref: getTargetRef,
1034
- className: `${className ? className : ''} ${isDisabled ? style.disabled : style.enabled}`
1035
- }, children) : /*#__PURE__*/React.createElement("div", {
1036
- "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : `${dataId}_widget`}`,
1037
- "data-test-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : `${dataId}_widget`}`,
1038
- className: `${className ? className : ''} ${style.textBox} ${isPopupOpen && !isDisabled ? style.textBoxFocus : ''} ${isDisabled ? style.disabled : isReadOnly ? style.readOnly : style.enabled}`,
1039
- onClick: !isAllowedDateType ? isDisabled || isReadOnly ? null : this.handleTogglePopup : null,
1040
- ref: getTargetRef
1041
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
1042
- htmlId: htmlId,
1043
- value: showValue ? showValue : placeholder,
1044
- needBorder: needBorder,
1045
- size: textBoxSize,
1046
- variant: textBoxVariant,
1047
- inputRef: this.getValueInputRef,
1048
- isDisabled: isDisabled,
1049
- dataId: dataId,
1050
- needReadOnlyStyle: isReadOnly || isDisabled,
1051
- onKeyDown: this.handleKeyDown,
1052
- onFocus: this.handleFocus,
1053
- borderColor: showError ? 'error' : borderColor,
1054
- needEffect: !(isDisabled || isReadOnly || showError),
1055
- isClickable: true,
1056
- onClick: isDisabled || isReadOnly ? null : this.handleInputClick,
1057
- onBlur: this.handleBlur,
1058
- onClear: showClear ? this.handleDateClear : null,
1059
- isReadOnly: isReadOnly,
1060
- onMouseDown: this.handleMouseDown,
1061
- showClearIcon: showClear,
1062
- customClass: {
1063
- customTBoxWrap: isDateEdited || value ? '' : style.placeHolder
1064
- },
1065
- iconOnHover: iconOnHover,
1066
- isFocus: isPopupReady,
1067
- autoComplete: false,
1068
- a11y: a11y,
1069
- customProps: TextBoxProps
1070
- }, /*#__PURE__*/React.createElement(Container, {
1071
- align: "both",
1072
- onClick: isDisabled || isReadOnly ? null : this.handleDateIconClick,
1073
- dataId: `${dataId}_datePicker`
1074
- }, /*#__PURE__*/React.createElement(Icon, {
1075
- name: "ZD-datepicker",
1076
- size: "12"
1077
- })))), isReadOnly || isDisabled ? null : /*#__PURE__*/React.createElement(DateTime, {
1078
- value: value,
1079
- isDateTimeField: isDateTime,
1080
- onSelect: this.handleSelect,
1081
- timeZone: timeZone,
1082
- min: min,
1083
- max: max,
1084
- maxErrorText: maxErrorText,
1085
- minErrorText: minErrorText,
1086
- position: position,
1087
- isReady: isPopupOpen,
1088
- isActive: isPopupReady,
1089
- getRef: getContainerRef,
1090
- onClick: removeClose,
1091
- needResponsive: needResponsive,
1092
- dataId: dataId,
1093
- defaultTime: defaultTime,
1094
- needDefaultTime: needDefaultTime,
1095
- getMethods: this.handleGetMethods,
1096
- onClear: this.handleDateTimeClear,
1097
- needAction: isDateTime,
1098
- onDateSelect: !isDateTime ? this.handleSelect : null,
1099
- i18nKeys: i18nKeys,
1100
- is24Hour: is24Hour,
1101
- isAbsolute: isAbsolutePositioningNeeded,
1102
- positionsOffset: positionsOffset,
1103
- targetOffset: targetOffset,
1104
- isRestrictScroll: isRestrictScroll,
1105
- dropBoxPortalId: dropBoxPortalId,
1106
- boxSize: boxSize,
1107
- onError: onError,
1108
- startDate: startDate,
1109
- endDate: endDate,
1110
- customProps: DateTimeProps,
1111
- weekStartDay: weekStartDay,
1112
- holidays: holidays
1113
- }));
1114
- }
1115
-
1116
- }
1117
-
1118
- DateWidgetComponent.defaultProps = DateWidget_defaultProps;
1119
- DateWidgetComponent.propTypes = DateWidget_propTypes;
1120
- const DateWidget = Popup(DateWidgetComponent);
1121
- DateWidget.defaultProps = DateWidgetComponent.defaultProps;
1122
- DateWidget.propTypes = DateWidgetComponent.propTypes; // eslint-disable-next-line no-undef
1123
- // if (__DOCS__) {
1124
- // DateWidgetComponent.docs = {
1125
- // componentGroup: 'Form Elements',
1126
- // folderName: 'Style Guide',
1127
- // external: true,
1128
- // description: ' '
1129
- // };
1130
- // // eslint-disable-next-line react/forbid-foreign-prop-types
1131
- // DateWidget.propTypes = DateWidgetComponent.propTypes;
1132
- // }
1133
-
1134
- export default DateWidget;