ab-ui-library 1.56.4 → 1.57.1
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.
|
@@ -9,7 +9,7 @@ import { useHideOnResize } from '../../../hooks/useHideOnResize.js';
|
|
|
9
9
|
import { noop } from '../../../utils/helpers.js';
|
|
10
10
|
import { useOnOutsideClick } from '../../../hooks/useOnOutsideClick.js';
|
|
11
11
|
import '../../../hooks/useScreenSize.js';
|
|
12
|
-
import { useGetHasBottomSpace
|
|
12
|
+
import { useGetHasBottomSpace } from '../../../hooks/useGetHasBottomSpace.js';
|
|
13
13
|
import 'react-hook-form';
|
|
14
14
|
import { useRecalculateDropdownPosition } from '../../../hooks/useRecalculateDropdownPosition.js';
|
|
15
15
|
import { Input } from '../../Input/Input.js';
|
|
@@ -285,10 +285,6 @@ var Select = function Select(props) {
|
|
|
285
285
|
input: inputRef.current
|
|
286
286
|
}),
|
|
287
287
|
hasBottomSpace = _useGetHasBottomSpace.hasBottomSpace;
|
|
288
|
-
var hasTopSpace = useGetHasTopSpace({
|
|
289
|
-
element: dropdownRef,
|
|
290
|
-
input: inputRef.current
|
|
291
|
-
});
|
|
292
288
|
useChangePositionsOnScroll({
|
|
293
289
|
parentElement: inputRef === null || inputRef === void 0 ? void 0 : inputRef.current,
|
|
294
290
|
childElement: dropdownRef,
|
|
@@ -354,14 +350,14 @@ var Select = function Select(props) {
|
|
|
354
350
|
style: _objectSpread({
|
|
355
351
|
left: left,
|
|
356
352
|
width: width
|
|
357
|
-
}, hasBottomSpace
|
|
358
|
-
top: bottom
|
|
353
|
+
}, hasBottomSpace ? {
|
|
354
|
+
top: bottom,
|
|
355
|
+
maxHeight: top - DROPDOWN_AND_INPUT_GAP
|
|
359
356
|
} : {
|
|
360
|
-
bottom: window.innerHeight - top + DROPDOWN_AND_INPUT_GAP
|
|
357
|
+
bottom: window.innerHeight - top + DROPDOWN_AND_INPUT_GAP,
|
|
358
|
+
maxHeight: window.innerHeight - bottom - DROPDOWN_AND_INPUT_GAP
|
|
361
359
|
}),
|
|
362
|
-
ref:
|
|
363
|
-
setDropdownRef(_ref2);
|
|
364
|
-
}
|
|
360
|
+
ref: setDropdownRef
|
|
365
361
|
}, isLoading ? /*#__PURE__*/React.createElement(Loading, null) : /*#__PURE__*/React.createElement("div", {
|
|
366
362
|
"data-id": "".concat(dataId, "-options-content"),
|
|
367
363
|
ref: scrollRef,
|
|
@@ -70,14 +70,16 @@ var notify = function notify(toastProps) {
|
|
|
70
70
|
closeSnackbar = toastProps.closeSnackbar,
|
|
71
71
|
actionProps = toastProps.actionProps,
|
|
72
72
|
_toastProps$duration = toastProps.duration,
|
|
73
|
-
duration = _toastProps$duration === void 0 ? DEFAULT_DURATION : _toastProps$duration
|
|
73
|
+
duration = _toastProps$duration === void 0 ? DEFAULT_DURATION : _toastProps$duration,
|
|
74
|
+
autoClose = toastProps.autoClose;
|
|
75
|
+
var shouldAutoClose = autoClose !== undefined ? autoClose : !actionProps;
|
|
74
76
|
toast(function () {
|
|
75
77
|
return CustomToast(toastProps);
|
|
76
78
|
}, {
|
|
77
79
|
bodyClassName: '__body',
|
|
78
80
|
className: '_container',
|
|
79
81
|
toastId: toastId,
|
|
80
|
-
autoClose:
|
|
82
|
+
autoClose: shouldAutoClose ? duration : false
|
|
81
83
|
});
|
|
82
84
|
toast.onChange(function (payload) {
|
|
83
85
|
if (payload.status === 'removed') {
|