intelicoreact 1.2.86 → 1.2.87

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.
@@ -144,10 +144,10 @@ var Dropdown = function Dropdown(_ref) {
144
144
  if (!options) return null;
145
145
  var getTotalOptions = (0, _react.useCallback)(function () {
146
146
  return options === null || options === void 0 ? void 0 : options.reduce(function (result, item) {
147
- if (item !== null && item !== void 0 && item.list) {
148
- var _item$list;
147
+ if (item !== null && item !== void 0 && item.list || item !== null && item !== void 0 && item.items) {
148
+ var _item$list, _item$items;
149
149
 
150
- result += (item === null || item === void 0 ? void 0 : (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || 0;
150
+ result += (item === null || item === void 0 ? void 0 : (_item$list = item.list) === null || _item$list === void 0 ? void 0 : _item$list.length) || (item === null || item === void 0 ? void 0 : (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.length) || 0;
151
151
  } else {
152
152
  ++result;
153
153
  }
@@ -177,24 +177,24 @@ var Dropdown = function Dropdown(_ref) {
177
177
  } else return option;
178
178
  });
179
179
  var filteredGroups = optionsWithOtherAtTheEnd.map(function (item) {
180
- var _item$items;
180
+ var _item$items2;
181
181
 
182
182
  return _objectSpread(_objectSpread({}, item), {}, {
183
- items: !isSearchable || !isSearchChanged ? item === null || item === void 0 ? void 0 : item.items : (_item$items = item.items) === null || _item$items === void 0 ? void 0 : _item$items.slice().filter(function (el) {
183
+ items: !isSearchable || !isSearchChanged ? item === null || item === void 0 ? void 0 : item.items : (_item$items2 = item.items) === null || _item$items2 === void 0 ? void 0 : _item$items2.slice().filter(function (el) {
184
184
  var _el$label;
185
185
 
186
186
  return (el === null || el === void 0 ? void 0 : (_el$label = el.label) === null || _el$label === void 0 ? void 0 : _el$label.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '')) || !(el !== null && el !== void 0 && el.value) || (el === null || el === void 0 ? void 0 : el.value) === '';
187
187
  })
188
188
  });
189
189
  }).filter(function (item) {
190
- var _item$items2;
190
+ var _item$items3;
191
191
 
192
- return ((_item$items2 = item.items) === null || _item$items2 === void 0 ? void 0 : _item$items2.length) > 0;
192
+ return ((_item$items3 = item.items) === null || _item$items3 === void 0 ? void 0 : _item$items3.length) > 0;
193
193
  });
194
194
  var filteredItems = optionsWithOtherAtTheEnd.filter(function (item) {
195
- var _item$items3;
195
+ var _item$items4;
196
196
 
197
- return !((_item$items3 = item.items) !== null && _item$items3 !== void 0 && _item$items3.length);
197
+ return !((_item$items4 = item.items) !== null && _item$items4 !== void 0 && _item$items4.length);
198
198
  }).filter(function (item) {
199
199
  var _item$label;
200
200
 
@@ -322,11 +322,11 @@ var Dropdown = function Dropdown(_ref) {
322
322
  var selectedLabel = ((_options$find = options.find(function (el) {
323
323
  return el.value === value;
324
324
  })) === null || _options$find === void 0 ? void 0 : _options$find.label) || options.reduce(function (acc, item) {
325
- var _item$items4, _item$items4$find;
325
+ var _item$items5, _item$items5$find;
326
326
 
327
- return acc || ((_item$items4 = item.items) === null || _item$items4 === void 0 ? void 0 : (_item$items4$find = _item$items4.find(function (el) {
327
+ return acc || ((_item$items5 = item.items) === null || _item$items5 === void 0 ? void 0 : (_item$items5$find = _item$items5.find(function (el) {
328
328
  return el.value === value;
329
- })) === null || _item$items4$find === void 0 ? void 0 : _item$items4$find.label);
329
+ })) === null || _item$items5$find === void 0 ? void 0 : _item$items5$find.label);
330
330
  }, null);
331
331
  var doScrollCallback = (0, _react.useCallback)(function (e) {
332
332
  var _ref2 = scrollReactionObj || {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.2.86",
3
+ "version": "1.2.87",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [