dtable-ui-component 7.0.5-pal.15 → 7.0.5-pal.17
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.
- package/lib/AsyncUserSelect/index.js +44 -59
- package/package.json +1 -1
|
@@ -73,21 +73,9 @@ const AsyncUserSelect = _ref => {
|
|
|
73
73
|
}, []);
|
|
74
74
|
const onClickOutside = (0, _react.useCallback)(e => {
|
|
75
75
|
console.log(111);
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
}, [isPopoverOpen, clearStatus]);
|
|
81
|
-
const onClickOutsideMenu = (0, _react.useCallback)(event => {
|
|
82
|
-
console.log(222);
|
|
83
|
-
if (isPopoverOpen && (0, _utils.getEventClassName)(event).includes('icon-fork-number')) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (!selectorRef.current.contains(event.target)) {
|
|
87
|
-
setIsPopoverOpen(false);
|
|
88
|
-
clearStatus();
|
|
89
|
-
}
|
|
90
|
-
}, [isPopoverOpen, clearStatus]);
|
|
76
|
+
setIsPopoverOpen(false);
|
|
77
|
+
clearStatus();
|
|
78
|
+
}, [clearStatus]);
|
|
91
79
|
const searchUsers = (0, _react.useCallback)(function () {
|
|
92
80
|
let searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
93
81
|
const trimmedSearchValue = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim()) || '';
|
|
@@ -266,51 +254,48 @@ const AsyncUserSelect = _ref => {
|
|
|
266
254
|
})]
|
|
267
255
|
})
|
|
268
256
|
}), isPopoverOpen && popoverStyle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
|
|
269
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
children:
|
|
277
|
-
className: "
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
className: "dtable-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
className: "no-user-search-result",
|
|
310
|
-
children: searchValue ? (0, _lang.getLocale)('User_not_found') : (0, _lang.getLocale)('Enter_characters_to_start_searching')
|
|
311
|
-
})]
|
|
257
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
258
|
+
className: "dtable-ui-user-select-popover dtable-ui-user-select-container",
|
|
259
|
+
ref: userSelectContainerRef,
|
|
260
|
+
style: popoverStyle,
|
|
261
|
+
onMouseDown: e => e.stopPropagation(),
|
|
262
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
263
|
+
className: "seatable-select-search",
|
|
264
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
|
|
265
|
+
className: "option-search-control",
|
|
266
|
+
placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
|
|
267
|
+
onChange: onSearchValueChanged,
|
|
268
|
+
clearValue: () => onSearchValueChanged(''),
|
|
269
|
+
autoFocus: true,
|
|
270
|
+
isClearable: true,
|
|
271
|
+
value: searchValue
|
|
272
|
+
})
|
|
273
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
274
|
+
className: "dtable-ui-user-list-container",
|
|
275
|
+
ref: userListContainerRef,
|
|
276
|
+
children: [searchedUsers.length > 0 && searchedUsers.map((user, index) => {
|
|
277
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
278
|
+
className: (0, _classnames.default)('dtable-ui-user-item-container', {
|
|
279
|
+
'dtable-ui-user-item-container-highlight': index === highlightIndex
|
|
280
|
+
}),
|
|
281
|
+
ref: index === 0 ? userItemContainerRef : null,
|
|
282
|
+
onClick: () => onUserClick(user),
|
|
283
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
|
|
284
|
+
user: user,
|
|
285
|
+
enableShowIDInOrgWhenSearchUser: enableShowIDInOrgWhenSearchUser
|
|
286
|
+
}, "dtable-ui-user-selector-searched-user-".concat(index)), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
287
|
+
className: "dtable-ui-collaborator-check-icon",
|
|
288
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
|
|
289
|
+
className: "dtable-font dtable-icon-check",
|
|
290
|
+
"aria-hidden": "true"
|
|
291
|
+
})
|
|
292
|
+
})]
|
|
293
|
+
}, user.email);
|
|
294
|
+
}), searchedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
295
|
+
className: "no-user-search-result",
|
|
296
|
+
children: searchValue ? (0, _lang.getLocale)('User_not_found') : (0, _lang.getLocale)('Enter_characters_to_start_searching')
|
|
312
297
|
})]
|
|
313
|
-
})
|
|
298
|
+
})]
|
|
314
299
|
})
|
|
315
300
|
})]
|
|
316
301
|
})
|