@kommo-crm/crm-react-ui-kit 1.1.1-beta.0 → 1.1.1-beta.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.
- package/dist/components/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +75 -72
- package/dist/components/ContextMenu/ContextMenu.props.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenu.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/ContextMenu.types.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenu.types.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +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 +64 -56
- package/dist/components/ContextMenu/components/Item/Item.props.d.ts +8 -2
- package/dist/components/ContextMenu/components/Item/Item.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +1 -1
- package/dist/components/ContextMenu/components/Sub/Sub.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Sub/Sub.js +18 -16
- package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts +4 -0
- package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +56 -53
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +1 -1
- package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +53 -50
- package/dist/components/ContextMenu/components/Trigger/Trigger.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Trigger/Trigger.js +24 -24
- 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 +1 -0
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +56 -46
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts +4 -3
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +55 -87
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts +1 -0
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +57 -54
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/useContentPositioning-27D32n5u.mjs +185 -0
- package/package.json +1 -1
- package/dist/useContentPositioning-BIVWgixU.mjs +0 -174
|
@@ -1,82 +1,85 @@
|
|
|
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 p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as E, useImperativeHandle as N } from "react";
|
|
3
|
+
import { R as T } from "../../../../index-BA3njR2k.mjs";
|
|
4
|
+
import { useContextMenuContext as w, ContextMenuProvider as L } from "../../ContextMenu.context.js";
|
|
5
|
+
import { ContextMenuMode as P } from "../../ContextMenu.enums.js";
|
|
6
|
+
import { useContextMenuSubMenu as j } from "../../hooks/useContextMenuSubMenu/useContextMenuSubMenu.js";
|
|
7
|
+
import "../../../../useContentPositioning-27D32n5u.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 e = "ContextMenu.SubRoot", t =
|
|
10
|
+
import { useContextMenuItemContext as B } from "../Item/Item.context.js";
|
|
11
|
+
import { Trigger as K } from "./components/Trigger/Trigger.js";
|
|
12
|
+
import { Content as V } from "./components/Content/Content.js";
|
|
13
|
+
const e = "ContextMenu.SubRoot", t = E(
|
|
14
14
|
({
|
|
15
|
-
children:
|
|
16
|
-
mode:
|
|
17
|
-
onOpen:
|
|
18
|
-
defaultOpen:
|
|
19
|
-
isCloseWithRootMenu:
|
|
20
|
-
...
|
|
21
|
-
},
|
|
15
|
+
children: a,
|
|
16
|
+
mode: l = P.HOVER,
|
|
17
|
+
onOpen: M,
|
|
18
|
+
defaultOpen: d,
|
|
19
|
+
isCloseWithRootMenu: C = !1,
|
|
20
|
+
...f
|
|
21
|
+
}, x) => {
|
|
22
22
|
const {
|
|
23
23
|
animationDuration: n,
|
|
24
24
|
hoverCloseDelay: r,
|
|
25
|
-
closeMenuImmediately:
|
|
26
|
-
} =
|
|
27
|
-
mode:
|
|
28
|
-
open:
|
|
25
|
+
closeMenuImmediately: c
|
|
26
|
+
} = w(e), { subMenuOpen: o, setSubMenuOpen: m } = B(e), y = C ? c : void 0, {
|
|
27
|
+
mode: b,
|
|
28
|
+
open: R,
|
|
29
29
|
onOpenChange: g,
|
|
30
|
-
triggerRef:
|
|
30
|
+
triggerRef: O,
|
|
31
31
|
contentRef: I,
|
|
32
|
-
inheritedArrowColor:
|
|
33
|
-
animatedOpen:
|
|
34
|
-
temporaryHoverClose:
|
|
32
|
+
inheritedArrowColor: v,
|
|
33
|
+
animatedOpen: S,
|
|
34
|
+
temporaryHoverClose: h,
|
|
35
35
|
closeMenuImmediately: i,
|
|
36
|
-
onMouseEnter:
|
|
37
|
-
onMouseLeave:
|
|
36
|
+
onMouseEnter: H,
|
|
37
|
+
onMouseLeave: A,
|
|
38
38
|
enableTemporaryHoverClose: u,
|
|
39
|
-
triggerId:
|
|
40
|
-
|
|
39
|
+
triggerId: D,
|
|
40
|
+
onOpenByKeyboard: s
|
|
41
|
+
} = j({
|
|
41
42
|
displayName: e,
|
|
42
|
-
mode:
|
|
43
|
-
defaultOpen:
|
|
44
|
-
onOpen:
|
|
43
|
+
mode: l,
|
|
44
|
+
defaultOpen: d,
|
|
45
|
+
onOpen: M,
|
|
45
46
|
animationDuration: n,
|
|
46
47
|
subMenuOpen: o,
|
|
47
48
|
setSubMenuOpen: m,
|
|
48
49
|
hoverCloseDelay: r,
|
|
49
|
-
closeRootMenuImmediately:
|
|
50
|
+
closeRootMenuImmediately: y
|
|
50
51
|
});
|
|
51
|
-
return
|
|
52
|
+
return N(x, () => ({
|
|
52
53
|
closeMenuImmediately: i,
|
|
53
|
-
enableTemporaryHoverClose: u
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
enableTemporaryHoverClose: u,
|
|
55
|
+
onOpenByKeyboard: s
|
|
56
|
+
})), /* @__PURE__ */ p(
|
|
57
|
+
L,
|
|
56
58
|
{
|
|
57
|
-
mode:
|
|
58
|
-
triggerRef:
|
|
59
|
+
mode: b,
|
|
60
|
+
triggerRef: O,
|
|
59
61
|
contentRef: I,
|
|
60
|
-
inheritedArrowColor:
|
|
61
|
-
animatedOpen:
|
|
62
|
+
inheritedArrowColor: v,
|
|
63
|
+
animatedOpen: S,
|
|
62
64
|
animationDuration: n,
|
|
63
65
|
hoverCloseDelay: r,
|
|
64
|
-
temporaryHoverClose:
|
|
66
|
+
temporaryHoverClose: h,
|
|
65
67
|
closeMenuImmediately: i,
|
|
66
|
-
onMouseEnter:
|
|
67
|
-
onMouseLeave:
|
|
68
|
+
onMouseEnter: H,
|
|
69
|
+
onMouseLeave: A,
|
|
68
70
|
enableTemporaryHoverClose: u,
|
|
69
71
|
subMenuOpen: o,
|
|
70
72
|
setSubMenuOpen: m,
|
|
71
|
-
triggerId:
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
triggerId: D,
|
|
74
|
+
onOpenByKeyboard: s,
|
|
75
|
+
children: /* @__PURE__ */ p(
|
|
76
|
+
T,
|
|
74
77
|
{
|
|
75
|
-
open:
|
|
78
|
+
open: R || o,
|
|
76
79
|
onOpenChange: g,
|
|
77
80
|
modal: !1,
|
|
78
|
-
...
|
|
79
|
-
children:
|
|
81
|
+
...f,
|
|
82
|
+
children: a
|
|
80
83
|
}
|
|
81
84
|
)
|
|
82
85
|
}
|
|
@@ -84,8 +87,8 @@ const e = "ContextMenu.SubRoot", t = D(
|
|
|
84
87
|
}
|
|
85
88
|
);
|
|
86
89
|
t.displayName = e;
|
|
87
|
-
t.Trigger =
|
|
88
|
-
t.Content =
|
|
90
|
+
t.Trigger = K;
|
|
91
|
+
t.Content = V;
|
|
89
92
|
export {
|
|
90
93
|
t as SubRoot
|
|
91
94
|
};
|
|
@@ -8,7 +8,7 @@ import { LevelProvider as j } from "../../../../providers/LevelProvider/LevelPro
|
|
|
8
8
|
import { useContextMenuContext as k } from "../../../../ContextMenu.context.js";
|
|
9
9
|
import { ContextMenuMode as p } from "../../../../ContextMenu.enums.js";
|
|
10
10
|
import { focusParentItem as z } from "../../../../utils/focusParentItem/focusParentItem.js";
|
|
11
|
-
import { u as F, s as X } from "../../../../../../useContentPositioning-
|
|
11
|
+
import { u as F, s as X } from "../../../../../../useContentPositioning-27D32n5u.mjs";
|
|
12
12
|
import { Direction as Y } from "../../../Content/Content.enums.js";
|
|
13
13
|
import { directionToSide as q } from "../../../Content/Content.utils.js";
|
|
14
14
|
const u = "ContextMenu.Content", J = P(
|
|
@@ -6,7 +6,7 @@ import { mergeRefs as E } from "../../../../../../lib/utils.js";
|
|
|
6
6
|
import { useContextMenuContext as C } from "../../../../ContextMenu.context.js";
|
|
7
7
|
import { ContextMenuMode as D } from "../../../../ContextMenu.enums.js";
|
|
8
8
|
import "../../../../providers/LevelProvider/LevelProvider.js";
|
|
9
|
-
import "../../../../../../useContentPositioning-
|
|
9
|
+
import "../../../../../../useContentPositioning-27D32n5u.mjs";
|
|
10
10
|
import "../../../Content/Content.utils.js";
|
|
11
11
|
import { useContextMenuItemFocus as L } from "../../../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
12
12
|
const r = "ContextMenu.Trigger", N = c(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubTrigger/SubTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAoB1C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"SubTrigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/SubTrigger/SubTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAoB1C,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAgGtB,CAAC"}
|
|
@@ -1,74 +1,77 @@
|
|
|
1
1
|
import { jsx as x } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as E } from "react";
|
|
3
3
|
import { b as P } from "../../../../index-BA3njR2k.mjs";
|
|
4
4
|
import { c as _ } from "../../../../index-L8X2o7IH.mjs";
|
|
5
|
-
import { useLevelContext as
|
|
6
|
-
import { useContextMenuSubContext as
|
|
7
|
-
import { hasItemIcon as
|
|
8
|
-
import { ContextMenuMode as
|
|
9
|
-
import "../../../../useContentPositioning-
|
|
5
|
+
import { useLevelContext as S } from "../../providers/LevelProvider/LevelProvider.js";
|
|
6
|
+
import { useContextMenuSubContext as A } from "../Sub/Sub.context.js";
|
|
7
|
+
import { hasItemIcon as N } from "../../utils/hasItemIcon/hasItemIcon.js";
|
|
8
|
+
import { ContextMenuMode as t } from "../../ContextMenu.enums.js";
|
|
9
|
+
import "../../../../useContentPositioning-27D32n5u.mjs";
|
|
10
10
|
import "../Content/Content.utils.js";
|
|
11
11
|
import "../../ContextMenu.context.js";
|
|
12
|
-
import { useContextMenuItemFocus as
|
|
13
|
-
import '../../../../assets/SubTrigger.css';const
|
|
14
|
-
sub_trigger:
|
|
15
|
-
},
|
|
16
|
-
({ className:
|
|
17
|
-
const { hasItemWithIcon:
|
|
18
|
-
mode:
|
|
19
|
-
open:
|
|
20
|
-
defaultOpen:
|
|
21
|
-
setOpen:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
} =
|
|
27
|
-
dataHighlighted:
|
|
28
|
-
onFocus:
|
|
12
|
+
import { useContextMenuItemFocus as O } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
13
|
+
import '../../../../assets/SubTrigger.css';const T = "_sub_trigger_d2xgz_1", k = {
|
|
14
|
+
sub_trigger: T
|
|
15
|
+
}, i = "ContextMenu.SubTrigger", y = E(
|
|
16
|
+
({ className: g, children: s, isDisabled: u, onKeyDown: n, ...m }, d) => {
|
|
17
|
+
const { hasItemWithIcon: f } = S(i), {
|
|
18
|
+
mode: o,
|
|
19
|
+
open: a,
|
|
20
|
+
defaultOpen: r,
|
|
21
|
+
setOpen: c,
|
|
22
|
+
onMouseEnter: l,
|
|
23
|
+
onMouseLeave: v,
|
|
24
|
+
triggerId: C,
|
|
25
|
+
onOpenByKeyboard: p
|
|
26
|
+
} = A(i), {
|
|
27
|
+
dataHighlighted: M,
|
|
28
|
+
onFocus: L,
|
|
29
29
|
onMouseEnter: I,
|
|
30
|
-
onBlur:
|
|
31
|
-
onMouseLeave:
|
|
32
|
-
} =
|
|
33
|
-
displayName:
|
|
34
|
-
id:
|
|
35
|
-
isDisabled:
|
|
36
|
-
onMouseEnter:
|
|
37
|
-
onMouseLeave:
|
|
30
|
+
onBlur: b,
|
|
31
|
+
onMouseLeave: h
|
|
32
|
+
} = O({
|
|
33
|
+
displayName: i,
|
|
34
|
+
id: C,
|
|
35
|
+
isDisabled: u,
|
|
36
|
+
onMouseEnter: l,
|
|
37
|
+
onMouseLeave: v
|
|
38
38
|
});
|
|
39
39
|
return /* @__PURE__ */ x(
|
|
40
40
|
P,
|
|
41
41
|
{
|
|
42
|
-
ref:
|
|
43
|
-
className: _(
|
|
44
|
-
disabled:
|
|
42
|
+
ref: d,
|
|
43
|
+
className: _(k.sub_trigger, g),
|
|
44
|
+
disabled: u,
|
|
45
45
|
"data-item": !0,
|
|
46
|
-
"data-no-icon-align":
|
|
47
|
-
"data-highlighted":
|
|
46
|
+
"data-no-icon-align": N(s) || !f ? "" : void 0,
|
|
47
|
+
"data-highlighted": a || M === "" || o === t.CLICK && a ? "" : void 0,
|
|
48
48
|
"data-submenu-trigger": !0,
|
|
49
|
-
onFocus: M,
|
|
50
49
|
onMouseEnter: I,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
onClick: (o) => {
|
|
54
|
-
(e === r.CLICK || t !== void 0) && (o.preventDefault(), o.stopPropagation(), t === void 0 && d(!s));
|
|
50
|
+
onKeyDown: (e) => {
|
|
51
|
+
o === t.HOVER && (["Enter", " ", "ArrowRight"].includes(e.key) ? p(!0) : e.key === "ArrowLeft" && (p(!1), e.currentTarget.focus())), n == null || n(e);
|
|
55
52
|
},
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
onFocus: L,
|
|
54
|
+
onBlur: b,
|
|
55
|
+
onMouseLeave: h,
|
|
56
|
+
onClick: (e) => {
|
|
57
|
+
(o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation(), r === void 0 && c(!a));
|
|
58
58
|
},
|
|
59
|
-
|
|
60
|
-
(
|
|
59
|
+
onPointerEnter: (e) => {
|
|
60
|
+
(o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
|
|
61
61
|
},
|
|
62
|
-
|
|
63
|
-
(
|
|
62
|
+
onPointerMove: (e) => {
|
|
63
|
+
(o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
|
|
64
|
+
},
|
|
65
|
+
onPointerLeave: (e) => {
|
|
66
|
+
(o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
|
|
64
67
|
},
|
|
65
68
|
...m,
|
|
66
|
-
children:
|
|
69
|
+
children: s
|
|
67
70
|
}
|
|
68
71
|
);
|
|
69
72
|
}
|
|
70
73
|
);
|
|
71
|
-
|
|
74
|
+
y.displayName = i;
|
|
72
75
|
export {
|
|
73
|
-
|
|
76
|
+
y as SubTrigger
|
|
74
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Trigger/Trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAc1C,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"Trigger.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Trigger/Trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAc1C,eAAO,MAAM,OAAO,kMAoCnB,CAAC"}
|
|
@@ -1,33 +1,33 @@
|
|
|
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
|
-
({ className:
|
|
10
|
-
const { triggerRef: p, mode:
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as x } from "react";
|
|
3
|
+
import { T as M } from "../../../../index-BA3njR2k.mjs";
|
|
4
|
+
import { c as d } from "../../../../index-L8X2o7IH.mjs";
|
|
5
|
+
import { mergeRefs as l } from "../../../../lib/utils.js";
|
|
6
|
+
import { useContextMenuContext as E } from "../../ContextMenu.context.js";
|
|
7
|
+
import { ContextMenuMode as i } from "../../ContextMenu.enums.js";
|
|
8
|
+
const n = "ContextMenu.Trigger", R = x(
|
|
9
|
+
({ className: s, children: f, onKeyDown: e, ...m }, a) => {
|
|
10
|
+
const { triggerRef: p, mode: o, onMouseEnter: g, onMouseLeave: u, onOpenByKeyboard: t } = E(n);
|
|
11
|
+
return /* @__PURE__ */ c(
|
|
12
|
+
M,
|
|
13
13
|
{
|
|
14
|
-
ref:
|
|
15
|
-
className:
|
|
16
|
-
onPointerDown: (
|
|
17
|
-
|
|
14
|
+
ref: l(p, a),
|
|
15
|
+
className: d(s),
|
|
16
|
+
onPointerDown: (r) => {
|
|
17
|
+
o === i.HOVER && (r.preventDefault(), r.stopPropagation());
|
|
18
18
|
},
|
|
19
|
-
onKeyDown: (
|
|
20
|
-
|
|
19
|
+
onKeyDown: (r) => {
|
|
20
|
+
o === i.HOVER && (r.stopPropagation(), ["Enter", " ", "ArrowDown"].includes(r.key) ? t(!0) : r.key === "Escape" && t(!1)), e == null || e(r);
|
|
21
21
|
},
|
|
22
|
-
onMouseEnter:
|
|
23
|
-
onMouseLeave:
|
|
24
|
-
...
|
|
25
|
-
children:
|
|
22
|
+
onMouseEnter: g,
|
|
23
|
+
onMouseLeave: u,
|
|
24
|
+
...m,
|
|
25
|
+
children: f
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
|
|
30
|
+
R.displayName = n;
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
R as Trigger
|
|
33
33
|
};
|
|
@@ -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-27D32n5u.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;;;;EAmM9B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "react";
|
|
2
|
-
import { u as n } from "../../../../useContentPositioning-
|
|
2
|
+
import { u as n } from "../../../../useContentPositioning-27D32n5u.mjs";
|
|
3
3
|
import "../../components/Content/Content.enums.js";
|
|
4
4
|
import "../../components/Content/Content.utils.js";
|
|
5
5
|
export {
|
|
@@ -4,6 +4,7 @@ export declare const useContextMenu: ({ mode: rootMode, defaultOpen, animationDu
|
|
|
4
4
|
open: boolean;
|
|
5
5
|
mode: ContextMenuMode;
|
|
6
6
|
onOpenChange: (value: boolean) => void;
|
|
7
|
+
onOpenByKeyboard: (value: boolean) => void;
|
|
7
8
|
inheritedArrowColor: string | null;
|
|
8
9
|
triggerRef: import('react').RefObject<HTMLButtonElement>;
|
|
9
10
|
contentRef: import('react').RefObject<HTMLDivElement>;
|
|
@@ -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;;;0BA4EW,OAAO;8BA2BP,OAAO;;;;;;;;;;;;CAkIzC,CAAC"}
|
|
@@ -1,63 +1,73 @@
|
|
|
1
|
-
import { useId as
|
|
2
|
-
import { ContextMenuMode as
|
|
1
|
+
import { useId as k, useState as l, useRef as a, useEffect as V } from "react";
|
|
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 z } from "../useInheritedArrowColor/useInheritedArrowColor.js";
|
|
5
|
+
import "../../../../useContentPositioning-27D32n5u.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:
|
|
8
|
+
import { useIsTouchDevice as D } from "../useIsTouchDevice/useIsTouchDevice.js";
|
|
9
|
+
import { contextMenuBus as b } from "../../utils/contextMenuBus/contextMenuBus.js";
|
|
10
|
+
const Z = ({
|
|
11
|
+
mode: g,
|
|
12
|
+
defaultOpen: h,
|
|
13
|
+
animationDuration: R,
|
|
14
|
+
hoverCloseDelay: d,
|
|
15
15
|
onOpen: T
|
|
16
16
|
}) => {
|
|
17
|
-
const
|
|
18
|
-
e.current && (clearTimeout(e.current), e.current = null),
|
|
19
|
-
}, v = () => {
|
|
20
|
-
l(!1), o(!1), d(!1);
|
|
21
|
-
}, E = () => {
|
|
22
|
-
M(), t === u.HOVER || r ? (c(!1), n.current = setTimeout(() => {
|
|
23
|
-
v();
|
|
24
|
-
}, h)) : v();
|
|
17
|
+
const f = k(), [c, m] = l(h || !1), [x, u] = l(!1), [I, s] = l(!1), [M, p] = l(!1), [n, C] = l(!1), B = a(null), y = a(null), e = a(null), r = a(null), t = D() ? o.CLICK : g, E = () => {
|
|
18
|
+
e.current && (clearTimeout(e.current), e.current = null), r.current && (clearTimeout(r.current), r.current = null);
|
|
25
19
|
}, H = () => {
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
20
|
+
m(!1), s(!1), C(!1);
|
|
21
|
+
}, v = () => {
|
|
22
|
+
E(), t === o.HOVER || n ? (u(!1), r.current = setTimeout(() => {
|
|
23
|
+
H();
|
|
24
|
+
}, R)) : H();
|
|
25
|
+
}, O = () => {
|
|
26
|
+
E(), u(!1), m(!1), s(!1), C(!1);
|
|
27
|
+
}, K = (i) => {
|
|
28
|
+
t === o.CLICK && h !== void 0 || (i ? (r.current && (clearTimeout(r.current), r.current = null), (t === o.HOVER || n) && u(!0), m(!0), T == null || T(!0), setTimeout(() => b.emit(f), 0)) : v());
|
|
29
|
+
}, L = (i) => {
|
|
30
|
+
p(i), K(i);
|
|
29
31
|
}, A = () => {
|
|
30
|
-
t !==
|
|
32
|
+
t !== o.HOVER && !n || (p(!1), r.current && (clearTimeout(r.current), r.current = null, u(!0)), c ? s(!0) : (e.current && (clearTimeout(e.current), e.current = null), u(!0), m(!0), s(!0), setTimeout(() => b.emit(f), 0)));
|
|
31
33
|
}, w = () => {
|
|
32
|
-
t !==
|
|
33
|
-
},
|
|
34
|
-
|
|
34
|
+
t !== o.HOVER && !n || (p(!1), e.current && (clearTimeout(e.current), e.current = null), s(!1));
|
|
35
|
+
}, q = () => {
|
|
36
|
+
u(!0), s(!0), C(!0);
|
|
35
37
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}), [
|
|
39
|
-
!
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
}, [
|
|
43
|
-
|
|
38
|
+
V(() => b.subscribe((j) => {
|
|
39
|
+
j !== f && O();
|
|
40
|
+
}), [f]), V(() => {
|
|
41
|
+
!c || t !== o.HOVER && !n || M || (I ? e.current && (clearTimeout(e.current), e.current = null) : e.current || (e.current = setTimeout(() => {
|
|
42
|
+
v();
|
|
43
|
+
}, d)));
|
|
44
|
+
}, [
|
|
45
|
+
t,
|
|
46
|
+
c,
|
|
47
|
+
I,
|
|
48
|
+
n,
|
|
49
|
+
d,
|
|
50
|
+
M
|
|
51
|
+
]);
|
|
52
|
+
const S = z(c, y);
|
|
44
53
|
return {
|
|
45
|
-
open:
|
|
54
|
+
open: c,
|
|
46
55
|
mode: t,
|
|
47
|
-
onOpenChange:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
onOpenChange: K,
|
|
57
|
+
onOpenByKeyboard: L,
|
|
58
|
+
inheritedArrowColor: S,
|
|
59
|
+
triggerRef: B,
|
|
60
|
+
contentRef: y,
|
|
61
|
+
animatedOpen: x,
|
|
62
|
+
animationDuration: R,
|
|
63
|
+
hoverCloseDelay: d,
|
|
64
|
+
temporaryHoverClose: n,
|
|
65
|
+
closeMenuImmediately: O,
|
|
56
66
|
onMouseEnter: A,
|
|
57
67
|
onMouseLeave: w,
|
|
58
|
-
enableTemporaryHoverClose:
|
|
68
|
+
enableTemporaryHoverClose: q
|
|
59
69
|
};
|
|
60
70
|
};
|
|
61
71
|
export {
|
|
62
|
-
|
|
72
|
+
Z as useContextMenu
|
|
63
73
|
};
|
|
@@ -4,9 +4,10 @@ export declare function useContextMenuSub({ displayName, mode: initialMode, defa
|
|
|
4
4
|
setOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
5
5
|
animatedOpen: boolean;
|
|
6
6
|
startAnimation: () => void;
|
|
7
|
-
handleMouseEnter: (
|
|
8
|
-
handleMouseLeave: (
|
|
9
|
-
handleOpenChange: (
|
|
7
|
+
handleMouseEnter: () => void;
|
|
8
|
+
handleMouseLeave: () => void;
|
|
9
|
+
handleOpenChange: (value: boolean) => void;
|
|
10
|
+
onOpenByKeyboard: (value: boolean) => void;
|
|
10
11
|
triggerId: string;
|
|
11
12
|
};
|
|
12
13
|
//# sourceMappingURL=useContextMenuSub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextMenuSub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,IAAI,EAAE,WAAW,EACjB,WAAW,GACZ,EAAE,wBAAwB
|
|
1
|
+
{"version":3,"file":"useContextMenuSub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAErE,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,IAAI,EAAE,WAAW,EACjB,WAAW,GACZ,EAAE,wBAAwB;;;;;;;8BAyEQ,OAAO;8BAmCP,OAAO;;EA4GzC"}
|