@zohodesk/components 1.0.0-temp-47 → 1.0.0-temp-50

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 (173) hide show
  1. package/README.md +24 -0
  2. package/assets/Appearance/dark/mode/darkMode.module.css +2 -0
  3. package/assets/Appearance/default/mode/defaultMode.module.css +2 -0
  4. package/es/Animation/Animation.js +7 -8
  5. package/es/Avatar/Avatar.js +13 -12
  6. package/es/Avatar/__tests__/Avatar.spec.js +0 -1
  7. package/es/AvatarTeam/__tests__/AvatarTeam.spec.js +0 -1
  8. package/es/Button/Button.js +15 -16
  9. package/es/Button/Button.module.css +6 -2
  10. package/es/Button/__tests__/Button.spec.js +0 -1
  11. package/es/Buttongroup/__test__/Buttongroup.spec.js +0 -1
  12. package/es/Card/Card.js +4 -5
  13. package/es/DateTime/DateTime.js +6 -3
  14. package/es/DateTime/DateWidget.js +5 -2
  15. package/es/DateTime/YearView.js +6 -5
  16. package/es/DateTime/common.js +9 -2
  17. package/es/DateTime/dateFormatUtils/dateFormat.js +76 -57
  18. package/es/DateTime/dateFormatUtils/index.js +12 -7
  19. package/es/DateTime/dateFormatUtils/timeChange.js +4 -3
  20. package/es/DateTime/dateFormatUtils/yearChange.js +4 -3
  21. package/es/DateTime/validator.js +0 -1
  22. package/es/DropBox/DropBox.js +2 -2
  23. package/es/Label/__tests__/Label.spec.js +0 -2
  24. package/es/Layout/utils.js +2 -1
  25. package/es/ListItem/ListContainer.js +3 -8
  26. package/es/ListItem/ListItem.js +58 -39
  27. package/es/ListItem/ListItem.module.css +11 -0
  28. package/es/ListItem/ListItemWithAvatar.js +74 -53
  29. package/es/ListItem/ListItemWithCheckBox.js +54 -33
  30. package/es/ListItem/ListItemWithIcon.js +66 -47
  31. package/es/ListItem/ListItemWithRadio.js +55 -34
  32. package/es/MultiSelect/AdvancedGroupMultiSelect.js +12 -4
  33. package/es/MultiSelect/AdvancedMultiSelect.js +20 -7
  34. package/es/MultiSelect/MultiSelect.js +24 -8
  35. package/es/MultiSelect/MultiSelectWithAvatar.js +1 -1
  36. package/es/PopOver/PopOver.js +19 -20
  37. package/es/Popup/Popup.js +15 -9
  38. package/es/Popup/viewPort.js +14 -9
  39. package/es/Provider/IdProvider.js +5 -4
  40. package/es/Provider/LibraryContext.js +6 -5
  41. package/es/Provider/NumberGenerator/NumberGenerator.js +17 -15
  42. package/es/Provider/ZindexProvider.js +5 -4
  43. package/es/Responsive/CustomResponsive.js +11 -8
  44. package/es/Responsive/ResizeComponent.js +3 -1
  45. package/es/Responsive/Responsive.js +12 -9
  46. package/es/Responsive/sizeObservers.js +13 -2
  47. package/es/Ribbon/Ribbon.js +8 -8
  48. package/es/Ribbon/__tests__/Ribbon.spec.js +0 -1
  49. package/es/Select/GroupSelect.js +3 -2
  50. package/es/Select/Select.js +3 -2
  51. package/es/Select/SelectWithAvatar.js +1 -1
  52. package/es/Select/SelectWithIcon.js +1 -1
  53. package/es/Stencils/Stencils.js +5 -6
  54. package/es/Stencils/__tests__/Stencils.spec.js +0 -1
  55. package/es/Tab/Tab.js +27 -26
  56. package/es/Tab/TabContent.js +17 -14
  57. package/es/Tab/TabContentWrapper.js +17 -14
  58. package/es/Tab/TabWrapper.js +15 -14
  59. package/es/Tab/Tabs.js +2 -1
  60. package/es/TextBox/__tests__/TextBox.spec.js +0 -1
  61. package/es/TextBoxIcon/TextBoxIcon.js +1 -1
  62. package/es/TextBoxIcon/__tests__/TextBoxIcon.spec.js +0 -1
  63. package/es/Textarea/__tests__/Textarea.spec.js +0 -1
  64. package/es/Tooltip/Tooltip.js +0 -1
  65. package/es/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +1 -1
  66. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +1 -1
  67. package/es/a11y/FocusScope/FocusScope.js +10 -4
  68. package/es/beta/FocusRing/FocusRing.js +4 -1
  69. package/es/utils/Common.js +31 -11
  70. package/es/utils/datetime/common.js +6 -3
  71. package/es/utils/dropDownUtils.js +45 -6
  72. package/es/utils/getInitial.js +3 -1
  73. package/lib/Accordion/Accordion.js +3 -3
  74. package/lib/Accordion/AccordionItem.js +3 -3
  75. package/lib/Animation/Animation.js +10 -11
  76. package/lib/AppContainer/AppContainer.js +3 -3
  77. package/lib/Avatar/Avatar.js +14 -14
  78. package/lib/AvatarTeam/AvatarTeam.js +3 -3
  79. package/lib/Button/Button.js +18 -19
  80. package/lib/Button/Button.module.css +6 -2
  81. package/lib/Buttongroup/Buttongroup.js +3 -3
  82. package/lib/Card/Card.js +8 -9
  83. package/lib/Card/__tests__/Card.spec.js +1 -1
  84. package/lib/Card/index.js +7 -7
  85. package/lib/CheckBox/CheckBox.js +3 -3
  86. package/lib/DateTime/CalendarView.js +4 -4
  87. package/lib/DateTime/DateTime.js +3 -3
  88. package/lib/DateTime/DateTimePopupFooter.js +3 -3
  89. package/lib/DateTime/DateTimePopupHeader.js +3 -3
  90. package/lib/DateTime/DateWidget.js +3 -3
  91. package/lib/DateTime/DaysRow.js +3 -3
  92. package/lib/DateTime/Time.js +3 -3
  93. package/lib/DateTime/YearView.js +3 -3
  94. package/lib/DateTime/__tests__/CalendarView.spec.js +1 -1
  95. package/lib/DateTime/__tests__/DateTime.spec.js +1 -1
  96. package/lib/DateTime/constants.js +1 -1
  97. package/lib/DateTime/dateFormatUtils/dateFormat.js +2 -2
  98. package/lib/DateTime/dateFormatUtils/index.js +13 -13
  99. package/lib/DateTime/objectUtils.js +2 -2
  100. package/lib/DropBox/DropBox.js +9 -5
  101. package/lib/DropDown/DropDown.js +4 -4
  102. package/lib/DropDown/DropDownHeading.js +3 -3
  103. package/lib/DropDown/DropDownItem.js +3 -3
  104. package/lib/DropDown/DropDownSearch.js +3 -3
  105. package/lib/DropDown/DropDownSeparator.js +3 -3
  106. package/lib/Label/Label.js +3 -3
  107. package/lib/Layout/Box.js +1 -1
  108. package/lib/Layout/Container.js +1 -1
  109. package/lib/Layout/index.js +4 -4
  110. package/lib/Layout/utils.js +2 -2
  111. package/lib/ListItem/ListContainer.js +3 -8
  112. package/lib/ListItem/ListItem.js +61 -40
  113. package/lib/ListItem/ListItem.module.css +11 -0
  114. package/lib/ListItem/ListItemWithAvatar.js +77 -56
  115. package/lib/ListItem/ListItemWithCheckBox.js +57 -36
  116. package/lib/ListItem/ListItemWithIcon.js +69 -48
  117. package/lib/ListItem/ListItemWithRadio.js +58 -37
  118. package/lib/Modal/Modal.js +3 -3
  119. package/lib/Modal/__docs__/Modal__default.docs.js +3 -3
  120. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +4 -4
  121. package/lib/MultiSelect/AdvancedMultiSelect.js +20 -8
  122. package/lib/MultiSelect/EmptyState.js +3 -3
  123. package/lib/MultiSelect/MultiSelect.js +16 -7
  124. package/lib/MultiSelect/MultiSelectHeader.js +3 -3
  125. package/lib/MultiSelect/MultiSelectWithAvatar.js +4 -4
  126. package/lib/MultiSelect/SelectedOptions.js +3 -3
  127. package/lib/MultiSelect/Suggestions.js +5 -5
  128. package/lib/PopOver/PopOver.js +23 -24
  129. package/lib/Popup/Popup.js +35 -32
  130. package/lib/Popup/__tests__/Popup.spec.js +3 -3
  131. package/lib/Provider/IdProvider.js +3 -3
  132. package/lib/Provider/LibraryContext.js +3 -3
  133. package/lib/Provider/NumberGenerator/NumberGenerator.js +2 -2
  134. package/lib/Provider/ZindexProvider.js +1 -1
  135. package/lib/Provider.js +3 -3
  136. package/lib/Radio/Radio.js +3 -3
  137. package/lib/Responsive/CustomResponsive.js +4 -4
  138. package/lib/Responsive/RefWrapper.js +1 -1
  139. package/lib/Responsive/ResizeComponent.js +3 -3
  140. package/lib/Responsive/ResizeObserver.js +1 -1
  141. package/lib/Responsive/Responsive.js +6 -5
  142. package/lib/Responsive/sizeObservers.js +14 -6
  143. package/lib/Responsive/utils/index.js +3 -2
  144. package/lib/Responsive/utils/shallowCompare.js +1 -1
  145. package/lib/Ribbon/Ribbon.js +11 -11
  146. package/lib/Select/GroupSelect.js +4 -4
  147. package/lib/Select/Select.js +4 -4
  148. package/lib/Select/SelectWithAvatar.js +4 -4
  149. package/lib/Select/SelectWithIcon.js +4 -4
  150. package/lib/Stencils/Stencils.js +8 -9
  151. package/lib/Switch/Switch.js +3 -3
  152. package/lib/Tab/Tab.js +1 -1
  153. package/lib/Tab/TabWrapper.js +1 -1
  154. package/lib/Tab/Tabs.js +3 -3
  155. package/lib/Tab/index.js +10 -10
  156. package/lib/Tag/Tag.js +3 -3
  157. package/lib/TextBox/TextBox.js +3 -3
  158. package/lib/TextBoxIcon/TextBoxIcon.js +4 -4
  159. package/lib/Textarea/Textarea.js +3 -3
  160. package/lib/Tooltip/Tooltip.js +3 -3
  161. package/lib/Tooltip/__tests__/Tooltip.spec.js +3 -3
  162. package/lib/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +8 -6
  163. package/lib/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +8 -6
  164. package/lib/a11y/FocusScope/FocusScope.js +2 -2
  165. package/lib/beta/FocusRing/FocusRing.js +3 -3
  166. package/lib/deprecated/PortalLayer/PortalLayer.js +3 -3
  167. package/lib/index.js +310 -310
  168. package/lib/semantic/Button/Button.js +3 -3
  169. package/lib/utils/Common.js +20 -16
  170. package/lib/utils/datetime/common.js +10 -10
  171. package/lib/utils/dropDownUtils.js +46 -3
  172. package/lib/utils/shallowEqual.js +1 -1
  173. package/package.json +4 -4
