@zohodesk/components 1.0.0-temp-179 → 1.0.0-temp-181

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 (310) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropUnificationExcludeFilesArray.js +231 -0
  3. package/.cli/PropValidationExcludeFilesArray.js +1 -1
  4. package/.cli/propValidation_report.html +24 -2
  5. package/PropValidationExcludeFilesArray.js +1 -0
  6. package/README.md +1363 -1357
  7. package/css_error.log +1 -1
  8. package/es/AppContainer/AppContainer.module.css +18 -18
  9. package/es/Avatar/Avatar.js +9 -9
  10. package/es/Avatar/Avatar.module.css +187 -187
  11. package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -591
  12. package/es/AvatarTeam/AvatarTeam.js +7 -7
  13. package/es/AvatarTeam/AvatarTeam.module.css +191 -191
  14. package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -704
  15. package/es/Button/Button.js +4 -4
  16. package/es/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -440
  17. package/es/Button/css/Button.module.css +533 -533
  18. package/es/Buttongroup/Buttongroup.js +1 -1
  19. package/es/Buttongroup/Buttongroup.module.css +107 -107
  20. package/es/Buttongroup/__tests__/__snapshots__/Buttongroup.spec.js.snap +191 -191
  21. package/es/Card/Card.js +4 -4
  22. package/es/Card/Card.module.css +20 -20
  23. package/es/CheckBox/CheckBox.js +0 -0
  24. package/es/CheckBox/CheckBox.module.css +159 -159
  25. package/es/DateTime/CalendarView.js +0 -0
  26. package/es/DateTime/DateTime.js +0 -0
  27. package/es/DateTime/DateTime.module.css +249 -249
  28. package/es/DateTime/DateWidget.js +0 -0
  29. package/es/DateTime/DateWidget.module.css +38 -38
  30. package/es/DateTime/YearView.js +0 -0
  31. package/es/DateTime/YearView.module.css +98 -98
  32. package/es/DateTime/common.js +0 -0
  33. package/es/DateTime/dateFormatUtils/dateFormat.js +6 -1
  34. package/es/DateTime/index.js +0 -0
  35. package/es/DateTime/objectUtils.js +0 -0
  36. package/es/DateTime/typeChecker.js +0 -0
  37. package/es/DateTime/validator.js +0 -0
  38. package/es/DropBox/DropBox.js +0 -0
  39. package/es/DropBox/DropBoxElement/css/DropBoxElement.module.css +441 -441
  40. package/es/DropBox/DropBoxPositionMapping.json +144 -144
  41. package/es/DropBox/css/DropBox.module.css +59 -59
  42. package/es/DropDown/DropDown.js +0 -0
  43. package/es/DropDown/DropDown.module.css +5 -5
  44. package/es/DropDown/DropDownHeading.js +0 -0
  45. package/es/DropDown/DropDownHeading.module.css +59 -59
  46. package/es/DropDown/DropDownItem.js +0 -0
  47. package/es/DropDown/DropDownItem.module.css +97 -97
  48. package/es/DropDown/DropDownSearch.js +0 -0
  49. package/es/DropDown/DropDownSearch.module.css +14 -14
  50. package/es/DropDown/DropDownSeparator.js +0 -0
  51. package/es/DropDown/DropDownSeparator.module.css +7 -7
  52. package/es/Heading/Heading.module.css +4 -4
  53. package/es/Label/Label.js +2 -2
  54. package/es/Label/Label.module.css +53 -53
  55. package/es/Label/LabelColors.module.css +20 -20
  56. package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -312
  57. package/es/Layout/Box.js +0 -0
  58. package/es/Layout/Container.js +0 -0
  59. package/es/Layout/Layout.module.css +335 -335
  60. package/es/Layout/utils.js +0 -0
  61. package/es/ListItem/ListItem.js +0 -0
  62. package/es/ListItem/ListItem.module.css +237 -237
  63. package/es/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
  64. package/es/MultiSelect/MobileHeader/MobileHeader.module.css +16 -16
  65. package/es/MultiSelect/MultiSelect.js +5 -5
  66. package/es/MultiSelect/MultiSelect.module.css +204 -204
  67. package/es/MultiSelect/MultiSelectWithAvatar.js +0 -0
  68. package/es/MultiSelect/SelectedOptions.module.css +15 -15
  69. package/es/PopOver/PopOver.module.css +9 -9
  70. package/es/Popup/Popup.js +0 -0
  71. package/es/Popup/PositionMapping.json +73 -73
  72. package/es/Radio/Radio.js +0 -0
  73. package/es/Radio/Radio.module.css +113 -113
  74. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -1837
  75. package/es/Responsive/CustomResponsive.js +0 -0
  76. package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
  77. package/es/Ribbon/Ribbon.js +0 -0
  78. package/es/Ribbon/Ribbon.module.css +458 -458
  79. package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -374
  80. package/es/RippleEffect/RippleEffect.module.css +92 -92
  81. package/es/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -171
  82. package/es/Select/GroupSelect.js +0 -0
  83. package/es/Select/Select.js +0 -0
  84. package/es/Select/Select.module.css +108 -108
  85. package/es/Select/SelectWithAvatar.js +0 -0
  86. package/es/Select/SelectWithIcon.js +0 -0
  87. package/es/Stencils/Stencils.js +0 -0
  88. package/es/Stencils/Stencils.module.css +96 -96
  89. package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -89
  90. package/es/Switch/Switch.js +0 -0
  91. package/es/Switch/Switch.module.css +129 -129
  92. package/es/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -831
  93. package/es/Tab/Tab.module.css +100 -100
  94. package/es/Tab/TabContent.module.css +4 -4
  95. package/es/Tab/Tabs.js +17 -17
  96. package/es/Tab/Tabs.module.css +136 -136
  97. package/es/Tag/Tag.js +8 -8
  98. package/es/Tag/Tag.module.css +260 -260
  99. package/es/TextBox/TextBox.js +0 -0
  100. package/es/TextBox/TextBox.module.css +178 -178
  101. package/es/TextBoxIcon/TextBoxIcon.js +0 -0
  102. package/es/TextBoxIcon/TextBoxIcon.module.css +84 -84
  103. package/es/Textarea/Textarea.js +0 -0
  104. package/es/Textarea/Textarea.module.css +145 -145
  105. package/es/Tooltip/Tooltip.module.css +144 -144
  106. package/es/common/a11y.module.css +3 -3
  107. package/es/common/animation.module.css +624 -624
  108. package/es/common/avatarsizes.module.css +48 -48
  109. package/es/common/basic.module.css +33 -33
  110. package/es/common/basicReset.module.css +40 -40
  111. package/es/common/boxShadow.module.css +33 -33
  112. package/es/common/common.module.css +524 -524
  113. package/es/common/customscroll.module.css +128 -128
  114. package/es/common/reset.module.css +13 -13
  115. package/es/common/transition.module.css +146 -146
  116. package/es/semantic/Button/semanticButton.module.css +9 -9
  117. package/es/utils/Common.js +0 -0
  118. package/es/utils/dropDownUtils.js +0 -0
  119. package/es/v1/Avatar/Avatar.js +5 -5
  120. package/es/v1/AvatarTeam/AvatarTeam.js +4 -4
  121. package/es/v1/Button/Button.js +4 -4
  122. package/es/v1/Card/Card.js +4 -4
  123. package/es/v1/CheckBox/CheckBox.js +0 -0
  124. package/es/v1/DateTime/DateTime.js +0 -0
  125. package/es/v1/DateTime/DateWidget.js +0 -0
  126. package/es/v1/DateTime/YearView.js +0 -0
  127. package/es/v1/DateTime/index.js +0 -0
  128. package/es/v1/DropBox/DropBox.js +0 -0
  129. package/es/v1/DropDown/DropDown.js +0 -0
  130. package/es/v1/DropDown/DropDownHeading.js +0 -0
  131. package/es/v1/DropDown/DropDownItem.js +0 -0
  132. package/es/v1/DropDown/DropDownSearch.js +0 -0
  133. package/es/v1/DropDown/DropDownSeparator.js +0 -0
  134. package/es/v1/Layout/Box.js +0 -0
  135. package/es/v1/Layout/Container.js +0 -0
  136. package/es/v1/ListItem/ListItem.js +0 -0
  137. package/es/v1/Modal/Modal.js +86 -114
  138. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
  139. package/es/v1/MultiSelect/MultiSelect.js +5 -5
  140. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +0 -0
  141. package/es/v1/Radio/Radio.js +0 -0
  142. package/es/v1/Responsive/CustomResponsive.js +0 -0
  143. package/es/v1/Select/GroupSelect.js +0 -0
  144. package/es/v1/Select/Select.js +0 -0
  145. package/es/v1/Select/SelectWithAvatar.js +0 -0
  146. package/es/v1/Select/SelectWithIcon.js +0 -0
  147. package/es/v1/Switch/Switch.js +0 -0
  148. package/es/v1/Tab/Tabs.js +17 -17
  149. package/es/v1/Tag/Tag.js +8 -8
  150. package/es/v1/TextBox/TextBox.js +0 -0
  151. package/es/v1/Typography/css/Typography.module.css +380 -409
  152. package/es/v1/Typography/css/cssJSLogic.js +6 -2
  153. package/es/v1/Typography/props/propTypes.js +2 -2
  154. package/es/v1/Typography/utils/index.js +50 -0
  155. package/install.md +10 -10
  156. package/lib/AppContainer/AppContainer.module.css +18 -18
  157. package/lib/Avatar/Avatar.js +9 -9
  158. package/lib/Avatar/Avatar.module.css +187 -187
  159. package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -591
  160. package/lib/AvatarTeam/AvatarTeam.js +7 -7
  161. package/lib/AvatarTeam/AvatarTeam.module.css +191 -191
  162. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -704
  163. package/lib/Button/Button.js +4 -4
  164. package/lib/Button/__tests__/__snapshots__/Button.spec.js.snap +440 -440
  165. package/lib/Button/css/Button.module.css +533 -533
  166. package/lib/Buttongroup/Buttongroup.js +1 -1
  167. package/lib/Buttongroup/Buttongroup.module.css +107 -107
  168. package/lib/Buttongroup/__tests__/__snapshots__/Buttongroup.spec.js.snap +191 -191
  169. package/lib/Card/Card.js +4 -4
  170. package/lib/Card/Card.module.css +20 -20
  171. package/lib/CheckBox/CheckBox.js +0 -0
  172. package/lib/CheckBox/CheckBox.module.css +159 -159
  173. package/lib/DateTime/CalendarView.js +0 -0
  174. package/lib/DateTime/DateTime.js +0 -0
  175. package/lib/DateTime/DateTime.module.css +249 -249
  176. package/lib/DateTime/DateWidget.js +0 -0
  177. package/lib/DateTime/DateWidget.module.css +38 -38
  178. package/lib/DateTime/YearView.js +0 -0
  179. package/lib/DateTime/YearView.module.css +98 -98
  180. package/lib/DateTime/common.js +0 -0
  181. package/lib/DateTime/dateFormatUtils/dateFormat.js +6 -1
  182. package/lib/DateTime/index.js +0 -0
  183. package/lib/DateTime/objectUtils.js +0 -0
  184. package/lib/DateTime/typeChecker.js +0 -0
  185. package/lib/DateTime/validator.js +0 -0
  186. package/lib/DropBox/DropBox.js +0 -0
  187. package/lib/DropBox/DropBoxElement/css/DropBoxElement.module.css +441 -441
  188. package/lib/DropBox/DropBoxPositionMapping.json +144 -144
  189. package/lib/DropBox/css/DropBox.module.css +59 -59
  190. package/lib/DropDown/DropDown.js +0 -0
  191. package/lib/DropDown/DropDown.module.css +5 -5
  192. package/lib/DropDown/DropDownHeading.js +0 -0
  193. package/lib/DropDown/DropDownHeading.module.css +59 -59
  194. package/lib/DropDown/DropDownItem.js +0 -0
  195. package/lib/DropDown/DropDownItem.module.css +97 -97
  196. package/lib/DropDown/DropDownSearch.js +0 -0
  197. package/lib/DropDown/DropDownSearch.module.css +14 -14
  198. package/lib/DropDown/DropDownSeparator.js +0 -0
  199. package/lib/DropDown/DropDownSeparator.module.css +7 -7
  200. package/lib/Heading/Heading.module.css +4 -4
  201. package/lib/Label/Label.js +0 -0
  202. package/lib/Label/Label.module.css +53 -53
  203. package/lib/Label/LabelColors.module.css +20 -20
  204. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -312
  205. package/lib/Layout/Box.js +0 -0
  206. package/lib/Layout/Container.js +0 -0
  207. package/lib/Layout/Layout.module.css +335 -335
  208. package/lib/Layout/utils.js +0 -0
  209. package/lib/ListItem/ListItem.js +0 -0
  210. package/lib/ListItem/ListItem.module.css +237 -237
  211. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
  212. package/lib/MultiSelect/MobileHeader/MobileHeader.module.css +16 -16
  213. package/lib/MultiSelect/MultiSelect.js +5 -5
  214. package/lib/MultiSelect/MultiSelect.module.css +204 -204
  215. package/lib/MultiSelect/MultiSelectWithAvatar.js +0 -0
  216. package/lib/MultiSelect/SelectedOptions.module.css +15 -15
  217. package/lib/PopOver/PopOver.module.css +9 -9
  218. package/lib/Popup/Popup.js +0 -0
  219. package/lib/Popup/PositionMapping.json +73 -73
  220. package/lib/Radio/Radio.js +0 -0
  221. package/lib/Radio/Radio.module.css +113 -113
  222. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -1837
  223. package/lib/Responsive/CustomResponsive.js +0 -0
  224. package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -6
  225. package/lib/Ribbon/Ribbon.js +0 -0
  226. package/lib/Ribbon/Ribbon.module.css +458 -458
  227. package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -374
  228. package/lib/RippleEffect/RippleEffect.module.css +92 -92
  229. package/lib/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -171
  230. package/lib/Select/GroupSelect.js +0 -0
  231. package/lib/Select/Select.js +0 -0
  232. package/lib/Select/Select.module.css +108 -108
  233. package/lib/Select/SelectWithAvatar.js +0 -0
  234. package/lib/Select/SelectWithIcon.js +0 -0
  235. package/lib/Stencils/Stencils.js +0 -0
  236. package/lib/Stencils/Stencils.module.css +96 -96
  237. package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -89
  238. package/lib/Switch/Switch.js +0 -0
  239. package/lib/Switch/Switch.module.css +129 -129
  240. package/lib/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -831
  241. package/lib/Tab/Tab.module.css +100 -100
  242. package/lib/Tab/TabContent.module.css +4 -4
  243. package/lib/Tab/Tabs.js +11 -11
  244. package/lib/Tab/Tabs.module.css +136 -136
  245. package/lib/Tag/Tag.js +8 -8
  246. package/lib/Tag/Tag.module.css +260 -260
  247. package/lib/TextBox/TextBox.js +0 -0
  248. package/lib/TextBox/TextBox.module.css +178 -178
  249. package/lib/TextBoxIcon/TextBoxIcon.js +0 -0
  250. package/lib/TextBoxIcon/TextBoxIcon.module.css +84 -84
  251. package/lib/Textarea/Textarea.js +0 -0
  252. package/lib/Textarea/Textarea.module.css +145 -145
  253. package/lib/Tooltip/Tooltip.module.css +144 -144
  254. package/lib/common/a11y.module.css +3 -3
  255. package/lib/common/animation.module.css +624 -624
  256. package/lib/common/avatarsizes.module.css +48 -48
  257. package/lib/common/basic.module.css +33 -33
  258. package/lib/common/basicReset.module.css +40 -40
  259. package/lib/common/boxShadow.module.css +33 -33
  260. package/lib/common/common.module.css +524 -524
  261. package/lib/common/customscroll.module.css +128 -128
  262. package/lib/common/reset.module.css +13 -13
  263. package/lib/common/transition.module.css +146 -146
  264. package/lib/semantic/Button/semanticButton.module.css +9 -9
  265. package/lib/utils/Common.js +0 -0
  266. package/lib/utils/dropDownUtils.js +0 -0
  267. package/lib/v1/Avatar/Avatar.js +5 -5
  268. package/lib/v1/AvatarTeam/AvatarTeam.js +4 -4
  269. package/lib/v1/Button/Button.js +4 -4
  270. package/lib/v1/Card/Card.js +4 -4
  271. package/lib/v1/CheckBox/CheckBox.js +0 -0
  272. package/lib/v1/DateTime/DateTime.js +0 -0
  273. package/lib/v1/DateTime/DateWidget.js +0 -0
  274. package/lib/v1/DateTime/YearView.js +0 -0
  275. package/lib/v1/DateTime/index.js +0 -0
  276. package/lib/v1/DropBox/DropBox.js +0 -0
  277. package/lib/v1/DropDown/DropDown.js +0 -0
  278. package/lib/v1/DropDown/DropDownHeading.js +0 -0
  279. package/lib/v1/DropDown/DropDownItem.js +0 -0
  280. package/lib/v1/DropDown/DropDownSearch.js +0 -0
  281. package/lib/v1/DropDown/DropDownSeparator.js +0 -0
  282. package/lib/v1/Layout/Box.js +0 -0
  283. package/lib/v1/Layout/Container.js +0 -0
  284. package/lib/v1/ListItem/ListItem.js +0 -0
  285. package/lib/v1/Modal/Modal.js +118 -164
  286. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +5 -5
  287. package/lib/v1/MultiSelect/MultiSelect.js +5 -5
  288. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +0 -0
  289. package/lib/v1/Radio/Radio.js +0 -0
  290. package/lib/v1/Responsive/CustomResponsive.js +0 -0
  291. package/lib/v1/Select/GroupSelect.js +0 -0
  292. package/lib/v1/Select/Select.js +0 -0
  293. package/lib/v1/Select/SelectWithAvatar.js +0 -0
  294. package/lib/v1/Select/SelectWithIcon.js +0 -0
  295. package/lib/v1/Switch/Switch.js +0 -0
  296. package/lib/v1/Tab/Tabs.js +11 -11
  297. package/lib/v1/Tag/Tag.js +8 -8
  298. package/lib/v1/TextBox/TextBox.js +0 -0
  299. package/lib/v1/Typography/css/Typography.module.css +380 -409
  300. package/lib/v1/Typography/css/cssJSLogic.js +7 -3
  301. package/lib/v1/Typography/props/propTypes.js +2 -2
  302. package/lib/v1/Typography/utils/index.js +59 -0
  303. package/package.json +95 -95
  304. package/postPublish.js +8 -8
  305. package/prePublish.js +70 -70
  306. package/propValidationArg.json +8 -0
  307. package/react-cli.config.js +23 -23
  308. package/result.json +1 -1
  309. package/es/v1/Typography/css/letterSpacingMap.js +0 -12
  310. package/lib/v1/Typography/css/letterSpacingMap.js +0 -20
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -5,12 +5,14 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = void 0;
8
+ exports["default"] = Modal;
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _reactDom = _interopRequireDefault(require("react-dom"));
13
13
 
