@bridge-ui/vue 0.0.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/dist/Actions/BridgeUIHosts.js +5 -0
- package/dist/Actions/BridgeUIHosts.vue.d.ts +18 -0
- package/dist/Actions/BridgeUIHosts.vue_vue_type_script_setup_true_lang.js +27 -0
- package/dist/Actions/Dialog/BridgeDialogAction.js +5 -0
- package/dist/Actions/Dialog/BridgeDialogAction.vue.d.ts +8 -0
- package/dist/Actions/Dialog/BridgeDialogAction.vue_vue_type_script_setup_true_lang.js +62 -0
- package/dist/Actions/Dialog/BridgeDialogHost.js +5 -0
- package/dist/Actions/Dialog/BridgeDialogHost.vue.d.ts +14 -0
- package/dist/Actions/Dialog/BridgeDialogHost.vue_vue_type_script_setup_true_lang.js +26 -0
- package/dist/Actions/Dialog/BridgeDialogItem.js +5 -0
- package/dist/Actions/Dialog/BridgeDialogItem.vue.d.ts +4 -0
- package/dist/Actions/Dialog/BridgeDialogItem.vue_vue_type_script_setup_true_lang.js +47 -0
- package/dist/Actions/Dialog/ResolveBridgeDialogFooter.js +5 -0
- package/dist/Actions/Dialog/ResolveBridgeDialogFooter.vue.d.ts +4 -0
- package/dist/Actions/Dialog/ResolveBridgeDialogFooter.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Actions/Dialog/bridgeDialog.types.d.ts +128 -0
- package/dist/Actions/Dialog/bridgeDialogInjectionKey.d.ts +3 -0
- package/dist/Actions/Dialog/bridgeDialogInjectionKey.js +4 -0
- package/dist/Actions/Dialog/createBridgeDialogApi.d.ts +2 -0
- package/dist/Actions/Dialog/createBridgeDialogApi.js +49 -0
- package/dist/Actions/Dialog/index.d.ts +3 -0
- package/dist/Actions/Dialog/index.js +3 -0
- package/dist/Actions/Dialog/useDialogAction.d.ts +5 -0
- package/dist/Actions/Dialog/useDialogAction.js +26 -0
- package/dist/Actions/Modal/BridgeModalHost.js +5 -0
- package/dist/Actions/Modal/BridgeModalHost.vue.d.ts +14 -0
- package/dist/Actions/Modal/BridgeModalHost.vue_vue_type_script_setup_true_lang.js +35 -0
- package/dist/Actions/Modal/bridgeModal.types.d.ts +44 -0
- package/dist/Actions/Modal/bridgeModalInjectionKey.d.ts +3 -0
- package/dist/Actions/Modal/bridgeModalInjectionKey.js +4 -0
- package/dist/Actions/Modal/createBridgeModalApi.d.ts +2 -0
- package/dist/Actions/Modal/createBridgeModalApi.js +49 -0
- package/dist/Actions/Modal/index.d.ts +3 -0
- package/dist/Actions/Modal/index.js +3 -0
- package/dist/Actions/Modal/useModalAction.d.ts +5 -0
- package/dist/Actions/Modal/useModalAction.js +26 -0
- package/dist/Actions/Snackbar/BridgeSnackbarAction.js +5 -0
- package/dist/Actions/Snackbar/BridgeSnackbarAction.vue.d.ts +8 -0
- package/dist/Actions/Snackbar/BridgeSnackbarAction.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/Actions/Snackbar/BridgeSnackbarHost.js +5 -0
- package/dist/Actions/Snackbar/BridgeSnackbarHost.vue.d.ts +16 -0
- package/dist/Actions/Snackbar/BridgeSnackbarHost.vue_vue_type_script_setup_true_lang.js +55 -0
- package/dist/Actions/Snackbar/BridgeSnackbarItem.js +5 -0
- package/dist/Actions/Snackbar/BridgeSnackbarItem.vue.d.ts +4 -0
- package/dist/Actions/Snackbar/BridgeSnackbarItem.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/Actions/Snackbar/bridgeSnackbar.types.d.ts +127 -0
- package/dist/Actions/Snackbar/bridgeSnackbarInjectionKey.d.ts +3 -0
- package/dist/Actions/Snackbar/bridgeSnackbarInjectionKey.js +4 -0
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.d.ts +14 -0
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +59 -0
- package/dist/Actions/Snackbar/index.d.ts +3 -0
- package/dist/Actions/Snackbar/index.js +3 -0
- package/dist/Actions/Snackbar/useSnackbarAction.d.ts +5 -0
- package/dist/Actions/Snackbar/useSnackbarAction.js +27 -0
- package/dist/Actions/bridgeUIHosts.types.d.ts +17 -0
- package/dist/Actions/index.d.ts +8 -0
- package/dist/Actions/index.js +8 -0
- package/dist/Components/Alert/Alert.js +5 -0
- package/dist/Components/Alert/Alert.vue.d.ts +11 -0
- package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +43 -0
- package/dist/Components/Alert/alert.types.d.ts +134 -0
- package/dist/Components/Alert/alertDefaultIcons.d.ts +4 -0
- package/dist/Components/Alert/alertDefaultIcons.js +13 -0
- package/dist/Components/Alert/composables/useAlert.d.ts +18 -0
- package/dist/Components/Alert/composables/useAlert.js +71 -0
- package/dist/Components/Alert/index.d.ts +3 -0
- package/dist/Components/Alert/index.js +3 -0
- package/dist/Components/Avatar/Avatar.js +5 -0
- package/dist/Components/Avatar/Avatar.vue.d.ts +11 -0
- package/dist/Components/Avatar/Avatar.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Avatar/avatar.types.d.ts +81 -0
- package/dist/Components/Avatar/composables/useAvatar.d.ts +23 -0
- package/dist/Components/Avatar/composables/useAvatar.js +73 -0
- package/dist/Components/Avatar/index.d.ts +3 -0
- package/dist/Components/Avatar/index.js +3 -0
- package/dist/Components/Badge/Badge.js +5 -0
- package/dist/Components/Badge/Badge.vue.d.ts +4 -0
- package/dist/Components/Badge/Badge.vue_vue_type_script_setup_true_lang.js +29 -0
- package/dist/Components/Badge/badge.types.d.ts +64 -0
- package/dist/Components/Badge/composables/useBadge.d.ts +9 -0
- package/dist/Components/Badge/composables/useBadge.js +47 -0
- package/dist/Components/Badge/index.d.ts +3 -0
- package/dist/Components/Badge/index.js +3 -0
- package/dist/Components/Button/Button.js +5 -0
- package/dist/Components/Button/Button.vue.d.ts +11 -0
- package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/Components/Button/button.types.d.ts +181 -0
- package/dist/Components/Button/composables/useButton.d.ts +22 -0
- package/dist/Components/Button/composables/useButton.js +91 -0
- package/dist/Components/Button/index.d.ts +3 -0
- package/dist/Components/Button/index.js +3 -0
- package/dist/Components/Card/Card.js +5 -0
- package/dist/Components/Card/Card.vue.d.ts +11 -0
- package/dist/Components/Card/Card.vue_vue_type_script_setup_true_lang.js +33 -0
- package/dist/Components/Card/card.types.d.ts +124 -0
- package/dist/Components/Card/composables/useCard.d.ts +18 -0
- package/dist/Components/Card/composables/useCard.js +80 -0
- package/dist/Components/Card/index.d.ts +3 -0
- package/dist/Components/Card/index.js +3 -0
- package/dist/Components/Checkbox/Checkbox.js +5 -0
- package/dist/Components/Checkbox/Checkbox.vue.d.ts +20 -0
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +70 -0
- package/dist/Components/Checkbox/checkbox.types.d.ts +98 -0
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +279 -0
- package/dist/Components/Checkbox/composables/useCheckbox.js +76 -0
- package/dist/Components/Checkbox/index.d.ts +3 -0
- package/dist/Components/Checkbox/index.js +3 -0
- package/dist/Components/FormControl/FormControl.js +5 -0
- package/dist/Components/FormControl/FormControl.vue.d.ts +17 -0
- package/dist/Components/FormControl/FormControl.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/FormControl/composables/useFormControl.d.ts +45 -0
- package/dist/Components/FormControl/composables/useFormControl.js +110 -0
- package/dist/Components/FormControl/formControl.types.d.ts +198 -0
- package/dist/Components/FormControl/index.d.ts +4 -0
- package/dist/Components/FormControl/index.js +3 -0
- package/dist/Components/FormField/FilledFormField.js +5 -0
- package/dist/Components/FormField/FilledFormField.vue.d.ts +17 -0
- package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/Components/FormField/FormField.js +5 -0
- package/dist/Components/FormField/FormField.vue.d.ts +15 -0
- package/dist/Components/FormField/FormField.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/Components/FormField/NotchedFormField.js +5 -0
- package/dist/Components/FormField/NotchedFormField.vue.d.ts +17 -0
- package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/Components/FormField/OutlinedFormField.js +5 -0
- package/dist/Components/FormField/OutlinedFormField.vue.d.ts +17 -0
- package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/Components/FormField/StackedFormField.js +5 -0
- package/dist/Components/FormField/StackedFormField.vue.d.ts +17 -0
- package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +42 -0
- package/dist/Components/FormField/UnderlinedFormField.js +5 -0
- package/dist/Components/FormField/UnderlinedFormField.vue.d.ts +17 -0
- package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/Components/FormField/composables/useFormField.d.ts +474 -0
- package/dist/Components/FormField/composables/useFormField.js +219 -0
- package/dist/Components/FormField/formField.types.d.ts +294 -0
- package/dist/Components/FormField/index.d.ts +4 -0
- package/dist/Components/FormField/index.js +3 -0
- package/dist/Components/Icon/Icon.js +5 -0
- package/dist/Components/Icon/Icon.vue.d.ts +4 -0
- package/dist/Components/Icon/Icon.vue_vue_type_script_setup_true_lang.js +17 -0
- package/dist/Components/Icon/composables/useIcon.d.ts +9 -0
- package/dist/Components/Icon/composables/useIcon.js +26 -0
- package/dist/Components/Icon/icon.types.d.ts +17 -0
- package/dist/Components/Icon/index.d.ts +3 -0
- package/dist/Components/Icon/index.js +3 -0
- package/dist/Components/Label/Label.js +5 -0
- package/dist/Components/Label/Label.vue.d.ts +4 -0
- package/dist/Components/Label/Label.vue_vue_type_script_setup_true_lang.js +21 -0
- package/dist/Components/Label/composables/useLabel.d.ts +10 -0
- package/dist/Components/Label/composables/useLabel.js +44 -0
- package/dist/Components/Label/index.d.ts +3 -0
- package/dist/Components/Label/index.js +3 -0
- package/dist/Components/Label/label.types.d.ts +52 -0
- package/dist/Components/Link/Link.js +5 -0
- package/dist/Components/Link/Link.vue.d.ts +11 -0
- package/dist/Components/Link/Link.vue_vue_type_script_setup_true_lang.js +52 -0
- package/dist/Components/Link/composables/useLink.d.ts +18 -0
- package/dist/Components/Link/composables/useLink.js +66 -0
- package/dist/Components/Link/index.d.ts +3 -0
- package/dist/Components/Link/index.js +3 -0
- package/dist/Components/Link/link.types.d.ts +113 -0
- package/dist/Components/List/List.js +5 -0
- package/dist/Components/List/List.vue.d.ts +9 -0
- package/dist/Components/List/List.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/Components/List/composables/useList.d.ts +11 -0
- package/dist/Components/List/composables/useList.js +44 -0
- package/dist/Components/List/index.d.ts +5 -0
- package/dist/Components/List/index.js +4 -0
- package/dist/Components/List/list.types.d.ts +57 -0
- package/dist/Components/List/listInjectionKey.d.ts +5 -0
- package/dist/Components/List/listInjectionKey.js +4 -0
- package/dist/Components/ListItem/ListItem.js +5 -0
- package/dist/Components/ListItem/ListItem.vue.d.ts +19 -0
- package/dist/Components/ListItem/ListItem.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/Components/ListItem/composables/useListItem.d.ts +40 -0
- package/dist/Components/ListItem/composables/useListItem.js +104 -0
- package/dist/Components/ListItem/index.d.ts +3 -0
- package/dist/Components/ListItem/index.js +3 -0
- package/dist/Components/ListItem/listItem.types.d.ts +164 -0
- package/dist/Components/ListSection/ListSection.js +5 -0
- package/dist/Components/ListSection/ListSection.vue.d.ts +15 -0
- package/dist/Components/ListSection/ListSection.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/Components/ListSection/composables/useListSection.d.ts +13 -0
- package/dist/Components/ListSection/composables/useListSection.js +51 -0
- package/dist/Components/ListSection/index.d.ts +3 -0
- package/dist/Components/ListSection/index.js +3 -0
- package/dist/Components/ListSection/listSection.types.d.ts +71 -0
- package/dist/Components/Listbox/Listbox.js +5 -0
- package/dist/Components/Listbox/Listbox.vue.d.ts +34 -0
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +157 -0
- package/dist/Components/Listbox/composables/useListbox.d.ts +13 -0
- package/dist/Components/Listbox/composables/useListbox.js +47 -0
- package/dist/Components/Listbox/composables/useListboxNavigation.d.ts +16 -0
- package/dist/Components/Listbox/composables/useListboxNavigation.js +62 -0
- package/dist/Components/Listbox/index.d.ts +4 -0
- package/dist/Components/Listbox/index.js +4 -0
- package/dist/Components/Listbox/listbox.types.d.ts +170 -0
- package/dist/Components/Menu/Menu.js +5 -0
- package/dist/Components/Menu/Menu.vue.d.ts +36 -0
- package/dist/Components/Menu/Menu.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/Components/Menu/composables/useMenu.d.ts +54 -0
- package/dist/Components/Menu/composables/useMenu.js +217 -0
- package/dist/Components/Menu/index.d.ts +4 -0
- package/dist/Components/Menu/index.js +3 -0
- package/dist/Components/Menu/menu.types.d.ts +172 -0
- package/dist/Components/Modal/Modal.js +5 -0
- package/dist/Components/Modal/Modal.vue.d.ts +38 -0
- package/dist/Components/Modal/Modal.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/Components/Modal/composables/useModal.d.ts +61 -0
- package/dist/Components/Modal/composables/useModal.js +191 -0
- package/dist/Components/Modal/index.d.ts +4 -0
- package/dist/Components/Modal/index.js +3 -0
- package/dist/Components/Modal/modal.types.d.ts +177 -0
- package/dist/Components/NumberField/NumberField.js +5 -0
- package/dist/Components/NumberField/NumberField.vue.d.ts +24 -0
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +83 -0
- package/dist/Components/NumberField/composables/useNumberField.d.ts +696 -0
- package/dist/Components/NumberField/composables/useNumberField.js +64 -0
- package/dist/Components/NumberField/index.d.ts +4 -0
- package/dist/Components/NumberField/index.js +3 -0
- package/dist/Components/NumberField/numberField.types.d.ts +52 -0
- package/dist/Components/PasswordField/PasswordField.js +5 -0
- package/dist/Components/PasswordField/PasswordField.vue.d.ts +24 -0
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +691 -0
- package/dist/Components/PasswordField/composables/usePasswordField.js +40 -0
- package/dist/Components/PasswordField/index.d.ts +4 -0
- package/dist/Components/PasswordField/index.js +3 -0
- package/dist/Components/PasswordField/passwordField.types.d.ts +34 -0
- package/dist/Components/Radio/Radio.js +5 -0
- package/dist/Components/Radio/Radio.vue.d.ts +20 -0
- package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/Components/Radio/composables/useRadio.d.ts +278 -0
- package/dist/Components/Radio/composables/useRadio.js +78 -0
- package/dist/Components/Radio/index.d.ts +3 -0
- package/dist/Components/Radio/index.js +3 -0
- package/dist/Components/Radio/radio.types.d.ts +104 -0
- package/dist/Components/Select/Select.js +5 -0
- package/dist/Components/Select/Select.vue.d.ts +40 -0
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +191 -0
- package/dist/Components/Select/SelectOption.js +5 -0
- package/dist/Components/Select/SelectOption.vue.d.ts +4 -0
- package/dist/Components/Select/SelectOption.vue_vue_type_script_setup_true_lang.js +30 -0
- package/dist/Components/Select/composables/useSelect.d.ts +733 -0
- package/dist/Components/Select/composables/useSelect.js +305 -0
- package/dist/Components/Select/index.d.ts +4 -0
- package/dist/Components/Select/index.js +4 -0
- package/dist/Components/Select/select.types.d.ts +231 -0
- package/dist/Components/Select/selectInjectionKey.d.ts +7 -0
- package/dist/Components/Select/selectInjectionKey.js +4 -0
- package/dist/Components/Snackbar/Snackbar.js +5 -0
- package/dist/Components/Snackbar/Snackbar.vue.d.ts +32 -0
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +156 -0
- package/dist/Components/Snackbar/composables/useSnackbar.d.ts +248 -0
- package/dist/Components/Snackbar/composables/useSnackbar.js +210 -0
- package/dist/Components/Snackbar/index.d.ts +4 -0
- package/dist/Components/Snackbar/index.js +3 -0
- package/dist/Components/Snackbar/snackbar.types.d.ts +214 -0
- package/dist/Components/Snackbar/snackbarDefaultIcons.d.ts +4 -0
- package/dist/Components/Snackbar/snackbarDefaultIcons.js +13 -0
- package/dist/Components/Switch/Switch.js +5 -0
- package/dist/Components/Switch/Switch.vue.d.ts +20 -0
- package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/Components/Switch/composables/useSwitch.d.ts +278 -0
- package/dist/Components/Switch/composables/useSwitch.js +73 -0
- package/dist/Components/Switch/index.d.ts +3 -0
- package/dist/Components/Switch/index.js +3 -0
- package/dist/Components/Switch/switch.types.d.ts +92 -0
- package/dist/Components/TextField/TextField.js +5 -0
- package/dist/Components/TextField/TextField.vue.d.ts +22 -0
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/Components/TextField/composables/useTextField.d.ts +680 -0
- package/dist/Components/TextField/composables/useTextField.js +21 -0
- package/dist/Components/TextField/index.d.ts +3 -0
- package/dist/Components/TextField/index.js +3 -0
- package/dist/Components/TextField/textField.types.d.ts +15 -0
- package/dist/Components/Textarea/Textarea.js +5 -0
- package/dist/Components/Textarea/Textarea.vue.d.ts +22 -0
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +57 -0
- package/dist/Components/Textarea/composables/useTextarea.d.ts +685 -0
- package/dist/Components/Textarea/composables/useTextarea.js +72 -0
- package/dist/Components/Textarea/index.d.ts +3 -0
- package/dist/Components/Textarea/index.js +3 -0
- package/dist/Components/Textarea/textarea.types.d.ts +34 -0
- package/dist/Provider/BridgeUIProvider.js +5 -0
- package/dist/Provider/BridgeUIProvider.vue.d.ts +18 -0
- package/dist/Provider/BridgeUIProvider.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/Provider/bridgeUITypes.d.ts +8 -0
- package/dist/Provider/createBridgeUI.d.ts +3 -0
- package/dist/Provider/createBridgeUI.js +15 -0
- package/dist/Provider/createBridgeUIApi.d.ts +7 -0
- package/dist/Provider/createBridgeUIApi.js +36 -0
- package/dist/Provider/index.d.ts +5 -0
- package/dist/Provider/index.js +4 -0
- package/dist/Provider/injectionKey.d.ts +3 -0
- package/dist/Provider/injectionKey.js +4 -0
- package/dist/Provider/useBridgeUI.d.ts +2 -0
- package/dist/Provider/useBridgeUI.js +8 -0
- package/dist/Utils/index.d.ts +47 -0
- package/dist/Utils/index.js +55 -0
- package/dist/Utils/slotOrProp.d.ts +28 -0
- package/dist/Utils/slotOrProp.js +23 -0
- package/dist/Utils/useHoldRepeat.d.ts +13 -0
- package/dist/Utils/useHoldRepeat.js +38 -0
- package/dist/augments.d.ts +113 -0
- package/dist/index.d.ts +54 -0
- package/dist/index.js +53 -0
- package/dist/theme.css +205 -0
- package/package.json +90 -0
|
@@ -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/Modal/createBridgeModalApi.ts
|
|
4
|
+
function u(t, n) {
|
|
5
|
+
return a(t, {
|
|
6
|
+
modal: n.modal,
|
|
7
|
+
props: n.props,
|
|
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 createBridgeModalApi };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { BridgeModalApi, BridgeModalController, BridgeModalEntry, BridgeModalHostProps, BridgeModalOpenOptions, BridgeModalShellProps, BridgeModalUpdateOptions, } from './bridgeModal.types';
|
|
2
|
+
export { default as BridgeModalHost } from './BridgeModalHost.vue';
|
|
3
|
+
export { BridgeModalHostMissingError, useModalAction, } from './useModalAction';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BRIDGE_MODAL_INJECTION_KEY as e } from "./bridgeModalInjectionKey.js";
|
|
2
|
+
import { computed as t, inject as n } from "vue";
|
|
3
|
+
import { getLayerCount as r } from "@bridge-ui/core";
|
|
4
|
+
//#region src/Actions/Modal/useModalAction.ts
|
|
5
|
+
var i = class extends Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("useModalAction() requires <BridgeModalHost /> in the app tree."), this.name = "BridgeModalHostMissingError";
|
|
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 BridgeModalHostMissingError, a as useModalAction };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BridgeSnackbarActionProps } from './bridgeSnackbar.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<BridgeSnackbarActionProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
+
run: () => any;
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<BridgeSnackbarActionProps> & Readonly<{
|
|
5
|
+
onRun?: (() => any) | undefined;
|
|
6
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
7
|
+
declare const _default: typeof __VLS_export;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import e from "../../Components/Button/Button.js";
|
|
2
|
+
import t from "../../Components/Link/Link.js";
|
|
3
|
+
import { computed as n, createBlock as r, createTextVNode as i, defineComponent as a, mergeProps as o, openBlock as s, toDisplayString as c, unref as l, withCtx as u } from "vue";
|
|
4
|
+
import { get as d } from "es-toolkit/compat";
|
|
5
|
+
import { cn as f, snackbarRoundedProps as p } from "@bridge-ui/core";
|
|
6
|
+
//#region src/Actions/Snackbar/BridgeSnackbarAction.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var m = /* @__PURE__ */ a({
|
|
8
|
+
__name: "BridgeSnackbarAction",
|
|
9
|
+
props: {
|
|
10
|
+
action: {},
|
|
11
|
+
hasAccept: { type: Boolean },
|
|
12
|
+
hasReject: { type: Boolean },
|
|
13
|
+
layout: {},
|
|
14
|
+
role: {},
|
|
15
|
+
snackbarColor: {},
|
|
16
|
+
snackbarRounded: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["run"],
|
|
19
|
+
setup(a, { emit: m }) {
|
|
20
|
+
let h = a, g = m, _ = n(() => h.role === "accept" ? h.snackbarColor : "secondary"), v = n(() => _.value), y = n(() => {
|
|
21
|
+
if (!h.action.link) return {};
|
|
22
|
+
let { onClick: e, ...t } = h.action.link;
|
|
23
|
+
return t;
|
|
24
|
+
}), b = n(() => {
|
|
25
|
+
let e = d(p, h.snackbarRounded ?? "lg"), t = d(e, "tr"), n = d(e, "br");
|
|
26
|
+
return d({
|
|
27
|
+
trailing: "mr-4 shrink-0",
|
|
28
|
+
"right-accept": f({
|
|
29
|
+
"w-full rounded-none": !0,
|
|
30
|
+
[t ?? ""]: !0,
|
|
31
|
+
[n ?? ""]: !h.hasReject
|
|
32
|
+
}),
|
|
33
|
+
"right-reject": f({
|
|
34
|
+
"w-full rounded-none": !0,
|
|
35
|
+
[n ?? ""]: !0,
|
|
36
|
+
[t ?? ""]: !h.hasAccept
|
|
37
|
+
})
|
|
38
|
+
}, h.layout, "");
|
|
39
|
+
}), x = n(() => f({
|
|
40
|
+
[b.value]: !0,
|
|
41
|
+
[h.action.className ?? ""]: !0,
|
|
42
|
+
"w-full": h.layout === "right-accept" || h.layout === "right-reject"
|
|
43
|
+
}));
|
|
44
|
+
function S() {
|
|
45
|
+
g("run");
|
|
46
|
+
}
|
|
47
|
+
function C(e) {
|
|
48
|
+
e.preventDefault(), h.action.link?.onClick?.(e), S();
|
|
49
|
+
}
|
|
50
|
+
return (n, d) => a.action.link ? (s(), r(l(t), o({
|
|
51
|
+
key: 0,
|
|
52
|
+
size: "sm",
|
|
53
|
+
underline: "hover",
|
|
54
|
+
color: v.value
|
|
55
|
+
}, y.value, {
|
|
56
|
+
onClick: C,
|
|
57
|
+
classes: {
|
|
58
|
+
...a.action.link.classes,
|
|
59
|
+
root: l(f)(x.value, a.action.link.classes?.root)
|
|
60
|
+
}
|
|
61
|
+
}), {
|
|
62
|
+
default: u(() => [i(c(a.action.label), 1)]),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 16, ["color", "classes"])) : (s(), r(l(e), o({
|
|
65
|
+
key: 1,
|
|
66
|
+
size: "sm",
|
|
67
|
+
onClick: S,
|
|
68
|
+
color: _.value
|
|
69
|
+
}, a.action.button, {
|
|
70
|
+
variant: a.action.solid ? "outline" : "flat",
|
|
71
|
+
classes: {
|
|
72
|
+
...a.action.button?.classes,
|
|
73
|
+
root: l(f)(x.value, a.action.button?.classes?.root)
|
|
74
|
+
}
|
|
75
|
+
}), {
|
|
76
|
+
default: u(() => [i(c(a.action.label), 1)]),
|
|
77
|
+
_: 1
|
|
78
|
+
}, 16, [
|
|
79
|
+
"color",
|
|
80
|
+
"variant",
|
|
81
|
+
"classes"
|
|
82
|
+
]));
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
//#endregion
|
|
86
|
+
export { m as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BridgeSnackbarHostProps } from './bridgeSnackbar.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<BridgeSnackbarHostProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BridgeSnackbarHostProps> & Readonly<{}>, {
|
|
7
|
+
teleportTo: false | string;
|
|
8
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
13
|
+
new (): {
|
|
14
|
+
$slots: S;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { useBridgeUI as e } from "../../Provider/useBridgeUI.js";
|
|
2
|
+
import { BRIDGE_SNACKBAR_INJECTION_KEY as t } from "./bridgeSnackbarInjectionKey.js";
|
|
3
|
+
import n from "./BridgeSnackbarItem.js";
|
|
4
|
+
import { createBridgeSnackbarApi as r } from "./createBridgeSnackbarApi.js";
|
|
5
|
+
import { Fragment as i, Teleport as a, computed as o, createBlock as s, createElementBlock as c, createElementVNode as l, defineComponent as u, inject as d, normalizeClass as f, openBlock as p, provide as m, renderList as h, renderSlot as g, unref as _ } from "vue";
|
|
6
|
+
import { get as v } from "es-toolkit/compat";
|
|
7
|
+
import { cn as y, mergeBridgeUILayeredClasses as b, snackbarPositionProps as x } from "@bridge-ui/core";
|
|
8
|
+
//#region src/Actions/Snackbar/BridgeSnackbarHost.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
+
var S = "[Bridge UI] Nested <BridgeSnackbarHost /> detected. useSnackbarAction() will target the nearest host only. Remove the extra host.", C = /* @__PURE__ */ u({
|
|
10
|
+
__name: "BridgeSnackbarHost",
|
|
11
|
+
props: {
|
|
12
|
+
max: {},
|
|
13
|
+
position: {},
|
|
14
|
+
snackbar: {},
|
|
15
|
+
teleportTo: {
|
|
16
|
+
type: [Boolean, String],
|
|
17
|
+
default: "body"
|
|
18
|
+
},
|
|
19
|
+
timeout: { type: [Boolean, Number] }
|
|
20
|
+
},
|
|
21
|
+
setup(u) {
|
|
22
|
+
let C = u;
|
|
23
|
+
d(t, null) && process.env.NODE_ENV !== "production" && console.warn(S);
|
|
24
|
+
let w = r({
|
|
25
|
+
max: C.max,
|
|
26
|
+
timeout: C.timeout
|
|
27
|
+
}), T = e();
|
|
28
|
+
m(t, w);
|
|
29
|
+
let E = o(() => w.entries.value), D = o(() => T?.components.value.Snackbar), O = o(() => C.position ?? D.value?.defaultProps?.position ?? "bottom-center"), k = o(() => v(b(x, D.value?.customProps?.position), O.value)), A = o(() => C.teleportTo === !1), j = o(() => C.teleportTo === !1 ? "body" : C.teleportTo), M = o(() => O.value.startsWith("top") ? "flex-col" : "flex-col-reverse");
|
|
30
|
+
return (e, t) => (p(), c(i, null, [g(e.$slots, "default"), (p(), s(a, {
|
|
31
|
+
to: j.value,
|
|
32
|
+
disabled: A.value
|
|
33
|
+
}, [l("div", {
|
|
34
|
+
"data-snackbar-host": "",
|
|
35
|
+
class: f(_(y)({
|
|
36
|
+
"fixed inset-0 z-40 flex pointer-events-none px-4 py-6 sm:p-5 sm:pt-4": !0,
|
|
37
|
+
[k.value ?? ""]: !0
|
|
38
|
+
}))
|
|
39
|
+
}, [l("div", { class: f(_(y)({
|
|
40
|
+
"flex w-full max-w-sm gap-y-2 pointer-events-auto": !0,
|
|
41
|
+
[M.value]: !0
|
|
42
|
+
})) }, [(p(!0), c(i, null, h(E.value, (e) => (p(), s(n, {
|
|
43
|
+
api: _(w),
|
|
44
|
+
entry: e,
|
|
45
|
+
key: e.id,
|
|
46
|
+
"host-snackbar": C.snackbar
|
|
47
|
+
}, null, 8, [
|
|
48
|
+
"api",
|
|
49
|
+
"entry",
|
|
50
|
+
"host-snackbar"
|
|
51
|
+
]))), 128))], 2)], 2)], 8, ["to", "disabled"]))], 64));
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//#endregion
|
|
55
|
+
export { C as default };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { BridgeSnackbarItemProps } from './bridgeSnackbar.types';
|
|
2
|
+
declare const __VLS_export: import('vue').DefineComponent<BridgeSnackbarItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BridgeSnackbarItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import e from "../../Components/Snackbar/Snackbar.js";
|
|
2
|
+
import t from "./BridgeSnackbarAction.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createVNode as c, defineComponent as l, mergeProps as u, normalizeClass as d, openBlock as f, unref as p, withCtx as m } from "vue";
|
|
4
|
+
import { completeLayerHide as h, invokeLayerDismiss as g, mergeLayerShellProps as _, usesTrailingSnackbarActions as v } from "@bridge-ui/core";
|
|
5
|
+
//#region src/Actions/Snackbar/BridgeSnackbarItem.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var y = { class: "flex flex-col border-l border-dark-200 dark:border-dark-700" }, b = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "flex flex-1 h-0"
|
|
9
|
+
}, x = /* @__PURE__ */ l({
|
|
10
|
+
__name: "BridgeSnackbarItem",
|
|
11
|
+
props: {
|
|
12
|
+
api: {},
|
|
13
|
+
entry: {},
|
|
14
|
+
hostSnackbar: {}
|
|
15
|
+
},
|
|
16
|
+
setup(l) {
|
|
17
|
+
let x = l, { actions: S, rightButtons: C, ...w } = x.entry.props, T = n(() => _(x.hostSnackbar, w)), E = n(() => T.value.color ?? "primary"), D = n(() => T.value.rounded ?? "lg"), O = () => {
|
|
18
|
+
g(x.api.entries.value, x.entry.id);
|
|
19
|
+
};
|
|
20
|
+
function k(e) {
|
|
21
|
+
e?.(), x.api.close(x.entry.id);
|
|
22
|
+
}
|
|
23
|
+
let A = n(() => !!(C && (S?.accept || S?.reject))), j = n(() => v(T.value.padding)), M = n(() => !C && !j.value && !!(S?.accept || S?.reject)), N = n(() => !!(j.value && S?.accept?.label));
|
|
24
|
+
return (n, g) => (f(), r(p(e), u({
|
|
25
|
+
"stack-id": l.entry.id,
|
|
26
|
+
"teleport-to": !1
|
|
27
|
+
}, T.value, {
|
|
28
|
+
"model-value": l.entry.show,
|
|
29
|
+
onClose: O,
|
|
30
|
+
"onUpdate:modelValue": g[5] ||= (e) => l.api.syncShow(l.entry.id, e),
|
|
31
|
+
onLeaveComplete: g[6] ||= () => p(h)(l.api.entries.value, l.entry.id, !1, l.api.removeEntry),
|
|
32
|
+
onShowChange: g[7] ||= (e) => p(h)(l.api.entries.value, l.entry.id, e, l.api.removeEntry)
|
|
33
|
+
}), s({ _: 2 }, [
|
|
34
|
+
M.value ? {
|
|
35
|
+
name: "actions",
|
|
36
|
+
fn: m(() => [p(S)?.accept?.label ? (f(), r(t, {
|
|
37
|
+
key: 0,
|
|
38
|
+
role: "accept",
|
|
39
|
+
layout: "inline",
|
|
40
|
+
action: p(S).accept,
|
|
41
|
+
"snackbar-color": E.value,
|
|
42
|
+
"snackbar-rounded": D.value,
|
|
43
|
+
onRun: g[0] ||= (e) => k(p(S)?.accept?.onClick)
|
|
44
|
+
}, null, 8, [
|
|
45
|
+
"action",
|
|
46
|
+
"snackbar-color",
|
|
47
|
+
"snackbar-rounded"
|
|
48
|
+
])) : i("", !0), p(S)?.reject?.label ? (f(), r(t, {
|
|
49
|
+
key: 1,
|
|
50
|
+
role: "reject",
|
|
51
|
+
layout: "inline",
|
|
52
|
+
action: p(S).reject,
|
|
53
|
+
"snackbar-color": E.value,
|
|
54
|
+
"snackbar-rounded": D.value,
|
|
55
|
+
onRun: g[1] ||= (e) => k(p(S)?.reject?.onClick)
|
|
56
|
+
}, null, 8, [
|
|
57
|
+
"action",
|
|
58
|
+
"snackbar-color",
|
|
59
|
+
"snackbar-rounded"
|
|
60
|
+
])) : i("", !0)]),
|
|
61
|
+
key: "0"
|
|
62
|
+
} : void 0,
|
|
63
|
+
N.value ? {
|
|
64
|
+
name: "trailing",
|
|
65
|
+
fn: m(() => [c(t, {
|
|
66
|
+
role: "accept",
|
|
67
|
+
layout: "trailing",
|
|
68
|
+
action: p(S).accept,
|
|
69
|
+
"snackbar-color": E.value,
|
|
70
|
+
"snackbar-rounded": D.value,
|
|
71
|
+
onRun: g[2] ||= (e) => k(p(S)?.accept?.onClick)
|
|
72
|
+
}, null, 8, [
|
|
73
|
+
"action",
|
|
74
|
+
"snackbar-color",
|
|
75
|
+
"snackbar-rounded"
|
|
76
|
+
])]),
|
|
77
|
+
key: "1"
|
|
78
|
+
} : void 0,
|
|
79
|
+
A.value ? {
|
|
80
|
+
name: "right",
|
|
81
|
+
fn: m(() => [o("div", y, [p(S)?.accept?.label ? (f(), a("div", {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: d(["flex flex-1 h-0", { "border-b border-dark-200 dark:border-dark-700": p(S)?.reject }])
|
|
84
|
+
}, [c(t, {
|
|
85
|
+
role: "accept",
|
|
86
|
+
layout: "right-accept",
|
|
87
|
+
action: p(S).accept,
|
|
88
|
+
"snackbar-color": E.value,
|
|
89
|
+
"snackbar-rounded": D.value,
|
|
90
|
+
"has-reject": !!p(S)?.reject,
|
|
91
|
+
onRun: g[3] ||= (e) => k(p(S)?.accept?.onClick)
|
|
92
|
+
}, null, 8, [
|
|
93
|
+
"action",
|
|
94
|
+
"snackbar-color",
|
|
95
|
+
"snackbar-rounded",
|
|
96
|
+
"has-reject"
|
|
97
|
+
])], 2)) : i("", !0), p(S)?.reject?.label ? (f(), a("div", b, [c(t, {
|
|
98
|
+
role: "reject",
|
|
99
|
+
layout: "right-reject",
|
|
100
|
+
action: p(S).reject,
|
|
101
|
+
"snackbar-color": E.value,
|
|
102
|
+
"snackbar-rounded": D.value,
|
|
103
|
+
"has-accept": !!p(S)?.accept,
|
|
104
|
+
onRun: g[4] ||= (e) => k(p(S)?.reject?.onClick)
|
|
105
|
+
}, null, 8, [
|
|
106
|
+
"action",
|
|
107
|
+
"snackbar-color",
|
|
108
|
+
"snackbar-rounded",
|
|
109
|
+
"has-accept"
|
|
110
|
+
])])) : i("", !0)])]),
|
|
111
|
+
key: "2"
|
|
112
|
+
} : void 0
|
|
113
|
+
]), 1040, ["stack-id", "model-value"]));
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
//#endregion
|
|
117
|
+
export { x as default };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { LayerId, SnackbarColor, SnackbarRounded, snackbarPositionProps } from '@bridge-ui/core';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
import { ButtonOwnProps } from '../../Components/Button/button.types';
|
|
4
|
+
import { LinkProps } from '../../Components/Link/link.types';
|
|
5
|
+
import { SnackbarOwnProps } from '../../Components/Snackbar/snackbar.types';
|
|
6
|
+
export interface SnackbarAction {
|
|
7
|
+
/**
|
|
8
|
+
* Props merged into the default `Button` (ignored when `link` is set).
|
|
9
|
+
*/
|
|
10
|
+
button?: Partial<Omit<ButtonOwnProps, "children">>;
|
|
11
|
+
/**
|
|
12
|
+
* Extra Tailwind classes for the action control (`classes.root`).
|
|
13
|
+
*/
|
|
14
|
+
className?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Button label.
|
|
17
|
+
*/
|
|
18
|
+
label: string;
|
|
19
|
+
/**
|
|
20
|
+
* When set, renders a `Link` instead of a `Button`.
|
|
21
|
+
*/
|
|
22
|
+
link?: Partial<Omit<LinkProps, "children">>;
|
|
23
|
+
/**
|
|
24
|
+
* Called when the action is clicked.
|
|
25
|
+
*/
|
|
26
|
+
onClick?: () => void;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the action renders as a solid bordered button.
|
|
29
|
+
*/
|
|
30
|
+
solid?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface SnackbarActions {
|
|
33
|
+
/**
|
|
34
|
+
* Primary action (e.g. Undo, Confirm). Uses the snackbar `color` by default.
|
|
35
|
+
*/
|
|
36
|
+
accept?: SnackbarAction;
|
|
37
|
+
/**
|
|
38
|
+
* Secondary action (e.g. Dismiss, Cancel). Uses `secondary` by default.
|
|
39
|
+
*/
|
|
40
|
+
reject?: SnackbarAction;
|
|
41
|
+
}
|
|
42
|
+
export type BridgeSnackbarShellProps = Partial<Omit<SnackbarOwnProps, "stackId">>;
|
|
43
|
+
export type SnackbarActionLayout = "inline" | "trailing" | "right-accept" | "right-reject";
|
|
44
|
+
export type SnackbarActionColor = keyof SnackbarColor;
|
|
45
|
+
export type SnackbarActionRounded = keyof SnackbarRounded;
|
|
46
|
+
export type BridgeSnackbarActionProps = {
|
|
47
|
+
action: SnackbarAction;
|
|
48
|
+
hasAccept?: boolean;
|
|
49
|
+
hasReject?: boolean;
|
|
50
|
+
layout: SnackbarActionLayout;
|
|
51
|
+
role: "accept" | "reject";
|
|
52
|
+
snackbarColor: SnackbarActionColor;
|
|
53
|
+
snackbarRounded?: SnackbarActionRounded;
|
|
54
|
+
};
|
|
55
|
+
export type BridgeSnackbarHostProps = {
|
|
56
|
+
/**
|
|
57
|
+
* Maximum open snackbars. When exceeded, the oldest closes before opening the new one.
|
|
58
|
+
*/
|
|
59
|
+
max?: number;
|
|
60
|
+
/**
|
|
61
|
+
* Notification stack position on the viewport.
|
|
62
|
+
*
|
|
63
|
+
* @default "bottom-center"
|
|
64
|
+
*/
|
|
65
|
+
position?: keyof typeof snackbarPositionProps;
|
|
66
|
+
/**
|
|
67
|
+
* Default shell options merged into every snackbar opened via `useSnackbarAction()`.
|
|
68
|
+
* Per-call `open()` options override these.
|
|
69
|
+
*/
|
|
70
|
+
snackbar?: BridgeSnackbarShellProps;
|
|
71
|
+
/**
|
|
72
|
+
* Portal target for the notification stack. `false` renders inline.
|
|
73
|
+
*
|
|
74
|
+
* @default "body"
|
|
75
|
+
*/
|
|
76
|
+
teleportTo?: false | string;
|
|
77
|
+
/**
|
|
78
|
+
* Default auto-dismiss delay (ms). `false` keeps snackbars open until dismissed.
|
|
79
|
+
* Per-call `open({ duration })` overrides this.
|
|
80
|
+
*/
|
|
81
|
+
timeout?: false | number;
|
|
82
|
+
};
|
|
83
|
+
export type BridgeSnackbarItemProps = {
|
|
84
|
+
api: BridgeSnackbarController;
|
|
85
|
+
entry: BridgeSnackbarEntry;
|
|
86
|
+
hostSnackbar?: BridgeSnackbarShellProps;
|
|
87
|
+
};
|
|
88
|
+
export type BridgeSnackbarContentProps = BridgeSnackbarShellProps & {
|
|
89
|
+
/**
|
|
90
|
+
* Preset inline or trailing actions (mapped to slots by the host).
|
|
91
|
+
*/
|
|
92
|
+
actions?: SnackbarActions;
|
|
93
|
+
/**
|
|
94
|
+
* Renders `actions` as a vertical column on the right edge.
|
|
95
|
+
*
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
rightButtons?: boolean;
|
|
99
|
+
};
|
|
100
|
+
export type BridgeSnackbarEntry = {
|
|
101
|
+
id: LayerId;
|
|
102
|
+
onClose?: () => void;
|
|
103
|
+
onClosed?: () => void;
|
|
104
|
+
props: BridgeSnackbarContentProps;
|
|
105
|
+
show: boolean;
|
|
106
|
+
};
|
|
107
|
+
export type BridgeSnackbarOpenOptions = BridgeSnackbarContentProps & {
|
|
108
|
+
onClose?: () => void;
|
|
109
|
+
onClosed?: () => void;
|
|
110
|
+
};
|
|
111
|
+
export type BridgeSnackbarUpdateOptions = {
|
|
112
|
+
props?: Partial<BridgeSnackbarContentProps>;
|
|
113
|
+
};
|
|
114
|
+
export type BridgeSnackbarController = {
|
|
115
|
+
close: (id: LayerId) => void;
|
|
116
|
+
closeAll: () => void;
|
|
117
|
+
closeTop: () => void;
|
|
118
|
+
entries: Ref<BridgeSnackbarEntry[]>;
|
|
119
|
+
isOpen: (id: LayerId) => boolean;
|
|
120
|
+
open: (options: BridgeSnackbarOpenOptions) => LayerId;
|
|
121
|
+
removeEntry: (id: LayerId) => void;
|
|
122
|
+
syncShow: (id: LayerId, show: boolean) => void;
|
|
123
|
+
update: (id: LayerId, options: BridgeSnackbarUpdateOptions) => void;
|
|
124
|
+
};
|
|
125
|
+
export type BridgeSnackbarApi = Omit<BridgeSnackbarController, "entries" | "syncShow" | "removeEntry"> & {
|
|
126
|
+
stackSize: number;
|
|
127
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BridgeSnackbarController } from './bridgeSnackbar.types';
|
|
2
|
+
export type BridgeSnackbarApiOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Maximum number of visible snackbars. When exceeded, the oldest closes before opening the new one.
|
|
5
|
+
*/
|
|
6
|
+
max?: number;
|
|
7
|
+
/**
|
|
8
|
+
* Default auto-dismiss delay (ms) for `open()`. `false` keeps snackbars open until dismissed.
|
|
9
|
+
*
|
|
10
|
+
* @default 5000
|
|
11
|
+
*/
|
|
12
|
+
timeout?: false | number;
|
|
13
|
+
};
|
|
14
|
+
export declare function createBridgeSnackbarApi(options?: BridgeSnackbarApiOptions): BridgeSnackbarController;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { shallowRef as e } from "vue";
|
|
2
|
+
import { isNil as t } from "es-toolkit/compat";
|
|
3
|
+
import { closeAllLayers as n, closeLayer as r, closeTopLayer as i, createLayerId as a, createOpenLayerEntry as o, isLayerMounted as s, removeLayer as c, syncLayerShow as l, trimLayersToMax as u, updateLayerMerged as d } from "@bridge-ui/core";
|
|
4
|
+
//#region src/Actions/Snackbar/createBridgeSnackbarApi.ts
|
|
5
|
+
function f(e, t) {
|
|
6
|
+
let { onClose: n, onClosed: r, ...i } = t;
|
|
7
|
+
return o(e, {
|
|
8
|
+
props: i,
|
|
9
|
+
onClose: n,
|
|
10
|
+
onClosed: r
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function p(e, n) {
|
|
14
|
+
return !t(e.duration) || t(n) ? e : {
|
|
15
|
+
...e,
|
|
16
|
+
duration: n
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function m(t = {}) {
|
|
20
|
+
let { max: o, timeout: m = 5e3 } = t, h = e([]);
|
|
21
|
+
function g(e) {
|
|
22
|
+
let t = a(), n = h.value;
|
|
23
|
+
return o != null && o > 0 && (n = u(n, o)), h.value = [...n, f(t, p(e, m))], t;
|
|
24
|
+
}
|
|
25
|
+
function _(e) {
|
|
26
|
+
h.value = r(h.value, e);
|
|
27
|
+
}
|
|
28
|
+
function v() {
|
|
29
|
+
h.value = i(h.value);
|
|
30
|
+
}
|
|
31
|
+
function y() {
|
|
32
|
+
h.value = n(h.value);
|
|
33
|
+
}
|
|
34
|
+
function b(e) {
|
|
35
|
+
return s(h.value, e);
|
|
36
|
+
}
|
|
37
|
+
function x(e) {
|
|
38
|
+
h.value = c(h.value, e);
|
|
39
|
+
}
|
|
40
|
+
function S(e, t) {
|
|
41
|
+
h.value = d(h.value, e, t, ["props"]);
|
|
42
|
+
}
|
|
43
|
+
function C(e, t) {
|
|
44
|
+
h.value = l(h.value, e, t);
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
open: g,
|
|
48
|
+
close: _,
|
|
49
|
+
isOpen: b,
|
|
50
|
+
update: S,
|
|
51
|
+
entries: h,
|
|
52
|
+
closeTop: v,
|
|
53
|
+
closeAll: y,
|
|
54
|
+
syncShow: C,
|
|
55
|
+
removeEntry: x
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { m as createBridgeSnackbarApi };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { BridgeSnackbarActionProps, BridgeSnackbarApi, BridgeSnackbarContentProps, BridgeSnackbarEntry, BridgeSnackbarHostProps, BridgeSnackbarItemProps, BridgeSnackbarOpenOptions, BridgeSnackbarShellProps, BridgeSnackbarUpdateOptions, SnackbarAction, SnackbarActionColor, SnackbarActionLayout, SnackbarActions, } from './bridgeSnackbar.types';
|
|
2
|
+
export { default as BridgeSnackbarHost } from './BridgeSnackbarHost.vue';
|
|
3
|
+
export { BridgeSnackbarHostMissingError, useSnackbarAction, } from './useSnackbarAction';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BRIDGE_SNACKBAR_INJECTION_KEY as e } from "./bridgeSnackbarInjectionKey.js";
|
|
2
|
+
import { computed as t, inject as n } from "vue";
|
|
3
|
+
import { getLayerCount as r } from "@bridge-ui/core";
|
|
4
|
+
//#region src/Actions/Snackbar/useSnackbarAction.ts
|
|
5
|
+
var i = class extends Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super("useSnackbarAction() requires <BridgeSnackbarHost /> in the app tree."), this.name = "BridgeSnackbarHostMissingError";
|
|
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
|
+
closeAll: a.closeAll,
|
|
21
|
+
get stackSize() {
|
|
22
|
+
return o.value;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { i as BridgeSnackbarHostMissingError, a as useSnackbarAction };
|