@zohodesk/components 1.2.9 → 1.2.11

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 (83) hide show
  1. package/.cli/PropLessFiles.html +1 -1
  2. package/.cli/PropValidationExcludeFilesArray.js +7 -10
  3. package/.cli/propValidation_report.html +1 -1
  4. package/README.md +14 -0
  5. package/coverage/Button/Button.js.html +1 -1
  6. package/coverage/Button/css/Button.module.css.html +1 -1
  7. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  8. package/coverage/Button/css/index.html +1 -1
  9. package/coverage/Button/index.html +1 -1
  10. package/coverage/Button/props/defaultProps.js.html +1 -1
  11. package/coverage/Button/props/index.html +1 -1
  12. package/coverage/Button/props/propTypes.js.html +1 -1
  13. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  14. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  15. package/coverage/Buttongroup/index.html +1 -1
  16. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  17. package/coverage/Buttongroup/props/index.html +1 -1
  18. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  19. package/coverage/coverage-final.json +10 -10
  20. package/coverage/coverage-summary.json +10 -10
  21. package/coverage/index.html +1 -1
  22. package/coverage/utils/dummyFunction.js.html +1 -1
  23. package/coverage/utils/index.html +1 -1
  24. package/es/DateTime/dateFormatUtils/dayChange.js +2 -1
  25. package/es/DateTime/dateFormatUtils/index.js +1 -1
  26. package/es/DateTime/dateFormatUtils/monthChange.js +2 -1
  27. package/es/DateTime/dateFormatUtils/timeChange.js +4 -4
  28. package/es/DateTime/dateFormatUtils/yearChange.js +2 -1
  29. package/es/MultiSelect/props/propTypes.js +140 -138
  30. package/es/Select/GroupSelect.js +2 -5
  31. package/es/Select/Select.js +2 -5
  32. package/es/Select/props/propTypes.js +3 -1
  33. package/es/utils/Common.js +3 -0
  34. package/es/v1/Accordion/Accordion.js +3 -2
  35. package/es/v1/AppContainer/AppContainer.js +75 -92
  36. package/es/v1/Avatar/Avatar.js +84 -134
  37. package/es/v1/Card/Card.js +143 -177
  38. package/es/v1/MultiSelect/MultiSelect.js +1 -0
  39. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +1 -0
  40. package/es/v1/PopOver/PopOver.js +125 -160
  41. package/es/v1/Popup/Popup.js +1 -1
  42. package/es/v1/Provider/AvatarSize.js +13 -0
  43. package/es/v1/Provider/Config.js +18 -0
  44. package/es/v1/Provider/CssProvider.js +16 -0
  45. package/es/v1/Provider/IdProvider.js +66 -0
  46. package/es/v1/Provider/LibraryContext.js +37 -0
  47. package/es/v1/Provider/LibraryContextInit.js +3 -0
  48. package/es/v1/Provider/NumberGenerator/NumberGenerator.js +136 -0
  49. package/es/v1/Provider/ZindexProvider.js +57 -0
  50. package/es/v1/Provider/index.js +4 -0
  51. package/es/v1/Select/GroupSelect.js +2 -5
  52. package/es/v1/Select/Select.js +2 -5
  53. package/lib/DateTime/dateFormatUtils/dayChange.js +3 -1
  54. package/lib/DateTime/dateFormatUtils/index.js +1 -1
  55. package/lib/DateTime/dateFormatUtils/monthChange.js +3 -1
  56. package/lib/DateTime/dateFormatUtils/timeChange.js +3 -3
  57. package/lib/DateTime/dateFormatUtils/yearChange.js +3 -1
  58. package/lib/MultiSelect/props/propTypes.js +146 -141
  59. package/lib/Select/GroupSelect.js +1 -2
  60. package/lib/Select/Select.js +1 -2
  61. package/lib/Select/props/propTypes.js +12 -2
  62. package/lib/utils/Common.js +5 -0
  63. package/lib/v1/Accordion/Accordion.js +3 -1
  64. package/lib/v1/AppContainer/AppContainer.js +87 -138
  65. package/lib/v1/Avatar/Avatar.js +130 -186
  66. package/lib/v1/Card/Card.js +190 -286
  67. package/lib/v1/MultiSelect/MultiSelect.js +3 -1
  68. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +3 -1
  69. package/lib/v1/PopOver/PopOver.js +160 -256
  70. package/lib/v1/Popup/Popup.js +1 -1
  71. package/lib/v1/Provider/AvatarSize.js +24 -0
  72. package/lib/v1/Provider/Config.js +27 -0
  73. package/lib/v1/Provider/CssProvider.js +27 -0
  74. package/lib/v1/Provider/IdProvider.js +79 -0
  75. package/lib/v1/Provider/LibraryContext.js +76 -0
  76. package/lib/v1/Provider/LibraryContextInit.js +15 -0
  77. package/lib/v1/Provider/NumberGenerator/NumberGenerator.js +174 -0
  78. package/lib/v1/Provider/ZindexProvider.js +69 -0
  79. package/lib/v1/Provider/index.js +81 -0
  80. package/lib/v1/Select/GroupSelect.js +1 -2
  81. package/lib/v1/Select/Select.js +1 -2
  82. package/package.json +4 -4
  83. package/result.json +1 -1
