@kommo-crm/crm-react-ui-kit 1.1.1-beta.4 → 1.1.1-beta.6
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/CheckboxItem.css +1 -1
- package/dist/assets/Item2.css +1 -1
- package/dist/assets/ItemRightSlot.css +1 -1
- package/dist/assets/Label2.css +1 -1
- package/dist/assets/RadioItem.css +1 -1
- package/dist/assets/SubTrigger.css +1 -1
- package/dist/components/ContextMenu/ContextMenu.js +1 -1
- package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +28 -28
- 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.js +9 -9
- package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.js +13 -13
- package/dist/components/ContextMenu/components/Label/Label.js +8 -8
- package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +16 -16
- package/dist/components/ContextMenu/components/Sub/Sub.d.ts +1 -1
- package/dist/components/ContextMenu/components/Sub/Sub.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/Sub/Sub.js +33 -31
- package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts +5 -1
- package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts.map +1 -1
- package/dist/components/ContextMenu/components/SubContent/SubContent.js +1 -1
- package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +1 -1
- package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +2 -2
- package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +1 -1
- package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +24 -24
- 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.js +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +51 -50
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.types.d.ts +4 -0
- package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.types.d.ts.map +1 -1
- package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +1 -1
- package/dist/components/ContextMenu/index.js +1 -1
- package/dist/{useContentPositioning-BLCC-Xty.mjs → useContentPositioning-DO7ZotnD.mjs} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._checkbox_item_j9dmr_1{position:relative;display:flex;align-items:center;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._checkbox_item_j9dmr_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._checkbox_item_j9dmr_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._checkbox_item_j9dmr_1[data-state=checked]{color:var(--crm-ui-kit-palette-active-element-900)}._checkbox_item_j9dmr_1[data-no-icon-align]{padding:10px 16px}._checkbox_item_j9dmr_1>:not(:last-child){margin-right:8px}
|
package/dist/assets/Item2.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._item_zkanf_1{position:relative;display:flex;align-items:center;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._item_zkanf_1[data-not-selectable]{cursor:auto;-webkit-user-select:text;user-select:text;padding:10px 16px}._item_zkanf_1[data-has-submenu]{padding:0 0 0 40px}._item_zkanf_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._item_zkanf_1[data-danger]{color:var(--crm-ui-kit-color-error)}._item_zkanf_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._item_zkanf_1[data-no-icon-align]{padding-left:16px}._item_zkanf_1>:not(:last-child){margin-right:8px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._rightSlot_n7bd4_1{display:flex;align-items:center;margin-left:auto;padding-left:16px}._rightSlot_n7bd4_1>:not(:last-child){margin-right:8px}._rightSlot_n7bd4_1[data-submenu-right-slot]{padding-left:0}
|
package/dist/assets/Label2.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._label_1sne1_1{position:relative;display:flex;align-items:center;outline:none;padding:10px 16px 10px 40px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary)}._label_1sne1_1[data-no-icon-align]{padding:10px 16px}._label_1sne1_1>:not(:last-child){margin-right:8px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._radio_item_14d4r_1{position:relative;display:flex;align-items:center;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._radio_item_14d4r_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._radio_item_14d4r_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._radio_item_14d4r_1[data-state=checked]{color:var(--crm-ui-kit-palette-active-element-900)}._radio_item_14d4r_1[data-no-icon-align]{padding:10px 16px}._radio_item_14d4r_1>:not(:last-child){margin-right:8px}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._sub_trigger_ip3hq_1{position:relative;display:flex;align-items:center;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._sub_trigger_ip3hq_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._sub_trigger_ip3hq_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._sub_trigger_ip3hq_1[data-no-icon-align]{padding:10px 16px}._sub_trigger_ip3hq_1>:not(:last-child){margin-right:8px}
|
|
@@ -3,7 +3,7 @@ import { forwardRef as M, useImperativeHandle as y } from "react";
|
|
|
3
3
|
import { R as v } from "../../index-BA3njR2k.mjs";
|
|
4
4
|
import { useContextMenu as x } from "./hooks/useContextMenu/useContextMenu.js";
|
|
5
5
|
import "./providers/LevelProvider/LevelProvider.js";
|
|
6
|
-
import { C as D } from "../../useContentPositioning-
|
|
6
|
+
import { C as D } from "../../useContentPositioning-DO7ZotnD.mjs";
|
|
7
7
|
import "./components/Content/Content.utils.js";
|
|
8
8
|
import { ContextMenuProvider as O, DISPLAY_NAME as T } from "./ContextMenu.context.js";
|
|
9
9
|
import { Trigger as L } from "./components/Trigger/Trigger.js";
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { d as
|
|
4
|
-
import { c as
|
|
5
|
-
import { useLevelContext as
|
|
6
|
-
import { useContextMenuContext as
|
|
7
|
-
import { hasItemIcon as
|
|
8
|
-
import "../../../../useContentPositioning-
|
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as u, useId as v, useMemo as w } from "react";
|
|
3
|
+
import { d as H } from "../../../../index-BA3njR2k.mjs";
|
|
4
|
+
import { c as P } from "../../../../index-L8X2o7IH.mjs";
|
|
5
|
+
import { useLevelContext as R } from "../../providers/LevelProvider/LevelProvider.js";
|
|
6
|
+
import { useContextMenuContext as W } from "../../ContextMenu.context.js";
|
|
7
|
+
import { hasItemIcon as Y } from "../../utils/hasItemIcon/hasItemIcon.js";
|
|
8
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
9
9
|
import "../Content/Content.utils.js";
|
|
10
|
-
import { useContextMenuItemFocus as
|
|
11
|
-
import '../../../../assets/CheckboxItem.css';const z = "
|
|
10
|
+
import { useContextMenuItemFocus as q } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
11
|
+
import '../../../../assets/CheckboxItem.css';const z = "_checkbox_item_j9dmr_1", D = {
|
|
12
12
|
checkbox_item: z
|
|
13
|
-
}, m = "ContextMenu.CheckboxItem", G =
|
|
13
|
+
}, m = "ContextMenu.CheckboxItem", G = u(
|
|
14
14
|
({
|
|
15
15
|
className: k,
|
|
16
16
|
children: o,
|
|
17
|
-
onChange:
|
|
17
|
+
onChange: h,
|
|
18
18
|
isDisabled: f,
|
|
19
19
|
isChecked: C,
|
|
20
|
-
hasIconCheckFn:
|
|
20
|
+
hasIconCheckFn: n = Y,
|
|
21
21
|
onFocus: c,
|
|
22
22
|
onMouseEnter: i,
|
|
23
23
|
onBlur: e,
|
|
24
24
|
onMouseLeave: r,
|
|
25
25
|
onSelect: s,
|
|
26
|
-
...
|
|
27
|
-
},
|
|
28
|
-
const
|
|
26
|
+
...I
|
|
27
|
+
}, _) => {
|
|
28
|
+
const b = v(), { hasItemWithIcon: g } = R(m), { closeMenuImmediately: N } = W(m), {
|
|
29
29
|
dataHighlighted: y,
|
|
30
30
|
onFocus: a,
|
|
31
31
|
onMouseEnter: x,
|
|
32
32
|
onBlur: p,
|
|
33
|
-
onMouseLeave:
|
|
34
|
-
} =
|
|
33
|
+
onMouseLeave: d
|
|
34
|
+
} = q({
|
|
35
35
|
displayName: m,
|
|
36
|
-
id:
|
|
36
|
+
id: b,
|
|
37
37
|
isDisabled: f
|
|
38
|
-
}),
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
38
|
+
}), j = w(() => n(o), [o]);
|
|
39
|
+
return /* @__PURE__ */ A(
|
|
40
|
+
H,
|
|
41
41
|
{
|
|
42
|
-
ref:
|
|
43
|
-
className:
|
|
42
|
+
ref: _,
|
|
43
|
+
className: P(D.checkbox_item, k),
|
|
44
44
|
disabled: f,
|
|
45
45
|
checked: C,
|
|
46
46
|
"data-item": !0,
|
|
47
|
-
"data-no-icon-align":
|
|
47
|
+
"data-no-icon-align": j || !g ? "" : void 0,
|
|
48
48
|
onCheckedChange: (t) => {
|
|
49
|
-
|
|
49
|
+
h && h({
|
|
50
50
|
target: { checked: t }
|
|
51
51
|
});
|
|
52
52
|
},
|
|
@@ -64,9 +64,9 @@ import '../../../../assets/CheckboxItem.css';const z = "_checkbox_item_16brq_1",
|
|
|
64
64
|
p == null || p(), e == null || e(t);
|
|
65
65
|
},
|
|
66
66
|
onMouseLeave: (t) => {
|
|
67
|
-
|
|
67
|
+
d == null || d(t), r == null || r(t);
|
|
68
68
|
},
|
|
69
|
-
...
|
|
69
|
+
...I,
|
|
70
70
|
children: o
|
|
71
71
|
}
|
|
72
72
|
);
|
|
@@ -7,7 +7,7 @@ import "../../../../lib/utils.js";
|
|
|
7
7
|
import "../../providers/LevelProvider/LevelProvider.js";
|
|
8
8
|
import "../../ContextMenu.context.js";
|
|
9
9
|
import "../../ContextMenu.enums.js";
|
|
10
|
-
import { C as b } from "../../../../useContentPositioning-
|
|
10
|
+
import { C as b } from "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
11
11
|
import "./Content.enums.js";
|
|
12
12
|
import "./Content.utils.js";
|
|
13
13
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as e } from "../../../../useContentPositioning-
|
|
1
|
+
import { C as e } from "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
2
2
|
import { Direction as i } from "./Content.enums.js";
|
|
3
3
|
import { directionToSide as f } from "./Content.utils.js";
|
|
4
4
|
export {
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as K, useMemo as N, useId as W, useState as v, useRef as Y, useEffect as G } from "react";
|
|
3
3
|
import { I as J } from "../../../../index-BA3njR2k.mjs";
|
|
4
4
|
import { c as y } from "../../../../index-L8X2o7IH.mjs";
|
|
5
5
|
import { mergeRefs as Q } from "../../../../lib/utils.js";
|
|
6
6
|
import { useLevelContext as T } from "../../providers/LevelProvider/LevelProvider.js";
|
|
7
7
|
import { useContextMenuContext as U } from "../../ContextMenu.context.js";
|
|
8
8
|
import { hasItemIcon as k } from "../../utils/hasItemIcon/hasItemIcon.js";
|
|
9
|
-
import "../../../../useContentPositioning-
|
|
9
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
10
10
|
import "../Content/Content.utils.js";
|
|
11
11
|
import { useContextMenuItemFocus as V } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
12
12
|
import { ContextMenuItemProvider as X } from "./Item.context.js";
|
|
13
|
-
import '../../../../assets/Item2.css';const Z = "
|
|
13
|
+
import '../../../../assets/Item2.css';const Z = "_item_zkanf_1", R = {
|
|
14
14
|
item: Z
|
|
15
|
-
}, s = "ContextMenu.Item", $ =
|
|
15
|
+
}, s = "ContextMenu.Item", $ = K((t, p) => {
|
|
16
16
|
const { hasItemWithIcon: x } = T(s);
|
|
17
17
|
if ("isSelectable" in t && t.isSelectable === !1) {
|
|
18
18
|
const {
|
|
@@ -20,16 +20,16 @@ import '../../../../assets/Item2.css';const Z = "_item_128tk_1", R = {
|
|
|
20
20
|
children: I,
|
|
21
21
|
isSelectable: j,
|
|
22
22
|
hasIconCheckFn: q = k,
|
|
23
|
-
...
|
|
24
|
-
} = t,
|
|
23
|
+
...z
|
|
24
|
+
} = t, B = N(() => q(I), [I]);
|
|
25
25
|
return /* @__PURE__ */ b(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
28
28
|
ref: p,
|
|
29
29
|
className: y(R.item, e),
|
|
30
30
|
"data-not-selectable": !j,
|
|
31
|
-
"data-no-icon-align":
|
|
32
|
-
...
|
|
31
|
+
"data-no-icon-align": B || !x ? "" : void 0,
|
|
32
|
+
...z,
|
|
33
33
|
children: I
|
|
34
34
|
}
|
|
35
35
|
);
|
|
@@ -47,7 +47,7 @@ import '../../../../assets/Item2.css';const Z = "_item_128tk_1", R = {
|
|
|
47
47
|
onMouseLeave: u,
|
|
48
48
|
onKeyDown: l,
|
|
49
49
|
...w
|
|
50
|
-
} = t, A =
|
|
50
|
+
} = t, A = W(), [M, S] = v(!1), [o, E] = v(!1), n = Y(null), H = N(() => _(a), [a]), { closeMenuImmediately: L } = U(s), {
|
|
51
51
|
dataHighlighted: O,
|
|
52
52
|
onFocus: d,
|
|
53
53
|
onMouseEnter: f,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as x } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as v, useRef as E, useState as _, useEffect as H } from "react";
|
|
3
3
|
import { c as I } from "../../../../index-L8X2o7IH.mjs";
|
|
4
4
|
import { mergeRefs as M } from "../../../../lib/utils.js";
|
|
5
5
|
import { useStopContextMenuEvents as N } from "../../hooks/useStopContextMenuEvents/useStopContextMenuEvents.js";
|
|
6
|
-
import '../../../../assets/ItemRightSlot.css';const
|
|
7
|
-
rightSlot:
|
|
8
|
-
},
|
|
6
|
+
import '../../../../assets/ItemRightSlot.css';const y = "_rightSlot_n7bd4_1", A = {
|
|
7
|
+
rightSlot: y
|
|
8
|
+
}, C = "ContextMenu.ItemRightSlot", j = v(
|
|
9
9
|
({
|
|
10
10
|
className: s,
|
|
11
11
|
children: e,
|
|
@@ -19,13 +19,13 @@ import '../../../../assets/ItemRightSlot.css';const q = "_rightSlot_13wq6_1", w
|
|
|
19
19
|
onPointerLeave: l,
|
|
20
20
|
onPointerMove: g,
|
|
21
21
|
...S
|
|
22
|
-
},
|
|
23
|
-
const t = E(null), [o,
|
|
22
|
+
}, d) => {
|
|
23
|
+
const t = E(null), [o, p] = _(!1);
|
|
24
24
|
H(() => {
|
|
25
25
|
if (!t.current)
|
|
26
26
|
return;
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const b = t.current.querySelector("[data-submenu-trigger]");
|
|
28
|
+
p(!!b);
|
|
29
29
|
}, [e]);
|
|
30
30
|
const r = {
|
|
31
31
|
onClick: n,
|
|
@@ -38,11 +38,11 @@ import '../../../../assets/ItemRightSlot.css';const q = "_rightSlot_13wq6_1", w
|
|
|
38
38
|
onPointerLeave: l,
|
|
39
39
|
onPointerMove: g
|
|
40
40
|
}, h = N(r), R = o ? h : r;
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
return /* @__PURE__ */ x(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
|
-
ref: M(t,
|
|
45
|
-
className: I(
|
|
44
|
+
ref: M(t, d),
|
|
45
|
+
className: I(A.rightSlot, s),
|
|
46
46
|
"data-submenu-right-slot": o ? "" : void 0,
|
|
47
47
|
...R,
|
|
48
48
|
...S,
|
|
@@ -51,7 +51,7 @@ import '../../../../assets/ItemRightSlot.css';const q = "_rightSlot_13wq6_1", w
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
|
|
54
|
+
j.displayName = C;
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
j as ItemRightSlot
|
|
57
57
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as s } from "react";
|
|
3
3
|
import { L as n } from "../../../../index-BA3njR2k.mjs";
|
|
4
|
-
import { c
|
|
5
|
-
import { useLevelContext as
|
|
6
|
-
import { hasItemIcon as
|
|
7
|
-
import '../../../../assets/Label2.css';const
|
|
8
|
-
label:
|
|
4
|
+
import { c } from "../../../../index-L8X2o7IH.mjs";
|
|
5
|
+
import { useLevelContext as i } from "../../providers/LevelProvider/LevelProvider.js";
|
|
6
|
+
import { hasItemIcon as b } from "../../utils/hasItemIcon/hasItemIcon.js";
|
|
7
|
+
import '../../../../assets/Label2.css';const f = "_label_1sne1_1", p = {
|
|
8
|
+
label: f
|
|
9
9
|
}, t = "ContextMenu.Label", L = s(
|
|
10
10
|
({ className: a, children: o, ...e }, r) => {
|
|
11
|
-
const { hasItemWithIcon: l } =
|
|
11
|
+
const { hasItemWithIcon: l } = i(t);
|
|
12
12
|
return /* @__PURE__ */ m(
|
|
13
13
|
n,
|
|
14
14
|
{
|
|
15
15
|
ref: r,
|
|
16
|
-
className:
|
|
17
|
-
"data-no-icon-align":
|
|
16
|
+
className: c(p.label, a),
|
|
17
|
+
"data-no-icon-align": b(o) || !l ? "" : void 0,
|
|
18
18
|
"data-label": !0,
|
|
19
19
|
...e,
|
|
20
20
|
children: o
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as j, useId as
|
|
3
|
-
import { f as
|
|
4
|
-
import { c as
|
|
5
|
-
import { useLevelContext as
|
|
6
|
-
import { useContextMenuContext as
|
|
7
|
-
import { hasItemIcon as
|
|
8
|
-
import "../../../../useContentPositioning-
|
|
2
|
+
import { forwardRef as j, useId as u, useMemo as w } from "react";
|
|
3
|
+
import { f as H } from "../../../../index-BA3njR2k.mjs";
|
|
4
|
+
import { c as P } from "../../../../index-L8X2o7IH.mjs";
|
|
5
|
+
import { useLevelContext as W } from "../../providers/LevelProvider/LevelProvider.js";
|
|
6
|
+
import { useContextMenuContext as Y } from "../../ContextMenu.context.js";
|
|
7
|
+
import { hasItemIcon as b } from "../../utils/hasItemIcon/hasItemIcon.js";
|
|
8
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
9
9
|
import "../Content/Content.utils.js";
|
|
10
|
-
import { useContextMenuItemFocus as
|
|
11
|
-
import '../../../../assets/RadioItem.css';const
|
|
12
|
-
radio_item:
|
|
10
|
+
import { useContextMenuItemFocus as k } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
11
|
+
import '../../../../assets/RadioItem.css';const q = "_radio_item_14d4r_1", z = {
|
|
12
|
+
radio_item: q
|
|
13
13
|
}, i = "ContextMenu.RadioItem", D = j(
|
|
14
14
|
({
|
|
15
15
|
className: I,
|
|
16
16
|
children: m,
|
|
17
17
|
isDisabled: x,
|
|
18
|
-
hasIconCheckFn: _ =
|
|
18
|
+
hasIconCheckFn: _ = b,
|
|
19
19
|
onFocus: o,
|
|
20
20
|
onMouseEnter: a,
|
|
21
21
|
onBlur: r,
|
|
@@ -23,22 +23,22 @@ import '../../../../assets/RadioItem.css';const b = "_radio_item_zek17_1", q = {
|
|
|
23
23
|
onSelect: d,
|
|
24
24
|
...g
|
|
25
25
|
}, n) => {
|
|
26
|
-
const C =
|
|
26
|
+
const C = u(), { hasItemWithIcon: N } = W(i), { closeMenuImmediately: R } = Y(i), {
|
|
27
27
|
dataHighlighted: h,
|
|
28
28
|
onFocus: p,
|
|
29
29
|
onMouseEnter: f,
|
|
30
30
|
onBlur: c,
|
|
31
31
|
onMouseLeave: e
|
|
32
|
-
} =
|
|
32
|
+
} = k({
|
|
33
33
|
displayName: i,
|
|
34
34
|
id: C,
|
|
35
35
|
isDisabled: x
|
|
36
|
-
}), y =
|
|
36
|
+
}), y = w(() => _(m), [m]);
|
|
37
37
|
return /* @__PURE__ */ A(
|
|
38
|
-
|
|
38
|
+
H,
|
|
39
39
|
{
|
|
40
40
|
ref: n,
|
|
41
|
-
className: z
|
|
41
|
+
className: P(z.radio_item, I),
|
|
42
42
|
disabled: x,
|
|
43
43
|
"data-item": !0,
|
|
44
44
|
"data-no-icon-align": y || !N ? "" : void 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { SubProps } from './Sub.props';
|
|
3
3
|
export declare const Sub: {
|
|
4
|
-
({ children, mode, defaultOpen, ...rest }: SubProps): React.JSX.Element;
|
|
4
|
+
({ children, mode, onOpen, defaultOpen, ...rest }: SubProps): React.JSX.Element;
|
|
5
5
|
displayName: string;
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=Sub.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Sub/Sub.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,eAAO,MAAM,GAAG
|
|
1
|
+
{"version":3,"file":"Sub.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Sub/Sub.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,eAAO,MAAM,GAAG;uDAOb,QAAQ;;CAwCV,CAAC"}
|
|
@@ -1,59 +1,61 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { S as
|
|
2
|
+
import { S as l } from "../../../../index-BA3njR2k.mjs";
|
|
3
3
|
import "react";
|
|
4
|
-
import { ContextMenuMode as
|
|
4
|
+
import { ContextMenuMode as x } from "../../ContextMenu.enums.js";
|
|
5
5
|
import "../../providers/LevelProvider/LevelProvider.js";
|
|
6
|
-
import "../../../../useContentPositioning-
|
|
6
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
7
7
|
import "../Content/Content.utils.js";
|
|
8
|
-
import { useContextMenuSub as
|
|
9
|
-
import { ContextMenuSubProvider as
|
|
10
|
-
const
|
|
8
|
+
import { useContextMenuSub as C } from "../../hooks/useContextMenuSub/useContextMenuSub.js";
|
|
9
|
+
import { ContextMenuSubProvider as O, DISPLAY_NAME as t } from "./Sub.context.js";
|
|
10
|
+
const f = ({
|
|
11
11
|
children: i,
|
|
12
|
-
mode: e =
|
|
12
|
+
mode: e = x.HOVER,
|
|
13
|
+
onOpen: m,
|
|
13
14
|
defaultOpen: o,
|
|
14
|
-
...
|
|
15
|
+
...p
|
|
15
16
|
}) => {
|
|
16
17
|
const {
|
|
17
18
|
open: n,
|
|
18
|
-
setOpen:
|
|
19
|
-
animatedOpen:
|
|
20
|
-
startAnimation:
|
|
21
|
-
handleMouseEnter:
|
|
22
|
-
handleMouseLeave:
|
|
23
|
-
handleOpenChange:
|
|
24
|
-
triggerId:
|
|
25
|
-
onOpenByKeyboard:
|
|
26
|
-
} =
|
|
19
|
+
setOpen: a,
|
|
20
|
+
animatedOpen: s,
|
|
21
|
+
startAnimation: u,
|
|
22
|
+
handleMouseEnter: d,
|
|
23
|
+
handleMouseLeave: M,
|
|
24
|
+
handleOpenChange: h,
|
|
25
|
+
triggerId: S,
|
|
26
|
+
onOpenByKeyboard: b
|
|
27
|
+
} = C({
|
|
27
28
|
displayName: t,
|
|
28
29
|
mode: e,
|
|
29
|
-
defaultOpen: o
|
|
30
|
+
defaultOpen: o,
|
|
31
|
+
onOpen: m
|
|
30
32
|
});
|
|
31
33
|
return /* @__PURE__ */ r(
|
|
32
|
-
|
|
34
|
+
O,
|
|
33
35
|
{
|
|
34
36
|
mode: e,
|
|
35
37
|
open: n,
|
|
36
|
-
setOpen:
|
|
37
|
-
animatedOpen:
|
|
38
|
+
setOpen: a,
|
|
39
|
+
animatedOpen: s,
|
|
38
40
|
defaultOpen: o,
|
|
39
|
-
startAnimation:
|
|
40
|
-
onMouseEnter:
|
|
41
|
-
onMouseLeave:
|
|
42
|
-
onOpenByKeyboard:
|
|
43
|
-
triggerId:
|
|
41
|
+
startAnimation: u,
|
|
42
|
+
onMouseEnter: d,
|
|
43
|
+
onMouseLeave: M,
|
|
44
|
+
onOpenByKeyboard: b,
|
|
45
|
+
triggerId: S,
|
|
44
46
|
children: /* @__PURE__ */ r(
|
|
45
|
-
|
|
47
|
+
l,
|
|
46
48
|
{
|
|
47
49
|
open: n,
|
|
48
|
-
onOpenChange:
|
|
49
|
-
...
|
|
50
|
+
onOpenChange: h,
|
|
51
|
+
...p,
|
|
50
52
|
children: i
|
|
51
53
|
}
|
|
52
54
|
)
|
|
53
55
|
}
|
|
54
56
|
);
|
|
55
57
|
};
|
|
56
|
-
|
|
58
|
+
f.displayName = t;
|
|
57
59
|
export {
|
|
58
|
-
|
|
60
|
+
f as Sub
|
|
59
61
|
};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { Sub as RadixDropdownMenuSub } from '@radix-ui/react-dropdown-menu';
|
|
3
3
|
import { ContextMenuModeType } from '../../ContextMenu.types';
|
|
4
|
-
export type SubProps = ComponentPropsWithoutRef<typeof RadixDropdownMenuSub> & {
|
|
4
|
+
export type SubProps = Omit<ComponentPropsWithoutRef<typeof RadixDropdownMenuSub>, 'onOpenChange'> & {
|
|
5
5
|
/**
|
|
6
6
|
* Defines how the submenu is triggered.
|
|
7
7
|
*
|
|
8
8
|
* @default "hover"
|
|
9
9
|
*/
|
|
10
10
|
mode?: ContextMenuModeType;
|
|
11
|
+
/**
|
|
12
|
+
* Called when submenu open state changes.
|
|
13
|
+
*/
|
|
14
|
+
onOpen?: (open: boolean) => void;
|
|
11
15
|
};
|
|
12
16
|
export interface ContextMenuSubContextProps {
|
|
13
17
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sub.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Sub/Sub.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,GAAG;
|
|
1
|
+
{"version":3,"file":"Sub.props.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/components/Sub/Sub.props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,GAAG,IAAI,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,MAAM,QAAQ,GAAG,IAAI,CACzB,wBAAwB,CAAC,OAAO,oBAAoB,CAAC,EACrD,cAAc,CACf,GAAG;IACF;;;;OAIG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,YAAY,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,YAAY,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C"}
|
|
@@ -4,7 +4,7 @@ import { R as T } from "../../../../index-BA3njR2k.mjs";
|
|
|
4
4
|
import { useContextMenuContext as w, ContextMenuProvider as L } from "../../ContextMenu.context.js";
|
|
5
5
|
import { ContextMenuMode as P } from "../../ContextMenu.enums.js";
|
|
6
6
|
import { useContextMenuSubMenu as j } from "../../hooks/useContextMenuSubMenu/useContextMenuSubMenu.js";
|
|
7
|
-
import "../../../../useContentPositioning-
|
|
7
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
8
8
|
import "../Content/Content.utils.js";
|
|
9
9
|
import "../../providers/LevelProvider/LevelProvider.js";
|
|
10
10
|
import { useContextMenuItemContext as B } from "../Item/Item.context.js";
|
|
@@ -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-DO7ZotnD.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(
|
|
@@ -61,7 +61,7 @@ const x = "ContextMenu.Content", V = L(
|
|
|
61
61
|
F.div,
|
|
62
62
|
{
|
|
63
63
|
style: {
|
|
64
|
-
zIndex: Number.MAX_SAFE_INTEGER,
|
|
64
|
+
zIndex: Number.MAX_SAFE_INTEGER - 10,
|
|
65
65
|
position: "fixed",
|
|
66
66
|
...E
|
|
67
67
|
},
|
|
@@ -5,7 +5,7 @@ import { mergeRefs as A } from "../../../../../../lib/utils.js";
|
|
|
5
5
|
import { useContextMenuContext as E } from "../../../../ContextMenu.context.js";
|
|
6
6
|
import { ContextMenuMode as H } from "../../../../ContextMenu.enums.js";
|
|
7
7
|
import "../../../../providers/LevelProvider/LevelProvider.js";
|
|
8
|
-
import "../../../../../../useContentPositioning-
|
|
8
|
+
import "../../../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
9
9
|
import "../../../Content/Content.utils.js";
|
|
10
10
|
import { useContextMenuItemFocus as h } from "../../../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
11
11
|
const s = "ContextMenu.Trigger", j = v(
|
|
@@ -2,22 +2,22 @@ import { jsx as M } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef as R } from "react";
|
|
3
3
|
import { b as H } from "../../../../index-BA3njR2k.mjs";
|
|
4
4
|
import { c as j } from "../../../../index-L8X2o7IH.mjs";
|
|
5
|
-
import { useLevelContext as
|
|
5
|
+
import { useLevelContext as q } from "../../providers/LevelProvider/LevelProvider.js";
|
|
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-
|
|
9
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
10
10
|
import "../Content/Content.utils.js";
|
|
11
11
|
import "../../ContextMenu.context.js";
|
|
12
12
|
import { useContextMenuItemFocus as W } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
|
|
13
|
-
import '../../../../assets/SubTrigger.css';const Y = "
|
|
13
|
+
import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_ip3hq_1", w = {
|
|
14
14
|
sub_trigger: Y
|
|
15
|
-
},
|
|
15
|
+
}, p = "ContextMenu.SubTrigger", z = R(
|
|
16
16
|
({
|
|
17
|
-
className:
|
|
17
|
+
className: L,
|
|
18
18
|
children: v,
|
|
19
|
-
isDisabled:
|
|
20
|
-
onKeyDown:
|
|
19
|
+
isDisabled: h,
|
|
20
|
+
onKeyDown: a,
|
|
21
21
|
onFocus: s,
|
|
22
22
|
onBlur: g,
|
|
23
23
|
onClick: e,
|
|
@@ -26,27 +26,27 @@ import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_d2xgz_1", q =
|
|
|
26
26
|
onPointerLeave: u,
|
|
27
27
|
onMouseEnter: d,
|
|
28
28
|
onMouseLeave: C,
|
|
29
|
-
...
|
|
29
|
+
...S
|
|
30
30
|
}, l) => {
|
|
31
|
-
const { hasItemWithIcon: A } =
|
|
31
|
+
const { hasItemWithIcon: A } = q(p), {
|
|
32
32
|
mode: r,
|
|
33
|
-
open:
|
|
33
|
+
open: b,
|
|
34
34
|
defaultOpen: o,
|
|
35
35
|
setOpen: N,
|
|
36
36
|
onMouseEnter: O,
|
|
37
37
|
onMouseLeave: T,
|
|
38
38
|
triggerId: y,
|
|
39
|
-
onOpenByKeyboard:
|
|
40
|
-
} = D(
|
|
39
|
+
onOpenByKeyboard: n
|
|
40
|
+
} = D(p), {
|
|
41
41
|
dataHighlighted: K,
|
|
42
|
-
onFocus:
|
|
42
|
+
onFocus: x,
|
|
43
43
|
onMouseEnter: c,
|
|
44
44
|
onBlur: I,
|
|
45
45
|
onMouseLeave: _
|
|
46
46
|
} = W({
|
|
47
|
-
displayName:
|
|
47
|
+
displayName: p,
|
|
48
48
|
id: y,
|
|
49
|
-
isDisabled:
|
|
49
|
+
isDisabled: h,
|
|
50
50
|
onMouseEnter: O,
|
|
51
51
|
onMouseLeave: T
|
|
52
52
|
});
|
|
@@ -54,11 +54,11 @@ import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_d2xgz_1", q =
|
|
|
54
54
|
H,
|
|
55
55
|
{
|
|
56
56
|
ref: l,
|
|
57
|
-
className: j(
|
|
58
|
-
disabled:
|
|
57
|
+
className: j(w.sub_trigger, L),
|
|
58
|
+
disabled: h,
|
|
59
59
|
"data-item": !0,
|
|
60
60
|
"data-no-icon-align": V(v) || !A ? "" : void 0,
|
|
61
|
-
"data-highlighted":
|
|
61
|
+
"data-highlighted": b || K === "" || r === i.CLICK && b ? "" : void 0,
|
|
62
62
|
"data-submenu-trigger": !0,
|
|
63
63
|
onMouseEnter: (t) => {
|
|
64
64
|
c == null || c(t), d == null || d(t);
|
|
@@ -67,16 +67,16 @@ import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_d2xgz_1", q =
|
|
|
67
67
|
_ == null || _(t), C == null || C(t);
|
|
68
68
|
},
|
|
69
69
|
onKeyDown: (t) => {
|
|
70
|
-
r === i.HOVER && (["Enter", " ", "ArrowRight"].includes(t.key) ?
|
|
70
|
+
r === i.HOVER && (["Enter", " ", "ArrowRight"].includes(t.key) ? n(!0) : t.key === "ArrowLeft" && (n(!1), t.currentTarget.focus())), a == null || a(t);
|
|
71
71
|
},
|
|
72
72
|
onFocus: (t) => {
|
|
73
|
-
|
|
73
|
+
x == null || x(), s == null || s(t);
|
|
74
74
|
},
|
|
75
75
|
onBlur: (t) => {
|
|
76
76
|
I == null || I(), g == null || g(t);
|
|
77
77
|
},
|
|
78
78
|
onClick: (t) => {
|
|
79
|
-
(r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation(), o === void 0 && N(!
|
|
79
|
+
(r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation(), o === void 0 && N(!b)), e == null || e(t);
|
|
80
80
|
},
|
|
81
81
|
onPointerEnter: (t) => {
|
|
82
82
|
(r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation()), f == null || f(t);
|
|
@@ -87,13 +87,13 @@ import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_d2xgz_1", q =
|
|
|
87
87
|
onPointerLeave: (t) => {
|
|
88
88
|
(r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation()), u == null || u(t);
|
|
89
89
|
},
|
|
90
|
-
...
|
|
90
|
+
...S,
|
|
91
91
|
children: v
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
94
|
}
|
|
95
95
|
);
|
|
96
|
-
|
|
96
|
+
z.displayName = p;
|
|
97
97
|
export {
|
|
98
|
-
|
|
98
|
+
z as SubTrigger
|
|
99
99
|
};
|
|
@@ -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-DO7ZotnD.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-DO7ZotnD.mjs";
|
|
3
3
|
import "../../components/Content/Content.enums.js";
|
|
4
4
|
import "../../components/Content/Content.utils.js";
|
|
5
5
|
export {
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { useInheritedArrowColor as D } from "../useInheritedArrowColor/useInheritedArrowColor.js";
|
|
5
|
-
import "../../../../useContentPositioning-
|
|
5
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
6
6
|
import "../../components/Content/Content.utils.js";
|
|
7
7
|
import "../../ContextMenu.context.js";
|
|
8
8
|
import { useIsTouchDevice as F } from "../useIsTouchDevice/useIsTouchDevice.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UseContextMenuSubOptions } from './useContextMenuSub.types';
|
|
2
|
-
export declare function useContextMenuSub({ displayName, mode: initialMode, defaultOpen, }: UseContextMenuSubOptions): {
|
|
2
|
+
export declare function useContextMenuSub({ displayName, mode: initialMode, defaultOpen, onOpen, }: UseContextMenuSubOptions): {
|
|
3
3
|
open: boolean;
|
|
4
4
|
setOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
5
5
|
animatedOpen: boolean;
|
|
@@ -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,
|
|
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,EACX,MAAM,GACP,EAAE,wBAAwB;;;;;;;8BA4EQ,OAAO;8BAsCP,OAAO;;EA6GzC"}
|
|
@@ -1,66 +1,67 @@
|
|
|
1
|
-
import { useId as
|
|
2
|
-
import { ContextMenuMode as
|
|
3
|
-
import { useLevelContext as
|
|
4
|
-
import "../../../../useContentPositioning-
|
|
1
|
+
import { useId as A, useState as n, useRef as M, useEffect as v } from "react";
|
|
2
|
+
import { ContextMenuMode as a } from "../../ContextMenu.enums.js";
|
|
3
|
+
import { useLevelContext as S } from "../../providers/LevelProvider/LevelProvider.js";
|
|
4
|
+
import "../../../../useContentPositioning-DO7ZotnD.mjs";
|
|
5
5
|
import "../../components/Content/Content.utils.js";
|
|
6
|
-
import { useIsTouchDevice as
|
|
7
|
-
import { useContextMenuContext as
|
|
8
|
-
function
|
|
9
|
-
displayName:
|
|
10
|
-
mode:
|
|
11
|
-
defaultOpen: c
|
|
6
|
+
import { useIsTouchDevice as q } from "../useIsTouchDevice/useIsTouchDevice.js";
|
|
7
|
+
import { useContextMenuContext as j } from "../../ContextMenu.context.js";
|
|
8
|
+
function Q({
|
|
9
|
+
displayName: d,
|
|
10
|
+
mode: H,
|
|
11
|
+
defaultOpen: c,
|
|
12
|
+
onOpen: e
|
|
12
13
|
}) {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
},
|
|
14
|
+
const C = A(), [o, u] = n(c || !1), [K, s] = n(!1), [T, m] = n(!1), [I, i] = n(!1), r = M(null), t = M(null), V = q(), { hoverCloseDelay: h, animationDuration: b } = j(d), { activeItemId: R } = S(d), l = V ? a.CLICK : H, E = () => {
|
|
15
|
+
r.current && (clearTimeout(r.current), r.current = null), t.current && (clearTimeout(t.current), t.current = null);
|
|
16
|
+
}, D = () => {
|
|
17
|
+
E(), s(!1), u(!1), e == null || e(!1), m(!1), i(!1);
|
|
18
|
+
}, x = () => {
|
|
19
|
+
E(), l === a.HOVER ? (s(!1), t.current = setTimeout(() => {
|
|
20
|
+
u(!1), e == null || e(!1), m(!1), i(!1);
|
|
21
|
+
}, b)) : (u(!1), e == null || e(!1), m(!1), i(!1));
|
|
22
|
+
}, y = (f) => {
|
|
22
23
|
if (c !== void 0) {
|
|
23
|
-
|
|
24
|
+
u(c), e == null || e(c), s(c), i(!1);
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
if (
|
|
27
|
-
|
|
27
|
+
if (l === a.CLICK) {
|
|
28
|
+
u(f), e == null || e(f), s(f);
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
f ? (
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
|
|
31
|
+
f ? (t.current && (clearTimeout(t.current), t.current = null), l === a.HOVER && s(!0), u(!0), e == null || e(!0)) : x();
|
|
32
|
+
}, L = (f) => {
|
|
33
|
+
i(f), y(f);
|
|
34
|
+
}, g = () => {
|
|
35
|
+
l === a.HOVER && (i(!1), t.current && (clearTimeout(t.current), t.current = null, s(!0)), o || (r.current && (clearTimeout(r.current), r.current = null), s(!0), e == null || e(!0), u(!0)), m(!0));
|
|
36
|
+
}, B = () => {
|
|
37
|
+
l === a.HOVER && (i(!1), r.current && (clearTimeout(r.current), r.current = null), m(!1));
|
|
37
38
|
};
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
}, [
|
|
41
|
-
if (!(!
|
|
42
|
-
if (
|
|
43
|
-
|
|
39
|
+
return v(() => {
|
|
40
|
+
R !== C && o && c === void 0 && D();
|
|
41
|
+
}, [R, o, c]), v(() => {
|
|
42
|
+
if (!(!o || l !== a.HOVER) && !I) {
|
|
43
|
+
if (T) {
|
|
44
|
+
r.current && (clearTimeout(r.current), r.current = null);
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
|
|
47
|
+
return r.current || (r.current = setTimeout(() => {
|
|
48
|
+
x();
|
|
49
|
+
}, h)), () => {
|
|
50
|
+
r.current && (clearTimeout(r.current), r.current = null);
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
|
-
}, [o,
|
|
53
|
-
open:
|
|
54
|
-
setOpen:
|
|
55
|
-
animatedOpen:
|
|
56
|
-
startAnimation: () =>
|
|
57
|
-
handleMouseEnter:
|
|
58
|
-
handleMouseLeave:
|
|
59
|
-
handleOpenChange:
|
|
60
|
-
onOpenByKeyboard:
|
|
61
|
-
triggerId:
|
|
53
|
+
}, [l, o, T, h, I]), {
|
|
54
|
+
open: o,
|
|
55
|
+
setOpen: u,
|
|
56
|
+
animatedOpen: K,
|
|
57
|
+
startAnimation: () => s(!0),
|
|
58
|
+
handleMouseEnter: g,
|
|
59
|
+
handleMouseLeave: B,
|
|
60
|
+
handleOpenChange: y,
|
|
61
|
+
onOpenByKeyboard: L,
|
|
62
|
+
triggerId: C
|
|
62
63
|
};
|
|
63
64
|
}
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
+
Q as useContextMenuSub
|
|
66
67
|
};
|
|
@@ -12,5 +12,9 @@ export interface UseContextMenuSubOptions {
|
|
|
12
12
|
* The open state of the dropdown menu when it is initially rendered.
|
|
13
13
|
*/
|
|
14
14
|
defaultOpen?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Called when submenu open state changes.
|
|
17
|
+
*/
|
|
18
|
+
onOpen?: (open: boolean) => void;
|
|
15
19
|
}
|
|
16
20
|
//# sourceMappingURL=useContextMenuSub.types.d.ts.map
|
package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useContextMenuSub.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useContextMenuSub.types.d.ts","sourceRoot":"","sources":["../../../../../src/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAClC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useId as Q, useState as C, useRef as v, useLayoutEffect as U, useEffect as R } from "react";
|
|
2
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-DO7ZotnD.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";
|
|
@@ -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-DO7ZotnD.mjs";
|
|
4
4
|
import { Direction as p } from "./components/Content/Content.enums.js";
|
|
5
5
|
import "./components/Content/Content.utils.js";
|
|
6
6
|
export {
|
package/package.json
CHANGED