@zohodesk/components 1.6.0 → 1.6.2

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 (560) hide show
  1. package/README.md +18 -1
  2. package/_react-cli.config.js +24 -0
  3. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +330 -321
  4. package/assets/Appearance/dark/mode/Component_v1_DarkMode.module.css +15 -9
  5. package/assets/Appearance/dark/themes/blue/blue_CTA_DarkModifyCategory.module.css +466 -466
  6. package/assets/Appearance/dark/themes/blue/blue_CTA_DarkTheme.module.css +34 -34
  7. package/assets/Appearance/dark/themes/blue/blue_ComponentTheme_DarkTheme.module.css +33 -29
  8. package/assets/Appearance/dark/themes/green/green_CTA_DarkModifyCategory.module.css +466 -466
  9. package/assets/Appearance/dark/themes/green/green_CTA_DarkTheme.module.css +34 -34
  10. package/assets/Appearance/dark/themes/green/green_ComponentTheme_DarkTheme.module.css +33 -29
  11. package/assets/Appearance/dark/themes/orange/orange_CTA_DarkModifyCategory.module.css +466 -466
  12. package/assets/Appearance/dark/themes/orange/orange_CTA_DarkTheme.module.css +34 -34
  13. package/assets/Appearance/dark/themes/orange/orange_ComponentTheme_DarkTheme.module.css +33 -29
  14. package/assets/Appearance/dark/themes/red/red_CTA_DarkModifyCategory.module.css +466 -466
  15. package/assets/Appearance/dark/themes/red/red_CTA_DarkTheme.module.css +34 -34
  16. package/assets/Appearance/dark/themes/red/red_ComponentTheme_DarkTheme.module.css +33 -29
  17. package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkModifyCategory.module.css +466 -466
  18. package/assets/Appearance/dark/themes/yellow/yellow_CTA_DarkTheme.module.css +34 -34
  19. package/assets/Appearance/dark/themes/yellow/yellow_ComponentTheme_DarkTheme.module.css +33 -29
  20. package/assets/Appearance/light/mode/Component_LightMode.module.css +330 -321
  21. package/assets/Appearance/light/mode/Component_v1_LightMode.module.css +15 -9
  22. package/assets/Appearance/light/themes/blue/blue_CTA_LightModifyCategory.module.css +466 -466
  23. package/assets/Appearance/light/themes/blue/blue_CTA_LightTheme.module.css +34 -34
  24. package/assets/Appearance/light/themes/blue/blue_ComponentTheme_LightTheme.module.css +33 -29
  25. package/assets/Appearance/light/themes/green/green_CTA_LightModifyCategory.module.css +466 -466
  26. package/assets/Appearance/light/themes/green/green_CTA_LightTheme.module.css +34 -34
  27. package/assets/Appearance/light/themes/green/green_ComponentTheme_LightTheme.module.css +33 -29
  28. package/assets/Appearance/light/themes/orange/orange_CTA_LightModifyCategory.module.css +466 -466
  29. package/assets/Appearance/light/themes/orange/orange_CTA_LightTheme.module.css +34 -34
  30. package/assets/Appearance/light/themes/orange/orange_ComponentTheme_LightTheme.module.css +33 -29
  31. package/assets/Appearance/light/themes/red/red_CTA_LightModifyCategory.module.css +466 -466
  32. package/assets/Appearance/light/themes/red/red_CTA_LightTheme.module.css +34 -34
  33. package/assets/Appearance/light/themes/red/red_ComponentTheme_LightTheme.module.css +33 -29
  34. package/assets/Appearance/light/themes/yellow/yellow_CTA_LightModifyCategory.module.css +466 -466
  35. package/assets/Appearance/light/themes/yellow/yellow_CTA_LightTheme.module.css +34 -34
  36. package/assets/Appearance/light/themes/yellow/yellow_ComponentTheme_LightTheme.module.css +33 -29
  37. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +330 -321
  38. package/assets/Appearance/pureDark/mode/Component_v1_PureDarkMode.module.css +15 -9
  39. package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkModifyCategory.module.css +466 -466
  40. package/assets/Appearance/pureDark/themes/blue/blue_CTA_PureDarkTheme.module.css +34 -34
  41. package/assets/Appearance/pureDark/themes/blue/blue_ComponentTheme_PureDarkTheme.module.css +33 -29
  42. package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkModifyCategory.module.css +466 -466
  43. package/assets/Appearance/pureDark/themes/green/green_CTA_PureDarkTheme.module.css +34 -34
  44. package/assets/Appearance/pureDark/themes/green/green_ComponentTheme_PureDarkTheme.module.css +33 -29
  45. package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkModifyCategory.module.css +466 -466
  46. package/assets/Appearance/pureDark/themes/orange/orange_CTA_PureDarkTheme.module.css +34 -34
  47. package/assets/Appearance/pureDark/themes/orange/orange_ComponentTheme_PureDarkTheme.module.css +33 -29
  48. package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkModifyCategory.module.css +466 -466
  49. package/assets/Appearance/pureDark/themes/red/red_CTA_PureDarkTheme.module.css +34 -34
  50. package/assets/Appearance/pureDark/themes/red/red_ComponentTheme_PureDarkTheme.module.css +33 -29
  51. package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkModifyCategory.module.css +466 -466
  52. package/assets/Appearance/pureDark/themes/yellow/yellow_CTA_PureDarkTheme.module.css +34 -34
  53. package/assets/Appearance/pureDark/themes/yellow/yellow_ComponentTheme_PureDarkTheme.module.css +33 -29
  54. package/assets/Contrast/darkContrastLightness.module.css +36 -36
  55. package/assets/Contrast/lightContrastLightness.module.css +36 -36
  56. package/assets/Contrast/pureDarkContrastLightness.module.css +36 -36
  57. package/cbt.config.js +41 -0
  58. package/es/AppContainer/AppContainer.js +9 -10
  59. package/es/Avatar/Avatar.js +5 -4
  60. package/es/Avatar/Avatar.module.css +8 -8
  61. package/es/AvatarTeam/AvatarTeam.js +7 -7
  62. package/es/AvatarTeam/AvatarTeam.module.css +30 -30
  63. package/es/Button/Button.js +6 -5
  64. package/es/Button/css/Button.module.css +19 -19
  65. package/es/Buttongroup/Buttongroup.js +0 -0
  66. package/es/Buttongroup/Buttongroup.module.css +5 -3
  67. package/es/Card/Card.js +0 -0
  68. package/es/CheckBox/CheckBox.js +11 -11
  69. package/es/ColorSelect/ColorMultiSelect.js +4 -2
  70. package/es/ColorSelect/ColorSingleSelect.js +4 -2
  71. package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.js +4 -3
  72. package/es/ColorSelect/_shared/ColorIndicator/ColorIndicator.module.css +2 -2
  73. package/es/ColorSelect/_shared/ColoredTag/ColoredTag.js +4 -2
  74. package/es/ColorSelect/_shared/helpers/renderHelpers.js +6 -4
  75. package/es/DateTime/CalendarView.js +0 -0
  76. package/es/DateTime/DateTime.js +5 -4
  77. package/es/DateTime/DateWidget.js +5 -4
  78. package/es/DateTime/Time.js +11 -12
  79. package/es/DateTime/YearView.js +0 -0
  80. package/es/DateTime/common.js +0 -0
  81. package/es/DateTime/index.js +0 -0
  82. package/es/DateTime/objectUtils.js +0 -0
  83. package/es/DateTime/typeChecker.js +0 -0
  84. package/es/DateTime/validator.js +0 -0
  85. package/es/DropBox/DropBox.js +11 -10
  86. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -3
  87. package/es/DropDown/DropDown.js +1 -2
  88. package/es/DropDown/DropDownHeading.js +0 -0
  89. package/es/DropDown/DropDownHeading.module.css +4 -4
  90. package/es/DropDown/DropDownItem.js +0 -0
  91. package/es/DropDown/DropDownItem.module.css +4 -4
  92. package/es/DropDown/DropDownSearch.js +0 -0
  93. package/es/DropDown/DropDownSearch.module.css +3 -3
  94. package/es/DropDown/DropDownSeparator.js +0 -0
  95. package/es/Label/Label.js +7 -7
  96. package/es/Label/Label.module.css +5 -5
  97. package/es/Layout/Box.js +0 -0
  98. package/es/Layout/Container.js +0 -0
  99. package/es/Layout/utils.js +0 -0
  100. package/es/ListItem/ListContainer.js +5 -6
  101. package/es/ListItem/ListItem.js +5 -4
  102. package/es/ListItem/ListItem.module.css +30 -19
  103. package/es/ListItem/ListItemWithAvatar.js +10 -11
  104. package/es/ListItem/ListItemWithCheckBox.js +5 -4
  105. package/es/ListItem/ListItemWithIcon.js +5 -4
  106. package/es/ListItem/ListItemWithRadio.js +5 -4
  107. package/es/Modal/Modal.js +5 -4
  108. package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -0
  109. package/es/MultiSelect/AdvancedMultiSelect.js +11 -8
  110. package/es/MultiSelect/EmptyState.js +16 -2
  111. package/es/MultiSelect/MultiSelect.js +10 -8
  112. package/es/MultiSelect/MultiSelectWithAvatar.js +7 -4
  113. package/es/MultiSelect/SelectedOptions.js +8 -6
  114. package/es/MultiSelect/Suggestions.js +8 -6
  115. package/es/MultiSelect/props/propTypes.js +3 -0
  116. package/es/Popup/Popup.js +0 -0
  117. package/es/Provider/LibraryContext.js +11 -3
  118. package/es/Radio/Radio.js +11 -11
  119. package/es/Radio/Radio.module.css +9 -8
  120. package/es/Responsive/CustomResponsive.js +0 -0
  121. package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -2
  122. package/es/Ribbon/Ribbon.js +0 -0
  123. package/es/Ribbon/Ribbon.module.css +25 -20
  124. package/es/Select/GroupSelect.js +13 -12
  125. package/es/Select/Select.js +14 -12
  126. package/es/Select/SelectWithAvatar.js +13 -12
  127. package/es/Select/SelectWithIcon.js +10 -8
  128. package/es/Select/props/propTypes.js +3 -0
  129. package/es/Stencils/Stencils.js +0 -0
  130. package/es/Stencils/Stencils.module.css +11 -11
  131. package/es/Switch/Switch.js +8 -8
  132. package/es/Tab/Tab.js +5 -4
  133. package/es/Tab/TabContentWrapper.js +5 -4
  134. package/es/Tab/TabWrapper.js +4 -2
  135. package/es/Tab/Tabs.js +19 -20
  136. package/es/Tag/Tag.js +11 -12
  137. package/es/Tag/Tag.module.css +18 -17
  138. package/es/TextBox/TextBox.js +5 -5
  139. package/es/TextBox/TextBox.module.css +9 -9
  140. package/es/TextBoxIcon/TextBoxIcon.js +4 -2
  141. package/es/TextBoxIcon/TextBoxIcon.module.css +1 -1
  142. package/es/Textarea/Textarea.js +7 -6
  143. package/es/Textarea/Textarea.module.css +18 -18
  144. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +5 -4
  145. package/es/common/avatarsizes.module.css +16 -16
  146. package/es/common/common.module.css +2 -2
  147. package/es/deprecated/PortalLayer/PortalLayer.js +6 -8
  148. package/es/deprecated/Switch/Switch.js +8 -8
  149. package/es/shared/ArrowIcon/ArrowIcon.js +6 -6
  150. package/es/shared/InputFieldLine/InputFieldLine.js +6 -6
  151. package/es/shared/InputFieldLine/InputFieldLine.module.css +2 -2
  152. package/es/utils/Common.js +0 -0
  153. package/es/utils/dropDownUtils.js +0 -0
  154. package/es/v1/Label/Label.js +98 -33
  155. package/es/v1/Label/__tests__/Label.spec.js +214 -0
  156. package/es/v1/Label/__tests__/__snapshots__/Label.spec.js.snap +457 -0
  157. package/es/v1/Label/constants/index.js +8 -0
  158. package/es/v1/Label/css/Label_v1.module.css +42 -0
  159. package/es/v1/Label/css/cssJSLogic.js +44 -0
  160. package/es/v1/Label/props/defaultProps.js +14 -9
  161. package/es/v1/Label/props/propTypes.js +34 -14
  162. package/es/v1/Switch/Switch.js +7 -6
  163. package/es/v1/Switch/css/Switch_v1.module.css +28 -28
  164. package/lib/Avatar/Avatar.module.css +8 -8
  165. package/lib/AvatarTeam/AvatarTeam.js +0 -0
  166. package/lib/AvatarTeam/AvatarTeam.module.css +30 -30
  167. package/lib/Button/Button.js +0 -0
  168. package/lib/Button/css/Button.module.css +19 -19
  169. package/lib/Buttongroup/Buttongroup.js +0 -0
  170. package/lib/Buttongroup/Buttongroup.module.css +5 -3
  171. package/lib/Card/Card.js +0 -0
  172. package/lib/CheckBox/CheckBox.js +0 -0
  173. package/lib/ColorSelect/_shared/ColorIndicator/ColorIndicator.module.css +2 -2
  174. package/lib/DateTime/CalendarView.js +0 -0
  175. package/lib/DateTime/DateTime.js +0 -0
  176. package/lib/DateTime/DateWidget.js +0 -0
  177. package/lib/DateTime/YearView.js +0 -0
  178. package/lib/DateTime/common.js +0 -0
  179. package/lib/DateTime/index.js +0 -0
  180. package/lib/DateTime/objectUtils.js +0 -0
  181. package/lib/DateTime/typeChecker.js +0 -0
  182. package/lib/DateTime/validator.js +0 -0
  183. package/lib/DropBox/DropBox.js +0 -0
  184. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +6 -3
  185. package/lib/DropDown/DropDown.js +0 -0
  186. package/lib/DropDown/DropDownHeading.js +0 -0
  187. package/lib/DropDown/DropDownHeading.module.css +4 -4
  188. package/lib/DropDown/DropDownItem.js +0 -0
  189. package/lib/DropDown/DropDownItem.module.css +4 -4
  190. package/lib/DropDown/DropDownSearch.js +0 -0
  191. package/lib/DropDown/DropDownSearch.module.css +3 -3
  192. package/lib/DropDown/DropDownSeparator.js +0 -0
  193. package/lib/Label/Label.js +0 -0
  194. package/lib/Label/Label.module.css +5 -5
  195. package/lib/Layout/Box.js +0 -0
  196. package/lib/Layout/Container.js +0 -0
  197. package/lib/Layout/utils.js +0 -0
  198. package/lib/ListItem/ListItem.js +0 -0
  199. package/lib/ListItem/ListItem.module.css +30 -19
  200. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +2 -0
  201. package/lib/MultiSelect/AdvancedMultiSelect.js +2 -0
  202. package/lib/MultiSelect/EmptyState.js +17 -2
  203. package/lib/MultiSelect/MultiSelect.js +2 -0
  204. package/lib/MultiSelect/MultiSelectWithAvatar.js +2 -0
  205. package/lib/MultiSelect/props/propTypes.js +3 -0
  206. package/lib/Popup/Popup.js +0 -0
  207. package/lib/Provider/LibraryContext.js +11 -3
  208. package/lib/Radio/Radio.js +0 -0
  209. package/lib/Radio/Radio.module.css +9 -8
  210. package/lib/Responsive/CustomResponsive.js +0 -0
  211. package/lib/Ribbon/Ribbon.js +0 -0
  212. package/lib/Ribbon/Ribbon.module.css +25 -20
  213. package/lib/Select/GroupSelect.js +2 -0
  214. package/lib/Select/Select.js +2 -0
  215. package/lib/Select/SelectWithAvatar.js +2 -0
  216. package/lib/Select/SelectWithIcon.js +2 -0
  217. package/lib/Select/props/propTypes.js +3 -0
  218. package/lib/Stencils/Stencils.js +0 -0
  219. package/lib/Stencils/Stencils.module.css +11 -11
  220. package/lib/Switch/Switch.js +0 -0
  221. package/lib/Tag/Tag.js +0 -0
  222. package/lib/Tag/Tag.module.css +18 -17
  223. package/lib/TextBox/TextBox.js +0 -0
  224. package/lib/TextBox/TextBox.module.css +9 -9
  225. package/lib/TextBoxIcon/TextBoxIcon.js +0 -0
  226. package/lib/TextBoxIcon/TextBoxIcon.module.css +1 -1
  227. package/lib/Textarea/Textarea.js +0 -0
  228. package/lib/Textarea/Textarea.module.css +18 -18
  229. package/lib/common/avatarsizes.module.css +16 -16
  230. package/lib/common/common.module.css +2 -2
  231. package/lib/deprecated/Switch/Switch.js +0 -0
  232. package/lib/shared/InputFieldLine/InputFieldLine.module.css +2 -2
  233. package/lib/utils/Common.js +0 -0
  234. package/lib/utils/dropDownUtils.js +0 -0
  235. package/lib/v1/Label/Label.js +104 -36
  236. package/lib/v1/Label/__tests__/Label.spec.js +221 -0
  237. package/lib/v1/Label/__tests__/__snapshots__/Label.spec.js.snap +457 -0
  238. package/lib/v1/Label/constants/index.js +16 -0
  239. package/lib/v1/Label/css/Label_v1.module.css +42 -0
  240. package/lib/v1/Label/css/cssJSLogic.js +38 -0
  241. package/lib/v1/Label/props/defaultProps.js +16 -11
  242. package/lib/v1/Label/props/propTypes.js +36 -16
  243. package/lib/v1/Switch/css/Switch_v1.module.css +28 -28
  244. package/package.json +15 -20
  245. package/es/v1/Accordion/Accordion.js +0 -66
  246. package/es/v1/Accordion/AccordionItem.js +0 -57
  247. package/es/v1/Accordion/index.js +0 -2
  248. package/es/v1/Accordion/props/defaultProps.js +0 -12
  249. package/es/v1/Accordion/props/propTypes.js +0 -33
  250. package/es/v1/Animation/Animation.js +0 -45
  251. package/es/v1/Animation/props/defaultProps.js +0 -7
  252. package/es/v1/Animation/props/propTypes.js +0 -12
  253. package/es/v1/Animation/utils.js +0 -83
  254. package/es/v1/AppContainer/AppContainer.js +0 -115
  255. package/es/v1/AppContainer/props/defaultProps.js +0 -10
  256. package/es/v1/AppContainer/props/propTypes.js +0 -17
  257. package/es/v1/Avatar/Avatar.js +0 -139
  258. package/es/v1/Avatar/props/defaultProps.js +0 -17
  259. package/es/v1/Avatar/props/propTypes.js +0 -26
  260. package/es/v1/AvatarTeam/AvatarTeam.js +0 -70
  261. package/es/v1/AvatarTeam/props/defaultProps.js +0 -17
  262. package/es/v1/AvatarTeam/props/propTypes.js +0 -27
  263. package/es/v1/Button/Button.js +0 -67
  264. package/es/v1/Button/props/defaultProps.js +0 -18
  265. package/es/v1/Button/props/propTypes.js +0 -28
  266. package/es/v1/Buttongroup/Buttongroup.js +0 -31
  267. package/es/v1/Buttongroup/props/defaultProps.js +0 -6
  268. package/es/v1/Buttongroup/props/propTypes.js +0 -9
  269. package/es/v1/Card/Card.js +0 -237
  270. package/es/v1/Card/index.js +0 -4
  271. package/es/v1/Card/props/defaultProps.js +0 -25
  272. package/es/v1/Card/props/propTypes.js +0 -48
  273. package/es/v1/CheckBox/CheckBox.js +0 -161
  274. package/es/v1/CheckBox/props/defaultProps.js +0 -18
  275. package/es/v1/CheckBox/props/propTypes.js +0 -41
  276. package/es/v1/DateTime/CalendarView.js +0 -254
  277. package/es/v1/DateTime/DateTime.js +0 -779
  278. package/es/v1/DateTime/DateTimePopupFooter.js +0 -47
  279. package/es/v1/DateTime/DateTimePopupHeader.js +0 -105
  280. package/es/v1/DateTime/DateWidget.js +0 -1134
  281. package/es/v1/DateTime/DaysRow.js +0 -32
  282. package/es/v1/DateTime/Time.js +0 -181
  283. package/es/v1/DateTime/YearView.js +0 -264
  284. package/es/v1/DateTime/index.js +0 -1
  285. package/es/v1/DateTime/props/defaultProps.js +0 -63
  286. package/es/v1/DateTime/props/propTypes.js +0 -206
  287. package/es/v1/DropBox/DropBox.js +0 -79
  288. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +0 -133
  289. package/es/v1/DropBox/DropBoxElement/props/defaultProps.js +0 -18
  290. package/es/v1/DropBox/DropBoxElement/props/propTypes.js +0 -51
  291. package/es/v1/DropBox/props/defaultProps.js +0 -14
  292. package/es/v1/DropBox/props/propTypes.js +0 -16
  293. package/es/v1/DropBox/utils/isMobilePopover.js +0 -17
  294. package/es/v1/DropDown/DropDown.js +0 -53
  295. package/es/v1/DropDown/DropDownHeading.js +0 -36
  296. package/es/v1/DropDown/DropDownItem.js +0 -56
  297. package/es/v1/DropDown/DropDownSearch.js +0 -58
  298. package/es/v1/DropDown/DropDownSeparator.js +0 -12
  299. package/es/v1/DropDown/props/defaultProps.js +0 -21
  300. package/es/v1/DropDown/props/propTypes.js +0 -66
  301. package/es/v1/Heading/Heading.js +0 -35
  302. package/es/v1/Heading/props/defaultProps.js +0 -5
  303. package/es/v1/Heading/props/propTypes.js +0 -12
  304. package/es/v1/Layout/Box.js +0 -115
  305. package/es/v1/Layout/Container.js +0 -132
  306. package/es/v1/Layout/index.js +0 -2
  307. package/es/v1/Layout/props/defaultProps.js +0 -16
  308. package/es/v1/Layout/props/propTypes.js +0 -46
  309. package/es/v1/ListItem/ListContainer.js +0 -104
  310. package/es/v1/ListItem/ListItem.js +0 -123
  311. package/es/v1/ListItem/ListItemWithAvatar.js +0 -143
  312. package/es/v1/ListItem/ListItemWithCheckBox.js +0 -104
  313. package/es/v1/ListItem/ListItemWithIcon.js +0 -126
  314. package/es/v1/ListItem/ListItemWithRadio.js +0 -105
  315. package/es/v1/ListItem/index.js +0 -6
  316. package/es/v1/ListItem/props/defaultProps.js +0 -97
  317. package/es/v1/ListItem/props/propTypes.js +0 -202
  318. package/es/v1/Modal/Modal.js +0 -125
  319. package/es/v1/Modal/props/defaultProps.js +0 -3
  320. package/es/v1/Modal/props/propTypes.js +0 -7
  321. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +0 -1092
  322. package/es/v1/MultiSelect/AdvancedMultiSelect.js +0 -583
  323. package/es/v1/MultiSelect/EmptyState.js +0 -64
  324. package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +0 -50
  325. package/es/v1/MultiSelect/MobileHeader/props/defaultProps.js +0 -7
  326. package/es/v1/MultiSelect/MobileHeader/props/propTypes.js +0 -7
  327. package/es/v1/MultiSelect/MultiSelect.js +0 -1119
  328. package/es/v1/MultiSelect/MultiSelectHeader.js +0 -32
  329. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +0 -208
  330. package/es/v1/MultiSelect/SelectedOptions.js +0 -84
  331. package/es/v1/MultiSelect/Suggestions.js +0 -141
  332. package/es/v1/MultiSelect/index.js +0 -4
  333. package/es/v1/MultiSelect/props/defaultProps.js +0 -165
  334. package/es/v1/MultiSelect/props/propTypes.js +0 -322
  335. package/es/v1/PopOver/PopOver.js +0 -176
  336. package/es/v1/PopOver/props/defaultProps.js +0 -7
  337. package/es/v1/PopOver/props/propTypes.js +0 -53
  338. package/es/v1/Popup/Popup.js +0 -644
  339. package/es/v1/Radio/Radio.js +0 -130
  340. package/es/v1/Radio/props/defaultProps.js +0 -15
  341. package/es/v1/Radio/props/propTypes.js +0 -40
  342. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +0 -56
  343. package/es/v1/ResponsiveDropBox/props/defaultProps.js +0 -4
  344. package/es/v1/ResponsiveDropBox/props/propTypes.js +0 -8
  345. package/es/v1/Ribbon/Ribbon.js +0 -33
  346. package/es/v1/Ribbon/props/defaultProps.js +0 -9
  347. package/es/v1/Ribbon/props/propTypes.js +0 -11
  348. package/es/v1/RippleEffect/RippleEffect.js +0 -25
  349. package/es/v1/RippleEffect/props/defaultProps.js +0 -10
  350. package/es/v1/RippleEffect/props/propTypes.js +0 -12
  351. package/es/v1/Select/GroupSelect.js +0 -818
  352. package/es/v1/Select/Select.js +0 -975
  353. package/es/v1/Select/SelectWithAvatar.js +0 -356
  354. package/es/v1/Select/SelectWithIcon.js +0 -545
  355. package/es/v1/Select/index.js +0 -4
  356. package/es/v1/Select/props/defaultProps.js +0 -126
  357. package/es/v1/Select/props/propTypes.js +0 -297
  358. package/es/v1/Stencils/Stencils.js +0 -26
  359. package/es/v1/Stencils/props/defaultProps.js +0 -6
  360. package/es/v1/Stencils/props/propTypes.js +0 -7
  361. package/es/v1/Tab/Tab.js +0 -106
  362. package/es/v1/Tab/TabContent.js +0 -30
  363. package/es/v1/Tab/TabContentWrapper.js +0 -33
  364. package/es/v1/Tab/TabWrapper.js +0 -55
  365. package/es/v1/Tab/Tabs.js +0 -619
  366. package/es/v1/Tab/index.js +0 -5
  367. package/es/v1/Tab/props/defaultProps.js +0 -51
  368. package/es/v1/Tab/props/propTypes.js +0 -117
  369. package/es/v1/Tab/v1Tab.module.css +0 -100
  370. package/es/v1/Tab/v1TabContent.module.css +0 -4
  371. package/es/v1/Tab/v1Tabs.module.css +0 -167
  372. package/es/v1/Tag/Tag.js +0 -140
  373. package/es/v1/Tag/props/defaultProps.js +0 -15
  374. package/es/v1/Tag/props/propTypes.js +0 -36
  375. package/es/v1/TextBox/TextBox.js +0 -160
  376. package/es/v1/TextBox/props/defaultProps.js +0 -20
  377. package/es/v1/TextBox/props/propTypes.js +0 -56
  378. package/es/v1/TextBoxIcon/TextBoxIcon.js +0 -166
  379. package/es/v1/TextBoxIcon/props/defaultProps.js +0 -24
  380. package/es/v1/TextBoxIcon/props/propTypes.js +0 -53
  381. package/es/v1/Textarea/Textarea.js +0 -100
  382. package/es/v1/Textarea/props/defaultProps.js +0 -17
  383. package/es/v1/Textarea/props/propTypes.js +0 -31
  384. package/es/v1/Tooltip/Tooltip.js +0 -530
  385. package/es/v1/Tooltip/props/defaultProps.js +0 -4
  386. package/es/v1/Tooltip/props/propTypes.js +0 -5
  387. package/es/v1/Typography/Typography.js +0 -38
  388. package/es/v1/Typography/css/cssJSLogic.js +0 -56
  389. package/es/v1/Typography/css/v1_Typography.module.css +0 -380
  390. package/es/v1/Typography/props/defaultProps.js +0 -8
  391. package/es/v1/Typography/props/propTypes.js +0 -27
  392. package/es/v1/Typography/utils/index.js +0 -50
  393. package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -69
  394. package/es/v1/VelocityAnimation/VelocityAnimation/props/defaultProps.js +0 -7
  395. package/es/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -12
  396. package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +0 -99
  397. package/es/v1/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +0 -15
  398. package/es/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -19
  399. package/es/v1/semantic/Button/Button.js +0 -53
  400. package/es/v1/semantic/Button/props/defaultProps.js +0 -12
  401. package/es/v1/semantic/Button/props/propTypes.js +0 -22
  402. package/es/v1/semantic/index.js +0 -1
  403. package/lib/v1/Accordion/Accordion.js +0 -98
  404. package/lib/v1/Accordion/AccordionItem.js +0 -68
  405. package/lib/v1/Accordion/index.js +0 -23
  406. package/lib/v1/Accordion/props/defaultProps.js +0 -20
  407. package/lib/v1/Accordion/props/propTypes.js +0 -45
  408. package/lib/v1/Animation/Animation.js +0 -61
  409. package/lib/v1/Animation/props/defaultProps.js +0 -14
  410. package/lib/v1/Animation/props/propTypes.js +0 -23
  411. package/lib/v1/Animation/utils.js +0 -94
  412. package/lib/v1/AppContainer/AppContainer.js +0 -146
  413. package/lib/v1/AppContainer/props/defaultProps.js +0 -17
  414. package/lib/v1/AppContainer/props/propTypes.js +0 -28
  415. package/lib/v1/Avatar/Avatar.js +0 -191
  416. package/lib/v1/Avatar/props/defaultProps.js +0 -24
  417. package/lib/v1/Avatar/props/propTypes.js +0 -37
  418. package/lib/v1/AvatarTeam/AvatarTeam.js +0 -81
  419. package/lib/v1/AvatarTeam/props/defaultProps.js +0 -24
  420. package/lib/v1/AvatarTeam/props/propTypes.js +0 -38
  421. package/lib/v1/Button/Button.js +0 -82
  422. package/lib/v1/Button/props/defaultProps.js +0 -27
  423. package/lib/v1/Button/props/propTypes.js +0 -40
  424. package/lib/v1/Buttongroup/Buttongroup.js +0 -44
  425. package/lib/v1/Buttongroup/props/defaultProps.js +0 -13
  426. package/lib/v1/Buttongroup/props/propTypes.js +0 -20
  427. package/lib/v1/Card/Card.js +0 -269
  428. package/lib/v1/Card/index.js +0 -37
  429. package/lib/v1/Card/props/defaultProps.js +0 -35
  430. package/lib/v1/Card/props/propTypes.js +0 -62
  431. package/lib/v1/CheckBox/CheckBox.js +0 -172
  432. package/lib/v1/CheckBox/props/defaultProps.js +0 -25
  433. package/lib/v1/CheckBox/props/propTypes.js +0 -52
  434. package/lib/v1/DateTime/CalendarView.js +0 -322
  435. package/lib/v1/DateTime/DateTime.js +0 -877
  436. package/lib/v1/DateTime/DateTimePopupFooter.js +0 -96
  437. package/lib/v1/DateTime/DateTimePopupHeader.js +0 -166
  438. package/lib/v1/DateTime/DateWidget.js +0 -1163
  439. package/lib/v1/DateTime/DaysRow.js +0 -81
  440. package/lib/v1/DateTime/Time.js +0 -270
  441. package/lib/v1/DateTime/YearView.js +0 -325
  442. package/lib/v1/DateTime/index.js +0 -15
  443. package/lib/v1/DateTime/props/defaultProps.js +0 -76
  444. package/lib/v1/DateTime/props/propTypes.js +0 -238
  445. package/lib/v1/DropBox/DropBox.js +0 -109
  446. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +0 -146
  447. package/lib/v1/DropBox/DropBoxElement/props/defaultProps.js +0 -25
  448. package/lib/v1/DropBox/DropBoxElement/props/propTypes.js +0 -62
  449. package/lib/v1/DropBox/props/defaultProps.js +0 -30
  450. package/lib/v1/DropBox/props/propTypes.js +0 -35
  451. package/lib/v1/DropBox/utils/isMobilePopover.js +0 -25
  452. package/lib/v1/DropDown/DropDown.js +0 -74
  453. package/lib/v1/DropDown/DropDownHeading.js +0 -47
  454. package/lib/v1/DropDown/DropDownItem.js +0 -75
  455. package/lib/v1/DropDown/DropDownSearch.js +0 -77
  456. package/lib/v1/DropDown/DropDownSeparator.js +0 -24
  457. package/lib/v1/DropDown/props/defaultProps.js +0 -31
  458. package/lib/v1/DropDown/props/propTypes.js +0 -87
  459. package/lib/v1/Heading/Heading.js +0 -53
  460. package/lib/v1/Heading/props/defaultProps.js +0 -12
  461. package/lib/v1/Heading/props/propTypes.js +0 -23
  462. package/lib/v1/Layout/Box.js +0 -128
  463. package/lib/v1/Layout/Container.js +0 -145
  464. package/lib/v1/Layout/index.js +0 -23
  465. package/lib/v1/Layout/props/defaultProps.js +0 -24
  466. package/lib/v1/Layout/props/propTypes.js +0 -58
  467. package/lib/v1/ListItem/ListContainer.js +0 -128
  468. package/lib/v1/ListItem/ListItem.js +0 -138
  469. package/lib/v1/ListItem/ListItemWithAvatar.js +0 -167
  470. package/lib/v1/ListItem/ListItemWithCheckBox.js +0 -126
  471. package/lib/v1/ListItem/ListItemWithIcon.js +0 -143
  472. package/lib/v1/ListItem/ListItemWithRadio.js +0 -127
  473. package/lib/v1/ListItem/index.js +0 -55
  474. package/lib/v1/ListItem/props/defaultProps.js +0 -109
  475. package/lib/v1/ListItem/props/propTypes.js +0 -196
  476. package/lib/v1/Modal/Modal.js +0 -166
  477. package/lib/v1/Modal/props/defaultProps.js +0 -10
  478. package/lib/v1/Modal/props/propTypes.js +0 -18
  479. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +0 -1180
  480. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +0 -649
  481. package/lib/v1/MultiSelect/EmptyState.js +0 -112
  482. package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +0 -62
  483. package/lib/v1/MultiSelect/MobileHeader/props/defaultProps.js +0 -14
  484. package/lib/v1/MultiSelect/MobileHeader/props/propTypes.js +0 -18
  485. package/lib/v1/MultiSelect/MultiSelect.js +0 -1202
  486. package/lib/v1/MultiSelect/MultiSelectHeader.js +0 -78
  487. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +0 -262
  488. package/lib/v1/MultiSelect/SelectedOptions.js +0 -130
  489. package/lib/v1/MultiSelect/Suggestions.js +0 -196
  490. package/lib/v1/MultiSelect/index.js +0 -39
  491. package/lib/v1/MultiSelect/props/defaultProps.js +0 -181
  492. package/lib/v1/MultiSelect/props/propTypes.js +0 -350
  493. package/lib/v1/PopOver/PopOver.js +0 -197
  494. package/lib/v1/PopOver/props/defaultProps.js +0 -15
  495. package/lib/v1/PopOver/props/propTypes.js +0 -66
  496. package/lib/v1/Popup/Popup.js +0 -715
  497. package/lib/v1/Radio/Radio.js +0 -141
  498. package/lib/v1/Radio/props/defaultProps.js +0 -22
  499. package/lib/v1/Radio/props/propTypes.js +0 -51
  500. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +0 -79
  501. package/lib/v1/ResponsiveDropBox/props/defaultProps.js +0 -11
  502. package/lib/v1/ResponsiveDropBox/props/propTypes.js +0 -27
  503. package/lib/v1/Ribbon/Ribbon.js +0 -44
  504. package/lib/v1/Ribbon/props/defaultProps.js +0 -16
  505. package/lib/v1/Ribbon/props/propTypes.js +0 -22
  506. package/lib/v1/RippleEffect/RippleEffect.js +0 -40
  507. package/lib/v1/RippleEffect/props/defaultProps.js +0 -17
  508. package/lib/v1/RippleEffect/props/propTypes.js +0 -23
  509. package/lib/v1/Select/GroupSelect.js +0 -894
  510. package/lib/v1/Select/Select.js +0 -1025
  511. package/lib/v1/Select/SelectWithAvatar.js +0 -406
  512. package/lib/v1/Select/SelectWithIcon.js +0 -607
  513. package/lib/v1/Select/index.js +0 -39
  514. package/lib/v1/Select/props/defaultProps.js +0 -125
  515. package/lib/v1/Select/props/propTypes.js +0 -319
  516. package/lib/v1/Stencils/Stencils.js +0 -43
  517. package/lib/v1/Stencils/props/defaultProps.js +0 -13
  518. package/lib/v1/Stencils/props/propTypes.js +0 -18
  519. package/lib/v1/Tab/Tab.js +0 -132
  520. package/lib/v1/Tab/TabContent.js +0 -42
  521. package/lib/v1/Tab/TabContentWrapper.js +0 -47
  522. package/lib/v1/Tab/TabWrapper.js +0 -89
  523. package/lib/v1/Tab/Tabs.js +0 -688
  524. package/lib/v1/Tab/index.js +0 -47
  525. package/lib/v1/Tab/props/defaultProps.js +0 -62
  526. package/lib/v1/Tab/props/propTypes.js +0 -132
  527. package/lib/v1/Tab/v1Tab.module.css +0 -100
  528. package/lib/v1/Tab/v1TabContent.module.css +0 -4
  529. package/lib/v1/Tab/v1Tabs.module.css +0 -167
  530. package/lib/v1/Tag/Tag.js +0 -160
  531. package/lib/v1/Tag/props/defaultProps.js +0 -22
  532. package/lib/v1/Tag/props/propTypes.js +0 -47
  533. package/lib/v1/TextBox/TextBox.js +0 -175
  534. package/lib/v1/TextBox/props/defaultProps.js +0 -27
  535. package/lib/v1/TextBox/props/propTypes.js +0 -62
  536. package/lib/v1/TextBoxIcon/TextBoxIcon.js +0 -206
  537. package/lib/v1/TextBoxIcon/props/defaultProps.js +0 -31
  538. package/lib/v1/TextBoxIcon/props/propTypes.js +0 -72
  539. package/lib/v1/Textarea/Textarea.js +0 -118
  540. package/lib/v1/Textarea/props/defaultProps.js +0 -24
  541. package/lib/v1/Textarea/props/propTypes.js +0 -42
  542. package/lib/v1/Tooltip/Tooltip.js +0 -599
  543. package/lib/v1/Tooltip/props/defaultProps.js +0 -11
  544. package/lib/v1/Tooltip/props/propTypes.js +0 -16
  545. package/lib/v1/Typography/Typography.js +0 -56
  546. package/lib/v1/Typography/css/cssJSLogic.js +0 -48
  547. package/lib/v1/Typography/css/v1_Typography.module.css +0 -380
  548. package/lib/v1/Typography/props/defaultProps.js +0 -15
  549. package/lib/v1/Typography/props/propTypes.js +0 -38
  550. package/lib/v1/Typography/utils/index.js +0 -59
  551. package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +0 -90
  552. package/lib/v1/VelocityAnimation/VelocityAnimation/props/defaultProps.js +0 -14
  553. package/lib/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +0 -23
  554. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +0 -126
  555. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +0 -22
  556. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +0 -30
  557. package/lib/v1/semantic/Button/Button.js +0 -63
  558. package/lib/v1/semantic/Button/props/defaultProps.js +0 -19
  559. package/lib/v1/semantic/Button/props/propTypes.js +0 -33
  560. package/lib/v1/semantic/index.js +0 -15
