vuedals.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. /*!
  2. * Vuedals plugin v1.7.0
  3. *
  4. * Multiple event based modal windows, with a single component
  5. *
  6. * This is a plugin to open any number of modal windows without having to attach them to the DOM
  7. * @author Javis Perez <javisperez@gmail.com>
  8. * https://github.com/javisperez/vuedals
  9. * Released under the MIT License.
  10. */
  11. !function(root,factory){"object"==typeof exports&&"object"==typeof module?module.exports=factory():"function"==typeof define&&define.amd?define("Vuedals",[],factory):"object"==typeof exports?exports.Vuedals=factory():root.Vuedals=factory()}(this,function(){/******/
  12. return function(modules){/******/
  13. // The require function
  14. /******/
  15. function __webpack_require__(moduleId){/******/
  16. // Check if module is in cache
  17. /******/
  18. if(installedModules[moduleId])/******/
  19. return installedModules[moduleId].exports;/******/
  20. // Create a new module (and put it into the cache)
  21. /******/
  22. var module=installedModules[moduleId]={/******/
  23. exports:{},/******/
  24. id:moduleId,/******/
  25. loaded:!1};/******/
  26. // Return the exports of the module
  27. /******/
  28. /******/
  29. // Execute the module function
  30. /******/
  31. /******/
  32. // Flag the module as loaded
  33. /******/
  34. return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.loaded=!0,module.exports}// webpackBootstrap
  35. /******/
  36. // The module cache
  37. /******/
  38. var installedModules={};/******/
  39. // Load entry module and return exports
  40. /******/
  41. /******/
  42. // expose the modules object (__webpack_modules__)
  43. /******/
  44. /******/
  45. // expose the module cache
  46. /******/
  47. /******/
  48. // __webpack_public_path__
  49. /******/
  50. return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.p="",__webpack_require__(0)}([/* 0 */
  51. /***/
  52. function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Component=exports.Bus=void 0;var _bus=__webpack_require__(1),_bus2=_interopRequireDefault(_bus),_component=__webpack_require__(22),_component2=_interopRequireDefault(_component);exports.default={install:function(Vue){Vue.prototype.$vuedals=new Vue({name:"$vuedals",created:function(){var _this=this;_bus2.default.$on("opened",function(data){_this.$emit("vuedals:opened",data)}),_bus2.default.$on("closed",function(data){_this.$emit("vuedals:closed",data)}),_bus2.default.$on("destroyed",function(data){_this.$emit("vuedals:destroyed",data)}),this.$on("new",function(options){_this.open(options)}),this.$on("close",function(data){_this.close(data)}),this.$on("dismiss",function(index){_this.dismiss(index||null)})},methods:{open:function(){var options=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_bus2.default.$emit("new",options)},close:function(){var data=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_bus2.default.$emit("close",data)},dismiss:function(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;_bus2.default.$emit("dismiss",index)}}}),Vue.mixin({created:function(){this.$on("vuedals:new",function(options){_bus2.default.$emit("new",options)}),this.$on("vuedals:close",function(data){_bus2.default.$emit("close",data)}),this.$on("vuedals:dismiss",function(index){_bus2.default.$emit("dismiss",index)})}})}},exports.Bus=_bus2.default,exports.Component=_component2.default},/* 1 */
  53. /***/
  54. function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _classCallCheck2=__webpack_require__(2),_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=__webpack_require__(3),_createClass3=_interopRequireDefault(_createClass2),instance=null,EventBus=function(){function EventBus(){return(0,_classCallCheck3.default)(this,EventBus),instance||(this.events={},instance=this),instance}return(0,_createClass3.default)(EventBus,[{key:"$emit",value:function(event,message){if(this.events[event])for(var callbacks=this.events[event],i=0,l=callbacks.length;i<l;i++){var callback=callbacks[i];callback.call(this,message)}}},{key:"$on",value:function(event,callback){this.events[event]||(this.events[event]=[]),this.events[event].push(callback)}}]),EventBus}();exports.default=new EventBus},/* 2 */
  55. /***/
  56. function(module,exports){"use strict";exports.__esModule=!0,exports.default=function(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}},/* 3 */
  57. /***/
  58. function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}exports.__esModule=!0;var _defineProperty=__webpack_require__(4),_defineProperty2=_interopRequireDefault(_defineProperty);exports.default=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),(0,_defineProperty2.default)(target,descriptor.key,descriptor)}}return function(Constructor,protoProps,staticProps){return protoProps&&defineProperties(Constructor.prototype,protoProps),staticProps&&defineProperties(Constructor,staticProps),Constructor}}()},/* 4 */
  59. /***/
  60. function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(5),__esModule:!0}},/* 5 */
  61. /***/
  62. function(module,exports,__webpack_require__){__webpack_require__(6);var $Object=__webpack_require__(9).Object;module.exports=function(it,key,desc){return $Object.defineProperty(it,key,desc)}},/* 6 */
  63. /***/
  64. function(module,exports,__webpack_require__){var $export=__webpack_require__(7);
  65. // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
  66. $export($export.S+$export.F*!__webpack_require__(17),"Object",{defineProperty:__webpack_require__(13).f})},/* 7 */
  67. /***/
  68. function(module,exports,__webpack_require__){var global=__webpack_require__(8),core=__webpack_require__(9),ctx=__webpack_require__(10),hide=__webpack_require__(12),PROTOTYPE="prototype",$export=function(type,name,source){var key,own,out,IS_FORCED=type&$export.F,IS_GLOBAL=type&$export.G,IS_STATIC=type&$export.S,IS_PROTO=type&$export.P,IS_BIND=type&$export.B,IS_WRAP=type&$export.W,exports=IS_GLOBAL?core:core[name]||(core[name]={}),expProto=exports[PROTOTYPE],target=IS_GLOBAL?global:IS_STATIC?global[name]:(global[name]||{})[PROTOTYPE];IS_GLOBAL&&(source=name);for(key in source)
  69. // contains in native
  70. own=!IS_FORCED&&target&&void 0!==target[key],own&&key in exports||(
  71. // export native or passed
  72. out=own?target[key]:source[key],
  73. // prevent global pollution for namespaces
  74. exports[key]=IS_GLOBAL&&"function"!=typeof target[key]?source[key]:IS_BIND&&own?ctx(out,global):IS_WRAP&&target[key]==out?function(C){var F=function(a,b,c){if(this instanceof C){switch(arguments.length){case 0:return new C;case 1:return new C(a);case 2:return new C(a,b)}return new C(a,b,c)}return C.apply(this,arguments)};return F[PROTOTYPE]=C[PROTOTYPE],F}(out):IS_PROTO&&"function"==typeof out?ctx(Function.call,out):out,
  75. // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
  76. IS_PROTO&&((exports.virtual||(exports.virtual={}))[key]=out,
  77. // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
  78. type&$export.R&&expProto&&!expProto[key]&&hide(expProto,key,out)))};
  79. // type bitmap
  80. $export.F=1,// forced
  81. $export.G=2,// global
  82. $export.S=4,// static
  83. $export.P=8,// proto
  84. $export.B=16,// bind
  85. $export.W=32,// wrap
  86. $export.U=64,// safe
  87. $export.R=128,// real proto method for `library`
  88. module.exports=$export},/* 8 */
  89. /***/
  90. function(module,exports){
  91. // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
  92. var global=module.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=global)},/* 9 */
  93. /***/
  94. function(module,exports){var core=module.exports={version:"2.4.0"};"number"==typeof __e&&(__e=core)},/* 10 */
  95. /***/
  96. function(module,exports,__webpack_require__){
  97. // optional / simple context binding
  98. var aFunction=__webpack_require__(11);module.exports=function(fn,that,length){if(aFunction(fn),void 0===that)return fn;switch(length){case 1:return function(a){return fn.call(that,a)};case 2:return function(a,b){return fn.call(that,a,b)};case 3:return function(a,b,c){return fn.call(that,a,b,c)}}return function(){return fn.apply(that,arguments)}}},/* 11 */
  99. /***/
  100. function(module,exports){module.exports=function(it){if("function"!=typeof it)throw TypeError(it+" is not a function!");return it}},/* 12 */
  101. /***/
  102. function(module,exports,__webpack_require__){var dP=__webpack_require__(13),createDesc=__webpack_require__(21);module.exports=__webpack_require__(17)?function(object,key,value){return dP.f(object,key,createDesc(1,value))}:function(object,key,value){return object[key]=value,object}},/* 13 */
  103. /***/
  104. function(module,exports,__webpack_require__){var anObject=__webpack_require__(14),IE8_DOM_DEFINE=__webpack_require__(16),toPrimitive=__webpack_require__(20),dP=Object.defineProperty;exports.f=__webpack_require__(17)?Object.defineProperty:function(O,P,Attributes){if(anObject(O),P=toPrimitive(P,!0),anObject(Attributes),IE8_DOM_DEFINE)try{return dP(O,P,Attributes)}catch(e){}if("get"in Attributes||"set"in Attributes)throw TypeError("Accessors not supported!");return"value"in Attributes&&(O[P]=Attributes.value),O}},/* 14 */
  105. /***/
  106. function(module,exports,__webpack_require__){var isObject=__webpack_require__(15);module.exports=function(it){if(!isObject(it))throw TypeError(it+" is not an object!");return it}},/* 15 */
  107. /***/
  108. function(module,exports){module.exports=function(it){return"object"==typeof it?null!==it:"function"==typeof it}},/* 16 */
  109. /***/
  110. function(module,exports,__webpack_require__){module.exports=!__webpack_require__(17)&&!__webpack_require__(18)(function(){return 7!=Object.defineProperty(__webpack_require__(19)("div"),"a",{get:function(){return 7}}).a})},/* 17 */
  111. /***/
  112. function(module,exports,__webpack_require__){
  113. // Thank's IE8 for his funny defineProperty
  114. module.exports=!__webpack_require__(18)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},/* 18 */
  115. /***/
  116. function(module,exports){module.exports=function(exec){try{return!!exec()}catch(e){return!0}}},/* 19 */
  117. /***/
  118. function(module,exports,__webpack_require__){var isObject=__webpack_require__(15),document=__webpack_require__(8).document,is=isObject(document)&&isObject(document.createElement);module.exports=function(it){return is?document.createElement(it):{}}},/* 20 */
  119. /***/
  120. function(module,exports,__webpack_require__){
  121. // 7.1.1 ToPrimitive(input [, PreferredType])
  122. var isObject=__webpack_require__(15);
  123. // instead of the ES6 spec version, we didn't implement @@toPrimitive case
  124. // and the second argument - flag - preferred type is a string
  125. module.exports=function(it,S){if(!isObject(it))return it;var fn,val;if(S&&"function"==typeof(fn=it.toString)&&!isObject(val=fn.call(it)))return val;if("function"==typeof(fn=it.valueOf)&&!isObject(val=fn.call(it)))return val;if(!S&&"function"==typeof(fn=it.toString)&&!isObject(val=fn.call(it)))return val;throw TypeError("Can't convert object to primitive value")}},/* 21 */
  126. /***/
  127. function(module,exports){module.exports=function(bitmap,value){return{enumerable:!(1&bitmap),configurable:!(2&bitmap),writable:!(4&bitmap),value:value}}},/* 22 */
  128. /***/
  129. function(module,exports,__webpack_require__){/* styles */
  130. __webpack_require__(23);var Component=__webpack_require__(27)(/* script */
  131. __webpack_require__(28),/* template */
  132. __webpack_require__(51),/* scopeId */
  133. null,/* cssModules */
  134. null);module.exports=Component.exports},/* 23 */
  135. /***/
  136. function(module,exports,__webpack_require__){
  137. // style-loader: Adds some css to the DOM by adding a <style> tag
  138. // load the styles
  139. var content=__webpack_require__(24);"string"==typeof content&&(content=[[module.id,content,""]]);
  140. // add the styles to the DOM
  141. __webpack_require__(26)(content,{});content.locals&&(module.exports=content.locals)},/* 24 */
  142. /***/
  143. function(module,exports,__webpack_require__){exports=module.exports=__webpack_require__(25)(),
  144. // imports
  145. // module
  146. exports.push([module.id,'body.vuedal-open{overflow:hidden}.vuedals{background-color:rgba(0,0,0,.5);position:fixed;top:0;left:0;right:0;bottom:0;z-index:1050;overflow-x:hidden;overflow-y:auto;perspective:500px;transition:opacity .4s ease}.vuedal{background:#fff;box-shadow:3px 5px 20px #333;padding:20px;margin:30px 0;transition:all .6s ease;position:absolute;left:50%;transform:translateX(-50%);will-change:transform;width:650px}.vuedal.xl{width:1024px}.vuedal.lg{width:850px}.vuedal.sm{width:550px}.vuedal.xs{width:350px}.vuedal.disabled{opacity:.2}.vuedal.disabled:after{background:transparent;content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:100}.vuedal header{border-bottom:1px solid #eee;min-height:32px;margin-bottom:20px}.vuedal header .title{font-size:21px;font-weight:100}.vuedal header .close{float:right;font-size:26px;font-weight:100;line-height:21px;cursor:pointer}.vuedal-enter,.vuedal-leave-active{opacity:0}.vuedal-enter .vuedal,.vuedal-leave-active .vuedal{opacity:0;transform:translateX(-50%) translateY(-30px) scale(.95)}',""])},/* 25 */
  147. /***/
  148. function(module,exports){/*
  149. MIT License http://www.opensource.org/licenses/mit-license.php
  150. Author Tobias Koppers @sokra
  151. */
  152. // css base code, injected by the css-loader
  153. module.exports=function(){var list=[];
  154. // return the list of modules as css string
  155. // import a list of modules into the list
  156. return list.toString=function(){for(var result=[],i=0;i<this.length;i++){var item=this[i];item[2]?result.push("@media "+item[2]+"{"+item[1]+"}"):result.push(item[1])}return result.join("")},list.i=function(modules,mediaQuery){"string"==typeof modules&&(modules=[[null,modules,""]]);for(var alreadyImportedModules={},i=0;i<this.length;i++){var id=this[i][0];"number"==typeof id&&(alreadyImportedModules[id]=!0)}for(i=0;i<modules.length;i++){var item=modules[i];
  157. // skip already imported module
  158. // this implementation is not 100% perfect for weird media query combinations
  159. // when a module is imported multiple times with different media queries.
  160. // I hope this will never occur (Hey this way we have smaller bundles)
  161. "number"==typeof item[0]&&alreadyImportedModules[item[0]]||(mediaQuery&&!item[2]?item[2]=mediaQuery:mediaQuery&&(item[2]="("+item[2]+") and ("+mediaQuery+")"),list.push(item))}},list}},/* 26 */
  162. /***/
  163. function(module,exports,__webpack_require__){function addStylesToDom(styles,options){for(var i=0;i<styles.length;i++){var item=styles[i],domStyle=stylesInDom[item.id];if(domStyle){domStyle.refs++;for(var j=0;j<domStyle.parts.length;j++)domStyle.parts[j](item.parts[j]);for(;j<item.parts.length;j++)domStyle.parts.push(addStyle(item.parts[j],options))}else{for(var parts=[],j=0;j<item.parts.length;j++)parts.push(addStyle(item.parts[j],options));stylesInDom[item.id]={id:item.id,refs:1,parts:parts}}}}function listToStyles(list){for(var styles=[],newStyles={},i=0;i<list.length;i++){var item=list[i],id=item[0],css=item[1],media=item[2],sourceMap=item[3],part={css:css,media:media,sourceMap:sourceMap};newStyles[id]?newStyles[id].parts.push(part):styles.push(newStyles[id]={id:id,parts:[part]})}return styles}function insertStyleElement(options,styleElement){var head=getHeadElement(),lastStyleElementInsertedAtTop=styleElementsInsertedAtTop[styleElementsInsertedAtTop.length-1];if("top"===options.insertAt)lastStyleElementInsertedAtTop?lastStyleElementInsertedAtTop.nextSibling?head.insertBefore(styleElement,lastStyleElementInsertedAtTop.nextSibling):head.appendChild(styleElement):head.insertBefore(styleElement,head.firstChild),styleElementsInsertedAtTop.push(styleElement);else{if("bottom"!==options.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");head.appendChild(styleElement)}}function removeStyleElement(styleElement){styleElement.parentNode.removeChild(styleElement);var idx=styleElementsInsertedAtTop.indexOf(styleElement);idx>=0&&styleElementsInsertedAtTop.splice(idx,1)}function createStyleElement(options){var styleElement=document.createElement("style");return styleElement.type="text/css",insertStyleElement(options,styleElement),styleElement}function addStyle(obj,options){var styleElement,update,remove;if(options.singleton){var styleIndex=singletonCounter++;styleElement=singletonElement||(singletonElement=createStyleElement(options)),update=applyToSingletonTag.bind(null,styleElement,styleIndex,!1),remove=applyToSingletonTag.bind(null,styleElement,styleIndex,!0)}else styleElement=createStyleElement(options),update=applyToTag.bind(null,styleElement),remove=function(){removeStyleElement(styleElement)};return update(obj),function(newObj){if(newObj){if(newObj.css===obj.css&&newObj.media===obj.media&&newObj.sourceMap===obj.sourceMap)return;update(obj=newObj)}else remove()}}function applyToSingletonTag(styleElement,index,remove,obj){var css=remove?"":obj.css;if(styleElement.styleSheet)styleElement.styleSheet.cssText=replaceText(index,css);else{var cssNode=document.createTextNode(css),childNodes=styleElement.childNodes;childNodes[index]&&styleElement.removeChild(childNodes[index]),childNodes.length?styleElement.insertBefore(cssNode,childNodes[index]):styleElement.appendChild(cssNode)}}function applyToTag(styleElement,obj){var css=obj.css,media=obj.media,sourceMap=obj.sourceMap;if(media&&styleElement.setAttribute("media",media),sourceMap&&(
  164. // https://developer.chrome.com/devtools/docs/javascript-debugging
  165. // this makes source maps inside style tags work properly in Chrome
  166. css+="\n/*# sourceURL="+sourceMap.sources[0]+" */",
  167. // http://stackoverflow.com/a/26603875
  168. css+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))))+" */"),styleElement.styleSheet)styleElement.styleSheet.cssText=css;else{for(;styleElement.firstChild;)styleElement.removeChild(styleElement.firstChild);styleElement.appendChild(document.createTextNode(css))}}/*
  169. MIT License http://www.opensource.org/licenses/mit-license.php
  170. Author Tobias Koppers @sokra
  171. */
  172. var stylesInDom={},memoize=function(fn){var memo;return function(){return"undefined"==typeof memo&&(memo=fn.apply(this,arguments)),memo}},isOldIE=memoize(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),getHeadElement=memoize(function(){return document.head||document.getElementsByTagName("head")[0]}),singletonElement=null,singletonCounter=0,styleElementsInsertedAtTop=[];module.exports=function(list,options){options=options||{},
  173. // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
  174. // tags it will allow on a page
  175. "undefined"==typeof options.singleton&&(options.singleton=isOldIE()),
  176. // By default, add <style> tags to the bottom of <head>.
  177. "undefined"==typeof options.insertAt&&(options.insertAt="bottom");var styles=listToStyles(list);return addStylesToDom(styles,options),function(newList){for(var mayRemove=[],i=0;i<styles.length;i++){var item=styles[i],domStyle=stylesInDom[item.id];domStyle.refs--,mayRemove.push(domStyle)}if(newList){var newStyles=listToStyles(newList);addStylesToDom(newStyles,options)}for(var i=0;i<mayRemove.length;i++){var domStyle=mayRemove[i];if(0===domStyle.refs){for(var j=0;j<domStyle.parts.length;j++)domStyle.parts[j]();delete stylesInDom[domStyle.id]}}}};var replaceText=function(){var textStore=[];return function(index,replacement){return textStore[index]=replacement,textStore.filter(Boolean).join("\n")}}()},/* 27 */
  178. /***/
  179. function(module,exports){module.exports=function(rawScriptExports,compiledTemplate,scopeId,cssModules){var esModule,scriptExports=rawScriptExports=rawScriptExports||{},type=typeof rawScriptExports.default;"object"!==type&&"function"!==type||(esModule=rawScriptExports,scriptExports=rawScriptExports.default);
  180. // Vue.extend constructor export interop
  181. var options="function"==typeof scriptExports?scriptExports.options:scriptExports;
  182. // inject cssModules
  183. if(
  184. // render functions
  185. compiledTemplate&&(options.render=compiledTemplate.render,options.staticRenderFns=compiledTemplate.staticRenderFns),
  186. // scopedId
  187. scopeId&&(options._scopeId=scopeId),cssModules){var computed=options.computed||(options.computed={});Object.keys(cssModules).forEach(function(key){var module=cssModules[key];computed[key]=function(){return module}})}return{esModule:esModule,exports:scriptExports,options:options}}},/* 28 */
  188. /***/
  189. function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(exports,"__esModule",{value:!0});var _assign=__webpack_require__(29),_assign2=_interopRequireDefault(_assign),_bus=__webpack_require__(1),_bus2=_interopRequireDefault(_bus);exports.default={name:"vuedals",created:function(){var _this=this;_bus2.default.$on("new",function(options){var defaults={title:null,dismissable:!0,name:"",size:"md",escapable:!1,onClose:function(){},onDismiss:function(){}};options=(0,_assign2.default)(defaults,options),_this.vuedals.push(options),_bus2.default.$emit("opened",{index:_this.$last,options:options}),_this.body.classList.add("vuedal-open"),document.querySelector(".vuedals").scrollTop=0}),_bus2.default.$on("close",function(data){var index=null;data&&data.$index&&(index=data.$index),null===index&&(index=_this.$last),_this.close(data,index)}),_bus2.default.$on("dismiss",function(index){null===index&&(index=_this.$last),_this.dismiss(index)})},data:function(){return{vuedals:[]}},methods:{splice:function(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;index!==-1&&this.vuedals.length&&(null===index?this.vuedals.pop():this.vuedals.splice(index,1),this.vuedals.length||(this.body.classList.remove("vuedal-open"),_bus2.default.$emit("destroyed")))},doClose:function(){var index=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,arguments[1]);if(this.vuedals.length&&this.vuedals[index]){this.splice(index);var vuedals=document.querySelector(".vuedals");vuedals&&(vuedals.scrollTop=0)}},close:function(){var data=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,index=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(0!==this.vuedals.length){var localIndex=index;index&&"function"==typeof index&&(localIndex=index(data,this.vuedals)),"number"!=typeof localIndex&&(localIndex=this.$last),_bus2.default.$emit("closed",{index:localIndex,instance:this.vuedals[index],data:data}),localIndex!==!1&&this.vuedals[localIndex]&&this.vuedals[localIndex].onClose(data),this.doClose(data,localIndex)}},dismiss:function(){var index=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,localIndex=index;index&&"function"==typeof index&&(localIndex=index(this.$last)),"number"!=typeof localIndex&&(localIndex=this.$last),this.vuedals[localIndex].onDismiss()!==!1&&(_bus2.default.$emit("dismissed",{index:localIndex,instance:this.vuedals[localIndex]}),this.doClose(null,localIndex))},getCssClasses:function(index){var vuedal=this.vuedals[index],classNames=vuedal.name+" "+vuedal.size;return index<this.$last&&(classNames+=" disabled"),classNames},handleEscapeKey:function(e){this.vuedals.length&&this.current.escapable&&this.dismiss()}},computed:{current:function(){return this.vuedals[this.$last]},$last:function(){return this.vuedals.length-1},body:function(){if("undefined"!=typeof document)return document.querySelector("body")}}}},/* 29 */
  190. /***/
  191. function(module,exports,__webpack_require__){module.exports={default:__webpack_require__(30),__esModule:!0}},/* 30 */
  192. /***/
  193. function(module,exports,__webpack_require__){__webpack_require__(31),module.exports=__webpack_require__(9).Object.assign},/* 31 */
  194. /***/
  195. function(module,exports,__webpack_require__){
  196. // 19.1.3.1 Object.assign(target, source)
  197. var $export=__webpack_require__(7);$export($export.S+$export.F,"Object",{assign:__webpack_require__(32)})},/* 32 */
  198. /***/
  199. function(module,exports,__webpack_require__){"use strict";
  200. // 19.1.2.1 Object.assign(target, source, ...)
  201. var getKeys=__webpack_require__(33),gOPS=__webpack_require__(48),pIE=__webpack_require__(49),toObject=__webpack_require__(50),IObject=__webpack_require__(37),$assign=Object.assign;
  202. // should work with symbols and should have deterministic property order (V8 bug)
  203. module.exports=!$assign||__webpack_require__(18)(function(){var A={},B={},S=Symbol(),K="abcdefghijklmnopqrst";return A[S]=7,K.split("").forEach(function(k){B[k]=k}),7!=$assign({},A)[S]||Object.keys($assign({},B)).join("")!=K})?function(target,source){for(// eslint-disable-line no-unused-vars
  204. var T=toObject(target),aLen=arguments.length,index=1,getSymbols=gOPS.f,isEnum=pIE.f;aLen>index;)for(var key,S=IObject(arguments[index++]),keys=getSymbols?getKeys(S).concat(getSymbols(S)):getKeys(S),length=keys.length,j=0;length>j;)isEnum.call(S,key=keys[j++])&&(T[key]=S[key]);return T}:$assign},/* 33 */
  205. /***/
  206. function(module,exports,__webpack_require__){
  207. // 19.1.2.14 / 15.2.3.14 Object.keys(O)
  208. var $keys=__webpack_require__(34),enumBugKeys=__webpack_require__(47);module.exports=Object.keys||function(O){return $keys(O,enumBugKeys)}},/* 34 */
  209. /***/
  210. function(module,exports,__webpack_require__){var has=__webpack_require__(35),toIObject=__webpack_require__(36),arrayIndexOf=__webpack_require__(40)(!1),IE_PROTO=__webpack_require__(44)("IE_PROTO");module.exports=function(object,names){var key,O=toIObject(object),i=0,result=[];for(key in O)key!=IE_PROTO&&has(O,key)&&result.push(key);
  211. // Don't enum bug & hidden keys
  212. for(;names.length>i;)has(O,key=names[i++])&&(~arrayIndexOf(result,key)||result.push(key));return result}},/* 35 */
  213. /***/
  214. function(module,exports){var hasOwnProperty={}.hasOwnProperty;module.exports=function(it,key){return hasOwnProperty.call(it,key)}},/* 36 */
  215. /***/
  216. function(module,exports,__webpack_require__){
  217. // to indexed object, toObject with fallback for non-array-like ES3 strings
  218. var IObject=__webpack_require__(37),defined=__webpack_require__(39);module.exports=function(it){return IObject(defined(it))}},/* 37 */
  219. /***/
  220. function(module,exports,__webpack_require__){
  221. // fallback for non-array-like ES3 and non-enumerable old V8 strings
  222. var cof=__webpack_require__(38);module.exports=Object("z").propertyIsEnumerable(0)?Object:function(it){return"String"==cof(it)?it.split(""):Object(it)}},/* 38 */
  223. /***/
  224. function(module,exports){var toString={}.toString;module.exports=function(it){return toString.call(it).slice(8,-1)}},/* 39 */
  225. /***/
  226. function(module,exports){
  227. // 7.2.1 RequireObjectCoercible(argument)
  228. module.exports=function(it){if(void 0==it)throw TypeError("Can't call method on "+it);return it}},/* 40 */
  229. /***/
  230. function(module,exports,__webpack_require__){
  231. // false -> Array#indexOf
  232. // true -> Array#includes
  233. var toIObject=__webpack_require__(36),toLength=__webpack_require__(41),toIndex=__webpack_require__(43);module.exports=function(IS_INCLUDES){return function($this,el,fromIndex){var value,O=toIObject($this),length=toLength(O.length),index=toIndex(fromIndex,length);
  234. // Array#includes uses SameValueZero equality algorithm
  235. if(IS_INCLUDES&&el!=el){for(;length>index;)if(value=O[index++],value!=value)return!0}else for(;length>index;index++)if((IS_INCLUDES||index in O)&&O[index]===el)return IS_INCLUDES||index||0;return!IS_INCLUDES&&-1}}},/* 41 */
  236. /***/
  237. function(module,exports,__webpack_require__){
  238. // 7.1.15 ToLength
  239. var toInteger=__webpack_require__(42),min=Math.min;module.exports=function(it){return it>0?min(toInteger(it),9007199254740991):0}},/* 42 */
  240. /***/
  241. function(module,exports){
  242. // 7.1.4 ToInteger
  243. var ceil=Math.ceil,floor=Math.floor;module.exports=function(it){return isNaN(it=+it)?0:(it>0?floor:ceil)(it)}},/* 43 */
  244. /***/
  245. function(module,exports,__webpack_require__){var toInteger=__webpack_require__(42),max=Math.max,min=Math.min;module.exports=function(index,length){return index=toInteger(index),index<0?max(index+length,0):min(index,length)}},/* 44 */
  246. /***/
  247. function(module,exports,__webpack_require__){var shared=__webpack_require__(45)("keys"),uid=__webpack_require__(46);module.exports=function(key){return shared[key]||(shared[key]=uid(key))}},/* 45 */
  248. /***/
  249. function(module,exports,__webpack_require__){var global=__webpack_require__(8),SHARED="__core-js_shared__",store=global[SHARED]||(global[SHARED]={});module.exports=function(key){return store[key]||(store[key]={})}},/* 46 */
  250. /***/
  251. function(module,exports){var id=0,px=Math.random();module.exports=function(key){return"Symbol(".concat(void 0===key?"":key,")_",(++id+px).toString(36))}},/* 47 */
  252. /***/
  253. function(module,exports){
  254. // IE 8- don't enum bug keys
  255. module.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},/* 48 */
  256. /***/
  257. function(module,exports){exports.f=Object.getOwnPropertySymbols},/* 49 */
  258. /***/
  259. function(module,exports){exports.f={}.propertyIsEnumerable},/* 50 */
  260. /***/
  261. function(module,exports,__webpack_require__){
  262. // 7.1.13 ToObject(argument)
  263. var defined=__webpack_require__(39);module.exports=function(it){return Object(defined(it))}},/* 51 */
  264. /***/
  265. function(module,exports){module.exports={render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c("transition",{attrs:{tag:"div",name:"vuedal"}},[_c("div",{directives:[{name:"show",rawName:"v-show",value:_vm.vuedals.length,expression:"vuedals.length"}],staticClass:"vuedals",attrs:{tabindex:"0"},on:{keyup:function($event){_vm._k($event.keyCode,"esc",27)||($event.preventDefault(),_vm.handleEscapeKey($event))},click:function($event){_vm.dismiss()}}},_vm._l(_vm.vuedals,function(vuedal,index){return _c("div",{key:index,staticClass:"vuedal",class:_vm.getCssClasses(index),on:{click:function($event){$event.stopPropagation()}}},[!vuedal.title&&!vuedal.dismissable||vuedal.header?_vm._e():_c("header",[_c("span",{staticClass:"title"},[_vm._v(_vm._s(vuedal.title))]),_vm._v(" "),vuedal.dismissable?_c("span",{staticClass:"close",on:{click:function($event){_vm.dismiss()}}},[_vm._v("×")]):_vm._e()]),_vm._v(" "),vuedal.header?_c("header",[_c(vuedal.header.component,_vm._b({tag:"component"},"component",vuedal.header.props))],1):_vm._e(),_vm._v(" "),_c(vuedal.component,_vm._b({tag:"component"},"component",vuedal.props))],1)}))])},staticRenderFns:[]}}])});