vuetify-dialog
Version:
Dialog helper for vuetify.js
2 lines (1 loc) • 27.9 kB
JavaScript
var VuetifyDialog=function(t,e,o){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var i={computed:{$parameters:function(){return this.$attrs||this.$options.propsData||this.$props||{}},isNewRecord:function(){return!this.$parameters||!this.$parameters[this.$options.primaryKey]}}},n={name:"Layoutable",mixins:[{name:"Activable",data:function(){return{isActive:!1}},watch:{isActive:function(t){this._dialogInstance?void 0!==this._dialogInstance.isActive&&(this._dialogInstance.isActive=t):this.$parent&&void 0!==this.$parent.isActive&&(this.$parent.isActive=t)}},methods:{close:function(){this.isActive=!1}}}],inheritAttrs:!1,props:{width:{type:[String,Number],default:function(){return 450}},persistent:Boolean},data:function(){return{loading:!1}},computed:{isLayout:function(){return!0},getWidth:function(){return"string"==typeof this.width?this.width:this.width+"px"}},watch:{isActive:function(t){t||this._destroy()}},mounted:function(){this.isActive=!0},methods:{_destroy:function(){this.$destroy()},dismiss:function(){this.persistent||this.loading||(this.isActive=!1)},close:function(){this.isActive=!1}},beforeDestroy:function(){"function"==typeof this.$el.remove?this.$el.remove():this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}};function r(t,e,o,i,n,r,s,a,c,l){"boolean"!=typeof s&&(c=a,a=s,s=!1);var d,u="function"==typeof o?o.options:o;if(t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,n&&(u.functional=!0)),i&&(u._scopeId=i),r?(d=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,c(t)),t&&t._registeredComponents&&t._registeredComponents.add(r)},u._ssrRegister=d):e&&(d=s?function(t){e.call(this,l(t,this.$root.$options.shadowRoot))}:function(t){e.call(this,a(t))}),d)if(u.functional){var p=u.render;u.render=function(t,e){return d.call(e),p(t,e)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,d):[d]}return o}var s={},a=function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"dialog-layout"},[e("dialog-child",this._b({ref:"dialog"},"dialog-child",this.$options.propsData,!1))],1)};a._withStripped=!0;var c=r({render:a,staticRenderFns:[]},void 0,s,void 0,!1,void 0,!1,void 0,void 0,void 0),l=function(t){return"function"==typeof t},d=function(t){return t&&(t instanceof Promise||"function"==typeof t.then)};function u(t,e){var o=this;void 0===e&&(e={});var i=[],n=this,r={};if("object"!=typeof t)return t;var s=function(s){var a=t[s];l(a)&&(a=a.call(o,e)),d(a)?(a=a.then((function(t){if(null!=t)return s.startsWith("...")?r=Object.assign({},r,t):r[s]=t,t})),l(e.asyncDataError)&&(a=a.catch((function(o){return e.asyncDataError.call(n,o,{key:s,obj:t})}))),i.push(a)):e.deep&&function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(d(t[e])||l(t[e]))return!0;return!1}(a)?i.push(u.call(n,a,e).then((function(t){r[s]=t}))):r[s]=a};for(var a in t)s(a);return Promise.all(i).then((function(){return Promise.resolve(r)}))}var p=function(t,e){var o=[];if(t.options.asyncData){var i=function(t,e){var o;if(o=l(t)?t.call(this,e):t,!d(o)){if("object"==typeof o)return u.call(this,o,e);o=Promise.resolve(o)}var i=this;return o.then((function(t){return u.call(i,t)}))}(t.options.asyncData,e);i.then((function(e){return function(t,e){var o=t.options._originDataFn||t.options.data||function(){return{}};t.options._originDataFn=o,e?(t.options.data=function(){var t=o.call(this);return Object.assign({},t,e)},t._Ctor&&t._Ctor.options&&(t._Ctor.options.data=t.options.data)):t.options.data=o}(t,e),e})),o.push(i)}return t.options.fetch&&o.push(t.options.fetch(e)),Promise.all(o)};function h(t){t&&!t._isDestroyed&&"function"==typeof t.$destroy&&t.$destroy()}function f(t){var e;return(e="string"==typeof t?document.querySelector(t):t)||(e=document.body),e}var v=1,m=function(t,e){void 0===e&&(e={});var o=e.layout,i=e.container;if(!t)throw Error("Component was not set");this._layout=o||{component:c,options:{}},this._component=t,this._vm=null,this._vmDialog=null,this._options={},this.id=++v,this._resolvers=[],this.container=f(i)},y={showed:{configurable:!0},element:{configurable:!0},hasAsyncPreload:{configurable:!0},vm:{configurable:!0},vmd:{configurable:!0}};m.prototype.show=async function(t,o){if(void 0===t&&(t={}),void 0===o&&(o={}),!e.prototype.$isServer){var r=this._component;"object"!=typeof r||r.options||(r=e.extend(Object.assign({},this._component))),r.options.primaryKey&&(r=r.extend({mixins:[i]})),this.hasAsyncPreload&&await p(r,Object.assign({},this.context,{params:t}));var s=e.extend({mixins:[n],components:{"dialog-child":r}});s=s.extend(this._layout.component),r.options.inheritAttrs=!1;var a=Object.assign({},this._layout.options,t,o&&o.propsData),c=new s(Object.assign({},this.context,o,{propsData:a}));c.$mount();var l=c.$refs.dialog;return c.$on("hook:destroyed",this._onDestroyed.bind(this)),c.$on("submit",this.onReturn.bind(this)),l&&l.$on("submit",this.onReturn.bind(this)),this._vm=c,this._vm._dialogInstance=l,this._vmDialog=l,(t.container?f(t.container):this.container).appendChild(c.$el),this}},m.prototype.wait=function(){var t=this;return new Promise((function(e){t._resolvers.push(e)}))},m.prototype._onDestroyed=function(){this.remove()},m.prototype.remove=function(){this.onDestroyed&&this.onDestroyed(this),this._processResultPromises(),h(this._vm),h(this._vmDialog),this._vm=null,this._vmDialog=null},m.prototype._processResultPromises=function(t){this._resolvers.length&&(this._resolvers.forEach((function(e){return e(t)})),this._resolvers=[])},m.prototype.onReturn=function(t){this._processResultPromises(t),this.close()},y.showed.get=function(){return!!this._vm&&!this._vm._isDestroyed},y.element.get=function(){return this._vm&&this._vm.$el},y.hasAsyncPreload.get=function(){return this._component&&(t=this._component.options||this._component,Boolean(t.asyncData||t.fetch));var t},y.vm.get=function(){return this._vm},y.vmd.get=function(){return this._vmDialog},m.prototype.close=function(){this._vm&&this._vm.close()},Object.defineProperties(m.prototype,y);var g=function(t){this._component=t,this._vm=null};g.prototype.show=function(){if(!this._vm){var t=e.extend(this._component);this._vm=new t,this._vm.$mount(),document.body.appendChild(this._vm.$el)}this._vm.visible=!0},g.prototype.hide=function(){this._vm.visible=!1},g.prototype.destroy=function(){this._vm&&(this._vm.$el.parentNode.removeChild(this._vm.$el),this._vm.$destroy(),this._vm=null)};var _=function(t){void 0===t&&(t={});var o=t.context,i=t.container;this._context=o||{},m.prototype.context=o||{},this._components={},this._layouts={},this._overlays={},this._container=i,this._emitter=new e({}),this._instances=[]},b={context:{configurable:!0}};b.context.get=function(){return this._context},_.prototype.layout=function(t,e,o){void 0===o&&(o={}),this._layouts[t]={component:e,options:o}},_.prototype.getLayout=function(t){if("function"==typeof t){var e=t.call(this._context);return t=this._layouts[e.name||"default"],Object.assign({},t,{options:e})}if("object"==typeof t&&"function"==typeof t.render)return{component:t};if(Array.isArray(t)){var o=t[0],i=t[1]||{},n="object"==typeof o&&"function"==typeof o.render?{component:o}:this._layouts[o];return n&&{component:n.component,options:Object.assign({},n.options,i)}}return this._layouts[t]},_.prototype.overlay=function(t,e){if(void 0===e){if(this._overlays[t])return this._overlays[t];throw new Error('Overlay "'+t+" not found\n Please register it by calling dialog.overlay('"+t+"', component)")}this._overlays[t]=new g(e)},_.prototype.getComponent=function(t){if(!this._components[t])throw new Error('Component "'+t+"\" was not found.\n Please register it by calling dialog.register('"+t+"', component)");return this._components[t]},_.prototype.component=function(t,e,o){var i=this;if(void 0===o&&(o={}),void 0===e)return this._components[t];this._components[t]={component:e,options:o},Object.defineProperty(this,t,{get:function(){return i.createFunctionWrapper(t)},configurable:!0})},_.prototype.getComponentProperty=function(t,e){return t.options?t.options[e]:t[e]},_.prototype.create=function(t){if(!t)throw new Error("Component is incorrect");var e=this.getLayout(this.getComponentProperty(t,"layout")||"default"),o=new m(t,{layout:e,context:this._context,container:this._container});return this._emitter.$emit("created",{dialog:o}),o},_.prototype.show=async function(t,e){void 0===e&&(e={});var o=this.create(t),i=!!o.hasAsyncPreload&&(this.getComponentProperty(t,"overlay")||"default"),n=i&&this._overlays[i]&&this.overlay(i);n&&n.show();try{return await o.show(e),this._emitter.$emit("shown",{dialog:o}),n&&n.hide(),o.onDestroyed=this.onDialogDestroyed.bind(this),e.waitForResult?o.wait():o}catch(t){throw this._emitter.$emit("error",{error:t,dialog:o}),n&&n.hide(),t}},_.prototype.createFunctionWrapper=function(t){var e=this,o=this.getComponent(t);return function(t){return e.show(o.component,Object.assign({},o.options,t))}},_.prototype.showAndWait=async function(t,e){return(await this.show(t,e)).wait()},_.prototype.on=function(t,e){this._emitter.$on(t,e)},_.prototype.off=function(t,e){this._emitter.$off(t,e)},_.prototype.once=function(t,e){this._emitter.$once(t,e)},_.prototype.onDialogDestroyed=function(t){this._emitter.$emit("destroyed",{dialog:t})},Object.defineProperties(_.prototype,b);var w={name:"VDialogOverlay",props:{zIndex:{type:Number,default:function(){return 1250}},visible:{type:Boolean,default:function(){return!1}}}},x=function(){var t=this.$createElement,e=this._self._c||t;return e("transition",{attrs:{name:"opacity"}},[this.visible?e("div",{staticClass:"dialog-overlay-loading",style:{zIndex:this.zIndex}},[this._v("\n Loading…\n ")]):this._e()])};x._withStripped=!0;var $=r({render:x,staticRenderFns:[]},void 0,w,void 0,!1,void 0,!1,void 0,void 0,void 0),C={name:"Actionable",mixins:[{name:"Returnable",props:{returnValue:null},data:function(){return{originalValue:this.returnValue,returnResovers:[]}},methods:{return:function(t){this.originalValue=t,this.$root.$emit("submit",this.originalValue),this.$emit("submit",this.originalValue)}}}],data:function(){return{loadingAction:null}},props:{actions:{type:[Array,Object,Function],default:function(){return[]}},handle:Function,handler:Function,params:Object},computed:{actionlist:function(){var t=[],e="function"==typeof this.actions?this.actions(this):this.actions||[];for(var o in e){var i=e[o];["string","boolean"].includes(typeof i)&&(i={text:i}),i.key||(i.key=isNaN(o)?o:i.text||o),["true","false"].indexOf(i.key)>=0&&(i.key=JSON.parse(i.key)),this.isActionVisible(i)&&("string"==typeof i.icon&&(i.icon={text:i.icon}),t.push(i))}return t}},created:function(){this.handle&&console.warn('DEPRECATED: "handle" prop will be deprecated, please use "handler" instead')},methods:{trigger:function(t){var e=this.actionlist.find((function(e){return e.key===t}));e&&!this.isActionDisabled(e)&&this.isActionVisible(e)&&this.onActionClick(e)},setLoadingToInstance:function(t,e){t&&void 0!==t.loading&&(t.loading=e)},setLoadingState:function(t){this.$emit("loading",t),!t&&(this.loadingAction=null),this.setLoadingToInstance(this.$root,t),this.setLoadingToInstance(this.$root._dialogInstance,t)},get:function(t,e){return void 0===t?e:"function"==typeof t?t(this.params):t},isActionDisabled:function(t){return this.get(t.disabled,!1)},isActionVisible:function(t){return this.get(t.visible,!0)},isActionInLoading:function(t){return this.loadingAction===t.key||this.get(t.loading)},onActionClick:async function(t){var e=void 0===t.closable||!0===t.closable,o=t.handle||t.handler||this.handle||this.handler;if("function"==typeof o){this.loadingAction=t.key,this.setLoadingState(!0);try{var i=await o(this.params,t);this.setLoadingState(!1),!1!==i&&e&&this.return(i||t.key)}catch(t){throw this.setLoadingState(!1),console.error("error",t),t}}else e&&this.return(t.key)}}},O={name:"Confirmable",props:{type:{type:String},text:{type:[String,Function],reqiured:!0},title:{type:String},actions:{type:[Array,Object,Function]}}},A=[],k={props:{verticalOffset:Number,showClose:{type:Boolean,default:function(){return!0}},position:{type:String,default:function(){return"top-right"}},timeout:{type:[Number,Boolean],default:function(){return 4500}},width:{type:Number,default:function(){return 330}},zIndex:{type:Number,default:function(){return 2e3}}},data:function(){return{activeTimeout:null}},computed:{horizontalClass:function(){return this.position.indexOf("right")>-1?"right":"left"},verticalProperty:function(){return/^top-/.test(this.position)?"top":"bottom"},getStyle:function(){var t;return(t={})[this.verticalProperty]=this.verticalOffset+"px",t["max-width"]=this.width+"px",t["z-index"]=this.zIndex,t}},methods:{_destroy:function(){this.$el.addEventListener("transitionend",this.onTransitionEnd)},onTransitionEnd:function(){this.$el.removeEventListener("transitionend",this.onTransitionEnd),this.$destroy()},clearTimer:function(){clearTimeout(this.activeTimeout)},startTimer:function(){this.timeout>0&&(this.activeTimeout=setTimeout(this.close,this.timeout))},keydown:function(t){46===t.keyCode||8===t.keyCode?this.clearTimer():27===t.keyCode?this.close():this.startTimer()},close:function(){this.isActive=!1}},watch:{isActive:function(t){var e,o,i;t?(o=(e=this).position,i=10,A.filter((function(t){return t.position===o})).forEach((function(t){i+=t.$el.offsetHeight+10})),A.push(e),e.verticalOffset=i):function(t){var e=A.findIndex((function(e){return e===t}));if(!(e<0)){A.splice(e,1);var o=A.length,i=t.position;if(o){var n=10;A.filter((function(t){return t.position===i})).forEach((function(t){t.verticalOffset=n,n+=t.$el.offsetHeight+10}))}}}(this)}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}};var V={install:function t(e,o){if(void 0===o&&(o={}),!t.installed){t.installed=!0;var i=o.property||"$dialog",n=new _(o);n.overlay("default",$),e.prototype[i]?console.warn("Property "+i+" is already defined in Vue prototype"):Object.defineProperty(e.prototype,i,{get:function(){return n},configurable:!0})}}},S=null;"undefined"!=typeof window?S=window.Vue:"undefined"!=typeof global&&(S=global.Vue),S&&S.use(V);var D={components:{VDialog:o.VDialog},props:{fullscreen:Boolean,scrollable:Boolean,hideOverlay:Boolean,transition:{type:[String,Boolean],default:"dialog-transition"},showClose:{type:Boolean,default:function(){return!0}}},methods:{_destroy:function(){var t=this;setTimeout((function(){t.$destroy()}),1e3)}}},j=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-dialog",{ref:"vdialog",attrs:{eager:"","content-class":"vuedl-layout",fullscreen:t.fullscreen,"max-width":t.getWidth,persistent:t.persistent||t.loading,scrollable:t.scrollable,transition:t.transition,"hide-overlay":t.hideOverlay,"retain-focus":!1},on:{keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"esc",27,e.key,["Esc","Escape"])?null:t.dismiss(e)}},model:{value:t.isActive,callback:function(e){t.isActive=e},expression:"isActive"}},[o("div",{staticClass:"v-dialog-wrapper"},[!t.showClose||t.persistent||t.loading?t._e():o("div",{staticClass:"vuedl-layout__closeBtn",on:{click:function(e){return e.stopPropagation(),t.close(e)}}},[t._v("\n ×\n ")]),t._v(" "),o("dialog-child",t._b({ref:"dialog"},"dialog-child",t.$options.propsData,!1))],1)])};j._withStripped=!0;var T=r({render:j,staticRenderFns:[]},void 0,D,void 0,!1,void 0,!1,void 0,void 0,void 0),B={props:{type:String,color:String},computed:{getColor:function(){return this.color||this.type}}},E={props:{icon:{type:[String,Boolean],default:void 0},type:String},computed:{getIcon:function(){if(!1!==this.icon)return this.icon||this.$vuetify&&this.$vuetify.icons&&this.$vuetify.icons.values[this.type]||this.type}}},P={components:{VIcon:o.VIcon,VBtn:o.VBtn},props:{attrs:Object,component:{type:[String,Object],default:"v-btn"},text:[String,Function],disabled:Boolean,flat:Boolean,icon:Object,on:{type:Object,default:function(){}}},computed:{actionText:function(){return"function"==typeof this.text?this.text():this.text}}},F=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o(t.component,t._g(t._b({tag:"component",attrs:{text:t.flat,icon:!t.text&&Boolean(t.icon),disabled:t.disabled},on:{click:function(e){return t.$emit("click",this)}}},"component",t.$attrs,!1),t.on),[t.icon&&!t.icon.right?o("v-icon",t._b({domProps:{textContent:t._s(t.icon.text)}},"v-icon",t.icon,!1)):t._e(),t._v("\n "+t._s(t.actionText)+"\n "),t.icon&&t.icon.right?o("v-icon",t._b({domProps:{textContent:t._s(t.icon.text)}},"v-icon",t.icon,!1)):t._e()],1)};F._withStripped=!0;var R={components:{DialogAction:r({render:F,staticRenderFns:[]},void 0,P,void 0,!1,void 0,!1,void 0,void 0,void 0),VSpacer:o.VSpacer,VCardActions:o.VCardActions},mixins:[C],props:{component:[String,Object],color:String,flat:Boolean,rounded:Boolean,outlined:Boolean,passive:Boolean,block:Boolean,large:Boolean,small:Boolean},computed:{nestedProps:function(){return["color","flat","rounded","outlined","icon","block","small","large","x-small","x-large"]}},methods:{getActionProps:function(t){var e=this,o={component:t.component||this.component,text:t.text};return this.nestedProps.forEach((function(i){(t[i]||e[i])&&(o[i]=void 0===t[i]?e[i]:t[i])})),o}}},L=function(){var t=this,e=t.$createElement,o=t._self._c||e;return t.actionlist&&Object.keys(t.actionlist).length?o("v-card-actions",[t.actions.spacer?t._e():o("v-spacer"),t._v(" "),t._l(t.actionlist,(function(e){return["spacer"===e.key?o("v-spacer",{key:e.key}):o("DialogAction",t._b({key:e.key,class:{loading:t.loadingAction===e.key},attrs:{"action-key":""+e.key,loading:!t.passive&&t.isActionInLoading(e),disabled:t.isActionDisabled(e)||!t.passive&&Boolean(t.loadingAction)},on:{click:function(o){return t.onActionClick(e)}}},"DialogAction",t.getActionProps(e),!1))]}))],2):t._e()};L._withStripped=!0;var I=r({render:L,staticRenderFns:[]},void 0,R,void 0,!1,void 0,!1,void 0,void 0,void 0),N={components:{DialogActions:I,VCard:o.VCard,VCardText:o.VCardText,VToolbar:o.VToolbar,VToolbarTitle:o.VToolbarTitle,VIcon:o.VIcon},layout:["default",{width:450}],mixins:[E,O,B],props:{actionOptions:Object,text:{type:[String,Function],required:!0,default:""}},computed:{getText:function(){return"function"==typeof this.text?this.text():this.text}}},z=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-card",{attrs:{tile:""}},[t.title?o("v-toolbar",{attrs:{dark:Boolean(t.getColor),color:t.getColor,dense:"",flat:""}},[Boolean(t.getIcon)?o("v-icon",{attrs:{left:""}},[t._v("\n "+t._s(t.getIcon)+"\n ")]):t._e(),t._v(" "),o("v-toolbar-title",{},[t._v("\n "+t._s(t.title)+"\n ")])],1):t._e(),t._v(" "),o("v-card-text",{staticClass:"body-1 py-2",class:{"pt-4":!t.title},domProps:{innerHTML:t._s(t.text)}}),t._v(" "),o("DialogActions",t._b({attrs:{actions:t.actions}},"DialogActions",t.actionOptions,!1))],1)};z._withStripped=!0;var H=r({render:z,staticRenderFns:[]},void 0,N,void 0,!1,void 0,!1,void 0,void 0,void 0),W={layout:"snackbar",props:{text:String}},M=function(){var t=this.$createElement;return(this._self._c||t)("div",{domProps:{innerHTML:this._s(this.text)}})};M._withStripped=!0;var q=r({render:M,staticRenderFns:[]},void 0,W,void 0,!1,void 0,!1,void 0,void 0,void 0),K={components:{DialogActions:I,VAlert:o.VAlert},mixins:[E],layout:["notification",{showClose:!1}],props:{color:{type:String,default:"info"},actions:{type:[Array,Object],default:function(){return{}}},text:{type:String,default:""},outlined:Boolean,prominent:Boolean,dismissible:{type:Boolean,default:!0},flat:Boolean,border:String,tile:Boolean,dense:Boolean,coloredBorder:Boolean}},U=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-alert",{staticStyle:{margin:"0","min-width":"300px"},attrs:{dismissible:t.dismissible,type:t.color,icon:t.getIcon,outlined:t.outlined,prominent:t.prominent,text:t.flat,border:t.border,tile:t.tile,dense:t.dense,"colored-border":t.coloredBorder},on:{input:function(e){return t.$emit("submit")}}},[o("div",{staticClass:"d-flex align-center"},[o("div",{staticClass:"mr-2",domProps:{innerHTML:t._s(t.text)}}),t._v(" "),o("DialogActions",{attrs:{actions:t.actions}})],1)])};U._withStripped=!0;var X=r({render:U,staticRenderFns:[]},void 0,K,void 0,!1,void 0,!1,void 0,void 0,void 0),J={components:{VSnackbar:o.VSnackbar,DialogActions:I},mixins:[B,O],props:{timeout:{type:Number,default:5e3},position:String,multiLine:Boolean,vertical:Boolean,elevation:[Number,String],flat:Boolean,centered:Boolean,rounded:[Boolean,String],outlined:Boolean,shaped:Boolean},data:function(){var t=this.position||this.$options.propsData.position||"";return{top:-1!==t.indexOf("top"),left:-1!==t.indexOf("left"),right:-1!==t.indexOf("right"),bottom:-1!==t.indexOf("bottom")}},methods:{_destroy:function(){var t=this;setTimeout((function(){t.$destroy()}),500)}}},G=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-snackbar",{staticClass:"application",attrs:{timeout:t.timeout,color:t.getColor,top:t.top,left:t.left,right:t.right,bottom:t.bottom,"multi-line":t.multiLine,vertical:t.vertical,elevation:t.elevation,text:t.flat,centered:t.centered,rounded:t.rounded,outlined:t.outlined,shaped:t.shaped},on:{click:t.dismiss},model:{value:t.isActive,callback:function(e){t.isActive=e},expression:"isActive"}},[o("dialog-child",t._b({ref:"dialog"},"dialog-child",t.$options.propsData,!1)),t._v(" "),o("DialogActions",{attrs:{slot:"action",actions:t.actions},slot:"action"})],1)};G._withStripped=!0;var Q=r({render:G,staticRenderFns:[]},void 0,J,void 0,!1,void 0,!1,void 0,void 0,void 0),Y={inheritAttrs:!1,components:{DialogActions:I,VCard:o.VCard,VCardTitle:o.VCardTitle,VCardText:o.VCardText},props:{title:String,flat:Boolean,innerScroll:Boolean,titleClass:[String,Object],actions:[Array,Object,Function],actionOptions:{type:Object,default:function(){return{flat:!0}}},handle:Function,handler:Function},created:function(){this.handle&&console.warn('DEPRECATED: "handle" prop will be deprecated, please use "handler" instead')},methods:{trigger:function(t){this.$refs.actions&&this.$refs.actions.trigger(t)}}},Z=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("v-card",{class:{"v-inner-scroll":t.innerScroll},attrs:{flat:t.flat}},[t._t("title",[t.title?o("v-card-title",{class:t.titleClass},[t._v("\n "+t._s(t.title)+"\n ")]):t._e()]),t._v(" "),o("v-card-text",[t._t("default")],2),t._v(" "),t.actions?o("DialogActions",t._b({ref:"actions",attrs:{actions:t.actions,handler:t.handler||t.handle}},"DialogActions",t.actionOptions,!1)):t._e(),t._v(" "),t._t("footer")],2)};Z._withStripped=!0;var tt=r({render:Z,staticRenderFns:[]},void 0,Y,void 0,!1,void 0,!1,void 0,void 0,void 0),et={components:{DialogCard:tt,VTextField:o.VTextField},layout:"default",mixins:[O],props:{value:String,rules:Array,textField:Object,titleClass:[String,Object],autofocus:{type:Boolean,default:!0}},data:function(){return{editedValue:this.value}},mounted:function(){var t=this;this.autofocus&&setTimeout((function(){t.$refs.input.focus()}),100)},methods:{onEnter:function(){this.$refs.card.$refs.actions.trigger(!0)},handlerClick:function(t,e){if(e.key||this.$emit("submit",e.key),!(!this.rules||this.$refs.input.validate()))return this.$refs.input.focus(),!1;this.$emit("submit",e.key?this.editedValue:e.key)}}},ot=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("DialogCard",{ref:"card",attrs:{title:t.title,actions:t.actions,handler:t.handlerClick,"title-class":t.titleClass}},[o("v-text-field",t._b({ref:"input",attrs:{rules:t.rules,label:t.text},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),t.onEnter(e))}},model:{value:t.editedValue,callback:function(e){t.editedValue=e},expression:"editedValue"}},"v-text-field",t.textField,!1))],1)],1)};ot._withStripped=!0;var it=r({render:ot,staticRenderFns:[]},void 0,et,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={layout:["default",{hideOverlay:!0,persistent:!0,width:300}],components:{VCard:o.VCard,VCardText:o.VCardText,VProgressLinear:o.VProgressLinear},props:{text:String,dark:{type:Boolean,default:!0},color:String}},rt=function(){var t=this.$createElement,e=this._self._c||t;return e("v-card",{attrs:{color:this.color,dark:this.dark}},[e("v-card-text",[this._v("\n "+this._s(this.text)+"\n "),e("v-progress-linear",{staticClass:"mb-0",attrs:{indeterminate:"",color:this.dark?"white":"primary"}})],1)],1)};rt._withStripped=!0;var st=r({render:rt,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),at={mixins:[k],props:{width:{type:Number,default:function(){return 500}}},computed:{getStyle:function(){var t;return(t={})[this.verticalProperty]=this.verticalOffset+"px",t["max-width"]=this.width+"px",t["z-index"]=this.zIndex,t}}},ct=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("transition",{attrs:{name:"vuedl-notification-fade"},on:{"after-leave":t.onTransitionEnd}},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.isActive,expression:"isActive"}],class:["vuedl-notification",t.horizontalClass],style:t.getStyle,attrs:{role:"alert"},on:{mouseenter:t.clearTimer,mouseleave:t.startTimer}},[o("dialog-child",t._b({ref:"dialog"},"dialog-child",t.$options.propsData,!1)),t._v(" "),t.showClose?o("div",{staticClass:"vuedl-notification__closeBtn",domProps:{innerHTML:t._s("×")},on:{click:function(e){return e.stopPropagation(),t.close(e)}}}):t._e()],1)])};ct._withStripped=!0;var lt=r({render:ct,staticRenderFns:[]},void 0,at,void 0,!1,void 0,!1,void 0,void 0,void 0);var dt={install:function t(e,o){if(void 0===o&&(o={}),!t.installed){t.installed=!0,o.container||(o.container="[data-app=true]");var i=o.property||"$dialog",n=o.actions||function(){return{false:"Cancel",true:{text:"OK",color:"primary"}}},r=o.actionOptions||{flat:!0};e.use(V,o);var s=e.prototype[i];s.layout("default",T),s.layout("snackbar",Q),s.layout("notification",lt),e.component("DialogActions",I),e.component("DialogCard",tt),s.component("confirm",H,Object.assign({},{waitForResult:!0,actions:n,actionOptions:r},o.confirm)),s.component("warning",H,Object.assign({},{type:"warning",waitForResult:!0,actions:n,actionOptions:r},o.warning)),s.component("error",H,Object.assign({},{type:"error",waitForResult:!0,actions:["Close"],actionOptions:r},o.error)),s.component("info",H,Object.assign({},{type:"info",waitForResult:!0,actions:["Ok"],actionOptions:r},o.info)),s.component("toast",q,Object.assign({},{waitForResult:!0,actionOptions:r},o.toast)),s.component("loading",st,Object.assign({},{waitForResult:!1},o.loading)),s.withLoading=function(t,e){return s.loading(t).then((function(t){e().then((function(e){return t.close(),e})).catch((function(e){throw t.close(),e}))}))},s.message={info:function(t,e){return s.toast(Object.assign({},{text:t,color:"info"},e))},error:function(t,e){return s.toast(Object.assign({},{text:t,color:"error"},e))},success:function(t,e){return s.toast(Object.assign({},{text:t,color:"success"},e))},warning:function(t,e){return s.toast(Object.assign({},{text:t,color:"warning"},e))}},s.component("notification",X,Object.assign({},{waitForResult:!0},o.notification)),s.notify={info:function(t,e){return s.notification(Object.assign({},{text:t,color:"info"},e))},error:function(t,e){return s.notification(Object.assign({},{text:t,color:"error"},e))},success:function(t,e){return s.notification(Object.assign({},{text:t,color:"success"},e))},warning:function(t,e){return s.notification(Object.assign({},{text:t,color:"warning"},e))}},s.component("prompt",it,Object.assign({},{waitForResult:!0,actions:n},o.prompt))}}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(dt),t.default=dt,t}({},Vue,Vuetify);