@@ -70,6 +70,17 @@
70
70
  [dir=rtl] .large {
71
71
  --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
72
72
  }
73
+ .responsiveHeight {
74
+ --listitem_height: var(--zd_size45);
75
+ }
76
+ [dir=ltr] .responsiveHeight {
77
+ --listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10)
78
+ var(--zd_size20)
79
+ /*rtl: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3)*/;
80
+ }
81
+ [dir=rtl] .responsiveHeight {
82
+ --listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size3);
83
+ }
73
84
 
74
85
  .value,
75
86
  .children {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -21,6 +21,8 @@ var _AvatarTeam = _interopRequireDefault(require("../AvatarTeam/AvatarTeam"));
21
21
 
22
22
  var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
23
23
 
24
+ var _CustomResponsive = require("../Responsive/CustomResponsive");
25
+
24
26
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
25
27
 
26
28
  var _ListItemWithAvatar$p;
@@ -35,9 +37,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
35
37
 
36
38
  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); } }
37
39
 
38
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
40
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
41
 
40
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
42
+ 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); }
41
43
 
42
44
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
43
45
 
@@ -65,6 +67,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
65
67
  _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
66
68
  _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
67
69
  _this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_this));
70
+ _this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
68
71
  return _this;
69
72
  }
70
73
 
