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.
@@ -73,21 +73,9 @@ const AsyncUserSelect = _ref => {
73
73
  }, []);
74
74
  const onClickOutside = (0, _react.useCallback)(e => {
75
75
  console.log(111);
76
- if (isPopoverOpen && (!selectorRef.current || !selectorRef.current.contains(e.target))) {
77
- setIsPopoverOpen(false);
78
- clearStatus();
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.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
- })]
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
  })
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.17",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",