@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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { BridgeUIHostsProps } from './bridgeUIHosts.types';
|
|
2
|
-
declare var
|
|
2
|
+
declare var __VLS_26: {};
|
|
3
3
|
type __VLS_Slots = {} & {
|
|
4
|
-
default?: (props: typeof
|
|
4
|
+
default?: (props: typeof __VLS_26) => any;
|
|
5
5
|
};
|
|
6
6
|
declare const __VLS_base: import('vue').DefineComponent<BridgeUIHostsProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BridgeUIHostsProps> & Readonly<{}>, {
|
|
7
7
|
dialog: import('./Dialog').BridgeDialogHostProps;
|
|
8
8
|
modal: import('./Modal').BridgeModalHostProps;
|
|
9
|
+
drawer: import('./Drawer').BridgeDrawerHostProps;
|
|
9
10
|
snackbar: import('./Snackbar').BridgeSnackbarHostProps;
|
|
10
11
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
12
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import e from "./Dialog/BridgeDialogHost.js";
|
|
2
|
-
import t from "./
|
|
3
|
-
import n from "./
|
|
4
|
-
import
|
|
2
|
+
import t from "./Drawer/BridgeDrawerHost.js";
|
|
3
|
+
import n from "./Modal/BridgeModalHost.js";
|
|
4
|
+
import r from "./Snackbar/BridgeSnackbarHost.js";
|
|
5
|
+
import { createBlock as i, createVNode as a, defineComponent as o, guardReactiveProps as s, normalizeProps as c, openBlock as l, renderSlot as u, unref as d, withCtx as f } from "vue";
|
|
5
6
|
//#region src/Actions/BridgeUIHosts.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var p = /* @__PURE__ */ o({
|
|
7
8
|
__name: "BridgeUIHosts",
|
|
8
9
|
props: {
|
|
9
10
|
dialog: { default: () => ({}) },
|
|
11
|
+
drawer: { default: () => ({}) },
|
|
10
12
|
modal: { default: () => ({}) },
|
|
11
13
|
snackbar: { default: () => ({}) }
|
|
12
14
|
},
|
|
13
|
-
setup(
|
|
14
|
-
return (
|
|
15
|
-
default:
|
|
16
|
-
default:
|
|
17
|
-
default:
|
|
15
|
+
setup(o) {
|
|
16
|
+
return (p, m) => (l(), i(d(n), c(s(o.modal)), {
|
|
17
|
+
default: f(() => [a(d(t), c(s(o.drawer)), {
|
|
18
|
+
default: f(() => [a(d(e), c(s(o.dialog)), {
|
|
19
|
+
default: f(() => [a(d(r), c(s(o.snackbar)), {
|
|
20
|
+
default: f(() => [u(p.$slots, "default")]),
|
|
21
|
+
_: 3
|
|
22
|
+
}, 16)]),
|
|
18
23
|
_: 3
|
|
19
24
|
}, 16)]),
|
|
20
25
|
_: 3
|
|
@@ -24,4 +29,4 @@ var f = /* @__PURE__ */ a({
|
|
|
24
29
|
}
|
|
25
30
|
});
|
|
26
31
|
//#endregion
|
|
27
|
-
export {
|
|
32
|
+
export { p as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BridgeDrawerHostProps } from './bridgeDrawer.types';
|
|
2
|
+
declare var __VLS_1: {};
|
|
3
|
+
type __VLS_Slots = {} & {
|
|
4
|
+
default?: (props: typeof __VLS_1) => any;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_base: import('vue').DefineComponent<BridgeDrawerHostProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BridgeDrawerHostProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
10
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
11
|
+
new (): {
|
|
12
|
+
$slots: S;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import e from "../../Components/Drawer/Drawer.js";
|
|
2
|
+
import { BRIDGE_DRAWER_INJECTION_KEY as t } from "./bridgeDrawerInjectionKey.js";
|
|
3
|
+
import { createBridgeDrawerApi as n } from "./createBridgeDrawerApi.js";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createElementBlock as o, defineComponent as s, inject as c, mergeProps as l, openBlock as u, provide as d, renderList as f, renderSlot as p, resolveDynamicComponent as m, unref as h, withCtx as g } from "vue";
|
|
5
|
+
import { completeLayerHide as _, invokeLayerDismiss as v, mergeLayerShellProps as y } from "@bridge-ui/core";
|
|
6
|
+
//#region src/Actions/Drawer/BridgeDrawerHost.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var b = "[Bridge UI] Nested <BridgeDrawerHost /> detected. useDrawerAction() will target the nearest host only. Remove the extra host.", x = /* @__PURE__ */ s({
|
|
8
|
+
__name: "BridgeDrawerHost",
|
|
9
|
+
props: { drawer: {} },
|
|
10
|
+
setup(s) {
|
|
11
|
+
let x = s;
|
|
12
|
+
c(t, null) && process.env.NODE_ENV !== "production" && console.warn(b);
|
|
13
|
+
let S = n(), C = i(() => S.entries.value);
|
|
14
|
+
return d(t, S), (t, n) => (u(), o(r, null, [p(t.$slots, "default"), (u(!0), o(r, null, f(C.value, (t) => (u(), a(h(e), l({
|
|
15
|
+
key: t.id,
|
|
16
|
+
"stack-id": t.id,
|
|
17
|
+
"model-value": t.show,
|
|
18
|
+
"onUpdate:modelValue": (e) => h(S).syncShow(t.id, e)
|
|
19
|
+
}, { ref_for: !0 }, h(y)(x.drawer, t.drawer), {
|
|
20
|
+
onClose: (e) => h(v)(h(S).entries.value, t.id),
|
|
21
|
+
onShowChange: (e) => h(_)(h(S).entries.value, t.id, e, h(S).removeEntry)
|
|
22
|
+
}), {
|
|
23
|
+
default: g(() => [(u(), a(m(t.component), l({ ref_for: !0 }, t.props), null, 16))]),
|
|
24
|
+
_: 2
|
|
25
|
+
}, 1040, [
|
|
26
|
+
"stack-id",
|
|
27
|
+
"model-value",
|
|
28
|
+
"onUpdate:modelValue",
|
|
29
|
+
"onClose",
|
|
30
|
+
"onShowChange"
|
|
31
|
+
]))), 128))], 64));
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { x as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { LayerId } from '@bridge-ui/core';
|
|
2
|
+
import { Component, Ref } from 'vue';
|
|
3
|
+
import { DrawerOwnProps } from '../../Components/Drawer/drawer.types';
|
|
4
|
+
export type BridgeDrawerShellProps = Partial<Omit<DrawerOwnProps, "stackId">>;
|
|
5
|
+
export type BridgeDrawerHostProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Default shell options merged into every drawer opened via `useDrawerAction()`.
|
|
8
|
+
* Per-call `open({ drawer })` overrides these.
|
|
9
|
+
*/
|
|
10
|
+
drawer?: BridgeDrawerShellProps;
|
|
11
|
+
};
|
|
12
|
+
export type BridgeDrawerEntry = {
|
|
13
|
+
component: Component;
|
|
14
|
+
drawer?: Partial<DrawerOwnProps>;
|
|
15
|
+
id: LayerId;
|
|
16
|
+
onClose?: () => void;
|
|
17
|
+
onClosed?: () => void;
|
|
18
|
+
props?: Record<string, unknown>;
|
|
19
|
+
show: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type BridgeDrawerOpenOptions<TProps = Record<string, unknown>> = {
|
|
22
|
+
component: Component;
|
|
23
|
+
drawer?: Partial<DrawerOwnProps>;
|
|
24
|
+
onClose?: () => void;
|
|
25
|
+
onClosed?: () => void;
|
|
26
|
+
props?: TProps;
|
|
27
|
+
};
|
|
28
|
+
export type BridgeDrawerUpdateOptions = {
|
|
29
|
+
drawer?: Partial<DrawerOwnProps>;
|
|
30
|
+
props?: Record<string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
export type BridgeDrawerController = {
|
|
33
|
+
close: (id: LayerId) => void;
|
|
34
|
+
closeTop: () => void;
|
|
35
|
+
entries: Ref<BridgeDrawerEntry[]>;
|
|
36
|
+
isOpen: (id: LayerId) => boolean;
|
|
37
|
+
open: <TProps = Record<string, unknown>>(options: BridgeDrawerOpenOptions<TProps>) => LayerId;
|
|
38
|
+
removeEntry: (id: LayerId) => void;
|
|
39
|
+
syncShow: (id: LayerId, show: boolean) => void;
|
|
40
|
+
update: (id: LayerId, options: BridgeDrawerUpdateOptions) => void;
|
|
41
|
+
};
|
|
42
|
+
export type BridgeDrawerApi = Omit<BridgeDrawerController, "entries" | "syncShow" | "removeEntry"> & {
|
|
43
|
+
stackSize: number;
|
|
44
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { markRaw as e, shallowRef as t } from "vue";
|
|
2
|
+
import { closeLayer as n, closeTopLayer as r, createLayerId as i, createOpenLayerEntry as a, isLayerMounted as o, removeLayer as s, syncLayerShow as c, updateLayer as l } from "@bridge-ui/core";
|
|
3
|
+
//#region src/Actions/Drawer/createBridgeDrawerApi.ts
|
|
4
|
+
function u(t, n) {
|
|
5
|
+
return a(t, {
|
|
6
|
+
props: n.props,
|
|
7
|
+
drawer: n.drawer,
|
|
8
|
+
onClose: n.onClose,
|
|
9
|
+
onClosed: n.onClosed,
|
|
10
|
+
component: e(n.component)
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function d() {
|
|
14
|
+
let e = t([]);
|
|
15
|
+
function a(t) {
|
|
16
|
+
let n = i(), r = u(n, t);
|
|
17
|
+
return e.value = [...e.value, r], n;
|
|
18
|
+
}
|
|
19
|
+
function d(t) {
|
|
20
|
+
e.value = n(e.value, t);
|
|
21
|
+
}
|
|
22
|
+
function f() {
|
|
23
|
+
e.value = r(e.value);
|
|
24
|
+
}
|
|
25
|
+
function p(t) {
|
|
26
|
+
return o(e.value, t);
|
|
27
|
+
}
|
|
28
|
+
function m(t) {
|
|
29
|
+
e.value = s(e.value, t);
|
|
30
|
+
}
|
|
31
|
+
function h(t, n) {
|
|
32
|
+
e.value = l(e.value, t, n);
|
|
33
|
+
}
|
|
34
|
+
function g(t, n) {
|
|
35
|
+
e.value = c(e.value, t, n);
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
open: a,
|
|
39
|
+
close: d,
|
|
40
|
+
isOpen: p,
|
|
41
|
+
update: h,
|
|
42
|
+
entries: e,
|
|
43
|
+
closeTop: f,
|
|
44
|
+
syncShow: g,
|
|
45
|
+
removeEntry: m
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { d as createBridgeDrawerApi };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { BridgeDrawerApi, BridgeDrawerController, BridgeDrawerEntry, BridgeDrawerHostProps, BridgeDrawerOpenOptions, BridgeDrawerShellProps, BridgeDrawerUpdateOptions, } from './bridgeDrawer.types';
|
|
2
|
+
export { default as BridgeDrawerHost } from './BridgeDrawerHost.vue';
|
|
3
|
+
export { BridgeDrawerHostMissingError, useDrawerAction, } from './useDrawerAction';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BRIDGE_DRAWER_INJECTION_KEY as e } from "./bridgeDrawerInjectionKey.js";
|
|
2
|
+
import { computed as t, inject as n } from "vue";
|
|
3
|
+
import { getLayerCount as r } from "@bridge-ui/core";
|
|
4
|
+
//#region src/Actions/Drawer/useDrawerAction.ts
|
|
5
|
+
var i = class extends Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("useDrawerAction() requires <BridgeDrawerHost /> in the app tree."), this.name = "BridgeDrawerHostMissingError";
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
function a() {
|
|
11
|
+
let a = n(e, null);
|
|
12
|
+
if (!a) throw new i();
|
|
13
|
+
let o = t(() => r(a.entries.value));
|
|
14
|
+
return {
|
|
15
|
+
open: a.open,
|
|
16
|
+
close: a.close,
|
|
17
|
+
isOpen: a.isOpen,
|
|
18
|
+
update: a.update,
|
|
19
|
+
closeTop: a.closeTop,
|
|
20
|
+
get stackSize() {
|
|
21
|
+
return o.value;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { i as BridgeDrawerHostMissingError, a as useDrawerAction };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BridgeDialogHostProps } from './Dialog/bridgeDialog.types';
|
|
2
|
+
import { BridgeDrawerHostProps } from './Drawer/bridgeDrawer.types';
|
|
2
3
|
import { BridgeModalHostProps } from './Modal/bridgeModal.types';
|
|
3
4
|
import { BridgeSnackbarHostProps } from './Snackbar/bridgeSnackbar.types';
|
|
4
5
|
export type BridgeUIHostsProps = {
|
|
@@ -6,6 +7,10 @@ export type BridgeUIHostsProps = {
|
|
|
6
7
|
* Props forwarded to {@link BridgeDialogHost}.
|
|
7
8
|
*/
|
|
8
9
|
dialog?: BridgeDialogHostProps;
|
|
10
|
+
/**
|
|
11
|
+
* Props forwarded to {@link BridgeDrawerHost}.
|
|
12
|
+
*/
|
|
13
|
+
drawer?: BridgeDrawerHostProps;
|
|
9
14
|
/**
|
|
10
15
|
* Props forwarded to {@link BridgeModalHost}.
|
|
11
16
|
*/
|
package/dist/Actions/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export type { BridgeUIHostsProps } from './bridgeUIHosts.types';
|
|
|
2
2
|
export { default as BridgeUIHosts } from './BridgeUIHosts.vue';
|
|
3
3
|
export { BridgeDialogHost, BridgeDialogHostMissingError, useDialogAction, } from './Dialog';
|
|
4
4
|
export type { BridgeDialogActionProps, BridgeDialogApi, BridgeDialogEntry, BridgeDialogHostProps, BridgeDialogOpenOptions, BridgeDialogShellProps, BridgeDialogUpdateOptions, DialogAction, DialogActions, } from './Dialog';
|
|
5
|
+
export { BridgeDrawerHost, BridgeDrawerHostMissingError, useDrawerAction, } from './Drawer';
|
|
6
|
+
export type { BridgeDrawerApi, BridgeDrawerController, BridgeDrawerEntry, BridgeDrawerHostProps, BridgeDrawerOpenOptions, BridgeDrawerShellProps, BridgeDrawerUpdateOptions, } from './Drawer';
|
|
5
7
|
export { BridgeModalHost, BridgeModalHostMissingError, useModalAction, } from './Modal';
|
|
6
8
|
export type { BridgeModalApi, BridgeModalController, BridgeModalEntry, BridgeModalHostProps, BridgeModalOpenOptions, BridgeModalShellProps, BridgeModalUpdateOptions, } from './Modal';
|
|
7
9
|
export { BridgeSnackbarHost, BridgeSnackbarHostMissingError, useSnackbarAction, } from './Snackbar';
|
package/dist/Actions/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import e from "./Dialog/BridgeDialogHost.js";
|
|
2
2
|
import { BridgeDialogHostMissingError as t, useDialogAction as n } from "./Dialog/useDialogAction.js";
|
|
3
|
-
import r from "./
|
|
4
|
-
import {
|
|
5
|
-
import o from "./
|
|
6
|
-
import {
|
|
7
|
-
import l from "./
|
|
8
|
-
|
|
3
|
+
import r from "./Drawer/BridgeDrawerHost.js";
|
|
4
|
+
import { BridgeDrawerHostMissingError as i, useDrawerAction as a } from "./Drawer/useDrawerAction.js";
|
|
5
|
+
import o from "./Modal/BridgeModalHost.js";
|
|
6
|
+
import { BridgeModalHostMissingError as s, useModalAction as c } from "./Modal/useModalAction.js";
|
|
7
|
+
import l from "./Snackbar/BridgeSnackbarHost.js";
|
|
8
|
+
import { BridgeSnackbarHostMissingError as u, useSnackbarAction as d } from "./Snackbar/useSnackbarAction.js";
|
|
9
|
+
import f from "./BridgeUIHosts.js";
|
|
10
|
+
export { e as BridgeDialogHost, t as BridgeDialogHostMissingError, r as BridgeDrawerHost, i as BridgeDrawerHostMissingError, o as BridgeModalHost, s as BridgeModalHostMissingError, l as BridgeSnackbarHost, u as BridgeSnackbarHostMissingError, f as BridgeUIHosts, n as useDialogAction, a as useDrawerAction, c as useModalAction, d as useSnackbarAction };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DrawerOwnProps, DrawerSlots } from './drawer.types';
|
|
2
|
+
type __VLS_Slots = DrawerSlots;
|
|
3
|
+
type __VLS_Props = DrawerOwnProps;
|
|
4
|
+
type __VLS_ModelProps = {
|
|
5
|
+
modelValue?: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
9
|
+
stackId: import('vue').ComputedRef<string>;
|
|
10
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
"update:modelValue": (value: boolean) => any;
|
|
12
|
+
close: () => any;
|
|
13
|
+
"show-change": (show: boolean) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
"onShow-change"?: ((show: boolean) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
placement: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').DrawerPlacement, import('./drawer.types').DrawerPlacementOverrides>;
|
|
20
|
+
closeOnEscape: boolean;
|
|
21
|
+
disableScrollLock: boolean;
|
|
22
|
+
keepMounted: boolean;
|
|
23
|
+
persistent: boolean;
|
|
24
|
+
teleportTo: false | string;
|
|
25
|
+
scroll: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').DrawerScroll, import('./drawer.types').DrawerScrollOverrides>;
|
|
26
|
+
autoFocus: boolean;
|
|
27
|
+
closeOnOverlay: boolean;
|
|
28
|
+
disableEnforceFocus: boolean;
|
|
29
|
+
disableRestoreFocus: boolean;
|
|
30
|
+
hideBackdrop: boolean;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
33
|
+
declare const _default: typeof __VLS_export;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { resolveNamedSlot as e } from "../../Utils/slotOrProp.js";
|
|
2
|
+
import { useDrawer as t } from "./composables/useDrawer.js";
|
|
3
|
+
import { Teleport as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeProps as f, openBlock as p, resolveDynamicComponent as m, unref as h, useModel as g, useSlots as _ } from "vue";
|
|
4
|
+
//#region src/Components/Drawer/Drawer.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var v = /* @__PURE__ */ c({
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "Drawer",
|
|
8
|
+
props: /* @__PURE__ */ u({
|
|
9
|
+
ariaLabel: {},
|
|
10
|
+
ariaLabelledBy: {},
|
|
11
|
+
autoFocus: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: !1
|
|
14
|
+
},
|
|
15
|
+
blur: {},
|
|
16
|
+
classes: {},
|
|
17
|
+
closeOnEscape: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !0
|
|
20
|
+
},
|
|
21
|
+
closeOnOverlay: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
},
|
|
25
|
+
customProps: {},
|
|
26
|
+
disableEnforceFocus: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
disableRestoreFocus: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
disableScrollLock: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
hideBackdrop: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
keepMounted: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
persistent: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
placement: { default: "left" },
|
|
51
|
+
scroll: { default: "paper" },
|
|
52
|
+
size: {},
|
|
53
|
+
stackId: {},
|
|
54
|
+
teleportTo: {
|
|
55
|
+
type: [Boolean, String],
|
|
56
|
+
default: "body"
|
|
57
|
+
},
|
|
58
|
+
transition: {}
|
|
59
|
+
}, {
|
|
60
|
+
modelValue: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: !1
|
|
63
|
+
},
|
|
64
|
+
modelModifiers: {}
|
|
65
|
+
}),
|
|
66
|
+
emits: /* @__PURE__ */ u(["close", "show-change"], ["update:modelValue"]),
|
|
67
|
+
setup(c, { expose: u, emit: v }) {
|
|
68
|
+
let y = _(), b = v, x = c, { merged: S, mounted: C, rootBind: w, panelBind: T, overlayBind: E, wrapperBind: D, setPanelRef: O, layerStackId: k } = t(x, {
|
|
69
|
+
size: "md",
|
|
70
|
+
blur: "none",
|
|
71
|
+
scroll: "paper",
|
|
72
|
+
autoFocus: !1,
|
|
73
|
+
placement: "left",
|
|
74
|
+
teleportTo: "body",
|
|
75
|
+
transition: "slide",
|
|
76
|
+
closeOnEscape: !0,
|
|
77
|
+
closeOnOverlay: !0
|
|
78
|
+
}, {
|
|
79
|
+
show: g(c, "modelValue"),
|
|
80
|
+
stackId: x.stackId,
|
|
81
|
+
onClose: () => b("close"),
|
|
82
|
+
onShowChange: (e) => b("show-change", e)
|
|
83
|
+
});
|
|
84
|
+
u({ stackId: r(() => x.stackId ?? k.value) });
|
|
85
|
+
let A = r(() => S.value.teleportTo === !1), j = r(() => S.value.teleportTo === !1 ? "body" : S.value.teleportTo), M = r(() => x.hideBackdrop !== !0 && S.value.hideBackdrop !== !0);
|
|
86
|
+
return (t, r) => (p(), i(n, {
|
|
87
|
+
to: j.value,
|
|
88
|
+
disabled: A.value
|
|
89
|
+
}, [h(C) ? (p(), o("div", f(d({ key: 0 }, h(w))), [M.value ? (p(), o("div", d({
|
|
90
|
+
key: 0,
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
}, h(E)), null, 16)) : a("", !0), s("div", f(l(h(D))), [s("div", d({ ref: h(O) }, h(T)), [(p(), i(m(h(e)(h(y), "default"))))], 16)], 16)], 16)) : a("", !0)], 8, ["to", "disabled"]));
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
//#endregion
|
|
96
|
+
export { v as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ComponentPublicInstance, Ref } from 'vue';
|
|
2
|
+
import { LibDefaultsShape, MergeLibDefaults } from '@bridge-ui/core';
|
|
3
|
+
import { DrawerOwnProps, DrawerProps } from '../drawer.types';
|
|
4
|
+
type DrawerLibDefaults = LibDefaultsShape<DrawerOwnProps, "blur" | "size" | "scroll" | "autoFocus" | "placement" | "teleportTo" | "transition" | "closeOnEscape" | "closeOnOverlay">;
|
|
5
|
+
type DrawerMerged = MergeLibDefaults<DrawerOwnProps, DrawerLibDefaults>;
|
|
6
|
+
export type DrawerOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* Called when the drawer requests to close.
|
|
9
|
+
* Sugar for `onShowChange(false)`.
|
|
10
|
+
*/
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
/**
|
|
13
|
+
* Called when `show` should change (controlled state).
|
|
14
|
+
*/
|
|
15
|
+
onShowChange?: (show: boolean) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the drawer is visible (`defineModel()` / `v-model`).
|
|
18
|
+
*
|
|
19
|
+
* @default false
|
|
20
|
+
*/
|
|
21
|
+
show?: Ref<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Pre-assigned stack id (BridgeDrawerHost). When omitted, the stack generates a UUID.
|
|
24
|
+
*/
|
|
25
|
+
stackId?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function useDrawer(props: DrawerOwnProps, libDefaults: DrawerLibDefaults, options?: DrawerOptions): {
|
|
28
|
+
merged: import('vue').ComputedRef<DrawerMerged>;
|
|
29
|
+
mounted: Ref<boolean, boolean>;
|
|
30
|
+
rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
31
|
+
onTransitionend: (event: TransitionEvent) => void;
|
|
32
|
+
style: {
|
|
33
|
+
zIndex: number;
|
|
34
|
+
};
|
|
35
|
+
"aria-hidden": boolean | undefined;
|
|
36
|
+
class: string;
|
|
37
|
+
}, "class", import('vue').HTMLAttributes | undefined, Omit<DrawerProps, "size" | "classes" | "customProps" | "placement" | "closeOnEscape" | "disableScrollLock" | "keepMounted" | "persistent" | "teleportTo" | "blur" | "scroll" | "autoFocus" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "hideBackdrop" | "stackId" | "transition" | "ariaLabel" | "ariaLabelledBy">>>;
|
|
38
|
+
panelBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
39
|
+
"data-drawer-part": string;
|
|
40
|
+
"data-state": "open" | "closed";
|
|
41
|
+
class: string;
|
|
42
|
+
}, "class", import('vue').HTMLAttributes | undefined, {
|
|
43
|
+
role: string;
|
|
44
|
+
"aria-modal": boolean;
|
|
45
|
+
"aria-label": string | undefined;
|
|
46
|
+
"aria-labelledby": string | undefined;
|
|
47
|
+
}>>;
|
|
48
|
+
overlayBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
|
|
49
|
+
"data-drawer-part": string;
|
|
50
|
+
"data-state": "open" | "closed";
|
|
51
|
+
class: string;
|
|
52
|
+
}, "class", import('vue').HTMLAttributes | undefined, {
|
|
53
|
+
onClick: () => void;
|
|
54
|
+
}>>;
|
|
55
|
+
wrapperBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {
|
|
56
|
+
onClick: (event: MouseEvent) => void;
|
|
57
|
+
}>>;
|
|
58
|
+
setPanelRef: (element: null | Element | ComponentPublicInstance) => void;
|
|
59
|
+
layerStackId: Ref<string, string>;
|
|
60
|
+
handleOverlayClick: () => void;
|
|
61
|
+
handleWrapperClick: (event: MouseEvent) => void;
|
|
62
|
+
};
|
|
63
|
+
export {};
|