@zohodesk/components 1.0.0-temp-157 → 1.0.0-temp-158

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 (423) hide show
  1. package/README.md +4 -0
  2. package/es/Accordion/Accordion.js +7 -3
  3. package/es/Accordion/AccordionItem.js +4 -2
  4. package/es/Animation/Animation.js +3 -3
  5. package/es/AppContainer/AppContainer.js +13 -5
  6. package/es/Avatar/Avatar.js +23 -11
  7. package/es/Avatar/Avatar.module.css +8 -8
  8. package/es/AvatarTeam/AvatarTeam.js +3 -3
  9. package/es/AvatarTeam/AvatarTeam.module.css +33 -32
  10. package/es/Button/Button.js +4 -3
  11. package/es/Button/css/Button.module.css +49 -48
  12. package/es/Buttongroup/Buttongroup.js +3 -3
  13. package/es/Buttongroup/Buttongroup.module.css +10 -10
  14. package/es/Card/Card.js +21 -10
  15. package/es/CheckBox/CheckBox.js +5 -3
  16. package/es/CheckBox/CheckBox.module.css +14 -14
  17. package/es/DateTime/CalendarView.js +32 -20
  18. package/es/DateTime/DateTime.js +76 -11
  19. package/es/DateTime/DateTime.module.css +32 -32
  20. package/es/DateTime/DateTimePopupFooter.js +4 -2
  21. package/es/DateTime/DateTimePopupHeader.js +8 -2
  22. package/es/DateTime/DateWidget.js +98 -35
  23. package/es/DateTime/DaysRow.js +4 -2
  24. package/es/DateTime/Time.js +10 -2
  25. package/es/DateTime/YearView.js +28 -4
  26. package/es/DateTime/YearView.module.css +12 -12
  27. package/es/DateTime/__tests__/CalendarView.spec.js +1 -0
  28. package/es/DateTime/__tests__/DateTime.spec.js +1 -0
  29. package/es/DateTime/__tests__/DateWidget.spec.js +2 -3
  30. package/es/DateTime/common.js +3 -0
  31. package/es/DateTime/constants.js +1 -0
  32. package/es/DateTime/dateFormatUtils/dateFormat.js +63 -30
  33. package/es/DateTime/dateFormatUtils/dateFormats.js +0 -1
  34. package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
  35. package/es/DateTime/dateFormatUtils/index.js +32 -2
  36. package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
  37. package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
  38. package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
  39. package/es/DateTime/objectUtils.js +14 -20
  40. package/es/DateTime/props/defaultProps.js +2 -1
  41. package/es/DateTime/typeChecker.js +3 -0
  42. package/es/DateTime/validator.js +58 -6
  43. package/es/DropBox/DropBox.js +6 -2
  44. package/es/DropBox/DropBoxElement/DropBoxElement.js +7 -0
  45. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +42 -41
  46. package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -3
  47. package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +3 -0
  48. package/es/DropBox/props/defaultProps.js +1 -2
  49. package/es/DropBox/props/propTypes.js +1 -2
  50. package/es/DropDown/DropDown.js +8 -4
  51. package/es/DropDown/DropDown.module.css +2 -2
  52. package/es/DropDown/DropDownHeading.js +4 -5
  53. package/es/DropDown/DropDownHeading.module.css +5 -5
  54. package/es/DropDown/DropDownItem.js +6 -0
  55. package/es/DropDown/DropDownItem.module.css +7 -7
  56. package/es/DropDown/DropDownSearch.js +4 -0
  57. package/es/DropDown/DropDownSearch.module.css +3 -3
  58. package/es/DropDown/DropDownSeparator.js +1 -0
  59. package/es/DropDown/DropDownSeparator.module.css +2 -2
  60. package/es/DropDown/__tests__/DropDown.spec.js +1 -2
  61. package/es/Heading/Heading.js +2 -3
  62. package/es/Heading/Heading.module.css +1 -1
  63. package/es/Label/Label.js +4 -10
  64. package/es/Label/Label.module.css +6 -6
  65. package/es/Label/props/propTypes.js +1 -4
  66. package/es/Layout/Box.js +13 -0
  67. package/es/Layout/Container.js +12 -1
  68. package/es/Layout/index.js +1 -2
  69. package/es/ListItem/ListContainer.js +8 -3
  70. package/es/ListItem/ListItem.js +9 -3
  71. package/es/ListItem/ListItem.module.css +37 -37
  72. package/es/ListItem/ListItemWithAvatar.js +9 -3
  73. package/es/ListItem/ListItemWithCheckBox.js +7 -2
  74. package/es/ListItem/ListItemWithIcon.js +8 -3
  75. package/es/ListItem/ListItemWithRadio.js +7 -3
  76. package/es/Modal/Modal.js +28 -11
  77. package/es/MultiSelect/AdvancedGroupMultiSelect.js +89 -13
  78. package/es/MultiSelect/AdvancedMultiSelect.js +32 -9
  79. package/es/MultiSelect/EmptyState.js +2 -0
  80. package/es/MultiSelect/MultiSelect.js +99 -32
  81. package/es/MultiSelect/MultiSelect.module.css +25 -24
  82. package/es/MultiSelect/MultiSelectHeader.js +3 -0
  83. package/es/MultiSelect/MultiSelectWithAvatar.js +12 -6
  84. package/es/MultiSelect/SelectedOptions.js +6 -3
  85. package/es/MultiSelect/SelectedOptions.module.css +4 -4
  86. package/es/MultiSelect/Suggestions.js +7 -3
  87. package/es/MultiSelect/__tests__/MultiSelect.spec.js +4 -6
  88. package/es/MultiSelect/props/propTypes.js +2 -0
  89. package/es/PopOver/PopOver.js +18 -2
  90. package/es/PopOver/__tests__/PopOver.spec.js +2 -1
  91. package/es/Popup/Popup.js +77 -24
  92. package/es/Popup/__tests__/Popup.spec.js +17 -5
  93. package/es/Popup/viewPort.js +16 -4
  94. package/es/Provider/IdProvider.js +10 -5
  95. package/es/Provider/LibraryContext.js +6 -4
  96. package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
  97. package/es/Provider/ZindexProvider.js +9 -2
  98. package/es/Radio/Radio.js +4 -2
  99. package/es/Radio/Radio.module.css +9 -9
  100. package/es/Responsive/CustomResponsive.js +30 -18
  101. package/es/Responsive/RefWrapper.js +6 -7
  102. package/es/Responsive/ResizeComponent.js +35 -25
  103. package/es/Responsive/ResizeObserver.js +26 -6
  104. package/es/Responsive/Responsive.js +34 -20
  105. package/es/Responsive/index.js +1 -3
  106. package/es/Responsive/sizeObservers.js +28 -7
  107. package/es/Responsive/utils/index.js +7 -5
  108. package/es/Responsive/utils/shallowCompare.js +7 -2
  109. package/es/Responsive/windowResizeObserver.js +7 -0
  110. package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
  111. package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +1 -1
  112. package/es/Ribbon/Ribbon.js +3 -2
  113. package/es/Ribbon/Ribbon.module.css +44 -42
  114. package/es/RippleEffect/RippleEffect.js +1 -3
  115. package/es/Select/GroupSelect.js +58 -14
  116. package/es/Select/Select.js +79 -33
  117. package/es/Select/Select.module.css +19 -19
  118. package/es/Select/SelectWithAvatar.js +17 -4
  119. package/es/Select/SelectWithIcon.js +46 -5
  120. package/es/Select/__tests__/Select.spec.js +6 -8
  121. package/es/Select/props/propTypes.js +1 -0
  122. package/es/Stencils/Stencils.js +3 -3
  123. package/es/Stencils/Stencils.module.css +13 -13
  124. package/es/Switch/Switch.js +5 -3
  125. package/es/Switch/Switch.module.css +22 -22
  126. package/es/Tab/Tab.js +4 -4
  127. package/es/Tab/Tab.module.css +10 -10
  128. package/es/Tab/TabContent.js +1 -0
  129. package/es/Tab/TabContentWrapper.js +2 -0
  130. package/es/Tab/TabWrapper.js +5 -2
  131. package/es/Tab/Tabs.js +54 -7
  132. package/es/Tab/Tabs.module.css +12 -12
  133. package/es/Tab/__tests__/Tab.spec.js +1 -3
  134. package/es/Tab/__tests__/TabWrapper.spec.js +1 -0
  135. package/es/Tag/Tag.js +6 -3
  136. package/es/Tag/Tag.module.css +20 -20
  137. package/es/TextBox/TextBox.js +15 -3
  138. package/es/TextBox/TextBox.module.css +15 -14
  139. package/es/TextBox/__tests__/TextBox.spec.js +1 -4
  140. package/es/TextBoxIcon/TextBoxIcon.js +9 -2
  141. package/es/TextBoxIcon/TextBoxIcon.module.css +2 -1
  142. package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -7
  143. package/es/Textarea/Textarea.js +12 -3
  144. package/es/Textarea/Textarea.module.css +21 -21
  145. package/es/Textarea/__tests__/Textarea.spec.js +2 -2
  146. package/es/Tooltip/Tooltip.js +58 -14
  147. package/es/Tooltip/Tooltip.module.css +10 -3
  148. package/es/Tooltip/__tests__/Tooltip.spec.js +5 -0
  149. package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -2
  150. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +7 -5
  151. package/es/common/avatarsizes.module.css +16 -16
  152. package/es/common/customscroll.module.css +2 -0
  153. package/es/common/reset.module.css +1 -0
  154. package/es/deprecated/AdvancedMultiSelect.module.css +16 -16
  155. package/es/deprecated/PortalLayer/PortalLayer.js +25 -20
  156. package/es/semantic/Button/Button.js +3 -2
  157. package/es/utils/Common.js +54 -9
  158. package/es/utils/ContextOptimizer.js +4 -5
  159. package/es/utils/__tests__/debounce.spec.js +2 -2
  160. package/es/utils/constructFullName.js +2 -0
  161. package/es/utils/css/compileClassNames.js +5 -0
  162. package/es/utils/css/mergeStyle.js +7 -6
  163. package/es/utils/css/utils.js +1 -0
  164. package/es/utils/datetime/GMTZones.js +48 -0
  165. package/es/utils/datetime/common.js +31 -7
  166. package/es/utils/debounce.js +5 -1
  167. package/es/utils/dropDownUtils.js +68 -11
  168. package/es/utils/getInitial.js +4 -0
  169. package/es/utils/shallowEqual.js +6 -0
  170. package/lib/Accordion/Accordion.js +42 -18
  171. package/lib/Accordion/AccordionItem.js +40 -18
  172. package/lib/Accordion/__tests__/Accordion.spec.js +3 -0
  173. package/lib/Accordion/index.js +3 -0
  174. package/lib/Accordion/props/propTypes.js +3 -0
  175. package/lib/Animation/Animation.js +38 -18
  176. package/lib/Animation/__tests__/Animation.spec.js +11 -7
  177. package/lib/Animation/props/propTypes.js +3 -0
  178. package/lib/AppContainer/AppContainer.js +56 -21
  179. package/lib/AppContainer/props/propTypes.js +3 -0
  180. package/lib/Avatar/Avatar.js +78 -38
  181. package/lib/Avatar/Avatar.module.css +8 -8
  182. package/lib/Avatar/__tests__/Avatar.spec.js +44 -0
  183. package/lib/Avatar/props/propTypes.js +3 -0
  184. package/lib/AvatarTeam/AvatarTeam.js +52 -30
  185. package/lib/AvatarTeam/AvatarTeam.module.css +33 -32
  186. package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +13 -0
  187. package/lib/AvatarTeam/props/propTypes.js +3 -0
  188. package/lib/Button/Button.js +31 -20
  189. package/lib/Button/css/Button.module.css +49 -48
  190. package/lib/Button/css/cssJSLogic.js +18 -17
  191. package/lib/Button/index.js +3 -0
  192. package/lib/Button/props/defaultProps.js +2 -0
  193. package/lib/Button/props/propTypes.js +3 -0
  194. package/lib/Buttongroup/Buttongroup.js +32 -12
  195. package/lib/Buttongroup/Buttongroup.module.css +10 -10
  196. package/lib/Buttongroup/__test__/Buttongroup.spec.js +10 -0
  197. package/lib/Buttongroup/props/propTypes.js +3 -0
  198. package/lib/Card/Card.js +102 -46
  199. package/lib/Card/__tests__/Card.spec.js +10 -1
  200. package/lib/Card/index.js +4 -0
  201. package/lib/Card/props/propTypes.js +3 -0
  202. package/lib/CheckBox/CheckBox.js +71 -47
  203. package/lib/CheckBox/CheckBox.module.css +14 -14
  204. package/lib/CheckBox/__tests__/CheckBox.spec.js +3 -0
  205. package/lib/CheckBox/props/propTypes.js +3 -0
  206. package/lib/DateTime/CalendarView.js +82 -42
  207. package/lib/DateTime/DateTime.js +248 -160
  208. package/lib/DateTime/DateTime.module.css +32 -32
  209. package/lib/DateTime/DateTimePopupFooter.js +32 -9
  210. package/lib/DateTime/DateTimePopupHeader.js +49 -18
  211. package/lib/DateTime/DateWidget.js +353 -251
  212. package/lib/DateTime/DaysRow.js +28 -6
  213. package/lib/DateTime/Time.js +74 -33
  214. package/lib/DateTime/YearView.js +78 -29
  215. package/lib/DateTime/YearView.module.css +12 -12
  216. package/lib/DateTime/__tests__/CalendarView.spec.js +13 -5
  217. package/lib/DateTime/__tests__/DateTime.spec.js +51 -37
  218. package/lib/DateTime/__tests__/DateWidget.spec.js +10 -8
  219. package/lib/DateTime/common.js +6 -0
  220. package/lib/DateTime/constants.js +1 -0
  221. package/lib/DateTime/dateFormatUtils/dateFormat.js +184 -122
  222. package/lib/DateTime/dateFormatUtils/dateFormats.js +0 -1
  223. package/lib/DateTime/dateFormatUtils/dayChange.js +14 -7
  224. package/lib/DateTime/dateFormatUtils/index.js +74 -16
  225. package/lib/DateTime/dateFormatUtils/monthChange.js +19 -9
  226. package/lib/DateTime/dateFormatUtils/timeChange.js +55 -23
  227. package/lib/DateTime/dateFormatUtils/yearChange.js +22 -11
  228. package/lib/DateTime/index.js +2 -0
  229. package/lib/DateTime/objectUtils.js +24 -20
  230. package/lib/DateTime/props/defaultProps.js +2 -1
  231. package/lib/DateTime/props/propTypes.js +11 -1
  232. package/lib/DateTime/typeChecker.js +4 -0
  233. package/lib/DateTime/validator.js +73 -10
  234. package/lib/DropBox/DropBox.js +34 -10
  235. package/lib/DropBox/DropBoxElement/DropBoxElement.js +58 -37
  236. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +42 -41
  237. package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +41 -33
  238. package/lib/DropBox/DropBoxElement/props/propTypes.js +3 -0
  239. package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +14 -9
  240. package/lib/DropBox/__tests__/DropBox.spec.js +6 -2
  241. package/lib/DropBox/css/cssJSLogic.js +3 -1
  242. package/lib/DropBox/props/defaultProps.js +8 -4
  243. package/lib/DropBox/props/propTypes.js +10 -4
  244. package/lib/DropDown/DropDown.js +52 -8
  245. package/lib/DropDown/DropDown.module.css +2 -2
  246. package/lib/DropDown/DropDownHeading.js +39 -20
  247. package/lib/DropDown/DropDownHeading.module.css +5 -5
  248. package/lib/DropDown/DropDownItem.js +42 -20
  249. package/lib/DropDown/DropDownItem.module.css +7 -7
  250. package/lib/DropDown/DropDownSearch.js +40 -17
  251. package/lib/DropDown/DropDownSearch.module.css +3 -3
  252. package/lib/DropDown/DropDownSeparator.js +24 -4
  253. package/lib/DropDown/DropDownSeparator.module.css +2 -2
  254. package/lib/DropDown/__tests__/DropDown.spec.js +15 -9
  255. package/lib/DropDown/__tests__/DropDownItem.spec.js +9 -4
  256. package/lib/DropDown/__tests__/DropDownSearch.spec.js +3 -0
  257. package/lib/DropDown/index.js +9 -0
  258. package/lib/DropDown/props/propTypes.js +6 -4
  259. package/lib/Heading/Heading.js +37 -15
  260. package/lib/Heading/Heading.module.css +1 -1
  261. package/lib/Heading/props/propTypes.js +3 -0
  262. package/lib/Label/Label.js +41 -27
  263. package/lib/Label/Label.module.css +6 -6
  264. package/lib/Label/__tests__/Label.spec.js +14 -1
  265. package/lib/Label/props/propTypes.js +4 -4
  266. package/lib/Layout/Box.js +31 -11
  267. package/lib/Layout/Container.js +29 -10
  268. package/lib/Layout/__tests__/Box.spec.js +65 -49
  269. package/lib/Layout/__tests__/Container.spec.js +67 -50
  270. package/lib/Layout/index.js +3 -0
  271. package/lib/Layout/props/propTypes.js +3 -0
  272. package/lib/Layout/utils.js +10 -0
  273. package/lib/ListItem/ListContainer.js +49 -28
  274. package/lib/ListItem/ListItem.js +70 -46
  275. package/lib/ListItem/ListItem.module.css +37 -37
  276. package/lib/ListItem/ListItemWithAvatar.js +76 -49
  277. package/lib/ListItem/ListItemWithCheckBox.js +64 -39
  278. package/lib/ListItem/ListItemWithIcon.js +69 -45
  279. package/lib/ListItem/ListItemWithRadio.js +65 -41
  280. package/lib/ListItem/index.js +7 -0
  281. package/lib/ListItem/props/propTypes.js +6 -4
  282. package/lib/Modal/Modal.js +46 -11
  283. package/lib/Modal/props/propTypes.js +3 -0
  284. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +295 -167
  285. package/lib/MultiSelect/AdvancedMultiSelect.js +203 -125
  286. package/lib/MultiSelect/EmptyState.js +46 -25
  287. package/lib/MultiSelect/MultiSelect.js +324 -206
  288. package/lib/MultiSelect/MultiSelect.module.css +25 -24
  289. package/lib/MultiSelect/MultiSelectHeader.js +31 -9
  290. package/lib/MultiSelect/MultiSelectWithAvatar.js +106 -64
  291. package/lib/MultiSelect/SelectedOptions.js +44 -18
  292. package/lib/MultiSelect/SelectedOptions.module.css +4 -4
  293. package/lib/MultiSelect/Suggestions.js +65 -33
  294. package/lib/MultiSelect/__tests__/MultiSelect.spec.js +86 -75
  295. package/lib/MultiSelect/index.js +5 -0
  296. package/lib/MultiSelect/props/defaultProps.js +2 -0
  297. package/lib/MultiSelect/props/propTypes.js +5 -0
  298. package/lib/PopOver/PopOver.js +95 -49
  299. package/lib/PopOver/__tests__/PopOver.spec.js +4 -1
  300. package/lib/PopOver/index.js +4 -0
  301. package/lib/PopOver/props/propTypes.js +3 -0
  302. package/lib/Popup/Popup.js +159 -82
  303. package/lib/Popup/__tests__/Popup.spec.js +44 -9
  304. package/lib/Popup/viewPort.js +28 -14
  305. package/lib/Provider/AvatarSize.js +4 -0
  306. package/lib/Provider/Config.js +2 -0
  307. package/lib/Provider/CssProvider.js +4 -0
  308. package/lib/Provider/IdProvider.js +17 -6
  309. package/lib/Provider/LibraryContext.js +35 -15
  310. package/lib/Provider/LibraryContextInit.js +4 -0
  311. package/lib/Provider/NumberGenerator/NumberGenerator.js +44 -15
  312. package/lib/Provider/ZindexProvider.js +15 -3
  313. package/lib/Provider/index.js +5 -0
  314. package/lib/Radio/Radio.js +62 -39
  315. package/lib/Radio/Radio.module.css +9 -9
  316. package/lib/Radio/__tests__/Radiospec.js +9 -5
  317. package/lib/Radio/props/propTypes.js +3 -0
  318. package/lib/Responsive/CustomResponsive.js +73 -28
  319. package/lib/Responsive/RefWrapper.js +17 -11
  320. package/lib/Responsive/ResizeComponent.js +63 -39
  321. package/lib/Responsive/ResizeObserver.js +24 -10
  322. package/lib/Responsive/Responsive.js +81 -31
  323. package/lib/Responsive/index.js +4 -0
  324. package/lib/Responsive/props/propTypes.js +3 -0
  325. package/lib/Responsive/sizeObservers.js +53 -17
  326. package/lib/Responsive/utils/index.js +11 -3
  327. package/lib/Responsive/utils/shallowCompare.js +11 -2
  328. package/lib/Responsive/windowResizeObserver.js +8 -0
  329. package/lib/ResponsiveDropBox/ResponsiveDropBox.js +45 -17
  330. package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +1 -1
  331. package/lib/ResponsiveDropBox/props/propTypes.js +3 -0
  332. package/lib/Ribbon/Ribbon.js +34 -14
  333. package/lib/Ribbon/Ribbon.module.css +44 -42
  334. package/lib/Ribbon/__tests__/Ribbon.spec.js +22 -0
  335. package/lib/Ribbon/props/propTypes.js +3 -0
  336. package/lib/RippleEffect/RippleEffect.js +18 -10
  337. package/lib/RippleEffect/props/propTypes.js +3 -0
  338. package/lib/Select/GroupSelect.js +230 -131
  339. package/lib/Select/Select.js +291 -209
  340. package/lib/Select/Select.module.css +19 -19
  341. package/lib/Select/SelectWithAvatar.js +103 -57
  342. package/lib/Select/SelectWithIcon.js +133 -77
  343. package/lib/Select/__tests__/Select.spec.js +134 -92
  344. package/lib/Select/index.js +5 -0
  345. package/lib/Select/props/defaultProps.js +5 -4
  346. package/lib/Select/props/propTypes.js +4 -0
  347. package/lib/Stencils/Stencils.js +30 -11
  348. package/lib/Stencils/Stencils.module.css +13 -13
  349. package/lib/Stencils/__tests__/Stencils.spec.js +12 -0
  350. package/lib/Stencils/props/propTypes.js +3 -0
  351. package/lib/Switch/Switch.js +57 -34
  352. package/lib/Switch/Switch.module.css +22 -22
  353. package/lib/Switch/props/propTypes.js +3 -0
  354. package/lib/Tab/Tab.js +41 -28
  355. package/lib/Tab/Tab.module.css +10 -10
  356. package/lib/Tab/TabContent.js +12 -5
  357. package/lib/Tab/TabContentWrapper.js +13 -6
  358. package/lib/Tab/TabWrapper.js +37 -19
  359. package/lib/Tab/Tabs.js +172 -98
  360. package/lib/Tab/Tabs.module.css +12 -12
  361. package/lib/Tab/__tests__/Tab.spec.js +67 -58
  362. package/lib/Tab/__tests__/TabContent.spec.js +10 -6
  363. package/lib/Tab/__tests__/TabContentWrapper.spec.js +28 -20
  364. package/lib/Tab/__tests__/TabWrapper.spec.js +12 -0
  365. package/lib/Tab/__tests__/Tabs.spec.js +53 -39
  366. package/lib/Tab/index.js +6 -0
  367. package/lib/Tab/props/propTypes.js +3 -0
  368. package/lib/Tag/Tag.js +72 -43
  369. package/lib/Tag/Tag.module.css +20 -20
  370. package/lib/Tag/__tests__/Tag.spec.js +14 -8
  371. package/lib/Tag/props/propTypes.js +3 -0
  372. package/lib/TextBox/TextBox.js +86 -60
  373. package/lib/TextBox/TextBox.module.css +15 -14
  374. package/lib/TextBox/__tests__/TextBox.spec.js +14 -4
  375. package/lib/TextBox/props/propTypes.js +6 -4
  376. package/lib/TextBoxIcon/TextBoxIcon.js +79 -52
  377. package/lib/TextBoxIcon/TextBoxIcon.module.css +2 -1
  378. package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +14 -4
  379. package/lib/TextBoxIcon/props/propTypes.js +3 -0
  380. package/lib/Textarea/Textarea.js +55 -30
  381. package/lib/Textarea/Textarea.module.css +21 -21
  382. package/lib/Textarea/__tests__/Textarea.spec.js +14 -2
  383. package/lib/Textarea/props/propTypes.js +3 -0
  384. package/lib/Tooltip/Tooltip.js +94 -31
  385. package/lib/Tooltip/Tooltip.module.css +10 -3
  386. package/lib/Tooltip/__tests__/Tooltip.spec.js +24 -3
  387. package/lib/Tooltip/props/propTypes.js +3 -0
  388. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +40 -16
  389. package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
  390. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +53 -25
  391. package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
  392. package/lib/VelocityAnimation/index.js +3 -0
  393. package/lib/common/avatarsizes.module.css +16 -16
  394. package/lib/common/customscroll.module.css +2 -0
  395. package/lib/common/reset.module.css +1 -0
  396. package/lib/css.js +40 -0
  397. package/lib/deprecated/AdvancedMultiSelect.module.css +16 -16
  398. package/lib/deprecated/PortalLayer/PortalLayer.js +47 -24
  399. package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
  400. package/lib/index.js +57 -0
  401. package/lib/semantic/Button/Button.js +42 -22
  402. package/lib/semantic/Button/props/propTypes.js +3 -0
  403. package/lib/semantic/index.js +2 -0
  404. package/lib/utils/Common.js +108 -18
  405. package/lib/utils/ContextOptimizer.js +16 -10
  406. package/lib/utils/__tests__/constructFullName.spec.js +1 -0
  407. package/lib/utils/__tests__/debounce.spec.js +3 -2
  408. package/lib/utils/__tests__/getInitial.spec.js +1 -0
  409. package/lib/utils/constructFullName.js +13 -4
  410. package/lib/utils/css/compileClassNames.js +6 -0
  411. package/lib/utils/css/mergeStyle.js +10 -7
  412. package/lib/utils/css/utils.js +8 -0
  413. package/lib/utils/datetime/GMTZones.js +55 -0
  414. package/lib/utils/datetime/common.js +52 -7
  415. package/lib/utils/debounce.js +6 -1
  416. package/lib/utils/dropDownUtils.js +176 -60
  417. package/lib/utils/dummyFunction.js +2 -0
  418. package/lib/utils/getHTMLFontSize.js +1 -0
  419. package/lib/utils/getInitial.js +6 -0
  420. package/lib/utils/index.js +4 -0
  421. package/lib/utils/scrollTo.js +2 -0
  422. package/lib/utils/shallowEqual.js +8 -0
  423. package/package.json +20 -13
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.isDataTypeOf = exports.getDataType = exports.dataTypes = void 0;
7
+
7
8
  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); }
