buefy 3.0.2 → 3.0.3
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/buefy.d.ts +19 -4
- package/dist/buefy.esm.js +40 -11
- package/dist/buefy.esm.min.js +2 -2
- package/dist/buefy.js +45 -9
- package/dist/buefy.min.js +2 -2
- package/dist/cjs/autocomplete.js +1 -1
- package/dist/cjs/breadcrumb.js +1 -1
- package/dist/cjs/button.js +1 -1
- package/dist/cjs/carousel.js +1 -1
- package/dist/cjs/checkbox.js +1 -1
- package/dist/cjs/clockpicker.js +1 -1
- package/dist/cjs/collapse.js +1 -1
- package/dist/cjs/colorpicker.js +2 -2
- package/dist/cjs/config.js +7 -1
- package/dist/cjs/datepicker.js +1 -1
- package/dist/cjs/datetimepicker.js +1 -1
- package/dist/cjs/dialog.js +7 -2
- package/dist/cjs/dropdown.js +1 -1
- package/dist/cjs/field.js +1 -1
- package/dist/cjs/icon.js +1 -1
- package/dist/cjs/image.js +1 -1
- package/dist/cjs/{index-DiQy3SCb.js → index-SLOXD6k3.js} +1 -1
- package/dist/cjs/index.js +10 -3
- package/dist/cjs/input.js +1 -1
- package/dist/cjs/loading.js +7 -2
- package/dist/cjs/menu.js +1 -1
- package/dist/cjs/message.js +1 -1
- package/dist/cjs/modal.js +7 -2
- package/dist/cjs/navbar.js +1 -1
- package/dist/cjs/notification.js +7 -2
- package/dist/cjs/numberinput.js +1 -1
- package/dist/cjs/pagination.js +1 -1
- package/dist/cjs/{plugins-DbyYGVpp.js → plugins-BWKpXmCr.js} +2 -1
- package/dist/cjs/progress.js +1 -1
- package/dist/cjs/radio.js +1 -1
- package/dist/cjs/rate.js +1 -1
- package/dist/cjs/select.js +1 -1
- package/dist/cjs/sidebar.js +1 -1
- package/dist/cjs/skeleton.js +1 -1
- package/dist/cjs/slider.js +1 -1
- package/dist/cjs/snackbar.js +7 -2
- package/dist/cjs/steps.js +1 -1
- package/dist/cjs/switch.js +1 -1
- package/dist/cjs/table.js +1 -1
- package/dist/cjs/tabs.js +1 -1
- package/dist/cjs/tag.js +1 -1
- package/dist/cjs/taginput.js +1 -1
- package/dist/cjs/timepicker.js +1 -1
- package/dist/cjs/toast.js +7 -2
- package/dist/cjs/tooltip.js +1 -1
- package/dist/cjs/upload.js +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/autocomplete/index.min.js +1 -1
- package/dist/components/breadcrumb/index.js +1 -1
- package/dist/components/breadcrumb/index.min.js +1 -1
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.min.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/carousel/index.min.js +1 -1
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.min.js +1 -1
- package/dist/components/clockpicker/index.js +1 -1
- package/dist/components/clockpicker/index.min.js +1 -1
- package/dist/components/collapse/index.js +1 -1
- package/dist/components/collapse/index.min.js +1 -1
- package/dist/components/colorpicker/index.js +1 -1
- package/dist/components/colorpicker/index.min.js +1 -1
- package/dist/components/datepicker/index.js +1 -1
- package/dist/components/datepicker/index.min.js +1 -1
- package/dist/components/datetimepicker/index.js +1 -1
- package/dist/components/datetimepicker/index.min.js +1 -1
- package/dist/components/dialog/index.js +9 -3
- package/dist/components/dialog/index.min.js +2 -2
- package/dist/components/dropdown/index.js +1 -1
- package/dist/components/dropdown/index.min.js +1 -1
- package/dist/components/field/index.js +1 -1
- package/dist/components/field/index.min.js +1 -1
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon/index.min.js +1 -1
- package/dist/components/image/index.js +1 -1
- package/dist/components/image/index.min.js +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.min.js +1 -1
- package/dist/components/loading/index.js +9 -3
- package/dist/components/loading/index.min.js +2 -2
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.min.js +1 -1
- package/dist/components/message/index.js +1 -1
- package/dist/components/message/index.min.js +1 -1
- package/dist/components/modal/index.js +9 -3
- package/dist/components/modal/index.min.js +2 -2
- package/dist/components/navbar/index.js +1 -1
- package/dist/components/navbar/index.min.js +1 -1
- package/dist/components/notification/index.js +9 -3
- package/dist/components/notification/index.min.js +2 -2
- package/dist/components/numberinput/index.js +1 -1
- package/dist/components/numberinput/index.min.js +1 -1
- package/dist/components/pagination/index.js +1 -1
- package/dist/components/pagination/index.min.js +1 -1
- package/dist/components/progress/index.js +1 -1
- package/dist/components/progress/index.min.js +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.min.js +1 -1
- package/dist/components/rate/index.js +1 -1
- package/dist/components/rate/index.min.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/index.min.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/index.min.js +1 -1
- package/dist/components/skeleton/index.js +1 -1
- package/dist/components/skeleton/index.min.js +1 -1
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.min.js +1 -1
- package/dist/components/snackbar/index.js +9 -3
- package/dist/components/snackbar/index.min.js +2 -2
- package/dist/components/steps/index.js +1 -1
- package/dist/components/steps/index.min.js +1 -1
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.min.js +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/table/index.min.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.min.js +1 -1
- package/dist/components/tag/index.js +1 -1
- package/dist/components/tag/index.min.js +1 -1
- package/dist/components/taginput/index.js +1 -1
- package/dist/components/taginput/index.min.js +1 -1
- package/dist/components/timepicker/index.js +1 -1
- package/dist/components/timepicker/index.min.js +1 -1
- package/dist/components/toast/index.js +9 -3
- package/dist/components/toast/index.min.js +2 -2
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.min.js +1 -1
- package/dist/components/upload/index.js +1 -1
- package/dist/components/upload/index.min.js +1 -1
- package/dist/css/buefy.css +4 -5
- package/dist/css/buefy.css.map +1 -1
- package/dist/css/buefy.min.css +1 -1
- package/dist/css/versions/buefy-no-reset.css +4 -5
- package/dist/css/versions/buefy-no-reset.css.map +1 -1
- package/dist/css/versions/buefy-no-reset.min.css +1 -1
- package/dist/css/versions/buefy-standalone.css +4 -5
- package/dist/css/versions/buefy-standalone.css.map +1 -1
- package/dist/css/versions/buefy-standalone.min.css +1 -1
- package/dist/esm/autocomplete.js +1 -1
- package/dist/esm/breadcrumb.js +1 -1
- package/dist/esm/button.js +1 -1
- package/dist/esm/carousel.js +1 -1
- package/dist/esm/checkbox.js +1 -1
- package/dist/esm/clockpicker.js +1 -1
- package/dist/esm/collapse.js +1 -1
- package/dist/esm/colorpicker.js +2 -2
- package/dist/esm/config.js +6 -2
- package/dist/esm/datepicker.js +1 -1
- package/dist/esm/datetimepicker.js +1 -1
- package/dist/esm/dialog.js +8 -4
- package/dist/esm/dropdown.js +1 -1
- package/dist/esm/field.js +1 -1
- package/dist/esm/icon.js +1 -1
- package/dist/esm/image.js +1 -1
- package/dist/esm/{index-CQegEsxK.js → index-BE58-KfV.js} +1 -1
- package/dist/esm/index.js +12 -11
- package/dist/esm/input.js +1 -1
- package/dist/esm/loading.js +8 -4
- package/dist/esm/menu.js +1 -1
- package/dist/esm/message.js +1 -1
- package/dist/esm/modal.js +8 -4
- package/dist/esm/navbar.js +1 -1
- package/dist/esm/notification.js +8 -4
- package/dist/esm/numberinput.js +1 -1
- package/dist/esm/pagination.js +1 -1
- package/dist/esm/{plugins-B172kuKE.js → plugins-1tLsuIZF.js} +2 -1
- package/dist/esm/progress.js +1 -1
- package/dist/esm/radio.js +1 -1
- package/dist/esm/rate.js +1 -1
- package/dist/esm/select.js +1 -1
- package/dist/esm/sidebar.js +1 -1
- package/dist/esm/skeleton.js +1 -1
- package/dist/esm/slider.js +1 -1
- package/dist/esm/snackbar.js +8 -4
- package/dist/esm/steps.js +1 -1
- package/dist/esm/switch.js +1 -1
- package/dist/esm/table.js +1 -1
- package/dist/esm/tabs.js +1 -1
- package/dist/esm/tag.js +1 -1
- package/dist/esm/taginput.js +1 -1
- package/dist/esm/timepicker.js +1 -1
- package/dist/esm/toast.js +8 -4
- package/dist/esm/tooltip.js +1 -1
- package/dist/esm/upload.js +1 -1
- package/package.json +2 -3
- package/src/components/dialog/index.ts +9 -3
- package/src/components/loading/index.ts +9 -3
- package/src/components/modal/index.ts +9 -3
- package/src/components/notification/index.ts +9 -3
- package/src/components/snackbar/index.ts +9 -3
- package/src/components/toast/index.ts +9 -3
- package/src/index.ts +9 -9
- package/src/scss/buefy.scss +0 -1
- package/src/scss/components/_dropdown.scss +6 -6
- package/src/utils/ConfigComponent.ts +13 -1
- package/src/utils/plugins.ts +3 -2
package/dist/esm/toast.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent, createBlock, openBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, renderSlot, createElementBlock, Fragment, createCommentVNode, vShow, createApp, h } from 'vue';
|
|
1
|
+
import { defineComponent, createBlock, openBlock, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, renderSlot, createElementBlock, Fragment, createCommentVNode, vShow, createApp, h, inject } from 'vue';
|
|
2
2
|
import { c as config } from './config-CKuo-p6e.js';
|
|
3
3
|
import { N as NoticeMixin } from './NoticeMixin-ByNlva3T.js';
|
|
4
4
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-OJRSZE6i.js';
|
|
5
5
|
import { getComponentFromVNode, copyAppContext } from './helpers.js';
|
|
6
|
-
import { r as registerComponentProgrammatic } from './plugins-
|
|
6
|
+
import { r as registerComponentProgrammatic } from './plugins-1tLsuIZF.js';
|
|
7
7
|
|
|
8
8
|
const Toast$1 = defineComponent({
|
|
9
9
|
name: "BToast",
|
|
@@ -147,10 +147,14 @@ class ToastProgrammatic {
|
|
|
147
147
|
return vueInstance.mount(container);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
+
const toastInjectionKey = Symbol("Buefy Toast");
|
|
151
|
+
function useToast() {
|
|
152
|
+
return inject(toastInjectionKey);
|
|
153
|
+
}
|
|
150
154
|
const Plugin = {
|
|
151
155
|
install(Vue) {
|
|
152
|
-
registerComponentProgrammatic(Vue, "toast", new ToastProgrammatic(Vue));
|
|
156
|
+
registerComponentProgrammatic(Vue, "toast", new ToastProgrammatic(Vue), toastInjectionKey);
|
|
153
157
|
}
|
|
154
158
|
};
|
|
155
159
|
|
|
156
|
-
export { Toast as BToast, ToastProgrammatic, Plugin as default };
|
|
160
|
+
export { Toast as BToast, ToastProgrammatic, Plugin as default, useToast };
|
package/dist/esm/tooltip.js
CHANGED
package/dist/esm/upload.js
CHANGED
|
@@ -3,7 +3,7 @@ import { C as CompatFallthroughMixin } from './CompatFallthroughMixin-C8LPuwDr.j
|
|
|
3
3
|
import { F as FormElementMixin } from './FormElementMixin-Dd_wkBN5.js';
|
|
4
4
|
import { F as File } from './ssr-C7yEpGLm.js';
|
|
5
5
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-OJRSZE6i.js';
|
|
6
|
-
import { a as registerComponent } from './plugins-
|
|
6
|
+
import { a as registerComponent } from './plugins-1tLsuIZF.js';
|
|
7
7
|
import './config-CKuo-p6e.js';
|
|
8
8
|
|
|
9
9
|
const Upload$1 = defineComponent({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "buefy",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Lightweight UI components for Vue.js (v3) based on Bulma",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuejs",
|
|
@@ -53,7 +53,6 @@
|
|
|
53
53
|
"build:scss-buefy": "sass --load-path=../../node_modules --load-path=node_modules src/scss/versions/buefy-bulma-bundle.scss dist/css/buefy.css && node ./build/banner.js < dist/css/buefy.css > dist/css/buefy.banner.css && mv dist/css/buefy.banner.css dist/css/buefy.css && cleancss -o dist/css/buefy.min.css dist/css/buefy.css",
|
|
54
54
|
"build:scss-buefy-standalone": "sass --load-path=../../node_modules --load-path=node_modules src/scss/buefy.scss dist/css/versions/buefy-standalone.css && node ./build/banner.js < dist/css/versions/buefy-standalone.css > dist/css/buefy.banner.css && mv dist/css/buefy.banner.css dist/css/versions/buefy-standalone.css && cleancss -o dist/css/versions/buefy-standalone.min.css dist/css/versions/buefy-standalone.css",
|
|
55
55
|
"build:scss-no-reset": "sass --load-path=../../node_modules --load-path=node_modules src/scss/versions/buefy-no-reset.scss dist/css/versions/buefy-no-reset.css && node ./build/banner.js < dist/css/versions/buefy-no-reset.css > dist/css/buefy.banner.css && mv dist/css/buefy.banner.css dist/css/versions/buefy-no-reset.css && cleancss -o dist/css/versions/buefy-no-reset.min.css dist/css/versions/buefy-no-reset.css",
|
|
56
|
-
|
|
57
56
|
"vetur": "node -r esm build/vetur.js"
|
|
58
57
|
},
|
|
59
58
|
"dependencies": {
|
|
@@ -81,4 +80,4 @@
|
|
|
81
80
|
"rollup-plugin-esbuild": "^6.1.0",
|
|
82
81
|
"vitest": "^3.0.6"
|
|
83
82
|
}
|
|
84
|
-
}
|
|
83
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createApp, h as createElement } from 'vue'
|
|
2
|
-
import type { App, ComponentPublicInstance } from 'vue'
|
|
1
|
+
import { createApp, h as createElement, inject } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance, InjectionKey } from 'vue'
|
|
3
3
|
|
|
4
4
|
import Dialog from './Dialog.vue'
|
|
5
5
|
import type { DialogProps } from './Dialog.vue'
|
|
@@ -154,10 +154,16 @@ class DialogProgrammatic {
|
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
+
const dialogInjectionKey = Symbol('Buefy Dialog') as InjectionKey<DialogProgrammatic>
|
|
158
|
+
|
|
159
|
+
export function useDialog() {
|
|
160
|
+
return inject(dialogInjectionKey)!
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
const Plugin = {
|
|
158
164
|
install(Vue: App) {
|
|
159
165
|
registerComponent(Vue, Dialog)
|
|
160
|
-
registerComponentProgrammatic(Vue, 'dialog', new DialogProgrammatic(Vue))
|
|
166
|
+
registerComponentProgrammatic(Vue, 'dialog', new DialogProgrammatic(Vue), dialogInjectionKey)
|
|
161
167
|
}
|
|
162
168
|
}
|
|
163
169
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createApp, h as createElement } from 'vue'
|
|
2
|
-
import type { App, ComponentPublicInstance } from 'vue'
|
|
1
|
+
import { createApp, h as createElement, inject } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance, InjectionKey } from 'vue'
|
|
3
3
|
|
|
4
4
|
import Loading from './Loading.vue'
|
|
5
5
|
import type { LoadingProps } from './Loading.vue'
|
|
@@ -76,10 +76,16 @@ class LoadingProgrammatic {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
const loadingInjectionKey = Symbol('Buefy Loading') as InjectionKey<LoadingProgrammatic>
|
|
80
|
+
|
|
81
|
+
export function useLoading() {
|
|
82
|
+
return inject(loadingInjectionKey)!
|
|
83
|
+
}
|
|
84
|
+
|
|
79
85
|
const Plugin = {
|
|
80
86
|
install(Vue: App) {
|
|
81
87
|
registerComponent(Vue, Loading)
|
|
82
|
-
registerComponentProgrammatic(Vue, 'loading', new LoadingProgrammatic(Vue))
|
|
88
|
+
registerComponentProgrammatic(Vue, 'loading', new LoadingProgrammatic(Vue), loadingInjectionKey)
|
|
83
89
|
}
|
|
84
90
|
}
|
|
85
91
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createApp, h as createElement } from 'vue'
|
|
2
|
-
import type { App, ComponentPublicInstance } from 'vue'
|
|
1
|
+
import { createApp, h as createElement, inject } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance, InjectionKey } from 'vue'
|
|
3
3
|
|
|
4
4
|
import Modal from './Modal.vue'
|
|
5
5
|
import type { ModalProps } from './Modal.vue'
|
|
@@ -92,10 +92,16 @@ class ModalProgrammatic {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
+
const modalInjectionKey = Symbol('Buefy Modal') as InjectionKey<ModalProgrammatic>
|
|
96
|
+
|
|
97
|
+
export function useModal() {
|
|
98
|
+
return inject(modalInjectionKey)!
|
|
99
|
+
}
|
|
100
|
+
|
|
95
101
|
const Plugin = {
|
|
96
102
|
install(Vue: App) {
|
|
97
103
|
registerComponent(Vue, Modal)
|
|
98
|
-
registerComponentProgrammatic(Vue, 'modal', new ModalProgrammatic(Vue))
|
|
104
|
+
registerComponentProgrammatic(Vue, 'modal', new ModalProgrammatic(Vue), modalInjectionKey)
|
|
99
105
|
}
|
|
100
106
|
}
|
|
101
107
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createApp, h as createElement } from 'vue'
|
|
2
|
-
import type { App, ComponentPublicInstance, VNode } from 'vue'
|
|
1
|
+
import { createApp, h as createElement, inject } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance, VNode, InjectionKey } from 'vue'
|
|
3
3
|
|
|
4
4
|
import Notification from './Notification.vue'
|
|
5
5
|
import type { NotificationProps } from './Notification.vue'
|
|
@@ -106,10 +106,16 @@ class NotificationProgrammatic {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
const notificationInjectionKey = Symbol('Buefy Notification') as InjectionKey<NotificationProgrammatic>
|
|
110
|
+
|
|
111
|
+
export function useNotification() {
|
|
112
|
+
return inject(notificationInjectionKey)!
|
|
113
|
+
}
|
|
114
|
+
|
|
109
115
|
const Plugin = {
|
|
110
116
|
install(Vue: App) {
|
|
111
117
|
registerComponent(Vue, Notification)
|
|
112
|
-
registerComponentProgrammatic(Vue, 'notification', new NotificationProgrammatic(Vue))
|
|
118
|
+
registerComponentProgrammatic(Vue, 'notification', new NotificationProgrammatic(Vue), notificationInjectionKey)
|
|
113
119
|
}
|
|
114
120
|
}
|
|
115
121
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createApp, h as createElement } from 'vue'
|
|
2
|
-
import type { App, ComponentPublicInstance, VNode } from 'vue'
|
|
1
|
+
import { createApp, h as createElement, inject } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance, VNode, InjectionKey } from 'vue'
|
|
3
3
|
|
|
4
4
|
import Snackbar from './Snackbar.vue'
|
|
5
5
|
import type { SnackbarProps } from './Snackbar.vue'
|
|
@@ -104,9 +104,15 @@ class SnackbarProgrammatic {
|
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
const snackbarInjectionKey = Symbol('Buefy Snackbar') as InjectionKey<SnackbarProgrammatic>
|
|
108
|
+
|
|
109
|
+
export function useSnackbar() {
|
|
110
|
+
return inject(snackbarInjectionKey)!
|
|
111
|
+
}
|
|
112
|
+
|
|
107
113
|
const Plugin = {
|
|
108
114
|
install(Vue: App) {
|
|
109
|
-
registerComponentProgrammatic(Vue, 'snackbar', new SnackbarProgrammatic(Vue))
|
|
115
|
+
registerComponentProgrammatic(Vue, 'snackbar', new SnackbarProgrammatic(Vue), snackbarInjectionKey)
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createApp, h as createElement } from 'vue'
|
|
2
|
-
import type { App, ComponentPublicInstance, VNode } from 'vue'
|
|
1
|
+
import { createApp, h as createElement, inject } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance, VNode, InjectionKey } from 'vue'
|
|
3
3
|
|
|
4
4
|
import Toast from './Toast.vue'
|
|
5
5
|
import type { ToastProps } from './Toast.vue'
|
|
@@ -106,9 +106,15 @@ class ToastProgrammatic {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
const toastInjectionKey = Symbol('Buefy Toast') as InjectionKey<ToastProgrammatic>
|
|
110
|
+
|
|
111
|
+
export function useToast() {
|
|
112
|
+
return inject(toastInjectionKey)!
|
|
113
|
+
}
|
|
114
|
+
|
|
109
115
|
const Plugin = {
|
|
110
116
|
install(Vue: App) {
|
|
111
|
-
registerComponentProgrammatic(Vue, 'toast', new ToastProgrammatic(Vue))
|
|
117
|
+
registerComponentProgrammatic(Vue, 'toast', new ToastProgrammatic(Vue), toastInjectionKey)
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ import config, { setOptions, setVueInstance } from './utils/config'
|
|
|
8
8
|
import type { BuefyConfig, BuefyConfigOptions } from './utils/config'
|
|
9
9
|
import { registerComponentProgrammatic } from './utils/plugins'
|
|
10
10
|
|
|
11
|
-
import ConfigComponent from './utils/ConfigComponent'
|
|
11
|
+
import ConfigComponent, { configInjectionKey } from './utils/ConfigComponent'
|
|
12
12
|
|
|
13
13
|
const Buefy = {
|
|
14
14
|
install(Vue: App, options: BuefyConfigOptions = {}) {
|
|
@@ -18,7 +18,7 @@ const Buefy = {
|
|
|
18
18
|
// Components
|
|
19
19
|
allComponents.forEach((component) => Vue.use(component))
|
|
20
20
|
// Config component
|
|
21
|
-
registerComponentProgrammatic(Vue, 'config', ConfigComponent)
|
|
21
|
+
registerComponentProgrammatic(Vue, 'config', ConfigComponent, configInjectionKey)
|
|
22
22
|
|
|
23
23
|
Vue.config.globalProperties.$buefy.globalNoticeInterval = undefined
|
|
24
24
|
}
|
|
@@ -29,13 +29,13 @@ export default Buefy
|
|
|
29
29
|
// export all components as vue plugin
|
|
30
30
|
export * from './components'
|
|
31
31
|
// export programmatic component
|
|
32
|
-
export { DialogProgrammatic } from './components/dialog'
|
|
33
|
-
export { LoadingProgrammatic } from './components/loading'
|
|
34
|
-
export { ModalProgrammatic } from './components/modal'
|
|
35
|
-
export { NotificationProgrammatic } from './components/notification'
|
|
36
|
-
export { SnackbarProgrammatic } from './components/snackbar'
|
|
37
|
-
export { ToastProgrammatic } from './components/toast'
|
|
38
|
-
export { default as ConfigProgrammatic } from './utils/ConfigComponent'
|
|
32
|
+
export { DialogProgrammatic, useDialog } from './components/dialog'
|
|
33
|
+
export { LoadingProgrammatic, useLoading } from './components/loading'
|
|
34
|
+
export { ModalProgrammatic, useModal } from './components/modal'
|
|
35
|
+
export { NotificationProgrammatic, useNotification } from './components/notification'
|
|
36
|
+
export { SnackbarProgrammatic, useSnackbar } from './components/snackbar'
|
|
37
|
+
export { ToastProgrammatic, useToast } from './components/toast'
|
|
38
|
+
export { default as ConfigProgrammatic, useConfigComponent } from './utils/ConfigComponent'
|
|
39
39
|
export { default as Color } from './utils/color'
|
|
40
40
|
// export helpers
|
|
41
41
|
export * from './utils/helpers'
|
package/src/scss/buefy.scss
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
@use "bulma/sass/utilities/extends" as extends;
|
|
3
3
|
@use "bulma/sass/utilities/css-variables" as cv;
|
|
4
4
|
@use "bulma/sass/utilities/initial-variables" as iv;
|
|
5
|
+
@use "bulma/sass/utilities/derived-variables.scss" as dv;
|
|
5
6
|
@use "bulma/sass/utilities/mixins" as mixins;
|
|
6
7
|
|
|
7
|
-
$dropdown-mobile-breakpoint:
|
|
8
|
-
$dropdown-background-color: rgba(
|
|
8
|
+
$dropdown-mobile-breakpoint: calc(iv.$desktop - 1px) !default;
|
|
9
|
+
$dropdown-background-color: rgba(dv.$scheme-invert, 0.86) !default;
|
|
9
10
|
$dropdown-disabled-opacity: 0.5 !default;
|
|
10
11
|
|
|
11
12
|
.#{iv.$class-prefix}dropdown {
|
|
12
13
|
@include cv.register-vars(
|
|
13
14
|
(
|
|
14
|
-
"dropdown-mobile-breakpoint": #{$dropdown-mobile-breakpoint},
|
|
15
15
|
"dropdown-background-color": #{$dropdown-background-color},
|
|
16
16
|
"dropdown-disabled-opacity": #{$dropdown-disabled-opacity}
|
|
17
17
|
)
|
|
@@ -25,10 +25,10 @@ $dropdown-disabled-opacity: 0.5 !default;
|
|
|
25
25
|
.background {
|
|
26
26
|
@extend %overlay;
|
|
27
27
|
position: fixed;
|
|
28
|
-
background-color: cv.getVar('dropdown-background-color');
|
|
28
|
+
background-color: #{cv.getVar('dropdown-background-color')};
|
|
29
29
|
z-index: 10;
|
|
30
30
|
cursor: pointer;
|
|
31
|
-
@media screen and (min-width:
|
|
31
|
+
@media screen and (min-width: $dropdown-mobile-breakpoint) {
|
|
32
32
|
display: none;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -132,7 +132,7 @@ $dropdown-disabled-opacity: 0.5 !default;
|
|
|
132
132
|
left: auto;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
@media screen and (max-width:
|
|
135
|
+
@media screen and (max-width: $dropdown-mobile-breakpoint) {
|
|
136
136
|
/* prevents modal on hover unless it is on touch devices */
|
|
137
137
|
&.is-mobile-modal:not(.is-hoverable),
|
|
138
138
|
&.is-mobile-modal.is-touch-enabled {
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import config, { setOptions } from './config'
|
|
2
2
|
import type { BuefyConfigOptions } from './config'
|
|
3
3
|
import { merge } from './helpers'
|
|
4
|
+
import { inject, type InjectionKey } from 'vue'
|
|
5
|
+
|
|
6
|
+
interface ConfigComponent {
|
|
7
|
+
getOptions(): BuefyConfigOptions,
|
|
8
|
+
setOptions(options: BuefyConfigOptions): void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const configInjectionKey = Symbol('Buefy Config Component') as InjectionKey<ConfigComponent>
|
|
12
|
+
|
|
13
|
+
export function useConfigComponent() {
|
|
14
|
+
return inject(configInjectionKey)
|
|
15
|
+
}
|
|
4
16
|
|
|
5
17
|
export default {
|
|
6
18
|
getOptions() {
|
|
@@ -9,4 +21,4 @@ export default {
|
|
|
9
21
|
setOptions(options: BuefyConfigOptions) {
|
|
10
22
|
setOptions(merge(config, options, true))
|
|
11
23
|
}
|
|
12
|
-
}
|
|
24
|
+
} as ConfigComponent
|
package/src/utils/plugins.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { App, Component } from 'vue'
|
|
1
|
+
import type { App, Component, InjectionKey } from 'vue'
|
|
2
2
|
|
|
3
3
|
// use `name` to register a Functional Component which will become unresolvable
|
|
4
4
|
// in production build due to name mangling.
|
|
@@ -13,8 +13,9 @@ export const registerComponent = (Vue: App, component: Component, name?: string)
|
|
|
13
13
|
export const registerComponentProgrammatic = <
|
|
14
14
|
K extends keyof App['config']['globalProperties']['$buefy'],
|
|
15
15
|
C extends App['config']['globalProperties']['$buefy'][K]
|
|
16
|
-
>(Vue: App, property: K, component: C) => {
|
|
16
|
+
>(Vue: App, property: K, component: C, injectionKey: InjectionKey<C>) => {
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
18
|
if (!Vue.config.globalProperties.$buefy) Vue.config.globalProperties.$buefy = {} as any
|
|
19
19
|
Vue.config.globalProperties.$buefy[property] = component
|
|
20
|
+
Vue.provide(injectionKey, component)
|
|
20
21
|
}
|