@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
|
-
|
|
75
|
+
normalizedKeyword = searchKey.trim().toLowerCase();
|
|
76
|
+
currentLevelGroups = userGroupList.filter(function (userGroup) {
|
|
76
77
|
var _$last2;
|
|
77
|
-
if (groupPath.length === 0)
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
89
|
+
case 8:
|
|
82
90
|
case "end":
|
|
83
91
|
return _context.stop();
|
|
84
92
|
}
|
|
85
93
|
}, _callee);
|
|
86
|
-
})), [
|
|
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, {
|