buefy
Version:
Lightweight UI components for Vue.js (v3) based on Bulma
3 lines (2 loc) • 22.6 kB
JavaScript
/*! Buefy v3.0.7 | MIT License | github.com/buefy/buefy */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Dialog={},e.Vue)}(this,(function(e,t){"use strict";const n=(e,t=!1)=>e?t?e.querySelectorAll('*[tabindex="-1"]'):e.querySelectorAll('a[href]:not([tabindex="-1"]),\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n *[tabindex]:not([tabindex="-1"]),\n *[contenteditable]'):null;let o;const i={beforeMount:(e,{value:t=!0})=>{if(t){let t=n(e),i=n(e,!0);t&&t.length>0&&(o=o=>{t=n(e),i=n(e,!0);const a=t[0],s=t[t.length-1];o.target===a&&o.shiftKey&&"Tab"===o.key?(o.preventDefault(),s.focus()):(o.target===s||Array.from(i).indexOf(o.target)>=0)&&!o.shiftKey&&"Tab"===o.key&&(o.preventDefault(),a.focus())},e.addEventListener("keydown",o))}},unmounted:e=>{e.removeEventListener("keydown",o)}};let a={defaultContainerElement:null,defaultIconPack:"mdi",defaultIconComponent:null,defaultModalCanCancel:["escape","x","outside","button"],defaultTrapFocus:!0,defaultAutoFocus:!0,defaultButtonRounded:!1,defaultLinkTags:["a","button","input","router-link","nuxt-link","n-link","RouterLink","NuxtLink","NLink"]};function s(e){void 0!==e.remove?e.remove():void 0!==e.parentNode&&null!==e.parentNode&&e.parentNode.removeChild(e)}function l(e){if(!e)return;const{component:t}=e;return t?t.exposed&&t.exposeProxy||t.proxy:void 0}const c={sizes:{default:"mdi-24px","is-small":null,"is-medium":"mdi-36px","is-large":"mdi-48px"},iconPrefix:"mdi-"},r=()=>{const e="fa-";return{sizes:{default:null,"is-small":null,"is-medium":e+"lg","is-large":e+"2x"},iconPrefix:e,internalIcons:{information:"info-circle",alert:"exclamation-triangle","alert-circle":"exclamation-circle","chevron-right":"angle-right","chevron-left":"angle-left","chevron-down":"angle-down","eye-off":"eye-slash","menu-down":"caret-down","menu-up":"caret-up","close-circle":"times-circle"}}},d={checkboxOn:{type:"svg",viewBox:"0 0 1 1",path:"M 0.04038059,0.6267767 0.14644661,0.52071068 0.42928932,0.80355339 0.3232233,0.90961941 z M 0.21715729,0.80355339 0.85355339,0.16715729 0.95961941,0.2732233 0.3232233,0.90961941 z"},checkboxIndeterminate:{type:"svg",viewBox:"0 0 1 1",path:"M 0.15,0.4 L 0.85,0.4 L 0.85,0.6 L 0.15,0.6 Z"},chevronLeft:{type:"svg",path:"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z"},chevronRight:{type:"svg",path:"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"},chevronDown:{type:"svg",path:"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z"},chevronUp:{type:"svg",path:"M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z"},menuDown:{type:"svg",path:"M7,10L12,15L17,10H7Z"},menuUp:{type:"svg",path:"M7,14L12,9L17,14H7Z"},check:{type:"svg",path:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"},alertCircle:{type:"svg",path:"M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"},alert:{type:"svg",path:"M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z"},information:{type:"svg",path:"M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"},close:{type:"svg",path:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"},closeCircle:{type:"svg",path:"M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z"},eye:{type:"svg",path:"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"},eyeOff:{type:"svg",path:"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.18 16.38,18.6L16.81,19L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z"}};function u(e){return d[e]}var p=t.defineComponent({name:"BIcon",props:{type:[String,Object],component:String,pack:String,icon:{type:String,required:!1,default:void 0},alias:String,size:String,customSize:String,customClass:String,both:Boolean},computed:{resolvedAlias(){var e;return this.alias&&null!=(e=u(this.alias))?e:null},isSvgAlias(){var e;return"svg"===(null==(e=this.resolvedAlias)?void 0:e.type)},isComponentAlias(){var e;return"component"===(null==(e=this.resolvedAlias)?void 0:e.type)},resolvedAliasSvg(){return this.resolvedAlias},resolvedAliasComponent(){return this.resolvedAlias},iconConfig(){return{mdi:c,fa:r(),fas:r(),far:r(),fad:r(),fab:r(),fal:r(),"fa-solid":r(),"fa-regular":r(),"fa-light":r(),"fa-thin":r(),"fa-duotone":r(),"fa-brands":r()}[this.newPack]},iconPrefix(){return this.iconConfig&&this.iconConfig.iconPrefix?this.iconConfig.iconPrefix:""},newIcon(){var e;return`${this.iconPrefix}${this.getEquivalentIconOf(null!=(e=this.icon)?e:"")}`},newPack(){return this.pack||a.defaultIconPack},newType(){if(!this.type)return;let e=[];if("string"==typeof this.type)e=this.type.split("-");else for(const t in this.type)if(this.type[t]){e=t.split("-");break}if(e.length<=1)return;const[,...t]=e;return`has-text-${t.join("-")}`},newCustomSize(){return this.customSize||this.customSizeByPack},customSizeByPack(){if(this.iconConfig&&this.iconConfig.sizes){if(this.size&&void 0!==this.iconConfig.sizes[this.size])return this.iconConfig.sizes[this.size];if(this.iconConfig.sizes.default)return this.iconConfig.sizes.default}return null},useIconComponent(){return this.component||a.defaultIconComponent}},methods:{getEquivalentIconOf(e){if(!this.both)return e;if(null==this.iconConfig)return e;const t=this.iconConfig;return t&&t.internalIcons&&t.internalIcons[e]?t.internalIcons[e]:e}}}),m=(e,t)=>{const n=e.__vccOpts||e;for(const[e,o]of t)n[e]=o;return n};const f=["viewBox"],h=["d"];var v=m(p,[["render",function(e,n,o,i,a,s){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["icon",[e.newType,e.size]])},[e.isSvgAlias?(t.openBlock(),t.createElementBlock("svg",{key:0,viewBox:e.resolvedAliasSvg.viewBox||"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",class:t.normalizeClass(e.customClass),"aria-hidden":"true"},[t.createElementVNode("path",{fill:"currentColor",d:e.resolvedAliasSvg.path},null,8,h)],10,f)):e.isComponentAlias?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.resolvedAliasComponent.component),{key:1,icon:e.resolvedAliasComponent.icon,class:t.normalizeClass(e.customClass)},null,8,["icon","class"])):e.useIconComponent?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.useIconComponent),{key:3,icon:[e.newPack,e.newIcon],size:e.newCustomSize,class:t.normalizeClass([e.customClass])},null,8,["icon","size","class"])):(t.openBlock(),t.createElementBlock("i",{key:2,class:t.normalizeClass([e.newPack,e.newIcon,e.newCustomSize,e.customClass])},null,2))],2)}]]);const g=["clip","keep"],y=["dialog","alertdialog"],C=t.defineComponent({name:"BModal",directives:{trapFocus:i},props:{modelValue:Boolean,component:[Object,Function,String],content:{type:[String,Object,Array]},programmatic:Boolean,props:Object,events:{type:Object,default:()=>({})},width:{type:[String,Number],default:960},hasModalCard:Boolean,animation:{type:String,default:"zoom-out"},canCancel:{type:[Array,Boolean],default:()=>a.defaultModalCanCancel},cancelCallback:{type:Function,default:()=>{}},scroll:{type:String,default:()=>"clip",validator:e=>g.indexOf(e)>=0},fullScreen:Boolean,trapFocus:{type:Boolean,default:()=>a.defaultTrapFocus},autoFocus:{type:Boolean,default:()=>a.defaultAutoFocus},customClass:String,customContentClass:[String,Array,Object],ariaRole:{type:String,validator:e=>y.indexOf(e)>=0},ariaModal:Boolean,ariaLabel:{type:String,validator:e=>Boolean(e)},closeButtonAriaLabel:{type:String,default:"close"},destroyOnHide:{type:Boolean,default:!0},renderOnMounted:{type:Boolean,default:!1}},emits:{"after-enter":()=>!0,"after-leave":()=>!0,cancel:e=>!0,close:()=>!0,"update:modelValue":e=>!0},data(){return{isActive:this.modelValue||!1,savedScrollTop:null,newWidth:"number"==typeof this.width?this.width+"px":this.width,animating:!this.modelValue,destroyed:!(this.modelValue||this.renderOnMounted)}},computed:{cancelOptions(){return"boolean"==typeof this.canCancel?this.canCancel?a.defaultModalCanCancel:[]:this.canCancel},showX(){return this.cancelOptions.indexOf("x")>=0},customStyle(){return this.fullScreen?null:{maxWidth:this.newWidth}}},watch:{modelValue(e){this.isActive=e},isActive(e){e&&(this.destroyed=!1),this.handleScroll(),this.$nextTick((()=>{e&&this.$el&&this.$el.focus&&this.autoFocus&&this.$el.focus()}))}},methods:{handleScroll(){"undefined"!=typeof window&&("clip"!==this.scroll?(this.savedScrollTop=this.savedScrollTop?this.savedScrollTop:document.documentElement.scrollTop,this.isActive?document.body.classList.add("is-noscroll"):document.body.classList.remove("is-noscroll"),this.isActive?document.body.style.top=`-${this.savedScrollTop}px`:(document.documentElement.scrollTop=this.savedScrollTop,document.body.style.top="",this.savedScrollTop=null)):this.isActive?document.documentElement.classList.add("is-clipped"):document.documentElement.classList.remove("is-clipped"))},cancel(e){this.cancelOptions.indexOf(e)<0||(this.$emit("cancel",e),this.cancelCallback.apply(null,[e]),this.close())},close(){this.$emit("close"),this.$emit("update:modelValue",!1),this.programmatic&&(this.isActive=!1,setTimeout((()=>{s(this.$el)}),150))},keyPress({key:e}){!this.isActive||"Escape"!==e&&"Esc"!==e||this.cancel("escape")},afterEnter(){this.animating=!1,this.$emit("after-enter")},beforeLeave(){this.animating=!0},afterLeave(){this.destroyOnHide&&(this.destroyed=!0),this.$emit("after-leave")}},created(){"undefined"!=typeof window&&document.addEventListener("keyup",this.keyPress)},mounted(){this.programmatic?(document.body.appendChild(this.$el),this.isActive=!0):this.isActive&&this.handleScroll()},beforeUnmount(){if("undefined"!=typeof window){document.removeEventListener("keyup",this.keyPress),document.documentElement.classList.remove("is-clipped");const e=this.savedScrollTop?this.savedScrollTop:document.documentElement.scrollTop;document.body.classList.remove("is-noscroll"),document.documentElement.scrollTop=e,document.body.style.top=""}}}),k=["role","aria-label","aria-modal"],b=["innerHTML"],L=["aria-label"];var B=m(C,[["render",function(e,n,o,i,a,s){const l=t.resolveDirective("trap-focus");return t.openBlock(),t.createBlock(t.Transition,{name:e.animation,onAfterEnter:e.afterEnter,onBeforeLeave:e.beforeLeave,onAfterLeave:e.afterLeave},{default:t.withCtx((()=>[e.destroyed?t.createCommentVNode("v-if",!0):t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["modal is-active",[{"is-full-screen":e.fullScreen},e.customClass]]),tabindex:"-1",role:e.ariaRole,"aria-label":e.ariaLabel,"aria-modal":e.ariaModal||void 0},[t.createElementVNode("div",{class:"modal-background",onClick:n[0]||(n[0]=t=>e.cancel("outside"))}),t.createElementVNode("div",{class:t.normalizeClass(["animation-content",[{"modal-content":!e.hasModalCard},e.customContentClass]]),style:t.normalizeStyle(e.customStyle)},[e.component?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.component),t.mergeProps({key:0},e.props,t.toHandlers(e.events),{"can-cancel":e.canCancel,onClose:e.close}),null,16,["can-cancel","onClose"])):e.content?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),t.createElementVNode("div",{innerHTML:e.content},null,8,b)],64)):t.renderSlot(e.$slots,"default",{key:2,canCancel:e.canCancel,close:e.close})],6),e.showX?t.withDirectives((t.openBlock(),t.createElementBlock("button",{key:0,class:"modal-close is-large","aria-label":e.closeButtonAriaLabel,onClick:n[1]||(n[1]=t=>e.cancel("x"))},null,8,L)),[[t.vShow,!e.animating]]):t.createCommentVNode("v-if",!0)],10,k)),[[t.vShow,e.isActive],[l,e.trapFocus]])])),_:3},8,["name","onAfterEnter","onBeforeLeave","onAfterLeave"])}]]);const S=["button","submit","reset"];var w=t.defineComponent({name:"BButton",components:{BIcon:v},inheritAttrs:!1,props:{type:[String,Object],size:String,label:String,iconPack:String,iconLeft:String,iconRight:String,rounded:{type:Boolean,default:()=>a.defaultButtonRounded},loading:Boolean,outlined:Boolean,expanded:Boolean,inverted:Boolean,focused:Boolean,active:Boolean,hovered:Boolean,selected:Boolean,nativeType:{type:String,default:"button",validator:e=>S.indexOf(e)>=0},tag:{type:[String,Object],default:"button",validator:e=>"object"==typeof e||a.defaultLinkTags.indexOf(e)>=0}},computed:{computedTag(){return void 0!==this.$attrs.disabled&&!1!==this.$attrs.disabled?"button":this.tag},iconSize(){return this.size&&"is-medium"!==this.size?"is-large"===this.size?"is-medium":this.size:"is-small"}}});const x={key:1},A={key:2};var E=m(w,[["render",function(e,n,o,i,a,s){const l=t.resolveComponent("b-icon");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.computedTag),t.mergeProps({class:"button"},e.$attrs,{type:"string"==typeof e.computedTag&&["button","input"].includes(e.computedTag)?e.nativeType:void 0,class:[e.size,e.type,{"is-rounded":e.rounded,"is-loading":e.loading,"is-outlined":e.outlined,"is-fullwidth":e.expanded,"is-inverted":e.inverted,"is-focused":e.focused,"is-active":e.active,"is-hovered":e.hovered,"is-selected":e.selected}]}),{default:t.withCtx((()=>[e.iconLeft?(t.openBlock(),t.createBlock(l,{key:0,pack:e.iconPack,icon:e.iconLeft,size:e.iconSize},null,8,["pack","icon","size"])):t.createCommentVNode("v-if",!0),e.label?(t.openBlock(),t.createElementBlock("span",x,t.toDisplayString(e.label),1)):e.$slots.default?(t.openBlock(),t.createElementBlock("span",A,[t.renderSlot(e.$slots,"default")])):t.createCommentVNode("v-if",!0),e.iconRight?(t.openBlock(),t.createBlock(l,{key:3,pack:e.iconPack,icon:e.iconRight,size:e.iconSize},null,8,["pack","icon","size"])):t.createCommentVNode("v-if",!0)])),_:3},16,["type","class"])}]]),V=Object.defineProperty,M=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable,T=(e,t,n)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const N=t.defineComponent({name:"BDialog",components:{BIcon:v,BButton:E},directives:{trapFocus:i},extends:B,props:{customClass:{type:String,default:""},customContentClass:{type:String,default:""},title:String,message:[String,Array],icon:String,iconPack:String,hasIcon:Boolean,type:{type:String,default:"is-primary"},size:String,confirmText:{type:String,default:()=>"OK"},cancelText:{type:String,default:()=>"Cancel"},hasInput:Boolean,inputAttrs:{type:Object,default:()=>({})},confirmCallback:{type:Function,default:()=>{}},closeOnConfirm:{type:Boolean,default:!0},container:{type:String,default:()=>a.defaultContainerElement},focusOn:{type:String,default:"confirm"}},emits:{confirm:(e,t)=>!0},data(){return{prompt:this.hasInput&&this.inputAttrs.value||"",isActive:!1,validationMessage:"",isCompositing:!1,isLoading:!1}},computed:{safeInputAttrs(){const e=((e,t)=>{for(var n in t||(t={}))O.call(t,n)&&T(e,n,t[n]);if(M)for(var n of M(t))z.call(t,n)&&T(e,n,t[n]);return e})({},this.inputAttrs);return delete e.value,void 0===e.required&&(e.required=!0),e},dialogClass(){return[this.size,{"has-custom-container":null!==this.container}]},iconByType(){switch(this.type){case"is-info":return"information";case"is-success":return"check-circle";case"is-warning":return"alert";case"is-danger":return"alert-circle";default:return null}},showCancel(){return this.cancelOptions.indexOf("button")>=0}},methods:{confirm(){const e=this.$refs.input;if(null!=e){if(this.isCompositing)return;if(!e.checkValidity())return this.validationMessage=e.validationMessage,void this.$nextTick((()=>e.select()))}this.$emit("confirm",this.prompt,this),this.confirmCallback(this.prompt,this),this.closeOnConfirm&&this.close()},close(){this.isActive=!1,this.isLoading=!1,setTimeout((()=>{s(this.$el)}),150)},startLoading(){this.isLoading=!0},cancelLoading(){this.isLoading=!1}},beforeMount(){"undefined"!=typeof window&&this.$nextTick((()=>{(document.querySelector(this.container)||document.body).appendChild(this.$el)}))},mounted(){this.isActive=!0,this.$nextTick((()=>{this.hasInput?this.$refs.input.focus():"cancel"===this.focusOn&&this.showCancel?this.$refs.cancelButton.$el.focus():this.$refs.confirmButton.$el.focus()}))}}),P=["role","aria-modal"],$={key:0,class:"modal-card-head"},I={class:"modal-card-title"},_={class:"media"},D={key:0,class:"media-left"},j={class:"media-content"},H=["innerHTML"],F={key:0,class:"field"},Z={class:"control"},R={class:"help is-danger"},q={class:"modal-card-foot"},U={class:"buttons"};var K=m(N,[["render",function(e,n,o,i,a,s){const l=t.resolveComponent("b-icon"),c=t.resolveComponent("b-button"),r=t.resolveDirective("trap-focus");return t.openBlock(),t.createBlock(t.Transition,{name:e.animation},{default:t.withCtx((()=>[e.isActive?t.withDirectives((t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dialog modal is-active",[e.dialogClass,e.customClass]]),role:e.ariaRole,"aria-modal":e.ariaModal},[t.createElementVNode("div",{class:"modal-background",onClick:n[0]||(n[0]=t=>e.cancel("outside"))}),t.createElementVNode("div",{class:t.normalizeClass(["modal-card animation-content",e.customContentClass])},[e.title?(t.openBlock(),t.createElementBlock("header",$,[t.createElementVNode("p",I,t.toDisplayString(e.title),1)])):t.createCommentVNode("v-if",!0),t.createElementVNode("section",{class:t.normalizeClass(["modal-card-body",{"is-titleless":!e.title,"is-flex":e.hasIcon}])},[t.createElementVNode("div",_,[e.hasIcon&&(e.icon||e.iconByType)?(t.openBlock(),t.createElementBlock("div",D,[t.createVNode(l,{icon:e.icon?e.icon:e.iconByType,pack:e.iconPack,type:e.type,both:!e.icon,size:"is-large"},null,8,["icon","pack","type","both"])])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",j,[t.createElementVNode("p",null,[e.$slots.default?t.renderSlot(e.$slots,"default",{key:0}):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createCommentVNode(" eslint-disable-next-line vue/no-v-html "),t.createElementVNode("div",{innerHTML:e.message},null,8,H)],64))]),e.hasInput?(t.openBlock(),t.createElementBlock("div",F,[t.createElementVNode("div",Z,[t.withDirectives(t.createElementVNode("input",t.mergeProps({"onUpdate:modelValue":n[1]||(n[1]=t=>e.prompt=t),class:["input",{"is-danger":e.validationMessage}],ref:"input"},e.safeInputAttrs,{onCompositionstart:n[2]||(n[2]=t=>e.isCompositing=!0),onCompositionend:n[3]||(n[3]=t=>e.isCompositing=!1),onKeydown:n[4]||(n[4]=t.withKeys(((...t)=>e.confirm&&e.confirm(...t)),["enter"]))}),null,16),[[t.vModelDynamic,e.prompt]])]),t.createElementVNode("p",R,t.toDisplayString(e.validationMessage),1)])):t.createCommentVNode("v-if",!0)])])],2),t.createElementVNode("footer",q,[t.createElementVNode("div",U,[e.showCancel?(t.openBlock(),t.createBlock(c,{key:0,ref:"cancelButton",disabled:e.isLoading,onClick:n[5]||(n[5]=t=>e.cancel("button"))},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.cancelText),1)])),_:1},8,["disabled"])):t.createCommentVNode("v-if",!0),t.createVNode(c,{type:e.type,ref:"confirmButton",loading:e.isLoading,onClick:e.confirm},{default:t.withCtx((()=>[t.createTextVNode(t.toDisplayString(e.confirmText),1)])),_:1},8,["type","loading","onClick"])])])],2)],10,P)),[[r,e.trapFocus]]):t.createCommentVNode("v-if",!0)])),_:3},8,["name"])}]]);var W=Object.defineProperty,Y=Object.defineProperties,X=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable,ee=(e,t,n)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,te=(e,t)=>{for(var n in t||(t={}))J.call(t,n)&&ee(e,n,t[n]);if(G)for(var n of G(t))Q.call(t,n)&&ee(e,n,t[n]);return e};function ne(e,n){let o;return Array.isArray(e.message)&&(o=e.message,delete e.message),function(){const i=document.createElement("div"),a=t.createApp({data:()=>({dialogVNode:null}),methods:{close(){const e=l(this.dialogVNode);e&&e.close()},startLoading(){const e=l(this.dialogVNode);e&&e.startLoading()},cancelLoading(){const e=l(this.dialogVNode);e&&e.cancelLoading()}},render(){var n;return this.dialogVNode=t.h(K,(n=te({},e),Y(n,X({onConfirm:e=>{},onCancel:e=>{a.unmount()},confirmCallback:(t,n)=>{null!=e.onConfirm&&e.onConfirm(t,n)},cancelCallback:t=>{null!=e.onCancel&&e.onCancel(t)}}))),o?{default:()=>o}:void 0),this.dialogVNode}});return n&&function(e,t){const{_context:n}=e,{_context:o}=t;o.config=n.config,o.mixins=n.mixins,o.components=n.components,o.directives=n.directives,o.provides=n.provides,o.optionsCache=n.optionsCache,o.propsCache=n.propsCache,o.emitsCache=n.emitsCache,"__VUE_I18N_SYMBOL__"in e&&(t.__VUE_I18N_SYMBOL__=e.__VUE_I18N_SYMBOL__)}(n,a),a.mount(i)}()}class oe{constructor(e){var t;ee(this,"app"+"",t),this.app=e}alert(e){let t;return t="string"==typeof e?{message:e}:e,t=te({canCancel:!1},t),ne(t,this.app)}confirm(e){return ne(e,this.app)}prompt(e){return ne(te({hasInput:!0},e),this.app)}}const ie=Symbol("Buefy Dialog");const ae={install(e){((e,t)=>{const n=t.name;if(null==n)throw new Error("Buefy.registerComponent: missing component name");e.component(n,t)})(e,K),((e,t,n,o)=>{e.config.globalProperties.$buefy||(e.config.globalProperties.$buefy={}),e.config.globalProperties.$buefy[t]=n,e.provide(o,n)})(e,"dialog",new oe(e),ie)}};e.BDialog=K,e.DialogProgrammatic=oe,e.default=ae,e.useDialog=function(){return t.inject(ie)},Object.defineProperty(e,"__esModule",{value:!0})}));