@pgcorp/ui-kit 0.14.0 → 0.15.0

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 (117) hide show
  1. package/README.md +330 -12
  2. package/dist/assets/src/components/layout/{SResizeHandle.vue_vue_type_style_index_0_scoped_13b9b27a_lang.css → SResizeHandle.vue_vue_type_style_index_0_scoped_dc65aba1_lang.css} +1 -1
  3. package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_a108e8f1_scoped_a108e8f1_lang.css +2 -0
  4. package/dist/assets/src/components/shared/containers/{SCollapsiblePanel.css_vue_type_style_index_0_src_71824088_scoped_71824088_lang.css → SCollapsiblePanel.css_vue_type_style_index_0_src_db85261d_scoped_db85261d_lang.css} +1 -1
  5. package/dist/assets/src/components/shared/containers/{SOverlayHost.css_vue_type_style_index_0_src_8f9be94e_scoped_8f9be94e_lang.css → SOverlayHost.css_vue_type_style_index_0_src_09215628_scoped_09215628_lang.css} +1 -1
  6. package/dist/assets/src/components/shared/containers/{SPopover.css_vue_type_style_index_0_src_4091d007_scoped_4091d007_lang.css → SPopover.css_vue_type_style_index_0_src_a4f1f64a_scoped_a4f1f64a_lang.css} +1 -1
  7. package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_52396e42_scoped_52396e42_lang.css +2 -0
  8. package/dist/assets/src/components/shared/controls/SButton.css_vue_type_style_index_0_src_7a5acda9_scoped_7a5acda9_lang.css +1 -1
  9. package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_2562f916_scoped_2562f916_lang.css +2 -0
  10. package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_d630c922_scoped_d630c922_lang.css +2 -0
  11. package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_43b6e378_scoped_43b6e378_lang.css +1 -0
  12. package/dist/assets/src/components/shared/controls/{SDropdownMenu.css_vue_type_style_index_0_src_857e2649_scoped_857e2649_lang.css → SDropdownMenu.css_vue_type_style_index_0_src_40040ae5_scoped_40040ae5_lang.css} +1 -1
  13. package/dist/assets/src/components/shared/controls/{SMenuSurface.css_vue_type_style_index_0_src_84109ad9_scoped_84109ad9_lang.css → SMenuSurface.css_vue_type_style_index_0_src_d2b7d71b_scoped_d2b7d71b_lang.css} +1 -1
  14. package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_d1ead6c0_scoped_d1ead6c0_lang.css +2 -0
  15. package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_a69aa84b_scoped_a69aa84b_lang.css +2 -0
  16. package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_d94fcf8c_scoped_d94fcf8c_lang.css +2 -0
  17. package/dist/assets/src/components/shared/data-display/STooltip.css_vue_type_style_index_0_src_true_lang.css +1 -1
  18. package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_914bad28_scoped_914bad28_lang.css +2 -0
  19. package/dist/assets/src/components/shared/navigation/{SBottomNav.vue_vue_type_style_index_0_scoped_24be0f2b_lang.css → SBottomNav.vue_vue_type_style_index_0_scoped_68cf84b3_lang.css} +1 -1
  20. package/dist/src/components/layout/SResizeHandle.vue.js +2 -2
  21. package/dist/src/components/layout/SResizeHandle.vue_vue_type_script_setup_true_lang.js +4 -2
  22. package/dist/src/components/shared/_internal/SDialogSurface.vue.d.ts +9 -1
  23. package/dist/src/components/shared/_internal/SDialogSurface.vue.js +2 -2
  24. package/dist/src/components/shared/_internal/SDialogSurface.vue_vue_type_script_setup_true_lang.js +174 -82
  25. package/dist/src/components/shared/_internal/dialogSurface.d.ts +2 -0
  26. package/dist/src/components/shared/_internal/dialogSurface.js +30 -27
  27. package/dist/src/components/shared/_internal/dialogSurfaceMotion.d.ts +14 -0
  28. package/dist/src/components/shared/_internal/dialogSurfaceMotion.js +84 -0
  29. package/dist/src/components/shared/_internal/focusTrap.js +15 -13
  30. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.d.ts +5 -0
  31. package/dist/src/components/shared/containers/SCollapsiblePanel.vue.js +2 -2
  32. package/dist/src/components/shared/containers/SCollapsiblePanel.vue_vue_type_script_setup_true_lang.js +123 -121
  33. package/dist/src/components/shared/containers/SDrawer.vue.d.ts +4 -4
  34. package/dist/src/components/shared/containers/SDrawer.vue.js +3 -6
  35. package/dist/src/components/shared/containers/SDrawer.vue_vue_type_script_setup_true_lang.js +104 -128
  36. package/dist/src/components/shared/containers/SModal.vue.d.ts +8 -8
  37. package/dist/src/components/shared/containers/SModal.vue.js +3 -6
  38. package/dist/src/components/shared/containers/SModal.vue_vue_type_script_setup_true_lang.js +87 -103
  39. package/dist/src/components/shared/containers/SOverlayHost.vue.js +2 -2
  40. package/dist/src/components/shared/containers/SOverlayHost.vue_vue_type_script_setup_true_lang.js +32 -31
  41. package/dist/src/components/shared/containers/SPanel.vue.d.ts +1 -1
  42. package/dist/src/components/shared/containers/SPopover.vue.js +2 -2
  43. package/dist/src/components/shared/containers/SPopover.vue_vue_type_script_setup_true_lang.js +225 -200
  44. package/dist/src/components/shared/containers/SSidebarSection.vue.js +2 -2
  45. package/dist/src/components/shared/containers/SSidebarSection.vue_vue_type_script_setup_true_lang.js +4 -3
  46. package/dist/src/components/shared/controls/SCheckbox.vue.js +2 -2
  47. package/dist/src/components/shared/controls/SCheckbox.vue_vue_type_script_setup_true_lang.js +13 -7
  48. package/dist/src/components/shared/controls/SCombobox.vue.js +2 -2
  49. package/dist/src/components/shared/controls/SCombobox.vue_vue_type_script_setup_true_lang.js +104 -94
  50. package/dist/src/components/shared/controls/SContextMenu.vue.js +2 -2
  51. package/dist/src/components/shared/controls/SContextMenu.vue_vue_type_script_setup_true_lang.js +86 -81
  52. package/dist/src/components/shared/controls/SDropdownMenu.vue.js +2 -2
  53. package/dist/src/components/shared/controls/SDropdownMenu.vue_vue_type_script_setup_true_lang.js +77 -72
  54. package/dist/src/components/shared/controls/SMenuSurface.vue.js +2 -2
  55. package/dist/src/components/shared/controls/SMenuSurface.vue_vue_type_script_setup_true_lang.js +81 -77
  56. package/dist/src/components/shared/controls/SSelect.vue.js +2 -2
  57. package/dist/src/components/shared/controls/SSelect.vue_vue_type_script_setup_true_lang.js +85 -77
  58. package/dist/src/components/shared/data-display/SControlledToastViewport.vue.js +2 -2
  59. package/dist/src/components/shared/data-display/SControlledToastViewport.vue_vue_type_script_setup_true_lang.js +58 -49
  60. package/dist/src/components/shared/data-display/SScrollViewport.vue.d.ts +10 -5
  61. package/dist/src/components/shared/data-display/SScrollViewport.vue.js +2 -2
  62. package/dist/src/components/shared/data-display/SScrollViewport.vue_vue_type_script_setup_true_lang.js +162 -111
  63. package/dist/src/components/shared/data-display/STooltip.vue_vue_type_script_setup_true_lang.js +276 -224
  64. package/dist/src/components/shared/data-display/_internal/STableFrame.vue.d.ts +3 -3
  65. package/dist/src/components/shared/data-display/_internal/STableFrame.vue.js +2 -2
  66. package/dist/src/components/shared/data-display/_internal/STableFrame.vue_vue_type_script_setup_true_lang.js +62 -46
  67. package/dist/src/components/shared/data-display/scrollViewport.d.ts +2 -0
  68. package/dist/src/components/shared/navigation/SBottomNav.vue.js +2 -2
  69. package/dist/src/components/shared/navigation/SBottomNav.vue_vue_type_script_setup_true_lang.js +3 -1
  70. package/dist/src/components/shared/navigation/STabList.vue.d.ts +1 -1
  71. package/dist/src/composables/useDialogOverlay.d.ts +12 -2
  72. package/dist/src/composables/useDialogOverlay.js +192 -119
  73. package/dist/src/internal/flatTree.d.ts +8 -0
  74. package/dist/src/internal/flatTree.js +23 -0
  75. package/dist/src/internal/focusNavigation.d.ts +3 -0
  76. package/dist/src/internal/focusNavigation.js +28 -15
  77. package/dist/src/internal/inertLease.d.ts +8 -0
  78. package/dist/src/internal/inertLease.js +33 -0
  79. package/dist/src/internal/layerStack.d.ts +40 -0
  80. package/dist/src/internal/layerStack.js +301 -94
  81. package/dist/src/internal/nativeFocus.d.ts +4 -0
  82. package/dist/src/internal/nativeFocus.js +12 -0
  83. package/dist/src/internal/overlayPortal.d.ts +17 -0
  84. package/dist/src/internal/overlayPortal.js +23 -0
  85. package/dist/src/internal/semanticSizing.d.ts +2 -2
  86. package/dist/src/internal/semanticSizing.js +2 -1
  87. package/dist/src/internal/useMenuLayer.d.ts +1 -0
  88. package/dist/src/internal/useMenuLayer.js +63 -57
  89. package/dist/src/internal/viewportModality.d.ts +27 -0
  90. package/dist/src/internal/viewportModality.js +132 -0
  91. package/dist/typography.js +17 -62
  92. package/docs/overlay-lifecycle.md +195 -0
  93. package/docs/public-api.md +141 -4
  94. package/docs/resize.md +34 -5
  95. package/docs/scroll-viewport.md +30 -10
  96. package/docs/theming.md +42 -8
  97. package/package.json +1 -1
  98. package/src/components/shared/_internal/SDialogSurface.css +185 -40
  99. package/src/components/shared/controls/SButton.css +0 -3
  100. package/src/components/shared/controls/SCheckbox.css +19 -7
  101. package/src/components/shared/data-display/SControlledToastViewport.css +2 -10
  102. package/src/components/shared/data-display/SScrollViewport.css +17 -1
  103. package/src/components/shared/data-display/STooltip.css +1 -1
  104. package/src/components/shared/data-display/_internal/STableFrame.css +1 -5
  105. package/dist/assets/src/components/shared/_internal/SDialogSurface.css_vue_type_style_index_0_src_0e58afdc_scoped_0e58afdc_lang.css +0 -2
  106. package/dist/assets/src/components/shared/containers/SDrawer.css_vue_type_style_index_0_src_61cf20dd_scoped_61cf20dd_lang.css +0 -2
  107. package/dist/assets/src/components/shared/containers/SModal.css_vue_type_style_index_0_src_42e1bd5f_scoped_42e1bd5f_lang.css +0 -2
  108. package/dist/assets/src/components/shared/containers/SSidebarSection.css_vue_type_style_index_0_src_21f71ae8_scoped_21f71ae8_lang.css +0 -2
  109. package/dist/assets/src/components/shared/controls/SCheckbox.css_vue_type_style_index_0_src_55d4826e_scoped_55d4826e_lang.css +0 -2
  110. package/dist/assets/src/components/shared/controls/SCombobox.css_vue_type_style_index_0_src_537f5744_scoped_537f5744_lang.css +0 -2
  111. package/dist/assets/src/components/shared/controls/SContextMenu.css_vue_type_style_index_0_src_03921269_scoped_03921269_lang.css +0 -1
  112. package/dist/assets/src/components/shared/controls/SSelect.css_vue_type_style_index_0_src_df3d6688_scoped_df3d6688_lang.css +0 -2
  113. package/dist/assets/src/components/shared/data-display/SControlledToastViewport.css_vue_type_style_index_0_src_5864b6c6_scoped_5864b6c6_lang.css +0 -2
  114. package/dist/assets/src/components/shared/data-display/SScrollViewport.css_vue_type_style_index_0_src_e5d11342_scoped_e5d11342_lang.css +0 -2
  115. package/dist/assets/src/components/shared/data-display/_internal/STableFrame.css_vue_type_style_index_0_src_52b5825e_scoped_52b5825e_lang.css +0 -2
  116. package/src/components/shared/containers/SDrawer.css +0 -87
  117. package/src/components/shared/containers/SModal.css +0 -27
