@bridge-ui/vue 0.0.1-beta.7 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Actions/BridgeUIHosts.vue.d.ts +3 -2
- package/dist/Actions/BridgeUIHosts.vue_vue_type_script_setup_true_lang.js +15 -10
- package/dist/Actions/Drawer/BridgeDrawerHost.js +5 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue.d.ts +14 -0
- package/dist/Actions/Drawer/BridgeDrawerHost.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Actions/Drawer/bridgeDrawer.types.d.ts +44 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.d.ts +3 -0
- package/dist/Actions/Drawer/bridgeDrawerInjectionKey.js +4 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.d.ts +2 -0
- package/dist/Actions/Drawer/createBridgeDrawerApi.js +49 -0
- package/dist/Actions/Drawer/index.d.ts +3 -0
- package/dist/Actions/Drawer/index.js +3 -0
- package/dist/Actions/Drawer/useDrawerAction.d.ts +5 -0
- package/dist/Actions/Drawer/useDrawerAction.js +26 -0
- package/dist/Actions/bridgeUIHosts.types.d.ts +5 -0
- package/dist/Actions/index.d.ts +2 -0
- package/dist/Actions/index.js +8 -6
- package/dist/Components/Badge/badge.types.d.ts +1 -1
- package/dist/Components/Chip/chip.types.d.ts +1 -1
- package/dist/Components/Drawer/Drawer.js +5 -0
- package/dist/Components/Drawer/Drawer.vue.d.ts +39 -0
- package/dist/Components/Drawer/Drawer.vue_vue_type_script_setup_true_lang.js +96 -0
- package/dist/Components/Drawer/composables/useDrawer.d.ts +63 -0
- package/dist/Components/Drawer/composables/useDrawer.js +208 -0
- package/dist/Components/Drawer/drawer.types.d.ts +188 -0
- package/dist/Components/Drawer/index.d.ts +4 -0
- package/dist/Components/Drawer/index.js +3 -0
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormField/formField.types.d.ts +7 -7
- package/dist/Components/Label/label.types.d.ts +1 -1
- package/dist/Components/Link/link.types.d.ts +3 -3
- package/dist/Components/List/list.types.d.ts +1 -1
- package/dist/Components/ListItem/listItem.types.d.ts +1 -1
- package/dist/Components/ListSection/listSection.types.d.ts +1 -1
- package/dist/Components/Listbox/listbox.types.d.ts +5 -5
- package/dist/Components/Menu/menu.types.d.ts +3 -3
- package/dist/Components/Modal/composables/useModal.js +0 -1
- package/dist/Components/Modal/modal.types.d.ts +3 -2
- package/dist/Components/Select/Select.vue.d.ts +2 -2
- package/dist/Components/Select/select.types.d.ts +5 -5
- package/dist/Components/Snackbar/composables/useSnackbar.js +1 -1
- package/dist/Components/Snackbar/snackbar.types.d.ts +7 -7
- package/dist/Components/Spinner/composables/useSpinner.js +16 -16
- package/dist/Components/Tab/Tab.js +5 -0
- package/dist/Components/Tab/Tab.vue.d.ts +11 -0
- package/dist/Components/Tab/Tab.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Tab/composables/useTab.d.ts +23 -0
- package/dist/Components/Tab/composables/useTab.js +88 -0
- package/dist/Components/Tab/index.d.ts +3 -0
- package/dist/Components/Tab/index.js +3 -0
- package/dist/Components/Tab/tab.types.d.ts +94 -0
- package/dist/Components/TabItem/TabItem.js +5 -0
- package/dist/Components/TabItem/TabItem.vue.d.ts +11 -0
- package/dist/Components/TabItem/TabItem.vue_vue_type_script_setup_true_lang.js +25 -0
- package/dist/Components/TabItem/composables/useTabItem.d.ts +3 -0
- package/dist/Components/TabItem/composables/useTabItem.js +39 -0
- package/dist/Components/TabItem/index.d.ts +3 -0
- package/dist/Components/TabItem/index.js +3 -0
- package/dist/Components/TabItem/tabItem.types.d.ts +72 -0
- package/dist/Components/TabList/TabList.js +5 -0
- package/dist/Components/TabList/TabList.vue.d.ts +11 -0
- package/dist/Components/TabList/TabList.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/Components/TabList/composables/useTabList.d.ts +10 -0
- package/dist/Components/TabList/composables/useTabList.js +65 -0
- package/dist/Components/TabList/index.d.ts +3 -0
- package/dist/Components/TabList/index.js +3 -0
- package/dist/Components/TabList/tabList.types.d.ts +38 -0
- package/dist/Components/TabPanel/TabPanel.js +5 -0
- package/dist/Components/TabPanel/TabPanel.vue.d.ts +11 -0
- package/dist/Components/TabPanel/TabPanel.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/Components/TabPanel/composables/useTabPanel.d.ts +14 -0
- package/dist/Components/TabPanel/composables/useTabPanel.js +51 -0
- package/dist/Components/TabPanel/index.d.ts +3 -0
- package/dist/Components/TabPanel/index.js +3 -0
- package/dist/Components/TabPanel/tabPanel.types.d.ts +48 -0
- package/dist/Components/Tabs/Tabs.js +5 -0
- package/dist/Components/Tabs/Tabs.vue.d.ts +24 -0
- package/dist/Components/Tabs/Tabs.vue_vue_type_script_setup_true_lang.js +73 -0
- package/dist/Components/Tabs/composables/useTabs.d.ts +39 -0
- package/dist/Components/Tabs/composables/useTabs.js +99 -0
- package/dist/Components/Tabs/index.d.ts +4 -0
- package/dist/Components/Tabs/index.js +4 -0
- package/dist/Components/Tabs/tabs.types.d.ts +93 -0
- package/dist/Components/Tabs/tabsInjectionKey.d.ts +121 -0
- package/dist/Components/Tabs/tabsInjectionKey.js +4 -0
- package/dist/Utils/index.d.ts +2 -0
- package/dist/Utils/index.js +20 -19
- package/dist/Utils/useBreakpoint.d.ts +19 -0
- package/dist/Utils/useBreakpoint.js +35 -0
- package/dist/index.d.ts +14 -1
- package/dist/index.js +76 -62
- package/dist/theme.css +9 -0
- package/package.json +2 -2
|
@@ -0,0 +1,208 @@
|
|
|
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 r, onBeforeUnmount as ne, ref as i, toValue as a, useAttrs as o, watch as s } from "vue";
|
|
3
|
+
import { get as c } from "es-toolkit/compat";
|
|
4
|
+
import { DRAWER_LEAVE_FALLBACK_MS as re, LAYER_STACK_BASE_Z_INDEX as l, acquireLayerStackOrder as ie, cn as u, countDrawerTransitionLayers as d, createFocusTrap as ae, getDrawerOverlayTransitionClass as oe, getDrawerPanelTransitionClass as se, getLayerStackEntry as ce, hasDrawerTransition as le, mergeBridgeUILayeredClasses as f, pushLayerStack as p, resolveEffectiveDrawerTransition as m, splitComponentProps as h, subscribeLayerStack as g } from "@bridge-ui/core";
|
|
5
|
+
import { isModalBackdropClick as ue } from "@bridge-ui/core/Utils";
|
|
6
|
+
import { blurProps as de, placementPanelProps as fe, placementProps as pe, sizeProps as me } from "@bridge-ui/core/Components/Drawer";
|
|
7
|
+
//#region src/Components/Drawer/composables/useDrawer.ts
|
|
8
|
+
var he = [
|
|
9
|
+
"blur",
|
|
10
|
+
"size",
|
|
11
|
+
"scroll",
|
|
12
|
+
"classes",
|
|
13
|
+
"stackId",
|
|
14
|
+
"ariaLabel",
|
|
15
|
+
"autoFocus",
|
|
16
|
+
"placement",
|
|
17
|
+
"persistent",
|
|
18
|
+
"teleportTo",
|
|
19
|
+
"transition",
|
|
20
|
+
"customProps",
|
|
21
|
+
"keepMounted",
|
|
22
|
+
"hideBackdrop",
|
|
23
|
+
"closeOnEscape",
|
|
24
|
+
"ariaLabelledBy",
|
|
25
|
+
"closeOnOverlay",
|
|
26
|
+
"disableScrollLock",
|
|
27
|
+
"disableEnforceFocus",
|
|
28
|
+
"disableRestoreFocus"
|
|
29
|
+
];
|
|
30
|
+
function _(_, ge, v = {}) {
|
|
31
|
+
let _e = o(), y = i(!1), b = i(!1), x = i(""), S = 0, C = null, w = null, T = i(null), E = null, D = i(l), O = null, k = i("closed"), A = null, j = n(() => a(v.show ?? !1));
|
|
32
|
+
function M(e) {
|
|
33
|
+
e || v.onClose?.(), v.show && (v.show.value = e), v.onShowChange?.(e);
|
|
34
|
+
}
|
|
35
|
+
let N = n(() => h({
|
|
36
|
+
bridgeKeys: he,
|
|
37
|
+
props: {
|
|
38
|
+
..._e,
|
|
39
|
+
..._
|
|
40
|
+
}
|
|
41
|
+
})), { merged: P, entry: F } = ee({
|
|
42
|
+
libDefaults: ge,
|
|
43
|
+
componentName: "Drawer",
|
|
44
|
+
props: () => N.value.componentProps
|
|
45
|
+
}), I = n(() => P.value.customProps), L = te({
|
|
46
|
+
entry: F,
|
|
47
|
+
props: () => N.value.componentProps
|
|
48
|
+
}), R = n(() => m(P.value.transition ?? "none")), z = n(() => le(R.value)), B = n(() => P.value.scroll ?? "paper"), V = n(() => P.value.keepMounted && !y.value), H = n(() => P.value.placement ?? "left"), U = n(() => H.value === "left" || H.value === "right" ? "horizontal" : "vertical"), ve = n(() => c(f(pe, F.value?.customProps?.placement), H.value)), ye = n(() => c(fe, H.value)), be = n(() => c(f(de, F.value?.customProps?.blur), P.value.blur)), xe = n(() => c(f(me, F.value?.customProps?.size), [P.value.size, U.value])), Se = n(() => oe(R.value)), Ce = n(() => se(R.value, H.value)), W = n(() => !P.value.persistent), we = n(() => N.value.inheritedAttrs), Te = n(() => e(I.value?.root, we.value, {
|
|
49
|
+
onTransitionend: je,
|
|
50
|
+
style: { zIndex: D.value },
|
|
51
|
+
"aria-hidden": V.value ? !0 : void 0,
|
|
52
|
+
class: u({
|
|
53
|
+
"fixed inset-0": !0,
|
|
54
|
+
"overflow-y-auto": B.value === "body",
|
|
55
|
+
"overflow-hidden": B.value === "paper",
|
|
56
|
+
"invisible pointer-events-none": V.value,
|
|
57
|
+
[c(L.value, "root") ?? ""]: !0
|
|
58
|
+
})
|
|
59
|
+
})), Ee = n(() => e(I.value?.overlay, { onClick: Z }, {
|
|
60
|
+
"data-drawer-part": "overlay",
|
|
61
|
+
"data-state": k.value,
|
|
62
|
+
class: u({
|
|
63
|
+
"fixed inset-0 bg-black/50": !0,
|
|
64
|
+
[be.value ?? ""]: !0,
|
|
65
|
+
[Se.value]: z.value,
|
|
66
|
+
[c(L.value, "overlay") ?? ""]: !0
|
|
67
|
+
})
|
|
68
|
+
})), De = n(() => e(I.value?.wrapper, { onClick: Q }, u({
|
|
69
|
+
"flex min-h-full w-full transform": !0,
|
|
70
|
+
[ve.value ?? ""]: !0,
|
|
71
|
+
[c(L.value, "wrapper") ?? ""]: !0
|
|
72
|
+
}))), Oe = n(() => e(I.value?.panel, {
|
|
73
|
+
role: "dialog",
|
|
74
|
+
"aria-modal": !0,
|
|
75
|
+
"aria-label": P.value.ariaLabel,
|
|
76
|
+
"aria-labelledby": P.value.ariaLabelledBy
|
|
77
|
+
}, {
|
|
78
|
+
"data-drawer-part": "panel",
|
|
79
|
+
"data-state": k.value,
|
|
80
|
+
class: u({
|
|
81
|
+
"relative rounded-none": !0,
|
|
82
|
+
[ye.value ?? ""]: !0,
|
|
83
|
+
[xe.value ?? ""]: !0,
|
|
84
|
+
"overflow-y-auto": B.value === "paper",
|
|
85
|
+
[Ce.value]: z.value,
|
|
86
|
+
[c(L.value, "panel") ?? ""]: !0
|
|
87
|
+
})
|
|
88
|
+
}));
|
|
89
|
+
function G() {
|
|
90
|
+
w?.release(), w = null;
|
|
91
|
+
}
|
|
92
|
+
function K() {
|
|
93
|
+
if (!y.value || k.value !== "open" || !T.value) {
|
|
94
|
+
G();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
G(), w = ae({
|
|
98
|
+
container: T.value,
|
|
99
|
+
disableAutoFocus: !P.value.autoFocus,
|
|
100
|
+
disableEnforceFocus: P.value.disableEnforceFocus,
|
|
101
|
+
disableRestoreFocus: P.value.disableRestoreFocus
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function ke(e) {
|
|
105
|
+
T.value = t(e), K();
|
|
106
|
+
}
|
|
107
|
+
function q() {
|
|
108
|
+
A !== null && (clearTimeout(A), A = null);
|
|
109
|
+
}
|
|
110
|
+
function J() {
|
|
111
|
+
q(), S = 0, y.value = !1, G(), j.value ? M(!1) : v.onShowChange?.(!1), k.value = "closed", P.value.keepMounted || (b.value = !1);
|
|
112
|
+
}
|
|
113
|
+
function Y() {
|
|
114
|
+
if (E?.releaseScrollLock(), !z.value) {
|
|
115
|
+
J();
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (k.value = "closed", S = d(R.value, { hideBackdrop: P.value.hideBackdrop }), S === 0) {
|
|
119
|
+
J();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
q(), A = setTimeout(() => {
|
|
123
|
+
A = null, S > 0 && J();
|
|
124
|
+
}, re);
|
|
125
|
+
}
|
|
126
|
+
function Ae() {
|
|
127
|
+
if (!z.value) {
|
|
128
|
+
k.value = "open";
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
k.value = "closed", r(() => {
|
|
132
|
+
requestAnimationFrame(() => {
|
|
133
|
+
k.value = "open";
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function je(e) {
|
|
138
|
+
if (!b.value || k.value !== "closed") return;
|
|
139
|
+
let t = e.target;
|
|
140
|
+
t?.dataset.drawerPart !== "overlay" && t?.dataset.drawerPart !== "panel" || e.propertyName === "none" || e.elapsedTime === 0 || (--S, S <= 0 && J());
|
|
141
|
+
}
|
|
142
|
+
function X() {
|
|
143
|
+
if (W.value) {
|
|
144
|
+
if (!z.value) {
|
|
145
|
+
M(!1);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
b.value && Y();
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
function Z() {
|
|
152
|
+
P.value.closeOnOverlay === !1 || !W.value || X();
|
|
153
|
+
}
|
|
154
|
+
function Q(e) {
|
|
155
|
+
ue(e) && Z();
|
|
156
|
+
}
|
|
157
|
+
function Me() {
|
|
158
|
+
!j.value || P.value.closeOnEscape === !1 || !W.value || X();
|
|
159
|
+
}
|
|
160
|
+
s(j, (e) => {
|
|
161
|
+
if (e) {
|
|
162
|
+
b.value = !0, y.value = !0, Ae();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
b.value && Y();
|
|
166
|
+
}, { immediate: !0 }), s([
|
|
167
|
+
y,
|
|
168
|
+
k,
|
|
169
|
+
() => P.value.autoFocus,
|
|
170
|
+
() => P.value.disableEnforceFocus,
|
|
171
|
+
() => P.value.disableRestoreFocus
|
|
172
|
+
], () => {
|
|
173
|
+
r(() => {
|
|
174
|
+
K();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
function $() {
|
|
178
|
+
let e = ce(x.value);
|
|
179
|
+
e && (D.value = e.zIndex);
|
|
180
|
+
}
|
|
181
|
+
return s(y, (e) => {
|
|
182
|
+
if (e) {
|
|
183
|
+
C === null && (C = ie()), E = p({
|
|
184
|
+
order: C,
|
|
185
|
+
id: v.stackId,
|
|
186
|
+
onEscape: Me,
|
|
187
|
+
lockScroll: P.value.disableScrollLock !== !0
|
|
188
|
+
}), x.value = E.id, D.value = E.zIndex, $(), O = g($);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
O?.(), O = null, E?.release(), E = null, x.value = "", D.value = l, b.value || (C = null);
|
|
192
|
+
}, { immediate: !0 }), ne(() => {
|
|
193
|
+
q(), O?.(), O = null, G(), E?.release(), E = null, C = null;
|
|
194
|
+
}), {
|
|
195
|
+
merged: P,
|
|
196
|
+
mounted: b,
|
|
197
|
+
rootBind: Te,
|
|
198
|
+
panelBind: Oe,
|
|
199
|
+
overlayBind: Ee,
|
|
200
|
+
wrapperBind: De,
|
|
201
|
+
setPanelRef: ke,
|
|
202
|
+
layerStackId: x,
|
|
203
|
+
handleOverlayClick: Z,
|
|
204
|
+
handleWrapperClick: Q
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
208
|
+
export { _ as useDrawer };
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { HTMLAttributes, Slot } from 'vue';
|
|
2
|
+
import { DrawerBlur, DrawerPlacement, DrawerScroll, DrawerSize, DrawerTransition, MergeHtmlProps, MergeProps } from '@bridge-ui/core';
|
|
3
|
+
export interface DrawerBlurOverrides {}
|
|
4
|
+
export interface DrawerSizeOverrides {}
|
|
5
|
+
export interface DrawerScrollOverrides {}
|
|
6
|
+
export interface DrawerPlacementOverrides {}
|
|
7
|
+
export interface DrawerTransitionOverrides {}
|
|
8
|
+
export interface DrawerClasses {
|
|
9
|
+
/**
|
|
10
|
+
* The classes to apply to the overlay.
|
|
11
|
+
*/
|
|
12
|
+
overlay?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The classes to apply to the dialog panel.
|
|
15
|
+
*/
|
|
16
|
+
panel?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The classes to apply to the root portal container.
|
|
19
|
+
*/
|
|
20
|
+
root?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The classes to apply to the placement wrapper.
|
|
23
|
+
*/
|
|
24
|
+
wrapper?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DrawerCustomProps {
|
|
27
|
+
/**
|
|
28
|
+
* Props forwarded to the overlay.
|
|
29
|
+
*/
|
|
30
|
+
overlay?: HTMLAttributes;
|
|
31
|
+
/**
|
|
32
|
+
* Props forwarded to the dialog panel.
|
|
33
|
+
*/
|
|
34
|
+
panel?: HTMLAttributes;
|
|
35
|
+
/**
|
|
36
|
+
* Props forwarded to the root portal container.
|
|
37
|
+
*/
|
|
38
|
+
root?: HTMLAttributes;
|
|
39
|
+
/**
|
|
40
|
+
* Props forwarded to the placement wrapper.
|
|
41
|
+
*/
|
|
42
|
+
wrapper?: HTMLAttributes;
|
|
43
|
+
}
|
|
44
|
+
export interface DrawerEmits {
|
|
45
|
+
/**
|
|
46
|
+
* Emitted when the user dismisses the drawer (overlay or Escape).
|
|
47
|
+
* Not emitted when the parent sets `v-model` to `false` directly.
|
|
48
|
+
*/
|
|
49
|
+
close: [];
|
|
50
|
+
/**
|
|
51
|
+
* Emitted when `show` should change (controlled state).
|
|
52
|
+
* Listen with `@show-change` / `v-on:show-change`.
|
|
53
|
+
*/
|
|
54
|
+
"show-change": [show: boolean];
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Drawer shell (overlay, portal, backdrop). Put any content in the default slot.
|
|
58
|
+
* Visibility is controlled with `v-model` (not listed here — `defineModel` handles it).
|
|
59
|
+
*/
|
|
60
|
+
export interface DrawerOwnProps {
|
|
61
|
+
/**
|
|
62
|
+
* Accessible name for the dialog panel (`aria-label`).
|
|
63
|
+
*
|
|
64
|
+
* @default undefined
|
|
65
|
+
*/
|
|
66
|
+
ariaLabel?: string;
|
|
67
|
+
/**
|
|
68
|
+
* Id of the element that labels the dialog (`aria-labelledby`). Prefer over `ariaLabel` when a visible title exists.
|
|
69
|
+
*
|
|
70
|
+
* @default undefined
|
|
71
|
+
*/
|
|
72
|
+
ariaLabelledBy?: string;
|
|
73
|
+
/**
|
|
74
|
+
* When true, focuses the first focusable element inside the drawer on open.
|
|
75
|
+
*
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
autoFocus?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Backdrop blur on the overlay.
|
|
81
|
+
*
|
|
82
|
+
* @default "none"
|
|
83
|
+
*/
|
|
84
|
+
blur?: MergeProps<DrawerBlur, DrawerBlurOverrides>;
|
|
85
|
+
/**
|
|
86
|
+
* The classes to apply to the drawer.
|
|
87
|
+
*
|
|
88
|
+
* @default undefined
|
|
89
|
+
*/
|
|
90
|
+
classes?: DrawerClasses;
|
|
91
|
+
/**
|
|
92
|
+
* Whether the drawer closes on escape key press.
|
|
93
|
+
*
|
|
94
|
+
* @default true
|
|
95
|
+
*/
|
|
96
|
+
closeOnEscape?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether the drawer closes on overlay click.
|
|
99
|
+
*
|
|
100
|
+
* @default true
|
|
101
|
+
*/
|
|
102
|
+
closeOnOverlay?: boolean;
|
|
103
|
+
/**
|
|
104
|
+
* Props forwarded to each drawer part.
|
|
105
|
+
*
|
|
106
|
+
* @default undefined
|
|
107
|
+
*/
|
|
108
|
+
customProps?: DrawerCustomProps;
|
|
109
|
+
/**
|
|
110
|
+
* When true, focus is not trapped inside the drawer while open.
|
|
111
|
+
*
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
disableEnforceFocus?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* When true, focus is not restored to the previously focused element on close.
|
|
117
|
+
*
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
disableRestoreFocus?: boolean;
|
|
121
|
+
/**
|
|
122
|
+
* When true, body scroll is not locked while the drawer is open.
|
|
123
|
+
*
|
|
124
|
+
* @default false
|
|
125
|
+
*/
|
|
126
|
+
disableScrollLock?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* When true, the backdrop overlay is not rendered.
|
|
129
|
+
*
|
|
130
|
+
* @default false
|
|
131
|
+
*/
|
|
132
|
+
hideBackdrop?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* When true, the drawer stays mounted in the DOM after closing (hidden).
|
|
135
|
+
*
|
|
136
|
+
* @default false
|
|
137
|
+
*/
|
|
138
|
+
keepMounted?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* When true, escape and overlay clicks do not close the drawer.
|
|
141
|
+
*
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
persistent?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Edge the panel docks to.
|
|
147
|
+
*
|
|
148
|
+
* @default "left"
|
|
149
|
+
*/
|
|
150
|
+
placement?: MergeProps<DrawerPlacement, DrawerPlacementOverrides>;
|
|
151
|
+
/**
|
|
152
|
+
* Where scroll happens: the page (`body`) or the drawer panel (`paper`).
|
|
153
|
+
*
|
|
154
|
+
* @default "paper"
|
|
155
|
+
*/
|
|
156
|
+
scroll?: MergeProps<DrawerScroll, DrawerScrollOverrides>;
|
|
157
|
+
/**
|
|
158
|
+
* Panel size along the placement axis (width for `left`/`right`, height for `top`/`bottom`).
|
|
159
|
+
*
|
|
160
|
+
* @default "md"
|
|
161
|
+
*/
|
|
162
|
+
size?: MergeProps<DrawerSize, DrawerSizeOverrides>;
|
|
163
|
+
/**
|
|
164
|
+
* Stack id assigned when the drawer opens. Set by BridgeDrawerHost; do not set in app code.
|
|
165
|
+
*
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
stackId?: string;
|
|
169
|
+
/**
|
|
170
|
+
* Where to teleport the drawer. Pass `false` to render in place.
|
|
171
|
+
*
|
|
172
|
+
* @default "body"
|
|
173
|
+
*/
|
|
174
|
+
teleportTo?: false | string;
|
|
175
|
+
/**
|
|
176
|
+
* Enter/leave animation for overlay and panel.
|
|
177
|
+
*
|
|
178
|
+
* @default "slide"
|
|
179
|
+
*/
|
|
180
|
+
transition?: MergeProps<DrawerTransition, DrawerTransitionOverrides>;
|
|
181
|
+
}
|
|
182
|
+
export interface DrawerSlots {
|
|
183
|
+
/**
|
|
184
|
+
* Drawer content.
|
|
185
|
+
*/
|
|
186
|
+
default?: Slot<undefined>;
|
|
187
|
+
}
|
|
188
|
+
export type DrawerProps = MergeHtmlProps<DrawerOwnProps, HTMLAttributes>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useDrawer } from './composables/useDrawer';
|
|
2
|
+
export type { DrawerOptions } from './composables/useDrawer';
|
|
3
|
+
export type { DrawerBlurOverrides, DrawerClasses, DrawerCustomProps, DrawerEmits, DrawerOwnProps, DrawerPlacementOverrides, DrawerProps, DrawerScrollOverrides, DrawerSizeOverrides, DrawerSlots, DrawerTransitionOverrides, } from './drawer.types';
|
|
4
|
+
export { default as Drawer } from './Drawer.vue';
|
|
@@ -173,26 +173,26 @@ export interface FormControlSlots {
|
|
|
173
173
|
/**
|
|
174
174
|
* The form control (checkbox, radio, switch, …).
|
|
175
175
|
*/
|
|
176
|
-
default?: Slot
|
|
176
|
+
default?: Slot<undefined>;
|
|
177
177
|
/**
|
|
178
178
|
* Helper text below the control row (hidden when invalid).
|
|
179
179
|
*/
|
|
180
|
-
description?: Slot
|
|
180
|
+
description?: Slot<undefined>;
|
|
181
181
|
/**
|
|
182
182
|
* Inline-end label after the main label.
|
|
183
183
|
*/
|
|
184
|
-
endLabel?: Slot
|
|
184
|
+
endLabel?: Slot<undefined>;
|
|
185
185
|
/**
|
|
186
186
|
* Custom error message content.
|
|
187
187
|
*/
|
|
188
|
-
errorMessage?: Slot
|
|
188
|
+
errorMessage?: Slot<undefined>;
|
|
189
189
|
/**
|
|
190
190
|
* Main label next to the control.
|
|
191
191
|
*/
|
|
192
|
-
mainLabel?: Slot
|
|
192
|
+
mainLabel?: Slot<undefined>;
|
|
193
193
|
/**
|
|
194
194
|
* Inline-start label before the control.
|
|
195
195
|
*/
|
|
196
|
-
startLabel?: Slot
|
|
196
|
+
startLabel?: Slot<undefined>;
|
|
197
197
|
}
|
|
198
198
|
export type FormControlProps = MergeHtmlProps<FormControlOwnProps, HTMLAttributes>;
|
|
@@ -263,32 +263,32 @@ export interface FormFieldSlots {
|
|
|
263
263
|
/**
|
|
264
264
|
* Slot at the inline end of the header row (secondary label).
|
|
265
265
|
*/
|
|
266
|
-
corner?: Slot
|
|
266
|
+
corner?: Slot<undefined>;
|
|
267
267
|
/**
|
|
268
268
|
* The form control (input, textarea, select trigger, etc.).
|
|
269
269
|
*/
|
|
270
|
-
default?: Slot
|
|
270
|
+
default?: Slot<undefined>;
|
|
271
271
|
/**
|
|
272
272
|
* Helper text below the control (hidden when the field is invalid).
|
|
273
273
|
*/
|
|
274
|
-
description?: Slot
|
|
274
|
+
description?: Slot<undefined>;
|
|
275
275
|
/**
|
|
276
276
|
* Inline-end slot for custom content (e.g. a `Button`). Prefer the `end` prop
|
|
277
277
|
* for plain suffix text.
|
|
278
278
|
*/
|
|
279
|
-
end?: Slot
|
|
279
|
+
end?: Slot<undefined>;
|
|
280
280
|
/**
|
|
281
281
|
* Custom error message content.
|
|
282
282
|
*/
|
|
283
|
-
errorMessage?: Slot
|
|
283
|
+
errorMessage?: Slot<undefined>;
|
|
284
284
|
/**
|
|
285
285
|
* Slot at the inline start of the header row (primary label).
|
|
286
286
|
*/
|
|
287
|
-
label?: Slot
|
|
287
|
+
label?: Slot<undefined>;
|
|
288
288
|
/**
|
|
289
289
|
* Inline-start slot for custom content (e.g. a `Button`). Prefer the `start`
|
|
290
290
|
* prop for plain prefix text.
|
|
291
291
|
*/
|
|
292
|
-
start?: Slot
|
|
292
|
+
start?: Slot<undefined>;
|
|
293
293
|
}
|
|
294
294
|
export type FormFieldProps = MergeHtmlProps<FormFieldOwnProps, HTMLAttributes>;
|
|
@@ -100,14 +100,14 @@ export interface LinkSlots {
|
|
|
100
100
|
/**
|
|
101
101
|
* Content after the label (inline end).
|
|
102
102
|
*/
|
|
103
|
-
append?: Slot
|
|
103
|
+
append?: Slot<undefined>;
|
|
104
104
|
/**
|
|
105
105
|
* The link label.
|
|
106
106
|
*/
|
|
107
|
-
default?: Slot
|
|
107
|
+
default?: Slot<undefined>;
|
|
108
108
|
/**
|
|
109
109
|
* Content before the label (inline start).
|
|
110
110
|
*/
|
|
111
|
-
prepend?: Slot
|
|
111
|
+
prepend?: Slot<undefined>;
|
|
112
112
|
}
|
|
113
113
|
export type LinkProps = MergeHtmlProps<LinkOwnProps, AnchorHTMLAttributes>;
|
|
@@ -13,7 +13,7 @@ export interface ListCustomProps {
|
|
|
13
13
|
root?: HTMLAttributes;
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
|
-
* Vertical list container
|
|
16
|
+
* Vertical list container. Use with `ListItem` and `ListSection`.
|
|
17
17
|
*/
|
|
18
18
|
export interface ListOwnProps {
|
|
19
19
|
/**
|
|
@@ -22,7 +22,7 @@ export interface ListSectionCustomProps {
|
|
|
22
22
|
}
|
|
23
23
|
export type ListSectionLabel = VNode | string | VNode[] | undefined;
|
|
24
24
|
/**
|
|
25
|
-
* Section heading inside a `List
|
|
25
|
+
* Section heading inside a `List`.
|
|
26
26
|
*/
|
|
27
27
|
export interface ListSectionOwnProps {
|
|
28
28
|
/**
|
|
@@ -182,25 +182,25 @@ export interface ListboxSlots {
|
|
|
182
182
|
/**
|
|
183
183
|
* Content below the list.
|
|
184
184
|
*/
|
|
185
|
-
afterOptions?: Slot
|
|
185
|
+
afterOptions?: Slot<undefined>;
|
|
186
186
|
/**
|
|
187
187
|
* Content above the list.
|
|
188
188
|
*/
|
|
189
|
-
beforeOptions?: Slot
|
|
189
|
+
beforeOptions?: Slot<undefined>;
|
|
190
190
|
/**
|
|
191
191
|
* Composed list content (`ListSection` / `ListItem`). When set, replaces the
|
|
192
192
|
* mapped `options` / `entries` render inside the list.
|
|
193
193
|
*/
|
|
194
|
-
default?: Slot
|
|
194
|
+
default?: Slot<undefined>;
|
|
195
195
|
/**
|
|
196
196
|
* Custom empty-state content.
|
|
197
197
|
*/
|
|
198
|
-
empty?: Slot
|
|
198
|
+
empty?: Slot<undefined>;
|
|
199
199
|
/**
|
|
200
200
|
* Custom loading content. Replaces the default `loadingMessage` when set.
|
|
201
201
|
* The progress bar still renders above this content.
|
|
202
202
|
*/
|
|
203
|
-
loading?: Slot
|
|
203
|
+
loading?: Slot<undefined>;
|
|
204
204
|
/**
|
|
205
205
|
* Custom option item content.
|
|
206
206
|
*/
|
|
@@ -54,13 +54,13 @@ export interface MenuEmits {
|
|
|
54
54
|
close: [];
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* Anchored menu panel
|
|
58
|
-
* (not listed here — `defineModel` handles it). Anchor with `anchorEl`
|
|
57
|
+
* Anchored menu panel. Visibility is controlled with `v-model`
|
|
58
|
+
* (not listed here — `defineModel` handles it). Anchor with `anchorEl`
|
|
59
59
|
* or put the opener in the `trigger` slot; menu items go in the default slot.
|
|
60
60
|
*/
|
|
61
61
|
export interface MenuOwnProps {
|
|
62
62
|
/**
|
|
63
|
-
* Element that anchors the menu panel
|
|
63
|
+
* Element that anchors the menu panel. When set, it is used
|
|
64
64
|
* for positioning and click-away instead of the `trigger` slot wrapper.
|
|
65
65
|
* Prefer this when the opener lives outside the `Menu` or is controlled manually.
|
|
66
66
|
* Not merged into Bridge defaults (DOM nodes must not be deep-merged).
|
|
@@ -65,7 +65,6 @@ function x(x, ue, S = {}) {
|
|
|
65
65
|
})
|
|
66
66
|
})), be = n(() => e(z.value?.wrapper, { onClick: Q }, l({
|
|
67
67
|
"flex min-h-full w-full transform p-4": !0,
|
|
68
|
-
"items-end justify-center": !0,
|
|
69
68
|
[fe.value ?? ""]: !0,
|
|
70
69
|
[s(B.value, "wrapper") ?? ""]: !0
|
|
71
70
|
}))), xe = n(() => e(z.value?.panel, {
|
|
@@ -59,8 +59,9 @@ export interface ModalEmits {
|
|
|
59
59
|
*/
|
|
60
60
|
export interface ModalOwnProps {
|
|
61
61
|
/**
|
|
62
|
-
* Panel position
|
|
63
|
-
*
|
|
62
|
+
* Panel position on all breakpoints (`{row}-{column}` grid).
|
|
63
|
+
* Use `useBreakpoint` if you need a different align per viewport
|
|
64
|
+
* (e.g. bottom sheet on mobile, centered on desktop).
|
|
64
65
|
*
|
|
65
66
|
* @default "middle-center"
|
|
66
67
|
*/
|
|
@@ -6,19 +6,19 @@ type __VLS_ModelProps = {
|
|
|
6
6
|
};
|
|
7
7
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
8
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
+
clear: () => any;
|
|
9
10
|
search: (query: string) => any;
|
|
10
11
|
select: (option: import('@bridge-ui/core').ListboxOption) => any;
|
|
11
12
|
"update:modelValue": (...args: unknown[]) => any;
|
|
12
|
-
clear: () => any;
|
|
13
13
|
change: (value: import('@bridge-ui/core').SelectModel) => any;
|
|
14
14
|
close: () => any;
|
|
15
15
|
open: () => any;
|
|
16
16
|
deselect: (option: import('@bridge-ui/core').ListboxOption) => any;
|
|
17
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
18
|
+
onClear?: (() => any) | undefined;
|
|
18
19
|
onSearch?: ((query: string) => any) | undefined;
|
|
19
20
|
onSelect?: ((option: import('@bridge-ui/core').ListboxOption) => any) | undefined;
|
|
20
21
|
"onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
|
|
21
|
-
onClear?: (() => any) | undefined;
|
|
22
22
|
onChange?: ((value: import('@bridge-ui/core').SelectModel) => any) | undefined;
|
|
23
23
|
onClose?: (() => any) | undefined;
|
|
24
24
|
onOpen?: (() => any) | undefined;
|
|
@@ -199,11 +199,11 @@ export interface SelectSlots extends FormFieldSlots {
|
|
|
199
199
|
/**
|
|
200
200
|
* Content below the trigger, above the option list.
|
|
201
201
|
*/
|
|
202
|
-
afterOptions?: Slot
|
|
202
|
+
afterOptions?: Slot<undefined>;
|
|
203
203
|
/**
|
|
204
204
|
* Content above the option list.
|
|
205
205
|
*/
|
|
206
|
-
beforeOptions?: Slot
|
|
206
|
+
beforeOptions?: Slot<undefined>;
|
|
207
207
|
/**
|
|
208
208
|
* Custom chip content (multiple mode).
|
|
209
209
|
*/
|
|
@@ -215,15 +215,15 @@ export interface SelectSlots extends FormFieldSlots {
|
|
|
215
215
|
* When set (and not using declarative `SelectOption` children), replaces
|
|
216
216
|
* mapped `options` inside the listbox.
|
|
217
217
|
*/
|
|
218
|
-
default?: Slot
|
|
218
|
+
default?: Slot<undefined>;
|
|
219
219
|
/**
|
|
220
220
|
* Custom empty-state content.
|
|
221
221
|
*/
|
|
222
|
-
empty?: Slot
|
|
222
|
+
empty?: Slot<undefined>;
|
|
223
223
|
/**
|
|
224
224
|
* Custom loading content.
|
|
225
225
|
*/
|
|
226
|
-
loading?: Slot
|
|
226
|
+
loading?: Slot<undefined>;
|
|
227
227
|
/**
|
|
228
228
|
* Custom option item content when rendering from the `options` prop.
|
|
229
229
|
*/
|