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