indicator-ui 0.0.307 → 0.0.308
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/dist/index.js
CHANGED
|
@@ -41699,15 +41699,15 @@ var DEFAULT_WEIGHTS = [[0.5, 1.5, 0.5], [1, 0, 1], [0.5, 1.5, 0.5]];
|
|
|
41699
41699
|
* Позволяет определить оптимальное положение элемента,
|
|
41700
41700
|
* чтобы он не выходил за пределы видимой области.
|
|
41701
41701
|
*
|
|
41702
|
-
* @param ref Ref на элемент, который нужно позиционировать
|
|
41703
41702
|
* @param [options.parentRef=undfined] Ref на контейнер, относительно которого будет происходить позиционирование. Если не задан, то будет позиционировать относительно изначального положения.
|
|
41704
41703
|
* @param [options.windowRef=window] Ref на контейнер, в области видимости которого будет происходить позиционирование. По умолчанию позиционирует в главном окне (`window`).
|
|
41705
|
-
* @param [options.position='fixed']
|
|
41706
|
-
* @param [options.offset=4]
|
|
41704
|
+
* @param [options.position='fixed']
|
|
41705
|
+
* @param [options.offset=4]
|
|
41707
41706
|
*
|
|
41708
41707
|
* @returns void
|
|
41709
41708
|
*
|
|
41710
41709
|
* @example
|
|
41710
|
+
* @param args
|
|
41711
41711
|
*/
|
|
41712
41712
|
function useSmartPosition() {
|
|
41713
41713
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -41954,6 +41954,12 @@ function useSmartPosition() {
|
|
|
41954
41954
|
(_callbacksMatrix$max$ = (_callbacksMatrix$max$2 = callbacksMatrix[max.pos[0]])[max.pos[1]]) === null || _callbacksMatrix$max$ === void 0 || _callbacksMatrix$max$.call(_callbacksMatrix$max$2);
|
|
41955
41955
|
}
|
|
41956
41956
|
};
|
|
41957
|
+
var configurateObj = function configurateObj() {
|
|
41958
|
+
ref.current.style.position = position;
|
|
41959
|
+
if (position === 'absolute' && parentRef) {
|
|
41960
|
+
parentRef.current.style.position = 'relative';
|
|
41961
|
+
}
|
|
41962
|
+
};
|
|
41957
41963
|
(0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(function () {
|
|
41958
41964
|
var observer = new ResizeObserver(resizeListener);
|
|
41959
41965
|
var clearListeners = function clearListeners() {
|
|
@@ -41968,6 +41974,7 @@ function useSmartPosition() {
|
|
|
41968
41974
|
};
|
|
41969
41975
|
setUpListeners();
|
|
41970
41976
|
resizeListener();
|
|
41977
|
+
configurateObj();
|
|
41971
41978
|
return clearListeners;
|
|
41972
41979
|
}, []);
|
|
41973
41980
|
}
|