Socket
Socket
Sign inDemoInstall

vuedl

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vuedl - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

dist/vuedl.css

342

dist/vuedl.cjs.js

@@ -9,2 +9,3 @@ 'use strict';

var merge = _interopDefault(require('lodash/merge'));
var vueAsyncable = require('vue-asyncable');

@@ -259,68 +260,2 @@ var Recordable = {

*/
var noopData = function () { return ({}); };
/* else if (typeof fn === 'object') {
} */
function promisify(fn, context) {
var promise;
if (fn.length === 2) {
// fn(context, callback)
promise = new Promise(function (resolve) {
fn(context, function (err, data) {
if (err) {
context.error(err);
}
data = data || {};
resolve(data);
});
});
} else {
promise = fn(context);
}
if (!isPromise(promise)) {
if (typeof promise === 'object') {
promise = checkObjectForPromises(promise, context);
} else {
promise = Promise.resolve(promise);
}
}
return promise;
}
function checkObjectForPromises(obj, context) {
var promises = [];
var data = {};
if (typeof obj === 'object') {
var loop = function ( key ) {
var something = obj[key];
if (typeof something === 'function') {
something = something(context);
}
if (isPromise(something)) {
var newPromise = something.then(function (res) {
data[key] = res;
});
promises.push(newPromise);
} else {
data[key] = something;
}
};
for (var key in obj) loop( key );
}
return Promise.all(promises).then(function () { return Promise.resolve(data); });
}
function isPromise(promise) {
return promise && (promise instanceof Promise || typeof promise.then === 'function');
}
function destroyVueElement(vm) {

@@ -345,62 +280,12 @@ if (vm && !vm._isDestroyed && typeof vm.$destroy === 'function') {

return found;
}
function applyAsyncData(Component, asyncData) {
var ComponentData = Component.options.data || noopData; // Prevent calling this method for each request on SSR context
if (!asyncData && Component.options.hasAsyncData) {
return;
}
Component.options.hasAsyncData = true;
Component.options.data = function () {
var data = ComponentData.call(this);
if (this.$ssrContext) {
asyncData = this.$ssrContext.asyncData[Component.cid];
}
return Object.assign({}, data, asyncData);
};
if (Component._Ctor && Component._Ctor.options) {
Component._Ctor.options.data = Component.options.data;
}
}
function ensureAsyncDatas(components, context) {
return new Promise(function ($return, $error) {
if (!Array.isArray(components)) {
if (!components) {
return $return(null);
} else {
components = [components];
}
}
return $return(Promise.all(components.map(function (Component) {
var promises = []; // Call asyncData(context)
if (Component.options.asyncData && typeof Component.options.asyncData === 'function') {
var promise = promisify(Component.options.asyncData, context);
promise.then(function (asyncDataResult) {
// ssrContext.asyncData[Component.cid] = asyncDataResult
applyAsyncData(Component, asyncDataResult);
return asyncDataResult;
});
promises.push(promise);
} else {
promises.push(null);
} // Call fetch(context)
if (Component.options.fetch) {
promises.push(Component.options.fetch(context));
} else {
promises.push(null);
}
return Promise.all(promises);
})));
});
} // todo
// export function middlewareSeries (promises, appContext) {
// if (!promises.length || appContext._redirected || appContext._errored) {
// return Promise.resolve()
// }
// return promisify(promises[0], appContext)
// .then(() => {
// return middlewareSeries(promises.slice(1), appContext)
// })
// }

@@ -461,26 +346,23 @@ /*

}));
} else {
Component.options.parent = layout;
} // add primary key mixin
if (this._component.primaryKey) {
Component = Component.extend({
mixins: [Recordable]
});
}
if (this.hasAsyncPreload) {
return Promise.resolve(ensureAsyncDatas(Component, Object.assign({}, this.context, {
params: params
}))).then(function ($await_3) {
try {
return $If_2.call(this);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}
if (Component.options.primaryKey) {
Component = Component.extend({
mixins: [Recordable]
});
}
function $If_2() {
return $If_1.call(this);
}
return $If_2.call(this);
if (this.hasAsyncPreload) {
return Promise.resolve(vueAsyncable.ensureComponentAsyncData(Component, Object.assign({}, this.context, {
params: params
}))).then(function ($await_2) {
try {
return $If_1.call(this);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}

@@ -562,3 +444,3 @@

prototypeAccessors.hasAsyncPreload.get = function () {
return this._component && (this._component.asyncData || this._component.fetch);
return this._component && vueAsyncable.hasAsyncPreload(this._component.options || this._component);
};

@@ -596,3 +478,3 @@

var Ctor = Vue.extend(this._component);
this._vm = new Ctor(); // {propsData: { visible: true }}
this._vm = new Ctor();

@@ -611,2 +493,12 @@ this._vm.$mount();

Overlay.prototype.destroy = function destroy () {
if (this._vm) {
this._vm.$el.parentNode.removeChild(this._vm.$el);
this._vm.$destroy();
this._vm = null;
}
};
/*

@@ -735,2 +627,6 @@ * vuedl

DialogManager.prototype.getComponentProperty = function getComponentProperty (component, name) {
return component.options ? component.options[name] : component[name];
};
DialogManager.prototype.create = function create (component) {

@@ -741,3 +637,3 @@ if (!component) {

var layout = this.getLayout(component.layout || 'default');
var layout = this.getLayout(this.getComponentProperty(component, 'layout') || 'default');
var dlg = new Dialog(component, {

@@ -762,3 +658,3 @@ layout: layout,

dlg = this.create(component);
overlayName = dlg.hasAsyncPreload ? component.overlay || 'default' : false;
overlayName = dlg.hasAsyncPreload ? this.getComponentProperty(component, 'overlay') || 'default' : false;
overlay = overlayName && this._overlays[overlayName] && this.overlay(overlayName);

@@ -842,2 +738,147 @@ overlay && overlay.show();

//
//
//
//
//
//
//
//
//
//
//
var script$1 = {
name: 'VDialogOverlay',
props: {
zIndex: {
type: Number,
default: function () { return 1250; }
},
visible: {
type: Boolean,
default: function () { return false; }
}
}
};
/* script */
var __vue_script__$1 = script$1;
/* template */
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"opacity"}},[(_vm.visible)?_c('div',{staticClass:"dialog-overlay-loading",style:({zIndex: _vm.zIndex})},[_vm._v("\n Loading…\n ")]):_vm._e()])};
var __vue_staticRenderFns__$1 = [];
/* style */
var __vue_inject_styles__$1 = undefined;
/* scoped */
var __vue_scope_id__$1 = undefined;
/* module identifier */
var __vue_module_identifier__$1 = undefined;
/* functional template */
var __vue_is_functional_template__$1 = false;
/* component normalizer */
function __vue_normalize__$1(
template, style, script,
scope, functional, moduleIdentifier,
createInjector, createInjectorSSR
) {
var component = (typeof script === 'function' ? script.options : script) || {};
// For security concerns, we use only base name in production mode.
component.__file = "DialogOverlay.vue";
if (!component.render) {
component.render = template.render;
component.staticRenderFns = template.staticRenderFns;
component._compiled = true;
if (functional) { component.functional = true; }
}
component._scopeId = scope;
return component
}
/* style inject */
function __vue_create_injector__$1() {
var head = document.head || document.getElementsByTagName('head')[0];
var styles = __vue_create_injector__$1.styles || (__vue_create_injector__$1.styles = {});
var isOldIE =
typeof navigator !== 'undefined' &&
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
return function addStyle(id, css) {
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present.
var group = isOldIE ? css.media || 'default' : id;
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
if (!style.ids.includes(id)) {
var code = css.source;
var index = style.ids.length;
style.ids.push(id);
if (css.map) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
// http://stackoverflow.com/a/26603875
code +=
'\n/*# sourceMappingURL=data:application/json;base64,' +
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
' */';
}
if (isOldIE) {
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
}
if (!style.element) {
var el = style.element = document.createElement('style');
el.type = 'text/css';
if (css.media) { el.setAttribute('media', css.media); }
if (isOldIE) {
el.setAttribute('data-group', group);
el.setAttribute('data-next-index', '0');
}
head.appendChild(el);
}
if (isOldIE) {
index = parseInt(style.element.getAttribute('data-next-index'));
style.element.setAttribute('data-next-index', index + 1);
}
if (style.element.styleSheet) {
style.parts.push(code);
style.element.styleSheet.cssText = style.parts
.filter(Boolean)
.join('\n');
} else {
var textNode = document.createTextNode(code);
var nodes = style.element.childNodes;
if (nodes[index]) { style.element.removeChild(nodes[index]); }
if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }
else { style.element.appendChild(textNode); }
}
}
}
}
/* style inject SSR */
var Overlay$1 = __vue_normalize__$1(
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
__vue_inject_styles__$1,
__vue_script__$1,
__vue_scope_id__$1,
__vue_is_functional_template__$1,
__vue_module_identifier__$1,
__vue_create_injector__$1,
undefined
);
/* @vue/component */

