@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.
Files changed (36) hide show
  1. package/dist/assets/CheckboxItem.css +1 -1
  2. package/dist/assets/Item2.css +1 -1
  3. package/dist/assets/ItemRightSlot.css +1 -1
  4. package/dist/assets/Label2.css +1 -1
  5. package/dist/assets/RadioItem.css +1 -1
  6. package/dist/assets/SubTrigger.css +1 -1
  7. package/dist/components/ContextMenu/ContextMenu.js +1 -1
  8. package/dist/components/ContextMenu/components/CheckboxItem/CheckboxItem.js +28 -28
  9. package/dist/components/ContextMenu/components/Content/Content.js +1 -1
  10. package/dist/components/ContextMenu/components/Content/index.js +1 -1
  11. package/dist/components/ContextMenu/components/Item/Item.js +9 -9
  12. package/dist/components/ContextMenu/components/ItemRightSlot/ItemRightSlot.js +13 -13
  13. package/dist/components/ContextMenu/components/Label/Label.js +8 -8
  14. package/dist/components/ContextMenu/components/RadioItem/RadioItem.js +16 -16
  15. package/dist/components/ContextMenu/components/Sub/Sub.d.ts +1 -1
  16. package/dist/components/ContextMenu/components/Sub/Sub.d.ts.map +1 -1
  17. package/dist/components/ContextMenu/components/Sub/Sub.js +33 -31
  18. package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts +5 -1
  19. package/dist/components/ContextMenu/components/Sub/Sub.props.d.ts.map +1 -1
  20. package/dist/components/ContextMenu/components/SubContent/SubContent.js +1 -1
  21. package/dist/components/ContextMenu/components/SubRoot/SubRoot.js +1 -1
  22. package/dist/components/ContextMenu/components/SubRoot/components/Content/Content.js +2 -2
  23. package/dist/components/ContextMenu/components/SubRoot/components/Trigger/Trigger.js +1 -1
  24. package/dist/components/ContextMenu/components/SubTrigger/SubTrigger.js +24 -24
  25. package/dist/components/ContextMenu/hooks/index.js +1 -1
  26. package/dist/components/ContextMenu/hooks/useContentPositioning/useContentPositioning.js +1 -1
  27. package/dist/components/ContextMenu/hooks/useContextMenu/useContextMenu.js +1 -1
  28. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts +1 -1
  29. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.d.ts.map +1 -1
  30. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.js +51 -50
  31. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.types.d.ts +4 -0
  32. package/dist/components/ContextMenu/hooks/useContextMenuSub/useContextMenuSub.types.d.ts.map +1 -1
  33. package/dist/components/ContextMenu/hooks/useContextMenuSubMenu/useContextMenuSubMenu.js +1 -1
  34. package/dist/components/ContextMenu/index.js +1 -1
  35. package/dist/{useContentPositioning-BLCC-Xty.mjs → useContentPositioning-DO7ZotnD.mjs} +1 -1
  36. package/package.json +1 -1
