@kommo-crm/crm-react-ui-kit 1.3.0-beta.2 → 1.3.0-beta.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.tsx"],"names":[],"mappings":"AAYA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,cAAc,YAChB,qBAAqB,KAC7B,oBAokBF,CAAC"}
1
+ {"version":3,"file":"useContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,cAAc,YAChB,qBAAqB,KAC7B,oBA+lBF,CAAC"}
@@ -1,168 +1,173 @@
1
- import { useId as me, useState as f, useRef as a, useEffect as F } from "react";
2
- import { a as he, b as Ce } from "../../../../index-DBS3EIVR.mjs";
3
- import { useFocusChange as pe } from "../../../../hooks/useFocusChange/useFocusChange.js";
1
+ import { useId as Ce, useState as a, useRef as o, useEffect as E } from "react";
2
+ import { a as pe, b as Re } from "../../../../index-DBS3EIVR.mjs";
3
+ import { useFocusChange as Ie } from "../../../../hooks/useFocusChange/useFocusChange.js";
4
+ import { noop as ge } from "../../../../utils/noop/noop.js";
4
5
  import { ContextMenuMode as i } from "../../ContextMenu.enums.js";
5
- import { contextMenuBus as y } from "./utils/contextMenuBus/contextMenuBus.js";
6
- const Fe = (N) => {
6
+ import { contextMenuBus as h } from "./utils/contextMenuBus/contextMenuBus.js";
7
+ const De = (X) => {
7
8
  const {
8
- mode: Q,
9
- defaultOpen: k,
10
- animationDuration: h,
9
+ mode: Y,
10
+ defaultOpen: x,
11
+ animationDuration: C,
11
12
  hoverCloseDelay: H,
12
- isOpen: p,
13
+ isOpen: R,
13
14
  onOpen: s,
14
15
  onAnimatedOpen: V,
15
16
  onAiming: B,
16
- onFocusOutside: U,
17
- aimingTolerance: X,
18
- aimingIdleTimeout: Y
19
- } = N, I = me(), [o, M] = f(
20
- p ?? k ?? !1
21
- ), [D, l] = f(!1), [Z, x] = f(!1), [K, R] = f(!1), [q, L] = f(!1), [W, _] = f(!1), [$, ee] = f(null), [te, E] = f(!1), [j, ne] = f(null), d = a(!1), w = a(null), n = a(null), u = a(null), P = a(!1), r = a(!1), T = a(null), g = a(!1), b = a(U), c = he() ? i.CLICK : Q, O = () => {
22
- n.current && (clearTimeout(n.current), n.current = null), u.current && (clearTimeout(u.current), u.current = null), T.current && (clearTimeout(T.current), T.current = null);
17
+ onFocusOutside: Z,
18
+ aimingTolerance: _,
19
+ aimingIdleTimeout: $
20
+ } = X, I = Ce(), [l, y] = a(
21
+ R ?? x ?? !1
22
+ ), [D, f] = a(!1), [ee, q] = a(!1), [K, g] = a(!1), [W, L] = a(!1), [j, te] = a(!1), [ne, re] = a(null), [se, A] = a(!1), [w, ue] = a(null), d = o(!1), z = o(null), n = o(null), c = o(null), P = o(!1), r = o(!1), T = o(null), O = o(!1), S = o(!1), G = o(ge), M = o(Z), u = pe() ? i.CLICK : Y, b = () => {
23
+ n.current && (clearTimeout(n.current), n.current = null), c.current && (clearTimeout(c.current), c.current = null), T.current && (clearTimeout(T.current), T.current = null);
23
24
  }, m = () => {
24
- O(), r.current = !1, M(!1), s == null || s(!1), R(!1), d.current = !1, E(!1);
25
- }, re = (e) => {
26
- B == null || B(e), !e && r.current && !d.current && !g.current && (r.current = !1, l(!1), u.current = setTimeout(() => {
25
+ b(), r.current = !1, y(!1), s == null || s(!1), g(!1), d.current = !1, A(!1);
26
+ }, ce = (e) => {
27
+ B == null || B(e), h.emitAimingChange(e), !e && r.current && !d.current && !O.current && (r.current = !1, f(!1), c.current = setTimeout(() => {
27
28
  m();
28
- }, h));
29
- }, { isAiming: v, ref: A } = Ce({
30
- isEnabled: o && c === i.HOVER,
31
- onChange: re,
32
- tolerance: X,
33
- idleTimeout: Y
34
- }), se = () => g.current, ue = (e) => {
35
- g.current = e, !e && r.current && !d.current && !v() && (r.current = !1, l(!1), u.current = setTimeout(() => {
29
+ }, C));
30
+ }, { isAiming: v, ref: F } = Re({
31
+ isEnabled: l && u === i.HOVER,
32
+ onChange: ce,
33
+ tolerance: _,
34
+ idleTimeout: $
35
+ }), oe = () => O.current, ie = (e) => {
36
+ O.current = e, !e && r.current && !d.current && !v() && (r.current = !1, f(!1), c.current = setTimeout(() => {
36
37
  m();
37
- }, h));
38
- }, z = () => {
39
- if (O(), x(!1), c === i.HOVER) {
40
- if (W && $ === i.CLICK || j !== null)
38
+ }, C));
39
+ }, J = () => {
40
+ if (b(), q(!1), u === i.HOVER) {
41
+ if (j && ne === i.CLICK || w !== null)
41
42
  return;
42
43
  if (K) {
43
- l(!1), u.current = setTimeout(() => {
44
+ f(!1), c.current = setTimeout(() => {
44
45
  m();
45
- }, h);
46
+ }, C);
46
47
  return;
47
48
  }
48
- r.current = !0, !v() && !g.current && (r.current = !1, l(!1), u.current = setTimeout(() => {
49
+ r.current = !0, !v() && !O.current && (r.current = !1, f(!1), c.current = setTimeout(() => {
49
50
  m();
50
- }, h));
51
+ }, C));
51
52
  } else
52
53
  m();
53
- }, S = ({
54
+ }, k = ({
54
55
  preventFocusRestore: e = !1,
55
56
  skipAnimationFlag: t = !1
56
57
  }) => {
57
- P.current = e, O(), r.current = !1, x(t), l(!1), M(!1), s == null || s(!1), R(!1), d.current = !1, E(!1);
58
+ P.current = e, b(), r.current = !1, q(t), f(!1), y(!1), s == null || s(!1), g(!1), d.current = !1, A(!1);
58
59
  };
59
- F(() => {
60
- o || (P.current = !1);
61
- }, [o]);
62
- const oe = (e) => {
63
- E(e);
64
- }, G = (e) => {
65
- if (!(c === i.CLICK && k !== void 0)) {
60
+ E(() => {
61
+ l || (P.current = !1);
62
+ }, [l]);
63
+ const le = (e) => {
64
+ A(e);
65
+ }, N = (e) => {
66
+ if (!(u === i.CLICK && x !== void 0)) {
66
67
  if (e) {
67
- u.current && (clearTimeout(u.current), u.current = null), r.current && (O(), r.current = !1), c === i.HOVER && l(!0), M(!0), s == null || s(!0), p !== !1 && y.emit({
68
+ c.current && (clearTimeout(c.current), c.current = null), r.current && (b(), r.current = !1), u === i.HOVER && f(!0), y(!0), s == null || s(!0), R !== !1 && h.emit({
68
69
  id: I,
69
70
  isAiming: v
70
71
  });
71
72
  return;
72
73
  }
73
- c === i.HOVER ? z() : m();
74
+ u === i.HOVER ? J() : m();
74
75
  }
75
- }, ce = (e) => {
76
- L(e), G(e);
77
- }, ie = () => {
76
+ }, fe = (e) => {
77
+ L(e), N(e);
78
+ }, Q = () => {
78
79
  var e, t;
79
- c !== i.HOVER || (t = (e = y).isAiming) != null && t.call(e) && y.activeMenuId !== I || (L(!1), O(), r.current = !1, o ? (R(!0), d.current = !0, l(!0)) : (n.current && (clearTimeout(n.current), n.current = null), l(!0), M(!0), s == null || s(!0), R(!0), d.current = !0, T.current = setTimeout(() => {
80
- T.current = null, p !== !1 && y.emit({
80
+ S.current = !0, !(u !== i.HOVER || (t = (e = h).isAiming) != null && t.call(e) && h.activeMenuId !== I) && (L(!1), b(), r.current = !1, l ? (g(!0), d.current = !0, f(!0)) : (n.current && (clearTimeout(n.current), n.current = null), f(!0), y(!0), s == null || s(!0), g(!0), d.current = !0, T.current = setTimeout(() => {
81
+ T.current = null, R !== !1 && h.emit({
81
82
  id: I,
82
83
  isAiming: v
83
84
  });
84
85
  }, 0)));
85
- }, le = () => {
86
- c === i.HOVER && (L(!1), R(!1), d.current = !1, n.current && (clearTimeout(n.current), n.current = null), r.current && !v() && !g.current && (r.current = !1, l(!1), u.current = setTimeout(() => {
86
+ };
87
+ G.current = Q;
88
+ const ae = () => {
89
+ S.current = !1, u === i.HOVER && (L(!1), g(!1), d.current = !1, n.current && (clearTimeout(n.current), n.current = null), r.current && !v() && !O.current && (r.current = !1, f(!1), c.current = setTimeout(() => {
87
90
  m();
88
- }, h)));
89
- }, fe = (e, t) => {
90
- e || E(!1), _(e), ee(t);
91
+ }, C)));
92
+ }, de = (e, t) => {
93
+ e || A(!1), te(e), re(t);
91
94
  };
92
- F(() => p === !1 ? void 0 : y.subscribe(({ id: t }) => {
93
- t !== I && S({
95
+ E(() => R === !1 ? void 0 : h.subscribe(({ id: t }) => {
96
+ t !== I && k({
94
97
  preventFocusRestore: !0,
95
98
  skipAnimationFlag: !0
96
99
  });
97
- }), [I, p]), F(() => {
98
- !o || c !== i.HOVER || q || (K ? n.current && (clearTimeout(n.current), n.current = null) : n.current || (n.current = setTimeout(() => {
99
- z();
100
+ }), [I, R]), E(() => u !== i.HOVER ? void 0 : h.subscribeAimingChange((t) => {
101
+ !t && S.current && G.current();
102
+ }), [u]), E(() => {
103
+ !l || u !== i.HOVER || W || (K ? n.current && (clearTimeout(n.current), n.current = null) : n.current || (n.current = setTimeout(() => {
104
+ J();
100
105
  }, H)));
101
- }, [c, o, K, H, q]), F(() => {
106
+ }, [u, l, K, H, W]), E(() => {
102
107
  V == null || V(D);
103
108
  }, [D]);
104
- const ae = () => {
109
+ const me = () => {
105
110
  const e = [];
106
- A.current && e.push(A.current);
111
+ F.current && e.push(F.current);
107
112
  const t = Array.from(
108
113
  document.querySelectorAll("[data-menu-level]")
109
114
  );
110
115
  return e.push(...t), e;
111
116
  };
112
- return pe({
113
- elements: o ? [A, w] : [],
114
- enabled: o,
117
+ return Ie({
118
+ elements: l ? [F, z] : [],
119
+ enabled: l,
115
120
  onFocusOutside: (e) => {
116
- var J;
121
+ var U;
117
122
  const t = e.target;
118
- if (!o || t === document.body)
123
+ if (!l || t === document.body)
119
124
  return;
120
- if (!ae().some((C) => t ? C === t || C.contains(t) : !1)) {
121
- let C = !1;
122
- const de = {
125
+ if (!me().some((p) => t ? p === t || p.contains(t) : !1)) {
126
+ let p = !1;
127
+ const he = {
123
128
  target: t,
124
129
  preventDefault: () => {
125
- C = !0;
130
+ p = !0;
126
131
  },
127
132
  get defaultPrevented() {
128
- return C;
133
+ return p;
129
134
  }
130
135
  };
131
- if ((J = b.current) == null || J.call(b, de), C)
136
+ if ((U = M.current) == null || U.call(M, he), p)
132
137
  return;
133
- S({ preventFocusRestore: !0 });
138
+ k({ preventFocusRestore: !0 });
134
139
  }
135
140
  }
136
141
  }), {
137
- isOpen: o,
138
- mode: c,
139
- onOpenChange: G,
140
- onOpenByKeyboard: ce,
141
- triggerRef: w,
142
- contentRef: A,
142
+ isOpen: l,
143
+ mode: u,
144
+ onOpenChange: N,
145
+ onOpenByKeyboard: fe,
146
+ triggerRef: z,
147
+ contentRef: F,
143
148
  isAnimatedOpen: D,
144
- skipAnimation: Z,
145
- animationDuration: h,
149
+ skipAnimation: ee,
150
+ animationDuration: C,
146
151
  hoverCloseDelay: H,
147
152
  closeMenuImmediately: (e) => {
148
- S({ preventFocusRestore: e });
153
+ k({ preventFocusRestore: e });
149
154
  },
150
- onContentEnter: ie,
151
- onContentLeave: le,
152
- onChildOpen: fe,
153
- onSubmenuOpen: oe,
154
- isRootContentBlocked: te,
155
- isChildOpen: W,
156
- itemWithFocusedInput: j,
157
- setItemWithFocusedInput: ne,
155
+ onContentEnter: Q,
156
+ onContentLeave: ae,
157
+ onChildOpen: de,
158
+ onSubmenuOpen: le,
159
+ isRootContentBlocked: se,
160
+ isChildOpen: j,
161
+ itemWithFocusedInput: w,
162
+ setItemWithFocusedInput: ue,
158
163
  shouldPreventFocusRestore: () => P.current,
159
164
  setOnFocusOutside: (e) => {
160
- b.current = e;
165
+ M.current = e;
161
166
  },
162
- isChildAiming: se,
163
- onChildAiming: ue
167
+ isChildAiming: oe,
168
+ onChildAiming: ie
164
169
  };
165
170
  };
166
171
  export {
167
- Fe as useContextMenu
172
+ De as useContextMenu
168
173
  };
@@ -1,7 +1,9 @@
1
- import { ContextMenuBusCallback, ContextMenuBusPayload } from './contextMenuBus.types';
1
+ import { ContextMenuBusCallback, ContextMenuBusPayload, ContextMenuBusAimingChangeCallback } from './contextMenuBus.types';
2
2
  export declare const contextMenuBus: {
3
3
  emit: (payload: ContextMenuBusPayload) => void;
4
+ emitAimingChange: (aiming: boolean) => void;
4
5
  subscribe: (cb: ContextMenuBusCallback) => (() => void);
6
+ subscribeAimingChange: (cb: ContextMenuBusAimingChangeCallback) => (() => void);
5
7
  readonly isAiming: (() => boolean) | null;
6
8
  readonly activeMenuId: string | null;
7
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"contextMenuBus.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/hooks/useContextMenu/utils/contextMenuBus/contextMenuBus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,wBAAwB,CAAC;AAkChC,eAAO,MAAM,cAAc;oBAlBJ,qBAAqB,KAAG,IAAI;oBAU5B,sBAAsB,KAAG,CAAC,MAAM,IAAI,CAAC;8BAhBvC,OAAO;;CAiC3B,CAAC"}
1
+ {"version":3,"file":"contextMenuBus.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/hooks/useContextMenu/utils/contextMenuBus/contextMenuBus.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,kCAAkC,EACnC,MAAM,wBAAwB,CAAC;AAuDhC,eAAO,MAAM,cAAc;oBAtCJ,qBAAqB,KAAG,IAAI;+BAUjB,OAAO,KAAG,IAAI;oBAOzB,sBAAsB,KAAG,CAAC,MAAM,IAAI,CAAC;gCAYtD,kCAAkC,KACrC,CAAC,MAAM,IAAI,CAAC;8BApCM,OAAO;;CAuD3B,CAAC"}
@@ -1,18 +1,24 @@
1
- let t = [], n = null, s = null;
2
- const r = (e) => {
3
- t.forEach((i) => i(e)), n = e.isAiming, s = e.id;
4
- }, u = (e) => (t.push(e), () => {
1
+ let n = [], t = [], s = null, r = null;
2
+ const u = (e) => {
3
+ n.forEach((i) => i(e)), s = e.isAiming, r = e.id;
4
+ }, g = (e) => {
5
+ t.forEach((i) => i(e));
6
+ }, c = (e) => (n.push(e), () => {
7
+ n = n.filter((i) => i !== e);
8
+ }), l = (e) => (t.push(e), () => {
5
9
  t = t.filter((i) => i !== e);
6
- }), c = {
7
- emit: r,
8
- subscribe: u,
10
+ }), m = {
11
+ emit: u,
12
+ emitAimingChange: g,
13
+ subscribe: c,
14
+ subscribeAimingChange: l,
9
15
  get isAiming() {
10
- return n;
16
+ return s;
11
17
  },
12
18
  get activeMenuId() {
13
- return s;
19
+ return r;
14
20
  }
15
21
  };
16
22
  export {
17
- c as contextMenuBus
23
+ m as contextMenuBus
18
24
  };
@@ -16,4 +16,8 @@ export type ContextMenuBusPayload = {
16
16
  * Callback function for context menu bus subscribers.
17
17
  */
18
18
  export type ContextMenuBusCallback = (payload: ContextMenuBusPayload) => void;
19
+ /**
20
+ * Callback function for aiming state change subscribers.
21
+ */
22
+ export type ContextMenuBusAimingChangeCallback = (aiming: boolean) => void;
19
23
  //# sourceMappingURL=contextMenuBus.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contextMenuBus.types.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/hooks/useContextMenu/utils/contextMenuBus/contextMenuBus.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC"}
1
+ {"version":3,"file":"contextMenuBus.types.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/hooks/useContextMenu/utils/contextMenuBus/contextMenuBus.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useContextMenuItemFocus.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuItemFocus/useContextMenuItemFocus.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,WAAW,WAClD,8BAA8B,CAAC,CAAC,CAAC,KACzC,6BAA6B,CAAC,CAAC,CA2HjC,CAAC"}
1
+ {"version":3,"file":"useContextMenuItemFocus.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuItemFocus/useContextMenuItemFocus.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,uBAAuB,GAAI,CAAC,SAAS,WAAW,WAClD,8BAA8B,CAAC,CAAC,CAAC,KACzC,6BAA6B,CAAC,CAAC,CAmKjC,CAAC"}
@@ -1,66 +1,71 @@
1
- import { useState as M, useLayoutEffect as E } from "react";
2
- import { useLevelContext as H } from "../../providers/LevelProvider/LevelProvider.js";
3
- const j = (d) => {
1
+ import { useState as R, useRef as H, useLayoutEffect as N, useEffect as T } from "react";
2
+ import { useLevelContext as d } from "../../providers/LevelProvider/LevelProvider.js";
3
+ const w = (E) => {
4
4
  const {
5
- displayName: y,
6
- id: u,
7
- isDisabled: o,
8
- hasSubmenu: F,
9
- onMouseEnter: v,
10
- onMouseLeave: l,
11
- onFocus: p,
12
- onBlur: I,
13
- onPointerEnter: n,
14
- onPointerLeave: b,
15
- onPointerMove: D,
16
- isSelectable: a = !0,
17
- subMenuTriggerId: S
18
- } = d, [L, s] = M(!1), { setActiveItemId: x, activeItemId: r, isAiming: t, isChildAiming: f } = H(y);
19
- return E(() => {
20
- F ? (r === null || r !== S && u !== r) && s(!1) : u !== r && s(!1);
21
- }, [r, S, F, u]), {
22
- dataHighlighted: L && a && !o ? "" : void 0,
23
- onFocus: (e) => {
24
- const c = (t == null ? void 0 : t()) || (f == null ? void 0 : f());
25
- a && !o && !c && (x(u), s(!o)), p == null || p(e);
5
+ displayName: L,
6
+ id: a,
7
+ isDisabled: u,
8
+ hasSubmenu: k,
9
+ onMouseEnter: I,
10
+ onMouseLeave: p,
11
+ onFocus: b,
12
+ onBlur: D,
13
+ onPointerEnter: x,
14
+ onPointerLeave: F,
15
+ onPointerMove: S,
16
+ isSelectable: o = !0,
17
+ subMenuTriggerId: y
18
+ } = E, [M, r] = R(!1), n = H(null), { setActiveItemId: l, activeItemId: s, isAiming: e, isChildAiming: t } = d(L), v = () => {
19
+ n.current && (clearInterval(n.current), n.current = null);
20
+ };
21
+ return N(() => {
22
+ k ? (s === null || s !== y && a !== s) && r(!1) : a !== s && r(!1);
23
+ }, [s, y, k, a]), T(() => () => v(), []), {
24
+ dataHighlighted: M && o && !u ? "" : void 0,
25
+ onFocus: (c) => {
26
+ const f = (e == null ? void 0 : e()) || (t == null ? void 0 : t());
27
+ o && !u && !f && (l(a), r(!u)), b == null || b(c);
26
28
  },
27
- onMouseEnter: (e) => {
28
- const c = (t == null ? void 0 : t()) || (f == null ? void 0 : f());
29
- a && !o && !c && (x(u), s(!o)), c || v == null || v(e);
29
+ onMouseEnter: (c) => {
30
+ const f = (e == null ? void 0 : e()) || (t == null ? void 0 : t());
31
+ o && !u && !f && (l(a), r(!u)), f && o && !u && (v(), n.current = setInterval(() => {
32
+ !(e != null && e()) && !(t != null && t()) && (l(a), r(!0), v());
33
+ }, 16)), f || I == null || I(c);
30
34
  },
31
- onBlur: (e) => {
32
- const c = (t == null ? void 0 : t()) || (f == null ? void 0 : f());
33
- a && !o && !c && s(!1), I == null || I(e);
35
+ onBlur: (c) => {
36
+ const f = (e == null ? void 0 : e()) || (t == null ? void 0 : t());
37
+ o && !u && !f && r(!1), D == null || D(c);
34
38
  },
35
- onMouseLeave: (e) => {
36
- const c = (t == null ? void 0 : t()) || (f == null ? void 0 : f());
37
- a && !o && !c && s(!1), c || l == null || l(e);
39
+ onMouseLeave: (c) => {
40
+ v();
41
+ const f = (e == null ? void 0 : e()) || (t == null ? void 0 : t());
42
+ o && !u && !f && r(!1), f || p == null || p(c);
38
43
  },
39
44
  /**
40
45
  * This is necessary to disable the standard focus behavior
41
46
  * when hovering over an item and similar elements in Radix.
42
47
  */
43
- onPointerEnter: (e) => {
44
- e.preventDefault(), n == null || n(e);
48
+ onPointerEnter: (c) => {
49
+ c.preventDefault(), x == null || x(c);
45
50
  },
46
51
  /**
47
52
  * This is necessary to disable the standard focus behavior
48
53
  * when hovering over an item and similar elements in Radix.
49
54
  */
50
- onPointerLeave: (e) => {
51
- e.preventDefault(), b == null || b(e);
55
+ onPointerLeave: (c) => {
56
+ c.preventDefault(), F == null || F(c);
52
57
  },
53
58
  /**
54
59
  * This is necessary to disable the standard focus behavior
55
60
  * when hovering over an item and similar elements in Radix.
56
61
  */
57
- onPointerMove: (e) => {
58
- e.preventDefault();
59
- const c = (t == null ? void 0 : t()) || (f == null ? void 0 : f());
60
- a && !o && !c && (x(u), s(!o)), c || D == null || D(e);
62
+ onPointerMove: (c) => {
63
+ c.preventDefault();
64
+ const f = (e == null ? void 0 : e()) || (t == null ? void 0 : t());
65
+ o && !u && !f && (l(a), r(!u)), f || S == null || S(c);
61
66
  }
62
67
  };
63
68
  };
64
69
  export {
65
- j as useContextMenuItemFocus
70
+ w as useContextMenuItemFocus
66
71
  };
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.3.0-beta.2",
4
+ "version": "1.3.0-beta.3",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "engines": {