@@ -5,10 +5,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports["default"] = exports.CardHeader = exports.CardFooter = exports.CardContent = void 0;
8
+ exports.CardContent = CardContent;
9
+ exports.CardFooter = CardFooter;
10
+ exports.CardHeader = CardHeader;
11
+ exports["default"] = Card;
9
12
 
10
13
  var _react = _interopRequireWildcard(require("react"));
11
14
 
15
+ var _hooks = require("@zohodesk/hooks");
16
+
12
17
  var _propTypes = require("../../Card/props/propTypes");
13
18
 
14
19
  var _defaultProps = require("../../Card/props/defaultProps");
@@ -25,25 +30,17 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
30
 
26
31
  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; }
27
32
 
28
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
-
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); } }
31
-
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; }
33
-
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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
35
34
 
36
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
35
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
37
36
 
38
- 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
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
39
38
 
40
- 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
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
41
40
 
42
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
43
42
 
44
- 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; } }
45
-
46
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
47
44
 
48
45
  /* eslint-disable react/forbid-component-props */
49
46
 
@@ -54,272 +51,198 @@ scroll logic move to virtualizer list
54
51
  */
55
52
 
56
53
  /* performance handling pending in card component moving to ref instead of setState */
57
- var CardHeader = /*#__PURE__*/function (_Component) {
58
- _inherits(CardHeader, _Component);
59
-
60
- var _super = _createSuper(CardHeader);
61
-
62
- function CardHeader(props) {
63
- var _this;
64
-
65
- _classCallCheck(this, CardHeader);
66
-
67
- _this = _super.call(this, props);
68
- _this.getCardHeaderDom = _this.getCardHeaderDom.bind(_assertThisInitialized(_this));
69
- _this.cardHeader = null;
70
- return _this;
54
+ function CardHeader(props) {
55
+ var isScroll = props.isScroll,
56
+ children = props.children,
57
+ dataId = props.dataId,
58
+ dataSelectorId = props.dataSelectorId,
59
+ customClass = props.customClass;
60
+ var cardHeader = (0, _react.useRef)(null);
61
+
62
+ function getCardHeaderDom(ele) {
63
+ cardHeader.current = ele;
71
64
  }
72
65
 
73
- _createClass(CardHeader, [{
74
- key: "getCardHeaderDom",
75
- value: function getCardHeaderDom(ele) {
76
- this.cardHeader = ele;
77
- }
78
- }, {
79
- key: "setScrollClassName",
80
- value: function setScrollClassName() {
81
- if (!this.cardHeader) {
82
- return null;
83
- }
66
+ function setScrollClassName() {
67
+ if (!cardHeader.current) {
68
+ return null;
84
69
  }
85
- }, {
86
- key: "render",
87
- value: function render() {
88
- var _this$props = this.props,
89
- isScroll = _this$props.isScroll,
90
- children = _this$props.children,
91
- dataId = _this$props.dataId,
92
- dataSelectorId = _this$props.dataSelectorId,
93
- customClass = _this$props.customClass;
94
- return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
95
- className: "".concat(isScroll ? _CardModule["default"].scroll : _CardModule["default"].notScroll, " ").concat(customClass),
96
- eleRef: this.getCardHeaderDom,
97
- dataId: dataId,
98
- dataSelectorId: dataSelectorId
99
- }, children);
100
- }
101
- }]);
70
+ }
102
71
 
103
- return CardHeader;
104
- }(_react.Component);
72
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
73
+ className: "".concat(isScroll ? _CardModule["default"].scroll : _CardModule["default"].notScroll, " ").concat(customClass),
74
+ eleRef: getCardHeaderDom,
75
+ dataId: dataId,
76
+ dataSelectorId: dataSelectorId
77
+ }, children);
78
+ }
105
79
 