9
+
8
10
  var dataTypes = {
9
11
  number: 'number',
10
12
  array: 'array',
@@ -17,17 +19,23 @@ var dataTypes = {
17
19
  "boolean": 'boolean'
18
20
  };
19
21
  exports.dataTypes = dataTypes;
22
+
20
23
  var getDataType = function getDataType(data) {
21
24
  var typeofData = _typeof(data);
25
+
22
26
  var isArrayDataType = Array.isArray(data);
27
+
23
28
  if (isArrayDataType) {
24
29
  return dataTypes.array;
25
30
  } else {
26
31
  return dataTypes[typeofData];
27
32
  }
28
33
  };
34
+
29
35
  exports.getDataType = getDataType;
36
+
30
37
  var isDataTypeOf = function isDataTypeOf(data, type) {
31
38
  return getDataType(data) === type;
32
39
  };
40
+
33
41
  exports.isDataTypeOf = isDataTypeOf;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.offsetMap = void 0;
7
+ var offsetMap = {
8
+ 0: 'GMT+00:00 Africa/Abidjan',
9
+ 44: 'GMT+00:00 Africa/Monrovia',
10
+ 60: 'GMT+01:00 Africa/Bangui',
11
+ 120: 'GMT+02:00 Africa/Blantyre',
12
+ 180: 'GMT+03:00 Africa/Addis_Ababa',
13
+ 210: 'GMT+04:30 Asia/Tehran',
14
+ 240: 'GMT+03:00 Asia/Bahrain',
15
+ 270: 'GMT+04:30 Asia/Kabul',
16
+ 300: 'GMT+05:00 Asia/Aqtau',
17
+ '-330': 'GMT+05:30 Asia/Kolkata',
18
+ 360: 'GMT+06:00 Asia/Dacca',
19
+ 390: 'GMT+06:30 Indian/Cocos',
20
+ 420: 'GMT+07:00 Asia/Bangkok',
21
+ 450: 'GMT+08:00 Asia/Singapore',
22
+ 480: 'GMT+08:00 Asia/Hong_Kong',
23
+ 510: 'GMT+08:00 Asia/Harbin',
24
+ 525: 'GMT+08:45 Australia/Eucla',
25
+ 540: 'GMT+09:00 Asia/Chita',
26
+ 570: 'GMT+09:30 Australia/Adelaide',
27
+ 600: 'GMT+10:00 Antarctica/DumontDUrville',
28
+ 660: 'GMT+11:00 Asia/Magadan',
29
+ 690: 'GMT+11:00 Pacific/Norfolk',
30
+ 720: 'GMT+12:00 Asia/Kamchatka',
31
+ 765: 'GMT+12:45 Pacific/Chatham',
32
+ 780: 'GMT+12:00 Asia/Anadyr',
33
+ 840: 'GMT+14:00 Etc/GMT-14',
34
+ '-60': 'GMT-01:00 Etc/GMT+1',
35
+ '-660': 'GMT-11:00 US/Samoa',
36
+ '-600': 'GMT-04:00 America/Anguilla',
37
+ '-240': 'GMT-04:00 America/Antigua',
38
+ '-180': 'GMT-03:00 America/Araguaina',
39
+ '-300': 'GMT-05:00 America/Atikokan',
40
+ '-480': 'GMT-05:00 America/Bahia_Banderas',
41
+ '-360': 'GMT-06:00 America/Belize',
42
+ '-420': 'GMT-06:00 America/Boise',
43
+ '-540': 'GMT-07:00 America/Dawson',
44
+ '-135': 'GMT-04:00 America/Guyana',
45
+ '-120': 'GMT-02:00 Etc/GMT+2',
46
+ '-150': 'GMT-03:00 America/Paramaribo',
47
+ '-210': 'GMT-04:00 America/Santo_Domingo',
48
+ '-720': 'GMT+12:00 Pacific/Kwajalein',
49
+ '-560': 'GMT+14:00 Pacific/Kiritimati',
50
+ '-510': 'GMT-09:30 Pacific/Marquesas',
51
+ '-630': 'GMT-11:00 Pacific/Niue',
52
+ '-450': 'GMT-08:00 Pacific/Pitcairn',
53
+ '-570': 'GMT-10:00 Pacific/Rarotonga'
54
+ };
55
+ exports.offsetMap = offsetMap;
@@ -8,6 +8,7 @@ exports.getDiffObj = getDiffObj;
8
8
  exports.getI18NInfo = getI18NInfo;
9
9
  exports.getI18NValue = getI18NValue;
10
10
  exports.getMonthEnd = getMonthEnd;
11
+ exports.getTimeOffset = getTimeOffset;
11
12
  exports.getValues = getValues;
12
13
  exports.isToday = isToday;
13
14
  exports.isTomorrow = isTomorrow;
@@ -17,12 +18,17 @@ exports.isYesterday = isYesterday;
17
18
  exports.pad = pad;
18
19
  exports.replaceI18NValuesWithRegex = replaceI18NValuesWithRegex;
19
20
  exports.unescapeUnicode = unescapeUnicode;
21
+
22
+ var _GMTZones = require("./GMTZones.js");
23
+
20
24
  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); }
