@zohodesk/components 1.0.0-temp-84 → 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 (600) hide show
  1. package/README.md +1102 -1102
  2. package/assets/Appearance/dark/mode/darkMode.module.css +168 -168
  3. package/assets/Appearance/dark/themes/blue/blueDarkCTATheme.module.css +32 -32
  4. package/assets/Appearance/dark/themes/green/greenDarkCTATheme.module.css +32 -32
  5. package/assets/Appearance/dark/themes/orange/orangeDarkCTATheme.module.css +32 -32
  6. package/assets/Appearance/dark/themes/red/redDarkCTATheme.module.css +32 -32
  7. package/assets/Appearance/dark/themes/yellow/yellowDarkCTATheme.module.css +32 -32
  8. package/assets/Appearance/default/mode/defaultMode.module.css +164 -164
  9. package/assets/Appearance/default/themes/blue/blueDefaultCTATheme.module.css +32 -32
  10. package/assets/Appearance/default/themes/green/greenDefaultCTATheme.module.css +32 -32
  11. package/assets/Appearance/default/themes/orange/orangeDefaultCTATheme.module.css +32 -32
  12. package/assets/Appearance/default/themes/red/redDefaultCTATheme.module.css +32 -32
  13. package/assets/Appearance/default/themes/yellow/yellowDefaultCTATheme.module.css +32 -32
  14. package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +170 -170
  15. package/assets/Appearance/pureDark/themes/blue/bluePureDarkCTATheme.module.css +32 -32
  16. package/assets/Appearance/pureDark/themes/green/greenPureDarkCTATheme.module.css +32 -32
  17. package/assets/Appearance/pureDark/themes/orange/orangePureDarkCTATheme.module.css +32 -32
  18. package/assets/Appearance/pureDark/themes/red/redPureDarkCTATheme.module.css +32 -32
  19. package/assets/Appearance/pureDark/themes/yellow/yellowPureDarkCTATheme.module.css +32 -32
  20. package/docs/external/active-line.js +72 -72
  21. package/docs/external/autorefresh.js +47 -47
  22. package/docs/external/codemirror.js +9681 -9681
  23. package/docs/external/css/hopscotch.css +576 -576
  24. package/docs/external/css/styleGuide.css +1100 -1100
  25. package/docs/external/css.js +466 -466
  26. package/docs/external/designTokens.js +1 -1
  27. package/docs/external/foldcode.js +151 -151
  28. package/docs/external/format.js +129 -129
  29. package/docs/external/htmlmixed.js +84 -84
  30. package/docs/external/index.html +127 -127
  31. package/docs/external/javascript.js +422 -422
  32. package/docs/external/jsx.js +147 -147
  33. package/docs/external/matchbrackets.js +145 -145
  34. package/docs/external/xml.js +322 -322
  35. package/docs/package.json +41 -41
  36. package/docs/src/index.js +1311 -1311
  37. package/es/AppContainer/AppContainer.module.css +18 -18
  38. package/es/Avatar/Avatar.js +12 -10
  39. package/es/Avatar/Avatar.module.css +123 -135
  40. package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +288 -288
  41. package/es/AvatarTeam/AvatarTeam.js +7 -7
  42. package/es/AvatarTeam/AvatarTeam.module.css +147 -161
  43. package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +226 -226
  44. package/es/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -0
  45. package/es/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -0
  46. package/es/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -0
  47. package/es/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -0
  48. package/es/Button/Button.js +4 -4
  49. package/es/Button/Button.module.css +448 -521
  50. package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +191 -191
  51. package/es/Button/docs/Button__custom.docs.js +0 -0
  52. package/es/Button/docs/Button__default.docs.js +0 -0
  53. package/es/Buttongroup/Buttongroup.js +1 -1
  54. package/es/Buttongroup/Buttongroup.module.css +60 -89
  55. package/es/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +146 -146
  56. package/es/Card/Card.js +4 -4
  57. package/es/Card/Card.module.css +20 -20
  58. package/es/Card/docs/Card__Custom.docs.js +0 -0
  59. package/es/Card/docs/Card__Default.docs.js +0 -0
  60. package/es/Card/docs/Card__Scroll.docs.js +0 -0
  61. package/es/CheckBox/CheckBox.js +0 -0
  62. package/es/CheckBox/CheckBox.module.css +151 -157
  63. package/es/CheckBox/docs/CheckBox__custom.docs.js +0 -0
  64. package/es/CheckBox/docs/CheckBox__default.docs.js +0 -0
  65. package/es/DateTime/CalendarView.js +4 -2
  66. package/es/DateTime/DateTime.js +0 -0
  67. package/es/DateTime/DateTime.module.css +201 -232
  68. package/es/DateTime/DateTimePopupHeader.js +24 -9
  69. package/es/DateTime/DateWidget.js +4 -2
  70. package/es/DateTime/DateWidget.module.css +34 -38
  71. package/es/DateTime/DaysRow.js +5 -2
  72. package/es/DateTime/YearView.js +12 -4
  73. package/es/DateTime/YearView.module.css +86 -81
  74. package/es/DateTime/common.js +0 -0
  75. package/es/DateTime/docs/DateTime__default.docs.js +0 -0
  76. package/es/DateTime/docs/DateWidget__default.docs.js +0 -0
  77. package/es/DateTime/index.js +0 -0
  78. package/es/DateTime/objectUtils.js +0 -0
  79. package/es/DateTime/typeChecker.js +0 -0
  80. package/es/DateTime/validator.js +0 -0
  81. package/es/DropBox/DropBox.js +0 -0
  82. package/es/DropBox/DropBox.module.css +370 -406
  83. package/es/DropBox/DropBoxPositionMapping.json +144 -144
  84. package/es/DropDown/DropDown.js +0 -0
  85. package/es/DropDown/DropDown.module.css +5 -5
  86. package/es/DropDown/DropDownHeading.js +3 -1
  87. package/es/DropDown/DropDownHeading.module.css +49 -53
  88. package/es/DropDown/DropDownItem.js +0 -0
  89. package/es/DropDown/DropDownItem.module.css +68 -94
  90. package/es/DropDown/DropDownSearch.js +0 -0
  91. package/es/DropDown/DropDownSearch.module.css +14 -14
  92. package/es/DropDown/DropDownSeparator.js +0 -0
  93. package/es/DropDown/DropDownSeparator.module.css +7 -7
  94. package/es/DropDown/props/propTypes.js +2 -1
  95. package/es/FramerAnimation/FramerAnimation.js +206 -0
  96. package/es/FramerAnimation/docs/FramerAnimation__default.docs.js +123 -0
  97. package/es/Heading/Heading.module.css +4 -4
  98. package/es/Label/Label.js +6 -4
  99. package/es/Label/Label.module.css +52 -52
  100. package/es/Label/LabelColors.module.css +20 -20
  101. package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +101 -101
  102. package/es/Label/docs/Label__clipped.docs.js +0 -0
  103. package/es/Label/docs/Label__custom.docs.js +0 -0
  104. package/es/Label/docs/Label__palette.docs.js +0 -0
  105. package/es/Label/docs/Label__size.docs.js +0 -0
  106. package/es/Label/docs/Label__type.docs.js +0 -0
  107. package/es/Layout/Box.js +0 -0
  108. package/es/Layout/Container.js +0 -0
  109. package/es/Layout/Layout.module.css +335 -335
  110. package/es/Layout/docs/Layout__default.docs.js +0 -0
  111. package/es/Layout/utils.js +0 -0
  112. package/es/LightNightMode/Colors.json +496 -496
  113. package/es/ListItem/ListContainer.js +4 -2
  114. package/es/ListItem/ListItem.js +2 -1
  115. package/es/ListItem/ListItem.module.css +177 -209
  116. package/es/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
  117. package/es/MultiSelect/MultiSelect.js +9 -7
  118. package/es/MultiSelect/MultiSelect.module.css +188 -205
  119. package/es/MultiSelect/MultiSelectWithAvatar.js +0 -0
  120. package/es/MultiSelect/SelectedOptions.module.css +9 -15
  121. package/es/MultiSelect/Suggestions.js +2 -1
  122. package/es/MultiSelect/__tests__/MultiSelect.spec.js +0 -0
  123. package/es/PopOver/PopOver.module.css +8 -8
  124. package/es/Popup/Popup.js +0 -0
  125. package/es/Popup/PositionMapping.json +73 -73
  126. package/es/Provider.js +7 -21
  127. package/es/Radio/Radio.js +0 -0
  128. package/es/Radio/Radio.module.css +106 -112
  129. package/es/Radio/docs/Radio__custom.docs.js +0 -0
  130. package/es/Radio/docs/Radio__default.docs.js +0 -0
  131. package/es/Responsive/CustomResponsive.js +0 -0
  132. package/es/Responsive/docs/Responsive__Custom.docs.js +0 -0
  133. package/es/Responsive/docs/style.module.css +46 -55
  134. package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
  135. package/es/Ribbon/Ribbon.js +0 -0
  136. package/es/Ribbon/Ribbon.module.css +311 -376
  137. package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +163 -163
  138. package/es/Ribbon/docs/Ribbon__custom.docs.js +0 -0
  139. package/es/Ribbon/docs/Ribbon__default.docs.js +0 -0
  140. package/es/RippleEffect/RippleEffect.module.css +110 -92
  141. package/es/Select/GroupSelect.js +0 -0
  142. package/es/Select/Select.js +7 -4
  143. package/es/Select/Select.module.css +98 -108
  144. package/es/Select/SelectWithAvatar.js +0 -0
  145. package/es/Select/SelectWithIcon.js +2 -1
  146. package/es/Select/__tests__/Select.spec.js +0 -0
  147. package/es/Select/docs/SelectWithIcon__default.docs.js +0 -0
  148. package/es/Select/docs/Select__default.docs.js +0 -0
  149. package/es/Stencils/Stencils.js +0 -0
  150. package/es/Stencils/Stencils.module.css +78 -96
  151. package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +49 -49
  152. package/es/Switch/Switch.js +0 -0
  153. package/es/Switch/Switch.module.css +111 -110
  154. package/es/Switch/docs/Switch__custom.docs.js +0 -0
  155. package/es/Switch/docs/Switch__default.docs.js +0 -0
  156. package/es/Tab/Tab.js +2 -1
  157. package/es/Tab/Tab.module.css +92 -101
  158. package/es/Tab/TabContent.module.css +4 -4
  159. package/es/Tab/Tabs.js +24 -20
  160. package/es/Tab/Tabs.module.css +107 -141
  161. package/es/Tab/docs/tabdocs.module.css +29 -29
  162. package/es/Tag/Tag.js +8 -8
  163. package/es/Tag/Tag.module.css +232 -254
  164. package/es/Tag/docs/Tag__custom.docs.js +0 -0
  165. package/es/Tag/docs/Tag__default.docs.js +0 -0
  166. package/es/TextBox/TextBox.js +0 -0
  167. package/es/TextBox/TextBox.module.css +161 -157
  168. package/es/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +127 -127
  169. package/es/TextBox/docs/TextBox__custom.docs.js +0 -0
  170. package/es/TextBox/docs/TextBox__default.docs.js +0 -0
  171. package/es/TextBox/docs/TextBox__variant.docs.js +0 -0
  172. package/es/TextBoxIcon/TextBoxIcon.js +0 -0
  173. package/es/TextBoxIcon/TextBoxIcon.module.css +71 -78
  174. package/es/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +334 -334
  175. package/es/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -0
  176. package/es/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -0
  177. package/es/Textarea/Textarea.js +0 -0
  178. package/es/Textarea/Textarea.module.css +140 -139
  179. package/es/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +97 -97
  180. package/es/Textarea/docs/Textarea__custom.docs.js +0 -0
  181. package/es/Textarea/docs/Textarea__default.docs.js +0 -0
  182. package/es/Textarea/docs/Textarea__disabled.docs.js +0 -0
  183. package/es/Tooltip/Tooltip.module.css +108 -109
  184. package/es/common/animation.module.css +426 -624
  185. package/es/common/avatarsizes.module.css +44 -44
  186. package/es/common/basic.module.css +33 -33
  187. package/es/common/basicReset.module.css +50 -40
  188. package/es/common/common.module.css +478 -524
  189. package/es/common/customscroll.module.css +93 -89
  190. package/es/common/docStyle.module.css +719 -887
  191. package/es/common/reset.module.css +12 -12
  192. package/es/common/transition.module.css +106 -146
  193. package/es/deprecated/AdvancedMultiSelect.module.css +112 -126
  194. package/es/semantic/Button/semanticButton.module.css +9 -9
  195. package/es/utils/Common.js +0 -0
  196. package/es/utils/dropDownUtils.js +0 -0
  197. package/package.json +81 -86
  198. package/assets/Contrast/darkContrastLightness.module.css +0 -25
  199. package/assets/Contrast/defaultContrastLightness.module.css +0 -25
  200. package/assets/Contrast/pureDarkContrastLightness.module.css +0 -25
  201. package/lib/Accordion/Accordion.js +0 -102
  202. package/lib/Accordion/AccordionItem.js +0 -84
  203. package/lib/Accordion/__tests__/Accordion.spec.js +0 -82
  204. package/lib/Accordion/docs/Accordion__Demo.docs.js +0 -104
  205. package/lib/Accordion/index.js +0 -20
  206. package/lib/Accordion/props/defaultProps.js +0 -16
  207. package/lib/Accordion/props/propTypes.js +0 -39
  208. package/lib/Animation/Animation.js +0 -161
  209. package/lib/Animation/__tests__/Animation.spec.js +0 -19
  210. package/lib/Animation/docs/Animation__default.docs.js +0 -61
  211. package/lib/Animation/docs/Animation__fadeIn.docs.js +0 -61
  212. package/lib/Animation/docs/Animation__scaleIn.docs.js +0 -61
  213. package/lib/Animation/docs/Animation__skewIn.docs.js +0 -61
  214. package/lib/Animation/docs/Animation__slideDown.docs.js +0 -61
  215. package/lib/Animation/docs/Animation__slideLeft.docs.js +0 -61
  216. package/lib/Animation/docs/Animation__zoomIn.docs.js +0 -61
  217. package/lib/Animation/props/defaultProps.js +0 -14
  218. package/lib/Animation/props/propTypes.js +0 -20
  219. package/lib/AppContainer/AppContainer.js +0 -156
  220. package/lib/AppContainer/AppContainer.module.css +0 -18
  221. package/lib/AppContainer/docs/AppContainer__default.docs.js +0 -47
  222. package/lib/AppContainer/props/defaultProps.js +0 -15
  223. package/lib/AppContainer/props/propTypes.js +0 -23
  224. package/lib/Avatar/Avatar.js +0 -199
  225. package/lib/Avatar/Avatar.module.css +0 -135
  226. package/lib/Avatar/__tests__/Avatar.spec.js +0 -164
  227. package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +0 -288
  228. package/lib/Avatar/docs/Avatar__custom.docs.js +0 -62
  229. package/lib/Avatar/docs/Avatar__default.docs.js +0 -60
  230. package/lib/Avatar/docs/Avatar__palette.docs.js +0 -82
  231. package/lib/Avatar/docs/Avatar__text.docs.js +0 -61
  232. package/lib/Avatar/props/defaultProps.js +0 -21
  233. package/lib/Avatar/props/propTypes.js +0 -31
  234. package/lib/AvatarTeam/AvatarTeam.js +0 -99
  235. package/lib/AvatarTeam/AvatarTeam.module.css +0 -161
  236. package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -79
  237. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +0 -226
  238. package/lib/AvatarTeam/docs/AvatarTeam__custom.docs.js +0 -100
  239. package/lib/AvatarTeam/docs/AvatarTeam__default.docs.js +0 -58
  240. package/lib/AvatarTeam/docs/AvatarTeam__palette.docs.js +0 -77
  241. package/lib/AvatarTeam/docs/AvatarTeam__size.docs.js +0 -76
  242. package/lib/AvatarTeam/props/defaultProps.js +0 -20
  243. package/lib/AvatarTeam/props/propTypes.js +0 -31
  244. package/lib/Button/Button.js +0 -90
  245. package/lib/Button/Button.module.css +0 -522
  246. package/lib/Button/__tests__/Button.spec.js +0 -193
  247. package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +0 -191
  248. package/lib/Button/docs/Button__custom.docs.js +0 -800
  249. package/lib/Button/docs/Button__default.docs.js +0 -565
  250. package/lib/Button/props/defaultProps.js +0 -22
  251. package/lib/Button/props/propTypes.js +0 -30
  252. package/lib/Buttongroup/Buttongroup.js +0 -69
  253. package/lib/Buttongroup/Buttongroup.module.css +0 -89
  254. package/lib/Buttongroup/__test__/Buttongroup.spec.js +0 -76
  255. package/lib/Buttongroup/__test__/__snapshots__/Buttongroup.spec.js.snap +0 -146
  256. package/lib/Buttongroup/docs/Buttongroup__custom.docs.js +0 -64
  257. package/lib/Buttongroup/docs/Buttongroup__footer.docs.js +0 -60
  258. package/lib/Buttongroup/docs/Buttongroup__header.docs.js +0 -71
  259. package/lib/Buttongroup/props/defaultProps.js +0 -11
  260. package/lib/Buttongroup/props/propTypes.js +0 -15
  261. package/lib/Card/Card.js +0 -301
  262. package/lib/Card/Card.module.css +0 -20
  263. package/lib/Card/__tests__/Card.spec.js +0 -47
  264. package/lib/Card/docs/Card__Custom.docs.js +0 -63
  265. package/lib/Card/docs/Card__Default.docs.js +0 -66
  266. package/lib/Card/docs/Card__Scroll.docs.js +0 -87
  267. package/lib/Card/index.js +0 -33
  268. package/lib/Card/props/defaultProps.js +0 -23
  269. package/lib/Card/props/propTypes.js +0 -54
  270. package/lib/CheckBox/CheckBox.js +0 -183
  271. package/lib/CheckBox/CheckBox.module.css +0 -157
  272. package/lib/CheckBox/__tests__/CheckBox.spec.js +0 -15
  273. package/lib/CheckBox/docs/CheckBox__custom.docs.js +0 -323
  274. package/lib/CheckBox/docs/CheckBox__default.docs.js +0 -249
  275. package/lib/CheckBox/props/defaultProps.js +0 -25
  276. package/lib/CheckBox/props/propTypes.js +0 -49
  277. package/lib/DateTime/CalendarView.js +0 -227
  278. package/lib/DateTime/DateTime.js +0 -779
  279. package/lib/DateTime/DateTime.module.css +0 -233
  280. package/lib/DateTime/DateTimePopupFooter.js +0 -65
  281. package/lib/DateTime/DateTimePopupHeader.js +0 -117
  282. package/lib/DateTime/DateWidget.js +0 -1015
  283. package/lib/DateTime/DateWidget.module.css +0 -38
  284. package/lib/DateTime/DaysRow.js +0 -52
  285. package/lib/DateTime/Time.js +0 -205
  286. package/lib/DateTime/YearView.js +0 -267
  287. package/lib/DateTime/YearView.module.css +0 -81
  288. package/lib/DateTime/__tests__/CalendarView.spec.js +0 -37
  289. package/lib/DateTime/__tests__/DateTime.spec.js +0 -113
  290. package/lib/DateTime/__tests__/DateWidget.spec.js +0 -79
  291. package/lib/DateTime/common.js +0 -30
  292. package/lib/DateTime/constants.js +0 -76
  293. package/lib/DateTime/dateFormatUtils/dateFormat.js +0 -551
  294. package/lib/DateTime/dateFormatUtils/dayChange.js +0 -74
  295. package/lib/DateTime/dateFormatUtils/index.js +0 -225
  296. package/lib/DateTime/dateFormatUtils/monthChange.js +0 -84
  297. package/lib/DateTime/dateFormatUtils/timeChange.js +0 -208
  298. package/lib/DateTime/dateFormatUtils/yearChange.js +0 -108
  299. package/lib/DateTime/docs/DateTime__default.docs.js +0 -119
  300. package/lib/DateTime/docs/DateWidget__default.docs.js +0 -212
  301. package/lib/DateTime/docs/timezonedata.json +0 -1
  302. package/lib/DateTime/index.js +0 -13
  303. package/lib/DateTime/objectUtils.js +0 -72
  304. package/lib/DateTime/props/defaultProps.js +0 -61
  305. package/lib/DateTime/props/propTypes.js +0 -144
  306. package/lib/DateTime/typeChecker.js +0 -22
  307. package/lib/DateTime/validator.js +0 -290
  308. package/lib/DropBox/DropBox.js +0 -266
  309. package/lib/DropBox/DropBox.module.css +0 -406
  310. package/lib/DropBox/DropBoxPositionMapping.json +0 -145
  311. package/lib/DropBox/__tests__/DropBox.spec.js +0 -83
  312. package/lib/DropBox/docs/DropBox__custom.docs.js +0 -97
  313. package/lib/DropBox/docs/DropBox__customOrder.docs.js +0 -114
  314. package/lib/DropBox/docs/DropBox__fixedPosition.docs.js +0 -113
  315. package/lib/DropBox/docs/DropBox__position.docs.js +0 -118
  316. package/lib/DropBox/docs/DropBox__size.docs.js +0 -92
  317. package/lib/DropBox/props/defaultProps.js +0 -27
  318. package/lib/DropBox/props/propTypes.js +0 -55
  319. package/lib/DropDown/DropDown.js +0 -127
  320. package/lib/DropDown/DropDown.module.css +0 -5
  321. package/lib/DropDown/DropDownHeading.js +0 -64
  322. package/lib/DropDown/DropDownHeading.module.css +0 -53
  323. package/lib/DropDown/DropDownItem.js +0 -102
  324. package/lib/DropDown/DropDownItem.module.css +0 -94
  325. package/lib/DropDown/DropDownSearch.js +0 -88
  326. package/lib/DropDown/DropDownSearch.module.css +0 -14
  327. package/lib/DropDown/DropDownSeparator.js +0 -42
  328. package/lib/DropDown/DropDownSeparator.module.css +0 -7
  329. package/lib/DropDown/__tests__/DropDown.spec.js +0 -44
  330. package/lib/DropDown/__tests__/DropDownItem.spec.js +0 -46
  331. package/lib/DropDown/__tests__/DropDownSearch.spec.js +0 -14
  332. package/lib/DropDown/docs/DropDownHeading__custom.docs.js +0 -50
  333. package/lib/DropDown/docs/DropDownHeading__default.docs.js +0 -48
  334. package/lib/DropDown/props/defaultProps.js +0 -28
  335. package/lib/DropDown/props/propTypes.js +0 -89
  336. package/lib/Heading/Heading.js +0 -64
  337. package/lib/Heading/Heading.module.css +0 -5
  338. package/lib/Heading/docs/Heading__default.docs.js +0 -50
  339. package/lib/Heading/props/defaultProps.js +0 -12
  340. package/lib/Heading/props/propTypes.js +0 -19
  341. package/lib/Label/Label.js +0 -65
  342. package/lib/Label/Label.module.css +0 -52
  343. package/lib/Label/LabelColors.module.css +0 -21
  344. package/lib/Label/__tests__/Label.spec.js +0 -124
  345. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +0 -101
  346. package/lib/Label/docs/Label__clipped.docs.js +0 -56
  347. package/lib/Label/docs/Label__custom.docs.js +0 -59
  348. package/lib/Label/docs/Label__palette.docs.js +0 -71
  349. package/lib/Label/docs/Label__size.docs.js +0 -58
  350. package/lib/Label/docs/Label__type.docs.js +0 -66
  351. package/lib/Label/props/defaultProps.js +0 -17
  352. package/lib/Label/props/propTypes.js +0 -22
  353. package/lib/Layout/Box.js +0 -104
  354. package/lib/Layout/Container.js +0 -122
  355. package/lib/Layout/Layout.module.css +0 -336
  356. package/lib/Layout/__tests__/Box.spec.js +0 -105
  357. package/lib/Layout/__tests__/Container.spec.js +0 -110
  358. package/lib/Layout/docs/Layout__Hidden.docs.js +0 -105
  359. package/lib/Layout/docs/Layout__default.docs.js +0 -77
  360. package/lib/Layout/docs/Layout__four_Column.docs.js +0 -107
  361. package/lib/Layout/docs/Layout__three_Column.docs.js +0 -104
  362. package/lib/Layout/docs/Layout__two_Column.docs.js +0 -97
  363. package/lib/Layout/index.js +0 -30
  364. package/lib/Layout/props/defaultProps.js +0 -20
  365. package/lib/Layout/props/propTypes.js +0 -51
  366. package/lib/Layout/utils.js +0 -45
  367. package/lib/LightNightMode/Colors.json +0 -497
  368. package/lib/LightNightMode/docs/AlternativeColors.docs.js +0 -128
  369. package/lib/ListItem/ListContainer.js +0 -93
  370. package/lib/ListItem/ListItem.js +0 -153
  371. package/lib/ListItem/ListItem.module.css +0 -209
  372. package/lib/ListItem/ListItemWithAvatar.js +0 -175
  373. package/lib/ListItem/ListItemWithCheckBox.js +0 -141
  374. package/lib/ListItem/ListItemWithIcon.js +0 -158
  375. package/lib/ListItem/ListItemWithRadio.js +0 -143
  376. package/lib/ListItem/docs/ListItemWithAvatar__custom.docs.js +0 -182
  377. package/lib/ListItem/docs/ListItemWithAvatar__default.docs.js +0 -139
  378. package/lib/ListItem/docs/ListItemWithCheckBox__custom.docs.js +0 -118
  379. package/lib/ListItem/docs/ListItemWithCheckBox__default.docs.js +0 -92
  380. package/lib/ListItem/docs/ListItemWithIcon__custom.docs.js +0 -95
  381. package/lib/ListItem/docs/ListItemWithIcon__default.docs.js +0 -89
  382. package/lib/ListItem/docs/ListItemWithRadio__custom.docs.js +0 -118
  383. package/lib/ListItem/docs/ListItemWithRadio__default.docs.js +0 -92
  384. package/lib/ListItem/docs/ListItem__custom.docs.js +0 -141
  385. package/lib/ListItem/docs/ListItem__default.docs.js +0 -109
  386. package/lib/ListItem/props/defaultProps.js +0 -97
  387. package/lib/ListItem/props/propTypes.js +0 -176
  388. package/lib/Modal/Modal.js +0 -174
  389. package/lib/Modal/__docs__/Modal__default.docs.js +0 -65
  390. package/lib/Modal/props/defaultProps.js +0 -10
  391. package/lib/Modal/props/propTypes.js +0 -14
  392. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +0 -1032
  393. package/lib/MultiSelect/AdvancedMultiSelect.js +0 -552
  394. package/lib/MultiSelect/EmptyState.js +0 -85
  395. package/lib/MultiSelect/MultiSelect.js +0 -1044
  396. package/lib/MultiSelect/MultiSelect.module.css +0 -206
  397. package/lib/MultiSelect/MultiSelectHeader.js +0 -55
  398. package/lib/MultiSelect/MultiSelectWithAvatar.js +0 -304
  399. package/lib/MultiSelect/SelectedOptions.js +0 -97
  400. package/lib/MultiSelect/SelectedOptions.module.css +0 -15
  401. package/lib/MultiSelect/Suggestions.js +0 -158
  402. package/lib/MultiSelect/__tests__/MultiSelect.spec.js +0 -159
  403. package/lib/MultiSelect/docs/AdvancedGroupMultiSelect__default.docs.js +0 -154
  404. package/lib/MultiSelect/docs/AdvancedMultiSelect__default.docs.js +0 -140
  405. package/lib/MultiSelect/docs/MultiSelectWithAvatar__default.docs.js +0 -165
  406. package/lib/MultiSelect/docs/MultiSelect__default.docs.js +0 -186
  407. package/lib/MultiSelect/props/defaultProps.js +0 -158
  408. package/lib/MultiSelect/props/propTypes.js +0 -377
  409. package/lib/PopOver/PopOver.js +0 -252
  410. package/lib/PopOver/PopOver.module.css +0 -8
  411. package/lib/PopOver/__tests__/PopOver.spec.js +0 -17
  412. package/lib/PopOver/docs/PopOver__default.docs.js +0 -61
  413. package/lib/PopOver/props/defaultProps.js +0 -15
  414. package/lib/PopOver/props/propTypes.js +0 -63
  415. package/lib/Popup/Popup.js +0 -640
  416. package/lib/Popup/PositionMapping.json +0 -74
  417. package/lib/Popup/__tests__/Popup.spec.js +0 -155
  418. package/lib/Popup/viewPort.js +0 -354
  419. package/lib/Provider/AvatarSize.js +0 -19
  420. package/lib/Provider/Config.js +0 -25
  421. package/lib/Provider/CssProvider.js +0 -23
  422. package/lib/Provider/IdProvider.js +0 -68
  423. package/lib/Provider/LibraryContext.js +0 -54
  424. package/lib/Provider/LibraryContextInit.js +0 -11
  425. package/lib/Provider/NumberGenerator/NumberGenerator.js +0 -145
  426. package/lib/Provider/ZindexProvider.js +0 -57
  427. package/lib/Provider/docs/Provider_Id__Class.docs.js +0 -56
  428. package/lib/Provider/docs/Provider_Id__Function.docs.js +0 -24
  429. package/lib/Provider/docs/Provider_Zindex__Class.docs.js +0 -59
  430. package/lib/Provider/docs/Provider_Zindex__Function.docs.js +0 -29
  431. package/lib/Provider.js +0 -134
  432. package/lib/Radio/Radio.js +0 -146
  433. package/lib/Radio/Radio.module.css +0 -112
  434. package/lib/Radio/__tests__/Radiospec.js +0 -25
  435. package/lib/Radio/docs/Radio__custom.docs.js +0 -273
  436. package/lib/Radio/docs/Radio__default.docs.js +0 -197
  437. package/lib/Radio/props/defaultProps.js +0 -21
  438. package/lib/Radio/props/propTypes.js +0 -40
  439. package/lib/Responsive/CustomResponsive.js +0 -192
  440. package/lib/Responsive/RefWrapper.js +0 -47
  441. package/lib/Responsive/ResizeComponent.js +0 -237
  442. package/lib/Responsive/ResizeObserver.js +0 -151
  443. package/lib/Responsive/Responsive.js +0 -222
  444. package/lib/Responsive/docs/Responsive__Custom.docs.js +0 -247
  445. package/lib/Responsive/docs/Responsive__default.docs.js +0 -118
  446. package/lib/Responsive/docs/style.module.css +0 -56
  447. package/lib/Responsive/index.js +0 -28
  448. package/lib/Responsive/props/defaultProps.js +0 -23
  449. package/lib/Responsive/props/propTypes.js +0 -36
  450. package/lib/Responsive/sizeObservers.js +0 -176
  451. package/lib/Responsive/utils/index.js +0 -62
  452. package/lib/Responsive/utils/shallowCompare.js +0 -29
  453. package/lib/Responsive/windowResizeObserver.js +0 -55
  454. package/lib/ResponsiveDropBox/ResponsiveDropBox.js +0 -94
  455. package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +0 -6
  456. package/lib/ResponsiveDropBox/props/defaultProps.js +0 -11
  457. package/lib/ResponsiveDropBox/props/propTypes.js +0 -15
  458. package/lib/Ribbon/Ribbon.js +0 -71
  459. package/lib/Ribbon/Ribbon.module.css +0 -377
  460. package/lib/Ribbon/__tests__/Ribbon.spec.js +0 -171
  461. package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +0 -163
  462. package/lib/Ribbon/docs/Ribbon__custom.docs.js +0 -414
  463. package/lib/Ribbon/docs/Ribbon__default.docs.js +0 -370
  464. package/lib/Ribbon/props/defaultProps.js +0 -15
  465. package/lib/Ribbon/props/propTypes.js +0 -18
  466. package/lib/RippleEffect/RippleEffect.js +0 -35
  467. package/lib/RippleEffect/RippleEffect.module.css +0 -92
  468. package/lib/RippleEffect/docs/RippleEffect__default.docs.js +0 -462
  469. package/lib/RippleEffect/props/defaultProps.js +0 -16
  470. package/lib/RippleEffect/props/propTypes.js +0 -19
  471. package/lib/Select/GroupSelect.js +0 -771
  472. package/lib/Select/Select.js +0 -910
  473. package/lib/Select/Select.module.css +0 -109
  474. package/lib/Select/SelectWithAvatar.js +0 -340
  475. package/lib/Select/SelectWithIcon.js +0 -530
  476. package/lib/Select/__tests__/Select.spec.js +0 -341
  477. package/lib/Select/docs/GroupSelect__default.docs.js +0 -173
  478. package/lib/Select/docs/SelectWithAvatar__default.docs.js +0 -124
  479. package/lib/Select/docs/SelectWithIcon__default.docs.js +0 -165
  480. package/lib/Select/docs/Select__default.docs.js +0 -313
  481. package/lib/Select/props/defaultProps.js +0 -112
  482. package/lib/Select/props/propTypes.js +0 -280
  483. package/lib/Stencils/Stencils.js +0 -57
  484. package/lib/Stencils/Stencils.module.css +0 -96
  485. package/lib/Stencils/__tests__/Stencils.spec.js +0 -72
  486. package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +0 -49
  487. package/lib/Stencils/docs/Stencils__custom.docs.js +0 -72
  488. package/lib/Stencils/docs/Stencils__default.docs.js +0 -77
  489. package/lib/Stencils/props/defaultProps.js +0 -13
  490. package/lib/Stencils/props/propTypes.js +0 -15
  491. package/lib/Switch/Switch.js +0 -123
  492. package/lib/Switch/Switch.module.css +0 -111
  493. package/lib/Switch/docs/Switch__custom.docs.js +0 -180
  494. package/lib/Switch/docs/Switch__default.docs.js +0 -134
  495. package/lib/Switch/props/defaultProps.js +0 -17
  496. package/lib/Switch/props/propTypes.js +0 -35
  497. package/lib/Tab/Tab.js +0 -116
  498. package/lib/Tab/Tab.module.css +0 -101
  499. package/lib/Tab/TabContent.js +0 -33
  500. package/lib/Tab/TabContent.module.css +0 -4
  501. package/lib/Tab/TabContentWrapper.js +0 -33
  502. package/lib/Tab/TabWrapper.js +0 -69
  503. package/lib/Tab/Tabs.js +0 -581
  504. package/lib/Tab/Tabs.module.css +0 -141
  505. package/lib/Tab/__tests__/Tab.spec.js +0 -119
  506. package/lib/Tab/__tests__/TabContent.spec.js +0 -18
  507. package/lib/Tab/__tests__/TabContentWrapper.spec.js +0 -51
  508. package/lib/Tab/__tests__/TabWrapper.spec.js +0 -88
  509. package/lib/Tab/__tests__/Tabs.spec.js +0 -109
  510. package/lib/Tab/docs/Tab__default.docs.js +0 -283
  511. package/lib/Tab/docs/tabdocs.module.css +0 -29
  512. package/lib/Tab/index.js +0 -41
  513. package/lib/Tab/props/defaultProps.js +0 -50
  514. package/lib/Tab/props/propTypes.js +0 -114
  515. package/lib/Tag/Tag.js +0 -177
  516. package/lib/Tag/Tag.module.css +0 -255
  517. package/lib/Tag/__tests__/Tag.spec.js +0 -29
  518. package/lib/Tag/docs/Tag__custom.docs.js +0 -397
  519. package/lib/Tag/docs/Tag__default.docs.js +0 -352
  520. package/lib/Tag/props/defaultProps.js +0 -20
  521. package/lib/Tag/props/propTypes.js +0 -42
  522. package/lib/TextBox/TextBox.js +0 -193
  523. package/lib/TextBox/TextBox.module.css +0 -157
  524. package/lib/TextBox/__tests__/TextBox.spec.js +0 -195
  525. package/lib/TextBox/__tests__/__snapshots__/TextBox.spec.js.snap +0 -127
  526. package/lib/TextBox/docs/TextBox__custom.docs.js +0 -72
  527. package/lib/TextBox/docs/TextBox__default.docs.js +0 -69
  528. package/lib/TextBox/docs/TextBox__size.docs.js +0 -67
  529. package/lib/TextBox/docs/TextBox__variant.docs.js +0 -67
  530. package/lib/TextBox/props/defaultProps.js +0 -26
  531. package/lib/TextBox/props/propTypes.js +0 -57
  532. package/lib/TextBoxIcon/TextBoxIcon.js +0 -187
  533. package/lib/TextBoxIcon/TextBoxIcon.module.css +0 -78
  534. package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -219
  535. package/lib/TextBoxIcon/__tests__/__snapshots__/TextBoxIcon.spec.js.snap +0 -334
  536. package/lib/TextBoxIcon/docs/TextBoxIcon__custom.docs.js +0 -118
  537. package/lib/TextBoxIcon/docs/TextBoxIcon__default.docs.js +0 -90
  538. package/lib/TextBoxIcon/props/defaultProps.js +0 -28
  539. package/lib/TextBoxIcon/props/propTypes.js +0 -57
  540. package/lib/Textarea/Textarea.js +0 -130
  541. package/lib/Textarea/Textarea.module.css +0 -139
  542. package/lib/Textarea/__tests__/Textarea.spec.js +0 -174
  543. package/lib/Textarea/__tests__/__snapshots__/Textarea.spec.js.snap +0 -97
  544. package/lib/Textarea/docs/Textarea__animated.docs.js +0 -70
  545. package/lib/Textarea/docs/Textarea__custom.docs.js +0 -111
  546. package/lib/Textarea/docs/Textarea__default.docs.js +0 -105
  547. package/lib/Textarea/docs/Textarea__disabled.docs.js +0 -58
  548. package/lib/Textarea/props/defaultProps.js +0 -23
  549. package/lib/Textarea/props/propTypes.js +0 -39
  550. package/lib/Tooltip/Tooltip.js +0 -519
  551. package/lib/Tooltip/Tooltip.module.css +0 -109
  552. package/lib/Tooltip/__tests__/Tooltip.spec.js +0 -75
  553. package/lib/Tooltip/docs/Tooltip__default.docs.js +0 -402
  554. package/lib/Tooltip/props/defaultProps.js +0 -11
  555. package/lib/Tooltip/props/propTypes.js +0 -16
  556. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -100
  557. package/lib/VelocityAnimation/VelocityAnimation/docs/VelocityAnimation__demo.docs.js +0 -123
  558. package/lib/VelocityAnimation/VelocityAnimation/props/defaultProps.js +0 -14
  559. package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -20
  560. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +0 -131
  561. package/lib/VelocityAnimation/VelocityAnimationGroup/docs/VelocityAnimationGroup__demo.docs.js +0 -174
  562. package/lib/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +0 -22
  563. package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -27
  564. package/lib/common/animation.module.css +0 -624
  565. package/lib/common/avatarsizes.module.css +0 -45
  566. package/lib/common/basic.module.css +0 -33
  567. package/lib/common/basicReset.module.css +0 -40
  568. package/lib/common/common.module.css +0 -525
  569. package/lib/common/customscroll.module.css +0 -89
  570. package/lib/common/docStyle.module.css +0 -887
  571. package/lib/common/reset.module.css +0 -12
  572. package/lib/common/transition.module.css +0 -146
  573. package/lib/css.js +0 -42
  574. package/lib/deprecated/AdvancedMultiSelect.module.css +0 -127
  575. package/lib/deprecated/PortalLayer/PortalLayer.js +0 -126
  576. package/lib/deprecated/PortalLayer/docs/PortalLayer__default.docs.js +0 -111
  577. package/lib/deprecated/PortalLayer/props/defaultProps.js +0 -12
  578. package/lib/deprecated/PortalLayer/props/propTypes.js +0 -19
  579. package/lib/deprecated/advancedMultiSelectVariableJson.js +0 -82
  580. package/lib/index.js +0 -1245
  581. package/lib/semantic/Button/Button.js +0 -81
  582. package/lib/semantic/Button/docs/Button__default.docs.js +0 -43
  583. package/lib/semantic/Button/props/defaultProps.js +0 -19
  584. package/lib/semantic/Button/props/propTypes.js +0 -34
  585. package/lib/semantic/Button/semanticButton.module.css +0 -9
  586. package/lib/utils/Common.js +0 -391
  587. package/lib/utils/ContextOptimizer.js +0 -43
  588. package/lib/utils/__tests__/constructFullName.spec.js +0 -11
  589. package/lib/utils/__tests__/debounce.spec.js +0 -39
  590. package/lib/utils/__tests__/getInitial.spec.js +0 -25
  591. package/lib/utils/constant.js +0 -10
  592. package/lib/utils/constructFullName.js +0 -25
  593. package/lib/utils/datetime/common.js +0 -206
  594. package/lib/utils/debounce.js +0 -25
  595. package/lib/utils/dropDownUtils.js +0 -491
  596. package/lib/utils/dummyFunction.js +0 -8
  597. package/lib/utils/getHTMLFontSize.js +0 -10
  598. package/lib/utils/getInitial.js +0 -27
  599. package/lib/utils/scrollTo.js +0 -20
  600. 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;