dtable-ui-component 7.0.5-pal.11 → 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.
@@ -71,27 +71,13 @@ const AsyncUserSelect = _ref => {
71
71
  setSearchValue('');
72
72
  setHighlightIndex(-1);
73
73
  }, []);
74
- const isEventInsideComponent = (0, _react.useCallback)(target => {
75
- if (!target) return false;
76
- if (selectorRef.current && selectorRef.current.contains(target)) return true;
77
- if (userSelectContainerRef.current && userSelectContainerRef.current.contains(target)) return true;
78
- return false;
79
- }, []);
80
74
  const onClickOutside = (0, _react.useCallback)(e => {
81
- if (isPopoverOpen && !isEventInsideComponent(e.target)) {
75
+ console.log(111);
76
+ if (isPopoverOpen && (!selectorRef.current || !selectorRef.current.contains(e.target))) {
82
77
  setIsPopoverOpen(false);
83
78
  clearStatus();
84
79
  }
85
- }, [isPopoverOpen, clearStatus, isEventInsideComponent]);
86
- const onClickOutsideMenu = (0, _react.useCallback)(event => {
87
- if (isPopoverOpen && (0, _utils.getEventClassName)(event).includes('icon-fork-number')) {
88
- return;
89
- }
90
- if (!isEventInsideComponent(event.target)) {
91
- setIsPopoverOpen(false);
92
- clearStatus();
93
- }
94
- }, [isPopoverOpen, clearStatus, isEventInsideComponent]);
80
+ }, [isPopoverOpen, clearStatus]);
95
81
  const searchUsers = (0, _react.useCallback)(function () {
96
82
  let searchValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
97
83
  const trimmedSearchValue = (searchValue === null || searchValue === void 0 ? void 0 : searchValue.trim()) || '';
@@ -270,51 +256,48 @@ const AsyncUserSelect = _ref => {
270
256
  })]
271
257
  })
272
258
  }), isPopoverOpen && popoverStyle && /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalPortal.default, {
273
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ClickOutside.default, {
274
- onClickOutside: onClickOutsideMenu,
275
- children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
276
- className: "dtable-ui-user-select-popover dtable-ui-user-select-container",
277
- ref: userSelectContainerRef,
278
- style: popoverStyle,
279
- onMouseDown: e => e.stopPropagation(),
280
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
281
- className: "seatable-select-search",
282
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_DTableCustomizeSearchInput.default, {
283
- className: "option-search-control",
284
- placeholder: searchPlaceholder || (0, _lang.getLocale)('Search_users'),
285
- onChange: onSearchValueChanged,
286
- clearValue: () => onSearchValueChanged(''),
287
- autoFocus: true,
288
- isClearable: true,
289
- value: searchValue
290
- })
291
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
292
- className: "dtable-ui-user-list-container",
293
- ref: userListContainerRef,
294
- children: [searchedUsers.length > 0 && searchedUsers.map((user, index) => {
295
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
296
- className: (0, _classnames.default)('dtable-ui-user-item-container', {
297
- 'dtable-ui-user-item-container-highlight': index === highlightIndex
298
- }),
299
- ref: index === 0 ? userItemContainerRef : null,
300
- onClick: () => onUserClick(user),
301
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_userItem.default, {
302
- user: user,
303
- enableShowIDInOrgWhenSearchUser: enableShowIDInOrgWhenSearchUser
304
- }, "dtable-ui-user-selector-searched-user-".concat(index)), selectedUsers.find(u => u.email === user.email) && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
305
- className: "dtable-ui-collaborator-check-icon",
306
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)("i", {
307
- className: "dtable-font dtable-icon-check",
308
- "aria-hidden": "true"
309
- })
310
- })]
311
- }, user.email);
312
- }), searchedUsers.length === 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
313
- className: "no-user-search-result",
314
- children: searchValue ? (0, _lang.getLocale)('User_not_found') : (0, _lang.getLocale)('Enter_characters_to_start_searching')
315
- })]
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')
316
299
  })]
317
- })
300
+ })]
318
301
  })
319
302
  })]
320
303
  })
@@ -28,6 +28,18 @@
28
28
  border-top-right-radius: 4px;
29
29
  }
30
30
 
31
+ .select-search-control:-webkit-autofill,
32
+ .select-search-control:-webkit-autofill:hover,
33
+ .select-search-control:-webkit-autofill:focus,
34
+ .select-search-control:-webkit-autofill:active,
35
+ .select-search-control:-internal-autofill-previewed,
36
+ .select-search-control:-internal-autofill-selected {
37
+ -webkit-box-shadow: inset 0 0 0 1000px var(--bs-popover-bg) !important;
38
+ box-shadow: inset 0 0 0 1000px var(--bs-popover-bg) !important;
39
+ -webkit-text-fill-color: var(--bs-body-color) !important;
40
+ transition: background-color 5000s ease-in-out 0s !important;
41
+ }
42
+
31
43
  .select-search-control:focus {
32
44
  outline: none;
33
45
  box-shadow: none;
@@ -161,7 +161,9 @@
161
161
  }
162
162
 
163
163
  .selector-group-select {
164
- padding: 7px 16px 7px 8px;
164
+ height: auto;
165
+ min-height: 38px;
166
+ padding: 6px 16px 6px 8px;
165
167
  }
166
168
 
167
169
  .selector-group-select .selected-option {
@@ -174,7 +176,3 @@
174
176
  height: auto;
175
177
  min-height: 24px
176
178
  }
177
-
178
- .selector-group-select {
179
- height: auto;
180
- }
@@ -9,7 +9,7 @@
9
9
  color: var(--bs-icon-color);
10
10
  }
11
11
 
12
- .seatable-option .select-option-name .seatable-tip-default {
12
+ .seatable-option .seatable-tip-default {
13
13
  font-size: 12px;
14
14
  margin-top: 4px
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dtable-ui-component",
3
- "version": "7.0.5pal.11",
3
+ "version": "7.0.5pal.16",
4
4
  "main": "./lib/index.js",
5
5
  "dependencies": {
6
6
  "@seafile/react-image-lightbox": "5.0.9",