@aloudata/aloudata-design 2.18.1 → 2.18.2

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.
@@ -55,7 +55,7 @@ var UserGroupSelection = function UserGroupSelection(_ref) {
55
55
  filterUserList = _useState6[0],
56
56
  setFilterUserList = _useState6[1];
57
57
  var getFilterUserList = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
58
- var _$last, nextLevelGroup;
58
+ var _$last, nextLevelGroup, normalizedKeyword, currentLevelGroups;
59
59
  return _regeneratorRuntime().wrap(function _callee$(_context) {
60
60
  while (1) switch (_context.prev = _context.next) {
61
61
  case 0:
@@ -72,18 +72,26 @@ var UserGroupSelection = function UserGroupSelection(_ref) {
72
72
  nextLevelGroup = _context.sent;
73
73
  return _context.abrupt("return", nextLevelGroup);
74
74
  case 5:
75
- return _context.abrupt("return", !!searchKey ? userGroupList : userGroupList.filter(function (userGroup) {
75
+ normalizedKeyword = searchKey.trim().toLowerCase();
76
+ currentLevelGroups = userGroupList.filter(function (userGroup) {
76
77
  var _$last2;
77
- if (groupPath.length === 0) return !userGroup.parentId;else return userGroup.parentId === ((_$last2 = _.last(groupPath)) === null || _$last2 === void 0 ? void 0 : _$last2.groupId);
78
- }).filter(function (group) {
79
- return group.name.toLowerCase().includes(searchKey.trim().toLowerCase());
78
+ if (groupPath.length === 0) {
79
+ return !userGroup.parentId;
80
+ }
81
+ return userGroup.parentId === ((_$last2 = _.last(groupPath)) === null || _$last2 === void 0 ? void 0 : _$last2.groupId);
82
+ });
83
+ return _context.abrupt("return", currentLevelGroups.filter(function (group) {
84
+ if (!normalizedKeyword) {
85
+ return true;
86
+ }
87
+ return group.name.toLowerCase().includes(normalizedKeyword);
80
88
  }));
81
- case 6:
89
+ case 8:
82
90
  case "end":
83
91
  return _context.stop();
84
92
  }
85
93
  }, _callee);
86
- })), [userGroupList, groupPath, searchKey, getNextLevelGroup]);
94
+ })), [isAsync, searchKey, userGroupList, getNextLevelGroup, groupPath]);
87
95
  useEffect(function () {
88
96
  getFilterUserList().then(function (userGroups) {
89
97
  setFilterUserList(userGroups.filter(function (userGroup) {
@@ -93,7 +101,7 @@ var UserGroupSelection = function UserGroupSelection(_ref) {
93
101
  return true;
94
102
  }));
95
103
  });
96
- }, [getFilterUserList]);
104
+ }, [filterItem, getFilterUserList]);
97
105
  return /*#__PURE__*/React.createElement("div", {
98
106
  className: classNames(className, 'ald-member-picker-member-list-wrap')
99
107
  }, /*#__PURE__*/React.createElement(Input, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aloudata/aloudata-design",
3
- "version": "2.18.1",
3
+ "version": "2.18.2",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "module": "dist/index.js",