106
- exports.CardHeader = CardHeader;
107
80
  CardHeader.propTypes = _propTypes.CardHeader_propTypes;
108
81
  CardHeader.defaultProps = _defaultProps.CardHeader_defaultProps;
109
82
 
110
- var CardContent = /*#__PURE__*/function (_Component2) {
111
- _inherits(CardContent, _Component2);
112
-
113
- var _super2 = _createSuper(CardContent);
83
+ function CardContent(props) {
84
+ var onScroll = props.onScroll,
85
+ eleRef = props.eleRef,
86
+ children = props.children,
87
+ scroll = props.scroll,
88
+ isScrollAttribute = props.isScrollAttribute,
89
+ dataId = props.dataId,
90
+ dataSelectorId = props.dataSelectorId,
91
+ shrink = props.shrink,
92
+ customClass = props.customClass,
93
+ preventParentScroll = props.preventParentScroll;
94
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
95
+ flexible: true,
96
+ onScroll: onScroll,
97
+ eleRef: eleRef,
98
+ scroll: scroll,
99
+ preventParentScroll: preventParentScroll,
100
+ isScrollAttribute: isScrollAttribute,
101
+ dataId: dataId,
102
+ shrink: shrink,
103
+ className: customClass,
104
+ dataSelectorId: dataSelectorId
105
+ }, children);
106
+ }
114
107
 
115
- function CardContent() {
116
- _classCallCheck(this, CardContent);
117
-
118
- return _super2.apply(this, arguments);
119
- }
120
-
121
- _createClass(CardContent, [{
122
- key: "render",
123
- value: function render() {
124
- var _this$props2 = this.props,
125
- onScroll = _this$props2.onScroll,
126
- eleRef = _this$props2.eleRef,
127
- children = _this$props2.children,
128
- scroll = _this$props2.scroll,
129
- isScrollAttribute = _this$props2.isScrollAttribute,
130
- dataId = _this$props2.dataId,
131
- dataSelectorId = _this$props2.dataSelectorId,
132
- shrink = _this$props2.shrink,
133
- customClass = _this$props2.customClass,
134
- preventParentScroll = _this$props2.preventParentScroll;
135
- return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
136
- flexible: true,
137
- onScroll: onScroll,
138
- eleRef: eleRef,
139
- scroll: scroll,
140
- preventParentScroll: preventParentScroll,
141
- isScrollAttribute: isScrollAttribute,
142
- dataId: dataId,
143
- shrink: shrink,
144
- className: customClass,
145
- dataSelectorId: dataSelectorId
146
- }, children);
147
- }
148
- }]);
149
-
150
- return CardContent;
151
- }(_react.Component);
152
-
153
- exports.CardContent = CardContent;
154
108
  CardContent.propTypes = _propTypes.CardContent_propTypes;
155
109
  CardContent.defaultProps = _defaultProps.CardContent_defaultProps;
156
110
 
