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, repositionModal: i, parentsModalsElementsRefs: o, repositionOnParentsModalsResize: s } = e, c = U(document.documentElement), u = k(() => {
20923
+ const { elementRef: t, anchorRef: n, parentsModalsElementsRefs: i, repositionOnParentsModalsResize: o } = e, s = U(document.documentElement), c = k(() => {
20924
20924
  r();
20925
- }, [r]), d = Ke(() => {
20926
- s && i();
20925
+ }, [r]), u = Ke(() => {
20926
+ o && r();
20927
20927
  });
20928
- ya(o, d), ya([t, n, c], u);
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((u) => {
20932
- const { strategy: d, position: f, modal: h, zIndex: p } = u, _ = window.visualViewport?.offsetTop ?? 0, g = window.visualViewport?.offsetLeft ?? 0;
20933
- switch (d) {
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
- h.style.position = "absolute";
20936
- const y = h.offsetParent;
20937
- Ye(y, "Offset parent of Modal");
20938
- const v = y.getBoundingClientRect();
20939
- h.style.top = `${f.top - v.top + _}px`, h.style.left = `${f.left - v.left + g}px`;
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
- h.style.position = "fixed", h.style.top = `${f.top + _}px`, h.style.left = `${f.left + g}px`;
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
- p !== void 0 && (h.style.zIndex = String(p));
20946
- }, []), c = Ke((u = i) => {
20947
- const { strategy: d = "fixed", zIndex: f } = u, h = e.current, p = t.current;
20948
- Ye(h, "Modal"), Ye(p, "Anchor");
20949
- const _ = o(h, p, u);
20950
- s({ position: _, modal: h, strategy: d, zIndex: f });
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(c, i), qH(c, {
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: c
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>>;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "react-components",
12
12
  "ui-kit"
13
13
  ],
14
- "version": "1.1.57",
14
+ "version": "1.1.58",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/types/index.d.ts",