@@ -1,530 +0,0 @@
1
- import React from 'react';
2
- import { defaultProps } from "./props/defaultProps";
3
- import { propTypes } from "./props/propTypes";
4
- import { getLibraryConfig } from "../../Provider/Config";
5
- import ResizeObserver from "../../Responsive/ResizeObserver";
6
- import selectn from 'selectn';
7
- import { whiteSpaceClassMapping } from "../../utils/cssUtils";
8
- import style from "../../Tooltip/Tooltip.module.css";
9
- export default class Tooltip extends React.Component {
10
- constructor(props) {
11
- super(props);
12
- this.state = {
13
- title: null,
14
- left: 0,
15
- top: 0,
16
- arrowLeft: 0,
17
- isArrowRight: null,
18
- isHtml: false
19
- };
20
- this.handleOver = this.handleOver.bind(this);
21
- this.getToolTipDOM = this.getToolTipDOM.bind(this);
22
- this.reset = this.reset.bind(this);
23
- this.getDirection = document.getElementsByTagName('html')[0];
24
- this.leftRightScreenEdge = this.leftRightScreenEdge.bind(this);
25
- this.topBottomScreenEdge = this.topBottomScreenEdge.bind(this);
26
- this.observer = new ResizeObserver(this.onResize);
27
- this.isResized = true;
28
- this.tooltipContainerClientRect = {};
29
- this.tooltipContainerEl = {};
30
- }
31
-
32
- onResize(sizeOfObservedEl, observedEl) {
33
- this.isResized = true;
34
- }
35
-
36
- observeElement() {
37
- this.tooltipContainerEl = this.getToolTipContainerEl();
38
- this.observer.observe(this.tooltipContainerEl);
39
- }
40
-
41
- unObserveElement() {
42
- this.observer.disconnect();
43
- }
44
-
45
- getClientRectOfContEl(el) {
46
- if (this.isResized) {
47
- return this.setClientRectOfContEl(el);
48
- }
49
-
50
- return this.tooltipContainerClientRect;
51
- }
52
-
53
- setClientRectOfContEl(containerEl) {
54
- this.isResized = false;
55
- this.tooltipContainerClientRect = containerEl.getBoundingClientRect();
56
- return this.tooltipContainerClientRect;
57
- }
58
-
59
- getToolTipContainerEl() {
60
- const getTooltipContainer = getLibraryConfig('getTooltipContainer');
61
- const tooltipContainer = typeof getTooltipContainer === 'function' ? getTooltipContainer() : null;
62
- return tooltipContainer ? tooltipContainer : document.body;
63
- }
64
-
65
- getToolTipDOM(el) {
66
- this.toolTip = el;
67
- }
68
-
69
- reset() {
70
- let {
71
- title
72
- } = this.state;
73
-
74
- if (title !== null) {
75
- this.setState({
76
- title: null,
77
- top: 0,
78
- left: 0
79
- });
80
- }
81
- }
82
- /* left and right screen edge check for top and bottom tooltip position */
83
-
84
-
85
- leftRightScreenEdge(tLeft, toolTipArrowLeft, thisLeft, thisWidth, tooltipoffsetWidth, bodyWidth, rightEdge, bodyLeft) {
86
- if (tLeft - bodyLeft <= 1) {
87
- // top & bottom position left side screen edge case
88
- tLeft = bodyLeft + 2;
89
- toolTipArrowLeft = parseInt(thisLeft - bodyLeft + thisWidth / 2 - 6);
90
- } else if (tLeft - bodyLeft + tooltipoffsetWidth > bodyWidth) {
91
- // top & bottom position right side screen edge case
92
- rightEdge = tLeft + tooltipoffsetWidth - bodyWidth + 2;
93
- tLeft = tLeft + bodyLeft - rightEdge;
94
- toolTipArrowLeft = toolTipArrowLeft - bodyLeft + rightEdge;
95
- } else if (tLeft + tooltipoffsetWidth + tooltipoffsetWidth >= bodyWidth - 2) {
96
- // top & bottom center screen tooltip collide with right edge screen
97
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2);
98
- toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 4);
99
- }
100
-
101
- return {
102
- tLeft,
103
- toolTipArrowLeft,
104
- thisLeft,
105
- thisWidth,
106
- tooltipoffsetWidth,
107
- bodyWidth,
108
- rightEdge
109
- };
110
- }
111
- /* top and bottom screen edge check for left and right tooltip position */
112
-
113
-
114
- topBottomScreenEdge(tTop, toolTipArrowTop, thisTop, thisHeight, tooltipoffsetHeight, bodyHeight, bottomEdge) {
115
- if (tTop <= 1) {
116
- tTop = 2;
117
- toolTipArrowTop = parseInt(thisTop + thisHeight / 2);
118
- } else if (tTop + tooltipoffsetHeight > bodyHeight) {
119
- bottomEdge = tTop + tooltipoffsetHeight - bodyHeight + 2;
120
- tTop -= bottomEdge;
121
- toolTipArrowTop += bottomEdge;
122
- }
123
-
124
- return {
125
- tTop,
126
- toolTipArrowTop,
127
- thisTop,
128
- thisHeight,
129
- tooltipoffsetHeight,
130
- bodyHeight,
131
- bottomEdge
132
- };
133
- }
134
-
135
- handleOver(e, targetElement) {
136
- let containerElement = this.tooltipContainerEl;
137
- let element = e.target;
138
- let titleDiv = element.hasAttribute('data-title') || element.hasAttribute('title') ? element : element.closest('[data-title]') || element.closest('[title]');
139
-
140
- if (titleDiv) {
141
- let title = titleDiv.getAttribute('data-title') || titleDiv.getAttribute('title');
142
- /* if data-title-position is left or right change right and left in rtl case */
143
-
144
- let isPosition = titleDiv.getAttribute('data-title-position');
145
- let elem = this.getDirection;
146
-
147
- if (elem.getAttribute('dir') == 'rtl') {
148
- if (isPosition == 'left') {
149
- isPosition = 'right';
150
- } else if (isPosition == 'right') {
151
- isPosition = 'left';
152
- }
153
- }
154
-
155
- if (title !== '' && title) {
156
- titleDiv.setAttribute('data-title', title);
157
- titleDiv.removeAttribute('title');
158
- let isInputElementType = element.type === 'text';
159
- let elementText = isInputElementType ? element.value : element.innerText;
160
-
161
- if (element.nodeName !== 'I' && elementText && elementText.trim() !== '') {
162
- let isContentDotted = '';
163
-
164
- if (element.scrollWidth !== 0) {
165
- isContentDotted = element.offsetWidth < element.scrollWidth;
166
-
167
- if (!isContentDotted) {
168
- isContentDotted = element.offsetHeight < element.scrollHeight;
169
- } // if (!isContentDotted) {Need to check the code Sivanesh
170
- // isContentDotted = element.offsetHeight < element.scrollHeight;
171
- // }
172
-
173
- } else {
174
- const offWidth = selectn('parentElement.offsetWidth', element) || 0;
175
- const scrollWidth = selectn('parentElement.scrollWidth', element) || 0;
176
- isContentDotted = offWidth < scrollWidth;
177
- }
178
-
179
- let originText = elementText.replace(/\s/g, '').toLowerCase();
180
- let tooltipText = title.replace(/\s/g, '').toLowerCase();
181
- let isDefaultTooltip = element.hasAttribute('data-istitle') || element.hasAttribute('istitle') ? element.getAttribute('data-istitle') || element.getAttribute('istitle') : 'false';
182
- isDefaultTooltip = isDefaultTooltip === 'true';
183
- let isSameText = originText.indexOf(tooltipText) !== -1 ? true : false;
184
-
185
- if (!isContentDotted && isSameText && !isDefaultTooltip) {
186
- return false;
187
- }
188
-
189
- if (isContentDotted && titleDiv.getAttribute('data-dottedTitle')) {
190
- title = titleDiv.getAttribute('data-dottedTitle');
191
- }
192
- }
193
-
194
- let isHtml = titleDiv.getAttribute('data-ishtml');
195
- let dataTooltipnoArrow = titleDiv.getAttribute('data-tooltip-noarrow') === 'true' ? true : false;
196
- let dataTooltipWrap = titleDiv.getAttribute('data-title-wrap') || 'normal'; // values: normal, pre, pre-wrap, pre-line, nowrap, break-spaces
197
-
198
- let clientRect = titleDiv.getBoundingClientRect();
199
- let boxLayout = this.getClientRectOfContEl(containerElement);
200
- this.setState({
201
- title,
202
- isHtml,
203
- dataTooltipnoArrow,
204
- dataTooltipWrap
205
- }, () => {
206
- let tooltip = this.toolTip;
207
-
208
- if (tooltip) {
209
- /* element top, left, height, width */
210
- let thisTop = clientRect.top;
211
- let thisLeft = clientRect.left;
212
- let thisHeight = clientRect.height;
213
- let thisWidth = clientRect.width;
214
- /* box layout left spacing */
215
-
216
- let bodyLeft = boxLayout.left; // let checkTop = thisTop + thisHeight;
217
-
218
- /* element left plus element width */
219
-
220
- let checkLeft = thisLeft + thisWidth;
221
- let tTop;
222
- let tLeft;
223
- let toolTipArrowTop;
224
- let toolTipArrowLeft;
225
- let rightEdge;
226
- let bottomEdge;
227
- let tooltipLeft;
228
- /* offset width, height of body */
229
-
230
- let bodyWidth = containerElement.offsetWidth;
231
- let bodyHeight = containerElement.offsetHeight;
232
- let isArrowHorizontal = false;
233
- let isArrowDown = false;
234
- let isArrowRight = false;
235
- let tWidth = '';
236
- /* overall body height minus element top + element height */
237
-
238
- let thisBottom = bodyHeight - (thisTop + thisHeight);
239
- /* overall body width minus element left + element width */
240
-
241
- let thisRight = bodyWidth - (thisLeft + thisWidth);
242
- /* tooltip width and height */
243
-
244
- let tooltipoffsetWidth = tooltip.offsetWidth;
245
- let tooltipoffsetHeight = tooltip.offsetHeight;
246
-
247
- if (isPosition) {
248
- if (isPosition == 'top') {
249
- /* if top does not have enough space show tooltip in bottom area */
250
- if (thisTop <= tooltipoffsetHeight + 5) {
251
- /* if top space is larger than bottom space show tooltip in top area */
252
- if (thisTop > thisBottom) {
253
- tTop = parseInt(thisTop - (tooltipoffsetHeight + 10));
254
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2 + 2);
255
- toolTipArrowTop = parseInt(tooltipoffsetHeight - 4);
256
- toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
257
- isArrowDown = true;
258
- } else {
259
- /* bottom position */
260
- tTop = parseInt(thisTop + (thisHeight + 10));
261
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2 + 2);
262
- toolTipArrowTop = -4;
263
- toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
264
- isArrowDown = false;
265
- }
266
- } else {
267
- /* if top have enough space show tooltip in top area */
268
- tTop = parseInt(thisTop - (tooltipoffsetHeight + 10));
269
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2 + 2);
270
- toolTipArrowTop = parseInt(tooltipoffsetHeight - 4);
271
- toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
272
- isArrowDown = true;
273
- }
274
- /* top tooltip left and right corner edge case */
275
-
276
-
277
- let values = this.leftRightScreenEdge(tLeft, toolTipArrowLeft, thisLeft, thisWidth, tooltipoffsetWidth, bodyWidth, rightEdge, bodyLeft);
278
- tLeft = values.tLeft, toolTipArrowLeft = values.toolTipArrowLeft, thisLeft = values.thisLeft, thisWidth = values.thisWidth, tooltipoffsetWidth = values.tooltipoffsetWidth, bodyWidth = values.bodyWidth, rightEdge = values.rightEdge;
279
- } else if (isPosition == 'bottom') {
280
- /* if bottom does not have enough space show tooltip in top area */
281
- if (thisBottom <= tooltipoffsetHeight + 5) {
282
- /* if bottom space is larger than top space show tooltip in bottom area */
283
- if (thisTop > thisBottom) {
284
- tTop = parseInt(thisTop - (tooltipoffsetHeight + 10));
285
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2 + 2);
286
- toolTipArrowTop = parseInt(tooltipoffsetHeight - 4);
287
- toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
288
- isArrowDown = true;
289
- } else {
290
- /* top position */
291
- tTop = parseInt(thisTop + (thisHeight + 10));
292
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2 + 2);
293
- toolTipArrowTop = -4;
294
- toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
295
- isArrowDown = false;
296
- }
297
- } else {
298
- /* if bottom have enough space show tooltip in bottom area */
299
- tTop = parseInt(thisTop + (thisHeight + 10));
300
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2 + 2);
301
- toolTipArrowTop = -4;
302
- toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
303
- isArrowDown = false;
304
- }
305
- /* bottom tooltip left and right corner edge case */
306
-
307
-
308
- let values = this.leftRightScreenEdge(tLeft, toolTipArrowLeft, thisLeft, thisWidth, tooltipoffsetWidth, bodyWidth, rightEdge, bodyLeft);
309
- tLeft = values.tLeft, toolTipArrowLeft = values.toolTipArrowLeft, thisLeft = values.thisLeft, thisWidth = values.thisWidth, tooltipoffsetWidth = values.tooltipoffsetWidth, bodyWidth = values.bodyWidth, rightEdge = values.rightEdge;
310
- } else if (isPosition == 'left') {
311
- isArrowHorizontal = true;
312
-
313
- if (thisLeft - bodyLeft <= tooltipoffsetWidth) {
314
- if (thisLeft - bodyLeft <= thisRight) {
315
- /* if left does not have enough space show tooltip in right area */
316
- tTop = parseInt(thisTop + (thisHeight / 2 - tooltipoffsetHeight / 2));
317
- tLeft = parseInt(thisLeft + thisWidth + 10);
318
- toolTipArrowTop = parseInt(tooltipoffsetHeight / 2 - 1);
319
- toolTipArrowLeft = -1;
320
- isArrowRight = false;
321
- } else {
322
- /* if left space is larger than right space show tooltip in left (default) area */
323
- if (bodyLeft + tooltipoffsetWidth >= thisLeft) {
324
- /* if tooltip width is greater than left space, set left space width to tooltip */
325
- tWidth = thisLeft;
326
- tTop = parseInt(thisTop + (thisHeight / 2 - tooltipoffsetHeight / 2));
327
- tLeft = parseInt(thisLeft - tWidth - 7);
328
- toolTipArrowTop = parseInt(tooltipoffsetHeight / 2 - 1);
329
- toolTipArrowLeft = parseInt(tWidth - 2);
330
- isArrowRight = true;
331
- }
332
- }
333
- } else {
334
- /* if left have enough space show tooltip in left area */
335
- tTop = parseInt(thisTop + (thisHeight / 2 - tooltipoffsetHeight / 2));
336
- tLeft = parseInt(thisLeft - tooltipoffsetWidth - 7);
337
- toolTipArrowTop = parseInt(tooltipoffsetHeight / 2 - 1);
338
- toolTipArrowLeft = parseInt(tooltipoffsetWidth - 2);
339
- isArrowRight = true;
340
- }
341
- /* left tooltip top and bottom corner edge case */
342
-
343
-
344
- let values = this.topBottomScreenEdge(tTop, toolTipArrowTop, thisTop, thisHeight, tooltipoffsetHeight, bodyHeight, bottomEdge);
345
- tTop = values.tTop, toolTipArrowTop = values.toolTipArrowTop, thisTop = values.thisTop, thisHeight = values.thisHeight, tooltipoffsetHeight = values.tooltipoffsetHeight, bodyHeight = values.bodyHeight, bottomEdge = values.bottomEdge;
346
- } else if (isPosition == 'right') {
347
- isArrowHorizontal = true;
348
-
349
- if (thisRight + bodyLeft <= tooltipoffsetWidth) {
350
- if (thisLeft + bodyLeft <= thisRight) {
351
- /* if right space is larger than left space show tooltip in right (default) area */
352
- tTop = parseInt(thisTop + (thisHeight / 2 - tooltipoffsetHeight / 2));
353
- tLeft = parseInt(thisLeft + thisWidth + 7);
354
- toolTipArrowTop = parseInt(tooltipoffsetHeight / 2 - 1);
355
- toolTipArrowLeft = -1;
356
- isArrowRight = false;
357
- } else {
358
- /* if right does not have enough space show tooltip in left area */
359
- if (tooltipoffsetWidth >= thisLeft) {
360
- /* if tooltip width is greater than left space, set left space width to tooltip */
361
- tWidth = thisLeft;
362
- tTop = parseInt(thisTop + (thisHeight / 2 - tooltipoffsetHeight / 2));
363
- tLeft = parseInt(thisLeft - tWidth - 7);
364
- toolTipArrowTop = parseInt(tooltipoffsetHeight / 2 - 1);
365
- toolTipArrowLeft = parseInt(tWidth - 2);
366
- isArrowRight = true;
367
- } else {
368
- /* show tooltip in left area without setting left space width to tooltip */
369
- tTop = parseInt(thisTop + (thisHeight / 2 - tooltipoffsetHeight / 2));
370
- tLeft = parseInt(thisLeft - tooltipoffsetWidth - 7);
371
- toolTipArrowTop = parseInt(tooltipoffsetHeight / 2 - 1);
372
- toolTipArrowLeft = parseInt(tooltipoffsetWidth - 2);
373
- isArrowRight = true;
374
- }
375
- }
376
- } else {
377
- /* if right have enough space show tooltip in right area */
378
- tTop = parseInt(thisTop + (thisHeight / 2 - tooltipoffsetHeight / 2));
379
- tLeft = parseInt(thisLeft + thisWidth + 7);
380
- toolTipArrowTop = parseInt(tooltipoffsetHeight / 2 - 1);
381
- toolTipArrowLeft = -1;
382
- isArrowRight = false;
383
- }
384
- /* right tooltip left and right corner edge case */
385
-
386
-
387
- let values = this.topBottomScreenEdge(tTop, toolTipArrowTop, thisTop, thisHeight, tooltipoffsetHeight, bodyHeight, bottomEdge);
388
- tTop = values.tTop, toolTipArrowTop = values.toolTipArrowTop, thisTop = values.thisTop, thisHeight = values.thisHeight, tooltipoffsetHeight = values.tooltipoffsetHeight, bodyHeight = values.bodyHeight, bottomEdge = values.bottomEdge;
389
- }
390
-
391
- this.setState({
392
- top: tTop,
393
- left: tLeft,
394
- arrowTop: toolTipArrowTop,
395
- arrowLeft: toolTipArrowLeft,
396
- isArrowHorizontal: isArrowHorizontal,
397
- isArrowDown: isArrowDown,
398
- isArrowRight: isArrowRight,
399
- width: tWidth
400
- });
401
- } else {
402
- this.setState({
403
- isArrowRight: null
404
- });
405
- tTop = parseInt(thisTop + thisHeight + 10);
406
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth / 2 - thisWidth / 2) + 2);
407
- tooltipLeft = parseInt(tooltipoffsetWidth / 2 - 6);
408
-
409
- if (tLeft - bodyLeft <= 1) {
410
- // default left side screen edge case
411
- tooltipLeft = parseInt(thisLeft - bodyLeft + thisWidth / 2 - 6);
412
- tLeft = bodyLeft + 2;
413
- } else if (tLeft - bodyLeft + tooltipoffsetWidth > bodyWidth) {
414
- checkLeft = tLeft + tooltipoffsetWidth - bodyWidth + 2;
415
- tooltipLeft = tooltipLeft - bodyLeft + checkLeft;
416
- tLeft = tLeft + bodyLeft - checkLeft;
417
- } else if (tLeft + tooltipoffsetWidth >= bodyWidth - 2) {
418
- // default center screen tooltip collide with right edge screen
419
- tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2);
420
- tooltipLeft = parseInt(tooltipoffsetWidth / 2 - 4);
421
- }
422
-
423
- isArrowDown = false;
424
-
425
- if (tTop + tooltipoffsetHeight > bodyHeight) {
426
- /* if bottom does not have enough space show tooltip in top area */
427
- if (thisTop > thisBottom) {
428
- isArrowDown = true;
429
- tTop -= tooltipoffsetHeight + thisHeight + 20;
430
- }
431
- }
432
-
433
- if (isArrowDown) {
434
- let arrowTop = tooltipoffsetHeight - 4;
435
- this.setState({
436
- top: tTop,
437
- left: tLeft,
438
- arrowLeft: tooltipLeft,
439
- arrowTop,
440
- isArrowDown: true,
441
- isArrowHorizontal: isArrowHorizontal
442
- });
443
- } else {
444
- this.setState({
445
- top: tTop,
446
- left: tLeft,
447
- arrowLeft: tooltipLeft,
448
- arrowTop: -4,
449
- isArrowDown: false,
450
- isArrowHorizontal: isArrowHorizontal
451
- });
452
- }
453
- }
454
- }
455
- });
456
- titleDiv.addEventListener('click', this.reset);
457
- titleDiv.addEventListener('mouseup', this.reset);
458
- titleDiv.addEventListener('mouseleave', this.reset);
459
- }
460
- } else {
461
- this.reset();
462
- }
463
- }
464
-
465
- render() {
466
- let {
467
- title,
468
- left,
469
- top,
470
- arrowLeft,
471
- arrowTop,
472
- isArrowDown,
473
- isArrowRight,
474
- isArrowHorizontal,
475
- width,
476
- isHtml,
477
- dataTooltipnoArrow,
478
- dataTooltipWrap
479
- } = this.state;
480
- let {
481
- dataId,
482
- customClass
483
- } = this.props;
484
- let arrowStyle = isArrowHorizontal ? isArrowRight ? style.arrowRight : style.arrowLeft : isArrowDown ? style.arrowDown : style.arrowUp;
485
- title = title ? title.trim() : null;
486
- let tooltipWhiteSpaceModification = dataTooltipWrap;
487
-
488
- if (dataTooltipWrap == 'pre') {
489
- tooltipWhiteSpaceModification = 'pre-wrap';
490
- } else if (dataTooltipWrap == 'nowrap') {
491
- tooltipWhiteSpaceModification = 'normal';
492
- }
493
-
494
- let tooltipCss = `${style.tooltipcont} ${whiteSpaceClassMapping[tooltipWhiteSpaceModification]}`;
495
- return title ? /*#__PURE__*/React.createElement("div", {
496
- className: `${customClass} ${style.tooltiptext}`,
497
- style: {
498
- left,
499
- top,
500
- width
501
- },
502
- ref: this.getToolTipDOM,
503
- "data-id": dataId,
504
- "data-test-id": dataId
505
- }, !dataTooltipnoArrow ? /*#__PURE__*/React.createElement("span", {
506
- className: `${style.tooltiparrow} ${arrowStyle}`,
507
- style: {
508
- left: arrowLeft,
509
- top: arrowTop
510
- }
511
- }) : null, isHtml ? /*#__PURE__*/React.createElement("div", {
512
- className: tooltipCss,
513
- dangerouslySetInnerHTML: {
514
- __html: title
515
- }
516
- }) : /*#__PURE__*/React.createElement("div", {
517
- className: tooltipCss
518
- }, title)) : null;
519
- }
520
-
521
- }
522
- Tooltip.propTypes = propTypes;
523
- Tooltip.defaultProps = defaultProps; // if (__DOCS__) {
524
- // Tooltip.docs = {
525
- // componentGroup: 'Atom',
526
- // folderName: 'Style Guide',
527
- // description: ' ',
528
- // external: true
529
- // };
530
- // }
@@ -1,4 +0,0 @@
1
- export const defaultProps = {
2
- dataId: 'toolTip',
3
- customClass: ''
4
- };
@@ -1,5 +0,0 @@
1
- import PropTypes from 'prop-types';
2
- export const propTypes = {
3
- dataId: PropTypes.string,
4
- customClass: PropTypes.string
5
- };
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import { defaultProps } from "./props/defaultProps";
3
- import { propTypes } from "./props/propTypes";
4
- import cssJSLogic from "./css/cssJSLogic";
5
- import { mergeStyle } from '@zohodesk/utils';
6
- import defaultStyle from "./css/v1_Typography.module.css";
7
-
8
- const Typography = props => {
9
- const {
10
- children,
11
- $ui_tagName,
12
- $i18n_dataTitle,
13
- testId,
14
- customId,
15
- $tagAttributes_text,
16
- $a11yAttributes_text,
17
- customStyle
18
- } = props;
19
- const style = mergeStyle(defaultStyle, customStyle);
20
- const {
21
- typographyClass
22
- } = cssJSLogic({
23
- props,
24
- style
25
- });
26
- return /*#__PURE__*/React.createElement($ui_tagName, {
27
- className: typographyClass,
28
- 'data-title': $i18n_dataTitle,
29
- 'data-id': customId,
30
- 'data-test-id': testId,
31
- ...$tagAttributes_text,
32
- ...$a11yAttributes_text
33
- }, children);
34
- };
35
-
36
- Typography.propTypes = propTypes;
37
- Typography.defaultProps = defaultProps;
38
- export default Typography;
@@ -1,56 +0,0 @@
1
- import { compileClassNames } from '@zohodesk/utils';
2
- import { letterspacingMapping, lineheightMapping } from "../utils";
3
- export default function cssJSLogic(_ref) {
4
- let {
5
- props,
6
- style
7
- } = _ref;
8
- let {
9
- $flag_reset,
10
- $flag_dotted,
11
- $ui_size,
12
- $ui_lineClamp,
13
- $ui_lineHeight,
14
- $ui_display,
15
- $ui_weight,
16
- $ui_typeFace,
17
- $ui_textAlign,
18
- $ui_letterSpacing,
19
- $ui_transform,
20
- $ui_decoration,
21
- $ui_className,
22
- $ui_wordBreak,
23
- $ui_wordWrap,
24
- $ui_whiteSpace
25
- } = props;
26
-
27
- if ($ui_letterSpacing) {
28
- $ui_letterSpacing = letterspacingMapping[$ui_letterSpacing];
29
- }
30
-
31
- if ($ui_lineHeight) {
32
- $ui_lineHeight = lineheightMapping[$ui_lineHeight];
33
- }
34
-
35
- let typographyClass = compileClassNames({
36
- [style.reset]: $flag_reset,
37
- [style.dotted]: $flag_dotted,
38
- [style[`size${$ui_size}`]]: !!$ui_size,
39
- [style[`lineclamp_${$ui_lineClamp}`]]: !!$ui_lineClamp,
40
- [style[`lineheight_${$ui_lineHeight}`]]: !!$ui_lineHeight,
41
- [style[`display_${$ui_display}`]]: !!$ui_display,
42
- [style[`font_${$ui_weight}`]]: !!$ui_weight,
43
- [style[`fontStyles_${$ui_typeFace}`]]: !!$ui_typeFace,
44
- [style[`textalign_${$ui_textAlign}`]]: !!$ui_textAlign,
45
- [style[`letterspacing_${$ui_letterSpacing}`]]: !!$ui_letterSpacing,
46
- [style[`transform_${$ui_transform}`]]: !!$ui_transform,
47
- [style[`decoration_${$ui_decoration}`]]: !!$ui_decoration,
48
- [$ui_className]: !!$ui_className,
49
- [style[`wordBreak_${$ui_wordBreak}`]]: !!$ui_wordBreak,
50
- [style[`wordWrap_${$ui_wordWrap}`]]: !!$ui_wordWrap,
51
- [style[`whiteSpace_${$ui_whiteSpace}`]]: !!$ui_whiteSpace
52
- });
53
- return {
54
- typographyClass
55
- };
56
- }