157
- var Card = /*#__PURE__*/function (_Component3) {
158
- _inherits(Card, _Component3);
159
-
160
- var _super3 = _createSuper(Card);
161
-
162
- function Card(props) {
163
- var _this2;
164
-
165
- _classCallCheck(this, Card);
111
+ function Card(props) {
112
+ var onClick = props.onClick,
113
+ children = props.children,
114
+ isScrollAttribute = props.isScrollAttribute,
115
+ dataId = props.dataId,
116
+ eleRef = props.eleRef,
117
+ _props$customClass = props.customClass,
118
+ customClass = _props$customClass === void 0 ? '' : _props$customClass,
119
+ htmlId = props.htmlId,
120
+ a11y = props.a11y,
121
+ from = props.from,
122
+ limit = props.limit,
123
+ fetchData = props.fetchData,
124
+ noMoreData = props.noMoreData,
125
+ scrollAt = props.scrollAt,
126
+ noNeedUpScroll = props.noNeedUpScroll,
127
+ isPercentageScroll = props.isPercentageScroll,
128
+ onScroll = props.onScroll;
129
+ var role = a11y.role;
130
+
131
+ var _useState = (0, _react.useState)(false),
132
+ _useState2 = _slicedToArray(_useState, 2),
133
+ isScroll = _useState2[0],
134
+ setScroll = _useState2[1];
135
+
136
+ var fromRef = (0, _react.useRef)(from);
137
+ var limitRef = (0, _react.useRef)(limit);
138
+ var to = (0, _react.useRef)(from + 3 * limit);
139
+ var lastScrollTop = (0, _react.useRef)(0);
140
+ var isFetching = (0, _react.useRef)(false);
141
+ var scrollDirection = (0, _react.useRef)(null);
142
+ (0, _hooks.useEffectCallOnlyAfterState)(function () {
143
+ fromRef.current = from;
144
+ }, [from]);
145
+
146
+ function onCardScroll(e) {
147
+ var scrollContainerObj = e.currentTarget;
148
+ var scrollHeight = scrollContainerObj.scrollHeight;
149
+ var scrollTop = scrollContainerObj.scrollTop;
150
+ var offsetHeight = scrollContainerObj.offsetHeight;
151
+ onScroll && onScroll(e);
152
+
153
+ if (scrollTop > lastScrollTop.current) {
154
+ scrollDirection.current = 'down';
155
+ } else {
156
+ scrollDirection.current = 'up';
157
+ }
166
158
 
167
- _this2 = _super3.call(this, props);
168
- _this2.state = {
169
- isScroll: false
170
- };
171
- var from = props.from,
172
- limit = props.limit;
173
- _this2.from = from;
174
- _this2.limit = limit;
175
- _this2.to = from + 3 * limit;
176
- _this2.isFetching = false;
177
- _this2.lastScrollTop = 0;
178
- _this2.onScroll = _this2.onScroll.bind(_assertThisInitialized(_this2)); //this.onSetScroll = debounce(this.setScroll.bind(this, true), 10, true);
179
- //this.onClearScroll = debounce(this.setScroll.bind(this, false), 500);
159
+ lastScrollTop.current = scrollTop;
180
160
 
181
- return _this2;
182
- }
161
+ if (fetchData && !isFetching.current) {
162
+ if (scrollDirection.current === 'down' && !noMoreData) {
163
+ var scrollingPercentage = (scrollTop + offsetHeight) / (scrollHeight - scrollAt) * 100;
164
+ var prefetch = isPercentageScroll ? scrollingPercentage >= (0, _Config.getLibraryConfig)('scrollFetchLimit') : scrollHeight - scrollAt <= scrollTop + offsetHeight;
183
165
 
184
- _createClass(Card, [{
185
- key: "UNSAFE_componentWillReceiveProps",
186
- value: function UNSAFE_componentWillReceiveProps(nextProps) {
187
- if (this.from !== nextProps.from) {
188
- this.from = nextProps.from;
189
- }
190
- }
191
- }, {
192
- key: "onScroll",
193
- value: function onScroll(e) {
194
- var _this3 = this;
195
-
196
- var scrollContainerObj = e.currentTarget;
197
- var scrollHeight = scrollContainerObj.scrollHeight;
198
- var scrollTop = scrollContainerObj.scrollTop;
199
- var offsetHeight = scrollContainerObj.offsetHeight;
200
- var onScroll = this.props.onScroll;
201
- onScroll && onScroll(e);
202
- var _this$props3 = this.props,
203
- fetchData = _this$props3.fetchData,
204
- noMoreData = _this$props3.noMoreData,
205
- scrollAt = _this$props3.scrollAt,
206
- noNeedUpScroll = _this$props3.noNeedUpScroll,
207
- isPercentageScroll = _this$props3.isPercentageScroll;
208
-
209
- if (scrollTop > this.lastScrollTop) {
210
- this.scrollDirection = 'down';
166
+ if (prefetch) {
167
+ isFetching.current = true;
168
+ fetchData(fromRef.current + limitRef.current, limitRef.current + to.current, scrollDirection.current).then(function () {
169
+ to.current = limitRef.current + to.current;
170
+ isFetching.current = false;
171
+ }, function () {
172
+ isFetching.current = false;
173
+ });
174
+ }
211
175
  } else {
212
- this.scrollDirection = 'up';
213
- }
214
-
215
- this.lastScrollTop = scrollTop;
216
-
217
- if (fetchData && !this.isFetching) {
218
- if (this.scrollDirection === 'down' && !noMoreData) {
219
- var scrollingPercentage = (scrollTop + offsetHeight) / (scrollHeight - scrollAt) * 100;
220
- var prefetch = isPercentageScroll ? scrollingPercentage >= (0, _Config.getLibraryConfig)('scrollFetchLimit') : scrollHeight - scrollAt <= scrollTop + offsetHeight;
221
-
222
- if (prefetch) {
223
- this.isFetching = true;
224
- fetchData(this.from + this.limit, this.limit + this.to, this.scrollDirection).then(function () {
225
- _this3.to = _this3.limit + _this3.to;
226
- _this3.isFetching = false;
227
- }, function () {
228
- _this3.isFetching = false;
229
- });
230
- }
231
- } else {
232
- if (0 >= scrollTop - scrollAt && this.from !== 0 && !noNeedUpScroll) {
233
- this.isFetching = true;
234
- fetchData(this.from - this.limit, this.to - this.limit, this.scrollDirection).then(function () {
235
- _this3.to = _this3.to - _this3.limit;
236
- _this3.isFetching = false;
237
- }, function () {
238
- _this3.isFetching = false;
239
- });
240
- }
176
+ if (0 >= scrollTop - scrollAt && fromRef.current !== 0 && !noNeedUpScroll) {
177
+ isFetching.current = true;
178
+ fetchData(fromRef.current - limitRef.current, to.current - limitRef.current, scrollDirection.current).then(function () {
179
+ to.current = to.current - limitRef.current;
180
+ isFetching.current = false;
181
+ }, function () {
182
+ isFetching.current = false;
183
+ });
241
184
  }
242
185
  }
186
+ }
243
187
 
244
- if (fetchData && !noNeedUpScroll) {
245
- if (this.from !== 0 && scrollTop === 0 && !noNeedUpScroll) {
246
- scrollContainerObj.scrollTop = scrollTop + offsetHeight / 3;
247
- } else if (scrollHeight === scrollTop + offsetHeight && !noMoreData) {
248
- scrollContainerObj.scrollTop = scrollTop - offsetHeight / 2;
249
- }
250
- } // if (isScrollShadow) {
251
- // this.onSetScroll();
252
- // }
253
-
254
- } // setScroll(isScroll) {
255
- // let { isScroll: stateIsScroll } = this.state;
256
- // if (isScroll && !stateIsScroll) {
257
- // this.setState({ isScroll: true }, () => {
258
- // this.onClearScroll();
259
- // });
260
- // } else if (!isScroll && stateIsScroll) {
261
- // this.setState({ isScroll: false });
262
- // }
188
+ if (fetchData && !noNeedUpScroll) {
189
+ if (fromRef.current !== 0 && scrollTop === 0 && !noNeedUpScroll) {
190
+ scrollContainerObj.scrollTop = scrollTop + offsetHeight / 3;
191
+ } else if (scrollHeight === scrollTop + offsetHeight && !noMoreData) {
192
+ scrollContainerObj.scrollTop = scrollTop - offsetHeight / 2;
193
+ }
194
+ } // if (isScrollShadow) {
195
+ // this.onSetScroll();
263
196
  // }
264
197
 
265
- }, {
266
- key: "render",
267
- value: function render() {
268
- var _this4 = this;
269
-
270
- var _this$props4 = this.props,
271
- onClick = _this$props4.onClick,
272
- children = _this$props4.children,
273
- isScrollAttribute = _this$props4.isScrollAttribute,
274
- dataId = _this$props4.dataId,
275
- eleRef = _this$props4.eleRef,
276
- _this$props4$customCl = _this$props4.customClass,
277
- customClass = _this$props4$customCl === void 0 ? '' : _this$props4$customCl,
278
- htmlId = _this$props4.htmlId,
279
- a11y = _this$props4.a11y;
280
- var isScroll = this.state.isScroll;
281
- var role = a11y.role;
282
- return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
283
- className: "".concat(customClass),
284
- isScrollAttribute: isScrollAttribute,
285
- onClick: onClick,
286
- dataId: dataId,
287
- eleRef: eleRef
288
- }, _react["default"].Children.map(children, function (child) {
289
- if (!child) {
290
- return child;
291
- }
292
-
293
- if (child.type === CardHeader || _this4.props.childTypes && child.type === _this4.props.childTypes.cardHeader) {
294
- return /*#__PURE__*/_react["default"].cloneElement(child, {
295
- isScroll: isScroll
296
- });
297
- } else if (child.type === CardContent || _this4.props.childTypes && child.type === _this4.props.childTypes.cardContent) {
298
- return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
299
- id: htmlId,
300
- role: role,
301
- flexible: true,
302
- scroll: child.props.scroll,
303
- preventParentScroll: child.props.preventParentScroll,
304
- onScroll: _this4.onScroll,
305
- eleRef: child.props.eleRef,
306
- isScrollAttribute: child.props.isScrollAttribute,
307
- dataId: child.props.dataId,
308
- shrink: child.props.shrink,
309
- className: child.props.customClass,
310
- dataSelectorId: child.props.dataSelectorId
311
- }, child.props.children);
312
- }
198
+ } // setScroll(isScroll) {
199
+ // let { isScroll: stateIsScroll } = this.state;
200
+ // if (isScroll && !stateIsScroll) {
201
+ // this.setState({ isScroll: true }, () => {
202
+ // this.onClearScroll();
203
+ // });
204
+ // } else if (!isScroll && stateIsScroll) {
205
+ // this.setState({ isScroll: false });
206
+ // }
207
+ // }
208
+
209
+
210
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
211
+ className: "".concat(customClass),
212
+ isScrollAttribute: isScrollAttribute,
213
+ onClick: onClick,
214
+ dataId: dataId,
215
+ eleRef: eleRef
216
+ }, _react["default"].Children.map(children, function (child) {
217
+ if (!child) {
218
+ return child;
219
+ }
313
220
 
314
- return child;
315
- }));
221
+ if (child.type === CardHeader || props.childTypes && child.type === props.childTypes.cardHeader) {
222
+ return /*#__PURE__*/_react["default"].cloneElement(child, {
223
+ isScroll: isScroll
224
+ });
225
+ } else if (child.type === CardContent || props.childTypes && child.type === props.childTypes.cardContent) {
226
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
227
+ id: htmlId,
228
+ role: role,
229
+ flexible: true,
230
+ scroll: child.props.scroll,
231
+ preventParentScroll: child.props.preventParentScroll,
232
+ onScroll: onCardScroll,
233
+ eleRef: child.props.eleRef,
234
+ isScrollAttribute: child.props.isScrollAttribute,
235
+ dataId: child.props.dataId,
236
+ shrink: child.props.shrink,
237
+ className: child.props.customClass,
238
+ dataSelectorId: child.props.dataSelectorId
239
+ }, child.props.children);
316
240
  }
317
- }]);
318
241
 
