module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/dist/";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 52);
/******/ })
/************************************************************************/
/******/ ({

/***/ 3:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}


/***/ }),

/***/ 4:
/***/ (function(module, exports) {

module.exports = require("babel-runtime/regenerator");

/***/ }),

/***/ 52:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/enable-drag/src/main.vue?vue&type=template&id=59b4b327&scoped=true&
var render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    {
      staticClass: "es-enable-drag",
      style:
        !_vm.position.length || _vm.showBig
          ? _vm.styleObject
          : _vm.positionObject,
      on: { mousedown: _vm.dragStart, touchstart: _vm.dragStart },
    },
    [
      _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: !_vm.position.length || _vm.showBig,
              expression: "!position.length || showBig",
            },
          ],
          staticClass: "es-enable-content",
          class: {
            "show-animation-left":
              _vm.iconStatus === "show" && _vm.position.includes("left"),
            "show-animation-top":
              _vm.iconStatus === "show" && _vm.position.includes("top"),
            "show-animation-right":
              _vm.iconStatus === "show" && _vm.position.includes("right"),
            "show-animation-bottom":
              _vm.iconStatus === "show" && _vm.position.includes("bottom"),
            "hide-animation-left":
              _vm.iconStatus === "hide" && _vm.position.includes("left"),
            "hide-animation-top":
              _vm.iconStatus === "hide" && _vm.position.includes("top"),
            "hide-animation-right":
              _vm.iconStatus === "hide" && _vm.position.includes("right"),
            "hide-animation-bottom":
              _vm.iconStatus === "hide" && _vm.position.includes("bottom"),
          },
          on: { mouseleave: _vm.leaveBigIcon },
        },
        [
          _c(
            "div",
            {
              on: {
                mousedown: _vm.iconMousedown,
                mouseup: _vm.iconMouseUp,
                dblclick: _vm.handleDblClick,
              },
            },
            [
              _vm._t("handler", [
                _c(
                  "el-button",
                  {
                    staticClass: "es-enable-drag-enter-button",
                    attrs: { round: "", type: "primary" },
                  },
                  [
                    _c("es-icon", {
                      staticClass: "es-enable-drag-enter-icon",
                      attrs: { contents: _vm.icon },
                    }),
                  ],
                  1
                ),
              ]),
            ],
            2
          ),
        ]
      ),
      _c(
        "div",
        {
          directives: [
            {
              name: "show",
              rawName: "v-show",
              value: _vm.position.length && !_vm.showBig,
              expression: "position.length && !showBig",
            },
          ],
          staticClass: "es-enable-drag-small-icon-box",
          on: { mouseenter: _vm.enterIcon },
        },
        [
          _vm._t(
            "small-icon",
            [
              _c(
                "div",
                {
                  staticClass: "es-enable-drag-small-icon",
                  class: {
                    "es-left": _vm.position.includes("left"),
                    "es-right": _vm.position.includes("right"),
                    "es-top":
                      _vm.position.includes("top") &&
                      !(
                        _vm.position.includes("right") ||
                        _vm.position.includes("left")
                      ),
                    "es-bottom":
                      _vm.position.includes("bottom") &&
                      !(
                        _vm.position.includes("right") ||
                        _vm.position.includes("left")
                      ),
                  },
                  attrs: { "data-content": _vm.smallText },
                },
                [
                  _c("i", {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.position.includes("right"),
                        expression: "position.includes('right')",
                      },
                    ],
                    staticClass: "es-enable-drag-small-tri es-icon-circle-zuo",
                  }),
                  _c("i", {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value: _vm.position.includes("left"),
                        expression: "position.includes('left')",
                      },
                    ],
                    staticClass: "es-enable-drag-small-tri es-icon-circle-you",
                  }),
                  _c("i", {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value:
                          _vm.position.includes("bottom") &&
                          !(
                            _vm.position.includes("right") ||
                            _vm.position.includes("left")
                          ),
                        expression:
                          "\n            position.includes('bottom') &&\n            !(position.includes('right') || position.includes('left'))\n          ",
                      },
                    ],
                    staticClass:
                      "es-enable-drag-small-tri es-icon-circle-shang",
                  }),
                  _c("i", {
                    directives: [
                      {
                        name: "show",
                        rawName: "v-show",
                        value:
                          _vm.position.includes("top") &&
                          !(
                            _vm.position.includes("right") ||
                            _vm.position.includes("left")
                          ),
                        expression:
                          "\n            position.includes('top') &&\n            !(position.includes('right') || position.includes('left'))\n          ",
                      },
                    ],
                    staticClass: "es-enable-drag-small-tri es-icon-circle-xia",
                  }),
                ]
              ),
            ],
            { position: _vm.position }
          ),
        ],
        2
      ),
    ]
  )
}
var staticRenderFns = []
render._withStripped = true