25
+
21
26
  var dateFormat = {
22
27
  dayNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
23
28
  monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
24
29
  timeNames: ['a', 'p', 'am', 'pm', 'A', 'P', 'AM', 'PM']
25
30
  };
31
+
26
32
  function pad(n) {
27
33
  var width = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
28
34
  var z = arguments.length > 2 ? arguments[2] : undefined;
@@ -30,8 +36,19 @@ function pad(n) {
30
36
  n = "".concat(n);
31
37
  return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
32
38
  }
39
+
40
+ function getTimeOffset() {
41
+ var GMT = new Date();
42
+ var matchingOffset = Object.keys(_GMTZones.offsetMap).find(function (offset) {
43
+ return GMT.getTimezoneOffset() === Number(offset);
44
+ });
45
+ return matchingOffset ? _GMTZones.offsetMap[matchingOffset].toString().split(' ') : ['', ''];
46
+ }
47
+
33
48
  function formatDate(dateMill, mask) {
34
49
  var date = new Date(dateMill);
50
+ var O = getTimeOffset()[0];
51
+ var Z = getTimeOffset()[1];
35
52
  var d = date.getDate();
36
53
  var D = date.getDay();
37
54
  var m = date.getMonth();
@@ -42,6 +59,7 @@ function formatDate(dateMill, mask) {
42
59
  var L = date.getMilliseconds();
43
60
  var flags = {
44
61
  d: d,
62
+ O: O,
45
63
  dd: pad(d, 2),
46
64
  ddd: dateFormat.dayNames[D],
47
65
  dddd: dateFormat.dayNames[D + 7],
@@ -69,17 +87,23 @@ function formatDate(dateMill, mask) {
69
87
  L: pad(Math.round(L / 10)),
70
88
  t: H < 12 ? dateFormat.timeNames[0] : dateFormat.timeNames[1],
71
89
  A: H < 12 ? dateFormat.timeNames[6] : dateFormat.timeNames[7],
72
- T: H < 12 ? dateFormat.timeNames[4] : dateFormat.timeNames[5]
90
+ a: H < 12 ? dateFormat.timeNames[6] : dateFormat.timeNames[7],
91
+ T: H < 12 ? dateFormat.timeNames[4] : dateFormat.timeNames[5],
92
+ Z: Z,
93
+ VV: Z,
94
+ SSS: pad(L, 3)
73
95
  };
74
- var token = /D{1,4}|d{1,4}|M{1,4}|YYYY|yyyy|YY|yy?|([HhmsA])\1?|[LloSZWN]|\[[^\]]*\]|'[^']*'/g;
96
+ var token = /D{1,4}|d{1,4}|M{1,4}|YYYY|yyyy|YY|O|Z|VV|SSS|yy?|([HhmsAa])\1?|[LloSZWN]|\[[^\]]*\]|'[^']*'/g;
75
97
  var dat = mask.replace(token, function (match) {
76
98
  if (match in flags) {
77
99
  return flags[match];
78
100
  }
101
+
79
102
  return match.slice(1, match.length - 1);
80
103
  });