319
- return Card;
320
- }(_react.Component);
242
+ return child;
243
+ }));
244
+ }
321
245
 
322
- exports["default"] = Card;
323
246
  Card.propTypes = _propTypes.Card_propTypes;
324
247
  Card.defaultProps = _defaultProps.Card_defaultProps; // if (__DOCS__) {
325
248
  // Card.docs = {
@@ -330,36 +253,17 @@ Card.defaultProps = _defaultProps.Card_defaultProps; // if (__DOCS__) {
330
253
  // };
331
254
  // }
332
255
 
333
- var CardFooter = /*#__PURE__*/function (_Component4) {
334
- _inherits(CardFooter, _Component4);
335
-
336
- var _super4 = _createSuper(CardFooter);
337
-
338
- function CardFooter() {
339
- _classCallCheck(this, CardFooter);
256
+ function CardFooter(props) {
257
+ var children = props.children,
258
+ dataId = props.dataId,
259
+ customClass = props.customClass,
260
+ dataSelectorId = props.dataSelectorId;
261
+ return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
262
+ className: "".concat(customClass),
263
+ dataId: dataId,
264
+ dataSelectorId: dataSelectorId
265
+ }, children);
266
+ }
340
267
 
341
- return _super4.apply(this, arguments);
342
- }
343
-
344
- _createClass(CardFooter, [{
345
- key: "render",
346
- value: function render() {
347
- var _this$props5 = this.props,
348
- children = _this$props5.children,
349
- dataId = _this$props5.dataId,
350
- customClass = _this$props5.customClass,
351
- dataSelectorId = _this$props5.dataSelectorId;
352
- return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
353
- className: "".concat(customClass),
354
- dataId: dataId,
355
- dataSelectorId: dataSelectorId
356
- }, children);
357
- }
358
- }]);
359
-
360
- return CardFooter;
361
- }(_react.Component);
362
-
363
- exports.CardFooter = CardFooter;
364
268
  CardFooter.propTypes = _propTypes.CardFooter_propTypes;
365
269
  CardFooter.defaultProps = _defaultProps.CardFooter_defaultProps;
@@ -13,6 +13,8 @@ var _propTypes = require("../../MultiSelect/props/propTypes");
13
13
 
14
14
  var _defaultProps = require("../../MultiSelect/props/defaultProps");
15
15
 
16
+ var _defaultProps2 = require("../../MultiSelect/MobileHeader/props/defaultProps");
17
+
16
18
  var _Popup = _interopRequireDefault(require("../Popup/Popup"));
17
19
 
18
20
  var _TextBoxIcon = _interopRequireDefault(require("../TextBoxIcon/TextBoxIcon"));
@@ -1095,7 +1097,7 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
1095
1097
  var suggestions = this.handleFilterSuggestions();
1096
1098
  var setAriaId = this.getNextAriaId();
1097
1099
  var ariaErrorId = this.getNextAriaId();
1098
- i18nKeys = Object.assign({}, MobileHeader_defaultProps.i18nKeys, i18nKeys, {
1100
+ i18nKeys = Object.assign({}, _defaultProps2.defaultProps.i18nKeys, i18nKeys, {
1099
1101
  emptyText: i18nKeys.emptyText || emptyMessage,
1100
1102
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
1101
1103
  noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
@@ -13,6 +13,8 @@ var _propTypes = require("../../MultiSelect/props/propTypes");
13
13
 
14
14
  var _defaultProps = require("../../MultiSelect/props/defaultProps");
15
15
 
16
+ var _defaultProps2 = require("../../MultiSelect/MobileHeader/props/defaultProps");
17
+
16
18
  var _MultiSelect = require("./MultiSelect");
17
19
 
18
20
  var _Popup = _interopRequireDefault(require("../Popup/Popup"));
@@ -156,7 +158,7 @@ var MultiSelectWithAvatarComponent = /*#__PURE__*/function (_MultiSelectComponen
156
158
  customProps = _this$props.customProps;
157
159
  var _customProps$Suggesti = customProps.SuggestionsProps,
158
160
  SuggestionsProps = _customProps$Suggesti === void 0 ? {} : _customProps$Suggesti;
159
- i18nKeys = Object.assign({}, MobileHeader_defaultProps.i18nKeys, i18nKeys, {
161
+ i18nKeys = Object.assign({}, _defaultProps2.defaultProps.i18nKeys, i18nKeys, {
160
162
  emptyText: i18nKeys.emptyText || emptyMessage,
161
163
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
162
164
  noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage