@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.
- package/dist/components/ContextMenu/ContextMenu.context.d.ts +4 -2
- package/dist/components/ContextMenu/ContextMenu.context.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.context.js +7 -4
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +83 -80
- package/dist/components/ContextMenu/ContextMenu.props.d.ts +14 -0
- package/dist/components/ContextMenu/ContextMenu.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +1 -1
- 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 +75 -71
- package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +1 -1
- package/dist/components/ContextMenu/components/Sub/Sub.js +2 -1
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +67 -64
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.props.d.ts +4 -0
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +38 -40
- package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +2 -2
- package/dist/components/ContextMenu/hooks/index.js +1 -1
- package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts +2 -1
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +72 -61
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.types.d.ts +4 -0
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.types.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +51 -49
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +71 -63
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.types.d.ts +4 -0
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.types.d.ts.map +1 -1
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/{useContentPositioning-DO7ZotnD.mjs → useContentPositioning-DAKfbddS.mjs} +66 -65
- package/package.json +1 -1
|
@@ -1,94 +1,97 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { R as
|
|
4
|
-
import { useContextMenuContext as
|
|
5
|
-
import { ContextMenuMode as
|
|
6
|
-
import { useContextMenuSubMenu as
|
|
7
|
-
import "../../../../useContentPositioning-
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as N, useImperativeHandle as T } from "react";
|
|
3
|
+
import { R as w } from "../../../../index-BA3njR2k.mjs";
|
|
4
|
+
import { useContextMenuContext as L, ContextMenuProvider as P } from "../../ContextMenu.context.js";
|
|
5
|
+
import { ContextMenuMode as j } from "../../ContextMenu.enums.js";
|
|
6
|
+
import { useContextMenuSubMenu as B } from "../../hooks/useContextMenuSubMenu/useContextMenuSubMenu.js";
|
|
7
|
+
import "../../../../useContentPositioning-DAKfbddS.mjs";
|
|
8
8
|
import "../Content/Content.utils.js";
|
|
9
9
|
import "../../providers/LevelProvider/LevelProvider.js";
|
|
10
|
-
import { useContextMenuItemContext as
|
|
11
|
-
import { Trigger as
|
|
12
|
-
import { Content as
|
|
13
|
-
const
|
|
10
|
+
import { useContextMenuItemContext as K } from "../Item/Item.context.js";
|
|
11
|
+
import { Trigger as V } from "./components/Trigger/Trigger.js";
|
|
12
|
+
import { Content as Y } from "./components/Content/Content.js";
|
|
13
|
+
const o = "ContextMenu.SubRoot", t = N(
|
|
14
14
|
({
|
|
15
|
-
children:
|
|
16
|
-
mode:
|
|
17
|
-
onOpen:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
children: l,
|
|
16
|
+
mode: M = j.HOVER,
|
|
17
|
+
onOpen: d,
|
|
18
|
+
onAnimatedOpen: C,
|
|
19
|
+
defaultOpen: f,
|
|
20
|
+
isCloseWithRootMenu: c = !1,
|
|
21
|
+
...x
|
|
22
|
+
}, y) => {
|
|
22
23
|
const {
|
|
23
24
|
animationDuration: n,
|
|
24
25
|
hoverCloseDelay: r,
|
|
25
|
-
closeMenuImmediately:
|
|
26
|
-
} =
|
|
27
|
-
mode:
|
|
28
|
-
open:
|
|
26
|
+
closeMenuImmediately: O
|
|
27
|
+
} = L(o), { subMenuOpen: e, setSubMenuOpen: m } = K(o), b = c ? O : void 0, {
|
|
28
|
+
mode: R,
|
|
29
|
+
open: i,
|
|
29
30
|
onOpenChange: g,
|
|
30
|
-
triggerRef:
|
|
31
|
-
contentRef:
|
|
32
|
-
inheritedArrowColor:
|
|
33
|
-
animatedOpen:
|
|
34
|
-
temporaryHoverClose:
|
|
35
|
-
closeMenuImmediately:
|
|
36
|
-
onMouseEnter:
|
|
37
|
-
onMouseLeave:
|
|
31
|
+
triggerRef: I,
|
|
32
|
+
contentRef: v,
|
|
33
|
+
inheritedArrowColor: S,
|
|
34
|
+
animatedOpen: h,
|
|
35
|
+
temporaryHoverClose: H,
|
|
36
|
+
closeMenuImmediately: s,
|
|
37
|
+
onMouseEnter: A,
|
|
38
|
+
onMouseLeave: D,
|
|
38
39
|
enableTemporaryHoverClose: u,
|
|
39
|
-
triggerId:
|
|
40
|
-
onOpenByKeyboard:
|
|
41
|
-
} =
|
|
42
|
-
displayName:
|
|
43
|
-
mode:
|
|
44
|
-
defaultOpen:
|
|
45
|
-
onOpen:
|
|
40
|
+
triggerId: E,
|
|
41
|
+
onOpenByKeyboard: p
|
|
42
|
+
} = B({
|
|
43
|
+
displayName: o,
|
|
44
|
+
mode: M,
|
|
45
|
+
defaultOpen: f,
|
|
46
|
+
onOpen: d,
|
|
47
|
+
onAnimatedOpen: C,
|
|
46
48
|
animationDuration: n,
|
|
47
|
-
subMenuOpen:
|
|
49
|
+
subMenuOpen: e,
|
|
48
50
|
setSubMenuOpen: m,
|
|
49
51
|
hoverCloseDelay: r,
|
|
50
|
-
closeRootMenuImmediately:
|
|
52
|
+
closeRootMenuImmediately: b
|
|
51
53
|
});
|
|
52
|
-
return
|
|
53
|
-
closeMenuImmediately:
|
|
54
|
+
return T(y, () => ({
|
|
55
|
+
closeMenuImmediately: s,
|
|
54
56
|
enableTemporaryHoverClose: u,
|
|
55
|
-
onOpenByKeyboard:
|
|
56
|
-
})), /* @__PURE__ */
|
|
57
|
-
|
|
57
|
+
onOpenByKeyboard: p
|
|
58
|
+
})), /* @__PURE__ */ a(
|
|
59
|
+
P,
|
|
58
60
|
{
|
|
59
|
-
mode:
|
|
60
|
-
triggerRef:
|
|
61
|
-
contentRef:
|
|
62
|
-
inheritedArrowColor:
|
|
63
|
-
animatedOpen:
|
|
61
|
+
mode: R,
|
|
62
|
+
triggerRef: I,
|
|
63
|
+
contentRef: v,
|
|
64
|
+
inheritedArrowColor: S,
|
|
65
|
+
animatedOpen: h,
|
|
64
66
|
animationDuration: n,
|
|
65
67
|
hoverCloseDelay: r,
|
|
66
|
-
temporaryHoverClose:
|
|
67
|
-
closeMenuImmediately:
|
|
68
|
-
onMouseEnter:
|
|
69
|
-
onMouseLeave:
|
|
68
|
+
temporaryHoverClose: H,
|
|
69
|
+
closeMenuImmediately: s,
|
|
70
|
+
onMouseEnter: A,
|
|
71
|
+
onMouseLeave: D,
|
|
70
72
|
enableTemporaryHoverClose: u,
|
|
71
|
-
subMenuOpen:
|
|
73
|
+
subMenuOpen: e,
|
|
72
74
|
setSubMenuOpen: m,
|
|
73
|
-
triggerId:
|
|
74
|
-
onOpenByKeyboard:
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
triggerId: E,
|
|
76
|
+
onOpenByKeyboard: p,
|
|
77
|
+
isOpen: e || i,
|
|
78
|
+
children: /* @__PURE__ */ a(
|
|
79
|
+
w,
|
|
77
80
|
{
|
|
78
|
-
open:
|
|
81
|
+
open: i || e,
|
|
79
82
|
onOpenChange: g,
|
|
80
83
|
modal: !1,
|
|
81
|
-
...
|
|
82
|
-
children:
|
|
84
|
+
...x,
|
|
85
|
+
children: l
|
|
83
86
|
}
|
|
84
87
|
)
|
|
85
88
|
}
|
|
86
89
|
);
|
|
87
90
|
}
|
|
88
91
|
);
|
|
89
|
-
t.displayName =
|
|
90
|
-
t.Trigger =
|
|
91
|
-
t.Content =
|
|
92
|
+
t.displayName = o;
|
|
93
|
+
t.Trigger = V;
|
|
94
|
+
t.Content = Y;
|
|
92
95
|
export {
|
|
93
96
|
t as SubRoot
|
|
94
97
|
};
|
|
@@ -5,6 +5,10 @@ export type ContextMenuSubRootProps = Omit<RadixDropdownMenuRootProps, 'onOpenCh
|
|
|
5
5
|
* Called whenever the open state of the menu changes.
|
|
6
6
|
*/
|
|
7
7
|
onOpen?: (open: boolean) => void;
|
|
8
|
+
/**
|
|
9
|
+
* Called whenever the animated open state of the menu changes.
|
|
10
|
+
*/
|
|
11
|
+
onAnimatedOpen?: (open: boolean) => void;
|
|
8
12
|
/**
|
|
9
13
|
* Defines how the menu is triggered.
|
|
10
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubRoot.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubRoot/SubRoot.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAErG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,0BAA0B,EAC1B,cAAc,GAAG,OAAO,CACzB,GAAG;IACF;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC"}
|
|
1
|
+
{"version":3,"file":"SubRoot.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubRoot/SubRoot.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAErG,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,0BAA0B,EAC1B,cAAc,GAAG,OAAO,CACzB,GAAG;IACF;;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;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { LevelProvider as X } from "../../../../providers/LevelProvider/LevelPro
|
|
|
8
8
|
import { useContextMenuContext as Y } from "../../../../ContextMenu.context.js";
|
|
9
9
|
import { ContextMenuMode as g } from "../../../../ContextMenu.enums.js";
|
|
10
10
|
import { focusParentItem as q } from "../../../../utils/focusParentItem/focusParentItem.js";
|
|
11
|
-
import { u as J, s as K } from "../../../../../../useContentPositioning-
|
|
11
|
+
import { u as J, s as K } from "../../../../../../useContentPositioning-DAKfbddS.mjs";
|
|
12
12
|
import { Direction as Q } from "../../../Content/Content.enums.js";
|
|
13
13
|
import { directionToSide as U } from "../../../Content/Content.utils.js";
|
|
14
14
|
const x = "ContextMenu.Content", V = L(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAe1C,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAe1C,eAAO,MAAM,OAAO,kMA6EnB,CAAC"}
|
|
@@ -1,72 +1,70 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { T as
|
|
4
|
-
import { mergeRefs as
|
|
5
|
-
import { useContextMenuContext as
|
|
6
|
-
import { ContextMenuMode as
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as c } from "react";
|
|
3
|
+
import { T as v } from "../../../../../../index-BA3njR2k.mjs";
|
|
4
|
+
import { mergeRefs as y } from "../../../../../../lib/utils.js";
|
|
5
|
+
import { useContextMenuContext as A } from "../../../../ContextMenu.context.js";
|
|
6
|
+
import { ContextMenuMode as E } from "../../../../ContextMenu.enums.js";
|
|
7
7
|
import "../../../../providers/LevelProvider/LevelProvider.js";
|
|
8
|
-
import "../../../../../../useContentPositioning-
|
|
8
|
+
import "../../../../../../useContentPositioning-DAKfbddS.mjs";
|
|
9
9
|
import "../../../Content/Content.utils.js";
|
|
10
|
-
import { useContextMenuItemFocus as
|
|
11
|
-
const
|
|
10
|
+
import { useContextMenuItemFocus as j } from "../../../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
11
|
+
const a = "ContextMenu.Trigger", D = c(
|
|
12
12
|
({
|
|
13
|
-
className:
|
|
14
|
-
children:
|
|
13
|
+
className: x,
|
|
14
|
+
children: u,
|
|
15
15
|
onFocus: r,
|
|
16
16
|
onBlur: e,
|
|
17
|
-
onMouseEnter:
|
|
18
|
-
onMouseLeave:
|
|
19
|
-
onPointerDown:
|
|
20
|
-
...
|
|
21
|
-
},
|
|
17
|
+
onMouseEnter: o,
|
|
18
|
+
onMouseLeave: i,
|
|
19
|
+
onPointerDown: m,
|
|
20
|
+
...C
|
|
21
|
+
}, n) => {
|
|
22
22
|
const {
|
|
23
|
-
triggerRef:
|
|
24
|
-
mode:
|
|
23
|
+
triggerRef: M,
|
|
24
|
+
mode: d,
|
|
25
25
|
onMouseEnter: R,
|
|
26
26
|
onMouseLeave: T,
|
|
27
27
|
triggerId: N
|
|
28
|
-
} =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
displayName: s,
|
|
28
|
+
} = A(a), {
|
|
29
|
+
onFocus: p,
|
|
30
|
+
onMouseEnter: f,
|
|
31
|
+
onBlur: g,
|
|
32
|
+
onMouseLeave: s
|
|
33
|
+
} = j({
|
|
34
|
+
displayName: a,
|
|
36
35
|
id: N || "",
|
|
37
36
|
isDisabled: !1,
|
|
38
37
|
onMouseEnter: R,
|
|
39
38
|
onMouseLeave: T
|
|
40
39
|
});
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
|
|
40
|
+
return /* @__PURE__ */ b(
|
|
41
|
+
v,
|
|
43
42
|
{
|
|
44
|
-
ref:
|
|
45
|
-
className:
|
|
46
|
-
"data-highlighted": b,
|
|
43
|
+
ref: y(M, n),
|
|
44
|
+
className: x,
|
|
47
45
|
onPointerDown: (t) => {
|
|
48
|
-
|
|
46
|
+
d === E.HOVER && t.preventDefault(), t.stopPropagation(), m == null || m(t);
|
|
49
47
|
},
|
|
50
48
|
onMouseEnter: (t) => {
|
|
51
|
-
|
|
49
|
+
f == null || f(t), o == null || o(t);
|
|
52
50
|
},
|
|
53
51
|
onMouseLeave: (t) => {
|
|
54
|
-
|
|
52
|
+
s == null || s(t), i == null || i(t);
|
|
55
53
|
},
|
|
56
54
|
onFocus: (t) => {
|
|
57
|
-
t.preventDefault(), t.stopPropagation(),
|
|
55
|
+
t.preventDefault(), t.stopPropagation(), p == null || p(), r == null || r(t);
|
|
58
56
|
},
|
|
59
57
|
onBlur: (t) => {
|
|
60
|
-
|
|
58
|
+
g == null || g(), e == null || e(t);
|
|
61
59
|
},
|
|
62
60
|
"data-submenu-trigger": !0,
|
|
63
|
-
...
|
|
64
|
-
children:
|
|
61
|
+
...C,
|
|
62
|
+
children: u
|
|
65
63
|
}
|
|
66
64
|
);
|
|
67
65
|
}
|
|
68
66
|
);
|
|
69
|
-
|
|
67
|
+
D.displayName = a;
|
|
70
68
|
export {
|
|
71
|
-
|
|
69
|
+
D as Trigger
|
|
72
70
|
};
|
|
@@ -6,9 +6,9 @@ import { useLevelContext as q } from "../../providers/LevelProvider/LevelProvide
|
|
|
6
6
|
import { useContextMenuSubContext as D } from "../Sub/Sub.context.js";
|
|
7
7
|
import { hasItemIcon as V } from "../../utils/hasItemIcon/hasItemIcon.js";
|
|
8
8
|
import { ContextMenuMode as i } from "../../ContextMenu.enums.js";
|
|
9
|
-
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
10
|
-
import "../Content/Content.utils.js";
|
|
11
9
|
import "../../ContextMenu.context.js";
|
|
10
|
+
import "../../../../useContentPositioning-DAKfbddS.mjs";
|
|
11
|
+
import "../Content/Content.utils.js";
|
|
12
12
|
import { useContextMenuItemFocus as W } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
13
13
|
import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_ip3hq_1", w = {
|
|
14
14
|
sub_trigger: Y
|
|
@@ -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-DAKfbddS.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import { u as n } from "../../../../useContentPositioning-
|
|
2
|
+
import { u as n } from "../../../../useContentPositioning-DAKfbddS.mjs";
|
|
3
3
|
import "../../components/Content/Content.enums.js";
|
|
4
4
|
import "../../components/Content/Content.utils.js";
|
|
5
5
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContextMenuMode } from '../../ContextMenu.enums';
|
|
2
2
|
import { UseContextMenuOptions } from './useContextMenu.types';
|
|
3
|
-
export declare const useContextMenu: ({ mode: rootMode, defaultOpen, animationDuration, hoverCloseDelay, onOpen, }: UseContextMenuOptions) => {
|
|
3
|
+
export declare const useContextMenu: ({ mode: rootMode, defaultOpen, animationDuration, hoverCloseDelay, onOpen, onAnimatedOpen, }: UseContextMenuOptions) => {
|
|
4
4
|
open: boolean;
|
|
5
5
|
mode: ContextMenuMode;
|
|
6
6
|
onOpenChange: (value: boolean) => void;
|
|
@@ -16,5 +16,6 @@ export declare const useContextMenu: ({ mode: rootMode, defaultOpen, animationDu
|
|
|
16
16
|
onMouseEnter: () => void;
|
|
17
17
|
onMouseLeave: () => void;
|
|
18
18
|
enableTemporaryHoverClose: () => void;
|
|
19
|
+
onChildClickOpen: (value: boolean) => void;
|
|
19
20
|
};
|
|
20
21
|
//# sourceMappingURL=useContextMenu.d.ts.map
|
|
@@ -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,
|
|
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,iGAOxB,qBAAqB;;;0BAmFW,OAAO;8BA2BP,OAAO;;;;;;;;;;;;8BAmEH,OAAO;CA8E7C,CAAC"}
|
|
@@ -1,73 +1,84 @@
|
|
|
1
|
-
import { useId as
|
|
2
|
-
import { ContextMenuMode as
|
|
1
|
+
import { useId as N, useState as n, useRef as C, useEffect as R } from "react";
|
|
2
|
+
import { ContextMenuMode as l } from "../../ContextMenu.enums.js";
|
|
3
3
|
import "../../providers/LevelProvider/LevelProvider.js";
|
|
4
|
-
import { useInheritedArrowColor as D } from "../useInheritedArrowColor/useInheritedArrowColor.js";
|
|
5
|
-
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
6
|
-
import "../../components/Content/Content.utils.js";
|
|
7
4
|
import "../../ContextMenu.context.js";
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
import { useInheritedArrowColor as P } from "../useInheritedArrowColor/useInheritedArrowColor.js";
|
|
6
|
+
import "../../../../useContentPositioning-DAKfbddS.mjs";
|
|
7
|
+
import "../../components/Content/Content.utils.js";
|
|
8
|
+
import { useIsTouchDevice as Q } from "../useIsTouchDevice/useIsTouchDevice.js";
|
|
9
|
+
import { contextMenuBus as M } from "../../utils/contextMenuBus/contextMenuBus.js";
|
|
10
|
+
const re = ({
|
|
11
|
+
mode: L,
|
|
12
|
+
defaultOpen: y,
|
|
13
|
+
animationDuration: E,
|
|
14
|
+
hoverCloseDelay: d,
|
|
15
|
+
onOpen: r,
|
|
16
|
+
onAnimatedOpen: T
|
|
16
17
|
}) => {
|
|
17
|
-
const a =
|
|
18
|
+
const a = N(), [f, m] = n(y || !1), [h, o] = n(!1), [H, i] = n(!1), [v, b] = n(!1), [u, I] = n(!1), [p, w] = n(!1), q = C(null), K = C(null), e = C(null), t = C(null), s = Q() ? l.CLICK : L, V = () => {
|
|
18
19
|
e.current && (clearTimeout(e.current), e.current = null), t.current && (clearTimeout(t.current), t.current = null);
|
|
19
|
-
},
|
|
20
|
-
m(!1), r == null || r(!1),
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
}, g = () => {
|
|
21
|
+
m(!1), r == null || r(!1), i(!1), I(!1);
|
|
22
|
+
}, k = () => {
|
|
23
|
+
if (V(), s === l.HOVER || u) {
|
|
24
|
+
if (p)
|
|
25
|
+
return;
|
|
26
|
+
o(!1), t.current = setTimeout(() => {
|
|
27
|
+
g();
|
|
28
|
+
}, E);
|
|
29
|
+
} else
|
|
30
|
+
g();
|
|
31
|
+
}, x = () => {
|
|
32
|
+
V(), o(!1), m(!1), r == null || r(!1), i(!1), I(!1);
|
|
33
|
+
}, B = (c) => {
|
|
34
|
+
s === l.CLICK && y !== void 0 || (c ? (t.current && (clearTimeout(t.current), t.current = null), (s === l.HOVER || u) && o(!0), m(!0), r == null || r(!0), setTimeout(() => M.emit(a), 0)) : k());
|
|
35
|
+
}, S = (c) => {
|
|
36
|
+
b(c), B(c);
|
|
37
|
+
}, j = () => {
|
|
38
|
+
s !== l.HOVER && !u || (b(!1), t.current && (clearTimeout(t.current), t.current = null, o(!0)), f ? i(!0) : (e.current && (clearTimeout(e.current), e.current = null), o(!0), m(!0), r == null || r(!0), i(!0), setTimeout(() => M.emit(a), 0)));
|
|
39
|
+
}, z = () => {
|
|
40
|
+
s !== l.HOVER && !u || (b(!1), i(!1), e.current && (clearTimeout(e.current), e.current = null));
|
|
41
|
+
}, D = () => {
|
|
42
|
+
o(!0), i(!0), I(!0);
|
|
43
|
+
}, F = (c) => {
|
|
44
|
+
w(c);
|
|
37
45
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}), [a]),
|
|
41
|
-
!
|
|
42
|
-
|
|
43
|
-
},
|
|
46
|
+
R(() => M.subscribe((J) => {
|
|
47
|
+
J !== a && x();
|
|
48
|
+
}), [a]), R(() => {
|
|
49
|
+
!f || s !== l.HOVER && !u || v || (H ? e.current && (clearTimeout(e.current), e.current = null) : e.current || (e.current = setTimeout(() => {
|
|
50
|
+
k();
|
|
51
|
+
}, d)));
|
|
44
52
|
}, [
|
|
45
|
-
u,
|
|
46
|
-
i,
|
|
47
|
-
M,
|
|
48
53
|
s,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
f,
|
|
55
|
+
H,
|
|
56
|
+
u,
|
|
57
|
+
d,
|
|
58
|
+
v
|
|
59
|
+
]), R(() => {
|
|
60
|
+
T == null || T(h);
|
|
61
|
+
}, [h]);
|
|
62
|
+
const G = P(f, K);
|
|
53
63
|
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:
|
|
64
|
+
open: f,
|
|
65
|
+
mode: s,
|
|
66
|
+
onOpenChange: B,
|
|
67
|
+
onOpenByKeyboard: S,
|
|
68
|
+
inheritedArrowColor: G,
|
|
69
|
+
triggerRef: q,
|
|
70
|
+
contentRef: K,
|
|
71
|
+
animatedOpen: h,
|
|
72
|
+
animationDuration: E,
|
|
73
|
+
hoverCloseDelay: d,
|
|
74
|
+
temporaryHoverClose: u,
|
|
75
|
+
closeMenuImmediately: x,
|
|
76
|
+
onMouseEnter: j,
|
|
77
|
+
onMouseLeave: z,
|
|
78
|
+
enableTemporaryHoverClose: D,
|
|
79
|
+
onChildClickOpen: F
|
|
69
80
|
};
|
|
70
81
|
};
|
|
71
82
|
export {
|
|
72
|
-
|
|
83
|
+
re as useContextMenu
|
|
73
84
|
};
|
|
@@ -21,6 +21,10 @@ export interface UseContextMenuOptions {
|
|
|
21
21
|
* The callback function to be called when the context menu is opened.
|
|
22
22
|
*/
|
|
23
23
|
onOpen?: (open: boolean) => void;
|
|
24
|
+
/**
|
|
25
|
+
* The callback function to be called when the context menu is animated open.
|
|
26
|
+
*/
|
|
27
|
+
onAnimatedOpen?: (open: boolean) => void;
|
|
24
28
|
/**
|
|
25
29
|
* Whether the context menu should close when another menu is opened.
|
|
26
30
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextMenu.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;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":"useContextMenu.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenu/useContextMenu.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAExC,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,eAAe,CAAC;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B;;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextMenuSub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useContextMenuSub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,IAAI,EAAE,WAAW,EACjB,WAAW,EACX,MAAM,GACP,EAAE,wBAAwB;;;;;;;8BA8EQ,OAAO;8BAsCP,OAAO;;EAyHzC"}
|