@zohodesk/components 1.2.4 → 1.2.6

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 (202) hide show
  1. package/README.md +8 -0
  2. package/coverage/Button/Button.js.html +1 -1
  3. package/coverage/Button/css/Button.module.css.html +1 -1
  4. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  5. package/coverage/Button/css/index.html +1 -1
  6. package/coverage/Button/index.html +1 -1
  7. package/coverage/Button/props/defaultProps.js.html +1 -1
  8. package/coverage/Button/props/index.html +1 -1
  9. package/coverage/Button/props/propTypes.js.html +1 -1
  10. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  11. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  12. package/coverage/Buttongroup/index.html +1 -1
  13. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  14. package/coverage/Buttongroup/props/index.html +1 -1
  15. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  16. package/coverage/index.html +1 -1
  17. package/coverage/utils/dummyFunction.js.html +1 -1
  18. package/coverage/utils/index.html +1 -1
  19. package/es/AppContainer/AppContainer.js +3 -0
  20. package/es/v1/Accordion/Accordion.js +65 -0
  21. package/es/v1/Accordion/AccordionItem.js +57 -0
  22. package/es/v1/Accordion/index.js +2 -0
  23. package/es/v1/Animation/Animation.js +127 -0
  24. package/es/v1/AppContainer/AppContainer.js +137 -0
  25. package/es/v1/Avatar/Avatar.js +189 -0
  26. package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
  27. package/es/v1/Button/Button.js +68 -0
  28. package/es/v1/Buttongroup/Buttongroup.js +31 -0
  29. package/es/v1/Card/Card.js +271 -0
  30. package/es/v1/CheckBox/CheckBox.js +155 -0
  31. package/es/v1/DateTime/CalendarView.js +218 -0
  32. package/es/v1/DateTime/DateTime.js +783 -0
  33. package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
  34. package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
  35. package/es/v1/DateTime/DateWidget.js +1098 -0
  36. package/es/v1/DateTime/DaysRow.js +31 -0
  37. package/es/v1/DateTime/Time.js +166 -0
  38. package/es/v1/DateTime/YearView.js +264 -0
  39. package/es/v1/DateTime/index.js +1 -0
  40. package/es/v1/DropBox/DropBox.js +91 -0
  41. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
  42. package/es/v1/DropDown/DropDown.js +73 -0
  43. package/es/v1/DropDown/DropDownHeading.js +44 -0
  44. package/es/v1/DropDown/DropDownItem.js +76 -0
  45. package/es/v1/DropDown/DropDownSearch.js +63 -0
  46. package/es/v1/DropDown/DropDownSeparator.js +15 -0
  47. package/es/v1/Heading/Heading.js +32 -0
  48. package/es/v1/Label/Label.js +40 -0
  49. package/es/v1/Layout/Box.js +115 -0
  50. package/es/v1/Layout/Container.js +132 -0
  51. package/es/v1/Layout/index.js +2 -0
  52. package/es/v1/ListItem/ListContainer.js +102 -0
  53. package/es/v1/ListItem/ListItem.js +124 -0
  54. package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
  55. package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
  56. package/es/v1/ListItem/ListItemWithIcon.js +127 -0
  57. package/es/v1/ListItem/ListItemWithRadio.js +105 -0
  58. package/es/v1/ListItem/index.js +6 -0
  59. package/es/v1/Modal/Modal.js +154 -0
  60. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
  61. package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
  62. package/es/v1/MultiSelect/EmptyState.js +64 -0
  63. package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
  64. package/es/v1/MultiSelect/MultiSelect.js +1120 -0
  65. package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
  66. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +216 -0
  67. package/es/v1/MultiSelect/SelectedOptions.js +82 -0
  68. package/es/v1/MultiSelect/Suggestions.js +142 -0
  69. package/es/v1/MultiSelect/index.js +4 -0
  70. package/es/v1/PopOver/PopOver.js +211 -0
  71. package/es/v1/Popup/Popup.js +645 -0
  72. package/es/v1/Radio/Radio.js +115 -0
  73. package/es/v1/Responsive/CustomResponsive.js +195 -0
  74. package/es/v1/Responsive/RefWrapper.js +39 -0
  75. package/es/v1/Responsive/ResizeComponent.js +197 -0
  76. package/es/v1/Responsive/ResizeObserver.js +140 -0
  77. package/es/v1/Responsive/Responsive.js +194 -0
  78. package/es/v1/Responsive/index.js +9 -0
  79. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
  80. package/es/v1/Ribbon/Ribbon.js +33 -0
  81. package/es/v1/RippleEffect/RippleEffect.js +24 -0
  82. package/es/v1/Select/GroupSelect.js +803 -0
  83. package/es/v1/Select/Select.js +969 -0
  84. package/es/v1/Select/SelectWithAvatar.js +344 -0
  85. package/es/v1/Select/SelectWithIcon.js +535 -0
  86. package/es/v1/Select/index.js +4 -0
  87. package/es/v1/Stencils/Stencils.js +26 -0
  88. package/es/v1/Switch/Switch.js +94 -0
  89. package/es/v1/Tab/Tab.js +108 -0
  90. package/es/v1/Tab/TabContent.js +30 -0
  91. package/es/v1/Tab/TabContentWrapper.js +29 -0
  92. package/es/v1/Tab/TabWrapper.js +57 -0
  93. package/es/v1/Tab/Tabs.js +612 -0
  94. package/es/v1/Tab/index.js +5 -0
  95. package/es/v1/Tag/Tag.js +134 -0
  96. package/es/v1/TextBox/TextBox.js +154 -0
  97. package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
  98. package/es/v1/Textarea/Textarea.js +102 -0
  99. package/es/v1/Tooltip/Tooltip.js +518 -0
  100. package/es/v1/Typography/Typography.js +38 -0
  101. package/es/v1/Typography/css/Typography.module.css +376 -0
  102. package/es/v1/Typography/css/cssJSLogic.js +46 -0
  103. package/es/v1/Typography/css/letterSpacingMap.js +12 -0
  104. package/es/v1/Typography/props/defaultProps.js +8 -0
  105. package/es/v1/Typography/props/propTypes.js +24 -0
  106. package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
  107. package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
  108. package/es/v1/semantic/Button/Button.js +53 -0
  109. package/es/v1/semantic/index.js +1 -0
  110. package/lib/AppContainer/AppContainer.js +5 -0
  111. package/lib/v1/Accordion/Accordion.js +96 -0
  112. package/lib/v1/Accordion/AccordionItem.js +68 -0
  113. package/lib/v1/Accordion/index.js +23 -0
  114. package/lib/v1/Animation/Animation.js +143 -0
  115. package/lib/v1/AppContainer/AppContainer.js +209 -0
  116. package/lib/v1/Avatar/Avatar.js +246 -0
  117. package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
  118. package/lib/v1/Button/Button.js +82 -0
  119. package/lib/v1/Buttongroup/Buttongroup.js +44 -0
  120. package/lib/v1/Card/Card.js +365 -0
  121. package/lib/v1/CheckBox/CheckBox.js +166 -0
  122. package/lib/v1/DateTime/CalendarView.js +285 -0
  123. package/lib/v1/DateTime/DateTime.js +872 -0
  124. package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
  125. package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
  126. package/lib/v1/DateTime/DateWidget.js +1125 -0
  127. package/lib/v1/DateTime/DaysRow.js +80 -0
  128. package/lib/v1/DateTime/Time.js +254 -0
  129. package/lib/v1/DateTime/YearView.js +325 -0
  130. package/lib/v1/DateTime/index.js +15 -0
  131. package/lib/v1/DropBox/DropBox.js +119 -0
  132. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
  133. package/lib/v1/DropDown/DropDown.js +170 -0
  134. package/lib/v1/DropDown/DropDownHeading.js +93 -0
  135. package/lib/v1/DropDown/DropDownItem.js +127 -0
  136. package/lib/v1/DropDown/DropDownSearch.js +113 -0
  137. package/lib/v1/DropDown/DropDownSeparator.js +64 -0
  138. package/lib/v1/Heading/Heading.js +49 -0
  139. package/lib/v1/Label/Label.js +51 -0
  140. package/lib/v1/Layout/Box.js +128 -0
  141. package/lib/v1/Layout/Container.js +145 -0
  142. package/lib/v1/Layout/index.js +23 -0
  143. package/lib/v1/ListItem/ListContainer.js +120 -0
  144. package/lib/v1/ListItem/ListItem.js +138 -0
  145. package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
  146. package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
  147. package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
  148. package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
  149. package/lib/v1/ListItem/index.js +55 -0
  150. package/lib/v1/Modal/Modal.js +212 -0
  151. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
  152. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
  153. package/lib/v1/MultiSelect/EmptyState.js +112 -0
  154. package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
  155. package/lib/v1/MultiSelect/MultiSelect.js +1201 -0
  156. package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
  157. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +270 -0
  158. package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
  159. package/lib/v1/MultiSelect/Suggestions.js +195 -0
  160. package/lib/v1/MultiSelect/index.js +39 -0
  161. package/lib/v1/PopOver/PopOver.js +293 -0
  162. package/lib/v1/Popup/Popup.js +715 -0
  163. package/lib/v1/Radio/Radio.js +126 -0
  164. package/lib/v1/Responsive/CustomResponsive.js +242 -0
  165. package/lib/v1/Responsive/RefWrapper.js +57 -0
  166. package/lib/v1/Responsive/ResizeComponent.js +268 -0
  167. package/lib/v1/Responsive/ResizeObserver.js +168 -0
  168. package/lib/v1/Responsive/Responsive.js +274 -0
  169. package/lib/v1/Responsive/index.js +55 -0
  170. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
  171. package/lib/v1/Ribbon/Ribbon.js +44 -0
  172. package/lib/v1/RippleEffect/RippleEffect.js +39 -0
  173. package/lib/v1/Select/GroupSelect.js +877 -0
  174. package/lib/v1/Select/Select.js +1013 -0
  175. package/lib/v1/Select/SelectWithAvatar.js +394 -0
  176. package/lib/v1/Select/SelectWithIcon.js +597 -0
  177. package/lib/v1/Select/index.js +39 -0
  178. package/lib/v1/Stencils/Stencils.js +43 -0
  179. package/lib/v1/Switch/Switch.js +108 -0
  180. package/lib/v1/Tab/Tab.js +132 -0
  181. package/lib/v1/Tab/TabContent.js +42 -0
  182. package/lib/v1/Tab/TabContentWrapper.js +42 -0
  183. package/lib/v1/Tab/TabWrapper.js +89 -0
  184. package/lib/v1/Tab/Tabs.js +680 -0
  185. package/lib/v1/Tab/index.js +47 -0
  186. package/lib/v1/Tag/Tag.js +154 -0
  187. package/lib/v1/TextBox/TextBox.js +168 -0
  188. package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
  189. package/lib/v1/Textarea/Textarea.js +118 -0
  190. package/lib/v1/Tooltip/Tooltip.js +586 -0
  191. package/lib/v1/Typography/Typography.js +56 -0
  192. package/lib/v1/Typography/css/Typography.module.css +376 -0
  193. package/lib/v1/Typography/css/cssJSLogic.js +41 -0
  194. package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
  195. package/lib/v1/Typography/props/defaultProps.js +15 -0
  196. package/lib/v1/Typography/props/propTypes.js +35 -0
  197. package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
  198. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
  199. package/lib/v1/semantic/Button/Button.js +63 -0
  200. package/lib/v1/semantic/index.js +15 -0
  201. package/package.json +1 -1
  202. package/result.json +1 -1
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = DropBox;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _FocusScope = _interopRequireDefault(require("@zohodesk/a11y/es/FocusScope/FocusScope"));
13
+
14
+ var _Modal = _interopRequireDefault(require("../Modal/Modal"));
15
+
16
+ var _Config = require("../../Provider/Config");
17
+
18
+ var _LibraryContextInit = _interopRequireDefault(require("../../Provider/LibraryContextInit"));
19
+
20
+ var _cssJSLogic2 = _interopRequireDefault(require("../../DropBox/css/cssJSLogic"));
21
+
22
+ var _DropBoxElement = _interopRequireDefault(require("./DropBoxElement/DropBoxElement"));
23
+
24
+ var _defaultProps = require("../../DropBox/props/defaultProps");
25
+
26
+ var _propTypes = require("../../DropBox/props/propTypes");
27
+
28
+ var _Common = require("../../utils/Common");
29
+
30
+ var _DropBoxModule = _interopRequireDefault(require("../../DropBox/css/DropBox.module.css"));
31
+
32
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
33
+
34
+ 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); }
35
+
36
+ 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; }
37
+
38
+ 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); }
39
+
40
+ function DropBox(props) {
41
+ var dropBoxRef = (0, _react.useRef)(null);
42
+ var DropBoxContext = (0, _react.useContext)(_LibraryContextInit["default"]);
43
+ var needResponsive = props.needResponsive,
44
+ portalId = props.portalId,
45
+ isActive = props.isActive,
46
+ isAbsolutePositioningNeeded = props.isAbsolutePositioningNeeded,
47
+ isRestrictScroll = props.isRestrictScroll,
48
+ needFocusScope = props.needFocusScope,
49
+ onClose = props.onClose,
50
+ customProps = props.customProps;
51
+ var _customProps$focusSco = customProps.focusScopeProps,
52
+ focusScopeProps = _customProps$focusSco === void 0 ? {} : _customProps$focusSco;
53
+ var _focusScopeProps$auto = focusScopeProps.autoFocus,
54
+ autoFocus = _focusScopeProps$auto === void 0 ? true : _focusScopeProps$auto,
55
+ _focusScopeProps$rest = focusScopeProps.restoreFocus,
56
+ restoreFocus = _focusScopeProps$rest === void 0 ? true : _focusScopeProps$rest,
57
+ _focusScopeProps$need = focusScopeProps.needArrowLoop,
58
+ needArrowLoop = _focusScopeProps$need === void 0 ? true : _focusScopeProps$need,
59
+ _focusScopeProps$need2 = focusScopeProps.needTabLoop,
60
+ needTabLoop = _focusScopeProps$need2 === void 0 ? false : _focusScopeProps$need2,
61
+ _focusScopeProps$enab = focusScopeProps.enableEnterAction,
62
+ enableEnterAction = _focusScopeProps$enab === void 0 ? true : _focusScopeProps$enab;
63
+
64
+ var _ref = DropBoxContext || {},
65
+ direction = _ref.direction;
66
+
67
+ var windowWidth,
68
+ mobileWidth = (0, _Config.getLibraryConfig)('mobileWidth'),
69
+ isModel = false;
70
+
71
+ if (needResponsive) {
72
+ windowWidth = window.innerWidth;
73
+
74
+ if (windowWidth <= mobileWidth) {
75
+ isModel = true;
76
+ }
77
+ }
78
+
79
+ var _cssJSLogic = (0, _cssJSLogic2["default"])(props),
80
+ zIndexStyle = _cssJSLogic.zIndexStyle;
81
+
82
+ var dropBoxEle = needFocusScope ? /*#__PURE__*/_react["default"].createElement(_FocusScope["default"], _extends({
83
+ onClose: onClose,
84
+ elementRef: dropBoxRef,
85
+ autoFocus: autoFocus,
86
+ restoreFocus: restoreFocus,
87
+ needArrowLoop: needArrowLoop,
88
+ needTabLoop: needTabLoop,
89
+ enableEnterAction: enableEnterAction
90
+ }, focusScopeProps), /*#__PURE__*/_react["default"].createElement(_DropBoxElement["default"], _extends({
91
+ isModel: isModel,
92
+ direction: direction
93
+ }, props, {
94
+ zIndexStyle: zIndexStyle,
95
+ subContainerRef: dropBoxRef
96
+ }))) : /*#__PURE__*/_react["default"].createElement(_DropBoxElement["default"], _extends({
97
+ isModel: isModel,
98
+ subContainerRef: dropBoxRef,
99
+ direction: direction
100
+ }, props, {
101
+ zIndexStyle: zIndexStyle
102
+ }));
103
+ return isModel && isActive ? /*#__PURE__*/_react["default"].createElement(_Modal["default"], {
104
+ portalId: portalId
105
+ }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
106
+ className: "".concat(_DropBoxModule["default"].freezeLayer, " ").concat(_DropBoxModule["default"].freeze),
107
+ style: zIndexStyle,
108
+ onClick: _Common.stopPropagation
109
+ }), dropBoxEle)) : !isAbsolutePositioningNeeded && isActive ? /*#__PURE__*/_react["default"].createElement(_Modal["default"], {
110
+ portalId: portalId
111
+ }, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isRestrictScroll ? /*#__PURE__*/_react["default"].createElement("div", {
112
+ className: _DropBoxModule["default"].freezeLayer,
113
+ style: zIndexStyle,
114
+ onClick: _Common.stopPropagation
115
+ }) : null, dropBoxEle)) : dropBoxEle;
116
+ }
117
+
118
+ DropBox.propTypes = _propTypes.DropBoxPropTypes;
119
+ DropBox.defaultProps = _defaultProps.DropBoxDefaultProps;
@@ -0,0 +1,145 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports["default"] = DropBoxElement;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _useDropboxPosCalc2 = _interopRequireDefault(require("../../../DropBox/DropBoxElement/useDropboxPosCalc"));
11
+
12
+ var _cssJSLogic2 = _interopRequireDefault(require("../../../DropBox/DropBoxElement/css/cssJSLogic"));
13
+
14
+ var _DropBoxPositionMapping = require("../../../DropBox/DropBoxPositionMapping.json");
15
+
16
+ var _defaultProps = require("../../../DropBox/DropBoxElement/props/defaultProps");
17
+
18
+ var _propTypes = require("../../../DropBox/DropBoxElement/props/propTypes");
19
+
20
+ var _utils = require("@zohodesk/utils");
21
+
22
+ var _DropBoxElementModule = _interopRequireDefault(require("../../../DropBox/DropBoxElement/css/DropBoxElement.module.css"));
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ function DropBoxElement(props) {
27
+ var children = props.children,
28
+ isAnimate = props.isAnimate,
29
+ isArrow = props.isArrow,
30
+ arrowPosition = props.arrowPosition,
31
+ boxPosition = props.boxPosition,
32
+ size = props.size,
33
+ onClick = props.onClick,
34
+ isActive = props.isActive,
35
+ dataId = props.dataId,
36
+ dataSelectorId = props.dataSelectorId,
37
+ isModel = props.isModel,
38
+ isAbsolutePositioningNeeded = props.isAbsolutePositioningNeeded,
39
+ tourId = props.tourId,
40
+ htmlId = props.htmlId,
41
+ a11y = props.a11y,
42
+ tabIndex = props.tabIndex,
43
+ palette = props.palette,
44
+ subContainerRef = props.subContainerRef,
45
+ customStyle = props.customStyle,
46
+ animationStyle = props.animationStyle;
47
+ var isAbsolute = isAbsolutePositioningNeeded;
48
+
49
+ var FireOnAnimationEnd = function FireOnAnimationEnd() {
50
+ var eleClassList = subContainerRef && subContainerRef.current.classList;
51
+ var animationStyles = animationStyle == 'default' ? _DropBoxElementModule["default"].fadeInScale : _DropBoxElementModule["default"][animationStyle];
52
+ animationStyles.split(' ').map(function (rmStyle) {
53
+ if (eleClassList && eleClassList.contains(rmStyle)) {
54
+ eleClassList.remove(rmStyle);
55
+ }
56
+ });
57
+ };
58
+
59
+ var getRef = function getRef(ele) {
60
+ var getRef = props.getRef,
61
+ forwardRef = props.forwardRef;
62
+ getRef && getRef(ele);
63
+
64
+ if (forwardRef) {
65
+ forwardRef.current = ele;
66
+ }
67
+ };
68
+
69
+ if (!isAbsolutePositioningNeeded && size === 'default' && !isActive) {
70
+ isAbsolute = true;
71
+ }
72
+
73
+ var role = a11y.role,
74
+ ariaMultiselectable = a11y.ariaMultiselectable,
75
+ ariaLabelledby = a11y.ariaLabelledby;
76
+ boxPosition = boxPosition && boxPosition != 'undefined' ? boxPosition : 'bottomCenter';
77
+ var boxDirection = _DropBoxPositionMapping.positionMapping[boxPosition].direction;
78
+
79
+ if (isAbsolute) {
80
+ arrowPosition = arrowPosition ? arrowPosition : _DropBoxPositionMapping.positionMapping[boxPosition].arrowPosition;
81
+ boxPosition = _DropBoxPositionMapping.positionMapping[boxPosition].positionStyle;
82
+ } else {
83
+ arrowPosition = _DropBoxPositionMapping.positionMapping[boxPosition].arrowPosition;
84
+ }
85
+
86
+ var _useDropboxPosCalc = (0, _useDropboxPosCalc2["default"])(props),
87
+ arrowstyle = _useDropboxPosCalc.arrowstyle,
88
+ boxstyle = _useDropboxPosCalc.boxstyle,
89
+ needBoxStyle = _useDropboxPosCalc.needBoxStyle;
90
+
91
+ var mergedStyle = (0, _utils.mergeStyle)(_DropBoxElementModule["default"], customStyle);
92
+
93
+ var _cssJSLogic = (0, _cssJSLogic2["default"])({
94
+ props: props,
95
+ style: mergedStyle,
96
+ customState: {
97
+ boxPosition: boxPosition,
98
+ boxDirection: boxDirection,
99
+ boxstyle: boxstyle,
100
+ needBoxStyle: needBoxStyle,
101
+ isAbsolute: isAbsolute
102
+ }
103
+ }),
104
+ boxClassName = _cssJSLogic.boxClassName,
105
+ subContainerClass = _cssJSLogic.subContainerClass,
106
+ inlineStyle = _cssJSLogic.inlineStyle;
107
+
108
+ return /*#__PURE__*/_react["default"].createElement("div", {
109
+ className: boxClassName,
110
+ "data-id": "".concat(dataId),
111
+ "data-test-id": "".concat(dataId),
112
+ "data-selector-id": dataSelectorId,
113
+ ref: getRef,
114
+ style: inlineStyle,
115
+ "data-tour": tourId,
116
+ "data-position": boxPosition,
117
+ id: htmlId,
118
+ role: role,
119
+ "aria-multiselectable": ariaMultiselectable,
120
+ "aria-labelledby": ariaLabelledby,
121
+ tabIndex: tabIndex,
122
+ onAnimationEnd: isAnimate && FireOnAnimationEnd
123
+ }, /*#__PURE__*/_react["default"].createElement("div", {
124
+ tabIndex: "-1",
125
+ className: "".concat(subContainerClass, " ").concat(_DropBoxElementModule["default"]["".concat(palette, "Palette")]),
126
+ onClick: onClick,
127
+ "data-id": "".concat(dataId, "_subcontainer"),
128
+ "data-test-id": "".concat(dataId, "_subcontainer"),
129
+ "data-selector-id": "".concat(dataSelectorId, "_subcontainer"),
130
+ ref: subContainerRef
131
+ }, isModel ? /*#__PURE__*/_react["default"].createElement("div", {
132
+ className: _DropBoxElementModule["default"].closeBar
133
+ }) : null, isArrow && !isModel && /*#__PURE__*/_react["default"].createElement("div", {
134
+ className: _DropBoxElementModule["default"][arrowPosition],
135
+ style: arrowstyle,
136
+ "data-id": "".concat(dataId, "_arrow"),
137
+ "data-test-id": "".concat(dataId, "_arrow"),
138
+ "data-selector-id": "".concat(dataSelectorId, "_arrow")
139
+ }, /*#__PURE__*/_react["default"].createElement("div", {
140
+ className: _DropBoxElementModule["default"].arrowShape
141
+ })), children));
142
+ }
143
+
144
+ DropBoxElement.propTypes = _propTypes.DropBoxElementPropTypes;
145
+ DropBoxElement.defaultProps = _defaultProps.DropBoxElementDefaultProps;
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = exports.DropDownTarget = exports.DropDownItemContainer = exports.DropDownContainer = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = require("../../DropDown/props/propTypes");
13
+
14
+ var _defaultProps = require("../../DropDown/props/defaultProps");
15
+
16
+ var _DropDownModule = _interopRequireDefault(require("../../DropDown/DropDown.module.css"));
17
+
18
+ var _PopOver = _interopRequireWildcard(require("../PopOver/PopOver"));
19
+
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
25
+
26
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
+
28
+ 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); } }
29
+
30
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
31
+
32
+ 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); }
33
+
34
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
+
36
+ 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); }; }
37
+
38
+ 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); }
39
+
40
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
+
42
+ 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; } }
43
+
44
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
45
+
46
+ var DropDown = /*#__PURE__*/function (_React$Component) {
47
+ _inherits(DropDown, _React$Component);
48
+
49
+ var _super = _createSuper(DropDown);
50
+
51
+ function DropDown() {
52
+ _classCallCheck(this, DropDown);
53
+
54
+ return _super.apply(this, arguments);
55
+ }
56
+
57
+ _createClass(DropDown, [{
58
+ key: "render",
59
+ value: function render() {
60
+ var children = this.props.children;
61
+ return /*#__PURE__*/_react["default"].createElement(_PopOver["default"], this.props, /*#__PURE__*/_react["default"].createElement(_PopOver.PopOverTarget, null, children[0]), /*#__PURE__*/_react["default"].createElement(_PopOver.PopOverContainer, null, children[1]));
62
+ }
63
+ }]);
64
+
65
+ return DropDown;
66
+ }(_react["default"].Component);
67
+
68
+ exports["default"] = DropDown;
69
+ DropDown.propTypes = _propTypes.DropDown_propTypes;
70
+
71
+ var DropDownTarget = /*#__PURE__*/function (_React$Component2) {
72
+ _inherits(DropDownTarget, _React$Component2);
73
+
74
+ var _super2 = _createSuper(DropDownTarget);
75
+
76
+ function DropDownTarget() {
77
+ _classCallCheck(this, DropDownTarget);
78
+
79
+ return _super2.apply(this, arguments);
80
+ }
81
+
82
+ _createClass(DropDownTarget, [{
83
+ key: "render",
84
+ value: function render() {
85
+ var children = this.props.children;
86
+ return /*#__PURE__*/_react["default"].createElement("div", null, children);
87
+ }
88
+ }]);
89
+
90
+ return DropDownTarget;
91
+ }(_react["default"].Component);
92
+
93
+ exports.DropDownTarget = DropDownTarget;
94
+ DropDownTarget.propTypes = _propTypes.DropDownTarget_propTypes;
95
+
96
+ var DropDownContainer = /*#__PURE__*/function (_React$Component3) {
97
+ _inherits(DropDownContainer, _React$Component3);
98
+
99
+ var _super3 = _createSuper(DropDownContainer);
100
+
101
+ function DropDownContainer() {
102
+ _classCallCheck(this, DropDownContainer);
103
+
104
+ return _super3.apply(this, arguments);
105
+ }
106
+
107
+ _createClass(DropDownContainer, [{
108
+ key: "render",
109
+ value: function render() {
110
+ var children = this.props.children;
111
+ return /*#__PURE__*/_react["default"].createElement("div", null, " ", children, " ");
112
+ }
113
+ }]);
114
+
115
+ return DropDownContainer;
116
+ }(_react["default"].Component);
117
+
118
+ exports.DropDownContainer = DropDownContainer;
119
+ DropDownContainer.propTypes = _propTypes.DropDownContainer_propTypes;
120
+
121
+ var DropDownItemContainer = /*#__PURE__*/function (_React$Component4) {
122
+ _inherits(DropDownItemContainer, _React$Component4);
123
+
124
+ var _super4 = _createSuper(DropDownItemContainer);
125
+
126
+ function DropDownItemContainer(props) {
127
+ var _this;
128
+
129
+ _classCallCheck(this, DropDownItemContainer);
130
+
131
+ _this = _super4.call(this, props);
132
+ _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
133
+ _this.onScroll = _this.onScroll.bind(_assertThisInitialized(_this));
134
+ return _this;
135
+ }
136
+
137
+ _createClass(DropDownItemContainer, [{
138
+ key: "onScroll",
139
+ value: function onScroll(e) {
140
+ var onScroll = this.props.onScroll;
141
+ onScroll && onScroll(e);
142
+ }
143
+ }, {
144
+ key: "getRef",
145
+ value: function getRef(ele) {
146
+ var getRef = this.props.getRef;
147
+ getRef && getRef(ele);
148
+ }
149
+ }, {
150
+ key: "render",
151
+ value: function render() {
152
+ var _this$props = this.props,
153
+ children = _this$props.children,
154
+ dataId = _this$props.dataId;
155
+ return /*#__PURE__*/_react["default"].createElement("div", {
156
+ className: _DropDownModule["default"].listGroup,
157
+ onScroll: this.onScroll,
158
+ ref: this.getRef,
159
+ "data-id": dataId,
160
+ "data-test-id": dataId
161
+ }, children);
162
+ }
163
+ }]);
164
+
165
+ return DropDownItemContainer;
166
+ }(_react["default"].Component);
167
+
168
+ exports.DropDownItemContainer = DropDownItemContainer;
169
+ DropDownItemContainer.propTypes = _propTypes.DropDownItemContainer_propTypes;
170
+ DropDownItemContainer.defaultProps = _defaultProps.DropDownItemContainer_defaultProps;
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = require("../../DropDown/props/propTypes");
13
+
14
+ var _defaultProps = require("../../DropDown/props/defaultProps");
15
+
16
+ var _DropDownHeadingModule = _interopRequireDefault(require("../../DropDown/DropDownHeading.module.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
+
22
+ 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); } }
23
+
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
+
26
+ 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); }
27
+
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+
30
+ 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); }; }
31
+
32
+ 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); }
33
+
34
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
+
36
+ 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; } }
37
+
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+
40
+ var DropDownHeading = /*#__PURE__*/function (_React$Component) {
41
+ _inherits(DropDownHeading, _React$Component);
42
+
43
+ var _super = _createSuper(DropDownHeading);
44
+
45
+ function DropDownHeading() {
46
+ _classCallCheck(this, DropDownHeading);
47
+
48
+ return _super.apply(this, arguments);
49
+ }
50
+
51
+ _createClass(DropDownHeading, [{
52
+ key: "render",
53
+ value: function render() {
54
+ var _this$props = this.props,
55
+ text = _this$props.text,
56
+ _this$props$title = _this$props.title,
57
+ title = _this$props$title === void 0 ? text : _this$props$title,
58
+ children = _this$props.children,
59
+ customClass = _this$props.customClass,
60
+ palette = _this$props.palette,
61
+ htmlId = _this$props.htmlId,
62
+ a11y = _this$props.a11y,
63
+ dataId = _this$props.dataId,
64
+ dataSelectorId = _this$props.dataSelectorId;
65
+ var role = a11y.role,
66
+ ariaLabelledby = a11y.ariaLabelledby,
67
+ ariaLabel = a11y.ariaLabel;
68
+ return /*#__PURE__*/_react["default"].createElement("div", {
69
+ className: "".concat(_DropDownHeadingModule["default"][palette], " ").concat(customClass),
70
+ "data-title": title,
71
+ role: role,
72
+ "aria-labelledby": ariaLabelledby,
73
+ "aria-label": ariaLabel,
74
+ id: htmlId,
75
+ "data-id": dataId,
76
+ "data-test-id": dataId,
77
+ "data-selector-id": dataSelectorId // tabindex='0'
78
+
79
+ }, text, children);
80
+ }
81
+ }]);
82
+
83
+ return DropDownHeading;
84
+ }(_react["default"].Component);
85
+
86
+ exports["default"] = DropDownHeading;
87
+ DropDownHeading.propTypes = _propTypes.DropDownHeading_propTypes;
88
+ DropDownHeading.defaultProps = _defaultProps.DropDownHeading_defaultProps; // if (__DOCS__) {
89
+ // DropDownHeading.docs = {
90
+ // componentGroup: 'Form Elements',
91
+ // folderName: 'Style Guide'
92
+ // };
93
+ // }
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _react = _interopRequireDefault(require("react"));
11
+
12
+ var _propTypes = require("../../DropDown/props/propTypes");
13
+
14
+ var _defaultProps = require("../../DropDown/props/defaultProps");
15
+
16
+ var _DropDownItemModule = _interopRequireDefault(require("../../DropDown/DropDownItem.module.css"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
+
22
+ 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); } }
23
+
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
+
26
+ 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); }
27
+
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+
30
+ 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); }; }
31
+
32
+ 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); }
33
+
34
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
+
36
+ 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; } }
37
+
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+
40
+ var DropDownItem = /*#__PURE__*/function (_React$Component) {
41
+ _inherits(DropDownItem, _React$Component);
42
+
43
+ var _super = _createSuper(DropDownItem);
44
+
45
+ function DropDownItem(props) {
46
+ var _this;
47
+
48
+ _classCallCheck(this, DropDownItem);
49
+
50
+ _this = _super.call(this, props);
51
+ _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
52
+ _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
53
+ _this.getSelectedElement = _this.getSelectedElement.bind(_assertThisInitialized(_this));
54
+ _this.onHover = _this.onHover.bind(_assertThisInitialized(_this));
55
+ return _this;
56
+ }
57
+
58
+ _createClass(DropDownItem, [{
59
+ key: "getRef",
60
+ value: function getRef(ele) {
61
+ this.ele = ele;
62
+ var _this$props = this.props,
63
+ index = _this$props.index,
64
+ getRef = _this$props.getRef;
65
+ getRef && getRef(ele, index);
66
+ }
67
+ }, {
68
+ key: "getSelectedElement",
69
+ value: function getSelectedElement() {
70
+ return this.ele ? this.ele : null;
71
+ }
72
+ }, {
73
+ key: "onClick",
74
+ value: function onClick(e) {
75
+ var _this$props2 = this.props,
76
+ onClick = _this$props2.onClick,
77
+ id = _this$props2.id,
78
+ value = _this$props2.value,
79
+ index = _this$props2.index;
80
+ onClick && onClick(id, value, index, e);
81
+ }
82
+ }, {
83
+ key: "onHover",
84
+ value: function onHover(e) {
85
+ var _this$props3 = this.props,
86
+ onHover = _this$props3.onHover,
87
+ id = _this$props3.id,
88
+ value = _this$props3.value,
89
+ index = _this$props3.index;
90
+ onHover && onHover(id, value, index, e);
91
+ }
92
+ }, {
93
+ key: "render",
94
+ value: function render() {
95
+ var _this$props4 = this.props,
96
+ value = _this$props4.value,
97
+ active = _this$props4.active,
98
+ children = _this$props4.children,
99
+ hightlight = _this$props4.hightlight,
100
+ dataId = _this$props4.dataId,
101
+ _this$props4$customCl = _this$props4.customClass,
102
+ customClass = _this$props4$customCl === void 0 ? '' : _this$props4$customCl;
103
+ return /*#__PURE__*/_react["default"].createElement("div", {
104
+ className: "".concat(_DropDownItemModule["default"].list, " ").concat(customClass, " ").concat(active ? _DropDownItemModule["default"].listActive : hightlight ? _DropDownItemModule["default"].listHover : '', " ").concat(children && children[1] ? _DropDownItemModule["default"].padding : ''),
105
+ onClick: this.onClick,
106
+ onMouseOver: this.onHover,
107
+ ref: this.getRef,
108
+ "data-id": dataId,
109
+ "data-test-id": dataId
110
+ }, children && children[0] ? /*#__PURE__*/_react["default"].createElement("span", {
111
+ className: _DropDownItemModule["default"].children
112
+ }, " ", children[0], " ") : children !== undefined ? /*#__PURE__*/_react["default"].createElement("span", {
113
+ className: _DropDownItemModule["default"].children
114
+ }, " ", children, " ") : null, value ? /*#__PURE__*/_react["default"].createElement("span", {
115
+ className: _DropDownItemModule["default"].value
116
+ }, value) : '', children && children[1] ? /*#__PURE__*/_react["default"].createElement("span", {
117
+ className: _DropDownItemModule["default"].user
118
+ }, " ", children[1], " ") : '');
119
+ }
120
+ }]);
121
+
122
+ return DropDownItem;
123
+ }(_react["default"].Component);
124
+
125
+ exports["default"] = DropDownItem;
126
+ DropDownItem.propTypes = _propTypes.DropDownItem_propTypes;
127
+ DropDownItem.defaultProps = _defaultProps.DropDownItem_defaultProps;