@@ -1197,2 +1238,3 @@ var Returnable = {

var manager = new DialogManager(options);
manager.overlay('default', Overlay$1);

@@ -1199,0 +1241,0 @@ if (!Vue$$1.prototype[property]) {

import Vue from 'vue';
import merge from 'lodash/merge';
import { ensureComponentAsyncData, hasAsyncPreload } from 'vue-asyncable';

@@ -252,68 +253,2 @@ var Recordable = {

*/
var noopData = function () { return ({}); };
/* else if (typeof fn === 'object') {
} */
function promisify(fn, context) {
var promise;
if (fn.length === 2) {
// fn(context, callback)
promise = new Promise(function (resolve) {
fn(context, function (err, data) {
if (err) {
context.error(err);
}
data = data || {};
resolve(data);
});
});
} else {
promise = fn(context);
}
if (!isPromise(promise)) {
if (typeof promise === 'object') {
promise = checkObjectForPromises(promise, context);
} else {
promise = Promise.resolve(promise);
}
}
return promise;
}
function checkObjectForPromises(obj, context) {
var promises = [];
var data = {};
if (typeof obj === 'object') {
var loop = function ( key ) {
var something = obj[key];
if (typeof something === 'function') {
something = something(context);
}
if (isPromise(something)) {
var newPromise = something.then(function (res) {
data[key] = res;
});
promises.push(newPromise);
} else {
data[key] = something;
}
};
for (var key in obj) loop( key );
}
return Promise.all(promises).then(function () { return Promise.resolve(data); });
}
function isPromise(promise) {
return promise && (promise instanceof Promise || typeof promise.then === 'function');
}
function destroyVueElement(vm) {

@@ -338,62 +273,12 @@ if (vm && !vm._isDestroyed && typeof vm.$destroy === 'function') {

return found;
}
function applyAsyncData(Component, asyncData) {
var ComponentData = Component.options.data || noopData; // Prevent calling this method for each request on SSR context
if (!asyncData && Component.options.hasAsyncData) {
return;
}
Component.options.hasAsyncData = true;
Component.options.data = function () {
var data = ComponentData.call(this);
if (this.$ssrContext) {
asyncData = this.$ssrContext.asyncData[Component.cid];
}
return Object.assign({}, data, asyncData);
};
if (Component._Ctor && Component._Ctor.options) {
Component._Ctor.options.data = Component.options.data;
}
}
function ensureAsyncDatas(components, context) {
return new Promise(function ($return, $error) {
if (!Array.isArray(components)) {
if (!components) {
return $return(null);
} else {
components = [components];
}
}
return $return(Promise.all(components.map(function (Component) {
var promises = []; // Call asyncData(context)
if (Component.options.asyncData && typeof Component.options.asyncData === 'function') {
var promise = promisify(Component.options.asyncData, context);
promise.then(function (asyncDataResult) {
// ssrContext.asyncData[Component.cid] = asyncDataResult
applyAsyncData(Component, asyncDataResult);
return asyncDataResult;
});
promises.push(promise);
} else {
promises.push(null);
} // Call fetch(context)
if (Component.options.fetch) {
promises.push(Component.options.fetch(context));
} else {
promises.push(null);
}
return Promise.all(promises);
})));
});
} // todo
// export function middlewareSeries (promises, appContext) {
// if (!promises.length || appContext._redirected || appContext._errored) {
// return Promise.resolve()
// }
// return promisify(promises[0], appContext)
// .then(() => {
// return middlewareSeries(promises.slice(1), appContext)
// })
// }

@@ -454,26 +339,23 @@ /*

}));
} else {
Component.options.parent = layout;
} // add primary key mixin
if (this._component.primaryKey) {
Component = Component.extend({
mixins: [Recordable]
});
}
if (this.hasAsyncPreload) {
return Promise.resolve(ensureAsyncDatas(Component, Object.assign({}, this.context, {
params: params
}))).then(function ($await_3) {
try {
return $If_2.call(this);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}
if (Component.options.primaryKey) {
Component = Component.extend({
mixins: [Recordable]
});
}
function $If_2() {
return $If_1.call(this);
}
return $If_2.call(this);
if (this.hasAsyncPreload) {
return Promise.resolve(ensureComponentAsyncData(Component, Object.assign({}, this.context, {
params: params
}))).then(function ($await_2) {
try {
return $If_1.call(this);
} catch ($boundEx) {
return $error($boundEx);
}
}.bind(this), $error);
}

@@ -555,3 +437,3 @@

prototypeAccessors.hasAsyncPreload.get = function () {
return this._component && (this._component.asyncData || this._component.fetch);
return this._component && hasAsyncPreload(this._component.options || this._component);
};

@@ -589,3 +471,3 @@

var Ctor = Vue.extend(this._component);
this._vm = new Ctor(); // {propsData: { visible: true }}
this._vm = new Ctor();

@@ -604,2 +486,12 @@ this._vm.$mount();

Overlay.prototype.destroy = function destroy () {
if (this._vm) {
this._vm.$el.parentNode.removeChild(this._vm.$el);
this._vm.$destroy();
this._vm = null;
}
};
/*

@@ -728,2 +620,6 @@ * vuedl

DialogManager.prototype.getComponentProperty = function getComponentProperty (component, name) {
return component.options ? component.options[name] : component[name];
};
DialogManager.prototype.create = function create (component) {

@@ -734,3 +630,3 @@ if (!component) {

var layout = this.getLayout(component.layout || 'default');
var layout = this.getLayout(this.getComponentProperty(component, 'layout') || 'default');
var dlg = new Dialog(component, {

@@ -755,3 +651,3 @@ layout: layout,

dlg = this.create(component);
overlayName = dlg.hasAsyncPreload ? component.overlay || 'default' : false;
overlayName = dlg.hasAsyncPreload ? this.getComponentProperty(component, 'overlay') || 'default' : false;
overlay = overlayName && this._overlays[overlayName] && this.overlay(overlayName);

@@ -835,2 +731,147 @@ overlay && overlay.show();

//
//
//
//
//
//
//
//
//
//
//
var script$1 = {
name: 'VDialogOverlay',
props: {
zIndex: {
type: Number,
default: function () { return 1250; }
},
visible: {
type: Boolean,
default: function () { return false; }
}
}
};
/* script */
var __vue_script__$1 = script$1;
/* template */
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('transition',{attrs:{"name":"opacity"}},[(_vm.visible)?_c('div',{staticClass:"dialog-overlay-loading",style:({zIndex: _vm.zIndex})},[_vm._v("\n Loading…\n ")]):_vm._e()])};
var __vue_staticRenderFns__$1 = [];
/* style */
var __vue_inject_styles__$1 = undefined;
/* scoped */
var __vue_scope_id__$1 = undefined;
/* module identifier */
var __vue_module_identifier__$1 = undefined;
/* functional template */
var __vue_is_functional_template__$1 = false;
/* component normalizer */
function __vue_normalize__$1(
template, style, script,
scope, functional, moduleIdentifier,
createInjector, createInjectorSSR
) {
var component = (typeof script === 'function' ? script.options : script) || {};
// For security concerns, we use only base name in production mode.
component.__file = "DialogOverlay.vue";
if (!component.render) {
component.render = template.render;
component.staticRenderFns = template.staticRenderFns;
component._compiled = true;
if (functional) { component.functional = true; }
}
component._scopeId = scope;
return component
}
/* style inject */
function __vue_create_injector__$1() {
var head = document.head || document.getElementsByTagName('head')[0];
var styles = __vue_create_injector__$1.styles || (__vue_create_injector__$1.styles = {});
var isOldIE =
typeof navigator !== 'undefined' &&
/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());
return function addStyle(id, css) {
if (document.querySelector('style[data-vue-ssr-id~="' + id + '"]')) { return } // SSR styles are present.
var group = isOldIE ? css.media || 'default' : id;
var style = styles[group] || (styles[group] = { ids: [], parts: [], element: undefined });
if (!style.ids.includes(id)) {
var code = css.source;
var index = style.ids.length;
style.ids.push(id);
if (css.map) {
// https://developer.chrome.com/devtools/docs/javascript-debugging
// this makes source maps inside style tags work properly in Chrome
code += '\n/*# sourceURL=' + css.map.sources[0] + ' */';
// http://stackoverflow.com/a/26603875
code +=
'\n/*# sourceMappingURL=data:application/json;base64,' +
btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) +
' */';
}
if (isOldIE) {
style.element = style.element || document.querySelector('style[data-group=' + group + ']');
}
if (!style.element) {
var el = style.element = document.createElement('style');
el.type = 'text/css';
if (css.media) { el.setAttribute('media', css.media); }
if (isOldIE) {
el.setAttribute('data-group', group);
el.setAttribute('data-next-index', '0');
}
head.appendChild(el);
}
if (isOldIE) {
index = parseInt(style.element.getAttribute('data-next-index'));
style.element.setAttribute('data-next-index', index + 1);
}
if (style.element.styleSheet) {
style.parts.push(code);
style.element.styleSheet.cssText = style.parts
.filter(Boolean)
.join('\n');
} else {
var textNode = document.createTextNode(code);
var nodes = style.element.childNodes;
if (nodes[index]) { style.element.removeChild(nodes[index]); }
if (nodes.length) { style.element.insertBefore(textNode, nodes[index]); }
else { style.element.appendChild(textNode); }
}
}
}
}
/* style inject SSR */
var Overlay$1 = __vue_normalize__$1(
{ render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
__vue_inject_styles__$1,
__vue_script__$1,
__vue_scope_id__$1,
__vue_is_functional_template__$1,
__vue_module_identifier__$1,
__vue_create_injector__$1,
undefined
);
/* @vue/component */

@@ -1190,2 +1231,3 @@ var Returnable = {

var manager = new DialogManager(options);
manager.overlay('default', Overlay$1);

@@ -1192,0 +1234,0 @@ if (!Vue$$1.prototype[property]) {

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],n):n(t.vuedl={},t.Vue)}(this,function(t,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var e={computed:{$parameters:function(){return this.$options.propsData},isNewRecord:function(){return!this.$options.primaryKey||!this.$options.propsData||!this.$options.propsData[this.$options.primaryKey]}}},r={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}}},i={name:"Layoutable",mixins:[r],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)}};var o=function(){this.__data__=[],this.size=0};var s=function(t,n){return t===n||t!=t&&n!=n};var u=function(t,n){for(var e=t.length;e--;)if(s(t[e][0],n))return e;return-1},a=Array.prototype.splice;var c=function(t){var n=this.__data__,e=u(n,t);return!(e<0||(e==n.length-1?n.pop():a.call(n,e,1),--this.size,0))};var f=function(t){var n=this.__data__,e=u(n,t);return e<0?void 0:n[e][1]};var h=function(t){return u(this.__data__,t)>-1};var l=function(t,n){var e=this.__data__,r=u(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this};function p(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}p.prototype.clear=o,p.prototype.delete=c,p.prototype.get=f,p.prototype.has=h,p.prototype.set=l;var v=p;var d=function(){this.__data__=new v,this.size=0};var y=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e};var _=function(t){return this.__data__.get(t)};var b=function(t){return this.__data__.has(t)},g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(t,n){return t(n={exports:{}},n.exports),n.exports}var w="object"==typeof g&&g&&g.Object===Object&&g,j="object"==typeof self&&self&&self.Object===Object&&self,A=w||j||Function("return this")(),O=A.Symbol,$=Object.prototype,x=$.hasOwnProperty,P=$.toString,S=O?O.toStringTag:void 0;var z=function(t){var n=x.call(t,S),e=t[S];try{t[S]=void 0}catch(t){}var r=P.call(t);return n?t[S]=e:delete t[S],r},T=Object.prototype.toString;var E=function(t){return T.call(t)},L="[object Null]",F="[object Undefined]",I=O?O.toStringTag:void 0;var D=function(t){return null==t?void 0===t?F:L:I&&I in Object(t)?z(t):E(t)};var N=function(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)},R="[object AsyncFunction]",V="[object Function]",k="[object GeneratorFunction]",B="[object Proxy]";var q,U=function(t){if(!N(t))return!1;var n=D(t);return n==V||n==k||n==R||n==B},W=A["__core-js_shared__"],K=(q=/[^.]+$/.exec(W&&W.keys&&W.keys.IE_PROTO||""))?"Symbol(src)_1."+q:"";var G=function(t){return!!K&&K in t},J=Function.prototype.toString;var H=function(t){if(null!=t){try{return J.call(t)}catch(t){}try{return t+""}catch(t){}}return""},Q=/^\[object .+?Constructor\]$/,X=Function.prototype,Y=Object.prototype,Z=X.toString,M=Y.hasOwnProperty,C=RegExp("^"+Z.call(M).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var tt=function(t){return!(!N(t)||G(t))&&(U(t)?C:Q).test(H(t))};var nt=function(t,n){return null==t?void 0:t[n]};var et=function(t,n){var e=nt(t,n);return tt(e)?e:void 0},rt=et(A,"Map"),it=et(Object,"create");var ot=function(){this.__data__=it?it(null):{},this.size=0};var st=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},ut="__lodash_hash_undefined__",at=Object.prototype.hasOwnProperty;var ct=function(t){var n=this.__data__;if(it){var e=n[t];return e===ut?void 0:e}return at.call(n,t)?n[t]:void 0},ft=Object.prototype.hasOwnProperty;var ht=function(t){var n=this.__data__;return it?void 0!==n[t]:ft.call(n,t)},lt="__lodash_hash_undefined__";var pt=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=it&&void 0===n?lt:n,this};function vt(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}vt.prototype.clear=ot,vt.prototype.delete=st,vt.prototype.get=ct,vt.prototype.has=ht,vt.prototype.set=pt;var dt=vt;var yt=function(){this.size=0,this.__data__={hash:new dt,map:new(rt||v),string:new dt}};var _t=function(t){var n=typeof t;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t};var bt=function(t,n){var e=t.__data__;return _t(n)?e["string"==typeof n?"string":"hash"]:e.map};var gt=function(t){var n=bt(this,t).delete(t);return this.size-=n?1:0,n};var mt=function(t){return bt(this,t).get(t)};var wt=function(t){return bt(this,t).has(t)};var jt=function(t,n){var e=bt(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this};function At(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}At.prototype.clear=yt,At.prototype.delete=gt,At.prototype.get=mt,At.prototype.has=wt,At.prototype.set=jt;var Ot=At,$t=200;var xt=function(t,n){var e=this.__data__;if(e instanceof v){var r=e.__data__;if(!rt||r.length<$t-1)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new Ot(r)}return e.set(t,n),this.size=e.size,this};function Pt(t){var n=this.__data__=new v(t);this.size=n.size}Pt.prototype.clear=d,Pt.prototype.delete=y,Pt.prototype.get=_,Pt.prototype.has=b,Pt.prototype.set=xt;var St=Pt,zt=function(){try{var t=et(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var Tt=function(t,n,e){"__proto__"==n&&zt?zt(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e};var Et=function(t,n,e){(void 0===e||s(t[n],e))&&(void 0!==e||n in t)||Tt(t,n,e)};var Lt=function(t){return function(n,e,r){for(var i=-1,o=Object(n),s=r(n),u=s.length;u--;){var a=s[t?u:++i];if(!1===e(o[a],a,o))break}return n}}(),Ft=m(function(t,n){var e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,i=r&&r.exports===e?A.Buffer:void 0,o=i?i.allocUnsafe:void 0;t.exports=function(t,n){if(n)return t.slice();var e=t.length,r=o?o(e):new t.constructor(e);return t.copy(r),r}}),It=A.Uint8Array;var Dt=function(t){var n=new t.constructor(t.byteLength);return new It(n).set(new It(t)),n};var Nt=function(t,n){var e=n?Dt(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)};var Rt=function(t,n){var e=-1,r=t.length;for(n||(n=Array(r));++e<r;)n[e]=t[e];return n},Vt=Object.create,kt=function(){function t(){}return function(n){if(!N(n))return{};if(Vt)return Vt(n);t.prototype=n;var e=new t;return t.prototype=void 0,e}}();var Bt=function(t,n){return function(e){return t(n(e))}}(Object.getPrototypeOf,Object),qt=Object.prototype;var Ut=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||qt)};var Wt=function(t){return"function"!=typeof t.constructor||Ut(t)?{}:kt(Bt(t))};var Kt=function(t){return null!=t&&"object"==typeof t},Gt="[object Arguments]";var Jt=function(t){return Kt(t)&&D(t)==Gt},Ht=Object.prototype,Qt=Ht.hasOwnProperty,Xt=Ht.propertyIsEnumerable,Yt=Jt(function(){return arguments}())?Jt:function(t){return Kt(t)&&Qt.call(t,"callee")&&!Xt.call(t,"callee")},Zt=Array.isArray,Mt=9007199254740991;var Ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Mt};var tn=function(t){return null!=t&&Ct(t.length)&&!U(t)};var nn=function(t){return Kt(t)&&tn(t)};var en=function(){return!1},rn=m(function(t,n){var e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,i=r&&r.exports===e?A.Buffer:void 0,o=(i?i.isBuffer:void 0)||en;t.exports=o}),on="[object Object]",sn=Function.prototype,un=Object.prototype,an=sn.toString,cn=un.hasOwnProperty,fn=an.call(Object);var hn=function(t){if(!Kt(t)||D(t)!=on)return!1;var n=Bt(t);if(null===n)return!0;var e=cn.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&an.call(e)==fn},ln={};ln["[object Float32Array]"]=ln["[object Float64Array]"]=ln["[object Int8Array]"]=ln["[object Int16Array]"]=ln["[object Int32Array]"]=ln["[object Uint8Array]"]=ln["[object Uint8ClampedArray]"]=ln["[object Uint16Array]"]=ln["[object Uint32Array]"]=!0,ln["[object Arguments]"]=ln["[object Array]"]=ln["[object ArrayBuffer]"]=ln["[object Boolean]"]=ln["[object DataView]"]=ln["[object Date]"]=ln["[object Error]"]=ln["[object Function]"]=ln["[object Map]"]=ln["[object Number]"]=ln["[object Object]"]=ln["[object RegExp]"]=ln["[object Set]"]=ln["[object String]"]=ln["[object WeakMap]"]=!1;var pn=function(t){return Kt(t)&&Ct(t.length)&&!!ln[D(t)]};var vn=function(t){return function(n){return t(n)}},dn=m(function(t,n){var e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,i=r&&r.exports===e&&w.process,o=function(){try{var t=r&&r.require&&r.require("util").types;return t||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=o}),yn=dn&&dn.isTypedArray,_n=yn?vn(yn):pn;var bn=function(t,n){if("__proto__"!=n)return t[n]},gn=Object.prototype.hasOwnProperty;var mn=function(t,n,e){var r=t[n];gn.call(t,n)&&s(r,e)&&(void 0!==e||n in t)||Tt(t,n,e)};var wn=function(t,n,e,r){var i=!e;e||(e={});for(var o=-1,s=n.length;++o<s;){var u=n[o],a=r?r(e[u],t[u],u,e,t):void 0;void 0===a&&(a=t[u]),i?Tt(e,u,a):mn(e,u,a)}return e};var jn=function(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r},An=9007199254740991,On=/^(?:0|[1-9]\d*)$/;var $n=function(t,n){var e=typeof t;return!!(n=null==n?An:n)&&("number"==e||"symbol"!=e&&On.test(t))&&t>-1&&t%1==0&&t<n},xn=Object.prototype.hasOwnProperty;var Pn=function(t,n){var e=Zt(t),r=!e&&Yt(t),i=!e&&!r&&rn(t),o=!e&&!r&&!i&&_n(t),s=e||r||i||o,u=s?jn(t.length,String):[],a=u.length;for(var c in t)!n&&!xn.call(t,c)||s&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||$n(c,a))||u.push(c);return u};var Sn=function(t){var n=[];if(null!=t)for(var e in Object(t))n.push(e);return n},zn=Object.prototype.hasOwnProperty;var Tn=function(t){if(!N(t))return Sn(t);var n=Ut(t),e=[];for(var r in t)("constructor"!=r||!n&&zn.call(t,r))&&e.push(r);return e};var En=function(t){return tn(t)?Pn(t,!0):Tn(t)};var Ln=function(t){return wn(t,En(t))};var Fn=function(t,n,e,r,i,o,s){var u=bn(t,e),a=bn(n,e),c=s.get(a);if(c)Et(t,e,c);else{var f=o?o(u,a,e+"",t,n,s):void 0,h=void 0===f;if(h){var l=Zt(a),p=!l&&rn(a),v=!l&&!p&&_n(a);f=a,l||p||v?Zt(u)?f=u:nn(u)?f=Rt(u):p?(h=!1,f=Ft(a,!0)):v?(h=!1,f=Nt(a,!0)):f=[]:hn(a)||Yt(a)?(f=u,Yt(u)?f=Ln(u):N(u)&&!U(u)||(f=Wt(a))):h=!1}h&&(s.set(a,f),i(f,a,r,o,s),s.delete(a)),Et(t,e,f)}};var In=function t(n,e,r,i,o){n!==e&&Lt(e,function(s,u){if(N(s))o||(o=new St),Fn(n,e,u,r,t,i,o);else{var a=i?i(bn(n,u),s,u+"",n,e,o):void 0;void 0===a&&(a=s),Et(n,u,a)}},En)};var Dn=function(t){return t};var Nn=function(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)},Rn=Math.max;var Vn=function(t,n,e){return n=Rn(void 0===n?t.length-1:n,0),function(){for(var r=arguments,i=-1,o=Rn(r.length-n,0),s=Array(o);++i<o;)s[i]=r[n+i];i=-1;for(var u=Array(n+1);++i<n;)u[i]=r[i];return u[n]=e(s),Nn(t,this,u)}};var kn=function(t){return function(){return t}},Bn=zt?function(t,n){return zt(t,"toString",{configurable:!0,enumerable:!1,value:kn(n),writable:!0})}:Dn,qn=800,Un=16,Wn=Date.now;var Kn=function(t){var n=0,e=0;return function(){var r=Wn(),i=Un-(r-e);if(e=r,i>0){if(++n>=qn)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}(Bn);var Gn=function(t,n){return Kn(Vn(t,n,Dn),t+"")};var Jn=function(t,n,e){if(!N(e))return!1;var r=typeof n;return!!("number"==r?tn(e)&&$n(n,e.length):"string"==r&&n in e)&&s(e[n],t)};var Hn=function(t){return Gn(function(n,e){var r=-1,i=e.length,o=i>1?e[i-1]:void 0,s=i>2?e[2]:void 0;for(o=t.length>3&&"function"==typeof o?(i--,o):void 0,s&&Jn(e[0],e[1],s)&&(o=i<3?void 0:o,i=1),n=Object(n);++r<i;){var u=e[r];u&&t(n,u,r,o)}return n})}(function(t,n,e){In(t,n,e)});var Qn,Xn,Yn,Zn,Mn,Cn=(Qn={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"dialog-layout"},[this._t("default")],2)},staticRenderFns:[]},Yn=void 0,Zn=!1,(Mn=("function"==typeof(Xn={})?Xn.options:Xn)||{}).__file="DefaultLayout.vue",Mn.render||(Mn.render=Qn.render,Mn.staticRenderFns=Qn.staticRenderFns,Mn._compiled=!0,Zn&&(Mn.functional=!0)),Mn._scopeId=Yn,Mn),te=function(){return{}};function ne(t,n){var e;return ee(e=2===t.length?new Promise(function(e){t(n,function(t,r){t&&n.error(t),e(r=r||{})})}):t(n))||(e="object"==typeof e?function(t,n){var e=[],r={};if("object"==typeof t){var i=function(i){var o=t[i];if("function"==typeof o&&(o=o(n)),ee(o)){var s=o.then(function(t){r[i]=t});e.push(s)}else r[i]=o};for(var o in t)i(o)}return Promise.all(e).then(function(){return Promise.resolve(r)})}(e,n):Promise.resolve(e)),e}function ee(t){return t&&(t instanceof Promise||"function"==typeof t.then)}function re(t){t&&!t._isDestroyed&&"function"==typeof t.$destroy&&t.$destroy()}function ie(t){var n;return(n="string"==typeof t?document.querySelector(t):t)||(n=document.body),n}function oe(t,n){return new Promise(function(e,r){if(!Array.isArray(t)){if(!t)return e(null);t=[t]}return e(Promise.all(t.map(function(t){var e=[];if(t.options.asyncData&&"function"==typeof t.options.asyncData){var r=ne(t.options.asyncData,n);r.then(function(n){return function(t,n){var e=t.options.data||te;!n&&t.options.hasAsyncData||(t.options.hasAsyncData=!0,t.options.data=function(){var r=e.call(this);return this.$ssrContext&&(n=this.$ssrContext.asyncData[t.cid]),Object.assign({},r,n)},t._Ctor&&t._Ctor.options&&(t._Ctor.options.data=t.options.data))}(t,n),n}),e.push(r)}else e.push(null);return t.options.fetch?e.push(t.options.fetch(n)):e.push(null),Promise.all(e)})))})}var se=1,ue=function(t,n){void 0===n&&(n={});var e=n.layout,r=n.container;if(!t)throw Error("Component was not setted");this._layout=e||{component:Cn,options:{}},this._component=t,this._vm=null,this._vmDialog=null,this._options={},this.id=++se,this._resolvers=[],this.container=ie(r)},ae={showed:{configurable:!0},element:{configurable:!0},hasAsyncPreload:{configurable:!0},vm:{configurable:!0},vmd:{configurable:!0}};ue.prototype.show=function(t,r){return void 0===t&&(t={}),void 0===r&&(r={}),new Promise(function(o,s){var u,a,c,f;if(n.prototype.$isServer)return o();if(u=(u=n.extend({mixins:[i]})).extend(this._layout.component),a=new u(Hn({propsData:Object.assign({},this._layout.options,t)},this.context,r)),"object"==typeof(c=this._component)&&!c.options){if(c=n.extend(Object.assign({},this._component,{parent:a})),this._component.primaryKey&&(c=c.extend({mixins:[e]})),this.hasAsyncPreload)return Promise.resolve(oe(c,Object.assign({},this.context,{params:t}))).then(function(t){try{return h.call(this)}catch(t){return s(t)}}.bind(this),s);function h(){return l.call(this)}return h.call(this)}function l(){return(f=new c(Hn({propsData:t},this.context,r))).$mount(),a.$slots.default=f._vnode,a.$mount(),a.$on("hook:destroyed",this._onDestroyed.bind(this)),a.$on("submit",this.onReturn.bind(this)),f.$on("submit",this.onReturn.bind(this)),this._vm=a,this._vm._dialogInstance=f,this._vmDialog=f,this.container=r.container?ie(r.container):this.container,this.container.appendChild(this.element),o(this)}return l.call(this)}.bind(this))},ue.prototype.wait=function(){var t=this;return new Promise(function(n){t._resolvers.push(n)})},ue.prototype._onDestroyed=function(){this.remove()},ue.prototype.remove=function(){this.onDestroyed&&this.onDestroyed(this),this._processResultPromises(),re(this._vm),re(this._vmDialog),this._vm=null,this._vmDialog=null},ue.prototype._processResultPromises=function(t){this._resolvers.length&&(this._resolvers.forEach(function(n){return n(t)}),this._resolvers=[])},ue.prototype.onReturn=function(t){this._processResultPromises(t),this.close()},ae.showed.get=function(){return!!this._vm&&!this._vm._isDestroyed},ae.element.get=function(){return this._vm&&this._vm.$el},ae.hasAsyncPreload.get=function(){return this._component&&(this._component.asyncData||this._component.fetch)},ae.vm.get=function(){return this._vm},ae.vmd.get=function(){return this._vmDialog},ue.prototype.close=function(){this._vm&&this._vm.close()},Object.defineProperties(ue.prototype,ae);var ce=function(t){this._component=t,this._vm=null};ce.prototype.show=function(){if(!this._vm){var t=n.extend(this._component);this._vm=new t,this._vm.$mount(),document.body.appendChild(this._vm.$el)}this._vm.visible=!0},ce.prototype.hide=function(){this._vm.visible=!1};var fe={get:function(t,n){return"symbol"==typeof n||"inspect"===n?t[n]:t[n]?t[n]:t._components[n]?t.createFunctionWrapper(n):t[n]}},he=function(t){void 0===t&&(t={});var e=t.context,r=t.container;return this._context=e||{},ue.prototype.context=e||{},this._components={},this._layouts={},this._overlays={},this._container=r,this._emitter=new n({}),this._instances=[],new Proxy(this,fe)},le={context:{configurable:!0}};le.context.get=function(){return this._context},he.prototype.layout=function(t,n,e){void 0===e&&(e={}),this._layouts[t]={component:n,options:e}},he.prototype.getLayout=function(t){if("function"==typeof t){var n=t.call(this._context);return t=this._layouts[n.name||"default"],Object.assign({},t,{options:n})}if("object"==typeof t&&"function"==typeof t.render)return{component:t};if(Array.isArray(t)){var e=t[0],r=t[1]||{},i="object"==typeof e&&"function"==typeof e.render?{component:e}:this._layouts[e];return i&&{component:i.component,options:Object.assign({},i.options,r)}}return this._layouts[t]},he.prototype.overlay=function(t,n){if(void 0===n){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 ce(n)},he.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]},he.prototype.component=function(t,n,e){if(void 0===e&&(e={}),void 0===n)return this._components[t];this._components[t]={component:n,options:e}},he.prototype.create=function(t){if(!t)throw new Error("Component is incorrect");var n=this.getLayout(t.layout||"default"),e=new ue(t,{layout:n,context:this._context,container:this._container});return this._emitter.$emit("created",{dialog:e}),e},he.prototype.show=function(t,n){return void 0===n&&(n={}),new Promise(function(e,r){var i,o,s;o=!!(i=this.create(t)).hasAsyncPreload&&(t.overlay||"default"),(s=o&&this._overlays[o]&&this.overlay(o))&&s.show();var u=function(t){try{throw this._emitter.$emit("error",{error:t,dialog:i}),s&&s.hide(),t}catch(t){return r(t)}}.bind(this);try{return Promise.resolve(i.show(n)).then(function(t){try{return this._emitter.$emit("shown",{dialog:i}),s&&s.hide(),i.onDestroyed=this.onDialogDestroyed.bind(this),e(n.waitForResult?i.wait():i)}catch(t){return u(t)}}.bind(this),u)}catch(t){u(t)}}.bind(this))},he.prototype.createFunctionWrapper=function(t){var n=this,e=this.getComponent(t);return function(t){return n.show(e.component,Object.assign({},e.options,t))}},he.prototype.showAndWait=function(t,n){return new Promise(function(e,r){return Promise.resolve(this.show(t,n)).then(function(t){try{return e(t.wait())}catch(t){return r(t)}},r)}.bind(this))},he.prototype.on=function(t,n){this._emitter.$on(t,n)},he.prototype.off=function(t,n){this._emitter.$off(t,n)},he.prototype.once=function(t,n){this._emitter.$once(t,n)},he.prototype.onDialogDestroyed=function(t){this._emitter.$emit("destroyed",{dialog:t})},Object.defineProperties(he.prototype,le);var pe={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)}}},ve={name:"Actionable",mixins:[pe],data:function(){return{loadingAction:null}},props:{actions:{type:[Array,Object],default:function(){return[]}},handle:Function,params:Object},computed:{actionlist:function(){var t=[];for(var n in this.actions){var e=this.actions[n];"string"==typeof e&&(e={text:e}),e.key||(e.key=isNaN(n)?n:e.text||n),["true","false"].indexOf(e.key)>=0&&(e.key=JSON.parse(e.key)),this.isActionVisible(e)&&("string"==typeof e.icon&&(e.icon={text:e.icon}),t.push(e))}return t}},methods:{trigger:function(t){var n=this.actionlist.find(function(n){return n.key===t});n&&!this.isActionDisabled(n)&&this.isActionVisible(n)&&this.onActionClick(n)},setLoadingToInstance:function(t,n){t&&void 0!==t.loading&&(t.loading=n)},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,n){return void 0===t?n:"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:function(t){return new Promise(function(n,e){var r,i;if(r=void 0===t.closable||!0===t.closable,"function"!=typeof(i=t.handle||this.handle))return r&&this.return(t.key),a.call(this);this.loadingAction=t.key,this.setLoadingState(!0);var o=function(){try{return a.call(this)}catch(t){return e(t)}}.bind(this),s=function(t){try{throw this.setLoadingState(!1),console.log("error",t),t}catch(t){return e(t)}}.bind(this);try{var u;return Promise.resolve(i(this.params)).then(function(n){try{return u=n,this.setLoadingState(!1),!1!==u&&r&&this.return(u||t.key),o()}catch(t){return s(t)}}.bind(this),s)}catch(t){s(t)}function a(){return n()}}.bind(this))}}},de={name:"Confirmable",props:{type:{type:String},text:{type:String,reqiured:!0},title:{type:String},actions:{type:[Array,Object]}}},ye=[],_e={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 n,e,r;t?(e=(n=this).position,r=10,ye.filter(function(t){return t.position===e}).forEach(function(t){r+=t.$el.offsetHeight+10}),ye.push(n),n.verticalOffset=r):function(t){var n=ye.findIndex(function(n){return n===t});if(!(n<0)){ye.splice(n,1);var e=ye.length,r=t.position;if(e){var i=10;ye.filter(function(t){return t.position===r}).forEach(function(t){t.verticalOffset=i,i+=t.$el.offsetHeight+10})}}}(this)}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}};var be={install:function t(n,e){if(void 0===e&&(e={}),!t.installed){t.installed=!0;var r=e.property||"$dialog",i=new he(e);n.prototype[r]?console.warn("Property "+r+" is already defigned in Vue prototype"):Object.defineProperty(n.prototype,r,{get:function(){return i}})}}},ge=null;"undefined"!=typeof window?ge=window.Vue:"undefined"!=typeof global&&(ge=global.Vue),ge&&ge.use(be),t.default=be,t.Actionable=ve,t.Activable=r,t.Confirmable=de,t.Notifiable=_e,t.Recordable=e,t.Returnable=pe,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],n):n(t.vuedl={},t.Vue)}(this,function(t,n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var e={computed:{$parameters:function(){return this.$options.propsData},isNewRecord:function(){return!this.$options.primaryKey||!this.$options.propsData||!this.$options.propsData[this.$options.primaryKey]}}},r={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}}},o={name:"Layoutable",mixins:[r],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)}};var i=function(){this.__data__=[],this.size=0};var s=function(t,n){return t===n||t!=t&&n!=n};var a=function(t,n){for(var e=t.length;e--;)if(s(t[e][0],n))return e;return-1},u=Array.prototype.splice;var c=function(t){var n=this.__data__,e=a(n,t);return!(e<0||(e==n.length-1?n.pop():u.call(n,e,1),--this.size,0))};var f=function(t){var n=this.__data__,e=a(n,t);return e<0?void 0:n[e][1]};var l=function(t){return a(this.__data__,t)>-1};var h=function(t,n){var e=this.__data__,r=a(e,t);return r<0?(++this.size,e.push([t,n])):e[r][1]=n,this};function p(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}p.prototype.clear=i,p.prototype.delete=c,p.prototype.get=f,p.prototype.has=l,p.prototype.set=h;var v=p;var d=function(){this.__data__=new v,this.size=0};var y=function(t){var n=this.__data__,e=n.delete(t);return this.size=n.size,e};var _=function(t){return this.__data__.get(t)};var m=function(t){return this.__data__.has(t)},b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(t,n){return t(n={exports:{}},n.exports),n.exports}var w="object"==typeof b&&b&&b.Object===Object&&b,j="object"==typeof self&&self&&self.Object===Object&&self,A=w||j||Function("return this")(),O=A.Symbol,$=Object.prototype,x=$.hasOwnProperty,P=$.toString,D=O?O.toStringTag:void 0;var C=function(t){var n=x.call(t,D),e=t[D];try{t[D]=void 0}catch(t){}var r=P.call(t);return n?t[D]=e:delete t[D],r},z=Object.prototype.toString;var S=function(t){return z.call(t)},T="[object Null]",E="[object Undefined]",R=O?O.toStringTag:void 0;var F=function(t){return null==t?void 0===t?E:T:R&&R in Object(t)?C(t):S(t)};var I=function(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)},L="[object AsyncFunction]",N="[object Function]",V="[object GeneratorFunction]",k="[object Proxy]";var B,W=function(t){if(!I(t))return!1;var n=F(t);return n==N||n==V||n==L||n==k},q=A["__core-js_shared__"],U=(B=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+B:"";var K=function(t){return!!U&&U in t},G=Function.prototype.toString;var J=function(t){if(null!=t){try{return G.call(t)}catch(t){}try{return t+""}catch(t){}}return""},H=/^\[object .+?Constructor\]$/,Q=Function.prototype,X=Object.prototype,Y=Q.toString,Z=X.hasOwnProperty,M=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var tt=function(t){return!(!I(t)||K(t))&&(W(t)?M:H).test(J(t))};var nt=function(t,n){return null==t?void 0:t[n]};var et=function(t,n){var e=nt(t,n);return tt(e)?e:void 0},rt=et(A,"Map"),ot=et(Object,"create");var it=function(){this.__data__=ot?ot(null):{},this.size=0};var st=function(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n},at="__lodash_hash_undefined__",ut=Object.prototype.hasOwnProperty;var ct=function(t){var n=this.__data__;if(ot){var e=n[t];return e===at?void 0:e}return ut.call(n,t)?n[t]:void 0},ft=Object.prototype.hasOwnProperty;var lt=function(t){var n=this.__data__;return ot?void 0!==n[t]:ft.call(n,t)},ht="__lodash_hash_undefined__";var pt=function(t,n){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=ot&&void 0===n?ht:n,this};function vt(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}vt.prototype.clear=it,vt.prototype.delete=st,vt.prototype.get=ct,vt.prototype.has=lt,vt.prototype.set=pt;var dt=vt;var yt=function(){this.size=0,this.__data__={hash:new dt,map:new(rt||v),string:new dt}};var _t=function(t){var n=typeof t;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t};var mt=function(t,n){var e=t.__data__;return _t(n)?e["string"==typeof n?"string":"hash"]:e.map};var bt=function(t){var n=mt(this,t).delete(t);return this.size-=n?1:0,n};var gt=function(t){return mt(this,t).get(t)};var wt=function(t){return mt(this,t).has(t)};var jt=function(t,n){var e=mt(this,t),r=e.size;return e.set(t,n),this.size+=e.size==r?0:1,this};function At(t){var n=-1,e=null==t?0:t.length;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}At.prototype.clear=yt,At.prototype.delete=bt,At.prototype.get=gt,At.prototype.has=wt,At.prototype.set=jt;var Ot=At,$t=200;var xt=function(t,n){var e=this.__data__;if(e instanceof v){var r=e.__data__;if(!rt||r.length<$t-1)return r.push([t,n]),this.size=++e.size,this;e=this.__data__=new Ot(r)}return e.set(t,n),this.size=e.size,this};function Pt(t){var n=this.__data__=new v(t);this.size=n.size}Pt.prototype.clear=d,Pt.prototype.delete=y,Pt.prototype.get=_,Pt.prototype.has=m,Pt.prototype.set=xt;var Dt=Pt,Ct=function(){try{var t=et(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();var zt=function(t,n,e){"__proto__"==n&&Ct?Ct(t,n,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[n]=e};var St=function(t,n,e){(void 0===e||s(t[n],e))&&(void 0!==e||n in t)||zt(t,n,e)};var Tt=function(t){return function(n,e,r){for(var o=-1,i=Object(n),s=r(n),a=s.length;a--;){var u=s[t?a:++o];if(!1===e(i[u],u,i))break}return n}}(),Et=g(function(t,n){var e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,o=r&&r.exports===e?A.Buffer:void 0,i=o?o.allocUnsafe:void 0;t.exports=function(t,n){if(n)return t.slice();var e=t.length,r=i?i(e):new t.constructor(e);return t.copy(r),r}}),Rt=A.Uint8Array;var Ft=function(t){var n=new t.constructor(t.byteLength);return new Rt(n).set(new Rt(t)),n};var It=function(t,n){var e=n?Ft(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)};var Lt=function(t,n){var e=-1,r=t.length;for(n||(n=Array(r));++e<r;)n[e]=t[e];return n},Nt=Object.create,Vt=function(){function t(){}return function(n){if(!I(n))return{};if(Nt)return Nt(n);t.prototype=n;var e=new t;return t.prototype=void 0,e}}();var kt=function(t,n){return function(e){return t(n(e))}}(Object.getPrototypeOf,Object),Bt=Object.prototype;var Wt=function(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||Bt)};var qt=function(t){return"function"!=typeof t.constructor||Wt(t)?{}:Vt(kt(t))};var Ut=function(t){return null!=t&&"object"==typeof t},Kt="[object Arguments]";var Gt=function(t){return Ut(t)&&F(t)==Kt},Jt=Object.prototype,Ht=Jt.hasOwnProperty,Qt=Jt.propertyIsEnumerable,Xt=Gt(function(){return arguments}())?Gt:function(t){return Ut(t)&&Ht.call(t,"callee")&&!Qt.call(t,"callee")},Yt=Array.isArray,Zt=9007199254740991;var Mt=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Zt};var tn=function(t){return null!=t&&Mt(t.length)&&!W(t)};var nn=function(t){return Ut(t)&&tn(t)};var en=function(){return!1},rn=g(function(t,n){var e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,o=r&&r.exports===e?A.Buffer:void 0,i=(o?o.isBuffer:void 0)||en;t.exports=i}),on="[object Object]",sn=Function.prototype,an=Object.prototype,un=sn.toString,cn=an.hasOwnProperty,fn=un.call(Object);var ln=function(t){if(!Ut(t)||F(t)!=on)return!1;var n=kt(t);if(null===n)return!0;var e=cn.call(n,"constructor")&&n.constructor;return"function"==typeof e&&e instanceof e&&un.call(e)==fn},hn={};hn["[object Float32Array]"]=hn["[object Float64Array]"]=hn["[object Int8Array]"]=hn["[object Int16Array]"]=hn["[object Int32Array]"]=hn["[object Uint8Array]"]=hn["[object Uint8ClampedArray]"]=hn["[object Uint16Array]"]=hn["[object Uint32Array]"]=!0,hn["[object Arguments]"]=hn["[object Array]"]=hn["[object ArrayBuffer]"]=hn["[object Boolean]"]=hn["[object DataView]"]=hn["[object Date]"]=hn["[object Error]"]=hn["[object Function]"]=hn["[object Map]"]=hn["[object Number]"]=hn["[object Object]"]=hn["[object RegExp]"]=hn["[object Set]"]=hn["[object String]"]=hn["[object WeakMap]"]=!1;var pn=function(t){return Ut(t)&&Mt(t.length)&&!!hn[F(t)]};var vn=function(t){return function(n){return t(n)}},dn=g(function(t,n){var e=n&&!n.nodeType&&n,r=e&&t&&!t.nodeType&&t,o=r&&r.exports===e&&w.process,i=function(){try{var t=r&&r.require&&r.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(t){}}();t.exports=i}),yn=dn&&dn.isTypedArray,_n=yn?vn(yn):pn;var mn=function(t,n){if("__proto__"!=n)return t[n]},bn=Object.prototype.hasOwnProperty;var gn=function(t,n,e){var r=t[n];bn.call(t,n)&&s(r,e)&&(void 0!==e||n in t)||zt(t,n,e)};var wn=function(t,n,e,r){var o=!e;e||(e={});for(var i=-1,s=n.length;++i<s;){var a=n[i],u=r?r(e[a],t[a],a,e,t):void 0;void 0===u&&(u=t[a]),o?zt(e,a,u):gn(e,a,u)}return e};var jn=function(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r},An=9007199254740991,On=/^(?:0|[1-9]\d*)$/;var $n=function(t,n){var e=typeof t;return!!(n=null==n?An:n)&&("number"==e||"symbol"!=e&&On.test(t))&&t>-1&&t%1==0&&t<n},xn=Object.prototype.hasOwnProperty;var Pn=function(t,n){var e=Yt(t),r=!e&&Xt(t),o=!e&&!r&&rn(t),i=!e&&!r&&!o&&_n(t),s=e||r||o||i,a=s?jn(t.length,String):[],u=a.length;for(var c in t)!n&&!xn.call(t,c)||s&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||$n(c,u))||a.push(c);return a};var Dn=function(t){var n=[];if(null!=t)for(var e in Object(t))n.push(e);return n},Cn=Object.prototype.hasOwnProperty;var zn=function(t){if(!I(t))return Dn(t);var n=Wt(t),e=[];for(var r in t)("constructor"!=r||!n&&Cn.call(t,r))&&e.push(r);return e};var Sn=function(t){return tn(t)?Pn(t,!0):zn(t)};var Tn=function(t){return wn(t,Sn(t))};var En=function(t,n,e,r,o,i,s){var a=mn(t,e),u=mn(n,e),c=s.get(u);if(c)St(t,e,c);else{var f=i?i(a,u,e+"",t,n,s):void 0,l=void 0===f;if(l){var h=Yt(u),p=!h&&rn(u),v=!h&&!p&&_n(u);f=u,h||p||v?Yt(a)?f=a:nn(a)?f=Lt(a):p?(l=!1,f=Et(u,!0)):v?(l=!1,f=It(u,!0)):f=[]:ln(u)||Xt(u)?(f=a,Xt(a)?f=Tn(a):I(a)&&!W(a)||(f=qt(u))):l=!1}l&&(s.set(u,f),o(f,u,r,i,s),s.delete(u)),St(t,e,f)}};var Rn=function t(n,e,r,o,i){n!==e&&Tt(e,function(s,a){if(I(s))i||(i=new Dt),En(n,e,a,r,t,o,i);else{var u=o?o(mn(n,a),s,a+"",n,e,i):void 0;void 0===u&&(u=s),St(n,a,u)}},Sn)};var Fn=function(t){return t};var In=function(t,n,e){switch(e.length){case 0:return t.call(n);case 1:return t.call(n,e[0]);case 2:return t.call(n,e[0],e[1]);case 3:return t.call(n,e[0],e[1],e[2])}return t.apply(n,e)},Ln=Math.max;var Nn=function(t,n,e){return n=Ln(void 0===n?t.length-1:n,0),function(){for(var r=arguments,o=-1,i=Ln(r.length-n,0),s=Array(i);++o<i;)s[o]=r[n+o];o=-1;for(var a=Array(n+1);++o<n;)a[o]=r[o];return a[n]=e(s),In(t,this,a)}};var Vn=function(t){return function(){return t}},kn=Ct?function(t,n){return Ct(t,"toString",{configurable:!0,enumerable:!1,value:Vn(n),writable:!0})}:Fn,Bn=800,Wn=16,qn=Date.now;var Un=function(t){var n=0,e=0;return function(){var r=qn(),o=Wn-(r-e);if(e=r,o>0){if(++n>=Bn)return arguments[0]}else n=0;return t.apply(void 0,arguments)}}(kn);var Kn=function(t,n){return Un(Nn(t,n,Fn),t+"")};var Gn=function(t,n,e){if(!I(e))return!1;var r=typeof n;return!!("number"==r?tn(e)&&$n(n,e.length):"string"==r&&n in e)&&s(e[n],t)};var Jn=function(t){return Kn(function(n,e){var r=-1,o=e.length,i=o>1?e[o-1]:void 0,s=o>2?e[2]:void 0;for(i=t.length>3&&"function"==typeof i?(o--,i):void 0,s&&Gn(e[0],e[1],s)&&(i=o<3?void 0:i,o=1),n=Object(n);++r<o;){var a=e[r];a&&t(n,a,r,i)}return n})}(function(t,n,e){Rn(t,n,e)});var Hn,Qn,Xn,Yn,Zn,Mn=(Hn={render:function(){var t=this.$createElement;return(this._self._c||t)("div",{staticClass:"dialog-layout"},[this._t("default")],2)},staticRenderFns:[]},Xn=void 0,Yn=!1,(Zn=("function"==typeof(Qn={})?Qn.options:Qn)||{}).__file="DefaultLayout.vue",Zn.render||(Zn.render=Hn.render,Zn.staticRenderFns=Hn.staticRenderFns,Zn._compiled=!0,Yn&&(Zn.functional=!0)),Zn._scopeId=Xn,Zn),te=function(){return{}},ne=function(t){return"function"==typeof t},ee=function(t){return null==t},re=function(t){return t&&(t instanceof Promise||"function"==typeof t.then)};function oe(t,n){var e=this,r=[],o=this,i={};if("object"!=typeof t)return t;var s=function(s){var a=t[s];ne(a)&&(a=a.call(e,n)),re(a)?(a=a.then(function(t){if(!ee(t))return s.startsWith("...")?i=Object.assign({},i,t):i[s]=t,t}),n&&ne(n.error)&&(a=a.catch(function(e){n.error.call(o,{error:e,key:s,obj:t})})),r.push(a)):i[s]=a};for(var a in t)s(a);return Promise.all(r).then(function(){return Promise.resolve(i)})}var ie=function(t,n){var e=[];if(t.options.asyncData){var r=function(t,n){var e;if(e=ne(t)?t.call(this,n):t,!re(e)){if("object"==typeof e)return oe.call(this,e,n);e=Promise.resolve(e)}var r=this;return e.then(function(t){return oe.call(r,t)})}(t.options.asyncData,n);r.then(function(n){return function(t,n){var e=t.options.data||te;n&&!t.options.hasAsyncData&&(t.options.hasAsyncData=!0,t.options.data=function(){var t=e.call(this);return Object.assign({},t,n)},t._Ctor&&t._Ctor.options&&(t._Ctor.options.data=t.options.data))}(t,n),n}),e.push(r)}return t.options.fetch&&e.push(t.options.fetch(n)),Promise.all(e)};function se(t){t&&!t._isDestroyed&&"function"==typeof t.$destroy&&t.$destroy()}function ae(t){var n;return(n="string"==typeof t?document.querySelector(t):t)||(n=document.body),n}var ue=1,ce=function(t,n){void 0===n&&(n={});var e=n.layout,r=n.container;if(!t)throw Error("Component was not setted");this._layout=e||{component:Mn,options:{}},this._component=t,this._vm=null,this._vmDialog=null,this._options={},this.id=++ue,this._resolvers=[],this.container=ae(r)},fe={showed:{configurable:!0},element:{configurable:!0},hasAsyncPreload:{configurable:!0},vm:{configurable:!0},vmd:{configurable:!0}};ce.prototype.show=function(t,r){return void 0===t&&(t={}),void 0===r&&(r={}),new Promise(function(i,s){var a,u,c,f;if(n.prototype.$isServer)return i();if(a=(a=n.extend({mixins:[o]})).extend(this._layout.component),u=new a(Jn({propsData:Object.assign({},this._layout.options,t)},this.context,r)),"object"!=typeof(c=this._component)||c.options?c.options.parent=u:c=n.extend(Object.assign({},this._component,{parent:u})),c.options.primaryKey&&(c=c.extend({mixins:[e]})),this.hasAsyncPreload)return Promise.resolve(ie(c,Object.assign({},this.context,{params:t}))).then(function(t){try{return l.call(this)}catch(t){return s(t)}}.bind(this),s);function l(){return(f=new c(Jn({propsData:t},this.context,r))).$mount(),u.$slots.default=f._vnode,u.$mount(),u.$on("hook:destroyed",this._onDestroyed.bind(this)),u.$on("submit",this.onReturn.bind(this)),f.$on("submit",this.onReturn.bind(this)),this._vm=u,this._vm._dialogInstance=f,this._vmDialog=f,this.container=r.container?ae(r.container):this.container,this.container.appendChild(this.element),i(this)}return l.call(this)}.bind(this))},ce.prototype.wait=function(){var t=this;return new Promise(function(n){t._resolvers.push(n)})},ce.prototype._onDestroyed=function(){this.remove()},ce.prototype.remove=function(){this.onDestroyed&&this.onDestroyed(this),this._processResultPromises(),se(this._vm),se(this._vmDialog),this._vm=null,this._vmDialog=null},ce.prototype._processResultPromises=function(t){this._resolvers.length&&(this._resolvers.forEach(function(n){return n(t)}),this._resolvers=[])},ce.prototype.onReturn=function(t){this._processResultPromises(t),this.close()},fe.showed.get=function(){return!!this._vm&&!this._vm._isDestroyed},fe.element.get=function(){return this._vm&&this._vm.$el},fe.hasAsyncPreload.get=function(){return this._component&&(t=this._component.options||this._component,Boolean(!t.hasAsyncData&&(t.asyncData||t.fetch)));var t},fe.vm.get=function(){return this._vm},fe.vmd.get=function(){return this._vmDialog},ce.prototype.close=function(){this._vm&&this._vm.close()},Object.defineProperties(ce.prototype,fe);var le=function(t){this._component=t,this._vm=null};le.prototype.show=function(){if(!this._vm){var t=n.extend(this._component);this._vm=new t,this._vm.$mount(),document.body.appendChild(this._vm.$el)}this._vm.visible=!0},le.prototype.hide=function(){this._vm.visible=!1},le.prototype.destroy=function(){this._vm&&(this._vm.$el.parentNode.removeChild(this._vm.$el),this._vm.$destroy(),this._vm=null)};var he={get:function(t,n){return"symbol"==typeof n||"inspect"===n?t[n]:t[n]?t[n]:t._components[n]?t.createFunctionWrapper(n):t[n]}},pe=function(t){void 0===t&&(t={});var e=t.context,r=t.container;return this._context=e||{},ce.prototype.context=e||{},this._components={},this._layouts={},this._overlays={},this._container=r,this._emitter=new n({}),this._instances=[],new Proxy(this,he)},ve={context:{configurable:!0}};ve.context.get=function(){return this._context},pe.prototype.layout=function(t,n,e){void 0===e&&(e={}),this._layouts[t]={component:n,options:e}},pe.prototype.getLayout=function(t){if("function"==typeof t){var n=t.call(this._context);return t=this._layouts[n.name||"default"],Object.assign({},t,{options:n})}if("object"==typeof t&&"function"==typeof t.render)return{component:t};if(Array.isArray(t)){var e=t[0],r=t[1]||{},o="object"==typeof e&&"function"==typeof e.render?{component:e}:this._layouts[e];return o&&{component:o.component,options:Object.assign({},o.options,r)}}return this._layouts[t]},pe.prototype.overlay=function(t,n){if(void 0===n){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 le(n)},pe.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]},pe.prototype.component=function(t,n,e){if(void 0===e&&(e={}),void 0===n)return this._components[t];this._components[t]={component:n,options:e}},pe.prototype.getComponentProperty=function(t,n){return t.options?t.options[n]:t[n]},pe.prototype.create=function(t){if(!t)throw new Error("Component is incorrect");var n=this.getLayout(this.getComponentProperty(t,"layout")||"default"),e=new ce(t,{layout:n,context:this._context,container:this._container});return this._emitter.$emit("created",{dialog:e}),e},pe.prototype.show=function(t,n){return void 0===n&&(n={}),new Promise(function(e,r){var o,i,s;i=!!(o=this.create(t)).hasAsyncPreload&&(this.getComponentProperty(t,"overlay")||"default"),(s=i&&this._overlays[i]&&this.overlay(i))&&s.show();var a=function(t){try{throw this._emitter.$emit("error",{error:t,dialog:o}),s&&s.hide(),t}catch(t){return r(t)}}.bind(this);try{return Promise.resolve(o.show(n)).then(function(t){try{return this._emitter.$emit("shown",{dialog:o}),s&&s.hide(),o.onDestroyed=this.onDialogDestroyed.bind(this),e(n.waitForResult?o.wait():o)}catch(t){return a(t)}}.bind(this),a)}catch(t){a(t)}}.bind(this))},pe.prototype.createFunctionWrapper=function(t){var n=this,e=this.getComponent(t);return function(t){return n.show(e.component,Object.assign({},e.options,t))}},pe.prototype.showAndWait=function(t,n){return new Promise(function(e,r){return Promise.resolve(this.show(t,n)).then(function(t){try{return e(t.wait())}catch(t){return r(t)}},r)}.bind(this))},pe.prototype.on=function(t,n){this._emitter.$on(t,n)},pe.prototype.off=function(t,n){this._emitter.$off(t,n)},pe.prototype.once=function(t,n){this._emitter.$once(t,n)},pe.prototype.onDialogDestroyed=function(t){this._emitter.$emit("destroyed",{dialog:t})},Object.defineProperties(pe.prototype,ve);var de=function(t,n,e,r,o,i,s,a){var u=("function"==typeof e?e.options:e)||{};return u.__file="DialogOverlay.vue",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,o&&(u.functional=!0)),u._scopeId=r,u}({render:function(){var t=this.$createElement,n=this._self._c||t;return n("transition",{attrs:{name:"opacity"}},[this.visible?n("div",{staticClass:"dialog-overlay-loading",style:{zIndex:this.zIndex}},[this._v("\n Loading…\n ")]):this._e()])},staticRenderFns:[]},0,{name:"VDialogOverlay",props:{zIndex:{type:Number,default:function(){return 1250}},visible:{type:Boolean,default:function(){return!1}}}},void 0,!1),ye={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)}}},_e={name:"Actionable",mixins:[ye],data:function(){return{loadingAction:null}},props:{actions:{type:[Array,Object],default:function(){return[]}},handle:Function,params:Object},computed:{actionlist:function(){var t=[];for(var n in this.actions){var e=this.actions[n];"string"==typeof e&&(e={text:e}),e.key||(e.key=isNaN(n)?n:e.text||n),["true","false"].indexOf(e.key)>=0&&(e.key=JSON.parse(e.key)),this.isActionVisible(e)&&("string"==typeof e.icon&&(e.icon={text:e.icon}),t.push(e))}return t}},methods:{trigger:function(t){var n=this.actionlist.find(function(n){return n.key===t});n&&!this.isActionDisabled(n)&&this.isActionVisible(n)&&this.onActionClick(n)},setLoadingToInstance:function(t,n){t&&void 0!==t.loading&&(t.loading=n)},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,n){return void 0===t?n:"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:function(t){return new Promise(function(n,e){var r,o;if(r=void 0===t.closable||!0===t.closable,"function"!=typeof(o=t.handle||this.handle))return r&&this.return(t.key),u.call(this);this.loadingAction=t.key,this.setLoadingState(!0);var i=function(){try{return u.call(this)}catch(t){return e(t)}}.bind(this),s=function(t){try{throw this.setLoadingState(!1),console.log("error",t),t}catch(t){return e(t)}}.bind(this);try{var a;return Promise.resolve(o(this.params)).then(function(n){try{return a=n,this.setLoadingState(!1),!1!==a&&r&&this.return(a||t.key),i()}catch(t){return s(t)}}.bind(this),s)}catch(t){s(t)}function u(){return n()}}.bind(this))}}},me={name:"Confirmable",props:{type:{type:String},text:{type:String,reqiured:!0},title:{type:String},actions:{type:[Array,Object]}}},be=[],ge={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 n,e,r;t?(e=(n=this).position,r=10,be.filter(function(t){return t.position===e}).forEach(function(t){r+=t.$el.offsetHeight+10}),be.push(n),n.verticalOffset=r):function(t){var n=be.findIndex(function(n){return n===t});if(!(n<0)){be.splice(n,1);var e=be.length,r=t.position;if(e){var o=10;be.filter(function(t){return t.position===r}).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 we={install:function t(n,e){if(void 0===e&&(e={}),!t.installed){t.installed=!0;var r=e.property||"$dialog",o=new pe(e);o.overlay("default",de),n.prototype[r]?console.warn("Property "+r+" is already defigned in Vue prototype"):Object.defineProperty(n.prototype,r,{get:function(){return o}})}}},je=null;"undefined"!=typeof window?je=window.Vue:"undefined"!=typeof global&&(je=global.Vue),je&&je.use(we),t.default=we,t.Actionable=_e,t.Activable=r,t.Confirmable=me,t.Notifiable=ge,t.Recordable=e,t.Returnable=ye,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=vuedl.min.js.map
{
"name": "vuedl",
"version": "0.1.4",
"version": "0.1.5",
"description": "Vue dialog helper",

@@ -12,3 +12,3 @@ "scripts": {

"lint:fix": "npm run lint -- --fix",
"prepublish": "npm run build",
"prepublish": "npm run test && npm run build",
"release": "bash build/release.sh",

@@ -26,3 +26,5 @@ "test": "jest --env=jsdom ",

"unpkg": "dist/vuedl.min.js",
"dependencies": {},
"dependencies": {
"vue-asyncable": "0.0.3"
},
"repository": {

@@ -29,0 +31,0 @@ "type": "git",

@@ -185,13 +185,22 @@ # Vuedl - vue dialog helper

```js
this.$dialog.confirm('Do you really want to exit?').then(res => {
this.$dialog.confirm({
text: 'Do you really want to exit?'
}).then(res => {
})
```
```js
const res = await this.$dialog.warning('Do you really want to exit?')
const res = await this.$dialog.warning({
text: 'Do you really want to exit?'
})
...
const res = await this.$dialog.error('Do you really want to exit?')
const res = await this.$dialog.error({
text: 'Some error'
})
```
```js
let res = await this.$dialog.confirm('Do you really want to exit?', {title: 'Warning'})
let res = await this.$dialog.confirm({
text: 'Do you really want to exit?',
title: 'Warning'
})
if (res) {

@@ -203,9 +212,2 @@ ...

You can format your message with arbitrary HTML - make sure you don't include any user-provided content here:
```js
this.$dialog.confirm('Please do not do this.<br>Do you really want to exit?'}).then(res => {
})
```
For registering own Confirm template

@@ -212,0 +214,0 @@ ```javascript

@@ -16,4 +16,4 @@ /*

import DefaultLayout from './components/DefaultLayout.vue'
import { ensureComponentAsyncData, hasAsyncPreload } from 'vue-asyncable'
import {
ensureAsyncDatas,
destroyVueElement,

@@ -55,9 +55,12 @@ findContainer

Component = Vue.extend({ ...this._component, parent: layout })
if (this._component.primaryKey) {
Component = Component.extend({ mixins: [ Recordable ] })
}
if (this.hasAsyncPreload) {
await ensureAsyncDatas(Component, { ...this.context, params })
}
} else {
Component.options.parent = layout
}
// add primary key mixin
if (Component.options.primaryKey) {
Component = Component.extend({ mixins: [ Recordable ] })
}
if (this.hasAsyncPreload) {
await ensureComponentAsyncData(Component, { ...this.context, params })
}

@@ -127,3 +130,3 @@ const dialog = new Component(merge({ propsData: params }, this.context, options))

get hasAsyncPreload () {
return this._component && (this._component.asyncData || this._component.fetch)
return this._component && hasAsyncPreload(this._component.options || this._component)
}

@@ -130,0 +133,0 @@

// Import vue components
import DialogManager from './manager'
import Overlay from './components/DialogOverlay.vue'
// install function executed by Vue.use()

@@ -11,2 +11,3 @@ function install (Vue, options = {}) {

manager.overlay('default', Overlay)
if (!Vue.prototype[property]) {

@@ -13,0 +14,0 @@ Object.defineProperty(Vue.prototype, property, {

@@ -110,2 +110,6 @@ /*

getComponentProperty (component, name) {
return component.options ? component.options[name] : component[name]
}
create (component) {

@@ -116,3 +120,3 @@ if (!component) {

const layout = this.getLayout(component.layout || 'default')
const layout = this.getLayout(this.getComponentProperty(component, 'layout') || 'default')
const dlg = new Dialog(component, {

@@ -129,3 +133,4 @@ layout,

const dlg = this.create(component)
const overlayName = dlg.hasAsyncPreload ? (component.overlay || 'default') : false
const overlayName = dlg.hasAsyncPreload ? (this.getComponentProperty(component, 'overlay') || 'default') : false
const overlay = overlayName && this._overlays[overlayName] && this.overlay(overlayName)

@@ -132,0 +137,0 @@

@@ -21,3 +21,3 @@ /*

const Ctor = Vue.extend(this._component)
this._vm = new Ctor() // {propsData: { visible: true }}
this._vm = new Ctor()
this._vm.$mount()

@@ -32,2 +32,10 @@ document.body.appendChild(this._vm.$el)

}
destroy () {
if (this._vm) {
this._vm.$el.parentNode.removeChild(this._vm.$el)
this._vm.$destroy()
this._vm = null
}
}
}

@@ -11,63 +11,2 @@ /*

import Vue from 'vue'
const noopData = () => ({})
/* else if (typeof fn === 'object') {
} */
export function promisify (fn, context) {
let promise
if (fn.length === 2) {
// fn(context, callback)
promise = new Promise((resolve) => {
fn(context, function (err, data) {
if (err) {
context.error(err)
}
data = data || {}
resolve(data)
})
})
} else {
promise = fn(context)
}
if (!isPromise(promise)) {
if (typeof promise === 'object') {
promise = checkObjectForPromises(promise, context)
} else {
promise = Promise.resolve(promise)
}
}
return promise
}
export function checkObjectForPromises (obj, context) {
let promises = []
let data = {}
if (typeof obj === 'object') {
for (let key in obj) {
let something = obj[key]
if (typeof something === 'function') {
something = something(context)
}
if (isPromise(something)) {
let newPromise = something.then((res) => {
data[key] = res
})
promises.push(newPromise)
} else {
data[key] = something
}
}
}
return Promise.all(promises).then(() => {
return Promise.resolve(data)
})
}
export function isPromise (promise) {
return promise && (promise instanceof Promise || typeof promise.then === 'function')
}
export function destroyVueElement (vm) {

@@ -92,84 +31,11 @@ if (vm && !vm._isDestroyed && (typeof vm.$destroy === 'function')) {

export function applyAsyncData (Component, asyncData) {
const ComponentData = Component.options.data || noopData
// Prevent calling this method for each request on SSR context
if (!asyncData && Component.options.hasAsyncData) {
return
}
Component.options.hasAsyncData = true
Component.options.data = function () {
const data = ComponentData.call(this)
if (this.$ssrContext) {
asyncData = this.$ssrContext.asyncData[Component.cid]
}
return { ...data, ...asyncData }
}
if (Component._Ctor && Component._Ctor.options) {
Component._Ctor.options.data = Component.options.data
}
}
export function sanitizeComponent (Component) {
// If Component already sanitized
if (Component.options && Component._Ctor === Component) {
return Component
}
if (!Component.options) {
Component = Vue.extend(Component) // fix issue #6
Component._Ctor = Component
} else {
Component._Ctor = Component
Component.extendOptions = Component.options
}
// For debugging purpose
if (!Component.options.name && Component.options.__file) {
Component.options.name = Component.options.__file
}
return Component
}
export async function ensureAsyncDatas (components, context) {
if (!Array.isArray(components)) {
if (!components) {
return null
} else {
components = [components]
}
}
return Promise.all(components.map((Component) => {
let promises = []
// Call asyncData(context)
if (Component.options.asyncData && typeof Component.options.asyncData === 'function') {
let promise = promisify(Component.options.asyncData, context)
promise.then((asyncDataResult) => {
// ssrContext.asyncData[Component.cid] = asyncDataResult
applyAsyncData(Component, asyncDataResult)
return asyncDataResult
})
promises.push(promise)
} else {
promises.push(null)
}
// Call fetch(context)
if (Component.options.fetch) {
promises.push(Component.options.fetch(context))
} else {
promises.push(null)
}
return Promise.all(promises)
}))
}
// todo
export function middlewareSeries (promises, appContext) {
if (!promises.length || appContext._redirected || appContext._errored) {
return Promise.resolve()
}
return promisify(promises[0], appContext)
.then(() => {
return middlewareSeries(promises.slice(1), appContext)
})
}
// export function middlewareSeries (promises, appContext) {
// if (!promises.length || appContext._redirected || appContext._errored) {
// return Promise.resolve()
// }
// return promisify(promises[0], appContext)
// .then(() => {
// return middlewareSeries(promises.slice(1), appContext)
// })
// }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc