@zohodesk/components 1.0.0-alpha-271 → 1.0.0-alpha-272

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 (352) 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/AvatarTeam/AvatarTeam.js +3 -3
  8. package/es/Button/Button.js +4 -3
  9. package/es/Buttongroup/Buttongroup.js +3 -3
  10. package/es/Card/Card.js +21 -10
  11. package/es/CheckBox/CheckBox.js +5 -3
  12. package/es/DateTime/CalendarView.js +32 -20
  13. package/es/DateTime/DateTime.js +75 -10
  14. package/es/DateTime/DateTimePopupFooter.js +4 -2
  15. package/es/DateTime/DateTimePopupHeader.js +8 -2
  16. package/es/DateTime/DateWidget.js +98 -35
  17. package/es/DateTime/DaysRow.js +4 -2
  18. package/es/DateTime/Time.js +10 -2
  19. package/es/DateTime/YearView.js +28 -4
  20. package/es/DateTime/__tests__/CalendarView.spec.js +1 -0
  21. package/es/DateTime/__tests__/DateTime.spec.js +1 -0
  22. package/es/DateTime/__tests__/DateWidget.spec.js +2 -3
  23. package/es/DateTime/common.js +3 -0
  24. package/es/DateTime/constants.js +1 -0
  25. package/es/DateTime/dateFormatUtils/dateFormat.js +63 -30
  26. package/es/DateTime/dateFormatUtils/dateFormats.js +0 -1
  27. package/es/DateTime/dateFormatUtils/dayChange.js +13 -4
  28. package/es/DateTime/dateFormatUtils/index.js +32 -2
  29. package/es/DateTime/dateFormatUtils/monthChange.js +8 -0
  30. package/es/DateTime/dateFormatUtils/timeChange.js +22 -6
  31. package/es/DateTime/dateFormatUtils/yearChange.js +11 -2
  32. package/es/DateTime/objectUtils.js +14 -20
  33. package/es/DateTime/props/defaultProps.js +2 -1
  34. package/es/DateTime/typeChecker.js +3 -0
  35. package/es/DateTime/validator.js +58 -6
  36. package/es/DropBox/DropBox.js +6 -2
  37. package/es/DropBox/DropBoxElement/DropBoxElement.js +7 -0
  38. package/es/DropBox/DropBoxElement/css/cssJSLogic.js +5 -3
  39. package/es/DropBox/DropBoxElement/useDropboxPosCalc.js +3 -0
  40. package/es/DropBox/props/defaultProps.js +1 -2
  41. package/es/DropBox/props/propTypes.js +1 -2
  42. package/es/DropDown/DropDown.js +8 -4
  43. package/es/DropDown/DropDownHeading.js +4 -5
  44. package/es/DropDown/DropDownItem.js +6 -0
  45. package/es/DropDown/DropDownSearch.js +4 -0
  46. package/es/DropDown/DropDownSeparator.js +1 -0
  47. package/es/DropDown/__tests__/DropDown.spec.js +1 -2
  48. package/es/Heading/Heading.js +2 -3
  49. package/es/Label/Label.js +2 -3
  50. package/es/Layout/Box.js +13 -0
  51. package/es/Layout/Container.js +12 -1
  52. package/es/Layout/index.js +1 -2
  53. package/es/ListItem/ListContainer.js +8 -3
  54. package/es/ListItem/ListItem.js +9 -3
  55. package/es/ListItem/ListItemWithAvatar.js +9 -3
  56. package/es/ListItem/ListItemWithCheckBox.js +7 -2
  57. package/es/ListItem/ListItemWithIcon.js +8 -3
  58. package/es/ListItem/ListItemWithRadio.js +7 -3
  59. package/es/Modal/Modal.js +28 -11
  60. package/es/MultiSelect/AdvancedGroupMultiSelect.js +89 -13
  61. package/es/MultiSelect/AdvancedMultiSelect.js +32 -9
  62. package/es/MultiSelect/EmptyState.js +2 -0
  63. package/es/MultiSelect/MultiSelect.js +99 -32
  64. package/es/MultiSelect/MultiSelectHeader.js +3 -0
  65. package/es/MultiSelect/MultiSelectWithAvatar.js +12 -6
  66. package/es/MultiSelect/SelectedOptions.js +6 -3
  67. package/es/MultiSelect/Suggestions.js +7 -3
  68. package/es/MultiSelect/__tests__/MultiSelect.spec.js +4 -6
  69. package/es/MultiSelect/props/propTypes.js +2 -0
  70. package/es/PopOver/PopOver.js +18 -2
  71. package/es/PopOver/__tests__/PopOver.spec.js +2 -1
  72. package/es/Popup/Popup.js +77 -24
  73. package/es/Popup/__tests__/Popup.spec.js +17 -5
  74. package/es/Popup/viewPort.js +16 -4
  75. package/es/Provider/IdProvider.js +10 -5
  76. package/es/Provider/LibraryContext.js +6 -4
  77. package/es/Provider/NumberGenerator/NumberGenerator.js +21 -7
  78. package/es/Provider/ZindexProvider.js +9 -2
  79. package/es/Radio/Radio.js +4 -2
  80. package/es/Responsive/CustomResponsive.js +30 -18
  81. package/es/Responsive/RefWrapper.js +6 -7
  82. package/es/Responsive/ResizeComponent.js +35 -25
  83. package/es/Responsive/ResizeObserver.js +26 -6
  84. package/es/Responsive/Responsive.js +34 -20
  85. package/es/Responsive/index.js +1 -3
  86. package/es/Responsive/sizeObservers.js +28 -7
  87. package/es/Responsive/utils/index.js +7 -5
  88. package/es/Responsive/utils/shallowCompare.js +7 -2
  89. package/es/Responsive/windowResizeObserver.js +7 -0
  90. package/es/ResponsiveDropBox/ResponsiveDropBox.js +4 -0
  91. package/es/Ribbon/Ribbon.js +3 -2
  92. package/es/RippleEffect/RippleEffect.js +1 -3
  93. package/es/Select/GroupSelect.js +58 -14
  94. package/es/Select/Select.js +79 -33
  95. package/es/Select/SelectWithAvatar.js +17 -4
  96. package/es/Select/SelectWithIcon.js +46 -5
  97. package/es/Select/__tests__/Select.spec.js +6 -8
  98. package/es/Select/props/propTypes.js +1 -0
  99. package/es/Stencils/Stencils.js +3 -3
  100. package/es/Switch/Switch.js +5 -3
  101. package/es/Tab/Tab.js +4 -4
  102. package/es/Tab/TabContent.js +1 -0
  103. package/es/Tab/TabContentWrapper.js +2 -0
  104. package/es/Tab/TabWrapper.js +5 -2
  105. package/es/Tab/Tabs.js +54 -7
  106. package/es/Tab/__tests__/Tab.spec.js +1 -3
  107. package/es/Tab/__tests__/TabWrapper.spec.js +1 -0
  108. package/es/Tag/Tag.js +6 -3
  109. package/es/TextBox/TextBox.js +15 -3
  110. package/es/TextBox/__tests__/TextBox.spec.js +1 -4
  111. package/es/TextBoxIcon/TextBoxIcon.js +9 -2
  112. package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +2 -7
  113. package/es/Textarea/Textarea.js +12 -3
  114. package/es/Textarea/__tests__/Textarea.spec.js +2 -2
  115. package/es/Tooltip/Tooltip.js +58 -14
  116. package/es/Tooltip/__tests__/Tooltip.spec.js +5 -0
  117. package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +3 -2
  118. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +7 -5
  119. package/es/deprecated/PortalLayer/PortalLayer.js +25 -20
  120. package/es/semantic/Button/Button.js +3 -2
  121. package/es/utils/Common.js +54 -9
  122. package/es/utils/ContextOptimizer.js +4 -5
  123. package/es/utils/__tests__/debounce.spec.js +2 -2
  124. package/es/utils/constructFullName.js +2 -0
  125. package/es/utils/css/compileClassNames.js +5 -0
  126. package/es/utils/css/mergeStyle.js +7 -6
  127. package/es/utils/css/utils.js +1 -0
  128. package/es/utils/datetime/GMTZones.js +48 -0
  129. package/es/utils/datetime/common.js +31 -7
  130. package/es/utils/debounce.js +5 -1
  131. package/es/utils/dropDownUtils.js +68 -11
  132. package/es/utils/getInitial.js +4 -0
  133. package/es/utils/shallowEqual.js +6 -0
  134. package/lib/Accordion/Accordion.js +42 -18
  135. package/lib/Accordion/AccordionItem.js +40 -18
  136. package/lib/Accordion/__tests__/Accordion.spec.js +3 -0
  137. package/lib/Accordion/index.js +3 -0
  138. package/lib/Accordion/props/propTypes.js +3 -0
  139. package/lib/Animation/Animation.js +38 -18
  140. package/lib/Animation/__tests__/Animation.spec.js +11 -7
  141. package/lib/Animation/props/propTypes.js +3 -0
  142. package/lib/AppContainer/AppContainer.js +56 -21
  143. package/lib/AppContainer/props/propTypes.js +3 -0
  144. package/lib/Avatar/Avatar.js +78 -38
  145. package/lib/Avatar/__tests__/Avatar.spec.js +44 -0
  146. package/lib/Avatar/props/propTypes.js +3 -0
  147. package/lib/AvatarTeam/AvatarTeam.js +52 -30
  148. package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +13 -0
  149. package/lib/AvatarTeam/props/propTypes.js +3 -0
  150. package/lib/Button/Button.js +31 -20
  151. package/lib/Button/css/cssJSLogic.js +18 -17
  152. package/lib/Button/index.js +3 -0
  153. package/lib/Button/props/defaultProps.js +2 -0
  154. package/lib/Button/props/propTypes.js +3 -0
  155. package/lib/Buttongroup/Buttongroup.js +32 -12
  156. package/lib/Buttongroup/__test__/Buttongroup.spec.js +10 -0
  157. package/lib/Buttongroup/props/propTypes.js +3 -0
  158. package/lib/Card/Card.js +102 -46
  159. package/lib/Card/__tests__/Card.spec.js +10 -1
  160. package/lib/Card/index.js +4 -0
  161. package/lib/Card/props/propTypes.js +3 -0
  162. package/lib/CheckBox/CheckBox.js +71 -47
  163. package/lib/CheckBox/__tests__/CheckBox.spec.js +3 -0
  164. package/lib/CheckBox/props/propTypes.js +3 -0
  165. package/lib/DateTime/CalendarView.js +82 -42
  166. package/lib/DateTime/DateTime.js +246 -158
  167. package/lib/DateTime/DateTimePopupFooter.js +31 -8
  168. package/lib/DateTime/DateTimePopupHeader.js +48 -17
  169. package/lib/DateTime/DateWidget.js +352 -250
  170. package/lib/DateTime/DaysRow.js +27 -5
  171. package/lib/DateTime/Time.js +73 -32
  172. package/lib/DateTime/YearView.js +77 -28
  173. package/lib/DateTime/__tests__/CalendarView.spec.js +13 -5
  174. package/lib/DateTime/__tests__/DateTime.spec.js +51 -37
  175. package/lib/DateTime/__tests__/DateWidget.spec.js +10 -8
  176. package/lib/DateTime/common.js +6 -0
  177. package/lib/DateTime/constants.js +1 -0
  178. package/lib/DateTime/dateFormatUtils/dateFormat.js +184 -122
  179. package/lib/DateTime/dateFormatUtils/dateFormats.js +0 -1
  180. package/lib/DateTime/dateFormatUtils/dayChange.js +14 -7
  181. package/lib/DateTime/dateFormatUtils/index.js +74 -16
  182. package/lib/DateTime/dateFormatUtils/monthChange.js +19 -9
  183. package/lib/DateTime/dateFormatUtils/timeChange.js +54 -22
  184. package/lib/DateTime/dateFormatUtils/yearChange.js +22 -11
  185. package/lib/DateTime/index.js +2 -0
  186. package/lib/DateTime/objectUtils.js +24 -20
  187. package/lib/DateTime/props/defaultProps.js +2 -1
  188. package/lib/DateTime/props/propTypes.js +11 -1
  189. package/lib/DateTime/typeChecker.js +4 -0
  190. package/lib/DateTime/validator.js +73 -10
  191. package/lib/DropBox/DropBox.js +34 -10
  192. package/lib/DropBox/DropBoxElement/DropBoxElement.js +59 -38
  193. package/lib/DropBox/DropBoxElement/css/cssJSLogic.js +42 -34
  194. package/lib/DropBox/DropBoxElement/props/propTypes.js +3 -0
  195. package/lib/DropBox/DropBoxElement/useDropboxPosCalc.js +14 -9
  196. package/lib/DropBox/__tests__/DropBox.spec.js +6 -2
  197. package/lib/DropBox/css/cssJSLogic.js +3 -1
  198. package/lib/DropBox/props/defaultProps.js +8 -4
  199. package/lib/DropBox/props/propTypes.js +10 -4
  200. package/lib/DropDown/DropDown.js +52 -8
  201. package/lib/DropDown/DropDownHeading.js +39 -20
  202. package/lib/DropDown/DropDownItem.js +42 -20
  203. package/lib/DropDown/DropDownSearch.js +40 -17
  204. package/lib/DropDown/DropDownSeparator.js +24 -4
  205. package/lib/DropDown/__tests__/DropDown.spec.js +15 -9
  206. package/lib/DropDown/__tests__/DropDownItem.spec.js +9 -4
  207. package/lib/DropDown/__tests__/DropDownSearch.spec.js +3 -0
  208. package/lib/DropDown/index.js +9 -0
  209. package/lib/DropDown/props/propTypes.js +6 -4
  210. package/lib/Heading/Heading.js +37 -15
  211. package/lib/Heading/props/propTypes.js +3 -0
  212. package/lib/Label/Label.js +39 -19
  213. package/lib/Label/__tests__/Label.spec.js +14 -1
  214. package/lib/Label/props/propTypes.js +3 -0
  215. package/lib/Layout/Box.js +31 -11
  216. package/lib/Layout/Container.js +29 -10
  217. package/lib/Layout/__tests__/Box.spec.js +65 -49
  218. package/lib/Layout/__tests__/Container.spec.js +67 -50
  219. package/lib/Layout/index.js +3 -0
  220. package/lib/Layout/props/propTypes.js +3 -0
  221. package/lib/Layout/utils.js +10 -0
  222. package/lib/ListItem/ListContainer.js +48 -27
  223. package/lib/ListItem/ListItem.js +69 -45
  224. package/lib/ListItem/ListItemWithAvatar.js +75 -48
  225. package/lib/ListItem/ListItemWithCheckBox.js +64 -39
  226. package/lib/ListItem/ListItemWithIcon.js +68 -44
  227. package/lib/ListItem/ListItemWithRadio.js +65 -41
  228. package/lib/ListItem/index.js +7 -0
  229. package/lib/ListItem/props/propTypes.js +6 -4
  230. package/lib/Modal/Modal.js +45 -10
  231. package/lib/Modal/props/propTypes.js +3 -0
  232. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +294 -166
  233. package/lib/MultiSelect/AdvancedMultiSelect.js +202 -125
  234. package/lib/MultiSelect/EmptyState.js +45 -24
  235. package/lib/MultiSelect/MultiSelect.js +323 -206
  236. package/lib/MultiSelect/MultiSelectHeader.js +30 -8
  237. package/lib/MultiSelect/MultiSelectWithAvatar.js +105 -63
  238. package/lib/MultiSelect/SelectedOptions.js +43 -17
  239. package/lib/MultiSelect/Suggestions.js +64 -32
  240. package/lib/MultiSelect/__tests__/MultiSelect.spec.js +86 -75
  241. package/lib/MultiSelect/index.js +5 -0
  242. package/lib/MultiSelect/props/defaultProps.js +2 -0
  243. package/lib/MultiSelect/props/propTypes.js +5 -0
  244. package/lib/PopOver/PopOver.js +95 -49
  245. package/lib/PopOver/__tests__/PopOver.spec.js +4 -1
  246. package/lib/PopOver/index.js +4 -0
  247. package/lib/PopOver/props/propTypes.js +3 -0
  248. package/lib/Popup/Popup.js +158 -81
  249. package/lib/Popup/__tests__/Popup.spec.js +43 -8
  250. package/lib/Popup/viewPort.js +28 -14
  251. package/lib/Provider/AvatarSize.js +4 -0
  252. package/lib/Provider/Config.js +2 -0
  253. package/lib/Provider/CssProvider.js +4 -0
  254. package/lib/Provider/IdProvider.js +17 -6
  255. package/lib/Provider/LibraryContext.js +35 -15
  256. package/lib/Provider/LibraryContextInit.js +4 -0
  257. package/lib/Provider/NumberGenerator/NumberGenerator.js +44 -15
  258. package/lib/Provider/ZindexProvider.js +15 -3
  259. package/lib/Provider/index.js +5 -0
  260. package/lib/Radio/Radio.js +61 -38
  261. package/lib/Radio/__tests__/Radiospec.js +9 -5
  262. package/lib/Radio/props/propTypes.js +3 -0
  263. package/lib/Responsive/CustomResponsive.js +73 -29
  264. package/lib/Responsive/RefWrapper.js +17 -11
  265. package/lib/Responsive/ResizeComponent.js +62 -36
  266. package/lib/Responsive/ResizeObserver.js +24 -10
  267. package/lib/Responsive/Responsive.js +80 -30
  268. package/lib/Responsive/index.js +4 -0
  269. package/lib/Responsive/props/propTypes.js +3 -0
  270. package/lib/Responsive/sizeObservers.js +53 -17
  271. package/lib/Responsive/utils/index.js +11 -3
  272. package/lib/Responsive/utils/shallowCompare.js +11 -2
  273. package/lib/Responsive/windowResizeObserver.js +8 -0
  274. package/lib/ResponsiveDropBox/ResponsiveDropBox.js +45 -17
  275. package/lib/ResponsiveDropBox/props/propTypes.js +3 -0
  276. package/lib/Ribbon/Ribbon.js +33 -13
  277. package/lib/Ribbon/__tests__/Ribbon.spec.js +22 -0
  278. package/lib/Ribbon/props/propTypes.js +3 -0
  279. package/lib/RippleEffect/RippleEffect.js +18 -10
  280. package/lib/RippleEffect/props/propTypes.js +3 -0
  281. package/lib/Select/GroupSelect.js +229 -130
  282. package/lib/Select/Select.js +290 -209
  283. package/lib/Select/SelectWithAvatar.js +102 -56
  284. package/lib/Select/SelectWithIcon.js +132 -76
  285. package/lib/Select/__tests__/Select.spec.js +133 -91
  286. package/lib/Select/index.js +5 -0
  287. package/lib/Select/props/defaultProps.js +5 -4
  288. package/lib/Select/props/propTypes.js +4 -0
  289. package/lib/Stencils/Stencils.js +29 -10
  290. package/lib/Stencils/__tests__/Stencils.spec.js +12 -0
  291. package/lib/Stencils/props/propTypes.js +3 -0
  292. package/lib/Switch/Switch.js +57 -34
  293. package/lib/Switch/props/propTypes.js +3 -0
  294. package/lib/Tab/Tab.js +40 -27
  295. package/lib/Tab/TabContent.js +12 -5
  296. package/lib/Tab/TabContentWrapper.js +13 -6
  297. package/lib/Tab/TabWrapper.js +37 -19
  298. package/lib/Tab/Tabs.js +171 -91
  299. package/lib/Tab/__tests__/Tab.spec.js +67 -58
  300. package/lib/Tab/__tests__/TabContent.spec.js +10 -6
  301. package/lib/Tab/__tests__/TabContentWrapper.spec.js +28 -20
  302. package/lib/Tab/__tests__/TabWrapper.spec.js +12 -0
  303. package/lib/Tab/__tests__/Tabs.spec.js +53 -39
  304. package/lib/Tab/index.js +6 -0
  305. package/lib/Tab/props/propTypes.js +3 -0
  306. package/lib/Tag/Tag.js +72 -43
  307. package/lib/Tag/__tests__/Tag.spec.js +14 -8
  308. package/lib/Tag/props/propTypes.js +3 -0
  309. package/lib/TextBox/TextBox.js +85 -59
  310. package/lib/TextBox/__tests__/TextBox.spec.js +14 -4
  311. package/lib/TextBox/props/propTypes.js +6 -4
  312. package/lib/TextBoxIcon/TextBoxIcon.js +79 -52
  313. package/lib/TextBoxIcon/__tests__/TextBoxIcon.spec.js +14 -5
  314. package/lib/TextBoxIcon/props/propTypes.js +3 -0
  315. package/lib/Textarea/Textarea.js +54 -29
  316. package/lib/Textarea/__tests__/Textarea.spec.js +14 -2
  317. package/lib/Textarea/props/propTypes.js +3 -0
  318. package/lib/Tooltip/Tooltip.js +94 -31
  319. package/lib/Tooltip/__tests__/Tooltip.spec.js +24 -3
  320. package/lib/Tooltip/props/propTypes.js +3 -0
  321. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +40 -16
  322. package/lib/VelocityAnimation/VelocityAnimation/props/propTypes.js +3 -0
  323. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +53 -25
  324. package/lib/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +3 -0
  325. package/lib/VelocityAnimation/index.js +3 -0
  326. package/lib/css.js +40 -0
  327. package/lib/deprecated/PortalLayer/PortalLayer.js +46 -23
  328. package/lib/deprecated/PortalLayer/props/propTypes.js +3 -0
  329. package/lib/index.js +57 -0
  330. package/lib/semantic/Button/Button.js +42 -22
  331. package/lib/semantic/Button/props/propTypes.js +3 -0
  332. package/lib/semantic/index.js +2 -0
  333. package/lib/utils/Common.js +110 -18
  334. package/lib/utils/ContextOptimizer.js +16 -10
  335. package/lib/utils/__tests__/constructFullName.spec.js +1 -0
  336. package/lib/utils/__tests__/debounce.spec.js +3 -2
  337. package/lib/utils/__tests__/getInitial.spec.js +1 -0
  338. package/lib/utils/constructFullName.js +13 -4
  339. package/lib/utils/css/compileClassNames.js +6 -0
  340. package/lib/utils/css/mergeStyle.js +10 -7
  341. package/lib/utils/css/utils.js +8 -0
  342. package/lib/utils/datetime/GMTZones.js +55 -0
  343. package/lib/utils/datetime/common.js +52 -7
  344. package/lib/utils/debounce.js +6 -1
  345. package/lib/utils/dropDownUtils.js +175 -59
  346. package/lib/utils/dummyFunction.js +2 -0
  347. package/lib/utils/getHTMLFontSize.js +1 -0
  348. package/lib/utils/getInitial.js +6 -0
  349. package/lib/utils/index.js +4 -0
  350. package/lib/utils/scrollTo.js +2 -0
  351. package/lib/utils/shallowEqual.js +8 -0
  352. package/package.json +1 -1
