bootstrap-vue-next
Version:
BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.
3 lines (2 loc) • 1.48 kB
JavaScript
const e=require("vue"),t=require("./keys-D59bcWpQ.js");const s=()=>({store:e.ref([]),_isOrchestratorInstalled:e.ref(!1),_isToastAppend:e.ref(!1)});exports._newOrchestratorRegistry=s,exports.buildPromise=function(t,s){let o=()=>{};const r=new Promise(e=>{o=e});return Object.assign(r,{id:t,ref:null,show(){const e=this.ref;return e?.show?(e.show(),r):this.set({modelValue:!0})},hide(e){const t=this.ref;return t?.hide?(t.hide(e,!0),r):this.set({modelValue:!1})},toggle(){const e=this.get(),t=this.ref;return t?.toggle?(t.toggle(),r):this.set({modelValue:!e?.modelValue})},get:()=>s.value.find(e=>e._self===t),set(o){const l=s.value.findIndex(e=>e._self===t),i=s.value[l];if(i){const t={...e.toValue(i),...e.toValue(o)};i.modelValue!==t.modelValue&&i["onUpdate:modelValue"]?.(t.modelValue),s.value.splice(l,1,{...t,title:e.toValue(t.title),body:e.toValue(t.body),modelValue:e.toValue(t.modelValue)})}return r},async destroy(){const o=s.value.find(e=>e._self===t);o&&(o.promise.stop?.(),o.modelValue&&await new Promise(t=>{const s=o.onHidden;o.onHidden=e=>{s?.(e),t(e)},e.nextTick(()=>{this.hide("destroy")})}),s.value.splice(s.value.findIndex(e=>e._self===t),1))},async[Symbol.asyncDispose](){await this.destroy()}}),{value:r,resolve:o,stop:void 0}},exports.useOrchestratorRegistry=()=>{const o=e.inject(t.orchestratorRegistryKey,void 0);if(o)return o;const r=s();return e.provide(t.orchestratorRegistryKey,r),r};
//# sourceMappingURL=orchestratorShared-Q1kU-Xan.js.map
;