81
104
  return dat;
82
105
  }
106
+
83
107
  function replaceI18NValuesWithRegex(i18nStr, values) {
84
108
  if (typeof values !== 'undefined') {
85
109
  if (Array.isArray(values)) {
@@ -90,13 +114,16 @@ function replaceI18NValuesWithRegex(i18nStr, values) {
90
114
  i18nStr = i18nStr.replace(new RegExp('\\{0\\}', 'g'), values);
91
115
  }
92
116
  }
117
+
93
118
  return i18nStr;
94
119
  }
120
+
95
121
  function unescapeUnicode(str) {
96
122
  return str.replace(/\\u([a-fA-F0-9]{4})/g, function (g, m1) {
97
123
  return String.fromCharCode(parseInt(m1, 16));
98
124
  });
99
125
  }
126
+
100
127
  function getValues() {
101
128
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
102
129
  var diff = arguments.length > 1 ? arguments[1] : undefined;
@@ -104,31 +131,36 @@ function getValues() {
104
131
  return diff[param];
105
132
  });
106
133
  }
134
+
107
135
  function getI18NValue(i18n) {
108
136
  if (typeof i18n === 'undefined') {
109
137
  return function (key) {
110
138
  return key;
111
139
  };
112
140
  }
141
+
113
142
  return function (key, values) {
114
143
  var i18nStr = i18n[key];
144
+
115
145
  if (i18nStr === undefined) {
116
146
  return key;
117
147
  }
148
+
118
149
  i18nStr = replaceI18NValuesWithRegex(i18nStr, values);
119
150
  return unescapeUnicode(i18nStr);
120
151
  };
121
- }
122
-
123
- // function getValues(params = [], diff) {
152
+ } // function getValues(params = [], diff) {
124
153
  // return params.map(param => {
