@kommo-crm/crm-react-ui-kit 1.1.1-beta.1 → 1.1.1-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/assets/ItemRightSlot.css +1 -1
  2. package/dist/components/ContextMenu/ContextMenu.js +1 -1
  3. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.d.ts.map +1 -1
  4. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +64 -43
  5. package/dist/components/ContextMenu/components/Content/Content.d.ts.map +1 -1
  6. package/dist/components/ContextMenu/components/Content/Content.js +1 -1
  7. package/dist/components/ContextMenu/components/Content/index.js +1 -1
  8. package/dist/components/ContextMenu/components/Item/Item.d.ts.map +1 -1
  9. package/dist/components/ContextMenu/components/Item/Item.js +77 -58
  10. package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.d.ts.map +1 -1
  11. package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.js +44 -21
  12. package/dist/components/ContextMenu/components/RadioItem/RadioItem.d.ts.map +1 -1
  13. package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +60 -33
  14. package/dist/components/ContextMenu/components/Sub/Sub.js +1 -1
  15. package/dist/components/ContextMenu/components/SubContent/SubContent.d.ts.map +1 -1
  16. package/dist/components/ContextMenu/components/SubContent/SubContent.js +64 -52
  17. package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +1 -1
  18. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.d.ts.map +1 -1
  19. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +83 -74
  20. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.d.ts.map +1 -1
  21. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +58 -36
  22. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.d.ts.map +1 -1
  23. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +82 -60
  24. package/dist/components/ContextMenu/components/Trigger/Trigger.d.ts.map +1 -1
  25. package/dist/components/ContextMenu/components/Trigger/Trigger.js +40 -22
  26. package/dist/components/ContextMenu/hooks/index.js +1 -1
  27. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.d.ts.map +1 -1
  28. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +1 -1
  29. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.d.ts.map +1 -1
  30. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +57 -57
  31. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +1 -1
  32. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.d.ts.map +1 -1
  33. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +40 -40
  34. package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.d.ts +11 -10
  35. package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.d.ts.map +1 -1
  36. package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.js +17 -15
  37. package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.d.ts +3 -0
  38. package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.d.ts.map +1 -0
  39. package/dist/components/ContextMenu/hooks/useStopContextMenuEvents/useStopContextMenuEvents.types.js +1 -0
  40. package/dist/components/ContextMenu/index.js +1 -1
  41. package/dist/useContentPositioning-BLCC-Xty.mjs +213 -0
  42. package/package.json +2 -2
  43. package/dist/useContentPositioning-27D32n5u.mjs +0 -185
