@zohodesk/components 1.0.0-alpha-195 → 1.0.0-alpha-199

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