125
154
  // return diff[param];
126
155
  // });
127
156
  // }
157
+
158
+
128
159
  function getI18NInfo(toDateObj, props, diffObj) {
129
160
  var key = null,
130
- values,
131
- text = null;
161
+ values,
162
+ text = null;
163
+
132
164
  if (typeof props === 'function') {
133
165
  var value = props(diffObj1);
134
166
  key = value.key;
@@ -139,40 +171,50 @@ function getI18NInfo(toDateObj, props, diffObj) {
139
171
  } else if (typeof props === 'string') {
140
172
  text = toDateObj.format(props);
141
173
  }
174
+
142
175
  return {
143
176
  key: key,
144
177
  values: values,
145
178
  text: text
146
179
  };
147
180
  }
181
+
148
182
  function isToday(fromDate, toDate) {
149
183
  var TODAY = toDate.clone().startOf('day');
150
184
  return fromDate.isSame(TODAY, 'd');
151
185
  }
186
+
152
187
  function isYesterday(fromDate, toDate) {
153
188
  var YESTERDAY = toDate.clone().subtract(1, 'days').startOf('day');
154
189
  return fromDate.isSame(YESTERDAY, 'd');
155
190
  }
191
+
156
192
  function isTomorrow(fromDate, toDate) {
157
193
  return isYesterday(toDate, fromDate);
158
194
  }
195
+
159
196
  function isWithinAWeek(fromDate, toDate) {
160
197
  var A_WEEK_OLD = toDate.clone().subtract(7, 'days').startOf('day');
161
198
  return fromDate.isAfter(A_WEEK_OLD);
162
199
  }
200
+
163
201
  function isTwoWeeksOrMore(fromDate, toDate) {
164
202
  return !isWithinAWeek(fromDate, toDate);
165
203
  }
204
+
166
205
  var oneYearInMillis = 31536000000;
167
206
  var oneDayInMillis = 86400000;
168
207
  var oneHourInMillis = 3600000;
169
208
  var oneMinuteInMillis = 60000;
209
+
170
210
  function convertAsNonExponential(number) {
171
211
  if (number.toString().toLowerCase().indexOf('e') !== -1) {
172
212
  return number.toFixed(20);
173
213
  }
214
+
174
215
  return number;
175
216
  }
217
+
176
218
  function getDiffObj(diff) {
177
219
  diff = Math.abs(diff);
178
220
  var diffYears = diff / oneYearInMillis;
@@ -196,11 +238,14 @@ function getDiffObj(diff) {
196
238
  s: diffSeconds
197
239
  };
198
240
  }
241
+
199
242
  function getMonthEnd(month, year) {
200
243
  var monthend = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
201
244
  var isLeapYear = year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
245
+
202
246
  if (month === 1 && isLeapYear) {
203
247
  return 29;
204
248
  }
249
+
205
250
  return monthend[month];
206
251
  }
@@ -4,20 +4,25 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.debounce = debounce;
7
+
7
8
  function debounce(func, wait, immediate) {
8
9
  var timeout;
9
10
  return function () {
10
11
  var context = this,
11
- args = arguments;
12
+ args = arguments;
13
+
12
14
  var later = function later() {
13
15
  timeout = null;
16
+
14
17
  if (!immediate) {
15
18
  func.apply(context, args);
16
19
  }
17
20
  };
21
+
18
22
  var callNow = immediate && !timeout;
19
23
  clearTimeout(timeout);
20
24
  timeout = setTimeout(later, wait);
25
+
21
26
  if (callNow) {
22
27
  func.apply(context, args);
23
28
  }