@@ -1 +1 @@
1
- ._checkbox_item_16brq_1{position:relative;display:flex;align-items:center;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;gap:8px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._checkbox_item_16brq_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._checkbox_item_16brq_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._checkbox_item_16brq_1[data-state=checked]{color:var(--crm-ui-kit-palette-active-element-900)}._checkbox_item_16brq_1[data-no-icon-align]{padding:10px 16px}
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}
@@ -1 +1 @@
1
- ._item_128tk_1{position:relative;display:flex;align-items:center;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;gap:8px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._item_128tk_1[data-not-selectable]{cursor:auto;-webkit-user-select:text;user-select:text;padding:10px 16px}._item_128tk_1[data-has-submenu]{padding:0 0 0 40px}._item_128tk_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._item_128tk_1[data-danger]{color:var(--crm-ui-kit-color-error)}._item_128tk_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._item_128tk_1[data-no-icon-align]{padding-left:16px}
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
- ._rightSlot_13wq6_1{display:flex;align-items:center;margin-left:auto;padding-left:16px;gap:8px}._rightSlot_13wq6_1[data-submenu-right-slot]{padding-left:0}
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}
@@ -1 +1 @@
1
- ._label_1ik2p_1{position:relative;display:flex;outline:none;padding:10px 16px 10px 40px;gap:8px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary)}._label_1ik2p_1[data-no-icon-align]{padding:10px 16px}
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
- ._radio_item_zek17_1{position:relative;display:flex;align-items:center;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;gap:8px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._radio_item_zek17_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._radio_item_zek17_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._radio_item_zek17_1[data-state=checked]{color:var(--crm-ui-kit-palette-active-element-900)}._radio_item_zek17_1[data-no-icon-align]{padding:10px 16px}
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
- ._sub_trigger_d2xgz_1{position:relative;display:flex;-webkit-user-select:none;user-select:none;outline:none;padding:10px 16px 10px 40px;gap:8px;color:var(--crm-ui-kit-palette-text-primary);background-color:var(--crm-ui-kit-palette-background-primary);cursor:pointer}._sub_trigger_d2xgz_1[data-disabled]{color:var(--crm-ui-kit-palette-text-secondary-light);cursor:auto}._sub_trigger_d2xgz_1[data-highlighted]{background-color:var(--crm-ui-kit-palette-background-default)}._sub_trigger_d2xgz_1[data-no-icon-align]{padding:10px 16px}
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-BLCC-Xty.mjs";
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 j } from "react/jsx-runtime";
2
- import { forwardRef as q, useId as u, useMemo as v } from "react";
3
- import { d as w } from "../../../../index-BA3njR2k.mjs";
4
- import { c as H } from "../../../../index-L8X2o7IH.mjs";
5
- import { useLevelContext as P } from "../../providers/LevelProvider/LevelProvider.js";
6
- import { useContextMenuContext as R } from "../../ContextMenu.context.js";
7
- import { hasItemIcon as W } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import "../../../../useContentPositioning-BLCC-Xty.mjs";
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 Y } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
11
- import '../../../../assets/CheckboxItem.css';const z = "_checkbox_item_16brq_1", D = {
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 = q(
13
+ }, m = "ContextMenu.CheckboxItem", G = u(
14
14
  ({
15
15
  className: k,
16
16
  children: o,
17
- onChange: d,
17
+ onChange: h,
18
18
  isDisabled: f,
19
19
  isChecked: C,
20
- hasIconCheckFn: b = W,
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
- ...n
27
- }, I) => {
28
- const _ = u(), { hasItemWithIcon: g } = P(m), { closeMenuImmediately: N } = R(m), {
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: h
34
- } = Y({
33
+ onMouseLeave: d
34
+ } = q({
35
35
  displayName: m,
36
- id: _,
36
+ id: b,
37
37
  isDisabled: f
38
- }), A = v(() => b(o), [o]);
39
- return /* @__PURE__ */ j(
40
- w,
38
+ }), j = w(() => n(o), [o]);
39
+ return /* @__PURE__ */ A(
40
+ H,
41
41
  {
42
- ref: I,
43
- className: H(D.checkbox_item, k),
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": A || !g ? "" : void 0,
47
+ "data-no-icon-align": j || !g ? "" : void 0,
48
48
  onCheckedChange: (t) => {
49
- d && d({
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
- h == null || h(t), r == null || r(t);
67
+ d == null || d(t), r == null || r(t);
68
68
  },
69
- ...n,
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-BLCC-Xty.mjs";
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-BLCC-Xty.mjs";
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 W, useMemo as N, useId as Y, useState as v, useRef as z, useEffect as G } from "react";
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-BLCC-Xty.mjs";
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 = "_item_128tk_1", R = {
13
+ import '../../../../assets/Item2.css';const Z = "_item_zkanf_1", R = {
14
14
  item: Z
15
- }, s = "ContextMenu.Item", $ = W((t, p) => {
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
- ...B
24
- } = t, K = N(() => q(I), [I]);
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": K || !x ? "" : void 0,
32
- ...B,
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 = Y(), [M, S] = v(!1), [o, E] = v(!1), n = z(null), H = N(() => _(a), [a]), { closeMenuImmediately: L } = U(s), {
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 b } from "react/jsx-runtime";
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 q = "_rightSlot_13wq6_1", w = {
7
- rightSlot: q
8
- }, y = "ContextMenu.ItemRightSlot", A = v(
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
- }, p) => {
23
- const t = E(null), [o, d] = _(!1);
22
+ }, d) => {
23
+ const t = E(null), [o, p] = _(!1);
24
24
  H(() => {
25
25
  if (!t.current)
26
26
  return;
27
- const x = t.current.querySelector("[data-submenu-trigger]");
28
- d(!!x);
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__ */ b(
41
+ return /* @__PURE__ */ x(
42
42
  "div",
43
43
  {
44
- ref: M(t, p),
45
- className: I(w.rightSlot, s),
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
- A.displayName = y;
54
+ j.displayName = C;
55
55
  export {
56
- A as ItemRightSlot
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 as i } from "../../../../index-L8X2o7IH.mjs";
5
- import { useLevelContext as c } from "../../providers/LevelProvider/LevelProvider.js";
6
- import { hasItemIcon as p } from "../../utils/hasItemIcon/hasItemIcon.js";
7
- import '../../../../assets/Label2.css';const b = "_label_1ik2p_1", f = {
8
- label: b
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 } = c(t);
11
+ const { hasItemWithIcon: l } = i(t);
12
12
  return /* @__PURE__ */ m(
13
13
  n,
14
14
  {
15
15
  ref: r,
16
- className: i(f.label, a),
17
- "data-no-icon-align": p(o) || !l ? "" : void 0,
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 k, useMemo as u } from "react";
3
- import { f as w } from "../../../../index-BA3njR2k.mjs";
4
- import { c as z } from "../../../../index-L8X2o7IH.mjs";
5
- import { useLevelContext as H } from "../../providers/LevelProvider/LevelProvider.js";
6
- import { useContextMenuContext as P } from "../../ContextMenu.context.js";
7
- import { hasItemIcon as W } from "../../utils/hasItemIcon/hasItemIcon.js";
8
- import "../../../../useContentPositioning-BLCC-Xty.mjs";
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 Y } from "../../hooks/useContextMenuItemFocus/useContextMenuItemFocus.js";
11
- import '../../../../assets/RadioItem.css';const b = "_radio_item_zek17_1", q = {
12
- radio_item: b
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: _ = W,
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 = k(), { hasItemWithIcon: N } = H(i), { closeMenuImmediately: R } = P(i), {
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
- } = Y({
32
+ } = k({
33
33
  displayName: i,
34
34
  id: C,
35
35
  isDisabled: x
36
- }), y = u(() => _(m), [m]);
36
+ }), y = w(() => _(m), [m]);
37
37
  return /* @__PURE__ */ A(
38
- w,
38
+ H,
39
39
  {
40
40
  ref: n,
41
- className: z(q.radio_item, I),
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;+CAKb,QAAQ;;CAuCV,CAAC"}
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 b } from "../../../../index-BA3njR2k.mjs";
2
+ import { S as l } from "../../../../index-BA3njR2k.mjs";
3
3
  import "react";
4
- import { ContextMenuMode as l } from "../../ContextMenu.enums.js";
4
+ import { ContextMenuMode as x } from "../../ContextMenu.enums.js";
5
5
  import "../../providers/LevelProvider/LevelProvider.js";
6
- import "../../../../useContentPositioning-BLCC-Xty.mjs";
6
+ import "../../../../useContentPositioning-DO7ZotnD.mjs";
7
7
  import "../Content/Content.utils.js";
8
- import { useContextMenuSub as x } from "../../hooks/useContextMenuSub/useContextMenuSub.js";
9
- import { ContextMenuSubProvider as C, DISPLAY_NAME as t } from "./Sub.context.js";
10
- const O = ({
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 = l.HOVER,
12
+ mode: e = x.HOVER,
13
+ onOpen: m,
13
14
  defaultOpen: o,
14
- ...m
15
+ ...p
15
16
  }) => {
16
17
  const {
17
18
  open: n,
18
- setOpen: p,
19
- animatedOpen: a,
20
- startAnimation: s,
21
- handleMouseEnter: u,
22
- handleMouseLeave: d,
23
- handleOpenChange: M,
24
- triggerId: h,
25
- onOpenByKeyboard: S
26
- } = x({
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
- C,
34
+ O,
33
35
  {
34
36
  mode: e,
35
37
  open: n,
36
- setOpen: p,
37
- animatedOpen: a,
38
+ setOpen: a,
39
+ animatedOpen: s,
38
40
  defaultOpen: o,
39
- startAnimation: s,
40
- onMouseEnter: u,
41
- onMouseLeave: d,
42
- onOpenByKeyboard: S,
43
- triggerId: h,
41
+ startAnimation: u,
42
+ onMouseEnter: d,
43
+ onMouseLeave: M,
44
+ onOpenByKeyboard: b,
45
+ triggerId: S,
44
46
  children: /* @__PURE__ */ r(
45
- b,
47
+ l,
46
48
  {
47
49
  open: n,
48
- onOpenChange: M,
49
- ...m,
50
+ onOpenChange: h,
51
+ ...p,
50
52
  children: i
51
53
  }
52
54
  )
53
55
  }
54
56
  );
55
57
  };
56
- O.displayName = t;
58
+ f.displayName = t;
57
59
  export {
58
- O as Sub
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;IAC7E;;;;OAIG;IACH,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B,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"}
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"}
@@ -51,7 +51,7 @@ import '../../../../assets/SubContent.css';const j = "_sub_content_y6v65_1", q =
51
51
  {
52
52
  style: {
53
53
  position: "fixed",
54
- zIndex: Number.MAX_SAFE_INTEGER,
54
+ zIndex: Number.MAX_SAFE_INTEGER - 10,
55
55
  ...v
56
56
  },
57
57
  onMouseEnter: (t) => {
@@ -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-BLCC-Xty.mjs";
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-BLCC-Xty.mjs";
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-BLCC-Xty.mjs";
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 z } from "../../providers/LevelProvider/LevelProvider.js";
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-BLCC-Xty.mjs";
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 = "_sub_trigger_d2xgz_1", q = {
13
+ import '../../../../assets/SubTrigger.css';const Y = "_sub_trigger_ip3hq_1", w = {
14
14
  sub_trigger: Y
15
- }, a = "ContextMenu.SubTrigger", w = R(
15
+ }, p = "ContextMenu.SubTrigger", z = R(
16
16
  ({
17
- className: S,
17
+ className: L,
18
18
  children: v,
19
- isDisabled: n,
20
- onKeyDown: p,
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
- ...h
29
+ ...S
30
30
  }, l) => {
31
- const { hasItemWithIcon: A } = z(a), {
31
+ const { hasItemWithIcon: A } = q(p), {
32
32
  mode: r,
33
- open: x,
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: L
40
- } = D(a), {
39
+ onOpenByKeyboard: n
40
+ } = D(p), {
41
41
  dataHighlighted: K,
42
- onFocus: b,
42
+ onFocus: x,
43
43
  onMouseEnter: c,
44
44
  onBlur: I,
45
45
  onMouseLeave: _
46
46
  } = W({
47
- displayName: a,
47
+ displayName: p,
48
48
  id: y,
49
- isDisabled: n,
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(q.sub_trigger, S),
58
- disabled: n,
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": x || K === "" || r === i.CLICK && x ? "" : void 0,
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) ? L(!0) : t.key === "ArrowLeft" && (L(!1), t.currentTarget.focus())), p == null || p(t);
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
- b == null || b(), s == null || s(t);
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(!x)), e == null || e(t);
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
- ...h,
90
+ ...S,
91
91
  children: v
92
92
  }
93
93
  );
94
94
  }
95
95
  );
96
- w.displayName = a;
96
+ z.displayName = p;
97
97
  export {
98
- w as SubTrigger
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-BLCC-Xty.mjs";
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-BLCC-Xty.mjs";
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-BLCC-Xty.mjs";
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,GACZ,EAAE,wBAAwB;;;;;;;8BAyEQ,OAAO;8BAmCP,OAAO;;EA4GzC"}
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 L, useState as a, useRef as v, useEffect as x } from "react";
2
- import { ContextMenuMode as s } from "../../ContextMenu.enums.js";
3
- import { useLevelContext as g } from "../../providers/LevelProvider/LevelProvider.js";
4
- import "../../../../useContentPositioning-BLCC-Xty.mjs";
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 B } from "../useIsTouchDevice/useIsTouchDevice.js";
7
- import { useContextMenuContext as A } from "../../ContextMenu.context.js";
8
- function G({
9
- displayName: m,
10
- mode: y,
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 d = L(), [i, t] = a(c || !1), [M, n] = a(!1), [C, l] = a(!1), [T, u] = a(!1), e = v(null), r = v(null), O = B(), { hoverCloseDelay: I, animationDuration: H } = A(m), { activeItemId: p } = g(m), o = O ? s.CLICK : y, h = () => {
14
- e.current && (clearTimeout(e.current), e.current = null), r.current && (clearTimeout(r.current), r.current = null);
15
- }, K = () => {
16
- h(), n(!1), t(!1), l(!1), u(!1);
17
- }, R = () => {
18
- h(), o === s.HOVER ? (n(!1), r.current = setTimeout(() => {
19
- t(!1), l(!1), u(!1);
20
- }, H)) : (t(!1), l(!1), u(!1));
21
- }, E = (f) => {
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
- t(c), n(c), u(!1);
24
+ u(c), e == null || e(c), s(c), i(!1);
24
25
  return;
25
26
  }
26
- if (o === s.CLICK) {
27
- t(f), n(f);
27
+ if (l === a.CLICK) {
28
+ u(f), e == null || e(f), s(f);
28
29
  return;
29
30
  }
30
- f ? (r.current && (clearTimeout(r.current), r.current = null), o === s.HOVER && n(!0), t(!0)) : R();
31
- }, V = (f) => {
32
- u(f), E(f);
33
- }, b = () => {
34
- o === s.HOVER && (u(!1), r.current && (clearTimeout(r.current), r.current = null, n(!0)), i || (e.current && (clearTimeout(e.current), e.current = null), n(!0), t(!0)), l(!0));
35
- }, D = () => {
36
- o === s.HOVER && (u(!1), e.current && (clearTimeout(e.current), e.current = null), l(!1));
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 x(() => {
39
- p !== d && i && c === void 0 && K();
40
- }, [p, i, c]), x(() => {
41
- if (!(!i || o !== s.HOVER) && !T) {
42
- if (C) {
43
- e.current && (clearTimeout(e.current), e.current = null);
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 e.current || (e.current = setTimeout(() => {
47
- R();
48
- }, I)), () => {
49
- e.current && (clearTimeout(e.current), e.current = null);
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, i, C, I, T]), {
53
- open: i,
54
- setOpen: t,
55
- animatedOpen: M,
56
- startAnimation: () => n(!0),
57
- handleMouseEnter: b,
58
- handleMouseLeave: D,
59
- handleOpenChange: E,
60
- onOpenByKeyboard: V,
61
- triggerId: d
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
- G as useContextMenuSub
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
@@ -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;CACvB"}
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-BLCC-Xty.mjs";
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-BLCC-Xty.mjs";
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 {
@@ -57,7 +57,7 @@ import './assets/useContentPositioning.css';const q = "_content_k9opk_1", X = {
57
57
  k.div,
58
58
  {
59
59
  style: {
60
- zIndex: Number.MAX_SAFE_INTEGER,
60
+ zIndex: Number.MAX_SAFE_INTEGER - 10,
61
61
  position: "fixed",
62
62
  ...y
63
63
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kommo-crm/crm-react-ui-kit",
3
3
  "description": "Ready-to-use React components which implements Kommo design",
4
- "version": "1.1.1-beta.4",
4
+ "version": "1.1.1-beta.6",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "engines": {