@@ -98,9 +101,21 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
98
101
  index = _this$props3.index;
99
102
  onMouseEnter && onMouseEnter(id, value, index, e);
100
103
  }
104
+ }, {
105
+ key: "responsiveFunc",
106
+ value: function responsiveFunc(_ref) {
107
+ var mediaQueryOR = _ref.mediaQueryOR;
108
+ return {
109
+ mobileToTab: mediaQueryOR([{
110
+ maxWidth: 700
111
+ }])
112
+ };
113
+ }
101
114
  }, {
102
115
  key: "render",
103
116
  value: function render() {
117
+ var _this2 = this;
118
+
104
119
  var _this$props4 = this.props,
105
120
  size = _this$props4.size,
106
121
  active = _this$props4.active,
@@ -137,59 +152,65 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
137
152
  ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden;
138
153
  var isDarkPalette = palette === 'dark';
139
154
  var dataIdString = value ? value : dataId;
140
- return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
141
- a11y: a11y,
142
- size: size,
143
- palette: palette,
144
- highlight: highlight,
145
- isDisabled: isDisabled,
146
- active: active,
147
- autoHover: autoHover,
148
- needTick: needTick,
149
- needBorder: needBorder,
150
- customClass: customListItem,
151
- dataId: "".concat(dataIdString, "_ListItemWithAvatar"),
152
- onClick: this.handleClick,
153
- onMouseEnter: this.handleMouseEnter,
154
- eleRef: this.getRef,
155
- disableTitle: disableTitle,
156
- title: null,
157
- customProps: ListItemProps
158
- }, ContainerProps), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
159
- className: _ListItemModule["default"].leftAvatar
160
- }, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], {
161
- name: name,
162
- size: "small",
163
- src: imgSrc,
164
- needTitle: needAvatarTitle,
165
- textPalette: isDarkPalette ? 'white' : '',
166
- palette: isDarkPalette ? 'info' : avatarPalette,
167
- customClass: {
168
- customAvatar: customAvatar,
169
- customAvatarTeam: customAvatarTeam
170
- }
171
- }) : /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
172
- name: name,
173
- size: "small",
174
- src: imgSrc,
175
- initial: initial,
176
- textPalette: isDarkPalette ? 'white' : '',
177
- needTitle: needAvatarTitle,
178
- palette: isDarkPalette ? 'info' : avatarPalette,
179
- customClass: customAvatar
180
- })) : null, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
181
- flexible: true,
182
- shrink: true,
183
- "data-title": isDisabled ? null : title,
184
- className: _ListItemModule["default"].value
185
- }, value) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
186
- className: _ListItemModule["default"].tickIcon,
187
- "aria-hidden": ariaHidden,
188
- dataId: "".concat(dataIdString, "_tickIcon")
189
- }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
190
- name: "ZD-ticknew",
191
- size: "8"
192
- })) : null);
155
+ return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
156
+ query: this.responsiveFunc,
157
+ responsiveId: "Helmet"
158
+ }, function (_ref2) {
159
+ var mobileToTab = _ref2.mobileToTab;
160
+ return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
161
+ a11y: a11y,
162
+ size: size,
163
+ palette: palette,
164
+ highlight: highlight,
165
+ isDisabled: isDisabled,
166
+ active: active,
167
+ autoHover: autoHover,
168
+ needTick: needTick,
169
+ needBorder: needBorder,
170
+ customClass: "".concat(customListItem, " ").concat(mobileToTab && _ListItemModule["default"].responsiveHeight),
171
+ dataId: "".concat(dataIdString, "_ListItemWithAvatar"),
172
+ onClick: _this2.handleClick,
173
+ onMouseEnter: _this2.handleMouseEnter,
174
+ eleRef: _this2.getRef,
175
+ disableTitle: disableTitle,
176
+ title: null,
177
+ customProps: ListItemProps
178
+ }, ContainerProps), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
179
+ className: _ListItemModule["default"].leftAvatar
180
+ }, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], {
181
+ name: name,
182
+ size: "small",
183
+ src: imgSrc,
184
+ needTitle: needAvatarTitle,
185
+ textPalette: isDarkPalette ? 'white' : '',
186
+ palette: isDarkPalette ? 'info' : avatarPalette,
187
+ customClass: {
188
+ customAvatar: customAvatar,
189
+ customAvatarTeam: customAvatarTeam
190
+ }
191
+ }) : /*#__PURE__*/_react["default"].createElement(_Avatar["default"], {
192
+ name: name,
193
+ size: "small",
194
+ src: imgSrc,
195
+ initial: initial,
196
+ textPalette: isDarkPalette ? 'white' : '',
197
+ needTitle: needAvatarTitle,
198
+ palette: isDarkPalette ? 'info' : avatarPalette,
199
+ customClass: customAvatar
200
+ })) : null, value ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
201
+ flexible: true,
202
+ shrink: true,
203
+ "data-title": isDisabled ? null : title,
204
+ className: _ListItemModule["default"].value
205
+ }, value) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
206
+ className: _ListItemModule["default"].tickIcon,
207
+ "aria-hidden": ariaHidden,
208
+ dataId: "".concat(dataIdString, "_tickIcon")
209
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
210
+ name: "ZD-ticknew",
211
+ size: "8"
212
+ })) : null);
213
+ });
193
214
  }
