@zohodesk/components 1.0.0-temp-107 → 1.0.0-test-252

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 (458) hide show
  1. package/css_error.log +0 -0
  2. package/es/Avatar/Avatar.js +1 -3
  3. package/es/Avatar/Avatar.module.css +23 -11
  4. package/es/AvatarTeam/AvatarTeam.module.css +21 -7
  5. package/es/Button/Button.module.css +97 -24
  6. package/es/Buttongroup/Buttongroup.module.css +37 -8
  7. package/es/CheckBox/CheckBox.module.css +17 -11
  8. package/es/DateTime/CalendarView.js +2 -4
  9. package/es/DateTime/DateTime.js +1 -1
  10. package/es/DateTime/DateTime.module.css +44 -13
  11. package/es/DateTime/DateTimePopupHeader.js +9 -24
  12. package/es/DateTime/DateWidget.js +2 -4
  13. package/es/DateTime/DateWidget.module.css +9 -5
  14. package/es/DateTime/DaysRow.js +2 -5
  15. package/es/DateTime/YearView.js +4 -12
  16. package/es/DateTime/YearView.module.css +18 -23
  17. package/es/DropBox/DropBox.module.css +47 -11
  18. package/es/DropDown/DropDownHeading.js +1 -3
  19. package/es/DropDown/DropDownHeading.module.css +7 -3
  20. package/es/DropDown/DropDownItem.module.css +32 -6
  21. package/es/DropDown/props/propTypes.js +1 -2
  22. package/es/Label/Label.js +2 -4
  23. package/es/ListItem/ListContainer.js +2 -4
  24. package/es/ListItem/ListItem.js +1 -2
  25. package/es/ListItem/ListItem.module.css +57 -25
  26. package/es/MultiSelect/MultiSelect.js +2 -4
  27. package/es/MultiSelect/MultiSelect.module.css +28 -11
  28. package/es/MultiSelect/SelectedOptions.module.css +8 -2
  29. package/es/MultiSelect/Suggestions.js +1 -2
  30. package/es/PopOver/PopOver.module.css +1 -1
  31. package/es/Radio/Radio.module.css +10 -4
  32. package/es/Ribbon/Ribbon.module.css +93 -28
  33. package/es/RippleEffect/RippleEffect.module.css +9 -27
  34. package/es/Select/Select.js +4 -7
  35. package/es/Select/Select.module.css +12 -2
  36. package/es/Select/SelectWithIcon.js +1 -2
  37. package/es/Stencils/Stencils.module.css +21 -3
  38. package/es/Switch/Switch.module.css +6 -7
  39. package/es/Tab/Tab.js +1 -2
  40. package/es/Tab/Tab.module.css +16 -7
  41. package/es/Tab/Tabs.js +3 -7
  42. package/es/Tab/Tabs.module.css +42 -8
  43. package/es/Tag/Tag.module.css +36 -14
  44. package/es/TextBox/TextBox.module.css +7 -11
  45. package/es/TextBoxIcon/TextBoxIcon.module.css +12 -5
  46. package/es/Textarea/Textarea.module.css +6 -7
  47. package/es/Tooltip/Tooltip.module.css +9 -8
  48. package/es/common/animation.module.css +219 -21
  49. package/es/common/basicReset.module.css +2 -12
  50. package/es/common/common.module.css +64 -18
  51. package/es/common/customscroll.module.css +17 -21
  52. package/es/common/transition.module.css +50 -10
  53. package/es/deprecated/AdvancedMultiSelect.module.css +22 -8
  54. package/es/index.js +107 -106
  55. package/es/semantic/Button/semanticButton.module.css +3 -3
  56. package/lib/Accordion/Accordion.js +102 -0
  57. package/lib/Accordion/AccordionItem.js +84 -0
  58. package/lib/Accordion/__tests__/Accordion.spec.js +82 -0
  59. package/lib/Accordion/index.js +20 -0
  60. package/lib/Accordion/props/defaultProps.js +16 -0
  61. package/lib/Accordion/props/propTypes.js +39 -0
  62. package/lib/Animation/Animation.js +161 -0
  63. package/lib/Animation/__tests__/Animation.spec.js +19 -0
  64. package/lib/Animation/props/defaultProps.js +14 -0
  65. package/lib/Animation/props/propTypes.js +20 -0
  66. package/lib/AppContainer/AppContainer.js +156 -0
  67. package/lib/AppContainer/AppContainer.module.css +18 -0
  68. package/lib/AppContainer/props/defaultProps.js +15 -0
  69. package/lib/AppContainer/props/propTypes.js +23 -0
  70. package/lib/Avatar/Avatar.js +199 -0
  71. package/lib/Avatar/Avatar.module.css +135 -0
  72. package/lib/Avatar/__tests__/Avatar.spec.js +164 -0
  73. package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +288 -0
  74. package/lib/Avatar/props/defaultProps.js +21 -0
  75. package/lib/Avatar/props/propTypes.js +31 -0
  76. package/lib/AvatarTeam/AvatarTeam.js +99 -0
  77. package/lib/AvatarTeam/AvatarTeam.module.css +161 -0
  78. package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +79 -0
  79. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +226 -0
  80. package/lib/AvatarTeam/props/defaultProps.js +20 -0
  81. package/lib/AvatarTeam/props/propTypes.js +31 -0
  82. package/lib/Button/Button.js +90 -0
  83. package/lib/Button/Button.module.css +522 -0
  84. package/lib/Button/__tests__/Button.spec.js +193 -0
  85. package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +191 -0
  86. package/lib/Button/props/defaultProps.js +22 -0
  87. package/lib/Button/props/propTypes.js +30 -0
  88. package/lib/Buttongroup/Buttongroup.js +70 -0
  89. package/lib/Buttongroup/Buttongroup.module.css +89 -0
  90. package/lib/Buttongroup/__test__/Buttongroup.spec.js +76 -0
  91. package/lib/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +146 -0
  92. package/lib/Buttongroup/props/defaultProps.js +11 -0
  93. package/lib/Buttongroup/props/propTypes.js +15 -0
  94. package/lib/Card/Card.js +301 -0
  95. package/lib/Card/Card.module.css +20 -0
  96. package/lib/Card/__tests__/Card.spec.js +47 -0
  97. package/lib/Card/index.js +33 -0
  98. package/lib/Card/props/defaultProps.js +23 -0
  99. package/lib/Card/props/propTypes.js +54 -0
  100. package/lib/CheckBox/CheckBox.js +183 -0
  101. package/lib/CheckBox/CheckBox.module.css +157 -0
  102. package/lib/CheckBox/__tests__/CheckBox.spec.js +15 -0
  103. package/lib/CheckBox/props/defaultProps.js +25 -0
  104. package/lib/CheckBox/props/propTypes.js +49 -0
  105. package/lib/DateTime/CalendarView.js +228 -0
  106. package/lib/DateTime/DateTime.js +779 -0
  107. package/lib/DateTime/DateTime.module.css +233 -0
  108. package/lib/DateTime/DateTimePopupFooter.js +65 -0
  109. package/lib/DateTime/DateTimePopupHeader.js +117 -0
  110. package/lib/DateTime/DateWidget.js +1015 -0
  111. package/lib/DateTime/DateWidget.module.css +38 -0
  112. package/lib/DateTime/DaysRow.js +52 -0
  113. package/lib/DateTime/Time.js +205 -0
  114. package/lib/DateTime/YearView.js +267 -0
  115. package/lib/DateTime/YearView.module.css +81 -0
  116. package/lib/DateTime/__tests__/CalendarView.spec.js +37 -0
  117. package/lib/DateTime/__tests__/DateTime.spec.js +113 -0
  118. package/lib/DateTime/__tests__/DateWidget.spec.js +79 -0
  119. package/lib/DateTime/common.js +30 -0
  120. package/lib/DateTime/constants.js +76 -0
  121. package/lib/DateTime/dateFormatUtils/dateFormat.js +551 -0
  122. package/lib/DateTime/dateFormatUtils/dayChange.js +74 -0
  123. package/lib/DateTime/dateFormatUtils/index.js +225 -0
  124. package/lib/DateTime/dateFormatUtils/monthChange.js +84 -0
  125. package/lib/DateTime/dateFormatUtils/timeChange.js +208 -0
  126. package/lib/DateTime/dateFormatUtils/yearChange.js +108 -0
  127. package/lib/DateTime/index.js +13 -0
  128. package/lib/DateTime/objectUtils.js +72 -0
  129. package/lib/DateTime/props/defaultProps.js +61 -0
  130. package/lib/DateTime/props/propTypes.js +144 -0
  131. package/lib/DateTime/typeChecker.js +22 -0
  132. package/lib/DateTime/validator.js +290 -0
  133. package/lib/DropBox/DropBox.js +266 -0
  134. package/lib/DropBox/DropBox.module.css +406 -0
  135. package/lib/DropBox/DropBoxPositionMapping.json +145 -0
  136. package/lib/DropBox/__tests__/DropBox.spec.js +83 -0
  137. package/lib/DropBox/props/defaultProps.js +27 -0
  138. package/lib/DropBox/props/propTypes.js +55 -0
  139. package/lib/DropDown/DropDown.js +128 -0
  140. package/lib/DropDown/DropDown.module.css +5 -0
  141. package/lib/DropDown/DropDownHeading.js +64 -0
  142. package/lib/DropDown/DropDownHeading.module.css +53 -0
  143. package/lib/DropDown/DropDownItem.js +102 -0
  144. package/lib/DropDown/DropDownItem.module.css +94 -0
  145. package/lib/DropDown/DropDownSearch.js +89 -0
  146. package/lib/DropDown/DropDownSearch.module.css +14 -0
  147. package/lib/DropDown/DropDownSeparator.js +42 -0
  148. package/lib/DropDown/DropDownSeparator.module.css +7 -0
  149. package/lib/DropDown/__tests__/DropDown.spec.js +44 -0
  150. package/lib/DropDown/__tests__/DropDownItem.spec.js +46 -0
  151. package/lib/DropDown/__tests__/DropDownSearch.spec.js +14 -0
  152. package/lib/DropDown/props/defaultProps.js +28 -0
  153. package/lib/DropDown/props/propTypes.js +89 -0
  154. package/lib/Heading/Heading.js +64 -0
  155. package/lib/Heading/Heading.module.css +5 -0
  156. package/lib/Heading/props/defaultProps.js +12 -0
  157. package/lib/Heading/props/propTypes.js +19 -0
  158. package/lib/Label/Label.js +65 -0
  159. package/lib/Label/Label.module.css +52 -0
  160. package/lib/Label/LabelColors.module.css +21 -0
  161. package/lib/Label/__tests__/Label.spec.js +124 -0
  162. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +101 -0
  163. package/lib/Label/props/defaultProps.js +17 -0
  164. package/lib/Label/props/propTypes.js +22 -0
  165. package/lib/Layout/Box.js +104 -0
  166. package/lib/Layout/Container.js +122 -0
  167. package/lib/Layout/Layout.module.css +336 -0
  168. package/lib/Layout/__tests__/Box.spec.js +105 -0
  169. package/lib/Layout/__tests__/Container.spec.js +110 -0
  170. package/lib/Layout/index.js +30 -0
  171. package/lib/Layout/props/defaultProps.js +20 -0
  172. package/lib/Layout/props/propTypes.js +51 -0
  173. package/lib/Layout/utils.js +45 -0
  174. package/lib/ListItem/ListContainer.js +93 -0
  175. package/lib/ListItem/ListItem.js +153 -0
  176. package/lib/ListItem/ListItem.module.css +209 -0
  177. package/lib/ListItem/ListItemWithAvatar.js +175 -0
  178. package/lib/ListItem/ListItemWithCheckBox.js +141 -0
  179. package/lib/ListItem/ListItemWithIcon.js +158 -0
  180. package/lib/ListItem/ListItemWithRadio.js +143 -0
  181. package/lib/ListItem/props/defaultProps.js +97 -0
  182. package/lib/ListItem/props/propTypes.js +176 -0
  183. package/lib/Modal/Modal.js +174 -0
  184. package/lib/Modal/props/defaultProps.js +10 -0
  185. package/lib/Modal/props/propTypes.js +14 -0
  186. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +1032 -0
  187. package/lib/MultiSelect/AdvancedMultiSelect.js +552 -0
  188. package/lib/MultiSelect/EmptyState.js +85 -0
  189. package/lib/MultiSelect/MultiSelect.js +1044 -0
  190. package/lib/MultiSelect/MultiSelect.module.css +206 -0
  191. package/lib/MultiSelect/MultiSelectHeader.js +55 -0
  192. package/lib/MultiSelect/MultiSelectWithAvatar.js +304 -0
  193. package/lib/MultiSelect/SelectedOptions.js +98 -0
  194. package/lib/MultiSelect/SelectedOptions.module.css +15 -0
  195. package/lib/MultiSelect/Suggestions.js +158 -0
  196. package/lib/MultiSelect/__tests__/MultiSelect.spec.js +159 -0
  197. package/lib/MultiSelect/props/defaultProps.js +158 -0
  198. package/lib/MultiSelect/props/propTypes.js +377 -0
  199. package/lib/PopOver/PopOver.js +252 -0
  200. package/lib/PopOver/PopOver.module.css +8 -0
  201. package/lib/PopOver/__tests__/PopOver.spec.js +17 -0
  202. package/lib/PopOver/props/defaultProps.js +15 -0
  203. package/lib/PopOver/props/propTypes.js +63 -0
  204. package/lib/Popup/Popup.js +640 -0
  205. package/lib/Popup/PositionMapping.json +74 -0
  206. package/lib/Popup/__tests__/Popup.spec.js +155 -0
  207. package/lib/Popup/viewPort.js +354 -0
  208. package/lib/Provider/AvatarSize.js +19 -0
  209. package/lib/Provider/Config.js +25 -0
  210. package/lib/Provider/CssProvider.js +23 -0
  211. package/lib/Provider/IdProvider.js +68 -0
  212. package/lib/Provider/LibraryContext.js +54 -0
  213. package/lib/Provider/LibraryContextInit.js +11 -0
  214. package/lib/Provider/NumberGenerator/NumberGenerator.js +145 -0
  215. package/lib/Provider/ZindexProvider.js +57 -0
  216. package/lib/Radio/Radio.js +146 -0
  217. package/lib/Radio/Radio.module.css +112 -0
  218. package/lib/Radio/__tests__/Radiospec.js +25 -0
  219. package/lib/Radio/props/defaultProps.js +21 -0
  220. package/lib/Radio/props/propTypes.js +40 -0
  221. package/lib/Responsive/CustomResponsive.js +192 -0
  222. package/lib/Responsive/RefWrapper.js +47 -0
  223. package/lib/Responsive/ResizeComponent.js +237 -0
  224. package/lib/Responsive/ResizeObserver.js +151 -0
  225. package/lib/Responsive/Responsive.js +222 -0
  226. package/lib/Responsive/index.js +28 -0
  227. package/lib/Responsive/props/defaultProps.js +23 -0
  228. package/lib/Responsive/props/propTypes.js +36 -0
  229. package/lib/Responsive/sizeObservers.js +176 -0
  230. package/lib/Responsive/utils/index.js +62 -0
  231. package/lib/Responsive/utils/shallowCompare.js +29 -0
  232. package/lib/Responsive/windowResizeObserver.js +55 -0
  233. package/lib/ResponsiveDropBox/ResponsiveDropBox.js +94 -0
  234. package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
  235. package/lib/ResponsiveDropBox/props/defaultProps.js +11 -0
  236. package/lib/ResponsiveDropBox/props/propTypes.js +15 -0
  237. package/lib/Ribbon/Ribbon.js +71 -0
  238. package/lib/Ribbon/Ribbon.module.css +377 -0
  239. package/lib/Ribbon/__tests__/Ribbon.spec.js +171 -0
  240. package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +163 -0
  241. package/lib/Ribbon/props/defaultProps.js +15 -0
  242. package/lib/Ribbon/props/propTypes.js +18 -0
  243. package/lib/RippleEffect/RippleEffect.js +35 -0
  244. package/lib/RippleEffect/RippleEffect.module.css +92 -0
  245. package/lib/RippleEffect/props/defaultProps.js +16 -0
  246. package/lib/RippleEffect/props/propTypes.js +19 -0
  247. package/lib/Select/GroupSelect.js +771 -0
  248. package/lib/Select/Select.js +910 -0
  249. package/lib/Select/Select.module.css +109 -0
  250. package/lib/Select/SelectWithAvatar.js +340 -0
  251. package/lib/Select/SelectWithIcon.js +530 -0
  252. package/lib/Select/__tests__/Select.spec.js +341 -0
  253. package/lib/Select/props/defaultProps.js +112 -0
  254. package/lib/Select/props/propTypes.js +280 -0
  255. package/lib/Stencils/Stencils.js +57 -0
  256. package/lib/Stencils/Stencils.module.css +96 -0
  257. package/lib/Stencils/__tests__/Stencils.spec.js +72 -0
  258. package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +49 -0
  259. package/lib/Stencils/props/defaultProps.js +13 -0
  260. package/lib/Stencils/props/propTypes.js +15 -0
  261. package/lib/Switch/Switch.js +123 -0
  262. package/lib/Switch/Switch.module.css +111 -0
  263. package/lib/Switch/props/defaultProps.js +17 -0
  264. package/lib/Switch/props/propTypes.js +35 -0
  265. package/lib/Tab/Tab.js +116 -0
  266. package/lib/Tab/Tab.module.css +101 -0
  267. package/lib/Tab/TabContent.js +33 -0
  268. package/lib/Tab/TabContent.module.css +4 -0
  269. package/lib/Tab/TabContentWrapper.js +33 -0
  270. package/lib/Tab/TabWrapper.js +69 -0
  271. package/lib/Tab/Tabs.js +581 -0
  272. package/lib/Tab/Tabs.module.css +141 -0
  273. package/lib/Tab/__tests__/Tab.spec.js +119 -0
  274. package/lib/Tab/__tests__/TabContent.spec.js +18 -0
  275. package/lib/Tab/__tests__/TabContentWrapper.spec.js +51 -0
  276. package/lib/Tab/__tests__/TabWrapper.spec.js +88 -0
  277. package/lib/Tab/__tests__/Tabs.spec.js +109 -0
  278. package/lib/Tab/index.js +41 -0
  279. package/lib/Tab/props/defaultProps.js +50 -0
  280. package/lib/Tab/props/propTypes.js +114 -0
  281. package/lib/Tag/Tag.js +177 -0
  282. package/lib/Tag/Tag.module.css +255 -0
  283. package/lib/Tag/__tests__/Tag.spec.js +29 -0
  284. package/lib/Tag/props/defaultProps.js +20 -0
  285. package/lib/Tag/props/propTypes.js +42 -0
  286. package/lib/TextBox/TextBox.js +193 -0
  287. package/lib/TextBox/TextBox.module.css +157 -0
  288. package/lib/TextBox/__tests__/TextBox.spec.js +195 -0
  289. package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +127 -0
  290. package/lib/TextBox/props/defaultProps.js +26 -0
  291. package/lib/TextBox/props/propTypes.js +57 -0
  292. package/lib/TextBoxIcon/TextBoxIcon.js +188 -0
  293. package/lib/TextBoxIcon/TextBoxIcon.module.css +78 -0
  294. package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +219 -0
  295. package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +334 -0
  296. package/lib/TextBoxIcon/props/defaultProps.js +28 -0
  297. package/lib/TextBoxIcon/props/propTypes.js +57 -0
  298. package/lib/Textarea/Textarea.js +130 -0
  299. package/lib/Textarea/Textarea.module.css +139 -0
  300. package/lib/Textarea/__tests__/Textarea.spec.js +174 -0
  301. package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +97 -0
  302. package/lib/Textarea/props/defaultProps.js +23 -0
  303. package/lib/Textarea/props/propTypes.js +39 -0
  304. package/lib/Tooltip/Tooltip.js +519 -0
  305. package/lib/Tooltip/Tooltip.module.css +109 -0
  306. package/lib/Tooltip/__tests__/Tooltip.spec.js +75 -0
  307. package/lib/Tooltip/props/defaultProps.js +11 -0
  308. package/lib/Tooltip/props/propTypes.js +16 -0
  309. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +100 -0
  310. package/lib/VelocityAnimation/VelocityAnimation/props/defaultProps.js +14 -0
  311. package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +20 -0
  312. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +131 -0
  313. package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +22 -0
  314. package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +27 -0
  315. package/lib/common/animation.module.css +624 -0
  316. package/lib/common/avatarsizes.module.css +45 -0
  317. package/lib/common/basic.module.css +33 -0
  318. package/lib/common/basicReset.module.css +40 -0
  319. package/lib/common/common.module.css +525 -0
  320. package/lib/common/customscroll.module.css +89 -0
  321. package/lib/common/reset.module.css +12 -0
  322. package/lib/common/transition.module.css +146 -0
  323. package/lib/css.js +42 -0
  324. package/lib/deprecated/AdvancedMultiSelect.module.css +127 -0
  325. package/lib/deprecated/PortalLayer/PortalLayer.js +126 -0
  326. package/lib/deprecated/PortalLayer/props/defaultProps.js +12 -0
  327. package/lib/deprecated/PortalLayer/props/propTypes.js +19 -0
  328. package/lib/deprecated/advancedMultiSelectVariableJson.js +82 -0
  329. package/lib/index.js +404 -0
  330. package/lib/semantic/Button/Button.js +81 -0
  331. package/lib/semantic/Button/props/defaultProps.js +19 -0
  332. package/lib/semantic/Button/props/propTypes.js +34 -0
  333. package/lib/semantic/Button/semanticButton.module.css +9 -0
  334. package/lib/utils/Common.js +391 -0
  335. package/lib/utils/ContextOptimizer.js +43 -0
  336. package/lib/utils/__tests__/constructFullName.spec.js +11 -0
  337. package/lib/utils/__tests__/debounce.spec.js +39 -0
  338. package/lib/utils/__tests__/getInitial.spec.js +25 -0
  339. package/lib/utils/constant.js +10 -0
  340. package/lib/utils/constructFullName.js +25 -0
  341. package/lib/utils/datetime/common.js +206 -0
  342. package/lib/utils/debounce.js +25 -0
  343. package/lib/utils/dropDownUtils.js +491 -0
  344. package/lib/utils/dummyFunction.js +8 -0
  345. package/lib/utils/getHTMLFontSize.js +10 -0
  346. package/lib/utils/getInitial.js +27 -0
  347. package/lib/utils/scrollTo.js +20 -0
  348. package/lib/utils/shallowEqual.js +33 -0
  349. package/package.json +1 -1
  350. package/es/Accordion/docs/Accordion__Demo.docs.js +0 -78
  351. package/es/Animation/docs/Animation__default.docs.js +0 -32
  352. package/es/Animation/docs/Animation__fadeIn.docs.js +0 -32
  353. package/es/Animation/docs/Animation__scaleIn.docs.js +0 -32
  354. package/es/Animation/docs/Animation__skewIn.docs.js +0 -32
  355. package/es/Animation/docs/Animation__slideDown.docs.js +0 -32
  356. package/es/Animation/docs/Animation__slideLeft.docs.js +0 -32
  357. package/es/Animation/docs/Animation__zoomIn.docs.js +0 -32
  358. package/es/AppContainer/docs/AppContainer__default.docs.js +0 -18
  359. package/es/Avatar/docs/Avatar__custom.docs.js +0 -27
  360. package/es/Avatar/docs/Avatar__default.docs.js +0 -27
  361. package/es/Avatar/docs/Avatar__palette.docs.js +0 -47
  362. package/es/Avatar/docs/Avatar__text.docs.js +0 -26
  363. package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -71
  364. package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -29
  365. package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -48
  366. package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -47
  367. package/es/Button/docs/Button__custom.docs.js +0 -769
  368. package/es/Button/docs/Button__default.docs.js +0 -534
  369. package/es/Buttongroup/docs/Buttongroup__custom.docs.js +0 -35
  370. package/es/Buttongroup/docs/Buttongroup__footer.docs.js +0 -31
  371. package/es/Buttongroup/docs/Buttongroup__header.docs.js +0 -40
  372. package/es/Card/docs/Card__Custom.docs.js +0 -32
  373. package/es/Card/docs/Card__Default.docs.js +0 -35
  374. package/es/Card/docs/Card__Scroll.docs.js +0 -56
  375. package/es/CheckBox/docs/CheckBox__custom.docs.js +0 -289
  376. package/es/CheckBox/docs/CheckBox__default.docs.js +0 -215
  377. package/es/DateTime/docs/DateTime__default.docs.js +0 -88
  378. package/es/DateTime/docs/DateWidget__default.docs.js +0 -178
  379. package/es/DateTime/docs/timezonedata.json +0 -1
  380. package/es/DropBox/docs/DropBox__custom.docs.js +0 -64
  381. package/es/DropBox/docs/DropBox__customOrder.docs.js +0 -85
  382. package/es/DropBox/docs/DropBox__fixedPosition.docs.js +0 -84
  383. package/es/DropBox/docs/DropBox__position.docs.js +0 -85
  384. package/es/DropBox/docs/DropBox__size.docs.js +0 -59
  385. package/es/DropDown/docs/DropDownHeading__custom.docs.js +0 -21
  386. package/es/DropDown/docs/DropDownHeading__default.docs.js +0 -19
  387. package/es/FramerAnimation/FramerAnimation.js +0 -206
  388. package/es/FramerAnimation/docs/FramerAnimation__default.docs.js +0 -123
  389. package/es/Heading/docs/Heading__default.docs.js +0 -19
  390. package/es/Label/docs/Label__clipped.docs.js +0 -25
  391. package/es/Label/docs/Label__custom.docs.js +0 -28
  392. package/es/Label/docs/Label__palette.docs.js +0 -40
  393. package/es/Label/docs/Label__size.docs.js +0 -27
  394. package/es/Label/docs/Label__type.docs.js +0 -35
  395. package/es/Layout/docs/Layout__Hidden.docs.js +0 -76
  396. package/es/Layout/docs/Layout__default.docs.js +0 -48
  397. package/es/Layout/docs/Layout__four_Column.docs.js +0 -78
  398. package/es/Layout/docs/Layout__three_Column.docs.js +0 -75
  399. package/es/Layout/docs/Layout__two_Column.docs.js +0 -68
  400. package/es/LightNightMode/Colors.json +0 -497
  401. package/es/LightNightMode/docs/AlternativeColors.docs.js +0 -92
  402. package/es/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -153
  403. package/es/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -110
  404. package/es/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -89
  405. package/es/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -63
  406. package/es/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -66
  407. package/es/ListItem/docs/ListItemWithIcon__default.docs.js +0 -60
  408. package/es/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -89
  409. package/es/ListItem/docs/ListItemWithRadio__default.docs.js +0 -63
  410. package/es/ListItem/docs/ListItem__custom.docs.js +0 -112
  411. package/es/ListItem/docs/ListItem__default.docs.js +0 -80
  412. package/es/Modal/__docs__/Modal__default.docs.js +0 -42
  413. package/es/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -118
  414. package/es/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -108
  415. package/es/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -137
  416. package/es/MultiSelect/docs/MultiSelect__default.docs.js +0 -156
  417. package/es/PopOver/docs/PopOver__default.docs.js +0 -30
  418. package/es/Provider/docs/Provider_Id__Class.docs.js +0 -28
  419. package/es/Provider/docs/Provider_Id__Function.docs.js +0 -17
  420. package/es/Provider/docs/Provider_Zindex__Class.docs.js +0 -31
  421. package/es/Provider/docs/Provider_Zindex__Function.docs.js +0 -22
  422. package/es/Provider.js +0 -91
  423. package/es/Radio/docs/Radio__custom.docs.js +0 -241
  424. package/es/Radio/docs/Radio__default.docs.js +0 -165
  425. package/es/Responsive/docs/Responsive__Custom.docs.js +0 -214
  426. package/es/Responsive/docs/Responsive__default.docs.js +0 -95
  427. package/es/Responsive/docs/style.module.css +0 -47
  428. package/es/Ribbon/docs/Ribbon__custom.docs.js +0 -385
  429. package/es/Ribbon/docs/Ribbon__default.docs.js +0 -341
  430. package/es/RippleEffect/docs/RippleEffect__default.docs.js +0 -433
  431. package/es/Select/docs/GroupSelect__default.docs.js +0 -144
  432. package/es/Select/docs/SelectWithAvatar__default.docs.js +0 -93
  433. package/es/Select/docs/SelectWithIcon__default.docs.js +0 -134
  434. package/es/Select/docs/Select__default.docs.js +0 -283
  435. package/es/Stencils/docs/Stencils__custom.docs.js +0 -43
  436. package/es/Stencils/docs/Stencils__default.docs.js +0 -48
  437. package/es/Switch/docs/Switch__custom.docs.js +0 -151
  438. package/es/Switch/docs/Switch__default.docs.js +0 -105
  439. package/es/Tab/docs/Tab__default.docs.js +0 -253
  440. package/es/Tab/docs/tabdocs.module.css +0 -29
  441. package/es/Tag/docs/Tag__custom.docs.js +0 -366
  442. package/es/Tag/docs/Tag__default.docs.js +0 -321
  443. package/es/TextBox/docs/TextBox__custom.docs.js +0 -41
  444. package/es/TextBox/docs/TextBox__default.docs.js +0 -38
  445. package/es/TextBox/docs/TextBox__size.docs.js +0 -36
  446. package/es/TextBox/docs/TextBox__variant.docs.js +0 -36
  447. package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -87
  448. package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -59
  449. package/es/Textarea/docs/Textarea__animated.docs.js +0 -39
  450. package/es/Textarea/docs/Textarea__custom.docs.js +0 -80
  451. package/es/Textarea/docs/Textarea__default.docs.js +0 -74
  452. package/es/Textarea/docs/Textarea__disabled.docs.js +0 -27
  453. package/es/Tooltip/docs/Tooltip__default.docs.js +0 -367
  454. package/es/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -92
  455. package/es/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -139
  456. package/es/common/docStyle.module.css +0 -719
  457. package/es/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -65
  458. package/es/semantic/Button/docs/Button__default.docs.js +0 -17
