intelicoreact 1.1.22 → 1.1.24

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.
@@ -353,13 +353,37 @@ var Dropdown = function Dropdown(_ref) {
353
353
  };
354
354
 
355
355
  var getListMarkUp = function getListMarkUp() {
356
+ var _getSortedOptions;
357
+
356
358
  return /*#__PURE__*/_react.default.createElement("div", {
357
359
  className: (0, _classnames.default)("".concat(RC, "__list"), (0, _defineProperty2.default)({}, "".concat(RC, "__list-top"), isListTop)),
358
360
  ref: dropdownListRef
359
- }, getSortedOptions(depend.options).map(function (filteredOption) {
360
- var _filteredOption$items2;
361
+ }, (_getSortedOptions = getSortedOptions(depend.options)) === null || _getSortedOptions === void 0 ? void 0 : _getSortedOptions.map(function (option) {
362
+ var _option$items;
363
+
364
+ if (option !== null && option !== void 0 && (_option$items = option.items) !== null && _option$items !== void 0 && _option$items.length) {
365
+ if (!isSearchable || !isSearchChanged) {
366
+ return filteredOptionList(option);
367
+ } else {
368
+ var _option$items2;
369
+
370
+ var items = (_option$items2 = option.items) === null || _option$items2 === void 0 ? void 0 : _option$items2.slice().filter(function (el) {
371
+ var _el$label2;
372
+
373
+ return (el === null || el === void 0 ? void 0 : (_el$label2 = el.label) === null || _el$label2 === void 0 ? void 0 : _el$label2.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) === '';
374
+ });
375
+ if (items !== null && items !== void 0 && items.length) return filteredOptionList(_objectSpread(_objectSpread({}, option), {}, {
376
+ items: items
377
+ }));
378
+ return null;
379
+ }
380
+ } else {
381
+ var _option$label;
361
382
 
362
- return (_filteredOption$items2 = filteredOption.items) !== null && _filteredOption$items2 !== void 0 && _filteredOption$items2.length ? filteredOptionList(filteredOption) : getMarkupForElement(filteredOption);
383
+ if (!isSearchable || !isSearchChanged || option !== null && option !== void 0 && (_option$label = option.label) !== null && _option$label !== void 0 && _option$label.toLowerCase().includes((searchValue === null || searchValue === void 0 ? void 0 : searchValue.toLowerCase()) || '') || !(option !== null && option !== void 0 && option.value) || (option === null || option === void 0 ? void 0 : option.value) === '') {
384
+ return getMarkupForElement(option);
385
+ }
386
+ }
363
387
  }), !filteredItems.length && !filteredGroups.length && /*#__PURE__*/_react.default.createElement("div", {
364
388
  className: "".concat(RC, "__list-item ").concat(RC, "__list-item--no-options")
365
389
  }, noOptionsText), disabled && isOpen && /*#__PURE__*/_react.default.createElement(_DropdownLoader.default, null));
@@ -433,7 +457,9 @@ var Dropdown = function Dropdown(_ref) {
433
457
  }
434
458
  }, [isSearchInputFocused]);
435
459
  (0, _react.useEffect)(function () {
436
- if (isOpen && !isSearchInputFocused) searchInputRef.current.focus();
460
+ var _searchInputRef$curre;
461
+
462
+ if (isOpen && !isSearchInputFocused && searchInputRef !== null && searchInputRef !== void 0 && searchInputRef.current) searchInputRef === null || searchInputRef === void 0 ? void 0 : (_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 ? void 0 : _searchInputRef$curre.focus();
437
463
  }, [isOpen]);
438
464
  var postfixText = selectedLabel && ((_filteredOptions$find = filteredOptions.find(function (option) {
439
465
  return option.value === value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intelicoreact",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [