UNPKG

bootstrap-vue-next

Version:

BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.

1 lines 1.51 kB
{"version":3,"file":"index.mjs","sources":["../../../../src/composables/useToastController/index.ts"],"sourcesContent":["import {inject, ref} from 'vue'\nimport {toastPluginKey} from '../../utils/keys'\nimport type {PromiseWithToast} from '../../types/ComponentOrchestratorTypes'\n\nexport const useToastController = () => {\n const noopPromise = () => {\n // eslint-disable-next-line no-console\n console.warn(\n 'useToastController() was called outside of the setup() function! or the plugin is not provided.'\n )\n return Promise.resolve(null) as unknown as PromiseWithToast\n }\n const toastContollerPlugin = inject(toastPluginKey, {\n toasts: ref([]),\n create: noopPromise,\n /*\n @deprecated\n */\n show: noopPromise,\n _isAppend: ref(false),\n _isOrchestratorInstalled: ref(false),\n })\n if (toastContollerPlugin.create === noopPromise) {\n throw new Error(\n 'useToastController() was called outside of the setup() function! or the plugin is not provided.'\n )\n }\n return {\n ...toastContollerPlugin,\n }\n}\n"],"names":[],"mappings":";;AAIO,MAAM,qBAAqB,MAAM;AACtC,QAAM,cAAc,MAAM;AAEhB,YAAA;AAAA,MACN;AAAA,IACF;AACO,WAAA,QAAQ,QAAQ,IAAI;AAAA,EAC7B;AACM,QAAA,uBAAuB,OAAO,gBAAgB;AAAA,IAClD,QAAQ,IAAI,EAAE;AAAA,IACd,QAAQ;AAAA;AAAA;AAAA;AAAA,IAIR,MAAM;AAAA,IACN,WAAW,IAAI,KAAK;AAAA,IACpB,0BAA0B,IAAI,KAAK;AAAA,EAAA,CACpC;AACG,MAAA,qBAAqB,WAAW,aAAa;AAC/C,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EAAA;AAEK,SAAA;AAAA,IACL,GAAG;AAAA,EACL;AACF;"}