vuetify-dialogue
Version:
Dialog helper for vuetify.js
2 lines (1 loc) • 29.6 kB
JavaScript
var VuetifyDialogue=function(t,e,i){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var n={computed:{$parameters:function(){return this.$attrs||this.$options.propsData||this.$props||{}},isNewRecord:function(){return!this.$parameters||!this.$parameters[this.$options.primaryKey]}}},o={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,i,n,o,r,s,a,c,l){"boolean"!=typeof s&&(c=a,a=s,s=!1);var d,u="function"==typeof i?i.options:i;if(t&&t.render&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,o&&(u.functional=!0)),n&&(u._scopeId=n),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 f=u.beforeCreate;u.beforeCreate=f?[].concat(f,d):[d]}return i}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 i=this;void 0===e&&(e={});var n=[],o=this,r={};if("object"!=typeof t)return t;var s=function(s){var a=t[s];l(a)&&(a=a.call(i,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(i){return e.asyncDataError.call(o,i,{key:s,obj:t})}))),n.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)?n.push(u.call(o,a,e).then((function(t){r[s]=t}))):r[s]=a};for(var a in t)s(a);return Promise.all(n).then((function(){return Promise.resolve(r)}))}var p=function(t,e){var i=[];if(t.options.asyncData){var n=function(t,e){var i;if(i=l(t)?t.call(this,e):t,!d(i)){if("object"==typeof i)return u.call(this,i,e);i=Promise.resolve(i)}var n=this;return i.then((function(t){return u.call(n,t)}))}(t.options.asyncData,e);n.then((function(e){return function(t,e){var i=t.options._originDataFn||t.options.data||function(){return{}};t.options._originDataFn=i,e?(t.options.data=function(){var t=i.call(this);return Object.assign({},t,e)},t._Ctor&&t._Ctor.options&&(t._Ctor.options.data=t.options.data)):t.options.data=i}(t,e),e})),i.push(n)}return t.options.fetch&&i.push(t.options.fetch(e)),Promise.all(i)};function f(t){t&&!t._isDestroyed&&"function"==typeof t.$destroy&&t.$destroy()}function h(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 i=e.layout,n=e.container;if(!t)throw Error("Component was not set");this._layout=i||{component:c,options:{}},this._component=t,this._vm=null,this._vmDialog=null,this._options={},this.id=++v,this._resolvers=[],this.container=h(n)},y={showed:{configurable:!0},element:{configurable:!0},hasAsyncPreload:{configurable:!0},vm:{configurable:!0},vmd:{configurable:!0}};m.prototype.show=async function(t,i){if(void 0===t&&(t={}),void 0===i&&(i={}),!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:[n]})),this.hasAsyncPreload&&await p(r,Object.assign({},this.context,{params:t}));var s=e.extend({mixins:[o],components:{"dialog-child":r}});s=s.extend(this._layout.component),r.options.inheritAttrs=!1;var a=Object.assign({},this._layout.options,t,i&&i.propsData),c=new s(Object.assign({},this.context,i,{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?h(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(),f(this._vm),f(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 i=t.context,n=t.container;this._context=i||{},m.prototype.context=i||{},this._components={},this._layouts={},this._overlays={},this._container=n,this._emitter=new e({}),this._instances=[]},b={context:{configurable:!0}};b.context.get=function(){return this._context},_.prototype.layout=function(t,e,i){void 0===i&&(i={}),this._layouts[t]={component:e,options:i}},_.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 i=t[0],n=t[1]||{},o="object"==typeof i&&"function"==typeof i.render?{component:i}:this._layouts[i];return o&&{component:o.component,options:Object.assign({},o.options,n)}}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,i){var n=this;if(void 0===i&&(i={}),void 0===e)return this._components[t];this._components[t]={component:e,options:i},Object.defineProperty(this,t,{get:function(){return n.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"),i=new m(t,{layout:e,context:this._context,container:this._container});return this._emitter.$emit("created",{dialog:i}),i},_.prototype.show=async function(t,e){void 0===e&&(e={});var i=this.create(t),n=!!i.hasAsyncPreload&&(this.getComponentProperty(t,"overlay")||"default"),o=n&&this._overlays[n]&&this.overlay(n);o&&o.show();try{return await i.show(e),this._emitter.$emit("shown",{dialog:i}),o&&o.hide(),i.onDestroyed=this.onDialogDestroyed.bind(this),e.waitForResult?i.wait():i}catch(t){throw this._emitter.$emit("error",{error:t,dialog:i}),o&&o.hide(),t}},_.prototype.createFunctionWrapper=function(t){var e=this,i=this.getComponent(t);return function(t){return e.show(i.component,Object.assign({},i.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 x={name:"VDialogOverlay",props:{zIndex:{type:Number,default:function(){return 1250}},visible:{type:Boolean,default:function(){return!1}}}},w=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()])};w._withStripped=!0;var $=r({render:w,staticRenderFns:[]},void 0,x,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 i in e){var n=e[i];["string","boolean"].includes(typeof n)&&(n={text:n}),n.key||(n.key=isNaN(i)?i:n.text||i),["true","false"].indexOf(n.key)>=0&&(n.key=JSON.parse(n.key)),this.isActionVisible(n)&&("string"==typeof n.icon&&(n.icon={text:n.icon}),t.push(n))}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,i=t.handle||t.handler||this.handle||this.handler;if("function"==typeof i){this.loadingAction=t.key,this.setLoadingState(!0);try{var n=await i(this.params,t);this.setLoadingState(!1),!1!==n&&e&&this.return(n||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,i,n;t?(i=(e=this).position,n=10,A.filter((function(t){return t.position===i})).forEach((function(t){n+=t.$el.offsetHeight+10})),A.push(e),e.verticalOffset=n):function(t){var e=A.findIndex((function(e){return e===t}));if(!(e<0)){A.splice(e,1);var i=A.length,n=t.position;if(i){var o=10;A.filter((function(t){return t.position===n})).forEach((function(t){t.verticalOffset=o,o+=t.$el.offsetHeight+10}))}}}(this)}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}};var S={install:function t(e,i){if(void 0===i&&(i={}),!t.installed){t.installed=!0;var n=i.property||"$dialog",o=new _(i);o.overlay("default",$),e.prototype[n]?console.warn("Property "+n+" is already defined in Vue prototype"):Object.defineProperty(e.prototype,n,{get:function(){return o},configurable:!0})}}},T=null;"undefined"!=typeof window?T=window.Vue:"undefined"!=typeof global&&(T=global.Vue),T&&T.use(S);var V={components:{VDialog:i.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)}}},D=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("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.apply(null,arguments)}},model:{value:t.isActive,callback:function(e){t.isActive=e},expression:"isActive"}},[i("div",{staticClass:"v-dialog-wrapper"},[!t.showClose||t.persistent||t.loading?t._e():i("div",{staticClass:"vuedl-layout__closeBtn",on:{click:function(e){return e.stopPropagation(),t.close.apply(null,arguments)}}},[t._v("\n ×\n ")]),t._v(" "),i("dialog-child",t._b({ref:"dialog"},"dialog-child",t.$options.propsData,!1))],1)])};D._withStripped=!0;var B=r({render:D,staticRenderFns:[]},void 0,V,void 0,!1,void 0,!1,void 0,void 0,void 0),j={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={props:{i18n:{type:Object,default:void 0}},computed:{hasI18n:function(){return void 0!==this.i18n}},methods:{getTranslate:function(t){return this.hasI18n&&t&&this.i18n.te(t)?this.i18n.t(t):t}}},F={components:{VIcon:i.VIcon,VBtn:i.VBtn},mixins:[P],props:{attrs:Object,component:{type:[String,Object],default:"v-btn"},text:[String,Function],disabled:Boolean,flat:Boolean,depressed:Boolean,elevation:[Number,String],icon:Object,on:{type:Object,default:function(){}}},computed:{actionText:function(){return"function"!=typeof this.text?this.getTranslate(this.text):"function"==typeof this.text?this.text():this.text}}},R=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i(t.component,t._g(t._b({tag:"component",attrs:{text:t.flat,icon:!t.text&&Boolean(t.icon),disabled:t.disabled,depressed:t.depressed},on:{click:function(e){return t.$emit("click",this)}}},"component",t.$attrs,!1),t.on),[t.icon&&!t.icon.right?i("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?i("v-icon",t._b({domProps:{textContent:t._s(t.icon.text)}},"v-icon",t.icon,!1)):t._e()],1)};R._withStripped=!0;var I={components:{DialogAction:r({render:R,staticRenderFns:[]},void 0,F,void 0,!1,void 0,!1,void 0,void 0,void 0),VSpacer:i.VSpacer,VCardActions:i.VCardActions},mixins:[C,P],props:{component:[String,Object],color:String,flat:Boolean,rounded:Boolean,outlined:Boolean,depressed:Boolean,elevation:[Number,String],passive:Boolean,block:Boolean,large:Boolean,small:Boolean},computed:{nestedProps:function(){return["color","flat","rounded","outlined","depressed","elevation","icon","block","small","large","x-small","x-large"]}},methods:{getActionProps:function(t){var e=this,i={component:t.component||this.component,text:this.getTranslate(t.text)};return this.nestedProps.forEach((function(n){(t[n]||e[n])&&(i[n]=void 0===t[n]?e[n]:t[n])})),i}}},L=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.actionlist&&Object.keys(t.actionlist).length?i("v-card-actions",[t.actions.spacer?t._e():i("v-spacer"),t._v(" "),t._l(t.actionlist,(function(e){return["spacer"===e.key?i("v-spacer",{key:e.key}):i("dialog-action",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(i){return t.onActionClick(e)}}},"dialog-action",t.getActionProps(e),!1))]}))],2):t._e()};L._withStripped=!0;var N=r({render:L,staticRenderFns:[]},void 0,I,void 0,!1,void 0,!1,void 0,void 0,void 0);function z(t){return null!==t&&"object"==typeof t}function H(t,e,i,n){if(void 0===i&&(i="."),!z(e))return H(t,{},i,n);var o=Object.assign({},e);for(var r in t)if("__proto__"!==r&&"constructor"!==r){var s=t[r];null!=s&&(n&&n(o,r,s,i)||(Array.isArray(s)&&Array.isArray(o[r])?o[r]=o[r].concat(s):z(s)&&z(o[r])?o[r]=H(s,o[r],(i?i+".":"")+r.toString(),n):o[r]=s))}return o}function W(t){return function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return e.reduce((function(e,i){return H(e,i,"",t)}),{})}}var M=W();M.fn=W((function(t,e,i,n){if(void 0!==t[e]&&"function"==typeof i)return t[e]=i(t[e]),!0})),M.arrayFn=W((function(t,e,i,n){if(Array.isArray(t[e])&&"function"==typeof i)return t[e]=i(t[e]),!0})),M.extend=W;var q={components:{DialogActions:N,VCard:i.VCard,VCardText:i.VCardText,VToolbar:i.VToolbar,VToolbarTitle:i.VToolbarTitle,VIcon:i.VIcon},layout:["default",{width:450}],mixins:[E,O,j,P],props:{actionOptions:{type:Object,default:function(){return{}}}},computed:{getDialogOptions:function(){var t=this.actionOptions||{};return M({i18n:this.i18n},t)},getText:function(){return"function"!=typeof this.text?this.getTranslate(this.text):"function"==typeof this.text?this.text():this.text},getTitle:function(){return this.getTranslate(this.title)}}},K=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-card",{attrs:{tile:""}},[t.title?i("v-toolbar",{attrs:{dark:Boolean(t.getColor),color:t.getColor,dense:"",flat:""}},[Boolean(t.getIcon)?i("v-icon",{attrs:{left:""}},[t._v("\n "+t._s(t.getIcon)+"\n ")]):t._e(),t._v(" "),i("v-toolbar-title",[t._v(t._s(t.getTitle))])],1):t._e(),t._v(" "),i("v-card-text",{staticClass:"body-1 py-2",class:{"pt-4":!t.title},domProps:{innerHTML:t._s(t.getText)}}),t._v(" "),i("dialog-actions",t._b({attrs:{actions:t.actions}},"dialog-actions",t.getDialogOptions,!1))],1)};K._withStripped=!0;var U=r({render:K,staticRenderFns:[]},void 0,q,void 0,!1,void 0,!1,void 0,void 0,void 0),X={layout:"snackbar",props:{text:String}},J=function(){var t=this.$createElement;return(this._self._c||t)("div",{domProps:{innerHTML:this._s(this.text)}})};J._withStripped=!0;var G=r({render:J,staticRenderFns:[]},void 0,X,void 0,!1,void 0,!1,void 0,void 0,void 0),Q={components:{DialogActions:N,VAlert:i.VAlert},mixins:[E,P],layout:["notification",{showClose:!1}],props:{color:{type:String,default:"info"},actions:{type:[Array,Object],default:function(){return{}}},text:{type:[String,Function],default:""},outlined:Boolean,prominent:Boolean,dismissible:{type:Boolean,default:!0},flat:Boolean,border:String,tile:Boolean,dense:Boolean,coloredBorder:Boolean},computed:{getText:function(){return"function"!=typeof this.text?this.getTranslate(this.text):"function"==typeof this.text?this.text():this.text},getTitle:function(){return this.getTranslate(this.title)}}},Y=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("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.getTitle,dense:t.dense,"colored-border":t.coloredBorder},on:{input:function(e){return t.$emit("submit")}}},[i("div",{staticClass:"d-flex align-center"},[i("div",{staticClass:"mr-2",domProps:{innerHTML:t._s(t.getText)}}),t._v(" "),i("dialog-actions",{attrs:{actions:t.actions}})],1)])};Y._withStripped=!0;var Z=r({render:Y,staticRenderFns:[]},void 0,Q,void 0,!1,void 0,!1,void 0,void 0,void 0),tt={components:{VSnackbar:i.VSnackbar,DialogActions:N},mixins:[j,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)}}},et=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("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"}},[i("dialog-child",t._b({ref:"dialog"},"dialog-child",t.$options.propsData,!1)),t._v(" "),i("dialog-actions",{attrs:{slot:"action",actions:t.actions},slot:"action"})],1)};et._withStripped=!0;var it=r({render:et,staticRenderFns:[]},void 0,tt,void 0,!1,void 0,!1,void 0,void 0,void 0),nt={inheritAttrs:!1,mixins:[P],components:{DialogActions:N,VCard:i.VCard,VCardTitle:i.VCardTitle,VCardText:i.VCardText},props:{title:String,flat:Boolean,innerScroll:Boolean,titleClass:[String,Object],actions:[Array,Object,Function],actionOptions:{type:Object,default:function(){return{flat:!0}}},handler:Function},computed:{getDialogOptions:function(){var t=this.actionOptions||{};return M({i18n:this.i18n},t)}},methods:{trigger:function(t){this.$refs.actions&&this.$refs.actions.trigger(t)}}},ot=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-card",{class:{"v-inner-scroll":t.innerScroll},attrs:{flat:t.flat}},[t._t("title",(function(){return[t.title?i("v-card-title",{class:t.titleClass},[t._v("\n "+t._s(t.title)+"\n ")]):t._e()]})),t._v(" "),i("v-card-text",[t._t("default")],2),t._v(" "),t.actions?i("dialog-actions",t._b({ref:"actions",attrs:{actions:t.actions,handler:t.handler}},"dialog-actions",t.getDialogOptions,!1)):t._e(),t._v(" "),t._t("footer")],2)};ot._withStripped=!0;var rt=r({render:ot,staticRenderFns:[]},void 0,nt,void 0,!1,void 0,!1,void 0,void 0,void 0),st={components:{DialogCard:rt,VTextField:i.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())&&this.$refs.input)return this.$refs.input.focus(),!1;this.$emit("submit",e.key?this.editedValue:e.key)}}},at=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("dialog-card",{ref:"card",attrs:{title:t.title,actions:t.actions,handler:t.handlerClick,"title-class":t.titleClass}},[i("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.apply(null,arguments))}},model:{value:t.editedValue,callback:function(e){t.editedValue=e},expression:"editedValue"}},"v-text-field",t.textField,!1))],1)};at._withStripped=!0;var ct=r({render:at,staticRenderFns:[]},void 0,st,void 0,!1,void 0,!1,void 0,void 0,void 0),lt={layout:["default",{hideOverlay:!0,persistent:!0,width:300}],components:{VCard:i.VCard,VCardText:i.VCardText,VProgressLinear:i.VProgressLinear},props:{text:String,dark:{type:Boolean,default:!0},color:String}},dt=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)};dt._withStripped=!0;var ut=r({render:dt,staticRenderFns:[]},void 0,lt,void 0,!1,void 0,!1,void 0,void 0,void 0),pt={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}}},ft=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("transition",{attrs:{name:"vuedl-notification-fade"},on:{"after-leave":t.onTransitionEnd}},[i("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}},[i("dialog-child",t._b({ref:"dialog"},"dialog-child",t.$options.propsData,!1)),t._v(" "),t.showClose?i("div",{staticClass:"vuedl-notification__closeBtn",domProps:{innerHTML:t._s("×")},on:{click:function(e){return e.stopPropagation(),t.close.apply(null,arguments)}}}):t._e()],1)])};ft._withStripped=!0;var ht=r({render:ft,staticRenderFns:[]},void 0,pt,void 0,!1,void 0,!1,void 0,void 0,void 0);function vt(t,e,i){return void 0===t?i:t.te(e+"."+i)?t.t(e+"."+i):i}var mt={install:function t(e,i){if(void 0===i&&(i={}),!t.installed){t.installed=!0,i.container||(i.container="[data-app=true]");var n=i.property||"$dialog",o=(i.context||{}).i18n,r=vt(o,n,"cancel"),s=vt(o,n,"ok"),a=M(i.actions,{false:r,true:{text:s,color:"primary"}}),c=i.actionOptions||{flat:!1};e.use(S,i);var l=e.prototype[n];l.layout("default",B),l.layout("snackbar",it),l.layout("notification",ht),e.component("DialogActions",N),e.component("DialogCard",rt),e.component("dialog-actions",N),e.component("dialog-card",rt),l.component("confirm",U,M(i.confirm,{i18n:o,actionOptions:c,actions:a,waitForResult:!0})),l.component("warning",U,M(i.warning,{i18n:o,type:"warning",waitForResult:!0,actions:a,actionOptions:c})),l.component("error",U,M(i.error,{i18n:o,type:"error",waitForResult:!0,actions:["Close"],actionOptions:c})),l.component("info",U,M(i.info,{i18n:o,type:"info",waitForResult:!0,actions:["Ok"],actionOptions:c})),l.component("toast",G,M(i.toast,{i18n:o,waitForResult:!0,actionOptions:c})),l.component("loading",ut,M(i.loading,{i18n:o,waitForResult:!1})),l.withLoading=function(t,e){return l.loading(t).then((function(t){e().then((function(e){return t.close(),e})).catch((function(e){throw t.close(),e}))}))},l.message={info:function(t,e){return l.toast(Object.assign({},{text:t,color:"info"},e))},error:function(t,e){return l.toast(Object.assign({},{text:t,color:"error"},e))},success:function(t,e){return l.toast(Object.assign({},{text:t,color:"success"},e))},warning:function(t,e){return l.toast(Object.assign({},{text:t,color:"warning"},e))}},l.component("notification",Z,M(i.notification,{i18n:o,waitForResult:!0})),l.notify={info:function(t,e){return l.notification(Object.assign({},{text:t,color:"info"},e))},error:function(t,e){return l.notification(Object.assign({},{text:t,color:"error"},e))},success:function(t,e){return l.notification(Object.assign({},{text:t,color:"success"},e))},warning:function(t,e){return l.notification(Object.assign({},{text:t,color:"warning"},e))}},l.component("prompt",ct,M(i.prompt,{i18n:o,waitForResult:!0,actions:a}))}}};return"undefined"!=typeof window&&window.Vue&&window.Vue.use(mt),t.default=mt,t}({},Vue,Vuetify);