@kommo-crm/crm-react-ui-kit 1.1.1-beta.6 → 1.1.1-beta.7

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.
Files changed (40) hide show
  1. package/dist/components/ContextMenu/ContextMenu.context.d.ts +4 -2
  2. package/dist/components/ContextMenu/ContextMenu.context.d.ts.map +1 -1
  3. package/dist/components/ContextMenu/ContextMenu.context.js +7 -4
  4. package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
  5. package/dist/components/ContextMenu/ContextMenu.js +83 -80
  6. package/dist/components/ContextMenu/ContextMenu.props.d.ts +14 -0
  7. package/dist/components/ContextMenu/ContextMenu.props.d.ts.map +1 -1
  8. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +1 -1
  9. package/dist/components/ContextMenu/components/Content/Content.d.ts.map +1 -1
  10. package/dist/components/ContextMenu/components/Content/Content.js +1 -1
  11. package/dist/components/ContextMenu/components/Content/index.js +1 -1
  12. package/dist/components/ContextMenu/components/Item/Item.d.ts.map +1 -1
  13. package/dist/components/ContextMenu/components/Item/Item.js +75 -71
  14. package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +1 -1
  15. package/dist/components/ContextMenu/components/Sub/Sub.js +2 -1
  16. package/dist/components/ContextMenu/components/SubRoot/SubRoot.d.ts.map +1 -1
  17. package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +67 -64
  18. package/dist/components/ContextMenu/components/SubRoot/SubRoot.props.d.ts +4 -0
  19. package/dist/components/ContextMenu/components/SubRoot/SubRoot.props.d.ts.map +1 -1
  20. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +1 -1
  21. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.d.ts.map +1 -1
  22. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +38 -40
  23. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +2 -2
  24. package/dist/components/ContextMenu/hooks/index.js +1 -1
  25. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +1 -1
  26. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts +2 -1
  27. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts.map +1 -1
  28. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +72 -61
  29. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.types.d.ts +4 -0
  30. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.types.d.ts.map +1 -1
  31. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts.map +1 -1
  32. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +51 -49
  33. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts +1 -1
  34. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts.map +1 -1
  35. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +71 -63
  36. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.types.d.ts +4 -0
  37. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.types.d.ts.map +1 -1
  38. package/dist/components/ContextMenu/index.js +1 -1
  39. package/dist/{useContentPositioning-DO7ZotnD.mjs → useContentPositioning-DAKfbddS.mjs} +66 -65
  40. package/package.json +1 -1
@@ -1,67 +1,69 @@
1
- import { useId as A, useState as n, useRef as M, useEffect as v } from "react";
2
- import { ContextMenuMode as a } from "../../ContextMenu.enums.js";
3
- import { useLevelContext as S } from "../../providers/LevelProvider/LevelProvider.js";
4
- import "../../../../useContentPositioning-DO7ZotnD.mjs";
1
+ import { useId as S, useState as C, useRef as v, useEffect as I } from "react";
2
+ import { ContextMenuMode as c } from "../../ContextMenu.enums.js";
3
+ import { useLevelContext as q } from "../../providers/LevelProvider/LevelProvider.js";
4
+ import { useContextMenuContext as j, useContextMenuRootContext as w } from "../../ContextMenu.context.js";
5
+ import "../../../../useContentPositioning-DAKfbddS.mjs";
5
6
  import "../../components/Content/Content.utils.js";