@@ -1,63 +1,75 @@
1
- import { jsx as o } from "react/jsx-runtime";
2
- import { forwardRef as y, useState as s, useLayoutEffect as r } from "react";
3
- import { c as E } from "../../../../index-BA3njR2k.mjs";
4
- import { u as g, e as h, a as N } from "../../../../react-spring_web.modern-Dnq1lqN5.mjs";
5
- import { c as L } from "../../../../index-L8X2o7IH.mjs";
6
- import { LevelProvider as P } from "../../providers/LevelProvider/LevelProvider.js";
7
- import { useContextMenuSubContext as F } from "../Sub/Sub.context.js";
8
- import { useContextMenuContext as O } from "../../ContextMenu.context.js";
9
- import '../../../../assets/SubContent.css';const w = "_sub_content_y6v65_1", D = {
10
- sub_content: w
11
- }, i = "ContextMenu.SubContent", R = y(
12
- ({ className: u, children: c, sideOffset: m = 4, collisionPadding: f = 10, ...d }, p) => {
13
- const [l, I] = s(null), {
14
- animatedOpen: t,
15
- startAnimation: b,
16
- onMouseEnter: x,
17
- onMouseLeave: _,
18
- defaultOpen: a
19
- } = F(i), { animationDuration: v } = O(i), [C, S] = s(!1), [A, e] = s(!1);
20
- r(() => {
21
- b();
22
- }, []), r(() => {
23
- let n;
24
- return t ? (e(!1), n = requestAnimationFrame(() => {
25
- e(!0);
26
- })) : e(!1), () => {
27
- n && cancelAnimationFrame(n);
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as N, useState as c, useLayoutEffect as f } from "react";
3
+ import { c as P } from "../../../../index-BA3njR2k.mjs";
4
+ import { u as F, e as O, a as w } from "../../../../react-spring_web.modern-Dnq1lqN5.mjs";
5
+ import { c as D } from "../../../../index-L8X2o7IH.mjs";
6
+ import { LevelProvider as E } from "../../providers/LevelProvider/LevelProvider.js";
7
+ import { useContextMenuSubContext as R } from "../Sub/Sub.context.js";
8
+ import { useContextMenuContext as W } from "../../ContextMenu.context.js";
9
+ import '../../../../assets/SubContent.css';const j = "_sub_content_y6v65_1", q = {
10
+ sub_content: j
11
+ }, m = "ContextMenu.SubContent", z = N(
12
+ ({
13
+ className: d,
14
+ children: p,
15
+ sideOffset: l = 4,
16
+ collisionPadding: I = 10,
17
+ onMouseEnter: e,
18
+ onMouseLeave: n,
19
+ ...b
20
+ }, _) => {
21
+ const [S, x] = c(null), {
22
+ animatedOpen: i,
23
+ startAnimation: A,
24
+ onMouseEnter: o,
25
+ onMouseLeave: s,
26
+ defaultOpen: u
27
+ } = R(m), { animationDuration: C } = W(m), [y, g] = c(!1), [h, a] = c(!1);
28
+ f(() => {
29
+ A();
30
+ }, []), f(() => {
31
+ let t;
32
+ return i ? (a(!1), t = requestAnimationFrame(() => {
33
+ a(!0);
34
+ })) : a(!1), () => {
35
+ t && cancelAnimationFrame(t);
28
36
  };
29
- }, [t]);
30
- const M = g({
31
- opacity: A && t || a !== void 0 ? 1 : 0,
32
- config: a === void 0 ? { duration: v, easing: h.easeInOutCubic } : { duration: 0 }
37
+ }, [i]);
38
+ const v = F({
39
+ opacity: h && i || u !== void 0 ? 1 : 0,
40
+ config: u === void 0 ? { duration: C, easing: O.easeInOutCubic } : { duration: 0 }
33
41
  });
34
- return /* @__PURE__ */ o(
35
- P,
42
+ return /* @__PURE__ */ r(
43
+ E,
36
44
  {
37
- hasItemWithIcon: C,
38
- setHasItemWithIcon: S,
39
- activeItemId: l,
40
- setActiveItemId: I,
41
- children: /* @__PURE__ */ o(
42
- N.div,
45
+ hasItemWithIcon: y,
46
+ setHasItemWithIcon: g,
47
+ activeItemId: S,
48
+ setActiveItemId: x,
49
+ children: /* @__PURE__ */ r(
50
+ w.div,
43
51
  {
44
52
  style: {
45
53
  position: "fixed",
46
54
  zIndex: Number.MAX_SAFE_INTEGER,
47
- ...M
55
+ ...v
56
+ },
57
+ onMouseEnter: (t) => {
58
+ o == null || o(t), e == null || e(t);
59
+ },
60
+ onMouseLeave: (t) => {
61
+ s == null || s(t), n == null || n(t);
48
62
  },
49
- onMouseEnter: x,
50
- onMouseLeave: _,
51
63
  "data-content-wrapper": !0,
52
- children: /* @__PURE__ */ o(
53
- E,
64
+ children: /* @__PURE__ */ r(
65
+ P,
54
66
  {
55
- ref: p,
56
- className: L(D.sub_content, u),
57
- sideOffset: m,
58
- collisionPadding: f,
59
- ...d,
60
- children: c
67
+ ref: _,
68
+ className: D(q.sub_content, d),
69
+ sideOffset: l,
70
+ collisionPadding: I,
71
+ ...b,
72
+ children: p
61
73
  }
62
74
  )
63
75
  }
@@ -66,7 +78,7 @@ import '../../../../assets/SubContent.css';const w = "_sub_content_y6v65_1", D =
66
78
  );
67
79
  }
68
80
  );
69
- R.displayName = i;
81
+ z.displayName = m;
70
82
  export {
71
- R as SubContent
83
+ z as SubContent
72
84
  };
@@ -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-27D32n5u.mjs";
7
+ import "../../../../useContentPositioning-BLCC-Xty.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";
@@ -1 +1 @@
1
- {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/components/SubRoot/components/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA4BpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAmGnB,CAAC"}
1
+ {"version":3,"file":"Content.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/ContextMenu/components/SubRoot/components/Content/Content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+B,MAAM,OAAO,CAAC;AA4BpD,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAkHnB,CAAC"}
@@ -1,87 +1,96 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as P, useState as c } from "react";
3
- import { C as _ } from "../../../../../../index-BA3njR2k.mjs";
4
- import { c as H } from "../../../../../../index-L8X2o7IH.mjs";
5
- import { u as T, e as W, a as b } from "../../../../../../react-spring_web.modern-Dnq1lqN5.mjs";
6
- import { mergeRefs as G } from "../../../../../../lib/utils.js";
7
- import { LevelProvider as j } from "../../../../providers/LevelProvider/LevelProvider.js";
8
- import { useContextMenuContext as k } from "../../../../ContextMenu.context.js";
9
- import { ContextMenuMode as p } from "../../../../ContextMenu.enums.js";
10
- import { focusParentItem as z } from "../../../../utils/focusParentItem/focusParentItem.js";
11
- import { u as F, s as X } from "../../../../../../useContentPositioning-27D32n5u.mjs";
12
- import { Direction as Y } from "../../../Content/Content.enums.js";
13
- import { directionToSide as q } from "../../../Content/Content.utils.js";
14
- const u = "ContextMenu.Content", J = P(
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { forwardRef as L, useState as C } from "react";
3
+ import { C as j } from "../../../../../../index-BA3njR2k.mjs";
4
+ import { c as k } from "../../../../../../index-L8X2o7IH.mjs";
5
+ import { u as w, e as z, a as F } from "../../../../../../react-spring_web.modern-Dnq1lqN5.mjs";
6
+ import { mergeRefs as M } from "../../../../../../lib/utils.js";
7
+ import { LevelProvider as X } from "../../../../providers/LevelProvider/LevelProvider.js";
8
+ import { useContextMenuContext as Y } from "../../../../ContextMenu.context.js";
9
+ import { ContextMenuMode as g } from "../../../../ContextMenu.enums.js";
10
+ import { focusParentItem as q } from "../../../../utils/focusParentItem/focusParentItem.js";
11
+ import { u as J, s as K } from "../../../../../../useContentPositioning-BLCC-Xty.mjs";
12
+ import { Direction as Q } from "../../../Content/Content.enums.js";
13
+ import { directionToSide as U } from "../../../Content/Content.utils.js";
14
+ const x = "ContextMenu.Content", V = L(
15
15
  ({
16
- style: d,
17
- className: I,
18
- children: t,
19
- alignOffset: l,
20
- arrowPadding: C = 5,
21
- collisionBoundary: o,
22
- direction: n = Y.DOWN_RIGHT,
23
- disableAutoPositioning: r = !1,
24
- ...g
25
- }, x) => {
26
- const [y, M] = c(!1), [v, D] = c(null), {
27
- triggerRef: i,
28
- contentRef: s,
29
- animatedOpen: E,
30
- animationDuration: L,
31
- mode: m,
32
- temporaryHoverClose: a,
33
- onMouseEnter: N,
34
- onMouseLeave: R,
35
- closeMenuImmediately: S
36
- } = k(u), { align: h, labelOffset: w, isPositioned: f } = F({
37
- direction: n,
38
- alignOffset: l,
39
- disableAutoPositioning: r,
40
- triggerRef: i,
41
- contentRef: s,
42
- collisionBoundary: o,
43
- children: t
44
- }), A = T({
45
- opacity: f && (m === p.CLICK && !a || E) ? 1 : 0,
46
- config: m === p.CLICK && !a ? { duration: 0 } : { duration: L, easing: W.easeInOutCubic }
47
- }), O = (K) => {
48
- K.key === "ArrowLeft" && (S(), z(i.current));
16
+ style: N,
17
+ className: R,
18
+ children: s,
19
+ alignOffset: S,
20
+ arrowPadding: h = 5,
21
+ collisionBoundary: a,
22
+ direction: f = Q.DOWN_RIGHT,
23
+ disableAutoPositioning: c = !1,
24
+ onMouseEnter: e,
25
+ onMouseLeave: r,
26
+ onKeyDown: o,
27
+ ...y
28
+ }, A) => {
29
+ const [O, v] = C(!1), [P, _] = C(null), {
30
+ triggerRef: p,
31
+ contentRef: d,
32
+ animatedOpen: H,
33
+ animationDuration: T,
34
+ mode: I,
35
+ temporaryHoverClose: l,
36
+ onMouseEnter: i,
37
+ onMouseLeave: n,
38
+ closeMenuImmediately: W
39
+ } = Y(x), { align: b, labelOffset: D, isPositioned: u } = J({
40
+ direction: f,
41
+ alignOffset: S,
42
+ disableAutoPositioning: c,
43
+ triggerRef: p,
44
+ contentRef: d,
45
+ collisionBoundary: a,
46
+ children: s
47
+ }), E = w({
48
+ opacity: u && (I === g.CLICK && !l || H) ? 1 : 0,
49
+ config: I === g.CLICK && !l ? { duration: 0 } : { duration: T, easing: z.easeInOutCubic }
50
+ }), G = (t) => {
51
+ t.key === "ArrowLeft" && (W(), q(p.current)), o == null || o(t);
49
52
  };
50
- return /* @__PURE__ */ e(
51
- j,
53
+ return /* @__PURE__ */ m(
54
+ X,
52
55
  {
53
- hasItemWithIcon: y,
54
- setHasItemWithIcon: M,
55
- activeItemId: v,
56
- setActiveItemId: D,
57
- children: /* @__PURE__ */ e(
58
- b.div,
56
+ hasItemWithIcon: O,
57
+ setHasItemWithIcon: v,
58
+ activeItemId: P,
59
+ setActiveItemId: _,
60
+ children: /* @__PURE__ */ m(
61
+ F.div,
59
62
  {
60
63
  style: {
61
64
  zIndex: Number.MAX_SAFE_INTEGER,
62
65
  position: "fixed",
63
- ...A
66
+ ...E
64
67
  },
65
68
  "data-content-wrapper": !0,
66
- children: /* @__PURE__ */ e(
67
- _,
69
+ children: /* @__PURE__ */ m(
70
+ j,
68
71
  {
69
- ref: G(s, x),
70
- className: H(X.content, I),
72
+ ref: M(d, A),
73
+ className: k(K.content, R),
71
74
  style: {
72
- ...d || {},
73
- pointerEvents: r || f ? "auto" : "none"
75
+ ...N || {},
76
+ pointerEvents: c || u ? "auto" : "none"
74
77
  },
75
- collisionBoundary: o,
76
- side: q[n],
77
- align: h,
78
- arrowPadding: C,
79
- alignOffset: w,
80
- onMouseEnter: N,
81
- onMouseLeave: R,
82
- onKeyDown: O,
83
- ...g,
84
- children: t
78
+ collisionBoundary: a,
79
+ side: U[f],
80
+ align: b,
81
+ arrowPadding: h,
82
+ alignOffset: D,
83
+ onMouseEnter: (t) => {
84
+ i == null || i(t), e == null || e(t);
85
+ },
86
+ onMouseLeave: (t) => {
87
+ n == null || n(t), r == null || r(t);
88
+ },
89
+ onKeyDown: (t) => {
90
+ G(t);
91
+ },
92
+ ...y,
93
+ children: s
85
94
  }
86
95
  )
87
96
  }
@@ -90,7 +99,7 @@ const u = "ContextMenu.Content", J = P(
90
99
  );
91
100
  }
92
101
  );
93
- J.displayName = u;
102
+ V.displayName = x;
94
103
  export {
95
- J as Content
104
+ V as Content
96
105
  };
@@ -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;AAgB1C,eAAO,MAAM,OAAO,kMA6CnB,CAAC"}
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,kMA+EnB,CAAC"}
@@ -1,50 +1,72 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as c } from "react";
3
- import { T as x } from "../../../../../../index-BA3njR2k.mjs";
4
- import { c as v } from "../../../../../../index-L8X2o7IH.mjs";
5
- import { mergeRefs as E } from "../../../../../../lib/utils.js";
6
- import { useContextMenuContext as C } from "../../../../ContextMenu.context.js";
7
- import { ContextMenuMode as D } from "../../../../ContextMenu.enums.js";
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ import { forwardRef as v } from "react";
3
+ import { T as y } from "../../../../../../index-BA3njR2k.mjs";
4
+ import { mergeRefs as A } from "../../../../../../lib/utils.js";
5
+ import { useContextMenuContext as E } from "../../../../ContextMenu.context.js";
6
+ import { ContextMenuMode as H } from "../../../../ContextMenu.enums.js";
8
7
  import "../../../../providers/LevelProvider/LevelProvider.js";
9
- import "../../../../../../useContentPositioning-27D32n5u.mjs";
8
+ import "../../../../../../useContentPositioning-BLCC-Xty.mjs";
10
9
  import "../../../Content/Content.utils.js";
11
- import { useContextMenuItemFocus as L } from "../../../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
12
- const r = "ContextMenu.Trigger", N = c(
13
- ({ className: t, children: n, ...s }, i) => {
14
- const { triggerRef: m, mode: a, onMouseEnter: u, onMouseLeave: p, triggerId: f } = C(r), {
15
- onFocus: o,
16
- onMouseEnter: g,
17
- onBlur: M,
18
- onMouseLeave: d
19
- } = L({
20
- displayName: r,
21
- id: f || "",
10
+ import { useContextMenuItemFocus as h } from "../../../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
11
+ const s = "ContextMenu.Trigger", j = v(
12
+ ({
13
+ className: d,
14
+ children: x,
15
+ onFocus: r,
16
+ onBlur: e,
17
+ onMouseEnter: i,
18
+ onMouseLeave: o,
19
+ onPointerDown: g,
20
+ ...u
21
+ }, C) => {
22
+ const {
23
+ triggerRef: n,
24
+ mode: M,
25
+ onMouseEnter: R,
26
+ onMouseLeave: T,
27
+ triggerId: N
28
+ } = E(s), {
29
+ dataHighlighted: b,
30
+ onFocus: m,
31
+ onMouseEnter: p,
32
+ onBlur: a,
33
+ onMouseLeave: f
34
+ } = h({
35
+ displayName: s,
36
+ id: N || "",
22
37
  isDisabled: !1,
23
- onMouseEnter: u,
24
- onMouseLeave: p
38
+ onMouseEnter: R,
39
+ onMouseLeave: T
25
40
  });
26
- return /* @__PURE__ */ l(
27
- x,
41
+ return /* @__PURE__ */ c(
42
+ y,
28
43
  {
29
- ref: E(m, i),
30
- className: v(t),
31
- onPointerDown: (e) => {
32
- a === D.HOVER && e.preventDefault(), e.stopPropagation();
44
+ ref: A(n, C),
45
+ className: d,
46
+ "data-highlighted": b,
47
+ onPointerDown: (t) => {
48
+ M === H.HOVER && t.preventDefault(), t.stopPropagation(), g == null || g(t);
33
49
  },
34
- onMouseEnter: g,
35
- onMouseLeave: d,
36
- onFocus: (e) => {
37
- e.preventDefault(), e.stopPropagation(), o == null || o();
50
+ onMouseEnter: (t) => {
51
+ p == null || p(t), i == null || i(t);
52
+ },
53
+ onMouseLeave: (t) => {
54
+ f == null || f(t), o == null || o(t);
55
+ },
56
+ onFocus: (t) => {
57
+ t.preventDefault(), t.stopPropagation(), m == null || m(), r == null || r(t);
58
+ },
59
+ onBlur: (t) => {
60
+ a == null || a(), e == null || e(t);
38
61
  },
39
- onBlur: M,
40
62
  "data-submenu-trigger": !0,
41
- ...s,
42
- children: n
63
+ ...u,
64
+ children: x
43
65
  }
44
66
  );
45
67
  }
46
68
  );
47
- N.displayName = r;
69
+ j.displayName = s;
48
70
  export {
49
- N as Trigger
71
+ j as Trigger
50
72
  };
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAgGtB,CAAC"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAyItB,CAAC"}
@@ -1,77 +1,99 @@
1
- import { jsx as x } from "react/jsx-runtime";
2
- import { forwardRef as E } from "react";
3
- import { b as P } from "../../../../index-BA3njR2k.mjs";
4
- import { c as _ } from "../../../../index-L8X2o7IH.mjs";
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";
1
+ import { jsx as M } from "react/jsx-runtime";
2
+ import { forwardRef as R } from "react";
3
+ import { b as H } from "../../../../index-BA3njR2k.mjs";
4
+ import { c as j } from "../../../../index-L8X2o7IH.mjs";
5
+ import { useLevelContext as z } from "../../providers/LevelProvider/LevelProvider.js";
6
+ import { useContextMenuSubContext as D } from "../Sub/Sub.context.js";
7
+ import { hasItemIcon as V } from "../../utils/hasItemIcon/hasItemIcon.js";
8
+ import { ContextMenuMode as i } from "../../ContextMenu.enums.js";
9
+ import "../../../../useContentPositioning-BLCC-Xty.mjs";
10
10
  import "../Content/Content.utils.js";
11
11
  import "../../ContextMenu.context.js";
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
- onMouseEnter: I,
30
- onBlur: b,
31
- onMouseLeave: h
32
- } = O({
33
- displayName: i,
34
- id: C,
35
- isDisabled: u,
36
- onMouseEnter: l,
37
- onMouseLeave: v
12
+ import { useContextMenuItemFocus as W } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
13
+ import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_d2xgz_1", q = {
14
+ sub_trigger: Y
15
+ }, a = "ContextMenu.SubTrigger", w = R(
16
+ ({
17
+ className: S,
18
+ children: v,
19
+ isDisabled: n,
20
+ onKeyDown: p,
21
+ onFocus: s,
22
+ onBlur: g,
23
+ onClick: e,
24
+ onPointerEnter: f,
25
+ onPointerMove: m,
26
+ onPointerLeave: u,
27
+ onMouseEnter: d,
28
+ onMouseLeave: C,
29
+ ...h
30
+ }, l) => {
31
+ const { hasItemWithIcon: A } = z(a), {
32
+ mode: r,
33
+ open: x,
34
+ defaultOpen: o,
35
+ setOpen: N,
36
+ onMouseEnter: O,
37
+ onMouseLeave: T,
38
+ triggerId: y,
39
+ onOpenByKeyboard: L
40
+ } = D(a), {
41
+ dataHighlighted: K,
42
+ onFocus: b,
43
+ onMouseEnter: c,
44
+ onBlur: I,
45
+ onMouseLeave: _
46
+ } = W({
47
+ displayName: a,
48
+ id: y,
49
+ isDisabled: n,
50
+ onMouseEnter: O,
51
+ onMouseLeave: T
38
52
  });
39
- return /* @__PURE__ */ x(
40
- P,
53
+ return /* @__PURE__ */ M(
54
+ H,
41
55
  {
42
- ref: d,
43
- className: _(k.sub_trigger, g),
44
- disabled: u,
56
+ ref: l,
57
+ className: j(q.sub_trigger, S),
58
+ disabled: n,
45
59
  "data-item": !0,
46
- "data-no-icon-align": N(s) || !f ? "" : void 0,
47
- "data-highlighted": a || M === "" || o === t.CLICK && a ? "" : void 0,
60
+ "data-no-icon-align": V(v) || !A ? "" : void 0,
61
+ "data-highlighted": x || K === "" || r === i.CLICK && x ? "" : void 0,
48
62
  "data-submenu-trigger": !0,
49
- onMouseEnter: I,
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);
63
+ onMouseEnter: (t) => {
64
+ c == null || c(t), d == null || d(t);
52
65
  },
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));
66
+ onMouseLeave: (t) => {
67
+ _ == null || _(t), C == null || C(t);
58
68
  },
59
- onPointerEnter: (e) => {
60
- (o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
69
+ onKeyDown: (t) => {
70
+ r === i.HOVER && (["Enter", " ", "ArrowRight"].includes(t.key) ? L(!0) : t.key === "ArrowLeft" && (L(!1), t.currentTarget.focus())), p == null || p(t);
61
71
  },
62
- onPointerMove: (e) => {
63
- (o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
72
+ onFocus: (t) => {
73
+ b == null || b(), s == null || s(t);
64
74
  },
65
- onPointerLeave: (e) => {
66
- (o === t.CLICK || r !== void 0) && (e.preventDefault(), e.stopPropagation());
75
+ onBlur: (t) => {
76
+ I == null || I(), g == null || g(t);
67
77
  },
68
- ...m,
69
- children: s
78
+ onClick: (t) => {
79
+ (r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation(), o === void 0 && N(!x)), e == null || e(t);
80
+ },
81
+ onPointerEnter: (t) => {
82
+ (r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation()), f == null || f(t);
83
+ },
84
+ onPointerMove: (t) => {
85
+ (r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation()), m == null || m(t);
86
+ },
87
+ onPointerLeave: (t) => {
88
+ (r === i.CLICK || o !== void 0) && (t.preventDefault(), t.stopPropagation()), u == null || u(t);
89
+ },
90
+ ...h,
91
+ children: v
70
92
  }
71
93
  );
72
94
  }
73
95
  );
74
- y.displayName = i;
96
+ w.displayName = a;
75
97
  export {
76
- y as SubTrigger
98
+ w as SubTrigger
77
99
  };
@@ -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,kMAoCnB,CAAC"}
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,kMA8DnB,CAAC"}