@bridge-ui/vue 0.23.0 → 0.24.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.
- package/ai/skills/bridge-ui-overlays/SKILL.md +4 -2
- package/dist/Components/ColorField/composables/useColorField.js +1 -1
- package/dist/Components/DateField/composables/useDateField.js +1 -1
- package/dist/Components/DateRangeField/composables/useDateRangeField.js +1 -1
- package/dist/Components/DateTimeField/composables/useDateTimeField.js +1 -1
- package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.js +1 -1
- package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -0
- package/dist/Components/Drawer/composables/useDrawer.js +96 -90
- package/dist/Components/Menu/composables/useMenu.d.ts +8 -8
- package/dist/Components/Menu/composables/useMenu.js +81 -195
- package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +7 -7
- package/dist/Components/Modal/composables/useModal.d.ts +1 -0
- package/dist/Components/Modal/composables/useModal.js +120 -114
- package/dist/Components/Popover/Popover.js +4 -0
- package/dist/Components/Popover/Popover.vue.d.ts +39 -0
- package/dist/Components/Popover/Popover.vue_vue_type_script_setup_true_lang.js +100 -0
- package/dist/Components/Popover/composables/popoverParts.d.ts +52 -0
- package/dist/Components/Popover/composables/popoverParts.js +35 -0
- package/dist/Components/Popover/composables/usePopover.d.ts +68 -0
- package/dist/Components/Popover/composables/usePopover.js +119 -0
- package/dist/Components/Popover/composables/usePopoverBase.d.ts +130 -0
- package/dist/Components/Popover/composables/usePopoverBase.js +210 -0
- package/dist/Components/Popover/index.d.ts +4 -0
- package/dist/Components/Popover/index.js +3 -0
- package/dist/Components/Popover/popover.types.d.ts +207 -0
- package/dist/Components/Resizable/composables/useResizable.js +85 -85
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +1 -1
- package/dist/Components/TimeField/composables/useTimeField.js +1 -1
- package/dist/Components/TimeRangeField/composables/useTimeRangeField.js +1 -1
- package/dist/augments.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +78 -76
- package/docs/README.md +1 -0
- package/docs/components/Menu.md +4 -0
- package/docs/components/Popover.md +210 -0
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bridge-ui-overlays
|
|
3
3
|
description: >-
|
|
4
|
-
Bridge UI Vue overlays and imperative actions — Modal, Drawer, Menu, Tooltip,
|
|
4
|
+
Bridge UI Vue overlays and imperative actions — Modal, Drawer, Menu, Popover, Tooltip,
|
|
5
5
|
Snackbar, useModalAction, useDialogAction, useDrawerAction, useSnackbarAction,
|
|
6
6
|
BridgeUIHosts. Use when opening layers or toast/dialog flows.
|
|
7
7
|
---
|
|
@@ -21,6 +21,7 @@ Overlays: **`v-model`**. Modal/Drawer body: **`Card`** (no `ModalCard`).
|
|
|
21
21
|
| Modal | `.ai/docs/components/Modal.md` |
|
|
22
22
|
| Drawer | `.ai/docs/components/Drawer.md` |
|
|
23
23
|
| Menu | `.ai/docs/components/Menu.md` |
|
|
24
|
+
| Popover | `.ai/docs/components/Popover.md` |
|
|
24
25
|
| Tooltip | `.ai/docs/components/Tooltip.md` |
|
|
25
26
|
| Snackbar | `.ai/docs/components/Snackbar.md` |
|
|
26
27
|
| useModalAction | `.ai/docs/components/useModalAction.md` |
|
|
@@ -34,4 +35,5 @@ Overlays: **`v-model`**. Modal/Drawer body: **`Card`** (no `ModalCard`).
|
|
|
34
35
|
1. Mount `BridgeUIHosts` before using action hooks.
|
|
35
36
|
2. `align` on Modal applies on all breakpoints — use `useBreakpoint` for mobile bottom sheets (keep the reactive object; do not destructure helpers).
|
|
36
37
|
3. Menu panel children are real components (`List` / `ListItem`, etc.). Docs may show a local `MenuContent` helper — that is **not** a Bridge export.
|
|
37
|
-
4.
|
|
38
|
+
4. Use `Popover` (not `Menu`) for forms, filters or rich content in a floating panel — `Menu` is for action lists and captures arrow keys.
|
|
39
|
+
5. Match action `open` option shapes to the `use*Action` docs. Escape closes the top nested layer only.
|
|
@@ -115,7 +115,7 @@ function w(p, w, T) {
|
|
|
115
115
|
M.value.editable && (A.value = e.target.value);
|
|
116
116
|
},
|
|
117
117
|
onKeydown: (e) => {
|
|
118
|
-
G.inputBind.value.onKeydown?.(e), e.key === "Escape" && (A.value = null, H(!1)), e.key === "Enter" && M.value.editable && A.value !== null && (e.preventDefault(), Z(A.value));
|
|
118
|
+
G.inputBind.value.onKeydown?.(e), e.key === "Escape" && (O.value && e.preventDefault(), A.value = null, H(!1)), e.key === "Enter" && M.value.editable && A.value !== null && (e.preventDefault(), Z(A.value));
|
|
119
119
|
}
|
|
120
120
|
}, void 0, G.inputBind.value)), de = o(() => M.value.overlay), fe = o(() => ({
|
|
121
121
|
modal: M.value.customProps?.modal,
|
|
@@ -112,7 +112,7 @@ function T(p, m, T) {
|
|
|
112
112
|
q.inputBind.value.onFocus?.(e), W(!0);
|
|
113
113
|
},
|
|
114
114
|
onKeydown: (e) => {
|
|
115
|
-
q.inputBind.value.onKeydown?.(e), e.key === "Escape" && W(!1);
|
|
115
|
+
q.inputBind.value.onKeydown?.(e), e.key === "Escape" && (A.value && e.preventDefault(), W(!1));
|
|
116
116
|
}
|
|
117
117
|
}, void 0, q.inputBind.value)), re = c(() => N.value.overlay), ie = c(() => ({
|
|
118
118
|
modal: N.value.customProps?.modal,
|
|
@@ -101,7 +101,7 @@ function S(S, C, w) {
|
|
|
101
101
|
B.inputBind.value.onFocus?.(e), R(!0);
|
|
102
102
|
},
|
|
103
103
|
onKeydown: (e) => {
|
|
104
|
-
B.inputBind.value.onKeydown?.(e), e.key === "Escape" && R(!1);
|
|
104
|
+
B.inputBind.value.onKeydown?.(e), e.key === "Escape" && (k.value && e.preventDefault(), R(!1));
|
|
105
105
|
}
|
|
106
106
|
}, void 0, B.inputBind.value)), re = s(() => M.value.overlay), Q = s(() => ({
|
|
107
107
|
modal: M.value.customProps?.modal,
|
|
@@ -89,7 +89,7 @@ function C(C, w, T) {
|
|
|
89
89
|
G.inputBind.value.onFocus?.(e), H(!0);
|
|
90
90
|
},
|
|
91
91
|
onKeydown: (e) => {
|
|
92
|
-
G.inputBind.value.onKeydown?.(e), e.key === "Escape" && H(!1);
|
|
92
|
+
G.inputBind.value.onKeydown?.(e), e.key === "Escape" && (A.value && e.preventDefault(), H(!1));
|
|
93
93
|
}
|
|
94
94
|
}, void 0, G.inputBind.value)), te = l(() => N.value.overlay), ne = l(() => ({
|
|
95
95
|
modal: N.value.customProps?.modal,
|
|
@@ -87,7 +87,7 @@ function T(g, T, E) {
|
|
|
87
87
|
H.inputBind.value.onFocus?.(e), z(!0);
|
|
88
88
|
},
|
|
89
89
|
onKeydown: (e) => {
|
|
90
|
-
H.inputBind.value.onKeydown?.(e), e.key === "Escape" && z(!1);
|
|
90
|
+
H.inputBind.value.onKeydown?.(e), e.key === "Escape" && (A.value && e.preventDefault(), z(!1));
|
|
91
91
|
}
|
|
92
92
|
}, void 0, H.inputBind.value)), ne = l(() => N.value.overlay), re = l(() => ({
|
|
93
93
|
modal: N.value.customProps?.modal,
|
|
@@ -64,7 +64,7 @@ var g = /*@__PURE__*/ s({
|
|
|
64
64
|
}),
|
|
65
65
|
emits: /*@__PURE__*/ l(["close", "show-change"], ["update:modelValue"]),
|
|
66
66
|
setup(s, { expose: l, emit: g }) {
|
|
67
|
-
let _ = g, v = s, y = h(s, "modelValue"), { merged: b, mounted: x, rootBind: S, panelBind: C,
|
|
67
|
+
let _ = g, v = s, y = h(s, "modelValue"), { merged: b, mounted: x, rootBind: S, panelBind: C, setRootRef: w, overlayBind: T, wrapperBind: E, setPanelRef: D, layerStackId: O } = e(v, {
|
|
68
68
|
size: "md",
|
|
69
69
|
blur: "none",
|
|
70
70
|
scroll: "paper",
|
|
@@ -80,16 +80,16 @@ var g = /*@__PURE__*/ s({
|
|
|
80
80
|
onClose: () => _("close"),
|
|
81
81
|
onShowChange: (e) => _("show-change", e)
|
|
82
82
|
});
|
|
83
|
-
l({ stackId: n(() => v.stackId ??
|
|
84
|
-
let
|
|
83
|
+
l({ stackId: n(() => v.stackId ?? O.value) });
|
|
84
|
+
let k = n(() => b.value.teleportTo === !1), A = n(() => b.value.teleportTo === !1 ? "body" : b.value.teleportTo), j = n(() => v.hideBackdrop !== !0 && b.value.hideBackdrop !== !0);
|
|
85
85
|
return (e, n) => m(x) ? (f(), r(t, {
|
|
86
86
|
key: 0,
|
|
87
|
-
to:
|
|
88
|
-
disabled:
|
|
89
|
-
}, [o("div",
|
|
87
|
+
to: A.value,
|
|
88
|
+
disabled: k.value
|
|
89
|
+
}, [o("div", u({ ref: m(w) }, m(S)), [j.value ? (f(), a("div", u({
|
|
90
90
|
key: 0,
|
|
91
91
|
"aria-hidden": "true"
|
|
92
|
-
}, m(
|
|
92
|
+
}, m(T)), null, 16)) : i("", !0), o("div", d(c(m(E))), [o("div", u({ ref: m(D) }, m(C)), [p(e.$slots, "default")], 16)], 16)], 16)], 8, ["to", "disabled"])) : i("", !0);
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
export { g as default };
|
|
@@ -45,6 +45,7 @@ export declare function useDrawer(props: DrawerOwnProps, libDefaults: DrawerLibD
|
|
|
45
45
|
"aria-label": string | undefined;
|
|
46
46
|
"aria-labelledby": string | undefined;
|
|
47
47
|
}>>;
|
|
48
|
+
setRootRef: (element: null | Element | ComponentPublicInstance) => void;
|
|
48
49
|
overlayBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
49
50
|
"data-drawer-part": string;
|
|
50
51
|
"data-state": "open" | "closed";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { mergePartBind as e, resolveVnodeRefElement as t, useBridgeUIComponent as
|
|
2
|
-
import { computed as
|
|
3
|
-
import { get as
|
|
4
|
-
import { drawerBlurProps as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { createFocusTrap as
|
|
7
|
-
import { DRAWER_LEAVE_FALLBACK_MS as
|
|
1
|
+
import { mergePartBind as e, resolveVnodeRefElement as t, useBridgeUIComponent as ee, useBridgeUIMergedRegistryClasses as te } from "../../../Utils/index.js";
|
|
2
|
+
import { computed as n, nextTick as ne, onBeforeUnmount as re, ref as r, toValue as ie, useAttrs as ae, watch as i } from "vue";
|
|
3
|
+
import { get as a } from "es-toolkit/compat";
|
|
4
|
+
import { drawerBlurProps as oe, drawerPlacementPanelProps as se, drawerPlacementProps as ce, drawerSizeProps as o } from "@bridge-ui/core/Tokens";
|
|
5
|
+
import { cn as s, mergeBridgeUILayeredClasses as c, splitComponentProps as le } from "@bridge-ui/core/Utils";
|
|
6
|
+
import { createFocusTrap as l, isModalBackdropClick as ue, requestAfterNextPaint as de } from "@bridge-ui/core/Runtime";
|
|
7
|
+
import { DRAWER_LEAVE_FALLBACK_MS as fe, LAYER_STACK_BASE_Z_INDEX as u, acquireLayerStackOrder as pe, countDrawerTransitionLayers as d, getDrawerOverlayTransitionClass as f, getDrawerPanelTransitionClass as p, getLayerFocusTrapGuards as me, getLayerStackEntry as he, hasDrawerTransition as ge, pushLayerStack as _e, resolveEffectiveDrawerTransition as ve, subscribeLayerStack as ye } from "@bridge-ui/core/Layer";
|
|
8
8
|
// src/Components/Drawer/composables/useDrawer.ts
|
|
9
9
|
var be = [
|
|
10
10
|
"blur",
|
|
@@ -28,162 +28,168 @@ var be = [
|
|
|
28
28
|
"disableEnforceFocus",
|
|
29
29
|
"disableRestoreFocus"
|
|
30
30
|
];
|
|
31
|
-
function m(m,
|
|
32
|
-
let
|
|
31
|
+
function m(m, xe, h = {}) {
|
|
32
|
+
let Se = ae(), g = r(!1), _ = r(!1), v = r(""), y = r(u), b = r("closed"), x = r(null), S = r(null), C = !1, w = 0, T = null, E = null, D = null, O = null, k = null, A = null, j = n(() => ie(h.show ?? !1));
|
|
33
33
|
function M(e) {
|
|
34
|
-
e ||
|
|
34
|
+
e || h.onClose?.(), h.show && (h.show.value = e), h.onShowChange?.(e);
|
|
35
35
|
}
|
|
36
|
-
let N =
|
|
36
|
+
let N = n(() => le({
|
|
37
37
|
bridgeKeys: be,
|
|
38
38
|
props: {
|
|
39
|
-
...
|
|
39
|
+
...Se,
|
|
40
40
|
...m
|
|
41
41
|
}
|
|
42
|
-
})), { merged: P, entry: F } =
|
|
43
|
-
libDefaults:
|
|
42
|
+
})), { merged: P, entry: F } = ee({
|
|
43
|
+
libDefaults: xe,
|
|
44
44
|
componentName: "Drawer",
|
|
45
45
|
props: () => N.value.componentProps
|
|
46
|
-
}), I =
|
|
46
|
+
}), I = n(() => P.value.customProps), L = te({
|
|
47
47
|
entry: F,
|
|
48
48
|
props: () => N.value.componentProps
|
|
49
|
-
}), R =
|
|
50
|
-
let e =
|
|
51
|
-
return
|
|
52
|
-
}),
|
|
53
|
-
let e =
|
|
54
|
-
return
|
|
55
|
-
}),
|
|
56
|
-
let e =
|
|
57
|
-
return
|
|
58
|
-
}),
|
|
59
|
-
onTransitionend:
|
|
60
|
-
style: { zIndex:
|
|
49
|
+
}), R = n(() => ve(P.value.transition ?? "none")), z = n(() => ge(R.value)), B = n(() => P.value.scroll ?? "paper"), V = n(() => P.value.keepMounted && !g.value), H = n(() => P.value.placement ?? "left"), Ce = n(() => H.value === "left" || H.value === "right" ? "horizontal" : "vertical"), we = n(() => {
|
|
50
|
+
let e = c(ce, F.value?.tokens?.placement);
|
|
51
|
+
return a(e, H.value);
|
|
52
|
+
}), Te = n(() => a(se, H.value)), Ee = n(() => {
|
|
53
|
+
let e = c(oe, F.value?.tokens?.blur);
|
|
54
|
+
return a(e, P.value.blur);
|
|
55
|
+
}), De = n(() => {
|
|
56
|
+
let e = c(o, F.value?.tokens?.size);
|
|
57
|
+
return a(e, [P.value.size, Ce.value]);
|
|
58
|
+
}), Oe = n(() => f(R.value)), ke = n(() => p(R.value, H.value)), U = n(() => !P.value.persistent), Ae = n(() => N.value.inheritedAttrs), je = n(() => e(I.value?.root, Ae.value, {
|
|
59
|
+
onTransitionend: Re,
|
|
60
|
+
style: { zIndex: y.value },
|
|
61
61
|
"aria-hidden": V.value ? !0 : void 0,
|
|
62
|
-
class:
|
|
62
|
+
class: s({
|
|
63
63
|
"fixed inset-0": !0,
|
|
64
64
|
"overflow-y-auto": B.value === "body",
|
|
65
65
|
"overflow-hidden": B.value === "paper",
|
|
66
66
|
"invisible pointer-events-none": V.value,
|
|
67
|
-
[
|
|
67
|
+
[a(L.value, "root") ?? ""]: !0
|
|
68
68
|
})
|
|
69
|
-
})),
|
|
69
|
+
})), Me = n(() => e(I.value?.overlay, { onClick: Z }, {
|
|
70
70
|
"data-drawer-part": "overlay",
|
|
71
|
-
"data-state":
|
|
72
|
-
class:
|
|
71
|
+
"data-state": b.value,
|
|
72
|
+
class: s({
|
|
73
73
|
"fixed inset-0 bg-black/50": !0,
|
|
74
|
-
[
|
|
75
|
-
[
|
|
76
|
-
[
|
|
74
|
+
[Ee.value ?? ""]: !0,
|
|
75
|
+
[Oe.value]: z.value,
|
|
76
|
+
[a(L.value, "overlay") ?? ""]: !0
|
|
77
77
|
})
|
|
78
|
-
})),
|
|
78
|
+
})), Ne = n(() => e(I.value?.wrapper, { onClick: Q }, s({
|
|
79
79
|
"flex min-h-full w-full transform": !0,
|
|
80
|
-
[
|
|
81
|
-
[
|
|
82
|
-
}))),
|
|
80
|
+
[we.value ?? ""]: !0,
|
|
81
|
+
[a(L.value, "wrapper") ?? ""]: !0
|
|
82
|
+
}))), Pe = n(() => e(I.value?.panel, {
|
|
83
83
|
role: "dialog",
|
|
84
84
|
"aria-modal": !0,
|
|
85
85
|
"aria-label": P.value.ariaLabel,
|
|
86
86
|
"aria-labelledby": P.value.ariaLabelledBy
|
|
87
87
|
}, {
|
|
88
88
|
"data-drawer-part": "panel",
|
|
89
|
-
"data-state":
|
|
90
|
-
class:
|
|
89
|
+
"data-state": b.value,
|
|
90
|
+
class: s({
|
|
91
91
|
"relative rounded-none": !0,
|
|
92
|
-
[
|
|
93
|
-
[
|
|
92
|
+
[Te.value ?? ""]: !0,
|
|
93
|
+
[De.value ?? ""]: !0,
|
|
94
94
|
"overflow-y-auto bridge-scroll-fade-y bridge-hide-scrollbar": B.value === "paper",
|
|
95
|
-
[
|
|
96
|
-
[
|
|
95
|
+
[ke.value]: z.value,
|
|
96
|
+
[a(L.value, "panel") ?? ""]: !0
|
|
97
97
|
})
|
|
98
98
|
}));
|
|
99
99
|
function W() {
|
|
100
|
-
|
|
100
|
+
E?.release(), E = null;
|
|
101
101
|
}
|
|
102
102
|
function G() {
|
|
103
|
-
!
|
|
104
|
-
container:
|
|
103
|
+
!g.value || b.value !== "open" || !S.value ? W() : (D?.setContainer(x.value), W(), E = l({
|
|
104
|
+
container: S.value,
|
|
105
105
|
disableAutoFocus: !P.value.autoFocus,
|
|
106
106
|
disableEnforceFocus: P.value.disableEnforceFocus,
|
|
107
107
|
disableRestoreFocus: P.value.disableRestoreFocus,
|
|
108
|
-
...me(() =>
|
|
108
|
+
...me(() => v.value)
|
|
109
109
|
}));
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
|
|
111
|
+
function Fe(e) {
|
|
112
|
+
x.value = t(e), D?.setContainer(x.value);
|
|
113
|
+
}
|
|
114
|
+
function Ie(e) {
|
|
115
|
+
S.value = t(e), G();
|
|
113
116
|
}
|
|
114
117
|
function K() {
|
|
115
118
|
A !== null && (clearTimeout(A), A = null);
|
|
116
119
|
}
|
|
117
120
|
function q() {
|
|
118
|
-
|
|
121
|
+
O?.(), O = null;
|
|
119
122
|
}
|
|
120
123
|
function J() {
|
|
121
|
-
|
|
124
|
+
C && (C = !1, K(), w = 0, g.value = !1, W(), j.value ? M(!1) : h.onShowChange?.(!1), b.value = "closed", P.value.keepMounted || (_.value = !1));
|
|
122
125
|
}
|
|
123
126
|
function Y() {
|
|
124
|
-
q(),
|
|
125
|
-
A = null,
|
|
126
|
-
},
|
|
127
|
+
q(), D?.releaseScrollLock(), C = !0, z.value ? (b.value = "closed", w = d(R.value, { hideBackdrop: P.value.hideBackdrop }), w === 0 ? J() : (K(), A = setTimeout(() => {
|
|
128
|
+
A = null, w > 0 && J();
|
|
129
|
+
}, fe))) : J();
|
|
127
130
|
}
|
|
128
|
-
function
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
})) :
|
|
131
|
+
function Le() {
|
|
132
|
+
D?.restoreScrollLock(), C = !1, K(), w = 0, z.value ? (b.value = "closed", q(), O = de(() => {
|
|
133
|
+
b.value = "open";
|
|
134
|
+
})) : b.value = "open";
|
|
132
135
|
}
|
|
133
|
-
function
|
|
134
|
-
if (!
|
|
136
|
+
function Re(e) {
|
|
137
|
+
if (!C || !_.value || b.value !== "closed") return;
|
|
135
138
|
let t = e.target;
|
|
136
|
-
(t?.dataset.drawerPart === "overlay" || t?.dataset.drawerPart === "panel") && e.propertyName !== "none" && e.elapsedTime !== 0 && (--
|
|
139
|
+
(t?.dataset.drawerPart === "overlay" || t?.dataset.drawerPart === "panel") && e.propertyName !== "none" && e.elapsedTime !== 0 && (--w, w <= 0 && J());
|
|
137
140
|
}
|
|
138
141
|
function X() {
|
|
139
|
-
U.value && (z.value ?
|
|
142
|
+
U.value && (z.value ? _.value && Y() : M(!1));
|
|
140
143
|
}
|
|
141
144
|
function Z() {
|
|
142
145
|
P.value.closeOnOverlay !== !1 && U.value && X();
|
|
143
146
|
}
|
|
144
147
|
function Q(e) {
|
|
145
|
-
|
|
148
|
+
ue(e) && Z();
|
|
146
149
|
}
|
|
147
|
-
function
|
|
150
|
+
function ze() {
|
|
148
151
|
j.value && P.value.closeOnEscape !== !1 && U.value && X();
|
|
149
152
|
}
|
|
150
|
-
|
|
151
|
-
e ? (
|
|
152
|
-
}, { immediate: !0 }),
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
i(j, (e) => {
|
|
154
|
+
e ? (_.value = !0, g.value = !0, Le()) : _.value && Y();
|
|
155
|
+
}, { immediate: !0 }), i([
|
|
156
|
+
g,
|
|
157
|
+
b,
|
|
155
158
|
() => P.value.autoFocus,
|
|
156
159
|
() => P.value.disableEnforceFocus,
|
|
157
160
|
() => P.value.disableRestoreFocus
|
|
158
161
|
], () => {
|
|
159
|
-
|
|
162
|
+
ne(() => {
|
|
160
163
|
G();
|
|
161
164
|
});
|
|
162
165
|
});
|
|
163
166
|
function $() {
|
|
164
|
-
let e = he(
|
|
165
|
-
e && (
|
|
167
|
+
let e = he(v.value);
|
|
168
|
+
e && (y.value = e.zIndex);
|
|
166
169
|
}
|
|
167
|
-
return
|
|
168
|
-
e ? (
|
|
170
|
+
return i(g, (e) => {
|
|
171
|
+
e ? (T === null && (T = pe()), D = _e({
|
|
169
172
|
trapsFocus: !0,
|
|
170
|
-
order:
|
|
171
|
-
id:
|
|
172
|
-
onEscape:
|
|
173
|
-
container:
|
|
173
|
+
order: T,
|
|
174
|
+
id: h.stackId,
|
|
175
|
+
onEscape: ze,
|
|
176
|
+
container: x.value ?? void 0,
|
|
174
177
|
lockScroll: P.value.disableScrollLock !== !0
|
|
175
|
-
}),
|
|
176
|
-
}, { immediate: !0 }),
|
|
177
|
-
|
|
178
|
+
}), v.value = D.id, y.value = D.zIndex, $(), k = ye($)) : (k?.(), k = null, D?.release(), D = null, v.value = "", y.value = u, _.value || (T = null));
|
|
179
|
+
}, { immediate: !0 }), i(() => P.value.disableScrollLock, (e) => {
|
|
180
|
+
D?.setLockScroll(e !== !0);
|
|
181
|
+
}), re(() => {
|
|
182
|
+
K(), q(), k?.(), k = null, W(), D?.release(), D = null, T = null;
|
|
178
183
|
}), {
|
|
179
184
|
merged: P,
|
|
180
|
-
mounted:
|
|
181
|
-
rootBind:
|
|
182
|
-
panelBind:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
185
|
+
mounted: _,
|
|
186
|
+
rootBind: je,
|
|
187
|
+
panelBind: Pe,
|
|
188
|
+
setRootRef: Fe,
|
|
189
|
+
overlayBind: Me,
|
|
190
|
+
wrapperBind: Ne,
|
|
191
|
+
setPanelRef: Ie,
|
|
192
|
+
layerStackId: v,
|
|
187
193
|
handleOverlayClick: Z,
|
|
188
194
|
handleWrapperClick: Q
|
|
189
195
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
2
|
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core/Utils';
|
|
3
|
-
import { MenuOwnProps
|
|
3
|
+
import { MenuOwnProps } from '../menu.types';
|
|
4
4
|
type MenuLibDefaults = LibDefaultsShape<MenuOwnProps, "offset" | "shadow" | "rounded" | "strategy" | "placement" | "teleportTo" | "closeOnEscape" | "closeOnClickAway" | "disableScrollLock">;
|
|
5
5
|
type MenuMerged = MergeLibDefaults<MenuOwnProps, MenuLibDefaults>;
|
|
6
6
|
export type MenuOptions = {
|
|
@@ -23,16 +23,15 @@ export type MenuOptions = {
|
|
|
23
23
|
export declare function useMenu(props: MenuOwnProps, libDefaults: MenuLibDefaults, options?: MenuOptions): {
|
|
24
24
|
merged: import('vue').ComputedRef<MenuMerged>;
|
|
25
25
|
menuId: string;
|
|
26
|
-
|
|
27
|
-
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<MenuProps, "offset" | "classes" | "customProps" | "rounded" | "shadow" | "closeOnEscape" | "disableScrollLock" | "keepMounted" | "persistent" | "placement" | "teleportTo" | "closeOnClickAway" | "disableAutoFocus" | "matchWidth" | "strategy">, "anchorEl" | "onShowChange">>>;
|
|
26
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, object>>;
|
|
28
27
|
isPortaled: import('vue').ComputedRef<boolean>;
|
|
29
28
|
triggerBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<{
|
|
30
29
|
tabindex: number;
|
|
31
30
|
role: string;
|
|
32
|
-
"aria-expanded": boolean;
|
|
33
31
|
onKeydown: (event: KeyboardEvent) => void;
|
|
34
|
-
"aria-
|
|
32
|
+
"aria-expanded": boolean;
|
|
35
33
|
onClickCapture: () => void;
|
|
34
|
+
"aria-haspopup": "menu" | "dialog";
|
|
36
35
|
"aria-controls": string | undefined;
|
|
37
36
|
class: string;
|
|
38
37
|
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
@@ -46,7 +45,8 @@ export declare function useMenu(props: MenuOwnProps, libDefaults: MenuLibDefault
|
|
|
46
45
|
"aria-hidden": boolean | undefined;
|
|
47
46
|
class: string;
|
|
48
47
|
}, "class", import('vue').HTMLAttributes | undefined, {}>>;
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
mounted: Ref<boolean, boolean>;
|
|
49
|
+
setTriggerRef: (element: null | Element | import('vue').ComponentPublicInstance) => void;
|
|
50
|
+
setContentRef: (element: null | Element | import('vue').ComponentPublicInstance) => void;
|
|
51
51
|
};
|
|
52
52
|
export {};
|