buefy 3.0.1 → 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/README.md +2 -2
- package/dist/buefy.d.ts +20 -5
- package/dist/buefy.esm.js +49 -19
- package/dist/buefy.esm.min.js +2 -2
- package/dist/buefy.js +54 -17
- 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 +10 -9
- 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 +10 -9
- package/dist/components/table/index.min.js +2 -2
- 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/{buefy.css → css/buefy.css} +4 -4
- package/dist/css/buefy.css.map +1 -0
- package/dist/css/buefy.min.css +1 -0
- package/dist/css/versions/buefy-no-reset.css +25930 -0
- package/dist/css/versions/buefy-no-reset.css.map +1 -0
- package/dist/css/versions/buefy-no-reset.min.css +1 -0
- package/dist/css/versions/buefy-standalone.css +5874 -0
- package/dist/css/versions/buefy-standalone.css.map +1 -0
- package/dist/css/versions/buefy-standalone.min.css +1 -0
- 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 +11 -10
- 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 +6 -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/table/Table.vue +18 -12
- 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/scss/{buefy-build.scss → versions/buefy-bulma-bundle.scss} +1 -1
- package/src/scss/versions/buefy-no-reset.scss +16 -0
- package/src/utils/ConfigComponent.ts +13 -1
- package/src/utils/plugins.ts +3 -2
- package/src/utils/vue-augmentation.ts +1 -1
- package/dist/buefy.css.map +0 -1
- package/dist/buefy.min.css +0 -1
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",
|
|
@@ -49,7 +49,10 @@
|
|
|
49
49
|
"build": "rimraf dist && npm run build:js && npm run build:scss && npm run build:dts",
|
|
50
50
|
"build:js": "rollup -c && rollup -c --environment MINIFY",
|
|
51
51
|
"build:dts": "rimraf temp-dts && vue-tsc -b tsconfig.types.json --force && api-extractor run --local && node build/augment-dts.mjs",
|
|
52
|
-
"build:scss": "
|
|
52
|
+
"build:scss": "npm run build:scss-buefy && npm run build:scss-buefy-standalone && npm run build:scss-no-reset",
|
|
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
|
+
"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
|
+
"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",
|
|
53
56
|
"vetur": "node -r esm build/vetur.js"
|
|
54
57
|
},
|
|
55
58
|
"dependencies": {
|
|
@@ -77,4 +80,4 @@
|
|
|
77
80
|
"rollup-plugin-esbuild": "^6.1.0",
|
|
78
81
|
"vitest": "^3.0.6"
|
|
79
82
|
}
|
|
80
|
-
}
|
|
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
|
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
</template>
|
|
442
442
|
|
|
443
443
|
<script lang="ts">
|
|
444
|
-
import { defineComponent, toRaw } from 'vue'
|
|
444
|
+
import { camelize, defineComponent, toHandlerKey, toRaw } from 'vue'
|
|
445
445
|
import type { PropType } from 'vue'
|
|
446
446
|
|
|
447
447
|
import type { VueClassAttribute } from '../../utils/config'
|
|
@@ -1506,19 +1506,25 @@ export default defineComponent({
|
|
|
1506
1506
|
this.$emit('dragleave', { event, row, index })
|
|
1507
1507
|
},
|
|
1508
1508
|
|
|
1509
|
-
//
|
|
1510
|
-
//
|
|
1511
|
-
//
|
|
1512
|
-
// some performance issues
|
|
1513
|
-
//
|
|
1514
|
-
//
|
|
1515
|
-
//
|
|
1509
|
+
// this method is for "mouseenter", and "mouseleave" events.
|
|
1510
|
+
// the original idea of this method was introduced by the PR
|
|
1511
|
+
// https://github.com/buefy/buefy/pull/2150
|
|
1512
|
+
// to address some performance issues related to these events.
|
|
1513
|
+
// I am not sure whether the justification made at the PR is still
|
|
1514
|
+
// relevant to Vue 3.
|
|
1515
|
+
// btw, this function was made by the PR https://github.com/buefy/buefy/pull/3236
|
|
1516
1516
|
emitEventForRow(eventName: string, event: Event, row: TableRow) {
|
|
1517
|
-
// eventName should not be in `emits` because it
|
|
1517
|
+
// eventName should not be in `emits` because it won't be included
|
|
1518
1518
|
// in `$attrs` if it is listed in `emits`.
|
|
1519
|
-
//
|
|
1520
|
-
//
|
|
1521
|
-
|
|
1519
|
+
// less known `toHandlerKey` helps us to make a proper name for the
|
|
1520
|
+
// listener. the following code also supports camelCase event names
|
|
1521
|
+
// but may be too much for our use case.
|
|
1522
|
+
// reference: https://github.com/vuejs/core/blob/a48ffdad65d9c97eb0a342a6cd53836a16289afe/packages/runtime-core/src/componentEmits.ts#L194-L197
|
|
1523
|
+
const listener =
|
|
1524
|
+
this.$attrs[toHandlerKey(eventName)] ||
|
|
1525
|
+
this.$attrs[toHandlerKey(camelize(eventName))]
|
|
1526
|
+
// @ts-expect-error $emit expects a name in the `emits` list
|
|
1527
|
+
return listener != null ? this.$emit(eventName, row, event) : null
|
|
1522
1528
|
},
|
|
1523
1529
|
|
|
1524
1530
|
/*
|
|
@@ -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 {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@charset "utf-8";
|
|
2
|
+
|
|
3
|
+
/* Custom Bulma Imports Without Minirest */
|
|
4
|
+
@forward "bulma/sass/utilities";
|
|
5
|
+
@forward "bulma/sass/themes";
|
|
6
|
+
@forward "bulma/sass/base/generic";
|
|
7
|
+
@forward "bulma/sass/base/animations";
|
|
8
|
+
@forward "bulma/sass/elements";
|
|
9
|
+
@forward "bulma/sass/form";
|
|
10
|
+
@forward "bulma/sass/components";
|
|
11
|
+
@forward "bulma/sass/grid";
|
|
12
|
+
@forward "bulma/sass/layout";
|
|
13
|
+
@forward "bulma/sass/base/skeleton";
|
|
14
|
+
@forward "bulma/sass/helpers";
|
|
15
|
+
|
|
16
|
+
@use "../buefy";
|
|
@@ -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
|
}
|
|
@@ -17,7 +17,7 @@ import ConfigComponent from './ConfigComponent'
|
|
|
17
17
|
|
|
18
18
|
// Augments the global property with `$buefy`.
|
|
19
19
|
// https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties
|
|
20
|
-
declare module '
|
|
20
|
+
declare module 'vue' {
|
|
21
21
|
/* @public */
|
|
22
22
|
interface ComponentCustomProperties {
|
|
23
23
|
/* Global Buefy API. */
|