// CONCATENATED MODULE: ./packages/enable-drag/src/main.vue?vue&type=template&id=59b4b327&scoped=true&

// EXTERNAL MODULE: external "babel-runtime/regenerator"
var regenerator_ = __webpack_require__(4);
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/enable-drag/src/main.vue?vue&type=script&lang=js&


function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//

/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'EsEnableDrag',
  props: {
    //默认拖动按钮图标
    icon: {
      type: String,
      default: 'es-icon-yingyong'
    },
    smallText: String,
    //边界距离（小于这个距离就隐藏）
    distance: {
      type: Number,
      default: 10,
      validator: function validator(value) {
        return value >= 0;
      }
    },
    // 初始距离顶部的位置
    topDistance: String,
    // 初始距离左边的位置
    leftDistance: String,
    // 是否可以拖拽
    isDragg: {
      type: Boolean,
      default: true
    },
    //允许隐藏的方位
    berth: {
      type: Array,
      default: function _default() {
        return ['right'];
      },

      validator: function validator(value) {
        return value.length == 0 || value.includes('right') || value.includes('left') || value.includes('top') || value.includes('bottom');
      }
    },
    // 列表数据
    list: {
      type: Array,
      default: function _default() {
        return [{}, {}];
      }
    },
    // 自定义列表的时候传入的高度（有高度才有动画）
    customHeight: {
      type: String,
      default: function _default() {
        return '';
      }
    }
  },
  data: function data() {
    return {
      width: 0, // 元素的宽度
      height: 0, // 元素的高度
      clickState: false, // 是点击还是拖拽
      dbClick: false, // 双击状态
      canDrag: true, // 临时状态：是否可以拖拽
      firstLoad: true, // 第一次加载
      iconStatus: 'normal', // 大图标显示状态
      showBig: false, // 是否显示大图标
      moved: false, // 是否移动过
      mouseX: 0, // 初始位置的X坐标
      mouseY: 0, // 初始位置的Y坐标
      // 拖拽位置的样式
      styleObject: {
        top: 0,
        left: 0
      },
      positionObject: {},
      position: [] // 是否贴边
    };
  },

  computed: {},
  created: function created() {},
  mounted: function mounted() {
    this.init();
  },

  methods: {
    init: function init() {
      var rect = this.$el.getBoundingClientRect();
      this.width = rect.width;
      this.height = rect.height;
      if (this.topDistance) {
        this.styleObject.top = this.topDistance;
      } else {
        this.styleObject.top = window.innerHeight - this.distance - this.height + 'px';
      }
      if (this.leftDistance) {
        this.styleObject.left = this.leftDistance;
      } else {
        this.styleObject.left = window.innerWidth - this.distance - this.width + 'px';
      }
    },

    /**
     * @description 双击
     */
    handleDblClick: function handleDblClick(event) {
      var _this = this;

      return _asyncToGenerator( /*#__PURE__*/regenerator_default.a.mark(function _callee() {
        return regenerator_default.a.wrap(function _callee$(_context) {
          while (1) {
            switch (_context.prev = _context.next) {
              case 0:
                event && event.stopPropagation();
                event && event.preventDefault();
                // 说明触发了双击状态
                _this.dbClick = true;
                console.log('双击了---------------');
                _this.$emit('DblClick');

              case 5:
              case 'end':
                return _context.stop();
            }
          }
        }, _callee, _this);
      }))();
    },

    /**
     * @description 是否打开智能助手
     */
    iconMouseUp: function iconMouseUp() {
      var _this2 = this;

      this.T = setTimeout(function () {
        // 不是双击
        if (!_this2.dbClick) {
          // 防止首次动画
          _this2.firstLoad = false;
          // 防止拖动影响到了click事件
          if (_this2.clickState) {
            // TODO 执行点击事件
            console.log('单击了---------------');
            _this2.$emit('click');
          }
        }
      }, 160);
    },

    /**
     * @description 点击ai入口事件
     */
    iconMousedown: function iconMousedown() {
      // 发生点击就重置双击状态
      this.dbClick = false;
      // 说明发生了点击
      this.clickState = true;
      // 可以拖拽
      this.canDrag = true;
      this.T && clearTimeout(this.T);
      this.T = null;
    },
    handleItem: function handleItem() {
      console.log('点击了单个列表---------------');
      this.$emit('handleItem');
    },

    /**
     * @description 进入小图标
     */
    enterIcon: function enterIcon(samll) {
      if (samll) {
        // 显示大图标
        this.showBig = true;
        // 大图标动画
        this.iconStatus = 'show';
      }
    },

    /**
     * @description 离开大图标
     */
    leaveBigIcon: function leaveBigIcon() {
      // 显示大图标
      this.showBig = false;
      // 大图标动画
      this.iconStatus = 'hide';
    },

    /**
     * @description 检测位置合理性
     */
    checkPosition: function checkPosition() {
      if (this.position.includes('right')) {
        this.styleObject.left = window.innerWidth + 'px';
      }
      if (this.position.includes('bottom')) {
        this.styleObject.top = window.innerHeight + 'px';
      }
      this.moved = true;
      this.dragEnd();
    },

    /**
     * @description 拖拽开始
     */
    dragStart: function dragStart(e) {
      if (this.isDragg && this.canDrag) {
        e.preventDefault();
        this.moved = false;
        var rect = this.$el.getBoundingClientRect();
        this.mouseY = e.y - rect.y;
        this.mouseX = e.x - rect.x;
        document.addEventListener('mousemove', this.drag);
        document.addEventListener('touchmove', this.drag);
        document.addEventListener('mouseup', this.dragEnd);
        document.addEventListener('touchend', this.dragEnd);
      } else {
        return false;
      }
    },

    /**
     * @description 拖拽中
     */
    drag: function drag(e) {
      this.moved = true;
      var x = e.x - this.mouseX;
      var y = e.y - this.mouseY;
      this.styleObject.left = x + 'px';
      this.styleObject.top = y + 'px';
    },

    /**
     * @description 拖拽结束
     */
    dragEnd: function dragEnd() {
      if (this.moved) {
        this.clickState = false;
        var x = this.styleObject.left.replace('px', '');
        var y = this.styleObject.top.replace('px', '');
        this.position = [];
        this.positionObject = { top: y, left: x };
        if (x < this.distance) {
          this.styleObject.left = this.distance + 'px';
          this.berth.includes('left') && this.position.push('left');
          this.positionObject.left = 0;
        }
        if (x > window.innerWidth - this.distance - this.width) {
          this.styleObject.left = window.innerWidth - this.distance - this.width + 'px';
          this.berth.includes('right') && this.position.push('right');
          delete this.positionObject.left;
          this.positionObject.right = 0;
        }
        if (y < this.distance) {
          this.styleObject.top = this.distance + 'px';
          this.berth.includes('top') && this.position.push('top');
          this.positionObject.top = 0;
        }
        if (y > window.innerHeight - this.distance - this.height) {
          this.styleObject.top = window.innerHeight - this.distance - this.height + 'px';
          this.berth.includes('bottom') && this.position.push('bottom');
          delete this.positionObject.top;
          this.positionObject.bottom = 0;
        }
      }
      document.removeEventListener('mousemove', this.drag);
      document.removeEventListener('touchmove', this.drag);
      document.removeEventListener('mouseup', this.dragEnd);
      document.removeEventListener('touchend', this.dragEnd);
    }
  },
  destroyed: function destroyed() {
    // 移除监听
    window.removeEventListener('resize', this.onResize);
    document.removeEventListener('mousemove', this.drag);
    document.removeEventListener('touchmove', this.drag);
    document.removeEventListener('mouseup', this.dragEnd);
    document.removeEventListener('touchend', this.dragEnd);
  }
});
// CONCATENATED MODULE: ./packages/enable-drag/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);

// CONCATENATED MODULE: ./packages/enable-drag/src/main.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  "59b4b327",
  null
  
)

/* harmony default export */ var main = (component.exports);
// CONCATENATED MODULE: ./packages/enable-drag/index.js


main.install = function (Vue) {
  return Vue.component(main.name, main);
};

/* harmony default export */ var enable_drag = __webpack_exports__["default"] = (main);

/***/ })

/******/ });