@kommo-crm/crm-react-ui-kit 1.1.1-beta.1 → 1.1.1-beta.4
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/assets/ItemRightSlot.css +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +64 -43
- package/dist/components/ContextMenu/components/Content/Content.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Content/Content.js +1 -1
- package/dist/components/ContextMenu/components/Content/index.js +1 -1
- package/dist/components/ContextMenu/components/Item/Item.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Item/Item.js +77 -58
- package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.js +44 -21
- package/dist/components/ContextMenu/components/RadioItem/RadioItem.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +60 -33
- package/dist/components/ContextMenu/components/Sub/Sub.js +1 -1
- package/dist/components/ContextMenu/components/SubContent/SubContent.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubContent/SubContent.js +64 -52
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +83 -74
- package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +58 -36
- package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +82 -60
- package/dist/components/ContextMenu/components/Trigger/Trigger.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Trigger/Trigger.js +40 -22
- package/dist/components/ContextMenu/hooks/index.js +1 -1
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +57 -57
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +40 -40
- package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.d.ts +11 -10
- package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.js +17 -15
- package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.d.ts +3 -0
- package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.d.ts.map +1 -0
- package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.js +1 -0
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/useContentPositioning-BLCC-Xty.mjs +213 -0
- package/package.json +2 -2
- package/dist/useContentPositioning-27D32n5u.mjs +0 -185
|
@@ -1,33 +1,51 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { T as
|
|
4
|
-
import { c as
|
|
5
|
-
import { mergeRefs as
|
|
6
|
-
import { useContextMenuContext as
|
|
7
|
-
import { ContextMenuMode as
|
|
8
|
-
const
|
|
9
|
-
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as R } from "react";
|
|
3
|
+
import { T as E } from "../../../../index-BA3njR2k.mjs";
|
|
4
|
+
import { c as T } from "../../../../index-L8X2o7IH.mjs";
|
|
5
|
+
import { mergeRefs as n } from "../../../../lib/utils.js";
|
|
6
|
+
import { useContextMenuContext as A } from "../../ContextMenu.context.js";
|
|
7
|
+
import { ContextMenuMode as p } from "../../ContextMenu.enums.js";
|
|
8
|
+
const s = "ContextMenu.Trigger", M = R(
|
|
9
|
+
({
|
|
10
|
+
className: a,
|
|
11
|
+
children: g,
|
|
12
|
+
onKeyDown: t,
|
|
13
|
+
onMouseEnter: e,
|
|
14
|
+
onMouseLeave: f,
|
|
15
|
+
onPointerDown: m,
|
|
16
|
+
...x
|
|
17
|
+
}, c) => {
|
|
18
|
+
const {
|
|
19
|
+
triggerRef: d,
|
|
20
|
+
mode: o,
|
|
21
|
+
onMouseEnter: l,
|
|
22
|
+
onMouseLeave: u,
|
|
23
|
+
onOpenByKeyboard: i
|
|
24
|
+
} = A(s);
|
|
25
|
+
return /* @__PURE__ */ C(
|
|
26
|
+
E,
|
|
13
27
|
{
|
|
14
|
-
ref:
|
|
15
|
-
className:
|
|
28
|
+
ref: n(d, c),
|
|
29
|
+
className: T(a),
|
|
16
30
|
onPointerDown: (r) => {
|
|
17
|
-
o ===
|
|
31
|
+
o === p.HOVER && (r.preventDefault(), r.stopPropagation()), m == null || m(r);
|
|
18
32
|
},
|
|
19
33
|
onKeyDown: (r) => {
|
|
20
|
-
o ===
|
|
34
|
+
o === p.HOVER && (r.stopPropagation(), ["Enter", " ", "ArrowDown"].includes(r.key) ? i(!0) : r.key === "Escape" && i(!1)), t == null || t(r);
|
|
21
35
|
},
|
|
22
|
-
onMouseEnter:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
onMouseEnter: (r) => {
|
|
37
|
+
l(r), e == null || e(r);
|
|
38
|
+
},
|
|
39
|
+
onMouseLeave: (r) => {
|
|
40
|
+
u(r), f == null || f(r);
|
|
41
|
+
},
|
|
42
|
+
...x,
|
|
43
|
+
children: g
|
|
26
44
|
}
|
|
27
45
|
);
|
|
28
46
|
}
|
|
29
47
|
);
|
|
30
|
-
|
|
48
|
+
M.displayName = s;
|
|
31
49
|
export {
|
|
32
|
-
|
|
50
|
+
M as Trigger
|
|
33
51
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useContextMenu as t } from "./useContextMenu/useContextMenu.js";
|
|
2
2
|
import { useContextMenuSubMenu as u } from "./useContextMenuSubMenu/useContextMenuSubMenu.js";
|
|
3
3
|
import { useInheritedArrowColor as s } from "./useInheritedArrowColor/useInheritedArrowColor.js";
|
|
4
|
-
import { u as m } from "../../../useContentPositioning-
|
|
4
|
+
import { u as m } from "../../../useContentPositioning-BLCC-Xty.mjs";
|
|
5
5
|
import { useContextMenuSub as p } from "./useContextMenuSub/useContextMenuSub.js";
|
|
6
6
|
import { useContextMenuItemFocus as i } from "./useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
7
7
|
import { useIsTouchDevice as c } from "./useIsTouchDevice/useIsTouchDevice.js";
|
package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContentPositioning.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,WAAe,EACf,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,QAAQ,GACT,EAAE,4BAA4B;;;;
|
|
1
|
+
{"version":3,"file":"useContentPositioning.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,WAAe,EACf,sBAAsB,EACtB,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,QAAQ,GACT,EAAE,4BAA4B;;;;EAsO9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import { u as n } from "../../../../useContentPositioning-
|
|
2
|
+
import { u as n } from "../../../../useContentPositioning-BLCC-Xty.mjs";
|
|
3
3
|
import "../../components/Content/Content.enums.js";
|
|
4
4
|
import "../../components/Content/Content.utils.js";
|
|
5
5
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,eAAO,MAAM,cAAc,iFAMxB,qBAAqB;;;
|
|
1
|
+
{"version":3,"file":"useContextMenu.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,eAAO,MAAM,cAAc,iFAMxB,qBAAqB;;;0BA8EW,OAAO;8BA2BP,OAAO;;;;;;;;;;;;CAmIzC,CAAC"}
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
import { useId as
|
|
1
|
+
import { useId as z, useState as f, useRef as d, useEffect as x } from "react";
|
|
2
2
|
import { ContextMenuMode as o } from "../../ContextMenu.enums.js";
|
|
3
3
|
import "../../providers/LevelProvider/LevelProvider.js";
|
|
4
|
-
import { useInheritedArrowColor as
|
|
5
|
-
import "../../../../useContentPositioning-
|
|
4
|
+
import { useInheritedArrowColor as D } from "../useInheritedArrowColor/useInheritedArrowColor.js";
|
|
5
|
+
import "../../../../useContentPositioning-BLCC-Xty.mjs";
|
|
6
6
|
import "../../components/Content/Content.utils.js";
|
|
7
7
|
import "../../ContextMenu.context.js";
|
|
8
|
-
import { useIsTouchDevice as
|
|
9
|
-
import { contextMenuBus as
|
|
10
|
-
const
|
|
11
|
-
mode:
|
|
12
|
-
defaultOpen:
|
|
13
|
-
animationDuration:
|
|
14
|
-
hoverCloseDelay:
|
|
15
|
-
onOpen:
|
|
8
|
+
import { useIsTouchDevice as F } from "../useIsTouchDevice/useIsTouchDevice.js";
|
|
9
|
+
import { contextMenuBus as h } from "../../utils/contextMenuBus/contextMenuBus.js";
|
|
10
|
+
const _ = ({
|
|
11
|
+
mode: B,
|
|
12
|
+
defaultOpen: R,
|
|
13
|
+
animationDuration: I,
|
|
14
|
+
hoverCloseDelay: T,
|
|
15
|
+
onOpen: r
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
e.current && (clearTimeout(e.current), e.current = null),
|
|
19
|
-
}, H = () => {
|
|
20
|
-
m(!1), s(!1), C(!1);
|
|
17
|
+
const a = z(), [i, m] = f(R || !1), [L, c] = f(!1), [M, n] = f(!1), [y, C] = f(!1), [s, b] = f(!1), A = d(null), E = d(null), e = d(null), t = d(null), u = F() ? o.CLICK : B, H = () => {
|
|
18
|
+
e.current && (clearTimeout(e.current), e.current = null), t.current && (clearTimeout(t.current), t.current = null);
|
|
21
19
|
}, v = () => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
|
|
20
|
+
m(!1), r == null || r(!1), n(!1), b(!1);
|
|
21
|
+
}, K = () => {
|
|
22
|
+
H(), u === o.HOVER || s ? (c(!1), t.current = setTimeout(() => {
|
|
23
|
+
v();
|
|
24
|
+
}, I)) : v();
|
|
25
|
+
}, V = () => {
|
|
26
|
+
H(), c(!1), m(!1), r == null || r(!1), n(!1), b(!1);
|
|
27
|
+
}, g = (l) => {
|
|
28
|
+
u === o.CLICK && R !== void 0 || (l ? (t.current && (clearTimeout(t.current), t.current = null), (u === o.HOVER || s) && c(!0), m(!0), r == null || r(!0), setTimeout(() => h.emit(a), 0)) : K());
|
|
29
|
+
}, p = (l) => {
|
|
30
|
+
C(l), g(l);
|
|
33
31
|
}, w = () => {
|
|
34
|
-
|
|
32
|
+
u !== o.HOVER && !s || (C(!1), t.current && (clearTimeout(t.current), t.current = null, c(!0)), i ? n(!0) : (e.current && (clearTimeout(e.current), e.current = null), c(!0), m(!0), r == null || r(!0), n(!0), setTimeout(() => h.emit(a), 0)));
|
|
35
33
|
}, q = () => {
|
|
36
|
-
u(!
|
|
34
|
+
u !== o.HOVER && !s || (C(!1), e.current && (clearTimeout(e.current), e.current = null), n(!1));
|
|
35
|
+
}, S = () => {
|
|
36
|
+
c(!0), n(!0), b(!0);
|
|
37
37
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}), [
|
|
41
|
-
!
|
|
42
|
-
|
|
43
|
-
},
|
|
38
|
+
x(() => h.subscribe((k) => {
|
|
39
|
+
k !== a && V();
|
|
40
|
+
}), [a]), x(() => {
|
|
41
|
+
!i || u !== o.HOVER && !s || y || (M ? e.current && (clearTimeout(e.current), e.current = null) : e.current || (e.current = setTimeout(() => {
|
|
42
|
+
K();
|
|
43
|
+
}, T)));
|
|
44
44
|
}, [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
u,
|
|
46
|
+
i,
|
|
47
|
+
M,
|
|
48
|
+
s,
|
|
49
|
+
T,
|
|
50
|
+
y
|
|
51
51
|
]);
|
|
52
|
-
const
|
|
52
|
+
const j = D(i, E);
|
|
53
53
|
return {
|
|
54
|
-
open:
|
|
55
|
-
mode:
|
|
56
|
-
onOpenChange:
|
|
57
|
-
onOpenByKeyboard:
|
|
58
|
-
inheritedArrowColor:
|
|
59
|
-
triggerRef:
|
|
60
|
-
contentRef:
|
|
61
|
-
animatedOpen:
|
|
62
|
-
animationDuration:
|
|
63
|
-
hoverCloseDelay:
|
|
64
|
-
temporaryHoverClose:
|
|
65
|
-
closeMenuImmediately:
|
|
66
|
-
onMouseEnter:
|
|
67
|
-
onMouseLeave:
|
|
68
|
-
enableTemporaryHoverClose:
|
|
54
|
+
open: i,
|
|
55
|
+
mode: u,
|
|
56
|
+
onOpenChange: g,
|
|
57
|
+
onOpenByKeyboard: p,
|
|
58
|
+
inheritedArrowColor: j,
|
|
59
|
+
triggerRef: A,
|
|
60
|
+
contentRef: E,
|
|
61
|
+
animatedOpen: L,
|
|
62
|
+
animationDuration: I,
|
|
63
|
+
hoverCloseDelay: T,
|
|
64
|
+
temporaryHoverClose: s,
|
|
65
|
+
closeMenuImmediately: V,
|
|
66
|
+
onMouseEnter: w,
|
|
67
|
+
onMouseLeave: q,
|
|
68
|
+
enableTemporaryHoverClose: S
|
|
69
69
|
};
|
|
70
70
|
};
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
_ as useContextMenu
|
|
73
73
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useId as L, useState as a, useRef as v, useEffect as x } from "react";
|
|
2
2
|
import { ContextMenuMode as s } from "../../ContextMenu.enums.js";
|
|
3
3
|
import { useLevelContext as g } from "../../providers/LevelProvider/LevelProvider.js";
|
|
4
|
-
import "../../../../useContentPositioning-
|
|
4
|
+
import "../../../../useContentPositioning-BLCC-Xty.mjs";
|
|
5
5
|
import "../../components/Content/Content.utils.js";
|
|
6
6
|
import { useIsTouchDevice as B } from "../useIsTouchDevice/useIsTouchDevice.js";
|
|
7
7
|
import { useContextMenuContext as A } from "../../ContextMenu.context.js";
|
package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts.map
CHANGED
|
@@ -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;;;
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import { useId as Q, useState as
|
|
2
|
-
import { ContextMenuMode as
|
|
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
3
|
import { useInheritedArrowColor as W } from "../useInheritedArrowColor/useInheritedArrowColor.js";
|
|
4
|
-
import "../../../../useContentPositioning-
|
|
4
|
+
import "../../../../useContentPositioning-BLCC-Xty.mjs";
|
|
5
5
|
import "../../components/Content/Content.utils.js";
|
|
6
6
|
import "../../ContextMenu.context.js";
|
|
7
7
|
import { useLevelContext as X } from "../../providers/LevelProvider/LevelProvider.js";
|
|
@@ -9,62 +9,62 @@ import { useIsTouchDevice as Y } from "../useIsTouchDevice/useIsTouchDevice.js";
|
|
|
9
9
|
const tr = ({
|
|
10
10
|
displayName: j,
|
|
11
11
|
mode: k,
|
|
12
|
-
defaultOpen:
|
|
13
|
-
animationDuration:
|
|
14
|
-
subMenuOpen:
|
|
12
|
+
defaultOpen: K,
|
|
13
|
+
animationDuration: V,
|
|
14
|
+
subMenuOpen: m,
|
|
15
15
|
setSubMenuOpen: t,
|
|
16
|
-
hoverCloseDelay:
|
|
17
|
-
closeRootMenuImmediately:
|
|
18
|
-
onOpen:
|
|
16
|
+
hoverCloseDelay: E,
|
|
17
|
+
closeRootMenuImmediately: u,
|
|
18
|
+
onOpen: e
|
|
19
19
|
}) => {
|
|
20
|
-
const
|
|
21
|
-
r.current && (clearTimeout(r.current), r.current = null),
|
|
22
|
-
}, I = (
|
|
23
|
-
t == null || t(!1), y(!1),
|
|
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
24
|
}, w = () => {
|
|
25
|
-
B(),
|
|
25
|
+
B(), f === a.HOVER || o ? (l(!1), c.current = setTimeout(() => {
|
|
26
26
|
I();
|
|
27
|
-
},
|
|
28
|
-
}, q = (
|
|
29
|
-
B(),
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
}, F = (
|
|
33
|
-
|
|
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
34
|
}, G = () => {
|
|
35
|
-
|
|
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
36
|
}, J = () => {
|
|
37
|
-
|
|
37
|
+
h(!1), !(f !== a.HOVER && !o) && (r.current && (clearTimeout(r.current), r.current = null), T(!1));
|
|
38
38
|
}, N = () => {
|
|
39
|
-
|
|
39
|
+
l(!0), T(!0), L(!0);
|
|
40
40
|
};
|
|
41
41
|
U(() => {
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
|
|
45
|
-
}, [
|
|
46
|
-
!
|
|
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
47
|
w();
|
|
48
|
-
},
|
|
49
|
-
}, [
|
|
50
|
-
const P = W(
|
|
48
|
+
}, E)));
|
|
49
|
+
}, [f, i, x, o, E]);
|
|
50
|
+
const P = W(i, A);
|
|
51
51
|
return {
|
|
52
|
-
open:
|
|
53
|
-
mode:
|
|
54
|
-
onOpenChange:
|
|
52
|
+
open: i,
|
|
53
|
+
mode: f,
|
|
54
|
+
onOpenChange: d,
|
|
55
55
|
onOpenByKeyboard: F,
|
|
56
56
|
inheritedArrowColor: P,
|
|
57
57
|
triggerRef: D,
|
|
58
58
|
contentRef: A,
|
|
59
|
-
animatedOpen:
|
|
60
|
-
animationDuration:
|
|
61
|
-
hoverCloseDelay:
|
|
62
|
-
temporaryHoverClose:
|
|
59
|
+
animatedOpen: g,
|
|
60
|
+
animationDuration: V,
|
|
61
|
+
hoverCloseDelay: E,
|
|
62
|
+
temporaryHoverClose: o,
|
|
63
63
|
closeMenuImmediately: q,
|
|
64
64
|
onMouseEnter: G,
|
|
65
65
|
onMouseLeave: J,
|
|
66
66
|
enableTemporaryHoverClose: N,
|
|
67
|
-
triggerId:
|
|
67
|
+
triggerId: H
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
export {
|
package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { DivHandlers } from './useStopContextMenuEvents.types';
|
|
2
|
+
export declare const useStopContextMenuEvents: (handlers?: Partial<DivHandlers>) => {
|
|
3
|
+
onClick: (e: import('react').MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
4
|
+
onKeyDown: (e: import('react').KeyboardEvent<HTMLDivElement>) => void;
|
|
5
|
+
onKeyUp: (e: import('react').KeyboardEvent<HTMLDivElement>) => void;
|
|
6
|
+
onKeyPress: (e: import('react').KeyboardEvent<HTMLDivElement>) => void;
|
|
7
|
+
onPointerDown: (e: import('react').PointerEvent<HTMLDivElement>) => void;
|
|
8
|
+
onPointerUp: (e: import('react').PointerEvent<HTMLDivElement>) => void;
|
|
9
|
+
onPointerEnter: (e: import('react').PointerEvent<HTMLDivElement>) => void;
|
|
10
|
+
onPointerLeave: (e: import('react').PointerEvent<HTMLDivElement>) => void;
|
|
11
|
+
onPointerMove: (e: import('react').PointerEvent<HTMLDivElement>) => void;
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=useStopContextMenuEvents.d.ts.map
|
package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStopContextMenuEvents.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"useStopContextMenuEvents.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAE/D,eAAO,MAAM,wBAAwB,cACzB,OAAO,CAAC,WAAW,CAAC;4EASd,IAAI;qEAAJ,IAAI;mEAAJ,IAAI;sEAAJ,IAAI;wEAAJ,IAAI;sEAAJ,IAAI;yEAAJ,IAAI;yEAAJ,IAAI;wEAAJ,IAAI;CAiBrB,CAAC"}
|
package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
}, [])
|
|
1
|
+
import { useCallback as P } from "react";
|
|
2
|
+
const c = (o = {}) => {
|
|
3
|
+
const i = P((t) => {
|
|
4
|
+
t.stopPropagation();
|
|
5
|
+
}, []), n = (t) => (e) => {
|
|
6
|
+
i(e), t == null || t(e);
|
|
7
|
+
};
|
|
6
8
|
return {
|
|
7
|
-
onClick: o,
|
|
8
|
-
onKeyDown: o,
|
|
9
|
-
onKeyUp: o,
|
|
10
|
-
onKeyPress: o,
|
|
11
|
-
onPointerDown: o,
|
|
12
|
-
onPointerUp: o,
|
|
13
|
-
onPointerEnter: o,
|
|
14
|
-
onPointerLeave: o,
|
|
15
|
-
onPointerMove: o
|
|
9
|
+
onClick: n(o.onClick),
|
|
10
|
+
onKeyDown: n(o.onKeyDown),
|
|
11
|
+
onKeyUp: n(o.onKeyUp),
|
|
12
|
+
onKeyPress: n(o.onKeyPress),
|
|
13
|
+
onPointerDown: n(o.onPointerDown),
|
|
14
|
+
onPointerUp: n(o.onPointerUp),
|
|
15
|
+
onPointerEnter: n(o.onPointerEnter),
|
|
16
|
+
onPointerLeave: n(o.onPointerLeave),
|
|
17
|
+
onPointerMove: n(o.onPointerMove)
|
|
16
18
|
};
|
|
17
19
|
};
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
c as useStopContextMenuEvents
|
|
20
22
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
export type DivHandlers = Pick<ComponentProps<'div'>, 'onClick' | 'onKeyDown' | 'onKeyUp' | 'onKeyPress' | 'onPointerDown' | 'onPointerUp' | 'onPointerEnter' | 'onPointerLeave' | 'onPointerMove'>;
|
|
3
|
+
//# sourceMappingURL=useStopContextMenuEvents.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useStopContextMenuEvents.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG,IAAI,CAC5B,cAAc,CAAC,KAAK,CAAC,EACnB,SAAS,GACT,WAAW,GACX,SAAS,GACT,YAAY,GACZ,eAAe,GACf,aAAa,GACb,gBAAgB,GAChB,gBAAgB,GAChB,eAAe,CAClB,CAAC"}
|
package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -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-
|
|
3
|
+
import "../../useContentPositioning-BLCC-Xty.mjs";
|
|
4
4
|
import { Direction as p } from "./components/Content/Content.enums.js";
|
|
5
5
|
import "./components/Content/Content.utils.js";
|
|
6
6
|
export {
|