14
+ var _useEffectCallOnlyAfterState = _interopRequireDefault(require("@zohodesk/hooks/es/utils/useEffectCallOnlyAfterState"));
15
+
14
16
  var _defaultProps = require("../../Modal/props/defaultProps");
15
17
 
16
18
  var _propTypes = require("../../Modal/props/propTypes");
@@ -19,194 +21,146 @@ var _AppContainerModule = _interopRequireDefault(require("../../AppContainer/App
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
21
23
 
22
- 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); }
23
-
24
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
- 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); } }
24
+ 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); }
27
25
 
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
26
+ 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; }
29
27
 
30
- 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); }
28
+ 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); }
31
29
 
32
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
30
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
33
31
 
34
- 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); }; }
32
+ 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."); }
35
33
 
36
- 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); }
34
+ 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); }
37
35
 
38
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
36
+ 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; }
39
37
 
40
- 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; } }
38
+ 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; }
41
39
 
42
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
41
 
44
42
  var createdPortalIds = [];
45
43
  var newPortalPrefix = 'CPortal';
46
44
  var portalChildrenTopIndexValues;
47
45
 
48
- var Modal = /*#__PURE__*/function (_React$Component) {
49
- _inherits(Modal, _React$Component);
50
-
51
- var _super = _createSuper(Modal);
52
-
53
- function Modal(props) {
54
- var _this;
55
-
56
- _classCallCheck(this, Modal);
57
-
58
- _this = _super.call(this, props);
59
- _this.handleAddPortalId = _this.handleAddPortalId.bind(_assertThisInitialized(_this));
60
- _this.handleRemovePortalId = _this.handleRemovePortalId.bind(_assertThisInitialized(_this));
61
- _this.handleInsertPortalDiv = _this.handleInsertPortalDiv.bind(_assertThisInitialized(_this));
62
- _this.getPortalDiv = _this.getPortalDiv.bind(_assertThisInitialized(_this));
63
- _this.state = {
64
- isMounted: false
65
- };
66
- _this.portalId = props.portalId;
67
- _this.setRef = _this.setRef.bind(_assertThisInitialized(_this));
68
- _this.ref = null; // this.portalDiv = document.createDocumentFragment();
46
+ function Modal(props) {
47
+ var children = props.children,
48
+ isActive = props.isActive,
49
+ autoZIndexNeeded = props.autoZIndexNeeded,
50
+ propPortalId = props.portalId;
51
+
52
+ var _useState = (0, _react.useState)(false),
53
+ _useState2 = _slicedToArray(_useState, 2),
54
+ isMounted = _useState2[0],
55
+ setMounted = _useState2[1];
56
+
57
+ var portalId = (0, _react.useRef)(propPortalId);
58
+ var ref = (0, _react.useRef)(null);
59
+ var isZIndexAppendNeeded = (0, _react.useRef)();
60
+ var zIndex = (0, _react.useRef)();
61
+ var modalRoot = (0, _react.useRef)();
62
+ var newModalRoot = (0, _react.useRef)();
63
+ var containerDiv = (0, _react.useRef)();
64
+ var portalDiv = (0, _react.useRef)(); // document.createDocumentFragment()
65
+
66
+ var isCustomPortalId = (0, _react.useRef)();
67
+ var setRef = (0, _react.useCallback)(function (ele) {
68
+ ref.current = ele;
69
+
70
+ if (isZIndexAppendNeeded.current) {
71
+ ref.current.style.zIndex = zIndex.current;
72
+ isZIndexAppendNeeded.current = false;
73
+ }
74
+ }, []);
75
+
76
+ function getPortalDiv() {
77
+ modalRoot.current = propPortalId ? document.querySelector("[data-portal=".concat(propPortalId, "]")) : "";
78
+
79
+ if (!modalRoot.current) {
80
+ portalId.current = handleAddPortalId();
81
+ newModalRoot.current = document.createElement('div');
82
+ newModalRoot.current.className = _AppContainerModule["default"].container;
83
+ newModalRoot.current.setAttribute('data-portal', portalId.current);
84
+ containerDiv.current && containerDiv.current.appendChild(newModalRoot.current);
85
+ modalRoot.current = newModalRoot.current;
86
+ }
69
87
 
70
- return _this;
88
+ return modalRoot.current;
71
89
  }
72
90
 
73
- _createClass(Modal, [{
74
- key: "setRef",
75
- value: function setRef(ele) {
76
- this.ref = ele;
77
-
78
- if (this.isZIndexAppendNeeded) {
79
- this.ref.style.zIndex = this.zIndex;
80
- this.isZIndexAppendNeeded = false;
81
- }
82
- }
83
- }, {
84
- key: "getPortalDiv",
85
- value: function getPortalDiv() {
86
- this.modalRoot = this.props.portalId ? document.querySelector("[data-portal=".concat(this.props.portalId, "]")) : '';
87
-
88
- if (!this.modalRoot) {
89
- this.portalId = this.handleAddPortalId();
90
- this.newModalRoot = document.createElement('div');
91
- this.newModalRoot.className = _AppContainerModule["default"].container;
92
- this.newModalRoot.setAttribute('data-portal', this.portalId);
93
- this.containerDiv && this.containerDiv.appendChild(this.newModalRoot);
94
- this.modalRoot = this.newModalRoot;
91
+ (0, _react.useEffect)(function () {
92
+ containerDiv.current = document.getElementsByTagName("desk")[0] ? document.getElementsByTagName('desk')[0] : document.getElementsByTagName('body')[0];
93
+ portalDiv.current = getPortalDiv();
94
+ setMounted(true);
95
+ setTimeout(function () {
96
+ handleInsertPortalDiv();
97
+ });
98
+ return function () {
99
+ // modalRoot.current && modalRoot.current.removeChild(portalDiv.current);
100
+ if (newModalRoot.current) {
101
+ containerDiv.current && containerDiv.current.removeChild(newModalRoot.current);
102
+ handleRemovePortalId();
95
103
  }
96
104
 
97
- return this.modalRoot;
98
- }
99
- }, {
100
- key: "componentDidMount",
101
- value: function componentDidMount() {
102
- var _this2 = this;
103
-
104
- this.containerDiv = document.getElementsByTagName('desk')[0] ? document.getElementsByTagName('desk')[0] : document.getElementsByTagName('body')[0];
105
- this.portalDiv = this.getPortalDiv();
106
- this.setState({
107
- isMounted: true
108
- }, function () {
109
- _this2.handleInsertPortalDiv();
110
- });
111
- }
112
- }, {
113
- key: "componentWillUnmount",
114
- value: function componentWillUnmount() {
115
- //this.modalRoot && this.modalRoot.removeChild(this.portalDiv);
116
- if (this.newModalRoot) {
117
- this.containerDiv && this.containerDiv.removeChild(this.newModalRoot);
118
- this.handleRemovePortalId();
119
- }
120
-
121
- if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
105
+ if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
122
106
  portalChildrenTopIndexValues -= 1;
123
107
  }
108
+ };
109
+ }, []);
110
+ (0, _useEffectCallOnlyAfterState["default"])(function () {
111
+ if (isActive) {
112
+ handleInsertPortalDiv();
113
+ } else if (zIndex.current && portalChildrenTopIndexValues === zIndex.current) {
114
+ portalChildrenTopIndexValues -= 1;
124
115
  }
125
- }, {
126
- key: "componentDidUpdate",
127
- value: function componentDidUpdate(prevProps) {
128
- if (prevProps.isActive != this.props.isActive) {
129
- if (this.props.isActive) {
130
- this.handleInsertPortalDiv();
131
- } else if (this.zIndex && portalChildrenTopIndexValues === this.zIndex) {
132
- portalChildrenTopIndexValues -= 1;
133
- }
134
- }
135
- }
136
- }, {
137
- key: "handleInsertPortalDiv",
138
- value: function handleInsertPortalDiv() {
139
- var autoZIndexNeeded = this.props.autoZIndexNeeded;
140
-
141
- if (autoZIndexNeeded) {
142
- var isActive = this.props.isActive;
143
-
144
- if (isActive) {
145
- var newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
146
- portalChildrenTopIndexValues = newHighValue;
147
- this.zIndex = newHighValue;
148
-
149
- if (this.ref) {
150
- this.ref.style.zIndex = newHighValue;
151
- } else {
152
- this.isZIndexAppendNeeded = true;
153
- }
154
- }
116
+ }, [isActive]);
117
+
118
+ function handleInsertPortalDiv() {
119
+ if (autoZIndexNeeded && isActive) {
120
+ var newHighValue = Number(portalChildrenTopIndexValues || 10) + 1;
121
+ portalChildrenTopIndexValues = newHighValue;
122
+ zIndex.current = newHighValue;
123
+
124
+ if (ref.current) {
125
+ ref.current.style.zIndex = newHighValue;
126
+ } else {
127
+ isZIndexAppendNeeded.current = true;
155
128
  }
156
129
  }
157
- }, {
158
- key: "handleAddPortalId",
159
- value: function handleAddPortalId() {
160
- var createdPortalIdsLen = createdPortalIds.length;
161
- var newPortalId = createdPortalIdsLen ? createdPortalIds[createdPortalIdsLen - 1] + 1 : 1;
162
- createdPortalIds.push(newPortalId);
163
- this.portalId = newPortalId;
164
- this.isCustomPortalId = true;
165
- return "".concat(newPortalPrefix).concat(newPortalId);
166
- }
167
- }, {
168
- key: "handleRemovePortalId",
169
- value: function handleRemovePortalId() {
170
- var _this3 = this;
171
-
172
- if (this.isCustomPortalId) {
173
- createdPortalIds = createdPortalIds.filter(function (id) {
174
- return id !== _this3.portalId;
175
- });
176
- }
130
+ }
131
+
132
+ function handleAddPortalId() {
133
+ var createdPortalIdsLen = createdPortalIds.length;
134
+ var newPortalId = createdPortalIdsLen ? createdPortalIds[createdPortalIdsLen - 1] + 1 : 1;
135
+ createdPortalIds.push(newPortalId);
136
+ portalId.current = newPortalId;
137
+ isCustomPortalId.current = true;
138
+ return "".concat(newPortalPrefix).concat(newPortalId);
139
+ }
140
+
141
+ function handleRemovePortalId() {
142
+ if (isCustomPortalId.current) {
143
+ createdPortalIds = createdPortalIds.filter(function (id) {
144
+ return id !== portalId.current;
145
+ });
177
146
  }
178
- }, {
179
- key: "render",
180
- value: function render() {
181
- var children = this.props.children,
182
- isMounted = this.state.isMounted;
183
- var Element = children.type,
184
- elementProps = children.props;
185
-
186
- if (isMounted) {
187
- if (Element) {
188
- return /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement(Element, _extends({
189
- ref: this.setRef
190
- }, elementProps)), this.portalDiv);
191
- }
192
-
193
- return null;
194
- }
147
+ }
195
148
 
196
- return null;
149
+ var Element = children.type,
150
+ elementProps = children.props;
151
+
152
+ if (isMounted) {
153
+ if (Element) {
154
+ return /*#__PURE__*/_reactDom["default"].createPortal( /*#__PURE__*/_react["default"].createElement(Element, _extends({
155
+ ref: setRef
156
+ }, elementProps)), portalDiv.current);
197
157
  }
198
- }]);
199
158
 
200
- return Modal;
201
- }(_react["default"].Component);
159
+ return null;
160
+ }
161
+
162
+ return null;
163
+ }
202
164
 
203
- exports["default"] = Modal;
204
165
  Modal.defaultProps = _defaultProps.defaultProps;
205
- Modal.propTypes = _propTypes.propTypes; // if (__DOCS__) {
206
- // Modal.docs = {
207
- // componentGroup: 'Atom',
208
- // folderName: 'Style Guide',
209
- // external: false,
210
- // description: ' '
211
- // };
212
- // }
166
+ Modal.propTypes = _propTypes.propTypes;
@@ -488,8 +488,8 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
488
488
  if (suggestionsLen && isPopupOpen && keyCode === 38) {
489
489
  //up arrow
490
490
 
491
- /*if (hoverOption === 0) { //disable first to last option higlight
492
- !isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
491
+ /*if (hoverOption === 0) { //disable first to last option higlight
492
+ !isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
493
493
  }*/
494
494
  if (hoverIndex) {
495
495
  this.setState({
@@ -499,9 +499,9 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
499
499
  } else if (suggestionsLen && isPopupOpen && keyCode === 40) {
500
500
  //down arrow
501
501
 
502
- /*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
503
- //disable last to first option higlight
504
- !isNextOptions && this.setState({ hoverOption: 0 });
502
+ /*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
503
+ //disable last to first option higlight
504
+ !isNextOptions && this.setState({ hoverOption: 0 });
505
505
  }*/
506
506
  if (isNextOptions && suggestionsLen >= 5 && hoverIndex === suggestionsLen - 3) {
507
507
  getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
@@ -402,8 +402,8 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
402
402
  if (suggestionsLen && isPopupOpen && keyCode === 38) {
403
403
  //up arrow
404
404
 
405
- /*if (hoverOption === 0) { //disable first to last option higlight
406
- !isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
405
+ /*if (hoverOption === 0) { //disable first to last option higlight
406
+ !isNextOptions && this.setState({ hoverOption: suggestionsLen - 1 });
407
407
  }*/
408
408
  if (hoverOption) {
409
409
  this.setState({
@@ -413,9 +413,9 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
413
413
  } else if (suggestionsLen && isPopupOpen && keyCode === 40) {
414
414
  //down arrow
415
415
 
416
- /*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
417
- //disable last to first option higlight
418
- !isNextOptions && this.setState({ hoverOption: 0 });
416
+ /*else if (hoverOption === suggestionsLen - 1 || hoverOption === null) {
417
+ //disable last to first option higlight
418
+ !isNextOptions && this.setState({ hoverOption: 0 });
419
419
  }*/
420
420
  if (isNextOptions && suggestionsLen >= 5 && hoverOption === suggestionsLen - 3) {
421
421
  getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -195,9 +195,9 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
195
195
  tabKeys = _this$state.tabKeys;
196
196
 
197
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.
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
201
  */
202
202
  var newTabKeys = [];
203
203
 
@@ -382,14 +382,14 @@ var Tabs = /*#__PURE__*/function (_React$Component) {
382
382
  });
383
383
 
384
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
- }
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
393
  mainTabs = newTabs; */
394
394
  this.setMaxDim(totalDimension);
395
395
  }
package/lib/v1/Tag/Tag.js CHANGED
@@ -31,16 +31,16 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
31
31
 
32
32
  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; }
33
33
 
34
- /*
35
- * eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
36
- * 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
37
- * 'pureDotted', 'primaryDotted'] }]
34
+ /*
35
+ * eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
36
+ * 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
37
+ * 'pureDotted', 'primaryDotted'] }]
38
38
  */
39
39
 
40
- /*
41
- * eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
42
- * 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
43
- * 'pureDotted', 'primaryDotted'] }]
40
+ /*
41
+ * eslint css-modules/no-unused-class: [2, { markAsUsed: ['small', 'medium',
42
+ * 'closedanger', 'closeprimary', 'default', 'danger', 'secondary',
43
+ * 'pureDotted', 'primaryDotted'] }]
44
44
  */
45
45
  function Tag(props) {
46
46
  var imageURL = props.imageURL,
File without changes