@@ -135,8 +135,7 @@ describe('Textarea component', () => {
135
135
  needBorder: false
136
136
  }));
137
137
  expect(TestUtils.findRenderedComponentsWithTestid(renderedDOM, 'TextareaComp').className).toMatch(/noBorder/);
138
- });
139
- // it('Check disabled works', () => {
138
+ }); // it('Check disabled works', () => {
140
139
  // let renderedDOM = TestUtils.renderIntoDocument(
141
140
  // <Textarea maxLength='100' placeHolder='Text Area' resize='vertical' size='large' variant='primary' text='Text Area Working' disabled needBorder={false} />
142
141
  // );
@@ -152,6 +151,7 @@ describe('Textarea component', () => {
152
151
  // pass
153
152
  // ).toBe(true);
154
153
  // });
154
+
155
155
  it('Check check onchange works', () => {
156
156
  let mockfn = jest.fn();
157
157
  let renderedDOM = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(Textarea, {
@@ -27,39 +27,49 @@ export default class Tooltip extends React.Component {
27
27
  this.tooltipContainerClientRect = {};
28
28
  this.tooltipContainerEl = {};
29
29
  }
30
+
30
31
  onResize(sizeOfObservedEl, observedEl) {
31
32
  this.isResized = true;
32
33
  }
34
+
33
35
  observeElement() {
34
36
  this.tooltipContainerEl = this.getToolTipContainerEl();
35
37
  this.observer.observe(this.tooltipContainerEl);
36
38
  }
39
+
37
40
  unObserveElement() {
38
41
  this.observer.disconnect();
39
42
  }
43
+
40
44
  getClientRectOfContEl(el) {
41
45
  if (this.isResized) {
42
46
  return this.setClientRectOfContEl(el);
43
47
  }
48
+
44
49
  return this.tooltipContainerClientRect;
45
50
  }
51
+
46
52
  setClientRectOfContEl(containerEl) {
47
53
  this.isResized = false;
48
54
  this.tooltipContainerClientRect = containerEl.getBoundingClientRect();
49
55
  return this.tooltipContainerClientRect;
50
56
  }
57
+
51
58
  getToolTipContainerEl() {
52
59
  const getTooltipContainer = getLibraryConfig('getTooltipContainer');
53
60
  const tooltipContainer = typeof getTooltipContainer === 'function' ? getTooltipContainer() : null;
54
61
  return tooltipContainer ? tooltipContainer : document.body;
55
62
  }
63
+
56
64
  getToolTipDOM(el) {
57
65
  this.toolTip = el;
58
66
  }
67
+
59
68
  reset() {
60
69
  let {
61
70
  title
62
71
  } = this.state;
72
+
63
73
  if (title !== null) {
64
74
  this.setState({
65
75
  title: null,
@@ -68,8 +78,9 @@ export default class Tooltip extends React.Component {
68
78
  });
69
79
  }
70
80
  }
71
-
72
81
  /* left and right screen edge check for top and bottom tooltip position */
82
+
83
+
73
84
  leftRightScreenEdge(tLeft, toolTipArrowLeft, thisLeft, thisWidth, tooltipoffsetWidth, bodyWidth, rightEdge, bodyLeft) {
74
85
  if (tLeft - bodyLeft <= 1) {
75
86
  // top & bottom position left side screen edge case
@@ -85,6 +96,7 @@ export default class Tooltip extends React.Component {
85
96
  tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2);
86
97
  toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 4);
87
98
  }
99
+
88
100
  return {
89
101
  tLeft,
90
102
  toolTipArrowLeft,
@@ -95,8 +107,9 @@ export default class Tooltip extends React.Component {
95
107
  rightEdge
96
108
  };
97
109
  }
98
-
99
110
  /* top and bottom screen edge check for left and right tooltip position */
111
+
112
+
100
113
  topBottomScreenEdge(tTop, toolTipArrowTop, thisTop, thisHeight, tooltipoffsetHeight, bodyHeight, bottomEdge) {
101
114
  if (tTop <= 1) {
102
115
  tTop = 2;
@@ -106,6 +119,7 @@ export default class Tooltip extends React.Component {
106
119
  tTop -= bottomEdge;
107
120
  toolTipArrowTop += bottomEdge;
108
121
  }
122
+
109
123
  return {
110
124
  tTop,
111
125
  toolTipArrowTop,
@@ -116,16 +130,19 @@ export default class Tooltip extends React.Component {
116
130
  bottomEdge
117
131
  };
118
132
  }
133
+
119
134
  handleOver(e, targetElement) {
120
135
  let containerElement = this.tooltipContainerEl;
121
136
  let element = e.target;
122
137
  let titleDiv = element.hasAttribute('data-title') || element.hasAttribute('title') ? element : element.closest('[data-title]') || element.closest('[title]');
138
+
123
139
  if (titleDiv) {
124
140
  let title = titleDiv.getAttribute('data-title') || titleDiv.getAttribute('title');
125
-
126
141
  /* if data-title-position is left or right change right and left in rtl case */
142
+
127
143
  let isPosition = titleDiv.getAttribute('data-title-position');
128
144
  let elem = this.getDirection;
145
+
129
146
  if (elem.getAttribute('dir') == 'rtl') {
130
147
  if (isPosition == 'left') {
131
148
  isPosition = 'right';
@@ -133,36 +150,44 @@ export default class Tooltip extends React.Component {
133
150
  isPosition = 'left';
134
151
  }
135
152
  }
153
+
136
154
  if (title !== '' && title) {
137
155
  titleDiv.setAttribute('data-title', title);
138
156
  titleDiv.removeAttribute('title');
157
+
139
158
  if (element.nodeName !== 'I' && element.innerText && element.innerText.trim() !== '') {
140
159
  let isContentDotted = '';
160
+
141
161
  if (element.scrollWidth !== 0) {
142
162
  isContentDotted = element.offsetWidth < element.scrollWidth;
163
+
143
164
  if (!isContentDotted) {
144
165
  isContentDotted = element.offsetHeight < element.scrollHeight;
145
- }
146
- // if (!isContentDotted) {Need to check the code Sivanesh
166
+ } // if (!isContentDotted) {Need to check the code Sivanesh
147
167
  // isContentDotted = element.offsetHeight < element.scrollHeight;
148
168
  // }
169
+
149
170
  } else {
150
171
  const offWidth = selectn('parentElement.offsetWidth', element) || 0;
151
172
  const scrollWidth = selectn('parentElement.scrollWidth', element) || 0;
152
173
  isContentDotted = offWidth < scrollWidth;
153
174
  }
175
+
154
176
  let originText = element.innerText.replace(/\s/g, '').toLowerCase();
155
177
  let tooltipText = title.replace(/\s/g, '').toLowerCase();
156
178
  let isDefaultTooltip = element.hasAttribute('data-istitle') || element.hasAttribute('istitle') ? element.getAttribute('data-istitle') || element.getAttribute('istitle') : 'false';
157
179
  isDefaultTooltip = isDefaultTooltip === 'true';
158
180
  let isSameText = originText.indexOf(tooltipText) !== -1 ? true : false;
181
+
159
182
  if (!isContentDotted && isSameText && !isDefaultTooltip) {
160
183
  return false;
161
184
  }
185
+
162
186
  if (isContentDotted && titleDiv.getAttribute('data-dottedTitle')) {
163
187
  title = titleDiv.getAttribute('data-dottedTitle');
164
188
  }
165
189
  }
190
+
166
191
  let isHtml = titleDiv.getAttribute('data-ishtml');
167
192
  let dataTooltipnoArrow = titleDiv.getAttribute('data-tooltip-noarrow') === 'true' ? true : false;
168
193
  let dataTooltipWrap = titleDiv.getAttribute('data-title-wrap') === 'true' ? true : false;
@@ -175,6 +200,7 @@ export default class Tooltip extends React.Component {
175
200
  dataTooltipWrap
176
201
  }, () => {
177
202
  let tooltip = this.toolTip;
203
+
178
204
  if (tooltip) {
179
205
  /* element top, left, height, width */
180
206
  let thisTop = clientRect.top;
@@ -182,9 +208,11 @@ export default class Tooltip extends React.Component {
182
208
  let thisHeight = clientRect.height;
183
209
  let thisWidth = clientRect.width;
184
210
  /* box layout left spacing */
185
- let bodyLeft = boxLayout.left;
186
- // let checkTop = thisTop + thisHeight;
211
+
212
+ let bodyLeft = boxLayout.left; // let checkTop = thisTop + thisHeight;
213
+
187
214
  /* element left plus element width */
215
+
188
216
  let checkLeft = thisLeft + thisWidth;
189
217
  let tTop;
190
218
  let tLeft;
@@ -194,6 +222,7 @@ export default class Tooltip extends React.Component {
194
222
  let bottomEdge;
195
223
  let tooltipLeft;
196
224
  /* offset width, height of body */
225
+
197
226
  let bodyWidth = containerElement.offsetWidth;
198
227
  let bodyHeight = containerElement.offsetHeight;
199
228
  let isArrowHorizontal = false;
@@ -201,12 +230,16 @@ export default class Tooltip extends React.Component {
201
230
  let isArrowRight = false;
202
231
  let tWidth = '';
203
232
  /* overall body height minus element top + element height */
233
+
204
234
  let thisBottom = bodyHeight - (thisTop + thisHeight);
205
235
  /* overall body width minus element left + element width */
236
+
206
237
  let thisRight = bodyWidth - (thisLeft + thisWidth);
207
238
  /* tooltip width and height */
239
+
208
240
  let tooltipoffsetWidth = tooltip.offsetWidth;
209
241
  let tooltipoffsetHeight = tooltip.offsetHeight;
242
+
210
243
  if (isPosition) {
211
244
  if (isPosition == 'top') {
212
245
  /* if top does not have enough space show tooltip in bottom area */
@@ -234,8 +267,9 @@ export default class Tooltip extends React.Component {
234
267
  toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
235
268
  isArrowDown = true;
236
269
  }
237
-
238
270
  /* top tooltip left and right corner edge case */
271
+
272
+
239
273
  let values = this.leftRightScreenEdge(tLeft, toolTipArrowLeft, thisLeft, thisWidth, tooltipoffsetWidth, bodyWidth, rightEdge, bodyLeft);
240
274
  tLeft = values.tLeft, toolTipArrowLeft = values.toolTipArrowLeft, thisLeft = values.thisLeft, thisWidth = values.thisWidth, tooltipoffsetWidth = values.tooltipoffsetWidth, bodyWidth = values.bodyWidth, rightEdge = values.rightEdge;
241
275
  } else if (isPosition == 'bottom') {
@@ -264,12 +298,14 @@ export default class Tooltip extends React.Component {
264
298
  toolTipArrowLeft = parseInt(tooltipoffsetWidth / 2 - 6);
265
299
  isArrowDown = false;
266
300
  }
267
-
268
301
  /* bottom tooltip left and right corner edge case */
302
+
303
+
269
304
  let values = this.leftRightScreenEdge(tLeft, toolTipArrowLeft, thisLeft, thisWidth, tooltipoffsetWidth, bodyWidth, rightEdge, bodyLeft);
270
305
  tLeft = values.tLeft, toolTipArrowLeft = values.toolTipArrowLeft, thisLeft = values.thisLeft, thisWidth = values.thisWidth, tooltipoffsetWidth = values.tooltipoffsetWidth, bodyWidth = values.bodyWidth, rightEdge = values.rightEdge;
271
306
  } else if (isPosition == 'left') {
272
307
  isArrowHorizontal = true;
308
+
273
309
  if (thisLeft - bodyLeft <= tooltipoffsetWidth) {
274
310
  if (thisLeft - bodyLeft <= thisRight) {
275
311
  /* if left does not have enough space show tooltip in right area */
@@ -298,12 +334,14 @@ export default class Tooltip extends React.Component {
298
334
  toolTipArrowLeft = parseInt(tooltipoffsetWidth - 2);
299
335
  isArrowRight = true;
300
336
  }
301
-
302
337
  /* left tooltip top and bottom corner edge case */
338
+
339
+
303
340
  let values = this.topBottomScreenEdge(tTop, toolTipArrowTop, thisTop, thisHeight, tooltipoffsetHeight, bodyHeight, bottomEdge);
304
341
  tTop = values.tTop, toolTipArrowTop = values.toolTipArrowTop, thisTop = values.thisTop, thisHeight = values.thisHeight, tooltipoffsetHeight = values.tooltipoffsetHeight, bodyHeight = values.bodyHeight, bottomEdge = values.bottomEdge;
305
342
  } else if (isPosition == 'right') {
306
343
  isArrowHorizontal = true;
344
+
307
345
  if (thisRight + bodyLeft <= tooltipoffsetWidth) {
308
346
  if (thisLeft + bodyLeft <= thisRight) {
309
347
  /* if right space is larger than left space show tooltip in right (default) area */
@@ -339,11 +377,13 @@ export default class Tooltip extends React.Component {
339
377
  toolTipArrowLeft = -1;
340
378
  isArrowRight = false;
341
379
  }
342
-
343
380
  /* right tooltip left and right corner edge case */
381
+
382
+
344
383
  let values = this.topBottomScreenEdge(tTop, toolTipArrowTop, thisTop, thisHeight, tooltipoffsetHeight, bodyHeight, bottomEdge);
345
384
  tTop = values.tTop, toolTipArrowTop = values.toolTipArrowTop, thisTop = values.thisTop, thisHeight = values.thisHeight, tooltipoffsetHeight = values.tooltipoffsetHeight, bodyHeight = values.bodyHeight, bottomEdge = values.bottomEdge;
346
385
  }
386
+
347
387
  this.setState({
348
388
  top: tTop,
349
389
  left: tLeft,
@@ -361,6 +401,7 @@ export default class Tooltip extends React.Component {
361
401
  tTop = parseInt(thisTop + thisHeight + 10);
362
402
  tLeft = parseInt(thisLeft - (tooltipoffsetWidth / 2 - thisWidth / 2) + 2);
363
403
  tooltipLeft = parseInt(tooltipoffsetWidth / 2 - 6);
404
+
364
405
  if (tLeft - bodyLeft <= 1) {
365
406
  // default left side screen edge case
366
407
  tooltipLeft = parseInt(thisLeft - bodyLeft + thisWidth / 2 - 6);
@@ -374,7 +415,9 @@ export default class Tooltip extends React.Component {
374
415
  tLeft = parseInt(thisLeft - (tooltipoffsetWidth - thisWidth) / 2);
375
416
  tooltipLeft = parseInt(tooltipoffsetWidth / 2 - 4);
376
417
  }
418
+
377
419
  isArrowDown = false;
420
+
378
421
  if (tTop + tooltipoffsetHeight > bodyHeight) {
379
422
  /* if bottom does not have enough space show tooltip in top area */
380
423
  if (thisTop > thisBottom) {
@@ -382,6 +425,7 @@ export default class Tooltip extends React.Component {
382
425
  tTop -= tooltipoffsetHeight + thisHeight + 20;
383
426
  }
384
427
  }
428
+
385
429
  if (isArrowDown) {
386
430
  let arrowTop = tooltipoffsetHeight - 4;
387
431
  this.setState({
@@ -413,6 +457,7 @@ export default class Tooltip extends React.Component {
413
457
  this.reset();
414
458
  }
415
459
  }
460
+
416
461
  render() {
417
462
  let {
418
463
  title,
@@ -459,11 +504,10 @@ export default class Tooltip extends React.Component {
459
504
  className: tooltipCss
460
505
  }, title)) : null;
461
506
  }
507
+
462
508
  }
463
509
  Tooltip.propTypes = propTypes;
464
- Tooltip.defaultProps = defaultProps;
465
-
466
- // if (__DOCS__) {
510
+ Tooltip.defaultProps = defaultProps; // if (__DOCS__) {
467
511
  // Tooltip.docs = {
468
512
  // componentGroup: 'Atom',
469
513
  // folderName: 'Style Guide',
@@ -1,15 +1,18 @@
1
1
  import React from 'react';
2
2
  import renderer from 'react-test-renderer';
3
3
  import Tooltip from '../Tooltip';
4
+
4
5
  class SampleComponent extends React.Component {
5
6
  constructor(props) {
6
7
  super(props);
7
8
  this.toolTipRef = /*#__PURE__*/React.createRef();
8
9
  this.setToolTipRef = this.setToolTipRef.bind(this);
9
10
  }
11
+
10
12
  setToolTipRef(ref) {
11
13
  this.toolTipRef = ref;
12
14
  }
15
+
13
16
  render() {
14
17
  return /*#__PURE__*/React.createElement("div", {
15
18
  onMouseOver: e => this.toolTipRef && this.toolTipRef.handleOver(e),
@@ -21,7 +24,9 @@ class SampleComponent extends React.Component {
21
24
  ref: this.setToolTipRef
22
25
  }));
23
26
  }
27
+
24
28
  }
29
+
25
30
  describe('Tooltip component conditions', () => {
26
31
  it('Is HandleOver Executed', () => {
27
32
  let sampleComponent = TestUtils.renderIntoDocument( /*#__PURE__*/React.createElement(SampleComponent, null));
@@ -8,6 +8,7 @@ export default class VelocityAnimation extends React.Component {
8
8
  constructor(props) {
9
9
  super(props);
10
10
  }
11
+
11
12
  render() {
12
13
  let {
13
14
  children,
@@ -65,11 +66,11 @@ export default class VelocityAnimation extends React.Component {
65
66
  interruptBehavior: "queue"
66
67
  }, children);
67
68
  }
69
+
68
70
  }
69
71
  VelocityAnimation.defaultProps = defaultProps;
70
72
  VelocityAnimation.propTypes = propTypes;
71
- VelocityAnimation.contextType = LibraryContext;
72
- // if (__DOCS__) {
73
+ VelocityAnimation.contextType = LibraryContext; // if (__DOCS__) {
73
74
  // VelocityAnimation.docs = {
74
75
  // componentGroup: 'Animation'
75
76
  // };
@@ -1,10 +1,12 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
2
3
  import React from 'react';
3
4
  import { defaultProps } from './props/defaultProps';
4
5
  import { propTypes } from './props/propTypes';
5
6
  import { VelocityTransitionGroup } from 'velocity-react';
6
7
  import 'velocity-animate/velocity.ui';
7
8
  import LibraryContext from '../../Provider/LibraryContextInit';
9
+
8
10
  function clearProps(props) {
9
11
  let newProps = Object.assign({}, props);
10
12
  Object.keys(VelocityAnimationGroup.propTypes).forEach(key => {
@@ -12,10 +14,12 @@ function clearProps(props) {
12
14
  });
13
15
  return newProps;
14
16
  }
17
+
15
18
  export default class VelocityAnimationGroup extends React.Component {
16
19
  constructor(props) {
17
20
  super(props);
18
21
  }
22
+
19
23
  render() {
20
24
  let {
21
25
  children,
@@ -91,15 +95,13 @@ export default class VelocityAnimationGroup extends React.Component {
91
95
  enterShowStyle: enterShowStyle
92
96
  }, childProps), isActive ? children : null);
93
97
  }
98
+
94
99
  }
95
- VelocityAnimationGroup.defaultProps = {
96
- ...defaultProps,
100
+ VelocityAnimationGroup.defaultProps = { ...defaultProps,
97
101
  component: React.Fragment
98
102
  };
99
103
  VelocityAnimationGroup.propTypes = propTypes;
100
- VelocityAnimationGroup.contextType = LibraryContext;
101
-
102
- // if (__DOCS__) {
104
+ VelocityAnimationGroup.contextType = LibraryContext; // if (__DOCS__) {
103
105
  // VelocityAnimationGroup.docs = {
104
106
  // componentGroup: 'Animation'
105
107
  // };
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { propTypes } from './props/propTypes';
3
- import { defaultProps } from './props/defaultProps';
4
- //Components
3
+ import { defaultProps } from './props/defaultProps'; //Components
4
+
5
5
  import Modal from '../../Modal/Modal';
6
6
  let RefElement = /*#__PURE__*/React.forwardRef((props, ref) => {
7
7
  let {
@@ -28,20 +28,23 @@ export default class PortalLayer extends React.Component {
28
28
  this.updateState = this.updateState.bind(this);
29
29
  this.getState = this.getState.bind(this);
30
30
  }
31
+
31
32
  componentDidUpdate(prevProps) {
32
33
  let {
33
- isActive
34
- } = this.props,
35
- {
36
- isActive: prevActive
37
- } = prevProps;
34
+ isActive
35
+ } = this.props,
36
+ {
37
+ isActive: prevActive
38
+ } = prevProps;
38
39
  isActive = Boolean(isActive), prevActive = Boolean(prevActive);
40
+
39
41
  if (typeof isActive !== 'undefined' && isActive != prevActive && Boolean(this.state.isOpen) != isActive) {
40
42
  this.setState({
41
43
  isOpen: isActive
42
44
  });
43
45
  }
44
46
  }
47
+
45
48
  updateState(alertState) {
46
49
  if (typeof alertState === 'boolean') {
47
50
  this.setState({
@@ -51,9 +54,11 @@ export default class PortalLayer extends React.Component {
51
54
  this.setState(alertState);
52
55
  }
53
56
  }
57
+
54
58
  getState() {
55
59
  return Object.keys(this.state).length == 1 ? this.state.isOpen : this.state;
56
60
  }
61
+
57
62
  componentDidMount() {
58
63
  let {
59
64
  saveUpdateFunction,
@@ -63,19 +68,20 @@ export default class PortalLayer extends React.Component {
63
68
  saveUpdateFunction && saveUpdateFunction(this.updateState, name);
64
69
  saveGetFunction && saveGetFunction(this.getState, name);
65
70
  }
71
+
66
72
  render() {
67
73
  let {
68
- children,
69
- renderChildren,
70
- portalId,
71
- autoZIndexNeeded,
72
- isChildrenRestrictionNeeded
73
- } = this.props,
74
- {
75
- isOpen = false
76
- } = this.state;
74
+ children,
75
+ renderChildren,
76
+ portalId,
77
+ autoZIndexNeeded,
78
+ isChildrenRestrictionNeeded
79
+ } = this.props,
80
+ {
81
+ isOpen = false
82
+ } = this.state;
77
83
  let Element = children && children.type,
78
- elementProps = children && children.props;
84
+ elementProps = children && children.props;
79
85
  return /*#__PURE__*/React.createElement(Modal, {
80
86
  autoZIndexNeeded: autoZIndexNeeded,
81
87
  portalId: portalId,
@@ -88,11 +94,10 @@ export default class PortalLayer extends React.Component {
88
94
  isActive: isOpen
89
95
  }));
90
96
  }
97
+
91
98
  }
92
99
  PortalLayer.defaultProps = defaultProps;
93
- PortalLayer.propTypes = propTypes;
94
-
95
- // if (__DOCS__) {
100
+ PortalLayer.propTypes = propTypes; // if (__DOCS__) {
96
101
  // PortalLayer.docs = {
97
102
  // componentGroup: 'Atom',
98
103
  // folderName: 'Style Guide'
@@ -6,6 +6,7 @@ export default class Button extends React.Component {
6
6
  constructor(props) {
7
7
  super(props);
8
8
  }
9
+
9
10
  render() {
10
11
  const {
11
12
  value,
@@ -47,10 +48,10 @@ export default class Button extends React.Component {
47
48
  "data-title": title
48
49
  }, children ? children : text);
49
50
  }
51
+
50
52
  }
51
53
  Button.defaultProps = defaultProps;
52
- Button.propTypes = propTypes;
53
- // if (__DOCS__) {
54
+ Button.propTypes = propTypes; // if (__DOCS__) {
54
55
  // Button.docs = {
55
56
  // componentGroup: 'semantic',
56
57
  // folderName: 'DefaultComponents'