@kommo-crm/crm-react-ui-kit 1.3.0-beta.4 → 1.3.1

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":"AAcA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,wBAAwB,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,cAAc,YAChB,qBAAqB,KAC7B,oBA+lBF,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,oBAqmBF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { useId as Ce, useState as a, useRef as o, useEffect as E } from "react";
1
+ import { useId as Ce, useState as a, useRef as o, useEffect as y } from "react";
2
2
  import { a as pe, b as Re } from "../../../../index-DBS3EIVR.mjs";
3
3
  import { useFocusChange as Ie } from "../../../../hooks/useFocusChange/useFocusChange.js";
4
4
  import { noop as ge } from "../../../../utils/noop/noop.js";
@@ -9,44 +9,44 @@ const De = (X) => {
9
9
  mode: Y,
10
10
  defaultOpen: x,
11
11
  animationDuration: C,
12
- hoverCloseDelay: H,
12
+ hoverCloseDelay: V,
13
13
  isOpen: R,
14
14
  onOpen: s,
15
- onAnimatedOpen: V,
16
- onAiming: B,
15
+ onAnimatedOpen: B,
16
+ onAiming: D,
17
17
  onFocusOutside: Z,
18
18
  aimingTolerance: _,
19
19
  aimingIdleTimeout: $
20
- } = X, I = Ce(), [l, y] = a(
20
+ } = X, I = Ce(), [l, A] = a(
21
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 = () => {
22
+ ), [K, f] = a(!1), [ee, q] = a(!1), [L, g] = a(!1), [W, P] = a(!1), [j, te] = a(!1), [ne, re] = a(null), [se, M] = a(!1), [w, ue] = a(null), d = o(!1), z = o(null), n = o(null), c = o(null), S = o(!1), r = o(!1), T = o(null), O = o(!1), b = o(!1), G = o(ge), F = o(Z), u = pe() ? i.CLICK : Y, v = () => {
23
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);
24
24
  }, m = () => {
25
- b(), r.current = !1, y(!1), s == null || s(!1), g(!1), d.current = !1, A(!1);
25
+ v(), r.current = !1, b.current = !1, A(!1), s == null || s(!1), g(!1), d.current = !1, M(!1);
26
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
+ D == null || D(e), h.emitAimingChange(e), !e && r.current && !d.current && !O.current && (r.current = !1, f(!1), c.current = setTimeout(() => {
28
28
  m();
29
29
  }, C));
30
- }, { isAiming: v, ref: F } = Re({
30
+ }, { isAiming: E, ref: H } = Re({
31
31
  isEnabled: l && u === i.HOVER,
32
32
  onChange: ce,
33
33
  tolerance: _,
34
34
  idleTimeout: $
35
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
+ O.current = e, !e && r.current && !d.current && !E() && (r.current = !1, f(!1), c.current = setTimeout(() => {
37
37
  m();
38
38
  }, C));
39
39
  }, J = () => {
40
- if (b(), q(!1), u === i.HOVER) {
40
+ if (v(), q(!1), u === i.HOVER) {
41
41
  if (j && ne === i.CLICK || w !== null)
42
42
  return;
43
- if (K) {
43
+ if (L) {
44
44
  f(!1), c.current = setTimeout(() => {
45
45
  m();
46
46
  }, C);
47
47
  return;
48
48
  }
49
- r.current = !0, !v() && !O.current && (r.current = !1, f(!1), c.current = setTimeout(() => {
49
+ r.current = !0, !E() && !O.current && (r.current = !1, f(!1), c.current = setTimeout(() => {
50
50
  m();
51
51
  }, C));
52
52
  } else
@@ -55,67 +55,67 @@ const De = (X) => {
55
55
  preventFocusRestore: e = !1,
56
56
  skipAnimationFlag: t = !1
57
57
  }) => {
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
+ S.current = e, v(), r.current = !1, b.current = !1, q(t), f(!1), A(!1), s == null || s(!1), g(!1), d.current = !1, M(!1);
59
59
  };
60
- E(() => {
61
- l || (P.current = !1);
60
+ y(() => {
61
+ l && (S.current = !1);
62
62
  }, [l]);
63
63
  const le = (e) => {
64
- A(e);
64
+ M(e);
65
65
  }, N = (e) => {
66
66
  if (!(u === i.CLICK && x !== void 0)) {
67
67
  if (e) {
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
+ c.current && (clearTimeout(c.current), c.current = null), r.current && (v(), r.current = !1), u === i.HOVER && f(!0), A(!0), s == null || s(!0), R !== !1 && h.emit({
69
69
  id: I,
70
- isAiming: v
70
+ isAiming: E
71
71
  });
72
72
  return;
73
73
  }
74
74
  u === i.HOVER ? J() : m();
75
75
  }
76
76
  }, fe = (e) => {
77
- L(e), N(e);
77
+ P(e), N(e);
78
78
  }, Q = () => {
79
79
  var e, t;
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(() => {
80
+ b.current = !0, !(u !== i.HOVER || (t = (e = h).isAiming) != null && t.call(e) && h.activeMenuId !== I) && (P(!1), v(), r.current = !1, l ? (g(!0), d.current = !0, f(!0)) : (n.current && (clearTimeout(n.current), n.current = null), f(!0), A(!0), s == null || s(!0), g(!0), d.current = !0, T.current = setTimeout(() => {
81
81
  T.current = null, R !== !1 && h.emit({
82
82
  id: I,
83
- isAiming: v
83
+ isAiming: E
84
84
  });
85
85
  }, 0)));
86
86
  };
87
87
  G.current = Q;
88
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(() => {
89
+ b.current = !1, u === i.HOVER && (P(!1), g(!1), d.current = !1, n.current && (clearTimeout(n.current), n.current = null), r.current && !E() && !O.current && (r.current = !1, f(!1), c.current = setTimeout(() => {
90
90
  m();
91
91
  }, C)));
92
92
  }, de = (e, t) => {
93
- e || A(!1), te(e), re(t);
93
+ e || M(!1), te(e), re(t);
94
94
  };
95
- E(() => R === !1 ? void 0 : h.subscribe(({ id: t }) => {
95
+ y(() => R === !1 ? void 0 : h.subscribe(({ id: t }) => {
96
96
  t !== I && k({
97
97
  preventFocusRestore: !0,
98
98
  skipAnimationFlag: !0
99
99
  });
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(() => {
100
+ }), [I, R]), y(() => u !== i.HOVER ? void 0 : h.subscribeAimingChange((t) => {
101
+ !t && b.current && G.current();
102
+ }), [u]), y(() => {
103
+ !l || u !== i.HOVER || W || (L ? n.current && (clearTimeout(n.current), n.current = null) : n.current || (n.current = setTimeout(() => {
104
104
  J();
105
- }, H)));
106
- }, [u, l, K, H, W]), E(() => {
107
- V == null || V(D);
108
- }, [D]);
105
+ }, V)));
106
+ }, [u, l, L, V, W]), y(() => {
107
+ B == null || B(K);
108
+ }, [K]);
109
109
  const me = () => {
110
110
  const e = [];
111
- F.current && e.push(F.current);
111
+ H.current && e.push(H.current);
112
112
  const t = Array.from(
113
113
  document.querySelectorAll("[data-menu-level]")
114
114
  );
115
115
  return e.push(...t), e;
116
116
  };
117
117
  return Ie({
118
- elements: l ? [F, z] : [],
118
+ elements: l ? [H, z] : [],
119
119
  enabled: l,
120
120
  onFocusOutside: (e) => {
121
121
  var U;
@@ -133,7 +133,7 @@ const De = (X) => {
133
133
  return p;
134
134
  }
135
135
  };
136
- if ((U = M.current) == null || U.call(M, he), p)
136
+ if ((U = F.current) == null || U.call(F, he), p)
137
137
  return;
138
138
  k({ preventFocusRestore: !0 });
139
139
  }
@@ -144,11 +144,11 @@ const De = (X) => {
144
144
  onOpenChange: N,
145
145
  onOpenByKeyboard: fe,
146
146
  triggerRef: z,
147
- contentRef: F,
148
- isAnimatedOpen: D,
147
+ contentRef: H,
148
+ isAnimatedOpen: K,
149
149
  skipAnimation: ee,
150
150
  animationDuration: C,
151
- hoverCloseDelay: H,
151
+ hoverCloseDelay: V,
152
152
  closeMenuImmediately: (e) => {
153
153
  k({ preventFocusRestore: e });
154
154
  },
@@ -160,9 +160,9 @@ const De = (X) => {
160
160
  isChildOpen: j,
161
161
  itemWithFocusedInput: w,
162
162
  setItemWithFocusedInput: ue,
163
- shouldPreventFocusRestore: () => P.current,
163
+ shouldPreventFocusRestore: () => S.current,
164
164
  setOnFocusOutside: (e) => {
165
- M.current = e;
165
+ F.current = e;
166
166
  },
167
167
  isChildAiming: oe,
168
168
  onChildAiming: ie
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.4",
4
+ "version": "1.3.1",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "engines": {
@@ -204,7 +204,7 @@
204
204
  "vite-plugin-svgr": "4.2.0"
205
205
  },
206
206
  "dependencies": {
207
- "@kommo-crm/react-hooks": "1.2.1-beta.2",
207
+ "@kommo-crm/react-hooks": "1.2.1",
208
208
  "@radix-ui/react-dropdown-menu": "2.1.15",
209
209
  "@react-spring/web": "10.0.1",
210
210
  "classnames": "2.5.1",
@@ -221,4 +221,4 @@
221
221
  "react-dom": "^18.0"
222
222
  },
223
223
  "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
224
- }
224
+ }