indicator-ui 1.1.57 → 1.1.58
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
|
@@ -20920,43 +20920,48 @@ function HH(r, e) {
|
|
|
20920
20920
|
}, [e]);
|
|
20921
20921
|
}
|
|
20922
20922
|
function qH(r, e) {
|
|
20923
|
-
const { elementRef: t, anchorRef: n,
|
|
20923
|
+
const { elementRef: t, anchorRef: n, parentsModalsElementsRefs: i, repositionOnParentsModalsResize: o } = e, s = U(document.documentElement), c = k(() => {
|
|
20924
20924
|
r();
|
|
20925
|
-
}, [r]),
|
|
20926
|
-
|
|
20925
|
+
}, [r]), u = Ke(() => {
|
|
20926
|
+
o && r();
|
|
20927
20927
|
});
|
|
20928
|
-
ya(
|
|
20928
|
+
ya(i, u), ya([t, n, s], c);
|
|
20929
20929
|
}
|
|
20930
20930
|
function $H(r) {
|
|
20931
|
-
const { modalRef: e, anchorRef: t, parentsModalsElementsRefs: n, options: i } = r, { calcAnchoredPosition: o } = WH(), s = k((
|
|
20932
|
-
const { strategy:
|
|
20933
|
-
switch (
|
|
20931
|
+
const { modalRef: e, anchorRef: t, parentsModalsElementsRefs: n, options: i } = r, { calcAnchoredPosition: o } = WH(), s = k((_) => {
|
|
20932
|
+
const { strategy: g, position: y, modal: v, zIndex: w } = _, S = window.visualViewport?.offsetTop ?? 0, x = window.visualViewport?.offsetLeft ?? 0;
|
|
20933
|
+
switch (g) {
|
|
20934
20934
|
case "absolute":
|
|
20935
|
-
|
|
20936
|
-
const
|
|
20937
|
-
Ye(
|
|
20938
|
-
const
|
|
20939
|
-
|
|
20935
|
+
v.style.position = "absolute";
|
|
20936
|
+
const T = v.offsetParent;
|
|
20937
|
+
Ye(T, "Offset parent of Modal");
|
|
20938
|
+
const b = T.getBoundingClientRect();
|
|
20939
|
+
v.style.top = `${y.top - b.top + S}px`, v.style.left = `${y.left - b.left + x}px`;
|
|
20940
20940
|
break;
|
|
20941
20941
|
case "fixed":
|
|
20942
|
-
|
|
20942
|
+
v.style.position = "fixed", v.style.top = `${y.top + S}px`, v.style.left = `${y.left + x}px`;
|
|
20943
20943
|
break;
|
|
20944
20944
|
}
|
|
20945
|
-
|
|
20946
|
-
}, []),
|
|
20947
|
-
|
|
20948
|
-
|
|
20949
|
-
|
|
20950
|
-
|
|
20945
|
+
w !== void 0 && (v.style.zIndex = String(w));
|
|
20946
|
+
}, []), {
|
|
20947
|
+
windowScrollBehavior: c,
|
|
20948
|
+
scrollableParentBehavior: u,
|
|
20949
|
+
closeOnClickOutside: d,
|
|
20950
|
+
repositionOnParentsModalsResize: f,
|
|
20951
|
+
...h
|
|
20952
|
+
} = i, p = Ke((_ = h) => {
|
|
20953
|
+
const { strategy: g = "fixed", zIndex: y } = _, v = e.current, w = t.current;
|
|
20954
|
+
Ye(v, "Modal"), Ye(w, "Anchor");
|
|
20955
|
+
const S = o(v, w, _);
|
|
20956
|
+
s({ position: S, modal: v, strategy: g, zIndex: y });
|
|
20951
20957
|
});
|
|
20952
|
-
return HH(
|
|
20958
|
+
return HH(p, h), qH(p, {
|
|
20953
20959
|
anchorRef: t,
|
|
20954
20960
|
elementRef: e,
|
|
20955
|
-
repositionModal: c,
|
|
20956
20961
|
parentsModalsElementsRefs: n,
|
|
20957
20962
|
repositionOnParentsModalsResize: i.repositionOnParentsModalsResize
|
|
20958
20963
|
}), {
|
|
20959
|
-
applyPosition:
|
|
20964
|
+
applyPosition: p
|
|
20960
20965
|
};
|
|
20961
20966
|
}
|
|
20962
20967
|
const YH = {
|
|
@@ -2,7 +2,6 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { UseAnchoredModalOptions } from '../types';
|
|
3
3
|
type Callback = () => void;
|
|
4
4
|
type OptionsType = Pick<UseAnchoredModalOptions, 'repositionOnParentsModalsResize'> & {
|
|
5
|
-
repositionModal: () => void;
|
|
6
5
|
anchorRef: React.RefObject<HTMLElement | null>;
|
|
7
6
|
elementRef: React.RefObject<HTMLElement | null>;
|
|
8
7
|
parentsModalsElementsRefs: Array<React.RefObject<HTMLElement | null>>;
|