@zohodesk/components 1.0.0-temp-169 → 1.0.0-temp-171

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 (216) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropValidationExcludeFilesArray.js +1 -13
  3. package/.cli/propValidation_report.html +1 -1
  4. package/README.md +19 -0
  5. package/assets/Appearance/dark/mode/Component_DarkMode.module.css +1 -0
  6. package/assets/Appearance/light/mode/Component_LightMode.module.css +1 -0
  7. package/assets/Appearance/pureDark/mode/Component_PureDarkMode.module.css +1 -0
  8. package/coverage/Avatar/Avatar.js.html +649 -0
  9. package/coverage/Avatar/Avatar.module.css.html +556 -0
  10. package/coverage/Avatar/index.html +131 -0
  11. package/coverage/Avatar/props/defaultProps.js.html +136 -0
  12. package/coverage/Avatar/props/index.html +131 -0
  13. package/coverage/Avatar/props/propTypes.js.html +166 -0
  14. package/coverage/AvatarTeam/AvatarTeam.js.html +340 -0
  15. package/coverage/AvatarTeam/AvatarTeam.module.css.html +610 -0
  16. package/coverage/AvatarTeam/index.html +131 -0
  17. package/coverage/AvatarTeam/props/defaultProps.js.html +136 -0
  18. package/coverage/AvatarTeam/props/index.html +131 -0
  19. package/coverage/AvatarTeam/props/propTypes.js.html +169 -0
  20. package/coverage/Button/Button.js.html +1 -1
  21. package/coverage/Button/css/Button.module.css.html +1 -1
  22. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  23. package/coverage/Button/css/index.html +1 -1
  24. package/coverage/Button/index.html +1 -1
  25. package/coverage/Button/props/defaultProps.js.html +1 -1
  26. package/coverage/Button/props/index.html +1 -1
  27. package/coverage/Button/props/propTypes.js.html +1 -1
  28. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  29. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  30. package/coverage/Buttongroup/index.html +1 -1
  31. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  32. package/coverage/Buttongroup/props/index.html +1 -1
  33. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  34. package/coverage/Label/Label.js.html +253 -0
  35. package/coverage/Label/Label.module.css.html +241 -0
  36. package/coverage/Label/LabelColors.module.css.html +145 -0
  37. package/coverage/Label/index.html +146 -0
  38. package/coverage/Label/props/defaultProps.js.html +118 -0
  39. package/coverage/Label/props/index.html +131 -0
  40. package/coverage/Label/props/propTypes.js.html +145 -0
  41. package/coverage/Layout/Box.js.html +367 -0
  42. package/coverage/Layout/Container.js.html +439 -0
  43. package/coverage/Layout/Layout.module.css.html +1090 -0
  44. package/coverage/Layout/index.html +176 -0
  45. package/coverage/Layout/index.js.html +118 -0
  46. package/coverage/Layout/props/defaultProps.js.html +136 -0
  47. package/coverage/Layout/props/index.html +131 -0
  48. package/coverage/Layout/props/propTypes.js.html +262 -0
  49. package/coverage/Layout/utils.js.html +199 -0
  50. package/coverage/Provider/AvatarSize.js.html +124 -0
  51. package/coverage/Provider/CssProvider.js.html +133 -0
  52. package/coverage/Provider/index.html +131 -0
  53. package/coverage/Radio/Radio.js.html +415 -0
  54. package/coverage/Radio/Radio.module.css.html +403 -0
  55. package/coverage/Radio/index.html +131 -0
  56. package/coverage/Radio/props/defaultProps.js.html +127 -0
  57. package/coverage/Radio/props/index.html +131 -0
  58. package/coverage/Radio/props/propTypes.js.html +187 -0
  59. package/coverage/Ribbon/Ribbon.js.html +229 -0
  60. package/coverage/Ribbon/Ribbon.module.css.html +1210 -0
  61. package/coverage/Ribbon/index.html +131 -0
  62. package/coverage/Ribbon/props/defaultProps.js.html +112 -0
  63. package/coverage/Ribbon/props/index.html +131 -0
  64. package/coverage/Ribbon/props/propTypes.js.html +121 -0
  65. package/coverage/RippleEffect/RippleEffect.js.html +172 -0
  66. package/coverage/RippleEffect/RippleEffect.module.css.html +415 -0
  67. package/coverage/RippleEffect/index.html +131 -0
  68. package/coverage/RippleEffect/props/defaultProps.js.html +112 -0
  69. package/coverage/RippleEffect/props/index.html +131 -0
  70. package/coverage/RippleEffect/props/propTypes.js.html +121 -0
  71. package/coverage/Stencils/Stencils.js.html +163 -0
  72. package/coverage/Stencils/Stencils.module.css.html +319 -0
  73. package/coverage/Stencils/index.html +131 -0
  74. package/coverage/Stencils/props/defaultProps.js.html +103 -0
  75. package/coverage/Stencils/props/index.html +131 -0
  76. package/coverage/Stencils/props/propTypes.js.html +109 -0
  77. package/coverage/Switch/Switch.js.html +379 -0
  78. package/coverage/Switch/Switch.module.css.html +481 -0
  79. package/coverage/Switch/index.html +131 -0
  80. package/coverage/Switch/props/defaultProps.js.html +118 -0
  81. package/coverage/Switch/props/index.html +131 -0
  82. package/coverage/Switch/props/propTypes.js.html +172 -0
  83. package/coverage/common/avatarsizes.module.css.html +229 -0
  84. package/coverage/common/common.module.css.html +1519 -0
  85. package/coverage/common/index.html +131 -0
  86. package/coverage/coverage-final.json +55 -10
  87. package/coverage/coverage-summary.json +56 -11
  88. package/coverage/index.html +311 -11
  89. package/coverage/utils/dummyFunction.js.html +1 -1
  90. package/coverage/utils/getInitial.js.html +139 -0
  91. package/coverage/utils/index.html +25 -10
  92. package/es/Avatar/__tests__/Avatar.spec.js +181 -0
  93. package/es/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -0
  94. package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +138 -0
  95. package/es/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -0
  96. package/es/DateTime/DateTime.module.css +12 -1
  97. package/es/Label/__tests__/Label.spec.js +99 -0
  98. package/es/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -0
  99. package/es/ListItem/ListContainer.js +1 -1
  100. package/es/MultiSelect/Suggestions.js +2 -1
  101. package/es/MultiSelect/props/propTypes.js +140 -138
  102. package/es/Radio/__tests__/Radio.spec.js +241 -0
  103. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -0
  104. package/es/Ribbon/__tests__/Ribbon.spec.js +52 -0
  105. package/es/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -0
  106. package/es/RippleEffect/__tests__/RippleEffect.spec.js +69 -0
  107. package/es/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -0
  108. package/es/Select/Select.js +4 -3
  109. package/es/Select/props/propTypes.js +3 -1
  110. package/es/Stencils/__tests__/Stencils.spec.js +46 -0
  111. package/es/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -0
  112. package/es/Switch/__tests__/Switch.spec.js +156 -0
  113. package/es/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -0
  114. package/es/TextBox/TextBox.module.css +4 -5
  115. package/es/Textarea/Textarea.module.css +4 -3
  116. package/es/v1/AppContainer/AppContainer.js +75 -92
  117. package/es/v1/Card/Card.js +143 -177
  118. package/es/v1/Card/index.js +4 -0
  119. package/es/v1/DateTime/CalendarView.js +43 -10
  120. package/es/v1/DateTime/DateTime.js +8 -4
  121. package/es/v1/DateTime/DateTimePopupFooter.js +2 -2
  122. package/es/v1/DateTime/DateTimePopupHeader.js +1 -1
  123. package/es/v1/DateTime/DateWidget.js +8 -4
  124. package/es/v1/DateTime/DaysRow.js +1 -1
  125. package/es/v1/DateTime/Time.js +2 -2
  126. package/es/v1/DateTime/YearView.js +2 -2
  127. package/es/v1/DateTime/props/defaultProps.js +57 -0
  128. package/es/v1/DateTime/props/propTypes.js +195 -0
  129. package/es/v1/DropDown/DropDown.js +31 -52
  130. package/es/v1/DropDown/DropDownHeading.js +29 -37
  131. package/es/v1/DropDown/DropDownItem.js +38 -58
  132. package/es/v1/DropDown/DropDownSearch.js +41 -49
  133. package/es/v1/DropDown/DropDownSeparator.js +7 -10
  134. package/es/v1/ListItem/ListItemWithAvatar.js +7 -8
  135. package/es/v1/MultiSelect/MultiSelect.js +1 -0
  136. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +1 -0
  137. package/es/v1/Provider/AvatarSize.js +13 -0
  138. package/es/v1/Provider/Config.js +18 -0
  139. package/es/v1/Provider/CssProvider.js +16 -0
  140. package/es/v1/Provider/IdProvider.js +66 -0
  141. package/es/v1/Provider/LibraryContext.js +37 -0
  142. package/es/v1/Provider/LibraryContextInit.js +3 -0
  143. package/es/v1/Provider/NumberGenerator/NumberGenerator.js +136 -0
  144. package/es/v1/Provider/ZindexProvider.js +57 -0
  145. package/es/v1/Provider/index.js +4 -0
  146. package/es/v1/Tag/Tag.js +6 -2
  147. package/es/v1/TextBox/TextBox.js +10 -10
  148. package/es/v1/Typography/Typography.js +4 -4
  149. package/es/v1/Typography/css/Typography.module.css +33 -0
  150. package/es/v1/Typography/css/cssJSLogic.js +14 -8
  151. package/es/v1/Typography/props/defaultProps.js +4 -4
  152. package/es/v1/Typography/props/propTypes.js +8 -5
  153. package/lib/Avatar/__tests__/Avatar.spec.js +188 -0
  154. package/lib/Avatar/__tests__/__snapshots__/Avatar.spec.js.snap +591 -0
  155. package/lib/AvatarTeam/__tests__/AvatarTeam.spec.js +145 -0
  156. package/lib/AvatarTeam/__tests__/__snapshots__/AvatarTeam.spec.js.snap +704 -0
  157. package/lib/DateTime/DateTime.module.css +12 -1
  158. package/lib/Label/__tests__/Label.spec.js +106 -0
  159. package/lib/Label/__tests__/__snapshots__/Label.spec.js.snap +312 -0
  160. package/lib/ListItem/ListContainer.js +1 -1
  161. package/lib/MultiSelect/Suggestions.js +2 -1
  162. package/lib/MultiSelect/props/propTypes.js +146 -141
  163. package/lib/Radio/__tests__/Radio.spec.js +250 -0
  164. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +1837 -0
  165. package/lib/Ribbon/__tests__/Ribbon.spec.js +59 -0
  166. package/lib/Ribbon/__tests__/__snapshots__/Ribbon.spec.js.snap +374 -0
  167. package/lib/RippleEffect/__tests__/RippleEffect.spec.js +76 -0
  168. package/lib/RippleEffect/__tests__/__snapshots__/RippleEffect.spec.js.snap +171 -0
  169. package/lib/Select/Select.js +4 -3
  170. package/lib/Select/props/propTypes.js +12 -2
  171. package/lib/Stencils/__tests__/Stencils.spec.js +53 -0
  172. package/lib/Stencils/__tests__/__snapshots__/Stencils.spec.js.snap +89 -0
  173. package/lib/Switch/__tests__/Switch.spec.js +163 -0
  174. package/lib/Switch/__tests__/__snapshots__/Switch.spec.js.snap +831 -0
  175. package/lib/TextBox/TextBox.module.css +4 -5
  176. package/lib/Textarea/Textarea.module.css +4 -3
  177. package/lib/v1/AppContainer/AppContainer.js +87 -138
  178. package/lib/v1/Card/Card.js +190 -286
  179. package/lib/v1/Card/index.js +37 -0
  180. package/lib/v1/DateTime/CalendarView.js +44 -10
  181. package/lib/v1/DateTime/DateTime.js +8 -4
  182. package/lib/v1/DateTime/DateTimePopupFooter.js +2 -2
  183. package/lib/v1/DateTime/DateTimePopupHeader.js +1 -1
  184. package/lib/v1/DateTime/DateWidget.js +8 -4
  185. package/lib/v1/DateTime/DaysRow.js +1 -1
  186. package/lib/v1/DateTime/Time.js +2 -2
  187. package/lib/v1/DateTime/YearView.js +2 -2
  188. package/lib/v1/DateTime/props/defaultProps.js +70 -0
  189. package/lib/v1/DateTime/props/propTypes.js +227 -0
  190. package/lib/v1/DropDown/DropDown.js +34 -130
  191. package/lib/v1/DropDown/DropDownHeading.js +29 -75
  192. package/lib/v1/DropDown/DropDownItem.js +50 -102
  193. package/lib/v1/DropDown/DropDownSearch.js +50 -89
  194. package/lib/v1/DropDown/DropDownSeparator.js +8 -48
  195. package/lib/v1/ListItem/ListItemWithAvatar.js +14 -9
  196. package/lib/v1/MultiSelect/MultiSelect.js +3 -1
  197. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +3 -1
  198. package/lib/v1/Provider/AvatarSize.js +24 -0
  199. package/lib/v1/Provider/Config.js +27 -0
  200. package/lib/v1/Provider/CssProvider.js +27 -0
  201. package/lib/v1/Provider/IdProvider.js +79 -0
  202. package/lib/v1/Provider/LibraryContext.js +76 -0
  203. package/lib/v1/Provider/LibraryContextInit.js +15 -0
  204. package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +174 -0
  205. package/lib/v1/Provider/ZindexProvider.js +69 -0
  206. package/lib/v1/Provider/index.js +81 -0
  207. package/lib/v1/Tag/Tag.js +7 -4
  208. package/lib/v1/TextBox/TextBox.js +8 -9
  209. package/lib/v1/Typography/Typography.js +3 -3
  210. package/lib/v1/Typography/css/Typography.module.css +33 -0
  211. package/lib/v1/Typography/css/cssJSLogic.js +8 -5
  212. package/lib/v1/Typography/props/defaultProps.js +4 -4
  213. package/lib/v1/Typography/props/propTypes.js +8 -5
  214. package/package.json +11 -11
  215. package/result.json +1 -1
  216. package/unittest/index.html +1 -1
@@ -13,6 +13,7 @@
13
13
  /* Variable:Ignore */
14
14
  --textbox_letter_spacing: 0.1px;
15
15
  --textbox_padding: 0;
16
+ --textbox_cursor: auto;
16
17
  --textbox_line_height: 35px;
17
18
 
18
19
  /* textbox placeholder default variable */
@@ -25,7 +26,7 @@
25
26
  appearance: none;
26
27
  letter-spacing: var(--textbox_letter_spacing);
27
28
  border: var(--textbox_border_width);
28
- cursor: text;
29
+ cursor: var(--textbox_cursor);
29
30
  }
30
31
  .basic::placeholder {
31
32
  color: var(--textbox_placeholder_text_color);
@@ -59,11 +60,9 @@
59
60
  .basic:disabled,
60
61
  .container:disabled,
61
62
  .container:disabled:hover {
63
+ --textbox_cursor: not-allowed;
62
64
  --textbox_text_color: var(--zdt_textbox_disabled_text);
63
65
  }
64
- .basic:disabled, .container:disabled, .container:disabled:hover {
65
- cursor: not-allowed;
66
- }
67
66
  .container:disabled,
68
67
  .container:disabled:hover {
69
68
  --textbox_bg_color: none;
@@ -81,7 +80,7 @@
81
80
  color: var(--textbox_placeholder_text_color);
82
81
  }
83
82
  .pointer {
84
- cursor: pointer;
83
+ --textbox_cursor: pointer;
85
84
  }
86
85
  /* Need Border */
87
86
  .border, .effect:hover, .effect:focus {
@@ -2,6 +2,7 @@
2
2
  /* textarea default variables */
3
3
  --textarea_border_width: 0;
4
4
  --textarea_border_color: none;
5
+ --textarea_cursor: auto;
5
6
  --textarea_text_color: var(--zdt_textarea_default_text);
6
7
  --textarea_font_size: var(--zd_font_size14);
7
8
  --textarea_line_height: 22px;
@@ -19,7 +20,7 @@
19
20
  outline: 0;
20
21
  letter-spacing: 0.1px;
21
22
  color: var(--textarea_text_color);
22
- cursor:text;
23
+ cursor: var(--textarea_cursor);
23
24
  }
24
25
  .basic, .noBorder {
25
26
  border-width: var(--textarea_border_width);
@@ -37,11 +38,11 @@
37
38
  color: var(--textarea_placeholder_text_color);
38
39
  }
39
40
  .basic:disabled {
41
+ --textarea_cursor: not-allowed;
40
42
  --textarea_text_color: var(--zdt_textarea_default_text);
41
- cursor: not-allowed;
42
43
  }
43
44
  .readonly {
44
- cursor: not-allowed;
45
+ --textarea_cursor: not-allowed;
45
46
  }
46
47
  .resizeX {
47
48
  composes: resizeX from '../common/common.module.css';
@@ -5,9 +5,9 @@ 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"] = AppContainer;
9
9
 
10
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
11
11
 
12
12
  var _defaultProps = require("../../AppContainer/props/defaultProps");
13
13
 
@@ -43,163 +43,112 @@ var _Config = require("../../Provider/Config");
43
43
 
44
44
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
45
45
 
46
- 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); }
47
-
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); }
46
+ 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); }
61
47
 