@@ -6,9 +6,9 @@ import { useMenuLayer as i } from "../../../internal/useMenuLayer.js";
6
6
  import a from "../_internal/SMenuLayer.vue.js";
7
7
  import { validateSMenuEntries as o } from "./menu.js";
8
8
  import s from "./SMenuSurface.vue.js";
9
- import { Teleport as c, Transition as ee, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createVNode as p, defineComponent as m, mergeProps as te, nextTick as h, onBeforeUnmount as g, onUpdated as _, openBlock as v, ref as y, renderSlot as b, unref as x, useId as ne, watch as S, watchEffect as re, withCtx as C } from "vue";
9
+ import { Teleport as c, Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as ee, createVNode as p, defineComponent as m, mergeProps as te, nextTick as h, onBeforeUnmount as g, onUpdated as ne, openBlock as _, ref as v, renderSlot as re, unref as y, useId as ie, watch as b, watchEffect as x, withCtx as S } from "vue";
10
10
  //#region src/components/shared/controls/SContextMenu.vue?vue&type=script&setup=true&lang.ts
11
- var w = ["data-layout"], T = /*@__PURE__*/ m({
11
+ var ae = ["data-layout"], C = /*@__PURE__*/ m({
12
12
  inheritAttrs: !1,
13
13
  __name: "SContextMenu",
14
14
  props: {
@@ -21,57 +21,57 @@ var w = ["data-layout"], T = /*@__PURE__*/ m({
21
21
  boundaryLayout: { default: "block" }
22
22
  },
23
23
  emits: ["before-open", "select"],
24
- setup(m, { emit: T }) {
25
- let E = m, D = T, ie = n({
24
+ setup(m, { emit: C }) {
25
+ let w = m, T = C, E = n({
26
26
  component: "SContextMenu",
27
27
  owner: "interaction boundary root"
28
- }), O = t();
28
+ }), D = t();
29
29
  r({
30
30
  owner: "SContextMenu",
31
- active: () => E.enabled
31
+ active: () => w.enabled
32
32
  });
33
- let k = `s-context-menu-${ne()}`, A = y("first"), j = y(null), M = y(null), N = y(null), P = y(!1), F = l(() => M.value?.getElement() ?? null), I = null, { isOpen: L, position: R, availableSize: z, zIndex: B, open: V, close: H, closeForTab: U } = i(M, { onRequestDismiss: (e) => q(e) }), W = l(() => L.value && P.value ? k : void 0), G = l(() => E.enabled ? {
33
+ let O = `s-context-menu-${ie()}`, k = v("first"), A = v(null), j = v(null), M = v(null), N = v(!1), P = u(() => j.value?.getElement() ?? null), F = null, { isOpen: I, portalTarget: L, position: R, availableSize: z, zIndex: B, open: V, close: H, closeForTab: U } = i(j, { onRequestDismiss: (e) => q(e) }), W = u(() => I.value && N.value ? O : void 0), G = u(() => w.enabled ? {
34
34
  "aria-haspopup": "menu",
35
- "aria-expanded": L.value,
35
+ "aria-expanded": I.value,
36
36
  "aria-controls": W.value,
37
- onKeydown: se
38
- } : {}), K = l(() => E.enabled ? {
37
+ onKeydown: ce
38
+ } : {}), K = u(() => w.enabled ? {
39
39
  "aria-haspopup": "menu",
40
40
  "aria-controls": W.value,
41
- onKeydown: oe
41
+ onKeydown: se
42
42
  } : {});
43
43
  function q(e = "programmatic") {
44
- let t = I;
45
- I = null, t?.release(), P.value = !1, H(e);
44
+ let t = F;
45
+ F = null, t?.release(), N.value = !1, H(e);
46
46
  }
47
- let J = (t) => I === t && E.enabled && O.value && j.value === t.boundary && t.boundary.isConnected && t.target.isConnected && t.boundary.contains(t.target) && (!t.focusOwner || t.focusOwner.isConnected && e(t.focusOwner) === t.focusOwner), Y = () => {
48
- let e = I;
47
+ let J = (t) => F === t && w.enabled && D.value && L.value !== null && A.value === t.boundary && t.boundary.isConnected && t.target.isConnected && t.boundary.contains(t.target) && (!t.focusOwner || t.focusOwner.isConnected && e(t.focusOwner) === t.focusOwner), Y = () => {
48
+ let e = F;
49
49
  e && !J(e) && q("outside");
50
- }, ae = async (e) => {
51
- if (await h(), I !== e) return;
50
+ }, oe = async (e) => {
51
+ if (await h(), F !== e) return;
52
52
  if (!J(e)) {
53
53
  q("outside");
54
54
  return;
55
55
  }
56
- if (e.phase = "mounting", A.value = e.initialFocus, await V(e.anchor, e.focusOwner), I !== e) return;
57
- if (!J(e) || !L.value || !F.value?.isConnected) {
56
+ if (e.phase = "mounting", k.value = e.initialFocus, await V(e.anchor, e.focusOwner), F !== e) return;
57
+ if (!J(e) || !I.value || !P.value?.isConnected) {
58
58
  q("outside");
59
59
  return;
60
60
  }
61
- if (P.value = !0, await h(), I !== e) return;
62
- if (!J(e) || !L.value || !F.value?.isConnected) {
61
+ if (N.value = !0, await h(), F !== e) return;
62
+ if (!J(e) || !I.value || !P.value?.isConnected) {
63
63
  q("outside");
64
64
  return;
65
65
  }
66
- let t = N.value;
66
+ let t = M.value;
67
67
  if (!t) throw q("outside"), Error("SContextMenu: current menu surface is unavailable after opening");
68
68
  e.phase = "open", e.initialFocus === "last" ? t.focusLast() : t.focusFirst();
69
69
  }, X = (e, t, n, r) => {
70
- let i = j.value, a = e.target;
71
- if (!O.value || !E.enabled || e.defaultPrevented || !i?.isConnected || !(a instanceof Node) || !a.isConnected || !i.contains(a) || F.value?.contains(a)) return;
70
+ let i = A.value, a = e.target;
71
+ if (!D.value || L.value === null || !w.enabled || e.defaultPrevented || !i?.isConnected || !(a instanceof Node) || !a.isConnected || !i.contains(a) || P.value?.contains(a)) return;
72
72
  q("outside");
73
73
  let o = (e) => {
74
- e.key === "Escape" && I === c && c.phase !== "open" && q("outside");
74
+ e.key === "Escape" && F === c && c.phase !== "open" && q("outside");
75
75
  }, s = new MutationObserver(Y), c = {
76
76
  boundary: i,
77
77
  target: n && i.contains(n) ? n : a,
@@ -86,13 +86,13 @@ var w = ["data-layout"], T = /*@__PURE__*/ m({
86
86
  if (s.observe(document.documentElement, {
87
87
  childList: !0,
88
88
  subtree: !0
89
- }), window.addEventListener("keydown", o, !0), I = c, D("before-open", e), e.defaultPrevented) {
90
- I === c && q("outside");
89
+ }), window.addEventListener("keydown", o, !0), F = c, T("before-open", e), e.defaultPrevented) {
90
+ F === c && q("outside");
91
91
  return;
92
92
  }
93
- e.preventDefault(), e.stopPropagation(), I === c && ae(c);
93
+ e.preventDefault(), e.stopPropagation(), F === c && oe(c);
94
94
  }, Z = (e, t, n) => {
95
- if (!E.enabled || e.defaultPrevented || e.isComposing) return;
95
+ if (!w.enabled || e.defaultPrevented || e.isComposing) return;
96
96
  let r = n ?? e.currentTarget;
97
97
  if (!(r instanceof HTMLElement)) throw TypeError("SContextMenu: trigger keydown currentTarget must be an HTMLElement");
98
98
  X(e, {
@@ -100,21 +100,21 @@ var w = ["data-layout"], T = /*@__PURE__*/ m({
100
100
  element: r,
101
101
  align: "left"
102
102
  }, r, t);
103
- }, Q = (e) => !e.altKey && !e.ctrlKey && !e.metaKey && (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey), oe = (e) => {
103
+ }, Q = (e) => !e.altKey && !e.ctrlKey && !e.metaKey && (e.key === "ContextMenu" || e.key === "F10" && e.shiftKey), se = (e) => {
104
104
  Q(e) && Z(e, "first");
105
- }, se = (e) => {
105
+ }, ce = (e) => {
106
106
  if (Q(e)) {
107
107
  Z(e, "first");
108
108
  return;
109
109
  }
110
- (E.trigger === "click" || E.trigger === "both") && (e.key === "ArrowDown" || e.key === "ArrowUp") && Z(e, e.key === "ArrowUp" ? "last" : "first");
111
- }, ce = (t) => {
112
- if (!Q(t) || !E.enabled || t.defaultPrevented || t.isComposing) return;
113
- let n = j.value, r = document.activeElement;
110
+ (w.trigger === "click" || w.trigger === "both") && (e.key === "ArrowDown" || e.key === "ArrowUp") && Z(e, e.key === "ArrowUp" ? "last" : "first");
111
+ }, le = (t) => {
112
+ if (!Q(t) || !w.enabled || t.defaultPrevented || t.isComposing) return;
113
+ let n = A.value, r = document.activeElement;
114
114
  r instanceof HTMLElement && t.target === r && n?.contains(r) && r !== n && e(r, n) === r && Z(t, "first", r);
115
115
  }, $ = (t) => {
116
- if (!E.enabled || t.defaultPrevented) return;
117
- let n = e(t.target, j.value), r = e(document.activeElement), i = n ?? (r && F.value?.contains(r) ? I?.focusOwner ?? null : r), a = t.clientX === 0 && t.clientY === 0 && t.detail === 0;
116
+ if (!w.enabled || t.defaultPrevented) return;
117
+ let n = e(t.target, A.value), r = e(document.activeElement), i = n ?? (r && P.value?.contains(r) ? F?.focusOwner ?? null : r), a = t.clientX === 0 && t.clientY === 0 && t.detail === 0;
118
118
  X(t, a && i ? {
119
119
  type: "element",
120
120
  element: i,
@@ -124,77 +124,82 @@ var w = ["data-layout"], T = /*@__PURE__*/ m({
124
124
  x: t.clientX,
125
125
  y: t.clientY
126
126
  }, i, "first");
127
- }, le = (e) => {
128
- (E.trigger === "click" || E.trigger === "both") && $(e);
129
127
  }, ue = (e) => {
130
- (E.trigger === "contextmenu" || E.trigger === "both") && $(e);
128
+ (w.trigger === "click" || w.trigger === "both") && $(e);
129
+ }, de = (e) => {
130
+ (w.trigger === "contextmenu" || w.trigger === "both") && $(e);
131
131
  };
132
- S(() => E.enabled, (e) => {
132
+ b(() => w.enabled, (e) => {
133
133
  e || q("programmatic");
134
- }, { flush: "sync" }), S(O, (e) => {
134
+ }, { flush: "sync" }), b(D, (e) => {
135
135
  e || q("outside");
136
- }, { flush: "sync" }), S(L, (e) => {
137
- if (e || (P.value = !1), e || !I || I.phase === "preparing") return;
138
- let t = I;
139
- I = null, t.release();
140
- }, { flush: "sync" }), _(Y), g(() => q("outside"));
141
- let de = (e, t) => {
142
- e.disabled || (q("selection"), D("select", e, t));
136
+ }, { flush: "sync" }), b(L, (e) => {
137
+ e === null && q("outside");
138
+ }, { flush: "sync" }), b(I, (e) => {
139
+ if (e || (N.value = !1), e || !F || F.phase === "preparing") return;
140
+ let t = F;
141
+ F = null, t.release();
142
+ }, { flush: "sync" }), ne(Y), g(() => q("outside"));
143
+ let fe = (e, t) => {
144
+ e.disabled || (q("selection"), T("select", e, t));
143
145
  };
144
- return re(() => {
145
- if (o(E.items), typeof E.enabled != "boolean") throw TypeError("SContextMenu: enabled must be a boolean");
146
+ return x(() => {
147
+ if (o(w.items), typeof w.enabled != "boolean") throw TypeError("SContextMenu: enabled must be a boolean");
146
148
  if (![
147
149
  "contextmenu",
148
150
  "click",
149
151
  "both"
150
- ].includes(E.trigger)) throw TypeError("SContextMenu: trigger must be 'contextmenu', 'click', or 'both'");
152
+ ].includes(w.trigger)) throw TypeError("SContextMenu: trigger must be 'contextmenu', 'click', or 'both'");
151
153
  if (![
152
154
  "block",
153
155
  "inline",
154
156
  "contents"
155
- ].includes(E.boundaryLayout)) throw TypeError("SContextMenu: boundaryLayout must be 'block', 'inline', or 'contents'");
156
- }), (e, t) => (v(), f("div", te({
157
+ ].includes(w.boundaryLayout)) throw TypeError("SContextMenu: boundaryLayout must be 'block', 'inline', or 'contents'");
158
+ }), (e, t) => (_(), ee("div", te({
157
159
  ref_key: "boundaryRef",
158
- ref: j
159
- }, x(ie).bindings(), {
160
+ ref: A
161
+ }, y(E).bindings(), {
160
162
  class: "s-context-menu-boundary",
161
163
  "data-layout": m.boundaryLayout,
162
- onClick: le,
163
- onContextmenu: ue,
164
- onKeydown: ce
165
- }), [b(e.$slots, "default", {
164
+ onClick: ue,
165
+ onContextmenu: de,
166
+ onKeydown: le
167
+ }), [re(e.$slots, "default", {
166
168
  triggerProps: G.value,
167
169
  textInputTriggerProps: K.value
168
- }, void 0, !0), (v(), u(c, { to: "body" }, [p(ee, {
169
- "enter-active-class": "transition ease-out duration-[var(--s-motion-fast)]",
170
- "enter-from-class": "transform opacity-0 scale-95",
171
- "enter-to-class": "transform opacity-100 scale-100",
172
- "leave-active-class": "transition ease-in duration-[var(--s-motion-instant)]",
173
- "leave-from-class": "transform opacity-100 scale-100",
174
- "leave-to-class": "transform opacity-0 scale-95"
170
+ }, void 0, !0), y(L) ? (_(), d(c, {
171
+ key: 0,
172
+ to: y(L)
173
+ }, [p(l, {
174
+ "enter-active-class": "transition-transform ease-out duration-[var(--s-motion-fast)]",
175
+ "enter-from-class": "transform scale-95",
176
+ "enter-to-class": "transform scale-100",
177
+ "leave-active-class": "transition-transform ease-in duration-[var(--s-motion-instant)]",
178
+ "leave-from-class": "transform scale-100",
179
+ "leave-to-class": "transform scale-95"
175
180
  }, {
176
- default: C(() => [x(L) ? (v(), u(a, {
181
+ default: S(() => [y(I) ? (_(), d(a, {
177
182
  key: 0,
178
183
  ref_key: "layerRef",
179
- ref: M,
184
+ ref: j,
180
185
  kind: "context",
181
186
  "landmark-label": "Контекстные действия",
182
- position: x(R),
183
- "available-size": x(z),
184
- "z-index": x(B)
187
+ position: y(R),
188
+ "available-size": y(z),
189
+ "z-index": y(B)
185
190
  }, {
186
- default: C(() => [p(s, {
191
+ default: S(() => [p(s, {
187
192
  ref_key: "menuSurfaceRef",
188
- ref: N,
189
- id: k,
193
+ ref: M,
194
+ id: O,
190
195
  label: "Контекстные действия",
191
- "initial-focus": A.value,
196
+ "initial-focus": k.value,
192
197
  items: m.items,
193
198
  onDismissTree: t[0] ||= (e) => q("outside"),
194
199
  onEscape: t[1] ||= (e) => q("escape"),
195
200
  onFocusExit: t[2] ||= (e) => q("outside"),
196
- onSelect: de,
197
- onTab: x(U)
201
+ onSelect: fe,
202
+ onTab: y(U)
198
203
  }, null, 8, [
199
204
  "initial-focus",
200
205
  "items",
@@ -205,10 +210,10 @@ var w = ["data-layout"], T = /*@__PURE__*/ m({
205
210
  "position",
206
211
  "available-size",
207
212
  "z-index"
208
- ])) : d("", !0)]),
213
+ ])) : f("", !0)]),
209
214
  _: 1
210
- })]))], 16, w));
215
+ })], 8, ["to"])) : f("", !0)], 16, ae));
211
216
  }
212
217
  });
213
218
  //#endregion
214
- export { T as default };
219
+ export { C as default };
@@ -1,8 +1,8 @@
1
- import "../../../../assets/src/components/shared/controls/SDropdownMenu.css_vue_type_style_index_0_src_857e2649_scoped_857e2649_lang.css";
1
+ import "../../../../assets/src/components/shared/controls/SDropdownMenu.css_vue_type_style_index_0_src_40040ae5_scoped_40040ae5_lang.css";
2
2
  import e from "../../../../_virtual/_plugin-vue_export-helper.js";
3
3
  import t from "./SDropdownMenu.vue_vue_type_script_setup_true_lang.js";
4
4
  /* empty css */
5
5
  //#region src/components/shared/controls/SDropdownMenu.vue
6
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-857e2649"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-40040ae5"]]);
7
7
  //#endregion
8
8
  export { n as default };
@@ -1,14 +1,14 @@
1
1
  import { validateBoolean as e, validateExactString as t } from "../../../internal/runtimeContract.js";
2
2
  import { useUiKitLocale as n } from "../../../composables/useUiKitLocale.js";
3
- import { useOwnedAttrs as r } from "../../../internal/ownedAttrs.js";
4
- import ee from "./SButton.vue.js";
3
+ import { useOwnedAttrs as ee } from "../../../internal/ownedAttrs.js";
4
+ import r from "./SButton.vue.js";
5
5
  import { useMenuLayer as i } from "../../../internal/useMenuLayer.js";
6
6
  import a from "../_internal/SMenuLayer.vue.js";
7
7
  import { validateSMenuEntries as o } from "./menu.js";
8
8
  import s from "./SMenuSurface.vue.js";
9
- import { Teleport as c, computed as l, createBlock as u, createCommentVNode as te, createElementBlock as d, createVNode as f, defineComponent as p, mergeProps as m, nextTick as h, onMounted as g, openBlock as _, ref as v, renderSlot as ne, unref as y, useId as b, useSlots as x, watch as S, watchEffect as re, withCtx as ie } from "vue";
9
+ import { Teleport as te, computed as c, createBlock as l, createCommentVNode as u, createElementBlock as d, createVNode as f, defineComponent as p, mergeProps as m, nextTick as h, onMounted as g, openBlock as _, ref as v, renderSlot as y, unref as b, useId as x, useSlots as ne, watch as S, watchEffect as re, withCtx as C } from "vue";
10
10
  //#region src/components/shared/controls/SDropdownMenu.vue?vue&type=script&setup=true&lang.ts
11
- var ae = { class: "s-dropdown-menu" }, C = /*@__PURE__*/ p({
11
+ var w = { class: "s-dropdown-menu" }, T = /*@__PURE__*/ p({
12
12
  inheritAttrs: !1,
13
13
  __name: "SDropdownMenu",
14
14
  props: {
@@ -30,17 +30,17 @@ var ae = { class: "s-dropdown-menu" }, C = /*@__PURE__*/ p({
30
30
  }
31
31
  },
32
32
  emits: ["select", "update:open"],
33
- setup(p, { emit: C }) {
34
- let w = p, { t: T } = n(), E = l(() => w.menuLabel ?? T("dialog.moreActions")), D = C, O = x(), k = r({
33
+ setup(p, { emit: T }) {
34
+ let E = p, { t: D } = n(), O = c(() => E.menuLabel ?? D("dialog.moreActions")), k = T, ie = ne(), A = ee({
35
35
  component: "SDropdownMenu",
36
36
  owner: "menu trigger"
37
- }), A = v(null), j = v(null), M = null, N = v(!1), { isOpen: P, position: F, availableSize: I, zIndex: L, close: R, closeForTab: z, open: B } = i(A, {
38
- onRequestDismiss: Q,
37
+ }), j = v(null), M = v(null), N = null, P = v(!1), F = !1, { isOpen: I, portalTarget: L, position: R, availableSize: z, zIndex: B, close: V, closeForTab: H, open: U } = i(j, {
38
+ onRequestDismiss: $,
39
39
  onRetire: () => {
40
- N.value = !0, D("update:open", !1);
40
+ P.value = !0, k("update:open", !1);
41
41
  }
42
- }), V = `s-dropdown-menu-${b()}`, H = v("first"), U = !!O.default, W = l(() => w.open !== void 0), G = l(() => !N.value && (W.value ? w.open === !0 : P.value));
43
- function K(e) {
42
+ }), W = `s-dropdown-menu-${x()}`, G = v("first"), K = !!ie.default, q = c(() => E.open !== void 0), J = c(() => L.value !== null && !P.value && (q.value ? E.open === !0 : I.value));
43
+ function ae(e) {
44
44
  if (e === null) return null;
45
45
  if (e instanceof HTMLElement) return e;
46
46
  let t = Reflect.get(e, "getElement");
@@ -49,110 +49,115 @@ var ae = { class: "s-dropdown-menu" }, C = /*@__PURE__*/ p({
49
49
  if (!(n instanceof HTMLElement)) throw Error("SDropdownMenu: trigger leaf getElement() must return an HTMLElement");
50
50
  return n;
51
51
  }
52
- let q = (e) => {
53
- if (e !== null && M !== null && e !== M) throw Error("SDropdownMenu: trigger binding must belong to exactly one UI-kit leaf");
54
- M = e;
55
- }, J = () => {
56
- let e = k.bindings();
52
+ let oe = (e) => {
53
+ if (e !== null && N !== null && e !== N) throw Error("SDropdownMenu: trigger binding must belong to exactly one UI-kit leaf");
54
+ N = e;
55
+ }, Y = () => {
56
+ let e = A.bindings();
57
57
  if (Object.prototype.hasOwnProperty.call(e, "onClick")) throw Error("SDropdownMenu: @click belongs to the typed triggerAttrs activation contract");
58
58
  return {
59
59
  ...e,
60
- ref: q,
60
+ ref: oe,
61
61
  "aria-haspopup": "menu",
62
- "aria-expanded": G.value,
63
- "aria-controls": V,
64
- onClick: $,
65
- onKeydown: se
62
+ "aria-expanded": J.value,
63
+ "aria-controls": W,
64
+ onClick: ce,
65
+ onKeydown: le
66
66
  };
67
67
  };
68
- function Y(e) {
69
- let t = K(M);
68
+ function X(e) {
69
+ let t = ae(N);
70
70
  if (!t) throw Error("SDropdownMenu: expected exactly one trigger, received 0");
71
71
  if (e?.currentTarget instanceof HTMLElement && e.currentTarget !== t) throw Error("SDropdownMenu: activation target does not match the registered trigger");
72
72
  return t;
73
73
  }
74
74
  g(() => {
75
- let e = Y();
76
- if (e.getAttribute("aria-haspopup") !== "menu" || e.getAttribute("aria-controls") !== V) throw Error("SDropdownMenu: expected exactly one trigger, received 0");
77
- (W.value && w.open || !W.value && w.defaultOpen) && X();
75
+ let e = X();
76
+ if (e.getAttribute("aria-haspopup") !== "menu" || e.getAttribute("aria-controls") !== W) throw Error("SDropdownMenu: expected exactly one trigger, received 0");
77
+ (q.value && E.open || !q.value && E.defaultOpen) && (L.value === null ? F = !0 : Z());
78
78
  });
79
- function oe(e) {
80
- let t = Y(e), n = w.placement === "auto" ? void 0 : w.placement;
79
+ function se(e) {
80
+ let t = X(e), n = E.placement === "auto" ? void 0 : E.placement;
81
81
  return {
82
82
  anchor: {
83
83
  type: "element",
84
84
  element: t,
85
- align: w.align,
85
+ align: E.align,
86
86
  ...n === void 0 ? {} : { placement: n }
87
87
  },
88
88
  trigger: t
89
89
  };
90
90
  }
91
- async function X(e) {
92
- if (N.value || P.value) return;
93
- let { anchor: t, trigger: n } = oe(e);
94
- await B(t, n);
95
- }
96
- function Z(e) {
97
- N.value && W.value || (N.value = !1, !G.value && (D("update:open", !0), W.value || X(e)));
91
+ async function Z(e) {
92
+ if (P.value || L.value === null || (F = !1, I.value)) return;
93
+ let { anchor: t, trigger: n } = se(e);
94
+ await U(t, n);
98
95
  }
99
96
  function Q(e) {
100
- (G.value || P.value) && (D("update:open", !1), W.value || R(e));
97
+ L.value !== null && (P.value && q.value || (P.value = !1, !J.value && (k("update:open", !0), q.value || Z(e))));
101
98
  }
102
99
  function $(e) {
103
- G.value ? Q("trigger") : (H.value = "first", Z(e));
100
+ (J.value || I.value) && (k("update:open", !1), q.value || V(e));
101
+ }
102
+ function ce(e) {
103
+ J.value ? $("trigger") : (G.value = "first", Q(e));
104
104
  }
105
- async function se(e) {
106
- (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), e.stopPropagation(), H.value = e.key === "ArrowUp" ? "last" : "first", G.value || Z(e), await h(), await h(), P.value && (H.value === "last" ? j.value?.focusLast() : j.value?.focusFirst()));
105
+ async function le(e) {
106
+ (e.key === "ArrowDown" || e.key === "ArrowUp") && (e.preventDefault(), e.stopPropagation(), G.value = e.key === "ArrowUp" ? "last" : "first", J.value || Q(e), await h(), await h(), I.value && (G.value === "last" ? M.value?.focusLast() : M.value?.focusFirst()));
107
107
  }
108
- function ce(e, t) {
109
- e.disabled || (D("select", e, t), w.closeOnSelect && Q("selection"));
108
+ function ue(e, t) {
109
+ e.disabled || (k("select", e, t), E.closeOnSelect && $("selection"));
110
110
  }
111
- function le(e) {
112
- z(e);
111
+ function de(e) {
112
+ H(e);
113
113
  }
114
- return S(() => w.open, (e) => {
115
- e !== void 0 && (e || (N.value = !1), e && !P.value ? X() : !e && P.value && R("programmatic"));
116
- }), S(() => [w.align, w.placement], () => {
117
- P.value && (R("programmatic"), X());
114
+ return S(() => E.open, (e) => {
115
+ e !== void 0 && (e || (F = !1), e || (P.value = !1), e && !I.value ? Z() : !e && I.value && V("programmatic"));
116
+ }), S(L, (e) => {
117
+ e === null || P.value || (F || q.value && E.open) && Z();
118
+ }, { flush: "post" }), S(() => [E.align, E.placement], () => {
119
+ I.value && (V("programmatic"), Z());
118
120
  }), re(() => {
119
- if (o(w.items), !E.value.trim()) throw TypeError("SDropdownMenu: menuLabel must be a non-empty string");
120
- t("SDropdownMenu", "align", w.align, ["left", "right"]), t("SDropdownMenu", "placement", w.placement, [
121
+ if (o(E.items), !O.value.trim()) throw TypeError("SDropdownMenu: menuLabel must be a non-empty string");
122
+ t("SDropdownMenu", "align", E.align, ["left", "right"]), t("SDropdownMenu", "placement", E.placement, [
121
123
  "auto",
122
124
  "bottom",
123
125
  "top"
124
- ]), e("SDropdownMenu", "defaultOpen", w.defaultOpen), e("SDropdownMenu", "closeOnSelect", w.closeOnSelect), w.open !== void 0 && e("SDropdownMenu", "open", w.open);
125
- }), (e, t) => (_(), d("div", ae, [y(U) ? ne(e.$slots, "default", { triggerAttrs: J() }, void 0, !0, 0) : (_(), u(ee, m({ key: 1 }, J(), {
126
+ ]), e("SDropdownMenu", "defaultOpen", E.defaultOpen), e("SDropdownMenu", "closeOnSelect", E.closeOnSelect), E.open !== void 0 && e("SDropdownMenu", "open", E.open);
127
+ }), (e, t) => (_(), d("div", w, [b(K) ? y(e.$slots, "default", { triggerAttrs: Y() }, void 0, !0, 0) : (_(), l(r, m({ key: 1 }, Y(), {
126
128
  label: "Опции",
127
129
  disclosure: {
128
- expanded: G.value,
129
- controls: V
130
+ expanded: J.value,
131
+ controls: W
130
132
  },
131
133
  severity: "secondary"
132
- }), null, 16, ["disclosure"])), (_(), u(c, { to: "body" }, [y(P) ? (_(), u(a, {
134
+ }), null, 16, ["disclosure"])), b(L) ? (_(), l(te, {
135
+ key: 2,
136
+ to: b(L)
137
+ }, [b(I) ? (_(), l(a, {
133
138
  key: 0,
134
139
  ref_key: "layerRef",
135
- ref: A,
140
+ ref: j,
136
141
  kind: "dropdown",
137
- "landmark-label": E.value,
138
- position: y(F),
139
- "available-size": y(I),
140
- "z-index": y(L)
142
+ "landmark-label": O.value,
143
+ position: b(R),
144
+ "available-size": b(z),
145
+ "z-index": b(B)
141
146
  }, {
142
- default: ie(() => [f(s, {
147
+ default: C(() => [f(s, {
143
148
  ref_key: "menuSurfaceRef",
144
- ref: j,
145
- id: V,
146
- label: E.value,
149
+ ref: M,
150
+ id: W,
151
+ label: O.value,
147
152
  density: "compact",
148
153
  autofocus: "",
149
- "initial-focus": H.value,
154
+ "initial-focus": G.value,
150
155
  items: p.items,
151
- onDismissTree: t[0] ||= (e) => Q("outside"),
152
- onEscape: t[1] ||= (e) => Q("escape"),
153
- onFocusExit: t[2] ||= (e) => Q("outside"),
154
- onSelect: ce,
155
- onTab: le
156
+ onDismissTree: t[0] ||= (e) => $("outside"),
157
+ onEscape: t[1] ||= (e) => $("escape"),
158
+ onFocusExit: t[2] ||= (e) => $("outside"),
159
+ onSelect: ue,
160
+ onTab: de
156
161
  }, null, 8, [
157
162
  "label",
158
163
  "initial-focus",
@@ -164,8 +169,8 @@ var ae = { class: "s-dropdown-menu" }, C = /*@__PURE__*/ p({
164
169
  "position",
165
170
  "available-size",
166
171
  "z-index"
167
- ])) : te("", !0)]))]));
172
+ ])) : u("", !0)], 8, ["to"])) : u("", !0)]));
168
173
  }
169
174
  });
170
175
  //#endregion
171
- export { C as default };
176
+ export { T as default };
@@ -1,8 +1,8 @@
1
- import "../../../../assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_84109ad9_scoped_84109ad9_lang.css";
1
+ import "../../../../assets/src/components/shared/controls/SMenuSurface.css_vue_type_style_index_0_src_d2b7d71b_scoped_d2b7d71b_lang.css";
2
2
  import e from "../../../../_virtual/_plugin-vue_export-helper.js";
3
3
  import t from "./SMenuSurface.vue_vue_type_script_setup_true_lang.js";
4
4
  /* empty css */
5
5
  //#region src/components/shared/controls/SMenuSurface.vue
6
- var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-84109ad9"]]);
6
+ var n = /*#__PURE__*/ e(t, [["__scopeId", "data-v-d2b7d71b"]]);
7
7
  //#endregion
8
8
  export { n as default };