dtable-ui-component 7.0.5-pal.15 → 7.0.5-pal.16

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.
@@ -78,16 +78,6 @@ const AsyncUserSelect = _ref => {
78
78
  clearStatus();
79
79
  }
80
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]);
91
81
  const searchUsers = (0, _react.useCallback)(function () {
92
82
  let searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
93
83
  const trimmedSearchValue = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim()) || '';
@@ -266,51 +256,48 @@ const AsyncUserSelect = _ref => {
266
256
  })]
267
257
  })
268
258
  }), isPopoverOpen && popoverStyle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
269
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
270
- onClickOutside: onClickOutsideMenu,
271
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
272
- className: "dtable-ui-user-select-popover dtable-ui-user-select-container",
273
- ref: userSelectContainerRef,
274
- style: popoverStyle,
275
- onMouseDown: e => e.stopPropagation(),
276
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
277
- className: "seatable-select-search",
278
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
279
- className: "option-search-control",
280
- placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
281
- onChange: onSearchValueChanged,
282
- clearValue: () => onSearchValueChanged(''),
283
- autoFocus: true,
284
- isClearable: true,
285
- value: searchValue
286
- })
287
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
288
- className: "dtable-ui-user-list-container",
289
- ref: userListContainerRef,
290
- children: [searchedUsers.length > 0 && searchedUsers.map((user, index) => {
291
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
292
- className: (0, _classnames.default)('dtable-ui-user-item-container', {
293
- 'dtable-ui-user-item-container-highlight': index === highlightIndex
294
- }),
295
- ref: index === 0 ? userItemContainerRef : null,
296
- onClick: () => onUserClick(user),
297
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
298
- user: user,
299
- enableShowIDInOrgWhenSearchUser: enableShowIDInOrgWhenSearchUser
300
- }, "dtable-ui-user-selector-searched-user-".concat(index)), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
301
- className: "dtable-ui-collaborator-check-icon",
302
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
303
- className: "dtable-font dtable-icon-check",
304
- "aria-hidden": "true"
305
- })
306
- })]
307
- }, user.email);
308
- }), searchedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
309
- className: "no-user-search-result",
310
- children: searchValue ? (0, _lang.getLocale)('User_not_found') : (0, _lang.getLocale)('Enter_characters_to_start_searching')
311
- })]
259
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
260
+ className: "dtable-ui-user-select-popover dtable-ui-user-select-container",
261
+ ref: userSelectContainerRef,
262
+ style: popoverStyle,
263
+ onMouseDown: e => e.stopPropagation(),
264
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
265
+ className: "seatable-select-search",
266
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
267
+ className: "option-search-control",
268
+ placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
269
+ onChange: onSearchValueChanged,
270
+ clearValue: () => onSearchValueChanged(''),
271
+ autoFocus: true,
272
+ isClearable: true,
273
+ value: searchValue
274
+ })
275
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
276
+ className: "dtable-ui-user-list-container",
277
+ ref: userListContainerRef,
278
+ children: [searchedUsers.length > 0 && searchedUsers.map((user, index) => {
279
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
280
+ className: (0, _classnames.default)('dtable-ui-user-item-container', {
281
+ 'dtable-ui-user-item-container-highlight': index === highlightIndex
282
+ }),
283
+ ref: index === 0 ? userItemContainerRef : null,
284
+ onClick: () => onUserClick(user),
285
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
286
+ user: user,
287
+ enableShowIDInOrgWhenSearchUser: enableShowIDInOrgWhenSearchUser
288
+ }, "dtable-ui-user-selector-searched-user-".concat(index)), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
289
+ className: "dtable-ui-collaborator-check-icon",
290
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
291
+ className: "dtable-font dtable-icon-check",
292
+ "aria-hidden": "true"
293
+ })
294
+ })]
295
+ }, user.email);
296
+ }), searchedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
297
+ className: "no-user-search-result",
298
+ children: searchValue ? (0, _lang.getLocale)('User_not_found') : (0, _lang.getLocale)('Enter_characters_to_start_searching')
312
299
  })]
313
- })
300
+ })]
314
301
  })
315
302
  })]
316
303
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "7.0.5pal.15",
3
+ "version": "7.0.5pal.16",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",