@zohodesk/components 1.2.19 → 1.2.21

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 (335) hide show
  1. package/.cli/PropUnificationExcludeFilesArray.js +231 -0
  2. package/.cli/propValidation_report.html +24 -2
  3. package/PropValidationExcludeFilesArray.js +1 -0
  4. package/README.md +10 -0
  5. package/es/Avatar/Avatar.js +2 -1
  6. package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +1 -0
  7. package/es/DateTime/DateTime.module.css +2 -2
  8. package/es/DateTime/YearView.module.css +1 -1
  9. package/es/Label/Label.module.css +6 -1
  10. package/es/ListItem/ListContainer.js +3 -2
  11. package/es/ListItem/ListItem.module.css +1 -1
  12. package/es/MultiSelect/Suggestions.js +2 -1
  13. package/es/Ribbon/Ribbon.module.css +49 -3
  14. package/es/Select/Select.js +13 -4
  15. package/es/Select/Select.module.css +27 -1
  16. package/es/Switch/Switch.js +2 -2
  17. package/es/Switch/__tests__/__snapshots__/Switch.spec.js.snap +22 -22
  18. package/es/Tab/Tab.module.css +3 -3
  19. package/es/TextBox/TextBox.js +8 -1
  20. package/es/TextBox/TextBox.module.css +45 -6
  21. package/es/TextBox/props/defaultProps.js +1 -0
  22. package/es/TextBox/props/propTypes.js +1 -0
  23. package/es/TextBoxIcon/TextBoxIcon.js +2 -0
  24. package/es/TextBoxIcon/props/defaultProps.js +1 -0
  25. package/es/TextBoxIcon/props/propTypes.js +1 -0
  26. package/es/Textarea/Textarea.module.css +4 -3
  27. package/es/Tooltip/Tooltip.js +4 -2
  28. package/es/Tooltip/Tooltip.module.css +1 -1
  29. package/es/v1/Accordion/Accordion.js +2 -2
  30. package/es/v1/Accordion/AccordionItem.js +2 -2
  31. package/es/v1/Accordion/props/defaultProps.js +12 -0
  32. package/es/v1/Accordion/props/propTypes.js +33 -0
  33. package/es/v1/Animation/Animation.js +2 -2
  34. package/es/v1/Animation/props/defaultProps.js +7 -0
  35. package/es/v1/Animation/props/propTypes.js +12 -0
  36. package/es/v1/AppContainer/AppContainer.js +2 -2
  37. package/es/v1/AppContainer/props/defaultProps.js +10 -0
  38. package/es/v1/AppContainer/props/propTypes.js +17 -0
  39. package/es/v1/Avatar/Avatar.js +4 -3
  40. package/es/v1/Avatar/props/defaultProps.js +17 -0
  41. package/es/v1/Avatar/props/propTypes.js +26 -0
  42. package/es/v1/AvatarTeam/AvatarTeam.js +3 -3
  43. package/es/v1/AvatarTeam/props/defaultProps.js +17 -0
  44. package/es/v1/AvatarTeam/props/propTypes.js +27 -0
  45. package/es/v1/Button/Button.js +2 -2
  46. package/es/v1/Button/props/defaultProps.js +18 -0
  47. package/es/v1/Button/props/propTypes.js +27 -0
  48. package/es/v1/Buttongroup/Buttongroup.js +2 -2
  49. package/es/v1/Buttongroup/props/defaultProps.js +6 -0
  50. package/es/v1/Buttongroup/props/propTypes.js +9 -0
  51. package/es/v1/Card/Card.js +3 -3
  52. package/es/v1/Card/props/defaultProps.js +25 -0
  53. package/es/v1/Card/props/propTypes.js +48 -0
  54. package/es/v1/CheckBox/CheckBox.js +5 -5
  55. package/es/v1/CheckBox/props/defaultProps.js +18 -0
  56. package/es/v1/CheckBox/props/propTypes.js +40 -0
  57. package/es/v1/DropBox/DropBox.js +2 -2
  58. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +2 -2
  59. package/es/v1/DropBox/DropBoxElement/props/defaultProps.js +18 -0
  60. package/es/v1/DropBox/DropBoxElement/props/propTypes.js +51 -0
  61. package/es/v1/DropBox/props/defaultProps.js +14 -0
  62. package/es/v1/DropBox/props/propTypes.js +16 -0
  63. package/es/v1/DropDown/DropDown.js +2 -2
  64. package/es/v1/DropDown/DropDownHeading.js +2 -2
  65. package/es/v1/DropDown/DropDownItem.js +2 -2
  66. package/es/v1/DropDown/DropDownSearch.js +2 -2
  67. package/es/v1/DropDown/DropDownSeparator.js +1 -1
  68. package/es/v1/DropDown/props/defaultProps.js +20 -0
  69. package/es/v1/DropDown/props/propTypes.js +65 -0
  70. package/es/v1/Heading/Heading.js +2 -2
  71. package/es/v1/Heading/props/defaultProps.js +5 -0
  72. package/es/v1/Heading/props/propTypes.js +11 -0
  73. package/es/v1/Label/Label.js +2 -2
  74. package/es/v1/Label/props/defaultProps.js +11 -0
  75. package/es/v1/Label/props/propTypes.js +19 -0
  76. package/es/v1/Layout/Box.js +2 -2
  77. package/es/v1/Layout/Container.js +2 -2
  78. package/es/v1/Layout/props/defaultProps.js +16 -0
  79. package/es/v1/Layout/props/propTypes.js +46 -0
  80. package/es/v1/ListItem/ListContainer.js +5 -4
  81. package/es/v1/ListItem/ListItem.js +2 -2
  82. package/es/v1/ListItem/ListItemWithAvatar.js +2 -2
  83. package/es/v1/ListItem/ListItemWithCheckBox.js +2 -2
  84. package/es/v1/ListItem/ListItemWithIcon.js +2 -2
  85. package/es/v1/ListItem/ListItemWithRadio.js +2 -2
  86. package/es/v1/ListItem/props/defaultProps.js +97 -0
  87. package/es/v1/ListItem/props/propTypes.js +202 -0
  88. package/es/v1/Modal/Modal.js +2 -2
  89. package/es/v1/Modal/props/defaultProps.js +3 -0
  90. package/es/v1/Modal/props/propTypes.js +7 -0
  91. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +2 -2
  92. package/es/v1/MultiSelect/AdvancedMultiSelect.js +2 -2
  93. package/es/v1/MultiSelect/EmptyState.js +2 -2
  94. package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +2 -2
  95. package/es/v1/MultiSelect/MobileHeader/props/defaultProps.js +7 -0
  96. package/es/v1/MultiSelect/MobileHeader/props/propTypes.js +7 -0
  97. package/es/v1/MultiSelect/MultiSelect.js +3 -3
  98. package/es/v1/MultiSelect/MultiSelectHeader.js +2 -2
  99. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +3 -3
  100. package/es/v1/MultiSelect/SelectedOptions.js +2 -2
  101. package/es/v1/MultiSelect/Suggestions.js +4 -3
  102. package/es/v1/MultiSelect/props/defaultProps.js +153 -0
  103. package/es/v1/MultiSelect/props/propTypes.js +312 -0
  104. package/es/v1/PopOver/PopOver.js +2 -2
  105. package/es/v1/PopOver/props/defaultProps.js +7 -0
  106. package/es/v1/PopOver/props/propTypes.js +53 -0
  107. package/es/v1/Radio/Radio.js +4 -4
  108. package/es/v1/Radio/props/defaultProps.js +14 -0
  109. package/es/v1/Radio/props/propTypes.js +33 -0
  110. package/es/v1/Responsive/CustomResponsive.js +2 -2
  111. package/es/v1/Responsive/Responsive.js +2 -2
  112. package/es/v1/Responsive/props/defaultProps.js +13 -0
  113. package/es/v1/Responsive/props/propTypes.js +25 -0
  114. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +2 -2
  115. package/es/v1/ResponsiveDropBox/props/defaultProps.js +4 -0
  116. package/es/v1/ResponsiveDropBox/props/propTypes.js +8 -0
  117. package/es/v1/Ribbon/Ribbon.js +3 -3
  118. package/es/v1/Ribbon/props/defaultProps.js +9 -0
  119. package/es/v1/Ribbon/props/propTypes.js +11 -0
  120. package/es/v1/RippleEffect/RippleEffect.js +2 -2
  121. package/es/v1/RippleEffect/props/defaultProps.js +9 -0
  122. package/es/v1/RippleEffect/props/propTypes.js +11 -0
  123. package/es/v1/Select/GroupSelect.js +2 -2
  124. package/es/v1/Select/Select.js +15 -6
  125. package/es/v1/Select/SelectWithAvatar.js +2 -2
  126. package/es/v1/Select/SelectWithIcon.js +2 -2
  127. package/es/v1/Select/props/defaultProps.js +119 -0
  128. package/es/v1/Select/props/propTypes.js +288 -0
  129. package/es/v1/Stencils/Stencils.js +2 -2
  130. package/es/v1/Stencils/props/defaultProps.js +6 -0
  131. package/es/v1/Stencils/props/propTypes.js +7 -0
  132. package/es/v1/Switch/Switch.js +4 -4
  133. package/es/v1/Switch/props/defaultProps.js +11 -0
  134. package/es/v1/Switch/props/propTypes.js +28 -0
  135. package/es/v1/Tab/Tab.js +3 -4
  136. package/es/v1/Tab/TabContent.js +3 -3
  137. package/es/v1/Tab/TabContentWrapper.js +2 -2
  138. package/es/v1/Tab/TabWrapper.js +2 -2
  139. package/es/v1/Tab/Tabs.js +184 -273
  140. package/es/v1/Tab/props/defaultProps.js +44 -0
  141. package/es/v1/Tab/props/propTypes.js +106 -0
  142. package/es/v1/Tab/v1Tab.module.css +100 -0
  143. package/es/v1/Tab/v1TabContent.module.css +4 -0
  144. package/es/v1/Tab/v1Tabs.module.css +137 -0
  145. package/es/v1/Tag/Tag.js +2 -2
  146. package/es/v1/Tag/props/defaultProps.js +14 -0
  147. package/es/v1/Tag/props/propTypes.js +35 -0
  148. package/es/v1/TextBox/TextBox.js +10 -4
  149. package/es/v1/TextBox/props/defaultProps.js +20 -0
  150. package/es/v1/TextBox/props/propTypes.js +56 -0
  151. package/es/v1/TextBoxIcon/TextBoxIcon.js +5 -3
  152. package/es/v1/TextBoxIcon/props/defaultProps.js +23 -0
  153. package/es/v1/TextBoxIcon/props/propTypes.js +52 -0
  154. package/es/v1/Textarea/Textarea.js +2 -2
  155. package/es/v1/Textarea/props/defaultProps.js +17 -0
  156. package/es/v1/Textarea/props/propTypes.js +31 -0
  157. package/es/v1/Tooltip/Tooltip.js +6 -4
  158. package/es/v1/Tooltip/props/defaultProps.js +4 -0
  159. package/es/v1/Tooltip/props/propTypes.js +5 -0
  160. package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +2 -2
  161. package/es/v1/VelocityAnimation/VelocityAnimation/props/defaultProps.js +7 -0
  162. package/es/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +12 -0
  163. package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -2
  164. package/es/v1/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +15 -0
  165. package/es/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +19 -0
  166. package/es/v1/semantic/Button/Button.js +2 -2
  167. package/es/v1/semantic/Button/props/defaultProps.js +12 -0
  168. package/es/v1/semantic/Button/props/propTypes.js +22 -0
  169. package/lib/Avatar/Avatar.js +2 -1
  170. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +1 -0
  171. package/lib/DateTime/DateTime.module.css +2 -2
  172. package/lib/DateTime/YearView.module.css +1 -1
  173. package/lib/Label/Label.module.css +6 -1
  174. package/lib/ListItem/ListContainer.js +10 -2
  175. package/lib/ListItem/ListItem.module.css +1 -1
  176. package/lib/MultiSelect/Suggestions.js +2 -1
  177. package/lib/Ribbon/Ribbon.module.css +49 -3
  178. package/lib/Select/Select.js +17 -4
  179. package/lib/Select/Select.module.css +27 -1
  180. package/lib/Switch/Switch.js +2 -2
  181. package/lib/Switch/__tests__/__snapshots__/Switch.spec.js.snap +22 -22
  182. package/lib/Tab/Tab.module.css +3 -3
  183. package/lib/TextBox/TextBox.js +9 -1
  184. package/lib/TextBox/TextBox.module.css +45 -6
  185. package/lib/TextBox/props/defaultProps.js +1 -0
  186. package/lib/TextBox/props/propTypes.js +1 -1
  187. package/lib/TextBoxIcon/TextBoxIcon.js +2 -0
  188. package/lib/TextBoxIcon/props/defaultProps.js +1 -0
  189. package/lib/TextBoxIcon/props/propTypes.js +1 -0
  190. package/lib/Textarea/Textarea.module.css +4 -3
  191. package/lib/Tooltip/Tooltip.js +4 -2
  192. package/lib/Tooltip/Tooltip.module.css +1 -1
  193. package/lib/v1/Accordion/Accordion.js +2 -2
  194. package/lib/v1/Accordion/AccordionItem.js +2 -2
  195. package/lib/v1/Accordion/props/defaultProps.js +20 -0
  196. package/lib/v1/Accordion/props/propTypes.js +45 -0
  197. package/lib/v1/Animation/Animation.js +2 -2
  198. package/lib/v1/Animation/props/defaultProps.js +14 -0
  199. package/lib/v1/Animation/props/propTypes.js +23 -0
  200. package/lib/v1/AppContainer/AppContainer.js +2 -2
  201. package/lib/v1/AppContainer/props/defaultProps.js +17 -0
  202. package/lib/v1/AppContainer/props/propTypes.js +28 -0
  203. package/lib/v1/Avatar/Avatar.js +4 -3
  204. package/lib/v1/Avatar/props/defaultProps.js +24 -0
  205. package/lib/v1/Avatar/props/propTypes.js +37 -0
  206. package/lib/v1/AvatarTeam/AvatarTeam.js +3 -3
  207. package/lib/v1/AvatarTeam/props/defaultProps.js +24 -0
  208. package/lib/v1/AvatarTeam/props/propTypes.js +38 -0
  209. package/lib/v1/Button/Button.js +2 -2
  210. package/lib/v1/Button/props/defaultProps.js +27 -0
  211. package/lib/v1/Button/props/propTypes.js +39 -0
  212. package/lib/v1/Buttongroup/Buttongroup.js +2 -2
  213. package/lib/v1/Buttongroup/props/defaultProps.js +13 -0
  214. package/lib/v1/Buttongroup/props/propTypes.js +20 -0
  215. package/lib/v1/Card/Card.js +3 -3
  216. package/lib/v1/Card/props/defaultProps.js +35 -0
  217. package/lib/v1/Card/props/propTypes.js +62 -0
  218. package/lib/v1/CheckBox/CheckBox.js +5 -5
  219. package/lib/v1/CheckBox/props/defaultProps.js +25 -0
  220. package/lib/v1/CheckBox/props/propTypes.js +51 -0
  221. package/lib/v1/DropBox/DropBox.js +2 -2
  222. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +2 -2
  223. package/lib/v1/DropBox/DropBoxElement/props/defaultProps.js +25 -0
  224. package/lib/v1/DropBox/DropBoxElement/props/propTypes.js +62 -0
  225. package/lib/v1/DropBox/props/defaultProps.js +30 -0
  226. package/lib/v1/DropBox/props/propTypes.js +35 -0
  227. package/lib/v1/DropDown/DropDown.js +2 -2
  228. package/lib/v1/DropDown/DropDownHeading.js +2 -2
  229. package/lib/v1/DropDown/DropDownItem.js +2 -2
  230. package/lib/v1/DropDown/DropDownSearch.js +2 -2
  231. package/lib/v1/DropDown/DropDownSeparator.js +1 -1
  232. package/lib/v1/DropDown/props/defaultProps.js +30 -0
  233. package/lib/v1/DropDown/props/propTypes.js +87 -0
  234. package/lib/v1/Heading/Heading.js +2 -2
  235. package/lib/v1/Heading/props/defaultProps.js +12 -0
  236. package/lib/v1/Heading/props/propTypes.js +22 -0
  237. package/lib/v1/Label/Label.js +2 -2
  238. package/lib/v1/Label/props/defaultProps.js +18 -0
  239. package/lib/v1/Label/props/propTypes.js +30 -0
  240. package/lib/v1/Layout/Box.js +2 -2
  241. package/lib/v1/Layout/Container.js +2 -2
  242. package/lib/v1/Layout/props/defaultProps.js +24 -0
  243. package/lib/v1/Layout/props/propTypes.js +58 -0
  244. package/lib/v1/ListItem/ListContainer.js +12 -4
  245. package/lib/v1/ListItem/ListItem.js +2 -2
  246. package/lib/v1/ListItem/ListItemWithAvatar.js +2 -2
  247. package/lib/v1/ListItem/ListItemWithCheckBox.js +2 -2
  248. package/lib/v1/ListItem/ListItemWithIcon.js +2 -2
  249. package/lib/v1/ListItem/ListItemWithRadio.js +2 -2
  250. package/lib/v1/ListItem/props/defaultProps.js +109 -0
  251. package/lib/v1/ListItem/props/propTypes.js +196 -0
  252. package/lib/v1/Modal/Modal.js +2 -2
  253. package/lib/v1/Modal/props/defaultProps.js +10 -0
  254. package/lib/v1/Modal/props/propTypes.js +18 -0
  255. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +2 -2
  256. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +2 -2
  257. package/lib/v1/MultiSelect/EmptyState.js +2 -2
  258. package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +2 -2
  259. package/lib/v1/MultiSelect/MobileHeader/props/defaultProps.js +14 -0
  260. package/lib/v1/MultiSelect/MobileHeader/props/propTypes.js +18 -0
  261. package/lib/v1/MultiSelect/MultiSelect.js +3 -3
  262. package/lib/v1/MultiSelect/MultiSelectHeader.js +2 -2
  263. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +3 -3
  264. package/lib/v1/MultiSelect/SelectedOptions.js +2 -2
  265. package/lib/v1/MultiSelect/Suggestions.js +4 -3
  266. package/lib/v1/MultiSelect/props/defaultProps.js +169 -0
  267. package/lib/v1/MultiSelect/props/propTypes.js +340 -0
  268. package/lib/v1/PopOver/PopOver.js +2 -2
  269. package/lib/v1/PopOver/props/defaultProps.js +15 -0
  270. package/lib/v1/PopOver/props/propTypes.js +66 -0
  271. package/lib/v1/Radio/Radio.js +4 -4
  272. package/lib/v1/Radio/props/defaultProps.js +21 -0
  273. package/lib/v1/Radio/props/propTypes.js +44 -0
  274. package/lib/v1/Responsive/CustomResponsive.js +2 -2
  275. package/lib/v1/Responsive/Responsive.js +2 -2
  276. package/lib/v1/Responsive/props/defaultProps.js +23 -0
  277. package/lib/v1/Responsive/props/propTypes.js +39 -0
  278. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +2 -2
  279. package/lib/v1/ResponsiveDropBox/props/defaultProps.js +11 -0
  280. package/lib/v1/ResponsiveDropBox/props/propTypes.js +27 -0
  281. package/lib/v1/Ribbon/Ribbon.js +3 -3
  282. package/lib/v1/Ribbon/props/defaultProps.js +16 -0
  283. package/lib/v1/Ribbon/props/propTypes.js +22 -0
  284. package/lib/v1/RippleEffect/RippleEffect.js +2 -2
  285. package/lib/v1/RippleEffect/props/defaultProps.js +16 -0
  286. package/lib/v1/RippleEffect/props/propTypes.js +22 -0
  287. package/lib/v1/Select/GroupSelect.js +2 -2
  288. package/lib/v1/Select/Select.js +19 -6
  289. package/lib/v1/Select/SelectWithAvatar.js +2 -2
  290. package/lib/v1/Select/SelectWithIcon.js +2 -2
  291. package/lib/v1/Select/props/defaultProps.js +120 -0
  292. package/lib/v1/Select/props/propTypes.js +310 -0
  293. package/lib/v1/Stencils/Stencils.js +2 -2
  294. package/lib/v1/Stencils/props/defaultProps.js +13 -0
  295. package/lib/v1/Stencils/props/propTypes.js +18 -0
  296. package/lib/v1/Switch/Switch.js +4 -4
  297. package/lib/v1/Switch/props/defaultProps.js +18 -0
  298. package/lib/v1/Switch/props/propTypes.js +39 -0
  299. package/lib/v1/Tab/Tab.js +8 -8
  300. package/lib/v1/Tab/TabContent.js +4 -4
  301. package/lib/v1/Tab/TabContentWrapper.js +2 -2
  302. package/lib/v1/Tab/TabWrapper.js +2 -2
  303. package/lib/v1/Tab/Tabs.js +480 -569
  304. package/lib/v1/Tab/props/defaultProps.js +55 -0
  305. package/lib/v1/Tab/props/propTypes.js +121 -0
  306. package/lib/v1/Tab/v1Tab.module.css +100 -0
  307. package/lib/v1/Tab/v1TabContent.module.css +4 -0
  308. package/lib/v1/Tab/v1Tabs.module.css +137 -0
  309. package/lib/v1/Tag/Tag.js +2 -2
  310. package/lib/v1/Tag/props/defaultProps.js +21 -0
  311. package/lib/v1/Tag/props/propTypes.js +46 -0
  312. package/lib/v1/TextBox/TextBox.js +12 -4
  313. package/lib/v1/TextBox/props/defaultProps.js +27 -0
  314. package/lib/v1/TextBox/props/propTypes.js +62 -0
  315. package/lib/v1/TextBoxIcon/TextBoxIcon.js +5 -3
  316. package/lib/v1/TextBoxIcon/props/defaultProps.js +30 -0
  317. package/lib/v1/TextBoxIcon/props/propTypes.js +71 -0
  318. package/lib/v1/Textarea/Textarea.js +2 -2
  319. package/lib/v1/Textarea/props/defaultProps.js +24 -0
  320. package/lib/v1/Textarea/props/propTypes.js +42 -0
  321. package/lib/v1/Tooltip/Tooltip.js +6 -4
  322. package/lib/v1/Tooltip/props/defaultProps.js +11 -0
  323. package/lib/v1/Tooltip/props/propTypes.js +16 -0
  324. package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +2 -2
  325. package/lib/v1/VelocityAnimation/VelocityAnimation/props/defaultProps.js +14 -0
  326. package/lib/v1/VelocityAnimation/VelocityAnimation/props/propTypes.js +23 -0
  327. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -2
  328. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/defaultProps.js +22 -0
  329. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/props/propTypes.js +30 -0
  330. package/lib/v1/semantic/Button/Button.js +2 -2
  331. package/lib/v1/semantic/Button/props/defaultProps.js +19 -0
  332. package/lib/v1/semantic/Button/props/propTypes.js +33 -0
  333. package/package.json +13 -11
  334. package/propValidationArg.json +8 -0
  335. package/result.json +1 -1
@@ -7,13 +7,15 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports["default"] = void 0;
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _useEffectCallOnlyAfterState = _interopRequireDefault(require("@zohodesk/hooks/es/utils/useEffectCallOnlyAfterState"));
11
13
 
12
14
  var _Tab = _interopRequireDefault(require("./Tab"));
13
15
 
14
- var _defaultProps = require("../../Tab/props/defaultProps");
16
+ var _defaultProps = require("./props/defaultProps");
15
17
 
16
- var _propTypes = require("../../Tab/props/propTypes");
18
+ var _propTypes = require("./props/propTypes");
17
19
 
18
20
  var _Common = require("../../utils/Common");
19
21
 
@@ -25,7 +27,7 @@ var _ListItem = _interopRequireDefault(require("../ListItem/ListItem"));
25
27
 
26
28
  var _icons = require("@zohodesk/icons");
27
29
 
28
- var _TabsModule = _interopRequireDefault(require("../../Tab/Tabs.module.css"));
30
+ var _v1TabsModule = _interopRequireDefault(require("./v1Tabs.module.css"));
29
31
 
30
32
  var _Popup = _interopRequireDefault(require("../Popup/Popup"));
31
33
 
@@ -37,6 +39,10 @@ var _semanticButtonModule = _interopRequireDefault(require("../../semantic/Butto
37
39
 
38
40
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
39
41
 
42
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
43
+
44
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
45
+
40
46
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
41
47
 
42
48
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -45,630 +51,535 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
45
51
 
46
52
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
47
53
 
48
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
49
-
50
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
51
-
52
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
53
-
54
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
55
-
56
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
57
-
58
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
59
-
60
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
61
-
62
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
54
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
55
+
56
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
57
+
58
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
59
+
60
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
61
+
62
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
63
+
64
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
65
+
66
+ var Tabs = function Tabs(props) {
67
+ var _useState = (0, _react.useState)(null),
68
+ _useState2 = _slicedToArray(_useState, 2),
69
+ totalDimension = _useState2[0],
70
+ setTotalDimension = _useState2[1];
71
+
72
+ var _useState3 = (0, _react.useState)({}),
73
+ _useState4 = _slicedToArray(_useState3, 2),
74
+ tabDimensions = _useState4[0],
75
+ setTabDimensions = _useState4[1];
76
+
77
+ var highlightInitialDimension = (0, _react.useRef)(null);
78
+
79
+ var _useState5 = (0, _react.useState)(true),
80
+ _useState6 = _slicedToArray(_useState5, 2),
81
+ renderVirtualTabs = _useState6[0],
82
+ setRenderVirtualTabs = _useState6[1];
83
+
84
+ var _useState7 = (0, _react.useState)([]),
85
+ _useState8 = _slicedToArray(_useState7, 2),
86
+ tabKeys = _useState8[0],
87
+ setTabKeys = _useState8[1];
88
+
89
+ var tabsObserver = (0, _react.useRef)(new _ResizeObserver["default"](onResize));
90
+ var tabObserver = (0, _react.useRef)({});
91
+ var highlight = (0, _react.useRef)(null);
92
+ var tabsEle = (0, _react.useRef)(null);
93
+ var tabElement = (0, _react.useRef)({});
94
+ var style = props.style,
95
+ className = props.className,
96
+ dataId = props.dataId,
97
+ highlightClass = props.highlightClass,
98
+ type = props.type,
99
+ isAnimate = props.isAnimate,
100
+ needTabBorder = props.needTabBorder,
101
+ needBorder = props.needBorder,
102
+ needPadding = props.needPadding,
103
+ align = props.align,
104
+ boxPosition = props.boxPosition,
105
+ removeClose = props.removeClose,
106
+ togglePopup = props.togglePopup,
107
+ needAppearance = props.needAppearance,
108
+ children = props.children,
109
+ onSelect = props.onSelect,
110
+ onScroll = props.onScroll,
111
+ isResponsive = props.isResponsive,
112
+ maxTabsCount = props.maxTabsCount,
113
+ minTabsCount = props.minTabsCount,
114
+ childType = props.childType,
115
+ containerClass = props.containerClass,
116
+ dataSelectorId = props.dataSelectorId,
117
+ selectedTab = props.selectedTab;
118
+
119
+ function onTabResize(size, target) {
120
+ var newDim = Object.assign({}, tabDimensions);
121
+ var elemDim = (0, _Common.getTotalDimension)(target, align);
122
+
123
+ if (elemDim !== 0) {
124
+ newDim[target.dataset.key] = elemDim;
125
+ }
63
126
 
64
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
127
+ setTabDimensions(newDim);
128
+ }
65
129
 
66
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
130
+ (0, _react.useEffect)(function () {
131
+ var totalDimension = getTotalDimensionLocal();
132
+ var tabDimensions = getTabDimensions();
133
+ var tabKeys = [];
134
+ var restrictedKeys = ['state', 'props', 'refs', 'context'];
67
135
 
68
- var Tabs = /*#__PURE__*/function (_React$Component) {
69
- _inherits(Tabs, _React$Component);
136
+ _react["default"].Children.toArray(children).forEach(function (child) {
137
+ if (child && child.props.id && child.type === childType) {
138
+ if (restrictedKeys.includes(child.props.id)) {
139
+ throw new Error('Restricted id name found in Tabs, Please avoid these names => ' + restrictedKeys.toString());
140
+ } else {
141
+ tabKeys.push(child.props.id);
142
+ }
143
+ }
144
+ });
70
145
 
71
- var _super = _createSuper(Tabs);
146
+ setTotalDimension(totalDimension);
147
+ setTabDimensions(tabDimensions);
148
+ setRenderVirtualTabs(false);
149
+ setTabKeys(tabKeys);
72
150
 
73
- function Tabs(props) {
74
- var _this;
151
+ if (highlight.current) {
152
+ highlightInitialDimension.current = getHighlightDim();
153
+ moveHighlight();
154
+ }
75
155
 
76
- _classCallCheck(this, Tabs);
156
+ return function () {
157
+ if (tabsObserver.current) {
158
+ tabsObserver.current.disconnect();
159
+ tabsObserver.current = null;
160
+ }
77
161
 
78
- _this = _super.call(this, props);
79
- _this.state = {
80
- totalDimension: null,
81
- tabDimensions: {},
82
- highlightInitialDimension: null,
83
- renderVirtualTabs: true,
84
- tabKeys: []
162
+ if (tabObserver.current) {
163
+ Object.keys(tabObserver.current).forEach(function (observer) {
164
+ tabObserver.current[observer] && tabObserver.current[observer].disconnect();
165
+ });
166
+ tabObserver.current = null;
167
+ }
85
168
  };
86
-
87
- _Common.bind.apply(_assertThisInitialized(_this), ['moreTabSelect', 'onResize', 'onTabResize', 'getHighlightRef', 'getTabsRef', 'getTabRef', 'getHighlightDim', 'onSizeChange', 'onScroll', 'togglePopup', 'setMaxDim']);
88
-
89
- _this.tabsObserver = new _ResizeObserver["default"](_this.onResize);
90
- _this.tabObserver = {};
91
- return _this;
169
+ }, []);
170
+
171
+ function setMaxDim() {
172
+ var totalDimension = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
173
+
174
+ // let actual = Object.keys(tabDimensions).reduce(
175
+ // (sum, tab) => sum + (tabDimensions[tab] || 0),
176
+ // 0
177
+ // );
178
+ if (totalDimension && tabElement.current[selectedTab]) {
179
+ var newDim = "".concat((0, _Common.remConvert)(totalDimension), "rem");
180
+ align === 'vertical' ? tabElement.current[selectedTab].style.maxWidth = newDim : tabElement.current[selectedTab].style.maxHeight = newDim;
181
+ }
92
182
  }
93
183
 
94
- _createClass(Tabs, [{
95
- key: "onTabResize",
96
- value: function onTabResize(size, target) {
97
- var align = this.props.align;
98
- var tabDimensions = this.state.tabDimensions;
99
- var newDim = Object.assign({}, tabDimensions);
100
- var elemDim = (0, _Common.getTotalDimension)(target, align);
101
-
102
- if (elemDim !== 0) {
103
- newDim[target.dataset.key] = elemDim;
104
- }
184
+ function getHighlightDim() {
185
+ return align === 'vertical' ? highlight.current.offsetLeft : highlight.current.offsetTop;
186
+ }
105
187
 
106
- this.setState({
107
- tabDimensions: newDim
108
- });
109
- }
110
- }, {
111
- key: "componentDidMount",
112
- value: function componentDidMount() {
113
- var _this2 = this;
114
-
115
- var _this$props = this.props,
116
- children = _this$props.children,
117
- childType = _this$props.childType;
118
- var totalDimension = this.getTotalDimension();
119
- var tabDimensions = this.getTabDimensions();
120
- var tabKeys = [];
121
- var restrictedKeys = ['state', 'props', 'refs', 'context'];
188
+ (0, _useEffectCallOnlyAfterState["default"])(function () {
189
+ if (children) {
190
+ /**
191
+ * To recalculate the dimensions of tabs we are checking the children length.
192
+ * and also checking the tab id and their order.
193
+ */
194
+ var newTabKeys = [];
122
195
 
123
196
  _react["default"].Children.toArray(children).forEach(function (child) {
124
197
  if (child && child.props.id && child.type === childType) {
125
- if (restrictedKeys.includes(child.props.id)) {
126
- throw new Error('Restricted id name found in Tabs, Please avoid these names => ' + restrictedKeys.toString());
127
- } else {
128
- tabKeys.push(child.props.id);
129
- }
198
+ newTabKeys.push(child.props.id);
130
199
  }
131
200
  });
132
201
 
133
- this.setState({
134
- totalDimension: totalDimension,
135
- tabDimensions: tabDimensions,
136
- renderVirtualTabs: false,
137
- tabKeys: tabKeys
138
- });
139
- this.highlight && this.setState({
140
- highlightInitialDimension: this.getHighlightDim()
141
- }, function () {
142
- _this2.moveHighlight();
202
+ var isSameTabKeys = newTabKeys.every(function (current, index) {
203
+ return tabKeys[index] === current;
143
204
  });
144
- }
145
- }, {
146
- key: "componentWillUnmount",
147
- value: function componentWillUnmount() {
148
- var _this3 = this;
149
-
150
- if (this.tabsObserver) {
151
- this.tabsObserver.disconnect();
152
- this.tabsObserver = null;
153
- }
154
205
 
155
- if (this.tabObserver) {
156
- Object.keys(this.tabObserver).forEach(function (observer) {
157
- _this3.tabObserver[observer] && _this3.tabObserver[observer].disconnect();
206
+ if (newTabKeys.length !== tabKeys.length || !isSameTabKeys) {
207
+ setRenderVirtualTabs(true);
208
+ setTabKeys(newTabKeys);
209
+ setTimeout(function () {
210
+ setTabDimensions(getTabDimensions());
211
+ setTotalDimension(getTotalDimensionLocal());
212
+ setRenderVirtualTabs(false);
158
213
  });
159
- this.tabObserver = null;
160
214
  }
161
- }
162
- }, {
163
- key: "setMaxDim",
164
- value: function setMaxDim() {
165
- var totalDimension = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
166
- var selectedTab = this.props.selectedTab; // let actual = Object.keys(tabDimensions).reduce(
167
- // (sum, tab) => sum + (tabDimensions[tab] || 0),
168
- // 0
169
- // );
170
-
171
- if (totalDimension && this[selectedTab]) {
172
- var align = this.props.align;
173
- var newDim = "".concat((0, _Common.remConvert)(totalDimension), "rem");
174
- align === 'vertical' ? this[selectedTab].style.maxWidth = newDim : this[selectedTab].style.maxHeight = newDim;
215
+
216
+ if (newTabKeys.length === 1) {
217
+ moveHighlight();
175
218
  }
176
219
  }
177
- }, {
178
- key: "getHighlightDim",
179
- value: function getHighlightDim() {
180
- var align = this.props.align;
181
- return align === 'vertical' ? this.highlight.offsetLeft : this.highlight.offsetTop;
182
- }
183
- }, {
184
- key: "componentDidUpdate",
185
- value: function componentDidUpdate(prevProps) {
186
- var _this4 = this;
187
-
188
- var _this$props2 = this.props,
189
- children = _this$props2.children,
190
- selectedTab = _this$props2.selectedTab,
191
- childType = _this$props2.childType;
192
- var _this$state = this.state,
193
- tabDimensions = _this$state.tabDimensions,
194
- totalDimension = _this$state.totalDimension,
195
- tabKeys = _this$state.tabKeys;
196
-
197
- if (prevProps.children && children) {
198
- /**
199
- * To recalculate the dimensions of tabs we are checking the children length.
200
- * and also checking the tab id and their order.
201
- */
202
- var newTabKeys = [];
203
-
204
- _react["default"].Children.toArray(children).forEach(function (child) {
205
- if (child && child.props.id && child.type === childType) {
206
- newTabKeys.push(child.props.id);
207
- }
208
- });
209
-
210
- var isSameTabKeys = newTabKeys.every(function (current, index) {
211
- return tabKeys[index] === current;
212
- });
220
+ });
221
+ (0, _useEffectCallOnlyAfterState["default"])(function () {
222
+ tabsObserver.current && tabsObserver.current.replaceResizeHandler(onResize);
213
223
 
214
- if (newTabKeys.length !== tabKeys.length || !isSameTabKeys) {
215
- this.setState({
216
- renderVirtualTabs: true,
217
- tabKeys: newTabKeys
218
- }, function () {
219
- totalDimension = _this4.getTotalDimension();
220
- tabDimensions = _this4.getTabDimensions();
221
-
222
- _this4.setState({
223
- tabDimensions: tabDimensions,
224
- totalDimension: totalDimension,
225
- renderVirtualTabs: false
226
- });
227
- });
228
- }
229
-
230
- if (prevProps.selectedTab !== selectedTab || newTabKeys.length === 1) {
231
- this.moveHighlight();
232
- }
233
- }
224
+ if (children) {
225
+ moveHighlight();
234
226
  }
235
- }, {
236
- key: "moveHighlight",
237
- value: function moveHighlight() {
238
- var _this$props3 = this.props,
239
- isAnimate = _this$props3.isAnimate,
240
- needTabBorder = _this$props3.needTabBorder,
241
- selectedTab = _this$props3.selectedTab,
242
- align = _this$props3.align;
243
- var highlightInitialDimension = this.state.highlightInitialDimension;
244
- var node = this.highlight;
245
-
246
- if (isAnimate && needTabBorder && node) {
247
- var tabActive = this[selectedTab];
248
-
249
- if (tabActive) {
250
- var position, dimension;
251
-
252
- if (align === 'vertical') {
253
- position = tabActive.offsetLeft;
254
- dimension = tabActive.offsetWidth;
255
- node.style.transform = "translateX(".concat((0, _Common.remConvert)(position - highlightInitialDimension), "rem)");
256
- node.style.width = "".concat((0, _Common.remConvert)(dimension), "rem");
257
- } else if (align === 'horizontal') {
258
- position = tabActive.offsetTop;
259
- dimension = tabActive.offsetHeight;
260
- node.style.transform = "translateY(".concat((0, _Common.remConvert)(position - highlightInitialDimension), "rem)");
261
- node.style.height = "".concat((0, _Common.remConvert)(dimension), "rem");
262
- }
227
+ }, [selectedTab]);
228
+
229
+ function moveHighlight() {
230
+ var node = highlight.current;
231
+
232
+ if (isAnimate && needTabBorder && node) {
233
+ var tabActive = tabElement.current[selectedTab];
234
+
235
+ if (tabActive) {
236
+ var position, dimension;
237
+
238
+ if (align === 'vertical') {
239
+ position = tabActive.offsetLeft;
240
+ dimension = tabActive.offsetWidth;
241
+ node.style.transform = "translateX(".concat((0, _Common.remConvert)(position - highlightInitialDimension.current), "rem)");
242
+ node.style.width = "".concat((0, _Common.remConvert)(dimension), "rem");
243
+ } else if (align === 'horizontal') {
244
+ position = tabActive.offsetTop;
245
+ dimension = tabActive.offsetHeight;
246
+ node.style.transform = "translateY(".concat((0, _Common.remConvert)(position - highlightInitialDimension.current), "rem)");
247
+ node.style.height = "".concat((0, _Common.remConvert)(dimension), "rem");
263
248
  }
264
249
  }
265
250
  }
266
- }, {
267
- key: "getHighlightRef",
268
- value: function getHighlightRef(ele) {
269
- this.highlight = ele;
251
+ }
252
+
253
+ var getHighlightRef = (0, _react.useCallback)(function (ele) {
254
+ highlight.current = ele;
255
+ }, []);
256
+ var getTabsRef = (0, _react.useCallback)(function (ele) {
257
+ tabsEle.current = ele;
258
+
259
+ if (ele) {
260
+ tabsObserver.current.observe(ele);
261
+ } else {
262
+ tabsObserver.current && tabsObserver.current.disconnect();
270
263
  }
271
- }, {
272
- key: "getTabsRef",
273
- value: function getTabsRef(ele) {
274
- this.tabsEle = ele;
264
+ }, []);
275
265
 
276
- if (ele) {
277
- this.tabsObserver.observe(ele);
266
+ function onSizeChange() {
267
+ var totalDimension = getTotalDimensionLocal();
268
+ setTotalDimension(totalDimension);
269
+
270
+ if (highlight.current) {
271
+ highlightInitialDimension.current = getHighlightDim();
272
+ moveHighlight();
273
+ }
274
+ }
275
+
276
+ function onResize(timer) {
277
+ if (tabsEle.current && isResponsive) {
278
+ if (!timer) {
279
+ onSizeChange();
278
280
  } else {
279
- this.tabsObserver && this.tabsObserver.disconnect();
281
+ setTimeout(function () {
282
+ onSizeChange();
283
+ }, timer);
280
284
  }
281
285
  }
282
- }, {
283
- key: "onSizeChange",
284
- value: function onSizeChange() {
285
- var _this5 = this;
286
-
287
- var totalDimension = this.getTotalDimension();
288
- this.setState({
289
- totalDimension: totalDimension
290
- });
291
- this.highlight && this.setState({
292
- highlightInitialDimension: this.getHighlightDim()
293
- }, function () {
294
- _this5.moveHighlight();
295
- });
296
- }
297
- }, {
298
- key: "onResize",
299
- value: function onResize(timer) {
300
- var _this6 = this;
286
+ }
301
287
 
302
- var isResponsive = this.props.isResponsive;
288
+ function getTotalDimensionLocal() {
289
+ var totalDimension = tabsEle.current && (0, _Common.getTotalDimension)(tabsEle.current, align);
290
+ return totalDimension;
291
+ }
303
292
 
304
- if (this.tabsEle && isResponsive) {
305
- if (!timer) {
306
- this.onSizeChange();
307
- } else {
308
- setTimeout(function () {
309
- _this6.onSizeChange();
310
- }, timer);
311
- }
312
- }
313
- }
314
- }, {
315
- key: "getTotalDimension",
316
- value: function getTotalDimension() {
317
- var align = this.props.align;
318
- var totalDimension = this.tabsEle && (0, _Common.getTotalDimension)(this.tabsEle, align);
319
- return totalDimension;
320
- }
321
- }, {
322
- key: "getTabDimensions",
323
- value: function getTabDimensions() {
324
- var _this7 = this;
293
+ function getTabDimensions() {
294
+ var tabDimensions = {};
325
295
 
326
- var _this$props4 = this.props,
327
- children = _this$props4.children,
328
- align = _this$props4.align,
329
- childType = _this$props4.childType;
330
- var tabDimensions = {};
296
+ _react["default"].Children.forEach(children, function (child) {
297
+ return /*#__PURE__*/_react["default"].isValidElement(child) && child.type === childType && tabElement.current[child.props.id] && Object.assign(tabDimensions, _defineProperty({}, child.props.id, tabElement.current[child.props.id] && (0, _Common.getTotalDimension)(tabElement.current[child.props.id], align)));
298
+ });
331
299
 
332
- _react["default"].Children.forEach(children, function (child) {
333
- return /*#__PURE__*/_react["default"].isValidElement(child) && child.type === childType && _this7[child.props.id] && Object.assign(tabDimensions, _defineProperty({}, child.props.id, _this7[child.props.id] && (0, _Common.getTotalDimension)(_this7[child.props.id], align)));
334
- });
300
+ return tabDimensions;
301
+ }
335
302
 
336
- return tabDimensions;
337
- }
338
- }, {
339
- key: "responsiveTab",
340
- value: function responsiveTab(totalDimension, tabDimensions) {
341
- var _this$props5 = this.props,
342
- children = _this$props5.children,
343
- maxTabsCount = _this$props5.maxTabsCount,
344
- minTabsCount = _this$props5.minTabsCount,
345
- isResponsive = _this$props5.isResponsive;
346
- var mainTabs = [],
347
- moreTabs = [],
348
- otherTabs = [];
349
-
350
- if (totalDimension && isResponsive) {
351
- var _this$props6 = this.props,
352
- childType = _this$props6.childType,
353
- selectedTab = _this$props6.selectedTab;
354
- var selectedTabDimension = tabDimensions[selectedTab] || 0;
355
- var remainingDimension = totalDimension - selectedTabDimension;
356
- var maxTabsTobeVisible = maxTabsCount - 1;
357
- var minTabsToBeVisible = 1;
358
-
359
- _react["default"].Children.forEach(children, function (child) {
360
- if (child && child.type === childType && child.props.id) {
361
- var elemDimension = tabDimensions[child.props.id];
362
- var isMaxCountExceeded = maxTabsTobeVisible <= 0 ? true : false;
363
- var isMinCountNotExceeded = minTabsToBeVisible < minTabsCount ? true : false;
364
-
365
- if (child.props.id === selectedTab) {
366
- mainTabs.push(child);
367
- } else if (isMinCountNotExceeded) {
368
- mainTabs.push(child);
369
- remainingDimension -= tabDimensions[child.props.id];
370
- minTabsToBeVisible++;
371
- maxTabsTobeVisible--;
372
- } else if (remainingDimension - elemDimension >= 20 && !moreTabs.length && !isMaxCountExceeded) {
373
- mainTabs.push(child);
374
- remainingDimension -= tabDimensions[child.props.id];
375
- maxTabsTobeVisible--;
376
- } else {
377
- moreTabs.push(child);
378
- }
379
- } else if ( /*#__PURE__*/_react["default"].isValidElement(child)) {
380
- otherTabs.push(child);
381
- }
382
- });
303
+ function responsiveTab(totalDimension, tabDimensions) {
304
+ var mainTabs = [],
305
+ moreTabs = [],
306
+ otherTabs = [];
383
307
 
384
- if (selectedTabDimension > totalDimension) {
385
- /* let { align } = this.props;
386
- let newDim = `${remConvert(totalDimension)}rem`;
387
- let newTabs;
388
- if (align === 'vertical') {
389
- newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxWidth: newDim } }));
390
- } else {
391
- newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxHeight: newDim } }));
392
- }
393
- mainTabs = newTabs; */
394
- this.setMaxDim(totalDimension);
395
- }
396
- } else if (!isResponsive) {
397
- var _childType = this.props.childType;
308
+ if (totalDimension && isResponsive) {
309
+ var selectedTabDimension = tabDimensions[selectedTab] || 0;
310
+ var remainingDimension = totalDimension - selectedTabDimension;
311
+ var maxTabsTobeVisible = maxTabsCount - 1;
312
+ var minTabsToBeVisible = 1;
398
313
 
399
- _react["default"].Children.forEach(children, function (child) {
400
- if (child && child.type === _childType && child.props.id) {
314
+ _react["default"].Children.forEach(children, function (child) {
315
+ if (child && child.type === childType && child.props.id) {
316
+ var elemDimension = tabDimensions[child.props.id];
317
+ var isMaxCountExceeded = maxTabsTobeVisible <= 0 ? true : false;
318
+ var isMinCountNotExceeded = minTabsToBeVisible < minTabsCount ? true : false;
319
+
320
+ if (child.props.id === selectedTab) {
321
+ mainTabs.push(child);
322
+ } else if (isMinCountNotExceeded) {
323
+ mainTabs.push(child);
324
+ remainingDimension -= tabDimensions[child.props.id];
325
+ minTabsToBeVisible++;
326
+ maxTabsTobeVisible--;
327
+ } else if (remainingDimension - elemDimension >= 20 && !moreTabs.length && !isMaxCountExceeded) {
401
328
  mainTabs.push(child);
329
+ remainingDimension -= tabDimensions[child.props.id];
330
+ maxTabsTobeVisible--;
402
331
  } else {
403
- otherTabs.push(child);
332
+ moreTabs.push(child);
404
333
  }
405
- });
406
- } else {
407
- moreTabs = children;
408
- }
334
+ } else if ( /*#__PURE__*/_react["default"].isValidElement(child)) {
335
+ otherTabs.push(child);
336
+ }
337
+ });
409
338
 
410
- return {
411
- mainTabs: mainTabs,
412
- moreTabs: moreTabs,
413
- otherTabs: otherTabs
414
- };
415
- }
416
- }, {
417
- key: "getTabRef",
418
- value: function getTabRef(refName, ele, isVirtual) {
419
- this[refName] = ele;
420
- var key = isVirtual ? "virtual_".concat(refName) : refName;
421
-
422
- if (ele) {
423
- this.tabObserver[key] = new _ResizeObserver["default"](this.onTabResize);
424
- this.tabObserver[key].observe(ele);
425
- } else {
426
- if (this.tabObserver && this.tabObserver[key]) {
427
- this.tabObserver[key].disconnect();
339
+ if (selectedTabDimension > totalDimension) {
340
+ /* let { align } = this.props;
341
+ let newDim = `${remConvert(totalDimension)}rem`;
342
+ let newTabs;
343
+ if (align === 'vertical') {
344
+ newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxWidth: newDim } }));
345
+ } else {
346
+ newTabs = mainTabs.map(tab => React.cloneElement(tab, { style: { maxHeight: newDim } }));
428
347
  }
348
+ mainTabs = newTabs; */
349
+ setMaxDim(totalDimension);
429
350
  }
351
+ } else if (!isResponsive) {
352
+ _react["default"].Children.forEach(children, function (child) {
353
+ if (child && child.type === childType && child.props.id) {
354
+ mainTabs.push(child);
355
+ } else {
356
+ otherTabs.push(child);
357
+ }
358
+ });
359
+ } else {
360
+ moreTabs = children;
430
361
  }
431
- }, {
432
- key: "moreTabSelect",
433
- value: function moreTabSelect(tab, value, index, e) {
434
- var onSelect = this.props.onSelect;
435
-
436
- if (e && e.target && e.target.parentElement.tagName === 'A' && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)) {
437
- (0, _Common.cancelBubblingEffect)(e);
438
- return;
439
- }
440
362
 
441
- e.preventDefault();
442
- onSelect(tab);
443
- }
444
- }, {
445
- key: "onScroll",
446
- value: function onScroll(e) {
447
- e.persist();
448
- var onScroll = this.props.onScroll;
449
- onScroll && (0, _Common.throttle)(onScroll, 100, e);
450
- }
451
- }, {
452
- key: "togglePopup",
453
- value: function togglePopup(e) {
454
- var _this$props7 = this.props,
455
- boxPosition = _this$props7.boxPosition,
456
- togglePopup = _this$props7.togglePopup,
457
- align = _this$props7.align,
458
- removeClose = _this$props7.removeClose;
459
- removeClose && removeClose(e);
460
- var popupPosition = align === 'vertical' ? 'bottomLeft' : 'rightTop';
461
- boxPosition = boxPosition ? boxPosition : popupPosition;
462
- togglePopup(e, boxPosition);
363
+ return {
364
+ mainTabs: mainTabs,
365
+ moreTabs: moreTabs,
366
+ otherTabs: otherTabs
367
+ };
368
+ }
369
+
370
+ function getTabRef(refName, ele, isVirtual) {
371
+ if (ele) {
372
+ tabElement.current[refName] = ele;
373
+ } // tabElement.current[refName] = ele
374
+
375
+
376
+ var key = isVirtual ? "virtual_".concat(refName) : refName;
377
+
378
+ if (ele) {
379
+ tabObserver.current[key] = new _ResizeObserver["default"](onTabResize);
380
+ tabObserver.current[key].observe(ele);
381
+ } else {
382
+ if (tabObserver.current && tabObserver.current[key]) {
383
+ tabObserver.current[key].disconnect();
384
+ }
463
385
  }
464
- }, {
465
- key: "responsiveFunc",
466
- value: function responsiveFunc(_ref) {
467
- var mediaQueryOR = _ref.mediaQueryOR;
468
- return {
469
- tabletMode: mediaQueryOR([{
470
- maxWidth: 700
471
- }])
472
- };
386
+ }
387
+
388
+ function moreTabSelect(tab, value, index, e) {
389
+ if (e && e.target && e.target.parentElement.tagName === 'A' && (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)) {
390
+ (0, _Common.cancelBubblingEffect)(e);
391
+ return;
473
392
  }
474
- }, {
475
- key: "renderTabs",
476
- value: function renderTabs(mainTabs, moreTabs, isVirtual) {
477
- var _this8 = this;
478
-
479
- var _this$props8 = this.props,
480
- selectedTab = _this$props8.selectedTab,
481
- moreButtonClass = _this$props8.moreButtonClass,
482
- moreButtonActiveClass = _this$props8.moreButtonActiveClass,
483
- moreBoxClass = _this$props8.moreBoxClass,
484
- menuItemClass = _this$props8.menuItemClass,
485
- itemClass = _this$props8.itemClass,
486
- itemActiveClass = _this$props8.itemActiveClass,
487
- iconName = _this$props8.iconName,
488
- isPopupReady = _this$props8.isPopupReady,
489
- isPopupOpen = _this$props8.isPopupOpen,
490
- getContainerRef = _this$props8.getContainerRef,
491
- showTitleInMoreOptions = _this$props8.showTitleInMoreOptions,
492
- onSelect = _this$props8.onSelect,
493
- moreContainerClass = _this$props8.moreContainerClass,
494
- align = _this$props8.align,
495
- type = _this$props8.type,
496
- isAnimate = _this$props8.isAnimate,
497
- needTabBorder = _this$props8.needTabBorder,
498
- needAppearance = _this$props8.needAppearance,
499
- iconSize = _this$props8.iconSize,
500
- getTargetRef = _this$props8.getTargetRef,
501
- position = _this$props8.position,
502
- customProps = _this$props8.customProps,
503
- getCustomDropBoxHeaderPlaceHolder = _this$props8.getCustomDropBoxHeaderPlaceHolder,
504
- dataSelectorId = _this$props8.dataSelectorId;
505
- var _customProps$DropBoxP = customProps.DropBoxProps,
506
- DropBoxProps = _customProps$DropBoxP === void 0 ? {} : _customProps$DropBoxP,
507
- _customProps$ListItem = customProps.ListItemProps,
508
- ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
509
- _customProps$MoreButt = customProps.MoreButtonProps,
510
- MoreButtonProps = _customProps$MoreButt === void 0 ? {} : _customProps$MoreButt;
511
- var popupClass = align === 'vertical' ? _TabsModule["default"][position] ? _TabsModule["default"][position] : '' : '';
512
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _react["default"].Children.map(mainTabs, function (child) {
513
- if (!child) {
514
- return null;
515
- }
516
393
 
517
- var MainTab = child.type;
518
- var classProps = {};
394
+ e.preventDefault();
395
+ onSelect(tab);
396
+ }
519
397
 
520
- if (itemActiveClass) {
521
- classProps.activeClass = itemActiveClass;
522
- }
398
+ function onScrollLocal(e) {
399
+ e.persist();
400
+ onScroll && (0, _Common.throttle)(onScroll, 100, e);
401
+ }
402
+
403
+ function togglePopupLocal(e) {
404
+ removeClose && removeClose(e);
405
+ var popupPosition = align === 'vertical' ? 'bottomLeft' : 'rightTop';
406
+ boxPosition = boxPosition ? boxPosition : popupPosition;
407
+ togglePopup(e, boxPosition);
408
+ }
409
+
410
+ function responsiveFunc(_ref) {
411
+ var mediaQueryOR = _ref.mediaQueryOR;
412
+ return {
413
+ tabletMode: mediaQueryOR([{
414
+ maxWidth: 700
415
+ }])
416
+ };
417
+ }
418
+
419
+ function renderTabs(mainTabs, moreTabs, isVirtual) {
420
+ var moreButtonClass = props.moreButtonClass,
421
+ moreButtonActiveClass = props.moreButtonActiveClass,
422
+ moreBoxClass = props.moreBoxClass,
423
+ menuItemClass = props.menuItemClass,
424
+ itemClass = props.itemClass,
425
+ itemActiveClass = props.itemActiveClass,
426
+ iconName = props.iconName,
427
+ isPopupReady = props.isPopupReady,
428
+ isPopupOpen = props.isPopupOpen,
429
+ getContainerRef = props.getContainerRef,
430
+ showTitleInMoreOptions = props.showTitleInMoreOptions,
431
+ moreContainerClass = props.moreContainerClass,
432
+ align = props.align,
433
+ type = props.type,
434
+ isAnimate = props.isAnimate,
435
+ needTabBorder = props.needTabBorder,
436
+ needAppearance = props.needAppearance,
437
+ iconSize = props.iconSize,
438
+ getTargetRef = props.getTargetRef,
439
+ position = props.position,
440
+ customProps = props.customProps,
441
+ getCustomDropBoxHeaderPlaceHolder = props.getCustomDropBoxHeaderPlaceHolder;
442
+ var _customProps$DropBoxP = customProps.DropBoxProps,
443
+ DropBoxProps = _customProps$DropBoxP === void 0 ? {} : _customProps$DropBoxP,
444
+ _customProps$ListItem = customProps.ListItemProps,
445
+ ListItemProps = _customProps$ListItem === void 0 ? {} : _customProps$ListItem,
446
+ _customProps$MoreButt = customProps.MoreButtonProps,
447
+ MoreButtonProps = _customProps$MoreButt === void 0 ? {} : _customProps$MoreButt;
448
+ var popupClass = align === 'vertical' ? _v1TabsModule["default"][position] ? _v1TabsModule["default"][position] : '' : '';
449
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _react["default"].Children.map(mainTabs, function (child) {
450
+ if (!child) {
451
+ return null;
452
+ }
453
+
454
+ var MainTab = child.type;
455
+ var classProps = {};
456
+
457
+ if (itemActiveClass) {
458
+ classProps.activeClass = itemActiveClass;
459
+ }
460
+
461
+ if (itemClass) {
462
+ classProps.className = itemClass;
463
+ }
523
464
 
524
- if (itemClass) {
525
- classProps.className = itemClass;
465
+ return /*#__PURE__*/_react["default"].isValidElement(child) && /*#__PURE__*/_react["default"].createElement(MainTab, _extends({}, child.props, {
466
+ key: child.props.id,
467
+ getTabRef: getTabRef,
468
+ onSelect: onSelect // recalculateDimension={tabElement.current[recalculateDimension]}
469
+ ,
470
+ isActive: child.props.id === selectedTab,
471
+ type: type,
472
+ isAnimate: isAnimate,
473
+ needBorder: needTabBorder,
474
+ needAppearance: needAppearance,
475
+ align: align,
476
+ isVirtual: isVirtual
477
+ }, classProps));
478
+ }), _react["default"].Children.count(moreTabs) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
479
+ className: "".concat(_v1TabsModule["default"].menu, " "),
480
+ dataSelectorId: "".concat(dataSelectorId, "_moreIcon")
481
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
482
+ className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(moreButtonClass, " ").concat(isPopupOpen ? moreButtonActiveClass : ''),
483
+ align: "both",
484
+ onClick: togglePopupLocal,
485
+ dataId: "moreTabs",
486
+ eleRef: getTargetRef
487
+ }, MoreButtonProps, {
488
+ "aria-label": "MoreTabs",
489
+ role: "link",
490
+ tagName: "button"
491
+ }), /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
492
+ name: iconName,
493
+ size: iconSize
494
+ })), isPopupOpen && /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
495
+ query: responsiveFunc,
496
+ responsiveId: "Helmet"
497
+ }, function (_ref2) {
498
+ var tabletMode = _ref2.tabletMode;
499
+ return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], _extends({
500
+ isActive: isPopupReady,
501
+ isAnimate: true,
502
+ size: "medium",
503
+ customClass: {
504
+ customDropBoxWrap: "".concat(moreContainerClass, " ").concat(popupClass)
505
+ },
506
+ boxPosition: position,
507
+ getRef: getContainerRef,
508
+ isBoxPaddingNeed: true,
509
+ isArrow: false
510
+ }, DropBoxProps, {
511
+ isResponsivePadding: true,
512
+ needFocusScope: true,
513
+ onClose: togglePopupLocal
514
+ }), getCustomDropBoxHeaderPlaceHolder && getCustomDropBoxHeaderPlaceHolder(props), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
515
+ flexible: true,
516
+ shrink: true,
517
+ scroll: "vertical",
518
+ className: "".concat(tabletMode ? '' : _v1TabsModule["default"].menuBox, " ").concat(moreBoxClass),
519
+ onScroll: onScrollLocal
520
+ }, _react["default"].Children.map(moreTabs, function (child) {
521
+ if (!child) {
522
+ return null;
526
523
  }
527
524
 
528
- return /*#__PURE__*/_react["default"].isValidElement(child) && /*#__PURE__*/_react["default"].createElement(MainTab, _extends({}, child.props, {
529
- key: child.props.id,
530
- getTabRef: _this8.getTabRef,
531
- onSelect: onSelect,
532
- recalculateDimension: _this8.recalculateDimension,
533
- isActive: child.props.id === selectedTab,
534
- type: type,
535
- isAnimate: isAnimate,
536
- needBorder: needTabBorder,
537
- needAppearance: needAppearance,
538
- align: align,
539
- isVirtual: isVirtual
540
- }, classProps));
541
- }), _react["default"].Children.count(moreTabs) ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
542
- className: "".concat(_TabsModule["default"].menu, " "),
543
- dataSelectorId: "".concat(dataSelectorId, "_moreIcon")
544
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
545
- className: "".concat(_semanticButtonModule["default"].buttonReset, " ").concat(moreButtonClass, " ").concat(isPopupOpen ? moreButtonActiveClass : ''),
546
- align: "both",
547
- onClick: this.togglePopup,
548
- dataId: "moreTabs",
549
- eleRef: getTargetRef
550
- }, MoreButtonProps, {
551
- "aria-label": "MoreTabs",
552
- role: "link",
553
- tagName: "button"
554
- }), /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
555
- name: iconName,
556
- size: iconSize
557
- })), isPopupOpen && /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
558
- query: this.responsiveFunc,
559
- responsiveId: "Helmet"
560
- }, function (_ref2) {
561
- var tabletMode = _ref2.tabletMode;
562
- return /*#__PURE__*/_react["default"].createElement(_ResponsiveDropBox["default"], _extends({
563
- isActive: isPopupReady,
564
- isAnimate: true,
565
- size: "medium",
525
+ var _child$props = child.props,
526
+ text = _child$props.text,
527
+ id = _child$props.id,
528
+ title = _child$props.title,
529
+ isLink = _child$props.isLink,
530
+ href = _child$props.href,
531
+ children = _child$props.children,
532
+ dataId = _child$props.dataId;
533
+ var value = text ? text : showTitleInMoreOptions ? title : null;
534
+ return /*#__PURE__*/_react["default"].isValidElement(child) && /*#__PURE__*/_react["default"].createElement(_ListItem["default"], _extends({
535
+ key: id,
536
+ value: value,
537
+ onClick: moreTabSelect,
538
+ id: id,
539
+ title: title || text,
540
+ isLink: isLink,
541
+ href: href,
542
+ autoHover: true,
566
543
  customClass: {
567
- customDropBoxWrap: "".concat(moreContainerClass, " ").concat(popupClass)
544
+ customListItem: menuItemClass
568
545
  },
569
- boxPosition: position,
570
- getRef: getContainerRef,
571
- isBoxPaddingNeed: true,
572
- isArrow: false
573
- }, DropBoxProps, {
574
- isResponsivePadding: true,
575
- needFocusScope: true,
576
- onClose: _this8.togglePopup
577
- }), getCustomDropBoxHeaderPlaceHolder && getCustomDropBoxHeaderPlaceHolder(_this8.props), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
578
- flexible: true,
579
- shrink: true,
580
- scroll: "vertical",
581
- className: "".concat(tabletMode ? '' : _TabsModule["default"].menuBox, " ").concat(moreBoxClass),
582
- onScroll: _this8.onScroll
583
- }, _react["default"].Children.map(moreTabs, function (child) {
584
- if (!child) {
585
- return null;
586
- }
587
-
588
- var _child$props = child.props,
589
- text = _child$props.text,
590
- id = _child$props.id,
591
- title = _child$props.title,
592
- isLink = _child$props.isLink,
593
- href = _child$props.href,
594
- children = _child$props.children,
595
- dataId = _child$props.dataId;
596
- var value = text ? text : showTitleInMoreOptions ? title : null;
597
- return /*#__PURE__*/_react["default"].isValidElement(child) && /*#__PURE__*/_react["default"].createElement(_ListItem["default"], _extends({
598
- key: id,
599
- value: value,
600
- onClick: _this8.moreTabSelect,
601
- id: id,
602
- title: title || text,
603
- isLink: isLink,
604
- href: href,
605
- autoHover: true,
606
- customClass: {
607
- customListItem: menuItemClass
608
- },
609
- target: "self",
610
- dataId: "".concat(dataId, "_Tab")
611
- }, ListItemProps), !showTitleInMoreOptions ? children : null);
612
- })));
613
- })) : null);
614
- }
615
- }, {
616
- key: "render",
617
- value: function render() {
618
- var _this$props9 = this.props,
619
- style = _this$props9.style,
620
- className = _this$props9.className,
621
- dataId = _this$props9.dataId,
622
- highlightClass = _this$props9.highlightClass,
623
- type = _this$props9.type,
624
- isAnimate = _this$props9.isAnimate,
625
- needTabBorder = _this$props9.needTabBorder,
626
- needBorder = _this$props9.needBorder,
627
- needPadding = _this$props9.needPadding,
628
- align = _this$props9.align,
629
- needAppearance = _this$props9.needAppearance,
630
- children = _this$props9.children,
631
- containerClass = _this$props9.containerClass,
632
- dataSelectorId = _this$props9.dataSelectorId;
633
- var _this$state2 = this.state,
634
- totalDimension = _this$state2.totalDimension,
635
- tabDimensions = _this$state2.tabDimensions,
636
- renderVirtualTabs = _this$state2.renderVirtualTabs;
637
-
638
- var _this$responsiveTab = this.responsiveTab(totalDimension, tabDimensions),
639
- mainTabs = _this$responsiveTab.mainTabs,
640
- moreTabs = _this$responsiveTab.moreTabs,
641
- otherTabs = _this$responsiveTab.otherTabs;
642
-
643
- var appearanceClass = (0, _Common.cs)([_TabsModule["default"][type], needBorder && _TabsModule["default"]["".concat(type, "_border")], needPadding && _TabsModule["default"]["".concat(type, "_padding")]]);
644
- var tabsClass = (0, _Common.cs)([_TabsModule["default"].tab, className, needAppearance && appearanceClass]);
645
- var hlClass = (0, _Common.cs)([_TabsModule["default"].highlight, highlightClass, isAnimate && _TabsModule["default"].lineAnimate]);
646
- return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
647
- className: containerClass,
648
- dataSelectorId: dataSelectorId
649
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
650
- alignBox: align === 'vertical' ? 'row' : 'column',
651
- className: tabsClass,
652
- style: style
653
- }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
654
- eleRef: this.getTabsRef,
655
- flexible: true
656
- }, renderVirtualTabs && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
657
- alignBox: align === 'vertical' ? 'row' : 'column',
658
- className: _TabsModule["default"].hidden
659
- }, this.renderTabs(children, [], true)), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
660
- alignBox: align === 'vertical' ? 'row' : 'column'
661
- }, this.renderTabs(mainTabs, moreTabs, false))), otherTabs.length ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, null, otherTabs) : null, isAnimate && needTabBorder && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
662
- className: hlClass,
663
- ref: this.getHighlightRef,
664
- "data-id": dataId,
665
- "data-test-id": dataId
546
+ target: "self",
547
+ dataId: "".concat(dataId, "_Tab")
548
+ }, ListItemProps), !showTitleInMoreOptions ? children : null);
666
549
  })));
667
- }
668
- }]);
550
+ })) : null);
551
+ }
669
552
 
670
- return Tabs;
671
- }(_react["default"].Component);
553
+ var _responsiveTab = responsiveTab(totalDimension, tabDimensions),
554
+ mainTabs = _responsiveTab.mainTabs,
555
+ moreTabs = _responsiveTab.moreTabs,
556
+ otherTabs = _responsiveTab.otherTabs;
557
+
558
+ var appearanceClass = (0, _Common.cs)([_v1TabsModule["default"][type], needBorder && _v1TabsModule["default"]["".concat(type, "_border")], needPadding && _v1TabsModule["default"]["".concat(type, "_padding")]]);
559
+ var tabsClass = (0, _Common.cs)([_v1TabsModule["default"].tab, className, needAppearance && appearanceClass]);
560
+ var hlClass = (0, _Common.cs)([_v1TabsModule["default"].highlight, highlightClass, isAnimate && _v1TabsModule["default"].lineAnimate]);
561
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
562
+ className: containerClass,
563
+ dataSelectorId: dataSelectorId
564
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
565
+ alignBox: align === 'vertical' ? 'row' : 'column',
566
+ className: tabsClass,
567
+ style: style
568
+ }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
569
+ eleRef: getTabsRef,
570
+ flexible: true
571
+ }, renderVirtualTabs && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
572
+ alignBox: align === 'vertical' ? 'row' : 'column',
573
+ className: _v1TabsModule["default"].hidden
574
+ }, renderTabs(children, [], true)), /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
575
+ alignBox: align === 'vertical' ? 'row' : 'column'
576
+ }, renderTabs(mainTabs, moreTabs, false))), otherTabs.length ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, null, otherTabs) : null, isAnimate && needTabBorder && needAppearance && /*#__PURE__*/_react["default"].createElement("div", {
577
+ className: hlClass,
578
+ ref: getHighlightRef,
579
+ "data-id": dataId,
580
+ "data-test-id": dataId
581
+ })));
582
+ };
672
583
 
673
584
  Tabs.propTypes = _propTypes.Tabs_propTypes;
674
585
  Tabs.defaultProps = _objectSpread(_objectSpread({}, _defaultProps.Tabs_defaultProps), {}, {