@zohodesk/components 1.0.0-temp-83 → 1.0.0-temp-107

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 (464) hide show
  1. package/es/Avatar/Avatar.js +3 -1
  2. package/es/Avatar/Avatar.module.css +11 -23
  3. package/es/AvatarTeam/AvatarTeam.module.css +7 -21
  4. package/es/Button/Button.js +3 -5
  5. package/es/Button/Button.module.css +24 -97
  6. package/es/Buttongroup/Buttongroup.module.css +8 -37
  7. package/es/CheckBox/CheckBox.module.css +11 -17
  8. package/es/DateTime/CalendarView.js +4 -2
  9. package/es/DateTime/DateTime.module.css +13 -44
  10. package/es/DateTime/DateTimePopupHeader.js +24 -9
  11. package/es/DateTime/DateWidget.js +4 -2
  12. package/es/DateTime/DateWidget.module.css +5 -9
  13. package/es/DateTime/DaysRow.js +5 -2
  14. package/es/DateTime/YearView.js +12 -4
  15. package/es/DateTime/YearView.module.css +23 -18
  16. package/es/DropBox/DropBox.js +4 -24
  17. package/es/DropBox/DropBox.module.css +11 -47
  18. package/es/DropBox/props/defaultProps.js +1 -2
  19. package/es/DropBox/props/propTypes.js +0 -1
  20. package/es/DropDown/DropDownHeading.js +3 -1
  21. package/es/DropDown/DropDownHeading.module.css +3 -7
  22. package/es/DropDown/DropDownItem.module.css +6 -32
  23. package/es/DropDown/props/propTypes.js +2 -1
  24. package/es/FramerAnimation/FramerAnimation.js +206 -0
  25. package/es/FramerAnimation/docs/FramerAnimation__default.docs.js +123 -0
  26. package/es/Label/Label.js +4 -2
  27. package/es/ListItem/ListContainer.js +3 -2
  28. package/es/ListItem/ListItem.js +2 -1
  29. package/es/ListItem/ListItem.module.css +25 -57
  30. package/es/MultiSelect/MultiSelect.js +4 -2
  31. package/es/MultiSelect/MultiSelect.module.css +11 -28
  32. package/es/MultiSelect/SelectedOptions.module.css +2 -8
  33. package/es/MultiSelect/Suggestions.js +2 -1
  34. package/es/PopOver/PopOver.module.css +1 -1
  35. package/es/Radio/Radio.module.css +4 -10
  36. package/es/Responsive/docs/style.module.css +8 -17
  37. package/es/Ribbon/Ribbon.module.css +28 -93
  38. package/es/RippleEffect/RippleEffect.module.css +27 -9
  39. package/es/Select/Select.js +7 -4
  40. package/es/Select/Select.module.css +2 -12
  41. package/es/Select/SelectWithIcon.js +2 -1
  42. package/es/Stencils/Stencils.module.css +3 -21
  43. package/es/Switch/Switch.js +5 -7
  44. package/es/Switch/Switch.module.css +7 -6
  45. package/es/Tab/Tab.js +2 -1
  46. package/es/Tab/Tab.module.css +7 -16
  47. package/es/Tab/TabContent.js +1 -1
  48. package/es/Tab/Tabs.js +9 -10
  49. package/es/Tab/Tabs.module.css +8 -42
  50. package/es/Tab/docs/tabdocs.module.css +1 -1
  51. package/es/Tag/Tag.module.css +14 -36
  52. package/es/TextBox/TextBox.module.css +11 -7
  53. package/es/TextBoxIcon/TextBoxIcon.module.css +5 -12
  54. package/es/Textarea/Textarea.module.css +7 -6
  55. package/es/Tooltip/Tooltip.module.css +8 -9
  56. package/es/common/animation.module.css +21 -219
  57. package/es/common/basicReset.module.css +12 -2
  58. package/es/common/common.module.css +18 -64
  59. package/es/common/customscroll.module.css +21 -17
  60. package/es/common/docStyle.module.css +32 -79
  61. package/es/common/transition.module.css +10 -50
  62. package/es/deprecated/AdvancedMultiSelect.module.css +8 -22
  63. package/es/semantic/Button/semanticButton.module.css +3 -3
  64. package/package.json +2 -3
  65. package/lib/Accordion/Accordion.js +0 -102
  66. package/lib/Accordion/AccordionItem.js +0 -84
  67. package/lib/Accordion/__tests__/Accordion.spec.js +0 -82
  68. package/lib/Accordion/docs/Accordion__Demo.docs.js +0 -104
  69. package/lib/Accordion/index.js +0 -20
  70. package/lib/Accordion/props/defaultProps.js +0 -16
  71. package/lib/Accordion/props/propTypes.js +0 -39
  72. package/lib/Animation/Animation.js +0 -161
  73. package/lib/Animation/__tests__/Animation.spec.js +0 -19
  74. package/lib/Animation/docs/Animation__default.docs.js +0 -61
  75. package/lib/Animation/docs/Animation__fadeIn.docs.js +0 -61
  76. package/lib/Animation/docs/Animation__scaleIn.docs.js +0 -61
  77. package/lib/Animation/docs/Animation__skewIn.docs.js +0 -61
  78. package/lib/Animation/docs/Animation__slideDown.docs.js +0 -61
  79. package/lib/Animation/docs/Animation__slideLeft.docs.js +0 -61
  80. package/lib/Animation/docs/Animation__zoomIn.docs.js +0 -61
  81. package/lib/Animation/props/defaultProps.js +0 -14
  82. package/lib/Animation/props/propTypes.js +0 -20
  83. package/lib/AppContainer/AppContainer.js +0 -156
  84. package/lib/AppContainer/AppContainer.module.css +0 -18
  85. package/lib/AppContainer/docs/AppContainer__default.docs.js +0 -47
  86. package/lib/AppContainer/props/defaultProps.js +0 -15
  87. package/lib/AppContainer/props/propTypes.js +0 -23
  88. package/lib/Avatar/Avatar.js +0 -199
  89. package/lib/Avatar/Avatar.module.css +0 -135
  90. package/lib/Avatar/__tests__/Avatar.spec.js +0 -164
  91. package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +0 -288
  92. package/lib/Avatar/docs/Avatar__custom.docs.js +0 -62
  93. package/lib/Avatar/docs/Avatar__default.docs.js +0 -60
  94. package/lib/Avatar/docs/Avatar__palette.docs.js +0 -82
  95. package/lib/Avatar/docs/Avatar__text.docs.js +0 -61
  96. package/lib/Avatar/props/defaultProps.js +0 -21
  97. package/lib/Avatar/props/propTypes.js +0 -31
  98. package/lib/AvatarTeam/AvatarTeam.js +0 -99
  99. package/lib/AvatarTeam/AvatarTeam.module.css +0 -161
  100. package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -79
  101. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +0 -226
  102. package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -100
  103. package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -58
  104. package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -77
  105. package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -76
  106. package/lib/AvatarTeam/props/defaultProps.js +0 -20
  107. package/lib/AvatarTeam/props/propTypes.js +0 -31
  108. package/lib/Button/Button.js +0 -92
  109. package/lib/Button/Button.module.css +0 -522
  110. package/lib/Button/__tests__/Button.spec.js +0 -193
  111. package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
  112. package/lib/Button/docs/Button__custom.docs.js +0 -800
  113. package/lib/Button/docs/Button__default.docs.js +0 -565
  114. package/lib/Button/props/defaultProps.js +0 -22
  115. package/lib/Button/props/propTypes.js +0 -30
  116. package/lib/Buttongroup/Buttongroup.js +0 -69
  117. package/lib/Buttongroup/Buttongroup.module.css +0 -89
  118. package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -76
  119. package/lib/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +0 -146
  120. package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +0 -64
  121. package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +0 -60
  122. package/lib/Buttongroup/docs/Buttongroup__header.docs.js +0 -71
  123. package/lib/Buttongroup/props/defaultProps.js +0 -11
  124. package/lib/Buttongroup/props/propTypes.js +0 -15
  125. package/lib/Card/Card.js +0 -301
  126. package/lib/Card/Card.module.css +0 -20
  127. package/lib/Card/__tests__/Card.spec.js +0 -47
  128. package/lib/Card/docs/Card__Custom.docs.js +0 -63
  129. package/lib/Card/docs/Card__Default.docs.js +0 -66
  130. package/lib/Card/docs/Card__Scroll.docs.js +0 -87
  131. package/lib/Card/index.js +0 -33
  132. package/lib/Card/props/defaultProps.js +0 -23
  133. package/lib/Card/props/propTypes.js +0 -54
  134. package/lib/CheckBox/CheckBox.js +0 -183
  135. package/lib/CheckBox/CheckBox.module.css +0 -157
  136. package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -15
  137. package/lib/CheckBox/docs/CheckBox__custom.docs.js +0 -323
  138. package/lib/CheckBox/docs/CheckBox__default.docs.js +0 -249
  139. package/lib/CheckBox/props/defaultProps.js +0 -25
  140. package/lib/CheckBox/props/propTypes.js +0 -49
  141. package/lib/DateTime/CalendarView.js +0 -227
  142. package/lib/DateTime/DateTime.js +0 -779
  143. package/lib/DateTime/DateTime.module.css +0 -233
  144. package/lib/DateTime/DateTimePopupFooter.js +0 -65
  145. package/lib/DateTime/DateTimePopupHeader.js +0 -117
  146. package/lib/DateTime/DateWidget.js +0 -1015
  147. package/lib/DateTime/DateWidget.module.css +0 -38
  148. package/lib/DateTime/DaysRow.js +0 -52
  149. package/lib/DateTime/Time.js +0 -205
  150. package/lib/DateTime/YearView.js +0 -267
  151. package/lib/DateTime/YearView.module.css +0 -81
  152. package/lib/DateTime/__tests__/CalendarView.spec.js +0 -37
  153. package/lib/DateTime/__tests__/DateTime.spec.js +0 -113
  154. package/lib/DateTime/__tests__/DateWidget.spec.js +0 -79
  155. package/lib/DateTime/common.js +0 -30
  156. package/lib/DateTime/constants.js +0 -76
  157. package/lib/DateTime/dateFormatUtils/dateFormat.js +0 -551
  158. package/lib/DateTime/dateFormatUtils/dayChange.js +0 -74
  159. package/lib/DateTime/dateFormatUtils/index.js +0 -225
  160. package/lib/DateTime/dateFormatUtils/monthChange.js +0 -84
  161. package/lib/DateTime/dateFormatUtils/timeChange.js +0 -208
  162. package/lib/DateTime/dateFormatUtils/yearChange.js +0 -108
  163. package/lib/DateTime/docs/DateTime__default.docs.js +0 -119
  164. package/lib/DateTime/docs/DateWidget__default.docs.js +0 -212
  165. package/lib/DateTime/docs/timezonedata.json +0 -1
  166. package/lib/DateTime/index.js +0 -13
  167. package/lib/DateTime/objectUtils.js +0 -72
  168. package/lib/DateTime/props/defaultProps.js +0 -61
  169. package/lib/DateTime/props/propTypes.js +0 -144
  170. package/lib/DateTime/typeChecker.js +0 -22
  171. package/lib/DateTime/validator.js +0 -290
  172. package/lib/DropBox/DropBox.js +0 -286
  173. package/lib/DropBox/DropBox.module.css +0 -406
  174. package/lib/DropBox/DropBoxPositionMapping.json +0 -145
  175. package/lib/DropBox/__tests__/DropBox.spec.js +0 -83
  176. package/lib/DropBox/docs/DropBox__custom.docs.js +0 -97
  177. package/lib/DropBox/docs/DropBox__customOrder.docs.js +0 -114
  178. package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +0 -113
  179. package/lib/DropBox/docs/DropBox__position.docs.js +0 -118
  180. package/lib/DropBox/docs/DropBox__size.docs.js +0 -92
  181. package/lib/DropBox/props/defaultProps.js +0 -28
  182. package/lib/DropBox/props/propTypes.js +0 -56
  183. package/lib/DropDown/DropDown.js +0 -127
  184. package/lib/DropDown/DropDown.module.css +0 -5
  185. package/lib/DropDown/DropDownHeading.js +0 -64
  186. package/lib/DropDown/DropDownHeading.module.css +0 -53
  187. package/lib/DropDown/DropDownItem.js +0 -102
  188. package/lib/DropDown/DropDownItem.module.css +0 -94
  189. package/lib/DropDown/DropDownSearch.js +0 -88
  190. package/lib/DropDown/DropDownSearch.module.css +0 -14
  191. package/lib/DropDown/DropDownSeparator.js +0 -42
  192. package/lib/DropDown/DropDownSeparator.module.css +0 -7
  193. package/lib/DropDown/__tests__/DropDown.spec.js +0 -44
  194. package/lib/DropDown/__tests__/DropDownItem.spec.js +0 -46
  195. package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -14
  196. package/lib/DropDown/docs/DropDownHeading__custom.docs.js +0 -50
  197. package/lib/DropDown/docs/DropDownHeading__default.docs.js +0 -48
  198. package/lib/DropDown/props/defaultProps.js +0 -28
  199. package/lib/DropDown/props/propTypes.js +0 -89
  200. package/lib/Heading/Heading.js +0 -64
  201. package/lib/Heading/Heading.module.css +0 -5
  202. package/lib/Heading/docs/Heading__default.docs.js +0 -50
  203. package/lib/Heading/props/defaultProps.js +0 -12
  204. package/lib/Heading/props/propTypes.js +0 -19
  205. package/lib/Label/Label.js +0 -65
  206. package/lib/Label/Label.module.css +0 -52
  207. package/lib/Label/LabelColors.module.css +0 -21
  208. package/lib/Label/__tests__/Label.spec.js +0 -124
  209. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -101
  210. package/lib/Label/docs/Label__clipped.docs.js +0 -56
  211. package/lib/Label/docs/Label__custom.docs.js +0 -59
  212. package/lib/Label/docs/Label__palette.docs.js +0 -71
  213. package/lib/Label/docs/Label__size.docs.js +0 -58
  214. package/lib/Label/docs/Label__type.docs.js +0 -66
  215. package/lib/Label/props/defaultProps.js +0 -17
  216. package/lib/Label/props/propTypes.js +0 -22
  217. package/lib/Layout/Box.js +0 -104
  218. package/lib/Layout/Container.js +0 -122
  219. package/lib/Layout/Layout.module.css +0 -336
  220. package/lib/Layout/__tests__/Box.spec.js +0 -105
  221. package/lib/Layout/__tests__/Container.spec.js +0 -110
  222. package/lib/Layout/docs/Layout__Hidden.docs.js +0 -105
  223. package/lib/Layout/docs/Layout__default.docs.js +0 -77
  224. package/lib/Layout/docs/Layout__four_Column.docs.js +0 -107
  225. package/lib/Layout/docs/Layout__three_Column.docs.js +0 -104
  226. package/lib/Layout/docs/Layout__two_Column.docs.js +0 -97
  227. package/lib/Layout/index.js +0 -30
  228. package/lib/Layout/props/defaultProps.js +0 -20
  229. package/lib/Layout/props/propTypes.js +0 -51
  230. package/lib/Layout/utils.js +0 -45
  231. package/lib/LightNightMode/Colors.json +0 -497
  232. package/lib/LightNightMode/docs/AlternativeColors.docs.js +0 -128
  233. package/lib/ListItem/ListContainer.js +0 -94
  234. package/lib/ListItem/ListItem.js +0 -153
  235. package/lib/ListItem/ListItem.module.css +0 -209
  236. package/lib/ListItem/ListItemWithAvatar.js +0 -175
  237. package/lib/ListItem/ListItemWithCheckBox.js +0 -141
  238. package/lib/ListItem/ListItemWithIcon.js +0 -158
  239. package/lib/ListItem/ListItemWithRadio.js +0 -143
  240. package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -182
  241. package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -139
  242. package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -118
  243. package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -92
  244. package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -95
  245. package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +0 -89
  246. package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -118
  247. package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +0 -92
  248. package/lib/ListItem/docs/ListItem__custom.docs.js +0 -141
  249. package/lib/ListItem/docs/ListItem__default.docs.js +0 -109
  250. package/lib/ListItem/props/defaultProps.js +0 -97
  251. package/lib/ListItem/props/propTypes.js +0 -176
  252. package/lib/Modal/Modal.js +0 -174
  253. package/lib/Modal/__docs__/Modal__default.docs.js +0 -65
  254. package/lib/Modal/props/defaultProps.js +0 -10
  255. package/lib/Modal/props/propTypes.js +0 -14
  256. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +0 -1032
  257. package/lib/MultiSelect/AdvancedMultiSelect.js +0 -552
  258. package/lib/MultiSelect/EmptyState.js +0 -85
  259. package/lib/MultiSelect/MultiSelect.js +0 -1044
  260. package/lib/MultiSelect/MultiSelect.module.css +0 -206
  261. package/lib/MultiSelect/MultiSelectHeader.js +0 -55
  262. package/lib/MultiSelect/MultiSelectWithAvatar.js +0 -304
  263. package/lib/MultiSelect/SelectedOptions.js +0 -97
  264. package/lib/MultiSelect/SelectedOptions.module.css +0 -15
  265. package/lib/MultiSelect/Suggestions.js +0 -158
  266. package/lib/MultiSelect/__tests__/MultiSelect.spec.js +0 -159
  267. package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -154
  268. package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -140
  269. package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -165
  270. package/lib/MultiSelect/docs/MultiSelect__default.docs.js +0 -186
  271. package/lib/MultiSelect/props/defaultProps.js +0 -158
  272. package/lib/MultiSelect/props/propTypes.js +0 -377
  273. package/lib/PopOver/PopOver.js +0 -252
  274. package/lib/PopOver/PopOver.module.css +0 -8
  275. package/lib/PopOver/__tests__/PopOver.spec.js +0 -17
  276. package/lib/PopOver/docs/PopOver__default.docs.js +0 -61
  277. package/lib/PopOver/props/defaultProps.js +0 -15
  278. package/lib/PopOver/props/propTypes.js +0 -63
  279. package/lib/Popup/Popup.js +0 -640
  280. package/lib/Popup/PositionMapping.json +0 -74
  281. package/lib/Popup/__tests__/Popup.spec.js +0 -155
  282. package/lib/Popup/viewPort.js +0 -354
  283. package/lib/Provider/AvatarSize.js +0 -19
  284. package/lib/Provider/Config.js +0 -25
  285. package/lib/Provider/CssProvider.js +0 -23
  286. package/lib/Provider/IdProvider.js +0 -68
  287. package/lib/Provider/LibraryContext.js +0 -54
  288. package/lib/Provider/LibraryContextInit.js +0 -11
  289. package/lib/Provider/NumberGenerator/NumberGenerator.js +0 -145
  290. package/lib/Provider/ZindexProvider.js +0 -57
  291. package/lib/Provider/docs/Provider_Id__Class.docs.js +0 -56
  292. package/lib/Provider/docs/Provider_Id__Function.docs.js +0 -24
  293. package/lib/Provider/docs/Provider_Zindex__Class.docs.js +0 -59
  294. package/lib/Provider/docs/Provider_Zindex__Function.docs.js +0 -29
  295. package/lib/Provider.js +0 -116
  296. package/lib/Radio/Radio.js +0 -146
  297. package/lib/Radio/Radio.module.css +0 -112
  298. package/lib/Radio/__tests__/Radiospec.js +0 -25
  299. package/lib/Radio/docs/Radio__custom.docs.js +0 -273
  300. package/lib/Radio/docs/Radio__default.docs.js +0 -197
  301. package/lib/Radio/props/defaultProps.js +0 -21
  302. package/lib/Radio/props/propTypes.js +0 -40
  303. package/lib/Responsive/CustomResponsive.js +0 -192
  304. package/lib/Responsive/RefWrapper.js +0 -47
  305. package/lib/Responsive/ResizeComponent.js +0 -237
  306. package/lib/Responsive/ResizeObserver.js +0 -151
  307. package/lib/Responsive/Responsive.js +0 -222
  308. package/lib/Responsive/docs/Responsive__Custom.docs.js +0 -247
  309. package/lib/Responsive/docs/Responsive__default.docs.js +0 -118
  310. package/lib/Responsive/docs/style.module.css +0 -56
  311. package/lib/Responsive/index.js +0 -28
  312. package/lib/Responsive/props/defaultProps.js +0 -23
  313. package/lib/Responsive/props/propTypes.js +0 -36
  314. package/lib/Responsive/sizeObservers.js +0 -176
  315. package/lib/Responsive/utils/index.js +0 -62
  316. package/lib/Responsive/utils/shallowCompare.js +0 -29
  317. package/lib/Responsive/windowResizeObserver.js +0 -55
  318. package/lib/ResponsiveDropBox/ResponsiveDropBox.js +0 -94
  319. package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +0 -6
  320. package/lib/ResponsiveDropBox/props/defaultProps.js +0 -11
  321. package/lib/ResponsiveDropBox/props/propTypes.js +0 -15
  322. package/lib/Ribbon/Ribbon.js +0 -71
  323. package/lib/Ribbon/Ribbon.module.css +0 -377
  324. package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -171
  325. package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +0 -163
  326. package/lib/Ribbon/docs/Ribbon__custom.docs.js +0 -414
  327. package/lib/Ribbon/docs/Ribbon__default.docs.js +0 -370
  328. package/lib/Ribbon/props/defaultProps.js +0 -15
  329. package/lib/Ribbon/props/propTypes.js +0 -18
  330. package/lib/RippleEffect/RippleEffect.js +0 -35
  331. package/lib/RippleEffect/RippleEffect.module.css +0 -92
  332. package/lib/RippleEffect/docs/RippleEffect__default.docs.js +0 -462
  333. package/lib/RippleEffect/props/defaultProps.js +0 -16
  334. package/lib/RippleEffect/props/propTypes.js +0 -19
  335. package/lib/Select/GroupSelect.js +0 -771
  336. package/lib/Select/Select.js +0 -910
  337. package/lib/Select/Select.module.css +0 -109
  338. package/lib/Select/SelectWithAvatar.js +0 -340
  339. package/lib/Select/SelectWithIcon.js +0 -530
  340. package/lib/Select/__tests__/Select.spec.js +0 -341
  341. package/lib/Select/docs/GroupSelect__default.docs.js +0 -173
  342. package/lib/Select/docs/SelectWithAvatar__default.docs.js +0 -124
  343. package/lib/Select/docs/SelectWithIcon__default.docs.js +0 -165
  344. package/lib/Select/docs/Select__default.docs.js +0 -313
  345. package/lib/Select/props/defaultProps.js +0 -112
  346. package/lib/Select/props/propTypes.js +0 -280
  347. package/lib/Stencils/Stencils.js +0 -57
  348. package/lib/Stencils/Stencils.module.css +0 -96
  349. package/lib/Stencils/__tests__/Stencils.spec.js +0 -72
  350. package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +0 -49
  351. package/lib/Stencils/docs/Stencils__custom.docs.js +0 -72
  352. package/lib/Stencils/docs/Stencils__default.docs.js +0 -77
  353. package/lib/Stencils/props/defaultProps.js +0 -13
  354. package/lib/Stencils/props/propTypes.js +0 -15
  355. package/lib/Switch/Switch.js +0 -125
  356. package/lib/Switch/Switch.module.css +0 -111
  357. package/lib/Switch/docs/Switch__custom.docs.js +0 -180
  358. package/lib/Switch/docs/Switch__default.docs.js +0 -134
  359. package/lib/Switch/props/defaultProps.js +0 -17
  360. package/lib/Switch/props/propTypes.js +0 -35
  361. package/lib/Tab/Tab.js +0 -116
  362. package/lib/Tab/Tab.module.css +0 -101
  363. package/lib/Tab/TabContent.js +0 -33
  364. package/lib/Tab/TabContent.module.css +0 -4
  365. package/lib/Tab/TabContentWrapper.js +0 -33
  366. package/lib/Tab/TabWrapper.js +0 -69
  367. package/lib/Tab/Tabs.js +0 -586
  368. package/lib/Tab/Tabs.module.css +0 -141
  369. package/lib/Tab/__tests__/Tab.spec.js +0 -119
  370. package/lib/Tab/__tests__/TabContent.spec.js +0 -18
  371. package/lib/Tab/__tests__/TabContentWrapper.spec.js +0 -51
  372. package/lib/Tab/__tests__/TabWrapper.spec.js +0 -88
  373. package/lib/Tab/__tests__/Tabs.spec.js +0 -109
  374. package/lib/Tab/docs/Tab__default.docs.js +0 -283
  375. package/lib/Tab/docs/tabdocs.module.css +0 -29
  376. package/lib/Tab/index.js +0 -41
  377. package/lib/Tab/props/defaultProps.js +0 -50
  378. package/lib/Tab/props/propTypes.js +0 -114
  379. package/lib/Tag/Tag.js +0 -177
  380. package/lib/Tag/Tag.module.css +0 -255
  381. package/lib/Tag/__tests__/Tag.spec.js +0 -29
  382. package/lib/Tag/docs/Tag__custom.docs.js +0 -397
  383. package/lib/Tag/docs/Tag__default.docs.js +0 -352
  384. package/lib/Tag/props/defaultProps.js +0 -20
  385. package/lib/Tag/props/propTypes.js +0 -42
  386. package/lib/TextBox/TextBox.js +0 -193
  387. package/lib/TextBox/TextBox.module.css +0 -157
  388. package/lib/TextBox/__tests__/TextBox.spec.js +0 -195
  389. package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +0 -127
  390. package/lib/TextBox/docs/TextBox__custom.docs.js +0 -72
  391. package/lib/TextBox/docs/TextBox__default.docs.js +0 -69
  392. package/lib/TextBox/docs/TextBox__size.docs.js +0 -67
  393. package/lib/TextBox/docs/TextBox__variant.docs.js +0 -67
  394. package/lib/TextBox/props/defaultProps.js +0 -26
  395. package/lib/TextBox/props/propTypes.js +0 -57
  396. package/lib/TextBoxIcon/TextBoxIcon.js +0 -187
  397. package/lib/TextBoxIcon/TextBoxIcon.module.css +0 -78
  398. package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -219
  399. package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +0 -334
  400. package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -118
  401. package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -90
  402. package/lib/TextBoxIcon/props/defaultProps.js +0 -28
  403. package/lib/TextBoxIcon/props/propTypes.js +0 -57
  404. package/lib/Textarea/Textarea.js +0 -130
  405. package/lib/Textarea/Textarea.module.css +0 -139
  406. package/lib/Textarea/__tests__/Textarea.spec.js +0 -174
  407. package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +0 -97
  408. package/lib/Textarea/docs/Textarea__animated.docs.js +0 -70
  409. package/lib/Textarea/docs/Textarea__custom.docs.js +0 -111
  410. package/lib/Textarea/docs/Textarea__default.docs.js +0 -105
  411. package/lib/Textarea/docs/Textarea__disabled.docs.js +0 -58
  412. package/lib/Textarea/props/defaultProps.js +0 -23
  413. package/lib/Textarea/props/propTypes.js +0 -39
  414. package/lib/Tooltip/Tooltip.js +0 -519
  415. package/lib/Tooltip/Tooltip.module.css +0 -109
  416. package/lib/Tooltip/__tests__/Tooltip.spec.js +0 -75
  417. package/lib/Tooltip/docs/Tooltip__default.docs.js +0 -402
  418. package/lib/Tooltip/props/defaultProps.js +0 -11
  419. package/lib/Tooltip/props/propTypes.js +0 -16
  420. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -100
  421. package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -123
  422. package/lib/VelocityAnimation/VelocityAnimation/props/defaultProps.js +0 -14
  423. package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -20
  424. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +0 -131
  425. package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -174
  426. package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +0 -22
  427. package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -27
  428. package/lib/common/animation.module.css +0 -624
  429. package/lib/common/avatarsizes.module.css +0 -45
  430. package/lib/common/basic.module.css +0 -33
  431. package/lib/common/basicReset.module.css +0 -40
  432. package/lib/common/common.module.css +0 -525
  433. package/lib/common/customscroll.module.css +0 -89
  434. package/lib/common/docStyle.module.css +0 -766
  435. package/lib/common/reset.module.css +0 -12
  436. package/lib/common/transition.module.css +0 -146
  437. package/lib/css.js +0 -42
  438. package/lib/deprecated/AdvancedMultiSelect.module.css +0 -127
  439. package/lib/deprecated/PortalLayer/PortalLayer.js +0 -126
  440. package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -111
  441. package/lib/deprecated/PortalLayer/props/defaultProps.js +0 -12
  442. package/lib/deprecated/PortalLayer/props/propTypes.js +0 -19
  443. package/lib/deprecated/advancedMultiSelectVariableJson.js +0 -82
  444. package/lib/index.js +0 -1245
  445. package/lib/semantic/Button/Button.js +0 -81
  446. package/lib/semantic/Button/docs/Button__default.docs.js +0 -43
  447. package/lib/semantic/Button/props/defaultProps.js +0 -19
  448. package/lib/semantic/Button/props/propTypes.js +0 -34
  449. package/lib/semantic/Button/semanticButton.module.css +0 -9
  450. package/lib/utils/Common.js +0 -391
  451. package/lib/utils/ContextOptimizer.js +0 -43
  452. package/lib/utils/__tests__/constructFullName.spec.js +0 -11
  453. package/lib/utils/__tests__/debounce.spec.js +0 -39
  454. package/lib/utils/__tests__/getInitial.spec.js +0 -25
  455. package/lib/utils/constant.js +0 -10
  456. package/lib/utils/constructFullName.js +0 -25
  457. package/lib/utils/datetime/common.js +0 -206
  458. package/lib/utils/debounce.js +0 -25
  459. package/lib/utils/dropDownUtils.js +0 -491
  460. package/lib/utils/dummyFunction.js +0 -8
  461. package/lib/utils/getHTMLFontSize.js +0 -10
  462. package/lib/utils/getInitial.js +0 -27
  463. package/lib/utils/scrollTo.js +0 -20
  464. package/lib/utils/shallowEqual.js +0 -33
@@ -1,1015 +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
- 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;