@@ -0,0 +1,1015 @@
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
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _propTypes = require("./props/propTypes");
10
+ var _defaultProps = require("./props/defaultProps");
11
+ var _datetimejs = _interopRequireDefault(require("@zohodesk/datetimejs"));
12
+ var _DateTime = _interopRequireDefault(require("./DateTime"));
13
+ var _Popup = _interopRequireDefault(require("../Popup/Popup"));
14
+ var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
15
+ var _Layout = require("../Layout");
16
+ var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
17
+ var _DateWidgetModule = _interopRequireDefault(require("./DateWidget.module.css"));
18
+ var _validator = _interopRequireDefault(require("./validator"));
19
+ var _common = require("../utils/datetime/common");
20
+ var _dateFormatUtils = require("./dateFormatUtils");
21
+ var _dateFormat = require("./dateFormatUtils/dateFormat");
22
+ var _dayChange = require("./dateFormatUtils/dayChange");
23
+ var _monthChange = require("./dateFormatUtils/monthChange");
24
+ var _yearChange = require("./dateFormatUtils/yearChange");
25
+ var _timeChange = require("./dateFormatUtils/timeChange");
26
+ var _Common = require("../utils/Common");
27
+ var _constants = require("./constants");
28
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
29
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
30
+ 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); } }
31
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
32
+ 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); }
33
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
34
+ 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); }; }
35
+ 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); }
36
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
+ 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; } }
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+ /* eslint-disable react/no-unused-prop-types */
40
+ /* eslint css-modules/no-unused-class: [0, { markAsUsed: 'inputLine'] }] */
41
+ var DateWidgetComponent = /*#__PURE__*/function (_React$Component) {
42
+ _inherits(DateWidgetComponent, _React$Component);
43
+ var _super = _createSuper(DateWidgetComponent);
44
+ function DateWidgetComponent(props) {
45
+ var _this;
46
+ _classCallCheck(this, DateWidgetComponent);
47
+ _this = _super.call(this, props);
48
+ _this.handleSelect = _this.handleSelect.bind(_assertThisInitialized(_this));
49
+ _this.handleTogglePopup = _this.handleTogglePopup.bind(_assertThisInitialized(_this));
50
+ _this.handleGetDisplayText = _this.handleGetDisplayText.bind(_assertThisInitialized(_this));
51
+ _this.handleKeyDown = _this.handleKeyDown.bind(_assertThisInitialized(_this));
52
+ _this.handleFocus = _this.handleFocus.bind(_assertThisInitialized(_this));
53
+ _this.getValueInputRef = _this.getValueInputRef.bind(_assertThisInitialized(_this));
54
+ _this.handleGetMethods = _this.handleGetMethods.bind(_assertThisInitialized(_this));
55
+ _this.handleInputClick = _this.handleInputClick.bind(_assertThisInitialized(_this));
56
+ _this.handleGetShowValue = _this.handleGetShowValue.bind(_assertThisInitialized(_this));
57
+ _this.handleSelection = _this.handleSelection.bind(_assertThisInitialized(_this));
58
+ _this.handleDateType = _this.handleDateType.bind(_assertThisInitialized(_this));
59
+ _this.handleBlur = _this.handleBlur.bind(_assertThisInitialized(_this));
60
+ _this.handleGetAllowedType = _this.handleGetAllowedType.bind(_assertThisInitialized(_this));
61
+ _this.handleDateClear = _this.handleDateClear.bind(_assertThisInitialized(_this));
62
+ _this.handleDateTimeClear = _this.handleDateTimeClear.bind(_assertThisInitialized(_this));
63
+ _this.handleMouseDown = _this.handleMouseDown.bind(_assertThisInitialized(_this));
64
+ _this.handleDateIconClick = _this.handleDateIconClick.bind(_assertThisInitialized(_this));
65
+ _this.handleSelectionRangeDetails = _this.handleSelectionRangeDetails.bind(_assertThisInitialized(_this));
66
+ _this.handleBlurSelectionRange = _this.handleBlurSelectionRange.bind(_assertThisInitialized(_this));
67
+ _this.state = {
68
+ selected: '',
69
+ displayText: '',
70
+ dateFormatDetails: {},
71
+ dateFormatSelection: {},
72
+ day: '',
73
+ month: '',
74
+ year: '',
75
+ hour: '',
76
+ minute: '',
77
+ noon: '',
78
+ isDateEdited: false,
79
+ stateFocusOrder: '',
80
+ isError: false,
81
+ isFocused: false
82
+ };
83
+ _this.oldFocusOrder = '';
84
+ _this.focusOrder = '';
85
+ _this.oldKeyDownAction = ''; //'Arrow' || 'valueTyped'
86
+ _this.keyDownAction = ''; //'Arrow' || 'valueTyped'
87
+ _this.isMouseDown = false;
88
+ return _this;
89
+ }
90
+ _createClass(DateWidgetComponent, [{
91
+ key: "componentDidMount",
92
+ value: function componentDidMount() {
93
+ var validation = this.props.validation;
94
+ var selected = this.state.selected;
95
+ if (validation && validation.validate) {
96
+ this.validateOnSelect(selected, this.props);
97
+ }
98
+ var _this$handleGetDispla = this.handleGetDisplayText(this.props),
99
+ displayText = _this$handleGetDispla.displayText,
100
+ newSelected = _this$handleGetDispla.selected;
101
+ this.setState({
102
+ displayText: displayText,
103
+ selected: newSelected
104
+ });
105
+ this.handleSelectionRangeDetails(this.props);
106
+ }
107
+ }, {
108
+ key: "componentDidUpdate",
109
+ value: function componentDidUpdate(prevProps, prevState) {
110
+ var _this$state = this.state,
111
+ selected = _this$state.selected,
112
+ day = _this$state.day,
113
+ month = _this$state.month,
114
+ year = _this$state.year,
115
+ hour = _this$state.hour,
116
+ minute = _this$state.minute,
117
+ noon = _this$state.noon,
118
+ isDateEdited = _this$state.isDateEdited,
119
+ stateFocusOrder = _this$state.stateFocusOrder,
120
+ isFocused = _this$state.isFocused;
121
+ var _this$props = this.props,
122
+ value = _this$props.value,
123
+ validation = _this$props.validation,
124
+ isPopupReady = _this$props.isPopupReady,
125
+ _this$props$dateForma = _this$props.dateFormat,
126
+ dateFormat = _this$props$dateForma === void 0 ? '' : _this$props$dateForma,
127
+ is24Hour = _this$props.is24Hour,
128
+ isHideCurrentYear = _this$props.isHideCurrentYear;
129
+ if (validation && validation.validate) {
130
+ this.validateOnSelect(selected, this.props);
131
+ }
132
+ if (value !== prevProps.value || dateFormat !== prevProps.dateFormat || is24Hour !== prevProps.is24Hour || isHideCurrentYear !== prevProps.isHideCurrentYear) {
133
+ var _this$handleGetDispla2 = this.handleGetDisplayText(this.props),
134
+ displayText = _this$handleGetDispla2.displayText,
135
+ _selected = _this$handleGetDispla2.selected;
136
+ this.setState({
137
+ selected: _selected,
138
+ displayText: displayText
139
+ });
140
+ if (value !== _constants.INVALID_DATE) {
141
+ this.setState({
142
+ day: '',
143
+ month: '',
144
+ year: '',
145
+ hour: '',
146
+ minute: '',
147
+ noon: '',
148
+ isDateEdited: false,
149
+ isError: false
150
+ });
151
+ }
152
+ }
153
+ if (prevProps.isPopupReady !== isPopupReady) {
154
+ if (isPopupReady) {
155
+ this.resetLocalDate && this.resetLocalDate();
156
+ }
157
+ }
158
+ var haveLocalValue = [day, month, year, hour, minute, noon].some(function (value) {
159
+ return !(0, _Common.getIsEmptyValue)(value);
160
+ });
161
+ if (isDateEdited !== haveLocalValue) {
162
+ this.setState({
163
+ isDateEdited: haveLocalValue
164
+ });
165
+ }
166
+ 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])) {
167
+ this.handleSelectionRangeDetails(this.props);
168
+ }
169
+
170
+ // if (stateFocusOrder !== prevState.stateFocusOrder) {
171
+
172
+ isFocused && !(0, _Common.getIsEmptyValue)(stateFocusOrder) && this.handleSelection(stateFocusOrder);
173
+ this.handleBlurSelectionRange(stateFocusOrder, prevState.stateFocusOrder);
174
+ // }
175
+
176
+ // if (prevProps.isPopupOpen !== isPopupOpen) {
177
+ // if (!isPopupOpen) {
178
+ // this.valueInput && this.valueInput.focus({preventScroll:true});
179
+ // }
180
+ // }
181
+ }
182
+ }, {
183
+ key: "handleSelect",
184
+ value: function handleSelect(userZoneSelectedTime, fotmattedValue, e) {
185
+ var _this$props2 = this.props,
186
+ id = _this$props2.id,
187
+ onSelect = _this$props2.onSelect,
188
+ closePopupOnly = _this$props2.closePopupOnly,
189
+ validation = _this$props2.validation;
190
+ if (validation && validation.validateOn) {
191
+ var selected = this.state.selected;
192
+ this.validateOnSelect(selected, this.props);
193
+ }
194
+ onSelect && onSelect(userZoneSelectedTime, id);
195
+ this.valueInput && this.valueInput.focus({
196
+ preventScroll: true
197
+ });
198
+ closePopupOnly(e);
199
+ }
200
+ }, {
201
+ key: "validateOnSelect",
202
+ value: function validateOnSelect(value, props) {
203
+ var defaultCheckPropsRules = ['required'];
204
+ var defaultValidateRules = ['required'];
205
+ var defaultType = 'onegroup';
206
+ var validation = props.validation,
207
+ onPassValidation = props.onPassValidation,
208
+ onFailValidation = props.onFailValidation;
209
+ var targetTag = this.elementRef;
210
+ if (validation) {
211
+ //validateOn won't work here ...
212
+ var newValidation = _validator["default"].combinePropsValidation(this.props, defaultType, 'onSelect', validation, defaultCheckPropsRules, defaultValidateRules);
213
+ var validationObj = {
214
+ validation: newValidation,
215
+ onPassValidation: onPassValidation,
216
+ onFailValidation: onFailValidation
217
+ };
218
+ _validator["default"].executeValidation(value, targetTag, validationObj, defaultType);
219
+ } else {
220
+ onPassValidation && onPassValidation(value, targetTag);
221
+ }
222
+ }
223
+ }, {
224
+ key: "handleTogglePopup",
225
+ value: function handleTogglePopup(e, isOpenOnly) {
226
+ var _this$props3 = this.props,
227
+ togglePopup = _this$props3.togglePopup,
228
+ _this$props3$defaultP = _this$props3.defaultPosition,
229
+ defaultPosition = _this$props3$defaultP === void 0 ? 'bottom' : _this$props3$defaultP,
230
+ openPopupOnly = _this$props3.openPopupOnly,
231
+ isPopupOpen = _this$props3.isPopupOpen,
232
+ removeClose = _this$props3.removeClose;
233
+ if (isOpenOnly) {
234
+ if (!isPopupOpen) {
235
+ togglePopup(e, "".concat(defaultPosition, "Right"));
236
+ } else {
237
+ removeClose(e);
238
+ }
239
+ }
240
+ !isOpenOnly && togglePopup(e, "".concat(defaultPosition, "Right"));
241
+ }
242
+ }, {
243
+ key: "handleSelectionRangeDetails",
244
+ value: function handleSelectionRangeDetails(props) {
245
+ var timeZone = props.timeZone,
246
+ dateFormat = props.dateFormat,
247
+ isDateTime = props.isDateTime,
248
+ value = props.value,
249
+ is24Hour = props.is24Hour;
250
+ var _this$state2 = this.state,
251
+ day = _this$state2.day,
252
+ month = _this$state2.month,
253
+ year = _this$state2.year,
254
+ hour = _this$state2.hour,
255
+ minute = _this$state2.minute,
256
+ noon = _this$state2.noon;
257
+ var selected = value === _constants.INVALID_DATE ? '' : value;
258
+
259
+ //New UI Changes
260
+ var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
261
+ isHideCurrentYear: false,
262
+ value: value,
263
+ timeZone: timeZone,
264
+ isDateTime: isDateTime
265
+ });
266
+ var dateFormatSelection = (0, _dateFormat.getDateFormatSelection)(dateFormatDetails, isDateTime, {
267
+ i18nShortMonths: _constants.i18nShortMonths,
268
+ i18nMonths: _constants.i18nMonths,
269
+ selectedValue: selected,
270
+ day: day,
271
+ month: month,
272
+ year: year,
273
+ hour: hour,
274
+ minute: minute,
275
+ noon: noon,
276
+ timeZone: timeZone,
277
+ is24Hour: is24Hour
278
+ });
279
+ var newDateFormat = dateFormatDetails.dateFormat;
280
+ this.setState({
281
+ dateFormatDetails: dateFormatDetails,
282
+ dateFormatSelection: dateFormatSelection,
283
+ newDateFormat: newDateFormat
284
+ });
285
+ }
286
+ }, {
287
+ key: "handleGetDisplayText",
288
+ value: function handleGetDisplayText(props) {
289
+ var timeZone = props.timeZone,
290
+ dateFormat = props.dateFormat,
291
+ isDateTime = props.isDateTime,
292
+ value = props.value,
293
+ is24Hour = props.is24Hour,
294
+ isHideCurrentYear = props.isHideCurrentYear;
295
+ var dateFormatDetails = (0, _dateFormat.getDateFormatDetails)(dateFormat, {
296
+ isHideCurrentYear: isHideCurrentYear,
297
+ value: value,
298
+ timeZone: timeZone,
299
+ isDateTime: isDateTime
300
+ });
301
+ var newDateFormat = dateFormatDetails.dateFormat;
302
+ var displayText = '';
303
+ var selected = value === _constants.INVALID_DATE ? '' : value;
304
+ if (selected) {
305
+ var format = newDateFormat,
306
+ convertedValue;
307
+ if (isDateTime) {
308
+ convertedValue = _datetimejs["default"].toDate(_datetimejs["default"].tz.utcToTz(value, timeZone));
309
+ format = "".concat(newDateFormat, " ").concat(is24Hour ? 'HH:mm' : 'hh:mm A');
310
+ } else {
311
+ convertedValue = _datetimejs["default"].toDate(value);
312
+ }
313
+ displayText = (0, _common.formatDate)(convertedValue, format);
314
+ }
315
+ return {
316
+ displayText: displayText,
317
+ selected: selected
318
+ };
319
+ }
320
+ }, {
321
+ key: "handleKeyDown",
322
+ value: function handleKeyDown(e) {
323
+ var keyCode = e.keyCode;
324
+ var _this$props4 = this.props,
325
+ isPopupOpen = _this$props4.isPopupOpen,
326
+ isPopupOpenOnEnter = _this$props4.isPopupOpenOnEnter,
327
+ onKeyDown = _this$props4.onKeyDown,
328
+ closePopupOnly = _this$props4.closePopupOnly,
329
+ cantEditOnPopupOpen = _this$props4.cantEditOnPopupOpen;
330
+ var isAllowedDateType = this.handleGetAllowedType();
331
+ if (isPopupOpen) {
332
+ if (keyCode === 9 && !isAllowedDateType) {
333
+ //on tab click popup close
334
+ closePopupOnly(e);
335
+ }
336
+ // ~~~~~~~ handle date navigation in dateTime popup ~~~~~
337
+ if (isAllowedDateType) {
338
+ cantEditOnPopupOpen && this.handleDateType(e);
339
+ }
340
+ } else if (!isPopupOpen) {
341
+ if (isPopupOpenOnEnter && keyCode === 13) {
342
+ //onEnter popup open
343
+ this.handleTogglePopup(e);
344
+ } else if (keyCode === 13) {
345
+ //onEnter submit case
346
+ onKeyDown && onKeyDown(e);
347
+ } else if (isAllowedDateType) {
348
+ this.handleDateType(e);
349
+ }
350
+ }
351
+ }
352
+ }, {
353
+ key: "getValueInputRef",
354
+ value: function getValueInputRef(el) {
355
+ var getRef = this.props.getRef;
356
+ this.valueInput = el;
357
+ getRef && getRef(el);
358
+ }
359
+ }, {
360
+ key: "handleFocus",
361
+ value: function handleFocus() {
362
+ var isAllowedDateType = this.handleGetAllowedType();
363
+ var isMouseDown = this.isMouseDown;
364
+ if (isAllowedDateType && !isMouseDown) {
365
+ var dateFormatSelection = this.state.dateFormatSelection;
366
+ var focusedIndex = dateFormatSelection.focusedIndex;
367
+ var _this$valueInput = this.valueInput,
368
+ newSelectionStart = _this$valueInput.selectionStart,
369
+ newSelectionEnd = _this$valueInput.selectionEnd;
370
+ var focusedOrder = focusedIndex["".concat(newSelectionStart, "_").concat(newSelectionEnd)] || 0;
371
+ isAllowedDateType && this.setState({
372
+ stateFocusOrder: focusedOrder,
373
+ isFocused: true
374
+ });
375
+ } else if (!isAllowedDateType) {
376
+ var valueInput = this.valueInput;
377
+ document.getSelection().removeAllRanges();
378
+ valueInput && valueInput.setSelectionRange(0, 0);
379
+ this.setState({
380
+ isFocused: true
381
+ });
382
+ }
383
+ var onFocus = this.props.onFocus;
384
+ onFocus && onFocus();
385
+ }
386
+ }, {
387
+ key: "handleBlur",
388
+ value: function handleBlur() {
389
+ this.focusOrder = '';
390
+ this.oldFocusOrder = '';
391
+ this.oldKeyDownAction = '';
392
+ this.keyDownAction = '';
393
+ this.setState({
394
+ isFocused: false
395
+ });
396
+
397
+ // const { valueInput } = this;
398
+ // document.getSelection().removeAllRanges();
399
+ // valueInput && valueInput.setSelectionRange(0, 0);
400
+
401
+ var onBlur = this.props.onBlur;
402
+ onBlur && onBlur();
403
+ }
404
+ }, {
405
+ key: "handleGetMethods",
406
+ value: function handleGetMethods(methods) {
407
+ var getMethods = this.props.getMethods;
408
+ var resetLocalDate = methods.resetLocalDate,
409
+ getStateValues = methods.getStateValues,
410
+ toggleYearView = methods.toggleYearView;
411
+ this.resetLocalDate = resetLocalDate;
412
+ this.getDateTimeStateValues = getStateValues;
413
+ this.DateTimeYearViewToggle = toggleYearView;
414
+ getMethods && getMethods(methods);
415
+ }
416
+ }, {
417
+ key: "handleDateType",
418
+ value: function handleDateType(e) {
419
+ var _this2 = this;
420
+ var keyCode = e.keyCode,
421
+ shiftKey = e.shiftKey;
422
+ var input = e.target;
423
+ if ((0, _dateFormatUtils.getIsSupportedKey)(e)) {
424
+ e.preventDefault();
425
+ }
426
+ var _this$props5 = this.props,
427
+ isDateTime = _this$props5.isDateTime,
428
+ timeZone = _this$props5.timeZone,
429
+ value = _this$props5.value,
430
+ onSelect = _this$props5.onSelect,
431
+ id = _this$props5.id,
432
+ min = _this$props5.min,
433
+ max = _this$props5.max,
434
+ minErrorText = _this$props5.minErrorText,
435
+ maxErrorText = _this$props5.maxErrorText,
436
+ onError = _this$props5.onError,
437
+ closePopupOnly = _this$props5.closePopupOnly,
438
+ is24Hour = _this$props5.is24Hour;
439
+ var _this$state3 = this.state,
440
+ dateFormatSelection = _this$state3.dateFormatSelection,
441
+ day = _this$state3.day,
442
+ month = _this$state3.month,
443
+ year = _this$state3.year,
444
+ hour = _this$state3.hour,
445
+ minute = _this$state3.minute,
446
+ noon = _this$state3.noon,
447
+ selected = _this$state3.selected,
448
+ dateFormatDetails = _this$state3.dateFormatDetails;
449
+ var focusedIndex = dateFormatSelection.focusedIndex,
450
+ order = dateFormatSelection.order;
451
+ var yearInfo = dateFormatDetails.yearInfo;
452
+ var _getDateDetails = (0, _dateFormat.getDateDetails)(selected, {
453
+ day: day,
454
+ month: month,
455
+ year: year,
456
+ hour: hour,
457
+ minute: minute,
458
+ noon: noon
459
+ }, isDateTime, timeZone, {
460
+ is24Hour: is24Hour
461
+ }),
462
+ _getDateDetails$day = _getDateDetails.day,
463
+ selectedDay = _getDateDetails$day === void 0 ? '' : _getDateDetails$day,
464
+ _getDateDetails$month = _getDateDetails.month,
465
+ selectedMonth = _getDateDetails$month === void 0 ? '' : _getDateDetails$month,
466
+ _getDateDetails$year = _getDateDetails.year,
467
+ selectedYear = _getDateDetails$year === void 0 ? '' : _getDateDetails$year,
468
+ _getDateDetails$hour = _getDateDetails.hour,
469
+ selectedHour = _getDateDetails$hour === void 0 ? '' : _getDateDetails$hour,
470
+ _getDateDetails$minut = _getDateDetails.minute,
471
+ selectedMinute = _getDateDetails$minut === void 0 ? '' : _getDateDetails$minut,
472
+ _getDateDetails$noon = _getDateDetails.noon,
473
+ selectedNoon = _getDateDetails$noon === void 0 ? '' : _getDateDetails$noon;
474
+ var newSelectionStart = input.selectionStart,
475
+ newSelectionEnd = input.selectionEnd;
476
+ var focusedOrder = focusedIndex["".concat(newSelectionStart, "_").concat(newSelectionEnd)];
477
+ var _ref = order[focusedOrder] || {},
478
+ type = _ref.type;
479
+ this.oldFocusOrder = this.focusOrder;
480
+ this.focusOrder = focusedOrder;
481
+ if (keyCode === 38 || keyCode === 40) {
482
+ //up arrow && down arrow
483
+ this.oldKeyDownAction = this.keyDownAction;
484
+ this.keyDownAction = 'Arrow';
485
+ } else {
486
+ this.oldKeyDownAction = this.keyDownAction;
487
+ this.keyDownAction = 'valueTyped';
488
+ }
489
+ var focusedOrders = {
490
+ focusOrder: this.focusOrder,
491
+ oldFocusOrder: this.oldFocusOrder
492
+ };
493
+ var keyActions = {
494
+ oldKeyAction: this.oldKeyDownAction,
495
+ keyAction: this.keyDownAction
496
+ };
497
+ var newDay = selectedDay,
498
+ newMonth = selectedMonth,
499
+ newYear = selectedYear,
500
+ newHour = selectedHour,
501
+ newMinute = selectedMinute,
502
+ newNoon = selectedNoon,
503
+ isValueChanged = false,
504
+ newFocusOrder = focusedOrder;
505
+ if (keyCode === 9 && shiftKey && !(0, _Common.getIsEmptyValue)(focusedOrder) && focusedOrder !== 0) {
506
+ e.preventDefault();
507
+ this.setState({
508
+ stateFocusOrder: focusedOrder - 1
509
+ });
510
+ } else if (keyCode === 9 && !shiftKey && !(0, _Common.getIsEmptyValue)(focusedOrder) && order.length - 1 !== focusedOrder) {
511
+ e.preventDefault();
512
+ this.setState({
513
+ stateFocusOrder: focusedOrder + 1
514
+ });
515
+ } else if (keyCode === 39) {
516
+ //arrow right
517
+ (0, _Common.getIsEmptyValue)(focusedOrder) ? this.setState({
518
+ stateFocusOrder: 0
519
+ }) : this.setState({
520
+ stateFocusOrder: focusedOrder + 1
521
+ });
522
+ } else if (keyCode === 37) {
523
+ //arrow left
524
+ (0, _Common.getIsEmptyValue)(focusedOrder) ? this.setState({
525
+ stateFocusOrder: order.length - 1
526
+ }) : this.setState({
527
+ stateFocusOrder: focusedOrder - 1
528
+ });
529
+ } else if (keyCode === 9) {
530
+ //on tab click popup close
531
+ closePopupOnly(e);
532
+ } else if (type === 'day') {
533
+ var _getChangedDay = (0, _dayChange.getChangedDay)({
534
+ day: selectedDay,
535
+ month: selectedMonth,
536
+ year: selectedYear
537
+ }, e, focusedOrders, keyActions);
538
+ newDay = _getChangedDay.day;
539
+ isValueChanged = _getChangedDay.isChanged;
540
+ newFocusOrder = _getChangedDay.focusOrder;
541
+ } else if (type === 'month') {
542
+ var _getChangedMonth = (0, _monthChange.getChangedMonth)({
543
+ day: selectedDay,
544
+ month: selectedMonth,
545
+ year: selectedYear
546
+ }, e, focusedOrders, keyActions);
547
+ newMonth = _getChangedMonth.month;
548
+ isValueChanged = _getChangedMonth.isChanged;
549
+ newFocusOrder = _getChangedMonth.focusOrder;
550
+ } else if (type === 'year') {
551
+ var _getChangedYear = (0, _yearChange.getChangedYear)({
552
+ day: selectedDay,
553
+ month: selectedMonth,
554
+ year: selectedYear
555
+ }, e, focusedOrders, keyActions, {
556
+ yearInfo: yearInfo
557
+ });
558
+ newYear = _getChangedYear.year;
559
+ isValueChanged = _getChangedYear.isChanged;
560
+ newFocusOrder = _getChangedYear.focusOrder;
561
+ } else if (type === 'hour') {
562
+ var _getChangedHour = (0, _timeChange.getChangedHour)({
563
+ hour: selectedHour
564
+ }, e, focusedOrders, keyActions, {
565
+ is24Hour: is24Hour
566
+ });
567
+ newHour = _getChangedHour.hour;
568
+ isValueChanged = _getChangedHour.isChanged;
569
+ newFocusOrder = _getChangedHour.focusOrder;
570
+ } else if (type === 'minute') {
571
+ var _getChangedMinute = (0, _timeChange.getChangedMinute)({
572
+ minute: selectedMinute
573
+ }, e, focusedOrders, keyActions);
574
+ newMinute = _getChangedMinute.minute;
575
+ isValueChanged = _getChangedMinute.isChanged;
576
+ newFocusOrder = _getChangedMinute.focusOrder;
577
+ } else if (type === 'noon') {
578
+ var _getChangedNoon = (0, _timeChange.getChangedNoon)({
579
+ noon: selectedNoon
580
+ }, e, focusedOrders, keyActions);
581
+ newNoon = _getChangedNoon.noon;
582
+ isValueChanged = _getChangedNoon.isChanged;
583
+ newFocusOrder = _getChangedNoon.focusOrder;
584
+ }
585
+ if (isValueChanged) {
586
+ var currentValue = {
587
+ day: newDay,
588
+ month: newMonth,
589
+ year: newYear,
590
+ hour: newHour,
591
+ minute: newMinute,
592
+ noon: newNoon
593
+ };
594
+ var errorCaseHandle = function errorCaseHandle(isEmptyValError) {
595
+ _this2.setState(function () {
596
+ return {
597
+ day: newDay,
598
+ month: newMonth,
599
+ year: newYear,
600
+ hour: newHour,
601
+ minute: newMinute,
602
+ noon: newNoon,
603
+ stateFocusOrder: newFocusOrder,
604
+ isDateEdited: true,
605
+ isError: !isEmptyValError
606
+ };
607
+ });
608
+ var newSelected = isEmptyValError ? '' : _constants.INVALID_DATE;
609
+ value !== newSelected && onSelect && onSelect(newSelected, id);
610
+ };
611
+ var _getIsValidDate = (0, _dateFormat.getIsValidDate)(currentValue, isDateTime, {
612
+ is24Hour: is24Hour
613
+ }),
614
+ isError = _getIsValidDate.isError,
615
+ isEmptyValError = _getIsValidDate.isEmptyValError;
616
+ if (isError) {
617
+ errorCaseHandle(isEmptyValError);
618
+ } else {
619
+ var _getSelectedDate = (0, _dateFormat.getSelectedDate)(currentValue, {
620
+ min: min,
621
+ max: max,
622
+ timeZone: timeZone,
623
+ isDateTime: isDateTime,
624
+ is24Hour: is24Hour
625
+ }),
626
+ selectedValue = _getSelectedDate.selectedValue,
627
+ selectedDateError = _getSelectedDate.isError,
628
+ errorType = _getSelectedDate.errorType;
629
+ if (selectedDateError) {
630
+ if (errorType === 'MIN') {
631
+ onError && onError(minErrorText, true);
632
+ } else if (errorType === 'MAX') {
633
+ onError && onError(maxErrorText, true);
634
+ }
635
+ errorCaseHandle();
636
+ } else {
637
+ this.setState(function () {
638
+ return {
639
+ day: '',
640
+ month: '',
641
+ year: '',
642
+ hour: '',
643
+ minute: '',
644
+ noon: '',
645
+ isDateEdited: false,
646
+ stateFocusOrder: newFocusOrder,
647
+ isError: false
648
+ };
649
+ });
650
+ onSelect && onSelect(selectedValue, id);
651
+ }
652
+ }
653
+ }
654
+ }
655
+ }, {
656
+ key: "handleSelection",
657
+ value: function handleSelection() {
658
+ var focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
659
+ var isAllowedDateType = this.handleGetAllowedType();
660
+ if (isAllowedDateType) {
661
+ var dateFormatSelection = this.state.dateFormatSelection;
662
+ var _dateFormatSelection$ = dateFormatSelection.order,
663
+ order = _dateFormatSelection$ === void 0 ? {} : _dateFormatSelection$;
664
+ var _ref2 = order[focusOrder] || {},
665
+ index = _ref2.index;
666
+ if (!index) {
667
+ focusOrder = 0;
668
+ var _ref3 = order[focusOrder] || {};
669
+ index = _ref3.index;
670
+ }
671
+ if (index && this.valueInput) {
672
+ document.getSelection().removeAllRanges();
673
+ this.valueInput.setSelectionRange(index[0], index[1]);
674
+ }
675
+ }
676
+ }
677
+ }, {
678
+ key: "handleInputClick",
679
+ value: function handleInputClick(e) {
680
+ this.isMouseDown = false;
681
+ var dateFormatSelection = this.state.dateFormatSelection;
682
+ var input = e.target;
683
+ var selectionEnd = input.selectionEnd;
684
+ e.preventDefault();
685
+ var clickIndex = dateFormatSelection.clickIndex;
686
+ var focusOrder = clickIndex[selectionEnd] || clickIndex[selectionEnd - 1] || 0;
687
+ var isAllowedDateType = this.handleGetAllowedType();
688
+ if (isAllowedDateType) {
689
+ this.setState({
690
+ stateFocusOrder: focusOrder,
691
+ isFocused: true
692
+ });
693
+ }
694
+ if (!isAllowedDateType) {
695
+ this.handleTogglePopup(e);
696
+ } else {
697
+ var _this$props6 = this.props,
698
+ isPopupOpenOnClick = _this$props6.isPopupOpenOnClick,
699
+ isReadOnly = _this$props6.isReadOnly,
700
+ isDisabled = _this$props6.isDisabled;
701
+ if (isPopupOpenOnClick && (!isReadOnly || !isDisabled)) {
702
+ this.handleTogglePopup(e, true);
703
+ }
704
+ var _this$props7 = this.props,
705
+ isPopupCloseOnClick = _this$props7.isPopupCloseOnClick,
706
+ isPopupOpen = _this$props7.isPopupOpen,
707
+ closePopupOnly = _this$props7.closePopupOnly;
708
+ if (isPopupCloseOnClick && !isPopupOpen) {
709
+ closePopupOnly && closePopupOnly(e);
710
+ }
711
+ }
712
+ }
713
+ }, {
714
+ key: "handleMouseDown",
715
+ value: function handleMouseDown() {
716
+ this.isMouseDown = true;
717
+ }
718
+ }, {
719
+ key: "handleGetShowValue",
720
+ value: function handleGetShowValue() {
721
+ var _this$state4 = this.state,
722
+ day = _this$state4.day,
723
+ month = _this$state4.month,
724
+ year = _this$state4.year,
725
+ hour = _this$state4.hour,
726
+ minute = _this$state4.minute,
727
+ noon = _this$state4.noon,
728
+ dateFormatDetails = _this$state4.dateFormatDetails,
729
+ displayText = _this$state4.displayText,
730
+ newDateFormat = _this$state4.newDateFormat,
731
+ isDateEdited = _this$state4.isDateEdited,
732
+ isFocused = _this$state4.isFocused,
733
+ selected = _this$state4.selected;
734
+ var _this$props8 = this.props,
735
+ isDateTime = _this$props8.isDateTime,
736
+ is24Hour = _this$props8.is24Hour,
737
+ isPopupReady = _this$props8.isPopupReady,
738
+ timeZone = _this$props8.timeZone,
739
+ isPopupOpen = _this$props8.isPopupOpen;
740
+ if (isDateEdited || isFocused || isPopupReady || isPopupOpen) {
741
+ var _getDateDetails2 = (0, _dateFormat.getDateDetails)(selected, {
742
+ day: day,
743
+ month: month,
744
+ year: year,
745
+ hour: hour,
746
+ minute: minute,
747
+ noon: noon
748
+ }, isDateTime, timeZone, {
749
+ is24Hour: is24Hour
750
+ }),
751
+ _getDateDetails2$day = _getDateDetails2.day,
752
+ selectedDay = _getDateDetails2$day === void 0 ? '' : _getDateDetails2$day,
753
+ _getDateDetails2$mont = _getDateDetails2.month,
754
+ selectedMonth = _getDateDetails2$mont === void 0 ? '' : _getDateDetails2$mont,
755
+ _getDateDetails2$year = _getDateDetails2.year,
756
+ selectedYear = _getDateDetails2$year === void 0 ? '' : _getDateDetails2$year,
757
+ _getDateDetails2$hour = _getDateDetails2.hour,
758
+ selectedHour = _getDateDetails2$hour === void 0 ? '' : _getDateDetails2$hour,
759
+ _getDateDetails2$minu = _getDateDetails2.minute,
760
+ selectedMinute = _getDateDetails2$minu === void 0 ? '' : _getDateDetails2$minu,
761
+ _getDateDetails2$noon = _getDateDetails2.noon,
762
+ selectedNoon = _getDateDetails2$noon === void 0 ? '' : _getDateDetails2$noon;
763
+ var dateTimeString = (0, _dateFormat.getDateTimeString)({
764
+ day: selectedDay,
765
+ month: selectedMonth,
766
+ year: selectedYear,
767
+ hour: selectedHour,
768
+ minute: selectedMinute,
769
+ noon: selectedNoon
770
+ }, dateFormatDetails, isDateTime, {
771
+ i18nShortMonths: _constants.i18nShortMonths,
772
+ i18nMonths: _constants.i18nMonths,
773
+ is24Hour: is24Hour
774
+ });
775
+ return dateTimeString;
776
+ } else if (displayText) {
777
+ return displayText;
778
+ }
779
+ var timeFormat = is24Hour ? ' HH:mm' : ' hh:mm --';
780
+ var dateTimeFormat = isDateTime ? "".concat(newDateFormat).concat(timeFormat) : newDateFormat;
781
+ return dateTimeFormat || '';
782
+ }
783
+ }, {
784
+ key: "handleGetAllowedType",
785
+ value: function handleGetAllowedType() {
786
+ var _this$props9 = this.props,
787
+ isReadOnly = _this$props9.isReadOnly,
788
+ isDisabled = _this$props9.isDisabled,
789
+ isEditable = _this$props9.isEditable;
790
+ if (isEditable) {
791
+ if (isReadOnly || isDisabled) {
792
+ return false;
793
+ }
794
+ return true;
795
+ }
796
+ return false;
797
+ }
798
+ }, {
799
+ key: "handleDateClear",
800
+ value: function handleDateClear() {
801
+ var _this$props10 = this.props,
802
+ id = _this$props10.id,
803
+ onSelect = _this$props10.onSelect,
804
+ value = _this$props10.value;
805
+ this.setState({
806
+ day: '',
807
+ month: '',
808
+ year: '',
809
+ hour: '',
810
+ minute: '',
811
+ noon: '',
812
+ isDateEdited: false,
813
+ stateFocusOrder: 0,
814
+ isError: false
815
+ });
816
+ value && onSelect && onSelect('', id);
817
+ this.valueInput && this.valueInput.focus({
818
+ preventScroll: true
819
+ });
820
+ }
821
+ }, {
822
+ key: "handleDateTimeClear",
823
+ value: function handleDateTimeClear(e) {
824
+ this.handleDateClear();
825
+ var closePopupOnly = this.props.closePopupOnly;
826
+ closePopupOnly(e);
827
+ }
828
+ }, {
829
+ key: "handleDateIconClick",
830
+ value: function handleDateIconClick(e) {
831
+ this.handleTogglePopup(e);
832
+ this.valueInput && this.valueInput.focus({
833
+ preventScroll: true
834
+ });
835
+ }
836
+ }, {
837
+ key: "handleBlurSelectionRange",
838
+ value: function handleBlurSelectionRange() {
839
+ var focusOrder = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
840
+ var oldFocusOrder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
841
+ var isAllowedDateType = this.handleGetAllowedType();
842
+ if (isAllowedDateType) {
843
+ // if (focusOrder !== oldFocusOrder) {
844
+ var _this$state$dateForma = this.state.dateFormatSelection,
845
+ dateFormatSelection = _this$state$dateForma === void 0 ? {} : _this$state$dateForma;
846
+ var _dateFormatSelection$2 = dateFormatSelection.order,
847
+ order = _dateFormatSelection$2 === void 0 ? [] : _dateFormatSelection$2;
848
+ var isPopupOpen = this.props.isPopupOpen;
849
+
850
+ // const { type: oldFocusedType = '' } = order[oldFocusOrder] || {};
851
+ var _ref4 = order[focusOrder] || {},
852
+ _ref4$type = _ref4.type,
853
+ focusedType = _ref4$type === void 0 ? '' : _ref4$type;
854
+ var _this$getDateTimeStat = this.getDateTimeStateValues(),
855
+ isYearView = _this$getDateTimeStat.isYearView,
856
+ oldIsMonthOpen = _this$getDateTimeStat.isMonthOpen;
857
+ var yearViewTypes = ['month', 'year'];
858
+ var isMonthOpen = focusedType === 'month';
859
+ if (isPopupOpen) {
860
+ if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
861
+ this.DateTimeYearViewToggle(true, isMonthOpen);
862
+ } else if (yearViewTypes.indexOf(focusedType) === -1 && isYearView) {
863
+ this.DateTimeYearViewToggle(false, false);
864
+ }
865
+ }
866
+ // }
867
+ }
868
+ }
869
+ }, {
870
+ key: "render",
871
+ value: function render() {
872
+ var _this$props11 = this.props,
873
+ removeClose = _this$props11.removeClose,
874
+ minErrorText = _this$props11.minErrorText,
875
+ maxErrorText = _this$props11.maxErrorText,
876
+ min = _this$props11.min,
877
+ max = _this$props11.max,
878
+ placeholder = _this$props11.placeholder,
879
+ isPopupOpen = _this$props11.isPopupOpen,
880
+ isPopupReady = _this$props11.isPopupReady,
881
+ isDateTime = _this$props11.isDateTime,
882
+ position = _this$props11.position,
883
+ textBoxVariant = _this$props11.textBoxVariant,
884
+ textBoxSize = _this$props11.textBoxSize,
885
+ _this$props11$childre = _this$props11.children,
886
+ children = _this$props11$childre === void 0 ? null : _this$props11$childre,
887
+ isDisabled = _this$props11.isDisabled,
888
+ getContainerRef = _this$props11.getContainerRef,
889
+ getTargetRef = _this$props11.getTargetRef,
890
+ timeZone = _this$props11.timeZone,
891
+ isReadOnly = _this$props11.isReadOnly,
892
+ dataId = _this$props11.dataId,
893
+ needResponsive = _this$props11.needResponsive,
894
+ className = _this$props11.className,
895
+ needBorder = _this$props11.needBorder,
896
+ defaultTime = _this$props11.defaultTime,
897
+ needDefaultTime = _this$props11.needDefaultTime,
898
+ borderColor = _this$props11.borderColor,
899
+ i18nKeys = _this$props11.i18nKeys,
900
+ needErrorOnBlur = _this$props11.needErrorOnBlur,
901
+ htmlId = _this$props11.htmlId,
902
+ iconOnHover = _this$props11.iconOnHover,
903
+ is24Hour = _this$props11.is24Hour,
904
+ isAbsolutePositioningNeeded = _this$props11.isAbsolutePositioningNeeded,
905
+ positionsOffset = _this$props11.positionsOffset,
906
+ targetOffset = _this$props11.targetOffset,
907
+ isRestrictScroll = _this$props11.isRestrictScroll,
908
+ dropBoxPortalId = _this$props11.dropBoxPortalId;
909
+ var _this$state5 = this.state,
910
+ _this$state5$selected = _this$state5.selected,
911
+ value = _this$state5$selected === void 0 ? '' : _this$state5$selected,
912
+ isError = _this$state5.isError,
913
+ isDateEdited = _this$state5.isDateEdited,
914
+ isFocused = _this$state5.isFocused;
915
+ var showValue = this.handleGetShowValue();
916
+ var isAllowedDateType = this.handleGetAllowedType();
917
+ var showClear = !(isDisabled || isReadOnly) && (isDateEdited || value) ? true : false;
918
+ var showError = needErrorOnBlur ? isError && !isFocused && !isPopupOpen : isError;
919
+ return /*#__PURE__*/_react["default"].createElement("div", {
920
+ className: "".concat(_DateWidgetModule["default"].container)
921
+ }, children ? /*#__PURE__*/_react["default"].createElement("div", {
922
+ "data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : "".concat(dataId, "_widget")),
923
+ onClick: isDisabled || isReadOnly ? null : this.handleTogglePopup,
924
+ ref: getTargetRef,
925
+ className: "".concat(className ? className : '', " ").concat(isDisabled ? _DateWidgetModule["default"].disabled : _DateWidgetModule["default"].enabled)
926
+ }, children) : /*#__PURE__*/_react["default"].createElement("div", {
927
+ "data-id": "".concat(isDisabled ? "".concat(dataId, "_disabled") : isReadOnly ? "".concat(dataId, "_readOnly") : "".concat(dataId, "_widget")),
928
+ 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),
929
+ onClick: !isAllowedDateType ? isDisabled || isReadOnly ? null : this.handleTogglePopup : null,
930
+ ref: getTargetRef
931
+ }, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
932
+ htmlId: htmlId,
933
+ value: showValue ? showValue : placeholder,
934
+ needBorder: needBorder,
935
+ size: textBoxSize,
936
+ variant: textBoxVariant,
937
+ inputRef: this.getValueInputRef,
938
+ isDisabled: isDisabled,
939
+ dataId: dataId,
940
+ needReadOnlyStyle: isReadOnly || isDisabled,
941
+ onKeyDown: this.handleKeyDown,
942
+ onFocus: this.handleFocus,
943
+ borderColor: showError ? 'error' : borderColor,
944
+ needEffect: !(isDisabled || isReadOnly || showError),
945
+ isClickable: true,
946
+ onClick: isDisabled || isReadOnly ? null : this.handleInputClick,
947
+ onBlur: this.handleBlur,
948
+ onClear: showClear ? this.handleDateClear : null,
949
+ isReadOnly: isReadOnly,
950
+ onMouseDown: this.handleMouseDown,
951
+ showClearIcon: showClear,
952
+ customClass: {
953
+ customTBoxWrap: isDateEdited || value ? '' : _DateWidgetModule["default"].placeHolder
954
+ },
955
+ iconOnHover: iconOnHover,
956
+ isFocus: isPopupReady,
957
+ autoComplete: false
958
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
959
+ align: "both",
960
+ onClick: isDisabled || isReadOnly ? null : this.handleDateIconClick
961
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
962
+ name: "ZD-datepicker",
963
+ size: "12"
964
+ })))), isReadOnly || isDisabled ? null : /*#__PURE__*/_react["default"].createElement(_DateTime["default"], {
965
+ value: value,
966
+ isDateTimeField: isDateTime,
967
+ onSelect: this.handleSelect,
968
+ timeZone: timeZone,
969
+ min: min,
970
+ max: max,
971
+ maxErrorText: maxErrorText,
972
+ minErrorText: minErrorText,
973
+ position: position,
974
+ isReady: isPopupOpen,
975
+ isActive: isPopupReady,
976
+ getRef: getContainerRef,
977
+ onClick: removeClose,
978
+ needResponsive: needResponsive,
979
+ dataId: dataId,
980
+ defaultTime: defaultTime,
981
+ needDefaultTime: needDefaultTime,
982
+ getMethods: this.handleGetMethods,
983
+ onClear: this.handleDateTimeClear,
984
+ needAction: isDateTime,
985
+ onDateSelect: !isDateTime ? this.handleSelect : null,
986
+ i18nKeys: i18nKeys,
987
+ is24Hour: is24Hour,
988
+ isAbsolute: isAbsolutePositioningNeeded,
989
+ positionsOffset: positionsOffset,
990
+ targetOffset: targetOffset,
991
+ isRestrictScroll: isRestrictScroll,
992
+ dropBoxPortalId: dropBoxPortalId
993
+ }));
994
+ }
995
+ }]);
996
+ return DateWidgetComponent;
997
+ }(_react["default"].Component);
998
+ DateWidgetComponent.defaultProps = _defaultProps.DateWidget_defaultProps;
999
+ DateWidgetComponent.propTypes = _propTypes.DateWidget_propTypes;
1000
+ var DateWidget = (0, _Popup["default"])(DateWidgetComponent);
1001
+ DateWidget.defaultProps = DateWidgetComponent.defaultProps;
1002
+
1003
+ // eslint-disable-next-line no-undef
1004
+ if (false) {
1005
+ DateWidgetComponent.docs = {
1006
+ componentGroup: 'Form Elements',
1007
+ folderName: 'Style Guide',
1008
+ external: true,
1009
+ description: ' '
1010
+ };
1011
+ // eslint-disable-next-line react/forbid-foreign-prop-types
1012
+ DateWidget.propTypes = DateWidgetComponent.propTypes;
1013
+ }
1014
+ var _default = DateWidget;
1015
+ exports["default"] = _default;