62
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
48
+ 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; }
63
49
 
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; } }
65
-
66
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
67
-
68
- var AppContainer = /*#__PURE__*/function (_React$Component) {
69
- _inherits(AppContainer, _React$Component);
70
-
71
- var _super = _createSuper(AppContainer);
72
-
73
- function AppContainer(props) {
74
- var _this;
75
-
76
- _classCallCheck(this, AppContainer);
50
+ 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); }
77
51
 
78
- _this = _super.call(this, props);
79
- _this.setTooltipRef = _this.setTooltipRef.bind(_assertThisInitialized(_this));
80
- _this.handleOver = _this.handleOver.bind(_assertThisInitialized(_this));
81
- _this.mouseOverDispatch = _this.mouseOverDispatch.bind(_assertThisInitialized(_this));
82
- _this.removeTimeout = _this.removeTimeout.bind(_assertThisInitialized(_this));
83
- _this.getContainerRef = _this.getContainerRef.bind(_assertThisInitialized(_this));
84
- _this.timer = null;
85
- _this.tooltipDebounce = (0, _Config.getLibraryConfig)('tooltipDebounce');
52
+ function AppContainer(props) {
53
+ var className = props.className,
54
+ children = props.children,
55
+ tagName = props.tagName,
56
+ dataId = props.dataId,
57
+ dataSelectorId = props.dataSelectorId,
58
+ tooltipClass = props.tooltipClass,
59
+ tooltipParentClass = props.tooltipParentClass,
60
+ needTooltip = props.needTooltip,
61
+ customProps = props.customProps,
62
+ eleRef = props.eleRef;
63
+ var _customProps$Containe = customProps.ContainerProps,
64
+ ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe,
65
+ _customProps$TooltipP = customProps.TooltipProps,
66
+ TooltipProps = _customProps$TooltipP === void 0 ? {} : _customProps$TooltipP,
67
+ _customProps$ExtraPro = customProps.ExtraProps,
68
+ ExtraProps = _customProps$ExtraPro === void 0 ? {} : _customProps$ExtraPro;
69
+ var tooltipRef = (0, _react.useRef)(null);
70
+ var containerElement = (0, _react.useRef)(null);
71
+ var timer = (0, _react.useRef)(null);
72
+ var tooltipDebounce = (0, _react.useRef)((0, _Config.getLibraryConfig)('tooltipDebounce'));
73
+ (0, _react.useLayoutEffect)(function () {
86
74
  (0, _Config.setLibraryConfig)({
87
75
  getTooltipContainer: function getTooltipContainer() {
88
- return _this.containerElement;
76
+ return containerElement.current;
89
77
  }
90
78
  });
91
- return _this;
79
+ }, []);
80
+
81
+ function mouseOverDispatch(e) {
82
+ if (tooltipRef.current) {
83
+ tooltipRef.current.handleOver(e, containerElement.current);
84
+ }
92
85
  }
93
86
 
94
- _createClass(AppContainer, [{
95
- key: "mouseOverDispatch",
96
- value: function mouseOverDispatch(e) {
97
- if (this.tooltipRef) {
98
- this.tooltipRef.handleOver(e, this.containerElement);
99
- }
87
+ function removeTimeout() {
88
+ if (timer.current) {
89
+ timer.current = clearTimeout(timer.current);
100
90
  }
101
- }, {
102
- key: "removeTimeout",
103
- value: function removeTimeout() {
104
- if (this.timer) {
105
- this.timer = clearTimeout(this.timer);
106
- }
91
+ }
92
+
93
+ function handleOver(e) {
94
+ if (timer.current) {
95
+ timer.current = clearTimeout(timer.current);
107
96
  }
108
- }, {
109
- key: "handleOver",
110
- value: function handleOver(e) {
111
- var _this2 = this;
112
97
 
113
- if (this.timer) {
114
- this.timer = clearTimeout(this.timer);
115
- }
98
+ timer.current = setTimeout(function () {
99
+ return mouseOverDispatch(e);
100
+ }, tooltipDebounce.current);
101
+ }
116
102
 
117
- this.timer = setTimeout(function () {
118
- return _this2.mouseOverDispatch(e);
119
- }, this.tooltipDebounce);
120
- }
121
- }, {
122
- key: "getContainerRef",
123
- value: function getContainerRef(ref) {
124
- var eleRef = this.props.eleRef;
125
- this.containerElement = ref;
126
- eleRef && eleRef(ref);
127
- }
128
- }, {
129
- key: "setTooltipRef",
130
- value: function setTooltipRef(ref) {
131
- this.tooltipRef = ref;
132
- }
133
- }, {
134
- key: "componentDidMount",
135
- value: function componentDidMount() {
136
- var needTooltip = this.props.needTooltip;
137
-
138
- if (this.containerElement && needTooltip) {
139
- this.containerElement.addEventListener('mouseover', this.handleOver, false);
140
- this.containerElement.addEventListener('mouseout', this.removeTimeout, false);
141
- this.tooltipRef.observeElement();
142
- }
103
+ function getContainerRef(ref) {
104
+ containerElement.current = ref;
105
+ eleRef && eleRef(ref);
106
+ }
107
+
108
+ function setTooltipRef(ref) {
109
+ tooltipRef.current = ref;
110
+ }
111
+
112
+ (0, _react.useEffect)(function () {
113
+ if (containerElement.current && needTooltip) {
114
+ containerElement.current.addEventListener('mouseover', handleOver, false);
115
+ containerElement.current.addEventListener('mouseout', removeTimeout, false);
116
+ tooltipRef.current.observeElement();
143
117
  }
144
- }, {
145
- key: "componentWillUnmount",
146
- value: function componentWillUnmount() {
147
- var needTooltip = this.props.needTooltip;
148
-
149
- if (this.containerElement && needTooltip) {
150
- this.containerElement.removeEventListener('mouseover', this.handleOver, false);
151
- this.containerElement.addEventListener('mouseout', this.removeTimeout, false);
152
- this.tooltipRef.unObserveElement();
118
+ }, []);
119
+ (0, _react.useEffect)(function () {
120
+ return function () {
121
+ if (containerElement.current && needTooltip) {
122
+ containerElement.current.removeEventListener('mouseover', handleOver, false);
123
+ containerElement.current.addEventListener('mouseout', removeTimeout, false);
124
+ tooltipRef.current.unObserveElement();
153
125
  (0, _Config.setLibraryConfig)({
154
126
  getTooltipContainer: function getTooltipContainer() {
155
127
  return null;
156
128
  }
157
129
  });
158
130
  }
159
- }
160
- }, {
161
- key: "render",
162
- value: function render() {
163
- var _this$props = this.props,
164
- className = _this$props.className,
165
- children = _this$props.children,
166
- tagName = _this$props.tagName,
167
- dataId = _this$props.dataId,
168
- dataSelectorId = _this$props.dataSelectorId,
169
- tooltipClass = _this$props.tooltipClass,
170
- tooltipParentClass = _this$props.tooltipParentClass,
171
- needTooltip = _this$props.needTooltip,
172
- customProps = _this$props.customProps;
173
- var _customProps$Containe = customProps.ContainerProps,
174
- ContainerProps = _customProps$Containe === void 0 ? {} : _customProps$Containe,
175
- _customProps$TooltipP = customProps.TooltipProps,
176
- TooltipProps = _customProps$TooltipP === void 0 ? {} : _customProps$TooltipP,
177
- _customProps$ExtraPro = customProps.ExtraProps,
178
- ExtraProps = _customProps$ExtraPro === void 0 ? {} : _customProps$ExtraPro;
179
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
180
- className: "".concat(_AppContainerModule["default"].container, " ").concat(className),
181
- dataId: dataId,
182
- dataSelectorId: dataSelectorId,
183
- tagName: tagName,
184
- eleRef: this.getContainerRef
185
- }, ContainerProps, ExtraProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
186
- flexible: true
187
- }, children)), needTooltip ? /*#__PURE__*/_react["default"].createElement("div", _extends({}, ExtraProps, {
188
- className: "".concat(_AppContainerModule["default"].container, " ").concat(_AppContainerModule["default"].tooltip, " ").concat(tooltipParentClass),
189
- "data-id": "".concat(dataId, "_tooltip"),
190
- "data-test-id": "".concat(dataId, "_tooltip"),
191
- "data-selector-id": "".concat(dataSelectorId, "_tooltip")
192
- }), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], _extends({
193
- ref: this.setTooltipRef,
194
- customClass: tooltipClass
195
- }, TooltipProps))) : null);
196
- }
197
- }]);
131
+ };
132
+ }, []);
133
+ return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
134
+ className: "".concat(_AppContainerModule["default"].container, " ").concat(className),
135
+ dataId: dataId,
136
+ dataSelectorId: dataSelectorId,
137
+ tagName: tagName,
138
+ eleRef: getContainerRef
139
+ }, ContainerProps, ExtraProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
140
+ flexible: true
141
+ }, children)), needTooltip ? /*#__PURE__*/_react["default"].createElement("div", _extends({}, ExtraProps, {
142
+ className: "".concat(_AppContainerModule["default"].container, " ").concat(_AppContainerModule["default"].tooltip, " ").concat(tooltipParentClass),
143
+ "data-id": "".concat(dataId, "_tooltip"),
144
+ "data-test-id": "".concat(dataId, "_tooltip"),
145
+ "data-selector-id": "".concat(dataSelectorId, "_tooltip")
146
+ }), /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], _extends({
147
+ ref: setTooltipRef,
148
+ customClass: tooltipClass
149
+ }, TooltipProps))) : null);
150
+ }
198
151
 
199
- return AppContainer;
200
- }(_react["default"].Component);
201
-
202
- exports["default"] = AppContainer;
203
152
  AppContainer.propTypes = _propTypes.propTypes;
204
153
  AppContainer.defaultProps = _defaultProps.defaultProps; // if (__DOCS__) {
205
154
  // AppContainer.docs = {