@kommo-crm/crm-react-ui-kit 1.3.0 → 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,
|
|
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
|
|
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:
|
|
12
|
+
hoverCloseDelay: V,
|
|
13
13
|
isOpen: R,
|
|
14
14
|
onOpen: s,
|
|
15
|
-
onAnimatedOpen:
|
|
16
|
-
onAiming:
|
|
15
|
+
onAnimatedOpen: B,
|
|
16
|
+
onAiming: D,
|
|
17
17
|
onFocusOutside: Z,
|
|
18
18
|
aimingTolerance: _,
|
|
19
19
|
aimingIdleTimeout: $
|
|
20
|
-
} = X, I = Ce(), [l,
|
|
20
|
+
} = X, I = Ce(), [l, A] = a(
|
|
21
21
|
R ?? x ?? !1
|
|
22
|
-
), [
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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 && !
|
|
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 (
|
|
40
|
+
if (v(), q(!1), u === i.HOVER) {
|
|
41
41
|
if (j && ne === i.CLICK || w !== null)
|
|
42
42
|
return;
|
|
43
|
-
if (
|
|
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, !
|
|
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
|
-
|
|
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
|
-
|
|
61
|
-
l
|
|
60
|
+
y(() => {
|
|
61
|
+
l && (S.current = !1);
|
|
62
62
|
}, [l]);
|
|
63
63
|
const le = (e) => {
|
|
64
|
-
|
|
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 && (
|
|
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:
|
|
70
|
+
isAiming: E
|
|
71
71
|
});
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
u === i.HOVER ? J() : m();
|
|
75
75
|
}
|
|
76
76
|
}, fe = (e) => {
|
|
77
|
-
|
|
77
|
+
P(e), N(e);
|
|
78
78
|
}, Q = () => {
|
|
79
79
|
var e, t;
|
|
80
|
-
|
|
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:
|
|
83
|
+
isAiming: E
|
|
84
84
|
});
|
|
85
85
|
}, 0)));
|
|
86
86
|
};
|
|
87
87
|
G.current = Q;
|
|
88
88
|
const ae = () => {
|
|
89
|
-
|
|
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 ||
|
|
93
|
+
e || M(!1), te(e), re(t);
|
|
94
94
|
};
|
|
95
|
-
|
|
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]),
|
|
101
|
-
!t &&
|
|
102
|
-
}), [u]),
|
|
103
|
-
!l || u !== i.HOVER || W || (
|
|
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
|
-
},
|
|
106
|
-
}, [u, l,
|
|
107
|
-
|
|
108
|
-
}, [
|
|
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
|
-
|
|
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 ? [
|
|
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 =
|
|
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:
|
|
148
|
-
isAnimatedOpen:
|
|
147
|
+
contentRef: H,
|
|
148
|
+
isAnimatedOpen: K,
|
|
149
149
|
skipAnimation: ee,
|
|
150
150
|
animationDuration: C,
|
|
151
|
-
hoverCloseDelay:
|
|
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: () =>
|
|
163
|
+
shouldPreventFocusRestore: () => S.current,
|
|
164
164
|
setOnFocusOutside: (e) => {
|
|
165
|
-
|
|
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.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"engines": {
|
|
@@ -221,4 +221,4 @@
|
|
|
221
221
|
"react-dom": "^18.0"
|
|
222
222
|
},
|
|
223
223
|
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
224
|
-
}
|
|
224
|
+
}
|