6
- import { useIsTouchDevice as q } from "../useIsTouchDevice/useIsTouchDevice.js";
7
- import { useContextMenuContext as j } from "../../ContextMenu.context.js";
8
- function Q({
9
- displayName: d,
10
- mode: H,
11
- defaultOpen: c,
7
+ import { useIsTouchDevice as z } from "../useIsTouchDevice/useIsTouchDevice.js";
8
+ function X({
9
+ displayName: T,
10
+ mode: y,
11
+ defaultOpen: l,
12
12
  onOpen: e
13
13
  }) {
14
- const C = A(), [o, u] = n(c || !1), [K, s] = n(!1), [T, m] = n(!1), [I, i] = n(!1), r = M(null), t = M(null), V = q(), { hoverCloseDelay: h, animationDuration: b } = j(d), { activeItemId: R } = S(d), l = V ? a.CLICK : H, E = () => {
15
- r.current && (clearTimeout(r.current), r.current = null), t.current && (clearTimeout(t.current), t.current = null);
14
+ const d = S(), [s, i] = C(l || !1), [H, f] = C(!1), [R, m] = C(!1), [x, o] = C(!1), t = v(null), r = v(null), V = z(), { hoverCloseDelay: E, animationDuration: b } = j(T), { onChildClickOpen: n } = w(T), { activeItemId: K } = q(T), u = V ? c.CLICK : y, M = () => {
15
+ t.current && (clearTimeout(t.current), t.current = null), r.current && (clearTimeout(r.current), r.current = null);
16
16
  }, D = () => {
17
- E(), s(!1), u(!1), e == null || e(!1), m(!1), i(!1);
18
- }, x = () => {
19
- E(), l === a.HOVER ? (s(!1), t.current = setTimeout(() => {
20
- u(!1), e == null || e(!1), m(!1), i(!1);
21
- }, b)) : (u(!1), e == null || e(!1), m(!1), i(!1));
22
- }, y = (f) => {
23
- if (c !== void 0) {
24
- u(c), e == null || e(c), s(c), i(!1);
17
+ M(), f(!1), i(!1), e == null || e(!1), m(!1), o(!1);
18
+ }, h = () => {
19
+ M(), u === c.HOVER ? (f(!1), r.current = setTimeout(() => {
20
+ i(!1), e == null || e(!1), m(!1), o(!1);
21
+ }, b)) : (i(!1), e == null || e(!1), m(!1), o(!1));
22
+ }, L = (a) => {
23
+ if (l !== void 0) {
24
+ i(l), e == null || e(l), f(l), o(!1);
25
25
  return;
26
26
  }
27
- if (l === a.CLICK) {
28
- u(f), e == null || e(f), s(f);
27
+ if (u === c.CLICK) {
28
+ i(a), e == null || e(a), f(a);
29
29
  return;
30
30
  }
31
- f ? (t.current && (clearTimeout(t.current), t.current = null), l === a.HOVER && s(!0), u(!0), e == null || e(!0)) : x();
32
- }, L = (f) => {
33
- i(f), y(f);
34
- }, g = () => {
35
- l === a.HOVER && (i(!1), t.current && (clearTimeout(t.current), t.current = null, s(!0)), o || (r.current && (clearTimeout(r.current), r.current = null), s(!0), e == null || e(!0), u(!0)), m(!0));
31
+ a ? (r.current && (clearTimeout(r.current), r.current = null), u === c.HOVER && f(!0), i(!0), e == null || e(!0)) : h();
32
+ }, g = (a) => {
33
+ o(a), L(a);
36
34
  }, B = () => {
37
- l === a.HOVER && (i(!1), r.current && (clearTimeout(r.current), r.current = null), m(!1));
35
+ u === c.HOVER && (o(!1), r.current && (clearTimeout(r.current), r.current = null, f(!0)), s || (t.current && (clearTimeout(t.current), t.current = null), f(!0), e == null || e(!0), i(!0)), m(!0));
36
+ }, A = () => {
37
+ u === c.HOVER && (o(!1), t.current && (clearTimeout(t.current), t.current = null), m(!1));
38
38
  };
39
- return v(() => {
40
- R !== C && o && c === void 0 && D();
41
- }, [R, o, c]), v(() => {
42
- if (!(!o || l !== a.HOVER) && !I) {
43
- if (T) {
44
- r.current && (clearTimeout(r.current), r.current = null);
39
+ return I(() => {
40
+ K !== d && s && l === void 0 && D();
41
+ }, [K, s, l]), I(() => {
42
+ if (!(!s || u !== c.HOVER) && !x) {
43
+ if (R) {
44
+ t.current && (clearTimeout(t.current), t.current = null);
45
45
  return;
46
46
  }
47
- return r.current || (r.current = setTimeout(() => {
48
- x();
49
- }, h)), () => {
50
- r.current && (clearTimeout(r.current), r.current = null);
47
+ return t.current || (t.current = setTimeout(() => {
48
+ h();
49
+ }, E)), () => {
50
+ t.current && (clearTimeout(t.current), t.current = null);
51
51
  };
52
52
  }
53
- }, [l, o, T, h, I]), {
54
- open: o,
55
- setOpen: u,
56
- animatedOpen: K,
57
- startAnimation: () => s(!0),
58
- handleMouseEnter: g,
59
- handleMouseLeave: B,
60
- handleOpenChange: y,
61
- onOpenByKeyboard: L,
62
- triggerId: C
53
+ }, [u, s, R, E, x]), I(() => {
54
+ u === c.CLICK && s ? n == null || n(!0) : u === c.CLICK && !s && (n == null || n(!1));
55
+ }, [s, u]), {
56
+ open: s,
57
+ setOpen: i,
58
+ animatedOpen: H,
59
+ startAnimation: () => f(!0),
60
+ handleMouseEnter: B,
61
+ handleMouseLeave: A,
62
+ handleOpenChange: L,
63
+ onOpenByKeyboard: g,
64
+ triggerId: d
63
65
  };
64
66
  }
65
67
  export {
66
- Q as useContextMenuSub
68
+ X as useContextMenuSub
67
69
  };
@@ -1,6 +1,6 @@
1
1
  import { ContextMenuMode } from '../../ContextMenu.enums';
2
2
  import { UseContextMenuSubMenuOptions } from './useContextMenuSubMenu.types';
3
- export declare const useContextMenuSubMenu: ({ displayName, mode: rootMode, defaultOpen, animationDuration, subMenuOpen, setSubMenuOpen, hoverCloseDelay, closeRootMenuImmediately, onOpen, }: UseContextMenuSubMenuOptions) => {
3
+ export declare const useContextMenuSubMenu: ({ displayName, mode: rootMode, defaultOpen, animationDuration, subMenuOpen, setSubMenuOpen, hoverCloseDelay, closeRootMenuImmediately, onOpen, onAnimatedOpen, }: UseContextMenuSubMenuOptions) => {
4
4
  open: boolean;
5
5
  mode: "click" | "hover" | ContextMenuMode;
6
6
  onOpenChange: (value: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"useContextMenuSubMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,eAAO,MAAM,qBAAqB,qJAU/B,4BAA4B;;;0BAyFI,OAAO;8BAyBP,OAAO;;;;;;;;2CAzCK,OAAO;;;;;CA4KrD,CAAC"}
1
+ {"version":3,"file":"useContextMenuSubMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAM1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,eAAO,MAAM,qBAAqB,qKAW/B,4BAA4B;;;0BA2FI,OAAO;8BA6BP,OAAO;;;;;;;;2CA7CK,OAAO;;;;;CAuLrD,CAAC"}
@@ -1,72 +1,80 @@
1
- import { useId as Q, useState as C, useRef as v, useLayoutEffect as U, useEffect as R } from "react";
2
- import { ContextMenuMode as a } from "../../ContextMenu.enums.js";
3
- import { useInheritedArrowColor as W } from "../useInheritedArrowColor/useInheritedArrowColor.js";
4
- import "../../../../useContentPositioning-DO7ZotnD.mjs";
1
+ import { useId as $, useState as m, useRef as H, useLayoutEffect as k, useEffect as g } from "react";
2
+ import { ContextMenuMode as u } from "../../ContextMenu.enums.js";
3
+ import { useInheritedArrowColor as y } from "../useInheritedArrowColor/useInheritedArrowColor.js";
4
+ import "../../../../useContentPositioning-DAKfbddS.mjs";
5
5
  import "../../components/Content/Content.utils.js";
6
- import "../../ContextMenu.context.js";
7
- import { useLevelContext as X } from "../../providers/LevelProvider/LevelProvider.js";
8
- import { useIsTouchDevice as Y } from "../useIsTouchDevice/useIsTouchDevice.js";
9
- const tr = ({
10
- displayName: j,
11
- mode: k,
12
- defaultOpen: K,
13
- animationDuration: V,
14
- subMenuOpen: m,
6
+ import { useContextMenuRootContext as A } from "../../ContextMenu.context.js";
7
+ import { useLevelContext as N } from "../../providers/LevelProvider/LevelProvider.js";
8
+ import { useIsTouchDevice as n } from "../useIsTouchDevice/useIsTouchDevice.js";
9
+ const er = ({
10
+ displayName: B,
11
+ mode: J,
12
+ defaultOpen: I,
13
+ animationDuration: w,
14
+ subMenuOpen: C,
15
15
  setSubMenuOpen: t,
16
- hoverCloseDelay: E,
17
- closeRootMenuImmediately: u,
18
- onOpen: e
16
+ hoverCloseDelay: d,
17
+ closeRootMenuImmediately: a,
18
+ onOpen: c,
19
+ onAnimatedOpen: x
19
20
  }) => {
20
- const H = Q(), [i, y] = C(m || K || !1), [g, l] = C(!1), [x, T] = C(!1), [z, h] = C(!1), [o, L] = C(!1), { activeItemId: n } = X(j), D = v(null), A = v(null), r = v(null), c = v(null), f = Y() ? a.CLICK : k, B = () => {
21
- r.current && (clearTimeout(r.current), r.current = null), c.current && (clearTimeout(c.current), c.current = null);
22
- }, I = (s = !1) => {
23
- t == null || t(!1), y(!1), e == null || e(!1), T(!1), L(!1), s && (u == null || u());
24
- }, w = () => {
25
- B(), f === a.HOVER || o ? (l(!1), c.current = setTimeout(() => {
26
- I();
27
- }, V)) : I();
28
- }, q = (s = !1) => {
29
- B(), l(!1), t == null || t(!1), e == null || e(!1), T(!1), L(!1), s && (u == null || u());
30
- }, d = (s) => {
31
- f === a.CLICK && K !== void 0 || (s ? (c.current && (clearTimeout(c.current), c.current = null), (f === a.HOVER || o) && l(!0), t == null || t(!0), e == null || e(!0)) : w());
32
- }, F = (s) => {
33
- h(s), d == null || d(s);
34
- }, G = () => {
35
- h(!1), !(f !== a.HOVER && !o) && (c.current && (clearTimeout(c.current), c.current = null, l(!0)), i || (r.current && (clearTimeout(r.current), r.current = null), l(!0), t == null || t(!0), e == null || e(!0)), T(!0));
36
- }, J = () => {
37
- h(!1), !(f !== a.HOVER && !o) && (r.current && (clearTimeout(r.current), r.current = null), T(!1));
38
- }, N = () => {
39
- l(!0), T(!0), L(!0);
21
+ const L = $(), [o, P] = m(C || I || !1), [v, i] = m(!1), [R, T] = m(!1), [Q, h] = m(!1), [l, K] = m(!1), { activeItemId: q } = N(B), { onChildClickOpen: V } = A(B), U = H(null), j = H(null), r = H(null), f = H(null), s = n() ? u.CLICK : J, z = () => {
22
+ r.current && (clearTimeout(r.current), r.current = null), f.current && (clearTimeout(f.current), f.current = null);
23
+ }, D = (e = !1) => {
24
+ t == null || t(!1), P(!1), c == null || c(!1), T(!1), K(!1), e && (a == null || a());
25
+ }, F = () => {
26
+ z(), s === u.HOVER || l ? (i(!1), f.current = setTimeout(() => {
27
+ D();
28
+ }, w)) : D();
29
+ }, G = (e = !1) => {
30
+ z(), i(!1), t == null || t(!1), c == null || c(!1), T(!1), K(!1), e && (a == null || a());
31
+ }, E = (e) => {
32
+ if (s === u.CLICK) {
33
+ if (I !== void 0)
34
+ return;
35
+ V == null || V(e);
36
+ }
37
+ e ? (f.current && (clearTimeout(f.current), f.current = null), (s === u.HOVER || l) && i(!0), t == null || t(!0), c == null || c(!0)) : F();
38
+ }, W = (e) => {
39
+ h(e), E == null || E(e);
40
+ }, X = () => {
41
+ h(!1), !(s !== u.HOVER && !l) && (f.current && (clearTimeout(f.current), f.current = null, i(!0)), o || (r.current && (clearTimeout(r.current), r.current = null), i(!0), t == null || t(!0), c == null || c(!0)), T(!0));
42
+ }, Y = () => {
43
+ h(!1), !(s !== u.HOVER && !l) && (r.current && (clearTimeout(r.current), r.current = null), T(!1));
44
+ }, Z = () => {
45
+ i(!0), T(!0), K(!0);
40
46
  };
41
- U(() => {
42
- m !== void 0 && l(m);
43
- }, [m]), R(() => {
44
- n !== H && (i || m) && q();
45
- }, [n, i, H]), R(() => {
46
- !i && !g || f !== a.HOVER && !o || z || (x ? r.current && (clearTimeout(r.current), r.current = null) : r.current || (r.current = setTimeout(() => {
47
- w();
48
- }, E)));
49
- }, [f, i, x, o, E]);
50
- const P = W(i, A);
47
+ k(() => {
48
+ C !== void 0 && i(C);
49
+ }, [C]), g(() => {
50
+ q !== L && (o || C) && G();
51
+ }, [q, o, L]), g(() => {
52
+ !o && !v || s !== u.HOVER && !l || Q || (R ? r.current && (clearTimeout(r.current), r.current = null) : r.current || (r.current = setTimeout(() => {
53
+ F();
54
+ }, d)));
55
+ }, [s, o, R, l, d]), g(() => {
56
+ x == null || x(v);
57
+ }, [v]);
58
+ const _ = y(o, j);
51
59
  return {
52
- open: i,
53
- mode: f,
54
- onOpenChange: d,
55
- onOpenByKeyboard: F,
56
- inheritedArrowColor: P,
57
- triggerRef: D,
58
- contentRef: A,
59
- animatedOpen: g,
60
- animationDuration: V,
61
- hoverCloseDelay: E,
62
- temporaryHoverClose: o,
63
- closeMenuImmediately: q,
64
- onMouseEnter: G,
65
- onMouseLeave: J,
66
- enableTemporaryHoverClose: N,
67
- triggerId: H
60
+ open: o,
61
+ mode: s,
62
+ onOpenChange: E,
63
+ onOpenByKeyboard: W,
64
+ inheritedArrowColor: _,
65
+ triggerRef: U,
66
+ contentRef: j,
67
+ animatedOpen: v,
68
+ animationDuration: w,
69
+ hoverCloseDelay: d,
70
+ temporaryHoverClose: l,
71
+ closeMenuImmediately: G,
72
+ onMouseEnter: X,
73
+ onMouseLeave: Y,
74
+ enableTemporaryHoverClose: Z,
75
+ triggerId: L
68
76
  };
69
77
  };
70
78
  export {
71
- tr as useContextMenuSubMenu
79
+ er as useContextMenuSubMenu
72
80
  };
@@ -41,6 +41,10 @@ export interface UseContextMenuSubMenuOptions {
41
41
  * The callback function to be called when the context menu is opened.
42
42
  */
43
43
  onOpen?: (open: boolean) => void;
44
+ /**
45
+ * The callback function to be called when the context menu is animated open.
46
+ */
47
+ onAnimatedOpen?: (open: boolean) => void;
44
48
  /**
45
49
  * Whether the context menu should close when another menu is opened.
46
50
  */
@@ -1 +1 @@
1
- {"version":3,"file":"useContextMenuSubMenu.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,wBAAwB,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC"}
1
+ {"version":3,"file":"useContextMenuSubMenu.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,wBAAwB,CAAC,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7D;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC;;OAEG;IACH,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC"}
@@ -1,6 +1,6 @@
1
1
  import { ContextMenu as n } from "./ContextMenu.js";
2
2
  import { ContextMenuMode as x } from "./ContextMenu.enums.js";
3
- import "../../useContentPositioning-DO7ZotnD.mjs";
3
+ import "../../useContentPositioning-DAKfbddS.mjs";
4
4
  import { Direction as p } from "./components/Content/Content.enums.js";
5
5
  import "./components/Content/Content.utils.js";
6
6
  export {
@@ -1,23 +1,23 @@
1
- import { forwardRef as A, useState as H, useLayoutEffect as v } from "react";
1
+ import { forwardRef as F, useState as H, useLayoutEffect as v } from "react";
2
2
  import { jsx as P } from "react/jsx-runtime";
3
- import { C as F } from "./index-BA3njR2k.mjs";
4
- import { c as R } from "./index-L8X2o7IH.mjs";
5
- import { u as U, a as k, e as S } from "./react-spring_web.modern-Dnq1lqN5.mjs";
6
- import { mergeRefs as z } from "./lib/utils.js";
7
- import { LevelProvider as B } from "./components/ContextMenu/providers/LevelProvider/LevelProvider.js";
8
- import { useContextMenuContext as j } from "./components/ContextMenu/ContextMenu.context.js";
3
+ import { C as R } from "./index-BA3njR2k.mjs";
4
+ import { c as U } from "./index-L8X2o7IH.mjs";
5
+ import { u as k, a as S, e as z } from "./react-spring_web.modern-Dnq1lqN5.mjs";
6
+ import { mergeRefs as B } from "./lib/utils.js";
7
+ import { LevelProvider as j } from "./components/ContextMenu/providers/LevelProvider/LevelProvider.js";
8
+ import { useContextMenuContext as K } from "./components/ContextMenu/ContextMenu.context.js";
9
9
  import { ContextMenuMode as w } from "./components/ContextMenu/ContextMenu.enums.js";
10
10
  import { Direction as e } from "./components/ContextMenu/components/Content/Content.enums.js";
11
- import { directionToSide as K } from "./components/ContextMenu/components/Content/Content.utils.js";
12
- import './assets/useContentPositioning.css';const q = "_content_k9opk_1", X = {
13
- content: q
14
- }, x = "ContextMenu.Content", Y = A(
11
+ import { directionToSide as q } from "./components/ContextMenu/components/Content/Content.utils.js";
12
+ import './assets/useContentPositioning.css';const X = "_content_k9opk_1", Y = {
13
+ content: X
14
+ }, x = "ContextMenu.Content", J = F(
15
15
  ({
16
- style: a,
16
+ style: c,
17
17
  className: g,
18
18
  children: h,
19
19
  alignOffset: o,
20
- arrowPadding: c = 5,
20
+ arrowPadding: l = 5,
21
21
  collisionBoundary: C,
22
22
  direction: O = e.DOWN_RIGHT,
23
23
  disableAutoPositioning: p = !1,
@@ -28,13 +28,14 @@ import './assets/useContentPositioning.css';const q = "_content_k9opk_1", X = {
28
28
  const [W, r] = H(!1), [i, I] = H(null), {
29
29
  triggerRef: s,
30
30
  contentRef: f,
31
- animatedOpen: _,
32
- animationDuration: u,
33
- mode: l,
34
- temporaryHoverClose: d,
35
- onMouseEnter: n,
36
- onMouseLeave: t
37
- } = j(x), { align: m, labelOffset: D, isPositioned: L } = J({
31
+ isOpen: _,
32
+ animatedOpen: u,
33
+ animationDuration: m,
34
+ mode: d,
35
+ temporaryHoverClose: n,
36
+ onMouseEnter: t,
37
+ onMouseLeave: a
38
+ } = K(x), { align: D, labelOffset: y, isPositioned: L } = M({
38
39
  direction: O,
39
40
  alignOffset: o,
40
41
  disableAutoPositioning: p,
@@ -42,45 +43,45 @@ import './assets/useContentPositioning.css';const q = "_content_k9opk_1", X = {
42
43
  contentRef: f,
43
44
  collisionBoundary: C,
44
45
  children: h
45
- }), y = U({
46
- opacity: L && (l === w.CLICK && !d || _) ? 1 : 0,
47
- config: l === w.CLICK && !d ? { duration: 0 } : { duration: u, easing: S.easeInOutCubic }
46
+ }), A = k({
47
+ opacity: L && (d === w.CLICK && !n || u) ? 1 : 0,
48
+ config: d === w.CLICK && !n ? { duration: 0 } : { duration: m, easing: z.easeInOutCubic }
48
49
  });
49
50
  return /* @__PURE__ */ P(
50
- B,
51
+ j,
51
52
  {
52
53
  hasItemWithIcon: W,
53
54
  setHasItemWithIcon: r,
54
55
  activeItemId: i,
55
56
  setActiveItemId: I,
56
- children: /* @__PURE__ */ P(
57
- k.div,
57
+ children: _ && /* @__PURE__ */ P(
58
+ S.div,
58
59
  {
59
60
  style: {
60
61
  zIndex: Number.MAX_SAFE_INTEGER - 10,
61
62
  position: "fixed",
62
- ...y
63
+ ...A
63
64
  },
64
65
  "data-content-wrapper": !0,
65
66
  children: /* @__PURE__ */ P(
66
- F,
67
+ R,
67
68
  {
68
- ref: z(f, G),
69
- className: R(X.content, g),
69
+ ref: B(f, G),
70
+ className: U(Y.content, g),
70
71
  style: {
71
- ...a || {},
72
+ ...c || {},
72
73
  pointerEvents: p || L ? "auto" : "none"
73
74
  },
74
75
  collisionBoundary: C,
75
- side: K[O],
76
- align: m,
77
- arrowPadding: c,
78
- alignOffset: D,
76
+ side: q[O],
77
+ align: D,
78
+ arrowPadding: l,
79
+ alignOffset: y,
79
80
  onMouseEnter: (T) => {
80
- n == null || n(T), E == null || E(T);
81
+ t == null || t(T), E == null || E(T);
81
82
  },
82
83
  onMouseLeave: (T) => {
83
- t == null || t(T), b == null || b(T);
84
+ a == null || a(T), b == null || b(T);
84
85
  },
85
86
  ...N,
86
87
  children: h
@@ -92,27 +93,27 @@ import './assets/useContentPositioning.css';const q = "_content_k9opk_1", X = {
92
93
  );
93
94
  }
94
95
  );
95
- Y.displayName = x;
96
- function J({
97
- direction: a,
96
+ J.displayName = x;
97
+ function M({
98
+ direction: c,
98
99
  alignOffset: g = 0,
99
100
  disableAutoPositioning: h,
100
101
  triggerRef: o,
101
- contentRef: c,
102
+ contentRef: l,
102
103
  collisionBoundary: C,
103
104
  children: O
104
105
  }) {
105
106
  const [p, E] = H(
106
- a === e.UP_RIGHT || a === e.DOWN_RIGHT || a === e.RIGHT_UP || a === e.RIGHT_DOWN ? "start" : "end"
107
+ c === e.UP_RIGHT || c === e.DOWN_RIGHT || c === e.RIGHT_UP || c === e.RIGHT_DOWN ? "start" : "end"
107
108
  ), [b, N] = H(g), [G, W] = H(!1);
108
109
  return v(() => {
109
- const r = c == null ? void 0 : c.current;
110
+ const r = l == null ? void 0 : l.current;
110
111
  if (!r || h || [
111
112
  e.DOWN_LEFT,
112
113
  e.DOWN_RIGHT,
113
114
  e.UP_LEFT,
114
115
  e.UP_RIGHT
115
- ].includes(a))
116
+ ].includes(c))
116
117
  return;
117
118
  const i = r.children;
118
119
  if (!i || i.length === 0)
@@ -122,20 +123,20 @@ function J({
122
123
  if (p === "start") {
123
124
  const t = i.item(1);
124
125
  if (t instanceof Element && t.hasAttribute("data-separator")) {
125
- const m = i.item(2);
126
- m instanceof Element ? s = m : s = null;
126
+ const a = i.item(2);
127
+ a instanceof Element ? s = a : s = null;
127
128
  } else t instanceof Element && (s = t);
128
129
  } else {
129
- const t = i.length - 1, m = i.item(t);
130
- if (m instanceof Element && m.hasAttribute("data-arrow")) {
130
+ const t = i.length - 1, a = i.item(t);
131
+ if (a instanceof Element && a.hasAttribute("data-arrow")) {
131
132
  const D = i.item(t - 1);
132
133
  D instanceof Element ? s = D : s = null;
133
- } else m instanceof Element && (s = m);
134
+ } else a instanceof Element && (s = a);
134
135
  }
135
136
  const f = o == null ? void 0 : o.current;
136
137
  if (!f || !s)
137
138
  return;
138
- const _ = s.getBoundingClientRect(), u = f.getBoundingClientRect(), l = _.height, n = (u.height - l) / 2;
139
+ const _ = s.getBoundingClientRect(), u = f.getBoundingClientRect(), m = _.height, n = (u.height - m) / 2;
139
140
  if (p === "start") {
140
141
  if (I instanceof Element && I.hasAttribute("data-label")) {
141
142
  const t = I.getBoundingClientRect().height;
@@ -145,8 +146,8 @@ function J({
145
146
  N(g + n - 1);
146
147
  }, [
147
148
  O,
148
- a,
149
149
  c,
150
+ l,
150
151
  o,
151
152
  p,
152
153
  g,
@@ -158,20 +159,20 @@ function J({
158
159
  const I = C instanceof Element && C || document.documentElement, s = () => {
159
160
  if (!i)
160
161
  return;
161
- const f = o.current, _ = c.current;
162
+ const f = o.current, _ = l.current;
162
163
  if (!f || !_)
163
164
  return;
164
- const u = f.getBoundingClientRect(), l = _.getBoundingClientRect();
165
- if (l.width <= 0)
165
+ const u = f.getBoundingClientRect(), m = _.getBoundingClientRect();
166
+ if (m.width <= 0)
166
167
  return;
167
168
  const d = I.getBoundingClientRect(), n = {
168
- right: d.right - u.right >= l.width,
169
- left: u.left - d.left >= l.width,
170
- bottom: d.bottom - u.bottom >= l.height,
171
- top: u.top - d.top >= l.height
169
+ right: d.right - u.right >= m.width,
170
+ left: u.left - d.left >= m.width,
171
+ bottom: d.bottom - u.bottom >= m.height,
172
+ top: u.top - d.top >= m.height
172
173
  };
173
174
  let t = "start";
174
- switch (a) {
175
+ switch (c) {
175
176
  case e.UP_RIGHT:
176
177
  case e.DOWN_RIGHT: {
177
178
  n.right ? t = "start" : n.left ? t = "end" : t = "start";
@@ -195,19 +196,19 @@ function J({
195
196
  }
196
197
  E(t), W(!0);
197
198
  };
198
- return requestAnimationFrame(s), c.current && typeof ResizeObserver < "u" && (r = new ResizeObserver(s), r.observe(c.current)), () => {
199
+ return requestAnimationFrame(s), l.current && typeof ResizeObserver < "u" && (r = new ResizeObserver(s), r.observe(l.current)), () => {
199
200
  i = !1, r == null || r.disconnect();
200
201
  };
201
202
  }, [
202
- a,
203
+ c,
203
204
  h,
204
205
  o,
205
- c,
206
+ l,
206
207
  C
207
208
  ]), { align: p, labelOffset: b, isPositioned: G };
208
209
  }
209
210
  export {
210
- Y as C,
211
- X as s,
212
- J as u
211
+ J as C,
212
+ Y as s,
213
+ M as u
213
214
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kommo-crm/crm-react-ui-kit",
3
3
  "description": "Ready-to-use React components which implements Kommo design",
4
- "version": "1.1.1-beta.6",
4
+ "version": "1.1.1-beta.7",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "engines": {