194
215
  }]);
195
216
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -19,6 +19,8 @@ var _Layout = require("../Layout");
19
19
 
20
20
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
21
21
 
22
+ var _CustomResponsive = require("../Responsive/CustomResponsive");
23
+
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
23
25
 
24
26
  function _extends() { _extends = Object.assign || 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); }
@@ -27,9 +29,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
27
29
 
28
30
  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
31
 
30
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
32
+ 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
33
 
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
34
+ 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
35
 
34
36
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
37
 
@@ -57,6 +59,7 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
57
59
  _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));
58
60
  _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
59
61
  _this.onHover = _this.onHover.bind(_assertThisInitialized(_this));
62
+ _this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
60
63
  return _this;
61
64
  }
62
65
 
@@ -89,9 +92,21 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
89
92
  index = _this$props3.index;
90
93
  onHover && onHover(id, value, index, e);
91
94
  }
95
+ }, {
96
+ key: "responsiveFunc",
97
+ value: function responsiveFunc(_ref) {
98
+ var mediaQueryOR = _ref.mediaQueryOR;
99
+ return {
100
+ mobileToTab: mediaQueryOR([{
101
+ maxWidth: 700
102
+ }])
103
+ };
104
+ }
92
105
  }, {
93
106
  key: "render",
94
107
  value: function render() {
108
+ var _this2 = this;
109
+
95
110
  var _this$props4 = this.props,
96
111
  size = _this$props4.size,
97
112
  active = _this$props4.active,
@@ -117,39 +132,45 @@ var ListItemWithCheckBox = /*#__PURE__*/function (_React$Component) {
117
132
  customCheckBox = _customClass$customCh === void 0 ? '' : _customClass$customCh,
118
133
  _customClass$customLa = customClass.customLabel,
119
134
  customLabel = _customClass$customLa === void 0 ? '' : _customClass$customLa;
120
- return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
121
- a11y: a11y,
122
- size: size,
123
- palette: palette,
124
- highlight: highlight,
125
- isDisabled: isDisabled,
126
- active: active,
127
- autoHover: autoHover,
128
- customClass: customListItem,
129
- dataId: "".concat(dataId ? dataId : value, "_ListItemWithCheckBox"),
130
- onClick: this.onClick,
131
- onMouseOver: this.onHover,
132
- eleRef: this.getRef,
133
- disableTitle: disableTitle,
134
- title: null,
135
- customProps: ListItemProps
136
- }, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
137
- className: _ListItemModule["default"].iconBox
138
- }, /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
139
- checked: checked,
140
- a11y: {
141
- ariaHidden: true
142
- },
143
- customClass: {
144
- customCheckBox: customCheckBox,
145
- customLabel: customLabel
146
- }
147
- })), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
148
- flexible: true,
149
- shrink: true,
150
- "data-title": isDisabled ? null : title,
151
- className: _ListItemModule["default"].value
152
- }, value));
135
+ return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
136
+ query: this.responsiveFunc,
137
+ responsiveId: "Helmet"
138
+ }, function (_ref2) {
139
+ var mobileToTab = _ref2.mobileToTab;
140
+ return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
141
+ a11y: a11y,
142
+ size: size,
143
+ palette: palette,
144
+ highlight: highlight,
145
+ isDisabled: isDisabled,
146
+ active: active,
147
+ autoHover: autoHover,
148
+ customClass: "".concat(customListItem, " ").concat(mobileToTab && _ListItemModule["default"].responsiveHeight),
149
+ dataId: "".concat(dataId ? dataId : value, "_ListItemWithCheckBox"),
150
+ onClick: _this2.onClick,
151
+ onMouseOver: _this2.onHover,
152
+ eleRef: _this2.getRef,
153
+ disableTitle: disableTitle,
154
+ title: null,
155
+ customProps: ListItemProps
156
+ }, ContainerProps), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
157
+ className: _ListItemModule["default"].iconBox
158
+ }, /*#__PURE__*/_react["default"].createElement(_CheckBox["default"], {
159
+ checked: checked,
160
+ a11y: {
161
+ ariaHidden: true
162
+ },
163
+ customClass: {
164
+ customCheckBox: customCheckBox,
165
+ customLabel: customLabel
166
+ }
167
+ })), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
168
+ flexible: true,
169
+ shrink: true,
170
+ "data-title": isDisabled ? null : title,
171
+ className: _ListItemModule["default"].value
172
+ }, value));
173
+ });
153
174
  }
154
175
  }]);
155
176
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -17,6 +17,8 @@ var _Icon = _interopRequireDefault(require("@zohodesk/icons/lib/Icon"));
17
17
 
18
18
  var _ListContainer = _interopRequireDefault(require("./ListContainer"));
19
19
 
20
+ var _CustomResponsive = require("../Responsive/CustomResponsive");
21
+
20
22
  var _ListItemModule = _interopRequireDefault(require("./ListItem.module.css"));
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -27,9 +29,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
27
29
 
28
30
  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
31
 
30
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
32
+ 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
33
 
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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
34
+ 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
35
 
34
36
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
37
 
@@ -57,6 +59,7 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
57
59
  _this.handleClick = _this.handleClick.bind(_assertThisInitialized(_this));
58
60
  _this.getRef = _this.getRef.bind(_assertThisInitialized(_this));
59
61
  _this.handleMouseEnter = _this.handleMouseEnter.bind(_assertThisInitialized(_this));
62
+ _this.responsiveFunc = _this.responsiveFunc.bind(_assertThisInitialized(_this));
60
63
  return _this;
61
64
  }
62
65
 
@@ -90,9 +93,21 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
90
93
  index = _this$props3.index;
91
94
  onMouseEnter && onMouseEnter(id, value, index, e);
92
95
  }
96
+ }, {
97
+ key: "responsiveFunc",
98
+ value: function responsiveFunc(_ref) {
99
+ var mediaQueryOR = _ref.mediaQueryOR;
100
+ return {
101
+ mobileToTab: mediaQueryOR([{
102
+ maxWidth: 700
103
+ }])
104
+ };
105
+ }
93
106
  }, {
94
107
  key: "render",
95
108
  value: function render() {
109
+ var _this2 = this;
110
+
96
111
  var _this$props4 = this.props,
97
112
  size = _this$props4.size,
98
113
  active = _this$props4.active,
@@ -122,51 +137,57 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
122
137
  var _a11y$ariaHidden = a11y.ariaHidden,
123
138
  ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden;
124
139
  var dataIdString = dataId ? "".concat(dataId.replace("'", '_')) : value.toLowerCase().replace("'", '_');
125
- return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
126
- a11y: a11y,
127
- size: size,
128
- palette: palette,
129
- highlight: highlight,
130
- isDisabled: isDisabled,
131
- active: active,
132
- autoHover: autoHover,
133
- needTick: needTick,
134
- needBorder: needBorder,
135
- customClass: customClass,
136
- dataId: dataIdString,
137
- isLink: isLink,
138
- href: href,
139
- target: target,
140
- onClick: this.handleClick,
141
- onMouseOver: this.handleMouseEnter,
142
- eleRef: this.getRef,
143
- disableTitle: disableTitle,
144
- title: null,
145
- customProps: ListItemProps
146
- }, ContainerProps), iconName && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
147
- "aria-hidden": true,
148
- className: _ListItemModule["default"].iconBox,
149
- dataId: dataId ? "".concat(dataId, "_Icon") : "".concat(value.toLowerCase().replace("'", '_'), "_Icon")
150
- }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
151
- iconClass: iconClass,
152
- name: iconName,
153
- size: iconSize
154
- })), iconClass && !iconName ? /*#__PURE__*/_react["default"].createElement("span", {
155
- className: iconClass
156
- }) : null, value && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
157
- flexible: true,
158
- shrink: true,
159
- className: _ListItemModule["default"].value,
160
- "data-title": isDisabled ? null : title,
161
- dataId: "".concat(dataIdString, "_Text")
162
- }, value), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
163
- className: _ListItemModule["default"].tickIcon,
164
- "aria-hidden": ariaHidden,
165
- dataId: "".concat(dataIdString, "_tickIcon")
166
- }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
167
- name: "ZD-ticknew",
168
- size: "8"
169
- })) : null);
140
+ return /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
141
+ query: this.responsiveFunc,
142
+ responsiveId: "Helmet"
143
+ }, function (_ref2) {
144
+ var mobileToTab = _ref2.mobileToTab;
145
+ return /*#__PURE__*/_react["default"].createElement(_ListContainer["default"], _extends({
146
+ a11y: a11y,
147
+ size: size,
148
+ palette: palette,
149
+ highlight: highlight,
150
+ isDisabled: isDisabled,
151
+ active: active,
152
+ autoHover: autoHover,
153
+ needTick: needTick,
154
+ needBorder: needBorder,
155
+ customClass: "".concat(customListItem, " ").concat(mobileToTab && _ListItemModule["default"].responsiveHeight),
156
+ dataId: dataIdString,
157
+ isLink: isLink,
158
+ href: href,
159
+ target: target,
160
+ onClick: _this2.handleClick,
161
+ onMouseOver: _this2.handleMouseEnter,
162
+ eleRef: _this2.getRef,
163
+ disableTitle: disableTitle,
164
+ title: null,
165
+ customProps: ListItemProps
166
+ }, ContainerProps), iconName && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
167
+ "aria-hidden": true,
168
+ className: _ListItemModule["default"].iconBox,
169
+ dataId: dataId ? "".concat(dataId, "_Icon") : "".concat(value.toLowerCase().replace("'", '_'), "_Icon")
170
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
171
+ iconClass: iconClass,
172
+ name: iconName,
173
+ size: iconSize
174
+ })), iconClass && !iconName ? /*#__PURE__*/_react["default"].createElement("span", {
175
+ className: iconClass
176
+ }) : null, value && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
177
+ flexible: true,
178
+ shrink: true,
179
+ className: _ListItemModule["default"].value,
180
+ "data-title": isDisabled ? null : title,
181
+ dataId: "".concat(dataIdString, "_Text")
182
+ }, value), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
183
+ className: _ListItemModule["default"].tickIcon,
184
+ "aria-hidden": ariaHidden,
185
+ dataId: "".concat(dataIdString, "_tickIcon")
186
+ }, /*#__PURE__*/_react["default"].createElement(_Icon["default"], {
187
+ name: "ZD-ticknew",
188
+ size: "8"
189
+ })) : null);
190
+ });
170
191
  }
171
192
  }]);
172
193