var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } import '../../../src/stylus/components/_dialogs.styl'; // Mixins import Dependent from '../../mixins/dependent'; import Detachable from '../../mixins/detachable'; import Overlayable from '../../mixins/overlayable'; import Returnable from '../../mixins/returnable'; import Stackable from '../../mixins/stackable'; import Toggleable from '../../mixins/toggleable'; // Directives import ClickOutside from '../../directives/click-outside'; // Helpers import { convertToUnit, keyCodes, getSlotType } from '../../util/helpers'; import ThemeProvider from '../../util/ThemeProvider'; import { consoleError } from '../../util/console'; /* @vue/component */ export default { name: 'v-dialog', directives: { ClickOutside: ClickOutside }, mixins: [Dependent, Detachable, Overlayable, Returnable, Stackable, Toggleable], props: { disabled: Boolean, persistent: Boolean, fullscreen: Boolean, fullWidth: Boolean, noClickAnimation: Boolean, light: Boolean, dark: Boolean, maxWidth: { type: [String, Number], default: 'none' }, origin: { type: String, default: 'center center' }, width: { type: [String, Number], default: 'auto' }, scrollable: Boolean, transition: { type: [String, Boolean], default: 'dialog-transition' } }, data: function data() { return { animate: false, animateTimeout: null, stackClass: 'v-dialog__content--active', stackMinZIndex: 200 }; }, computed: { classes: function classes() { var _ref; return _ref = {}, _defineProperty(_ref, ('v-dialog ' + this.contentClass).trim(), true), _defineProperty(_ref, 'v-dialog--active', this.isActive), _defineProperty(_ref, 'v-dialog--persistent', this.persistent), _defineProperty(_ref, 'v-dialog--fullscreen', this.fullscreen), _defineProperty(_ref, 'v-dialog--scrollable', this.scrollable), _defineProperty(_ref, 'v-dialog--animated', this.animate), _ref; }, contentClasses: function contentClasses() { return { 'v-dialog__content': true, 'v-dialog__content--active': this.isActive }; }, hasActivator: function hasActivator() { return Boolean(!!this.$slots.activator || !!this.$scopedSlots.activator); } }, watch: { isActive: function isActive(val) { if (val) { this.show(); this.hideScroll(); } else { this.removeOverlay(); this.unbind(); } }, fullscreen: function fullscreen(val) { if (!this.isActive) return; if (val) { this.hideScroll(); this.removeOverlay(false); } else { this.showScroll(); this.genOverlay(); } } }, beforeMount: function beforeMount() { var _this = this; this.$nextTick(function () { _this.isBooted = _this.isActive; _this.isActive && _this.show(); }); }, mounted: function mounted() { if (getSlotType(this, 'activator', true) === 'v-slot') { consoleError('v-dialog\'s activator slot must be bound, try \'