| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864 | 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 = 72);/******/ })/************************************************************************//******/ ({/***/ 0:/***/ (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, 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 functioal 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  }}/***/ }),/***/ 11:/***/ (function(module, exports) {module.exports = require("element-ui/lib/mixins/migrating");/***/ }),/***/ 2:/***/ (function(module, exports) {module.exports = require("element-ui/lib/utils/dom");/***/ }),/***/ 4:/***/ (function(module, exports) {module.exports = require("element-ui/lib/mixins/emitter");/***/ }),/***/ 72:/***/ (function(module, __webpack_exports__, __webpack_require__) {"use strict";__webpack_require__.r(__webpack_exports__);// EXTERNAL MODULE: external "element-ui/lib/mixins/emitter"var emitter_ = __webpack_require__(4);var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);// EXTERNAL MODULE: external "element-ui/lib/mixins/migrating"var migrating_ = __webpack_require__(11);var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);// CONCATENATED MODULE: ./src/utils/aria-utils.jsvar aria = aria || {};aria.Utils = aria.Utils || {};/** * @desc Set focus on descendant nodes until the first focusable element is *       found. * @param element *          DOM node for which to find the first focusable descendant. * @returns *  true if a focusable element is found and focus is set. */aria.Utils.focusFirstDescendant = function (element) {  for (var i = 0; i < element.childNodes.length; i++) {    var child = element.childNodes[i];    if (aria.Utils.attemptFocus(child) || aria.Utils.focusFirstDescendant(child)) {      return true;    }  }  return false;};/** * @desc Find the last descendant node that is focusable. * @param element *          DOM node for which to find the last focusable descendant. * @returns *  true if a focusable element is found and focus is set. */aria.Utils.focusLastDescendant = function (element) {  for (var i = element.childNodes.length - 1; i >= 0; i--) {    var child = element.childNodes[i];    if (aria.Utils.attemptFocus(child) || aria.Utils.focusLastDescendant(child)) {      return true;    }  }  return false;};/** * @desc Set Attempt to set focus on the current node. * @param element *          The node to attempt to focus on. * @returns *  true if element is focused. */aria.Utils.attemptFocus = function (element) {  if (!aria.Utils.isFocusable(element)) {    return false;  }  aria.Utils.IgnoreUtilFocusChanges = true;  try {    element.focus();  } catch (e) {}  aria.Utils.IgnoreUtilFocusChanges = false;  return document.activeElement === element;};aria.Utils.isFocusable = function (element) {  if (element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute('tabIndex') !== null) {    return true;  }  if (element.disabled) {    return false;  }  switch (element.nodeName) {    case 'A':      return !!element.href && element.rel !== 'ignore';    case 'INPUT':      return element.type !== 'hidden' && element.type !== 'file';    case 'BUTTON':    case 'SELECT':    case 'TEXTAREA':      return true;    default:      return false;  }};/** * 触发一个事件 * mouseenter, mouseleave, mouseover, keyup, change, click 等 * @param  {Element} elm * @param  {String} name * @param  {*} opts */aria.Utils.triggerEvent = function (elm, name) {  var eventName = void 0;  if (/^mouse|click/.test(name)) {    eventName = 'MouseEvents';  } else if (/^key/.test(name)) {    eventName = 'KeyboardEvent';  } else {    eventName = 'HTMLEvents';  }  var evt = document.createEvent(eventName);  for (var _len = arguments.length, opts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {    opts[_key - 2] = arguments[_key];  }  evt.initEvent.apply(evt, [name].concat(opts));  elm.dispatchEvent ? elm.dispatchEvent(evt) : elm.fireEvent('on' + name, evt);  return elm;};aria.Utils.keys = {  tab: 9,  enter: 13,  space: 32,  left: 37,  up: 38,  right: 39,  down: 40,  esc: 27};/* harmony default export */ var aria_utils = (aria.Utils);// CONCATENATED MODULE: ./src/utils/menu/aria-submenu.jsvar SubMenu = function SubMenu(parent, domNode) {  this.domNode = domNode;  this.parent = parent;  this.subMenuItems = [];  this.subIndex = 0;  this.init();};SubMenu.prototype.init = function () {  this.subMenuItems = this.domNode.querySelectorAll('li');  this.addListeners();};SubMenu.prototype.gotoSubIndex = function (idx) {  if (idx === this.subMenuItems.length) {    idx = 0;  } else if (idx < 0) {    idx = this.subMenuItems.length - 1;  }  this.subMenuItems[idx].focus();  this.subIndex = idx;};SubMenu.prototype.addListeners = function () {  var _this = this;  var keys = aria_utils.keys;  var parentNode = this.parent.domNode;  Array.prototype.forEach.call(this.subMenuItems, function (el) {    el.addEventListener('keydown', function (event) {      var prevDef = false;      switch (event.keyCode) {        case keys.down:          _this.gotoSubIndex(_this.subIndex + 1);          prevDef = true;          break;        case keys.up:          _this.gotoSubIndex(_this.subIndex - 1);          prevDef = true;          break;        case keys.tab:          aria_utils.triggerEvent(parentNode, 'mouseleave');          break;        case keys.enter:        case keys.space:          prevDef = true;          event.currentTarget.click();          break;      }      if (prevDef) {        event.preventDefault();        event.stopPropagation();      }      return false;    });  });};/* harmony default export */ var aria_submenu = (SubMenu);// CONCATENATED MODULE: ./src/utils/menu/aria-menuitem.jsvar MenuItem = function MenuItem(domNode) {  this.domNode = domNode;  this.submenu = null;  this.init();};MenuItem.prototype.init = function () {  this.domNode.setAttribute('tabindex', '0');  var menuChild = this.domNode.querySelector('.el-menu');  if (menuChild) {    this.submenu = new aria_submenu(this, menuChild);  }  this.addListeners();};MenuItem.prototype.addListeners = function () {  var _this = this;  var keys = aria_utils.keys;  this.domNode.addEventListener('keydown', function (event) {    var prevDef = false;    switch (event.keyCode) {      case keys.down:        aria_utils.triggerEvent(event.currentTarget, 'mouseenter');        _this.submenu && _this.submenu.gotoSubIndex(0);        prevDef = true;        break;      case keys.up:        aria_utils.triggerEvent(event.currentTarget, 'mouseenter');        _this.submenu && _this.submenu.gotoSubIndex(_this.submenu.subMenuItems.length - 1);        prevDef = true;        break;      case keys.tab:        aria_utils.triggerEvent(event.currentTarget, 'mouseleave');        break;      case keys.enter:      case keys.space:        prevDef = true;        event.currentTarget.click();        break;    }    if (prevDef) {      event.preventDefault();    }  });};/* harmony default export */ var aria_menuitem = (MenuItem);// CONCATENATED MODULE: ./src/utils/menu/aria-menubar.jsvar Menu = function Menu(domNode) {  this.domNode = domNode;  this.init();};Menu.prototype.init = function () {  var menuChildren = this.domNode.childNodes;  [].filter.call(menuChildren, function (child) {    return child.nodeType === 1;  }).forEach(function (child) {    new aria_menuitem(child); // eslint-disable-line  });};/* harmony default export */ var aria_menubar = (Menu);// EXTERNAL MODULE: external "element-ui/lib/utils/dom"var dom_ = __webpack_require__(2);// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/menu/src/menu.vue?vue&type=script&lang=js&/* harmony default export */ var menuvue_type_script_lang_js_ = ({  name: 'ElMenu',  render: function render(h) {    var component = h(      'ul',      {        attrs: {          role: 'menubar'        },        key: +this.collapse,        style: { backgroundColor: this.backgroundColor || '' },        'class': {          'el-menu--horizontal': this.mode === 'horizontal',          'el-menu--collapse': this.collapse,          "el-menu": true        }      },      [this.$slots.default]    );    if (this.collapseTransition) {      return h('el-menu-collapse-transition', [component]);    } else {      return component;    }  },  componentName: 'ElMenu',  mixins: [emitter_default.a, migrating_default.a],  provide: function provide() {    return {      rootMenu: this    };  },  components: {    'el-menu-collapse-transition': {      functional: true,      render: function render(createElement, context) {        var data = {          props: {            mode: 'out-in'          },          on: {            beforeEnter: function beforeEnter(el) {              el.style.opacity = 0.2;            },            enter: function enter(el) {              Object(dom_["addClass"])(el, 'el-opacity-transition');              el.style.opacity = 1;            },            afterEnter: function afterEnter(el) {              Object(dom_["removeClass"])(el, 'el-opacity-transition');              el.style.opacity = '';            },            beforeLeave: function beforeLeave(el) {              if (!el.dataset) el.dataset = {};              if (Object(dom_["hasClass"])(el, 'el-menu--collapse')) {                Object(dom_["removeClass"])(el, 'el-menu--collapse');                el.dataset.oldOverflow = el.style.overflow;                el.dataset.scrollWidth = el.clientWidth;                Object(dom_["addClass"])(el, 'el-menu--collapse');              } else {                Object(dom_["addClass"])(el, 'el-menu--collapse');                el.dataset.oldOverflow = el.style.overflow;                el.dataset.scrollWidth = el.clientWidth;                Object(dom_["removeClass"])(el, 'el-menu--collapse');              }              el.style.width = el.scrollWidth + 'px';              el.style.overflow = 'hidden';            },            leave: function leave(el) {              Object(dom_["addClass"])(el, 'horizontal-collapse-transition');              el.style.width = el.dataset.scrollWidth + 'px';            }          }        };        return createElement('transition', data, context.children);      }    }  },  props: {    mode: {      type: String,      default: 'vertical'    },    defaultActive: {      type: String,      default: ''    },    defaultOpeneds: Array,    uniqueOpened: Boolean,    router: Boolean,    menuTrigger: {      type: String,      default: 'hover'    },    collapse: Boolean,    backgroundColor: String,    textColor: String,    activeTextColor: String,    collapseTransition: {      type: Boolean,      default: true    }  },  data: function data() {    return {      activeIndex: this.defaultActive,      openedMenus: this.defaultOpeneds && !this.collapse ? this.defaultOpeneds.slice(0) : [],      items: {},      submenus: {}    };  },  computed: {    hoverBackground: function hoverBackground() {      return this.backgroundColor ? this.mixColor(this.backgroundColor, 0.2) : '';    },    isMenuPopup: function isMenuPopup() {      return this.mode === 'horizontal' || this.mode === 'vertical' && this.collapse;    }  },  watch: {    defaultActive: function defaultActive(value) {      if (!this.items[value]) {        this.activeIndex = null;      }      this.updateActiveIndex(value);    },    defaultOpeneds: function defaultOpeneds(value) {      if (!this.collapse) {        this.openedMenus = value;      }    },    collapse: function collapse(value) {      if (value) this.openedMenus = [];      this.broadcast('ElSubmenu', 'toggle-collapse', value);    }  },  methods: {    updateActiveIndex: function updateActiveIndex(val) {      var item = this.items[val] || this.items[this.activeIndex] || this.items[this.defaultActive];      if (item) {        this.activeIndex = item.index;        this.initOpenedMenu();      } else {        this.activeIndex = null;      }    },    getMigratingConfig: function getMigratingConfig() {      return {        props: {          'theme': 'theme is removed.'        }      };    },    getColorChannels: function getColorChannels(color) {      color = color.replace('#', '');      if (/^[0-9a-fA-F]{3}$/.test(color)) {        color = color.split('');        for (var i = 2; i >= 0; i--) {          color.splice(i, 0, color[i]);        }        color = color.join('');      }      if (/^[0-9a-fA-F]{6}$/.test(color)) {        return {          red: parseInt(color.slice(0, 2), 16),          green: parseInt(color.slice(2, 4), 16),          blue: parseInt(color.slice(4, 6), 16)        };      } else {        return {          red: 255,          green: 255,          blue: 255        };      }    },    mixColor: function mixColor(color, percent) {      var _getColorChannels = this.getColorChannels(color),          red = _getColorChannels.red,          green = _getColorChannels.green,          blue = _getColorChannels.blue;      if (percent > 0) {        // shade given color        red *= 1 - percent;        green *= 1 - percent;        blue *= 1 - percent;      } else {        // tint given color        red += (255 - red) * percent;        green += (255 - green) * percent;        blue += (255 - blue) * percent;      }      return 'rgb(' + Math.round(red) + ', ' + Math.round(green) + ', ' + Math.round(blue) + ')';    },    addItem: function addItem(item) {      this.$set(this.items, item.index, item);    },    removeItem: function removeItem(item) {      delete this.items[item.index];    },    addSubmenu: function addSubmenu(item) {      this.$set(this.submenus, item.index, item);    },    removeSubmenu: function removeSubmenu(item) {      delete this.submenus[item.index];    },    openMenu: function openMenu(index, indexPath) {      var openedMenus = this.openedMenus;      if (openedMenus.indexOf(index) !== -1) return;      // 将不在该菜单路径下的其余菜单收起      // collapse all menu that are not under current menu item      if (this.uniqueOpened) {        this.openedMenus = openedMenus.filter(function (index) {          return indexPath.indexOf(index) !== -1;        });      }      this.openedMenus.push(index);    },    closeMenu: function closeMenu(index) {      var i = this.openedMenus.indexOf(index);      if (i !== -1) {        this.openedMenus.splice(i, 1);      }    },    handleSubmenuClick: function handleSubmenuClick(submenu) {      var index = submenu.index,          indexPath = submenu.indexPath;      var isOpened = this.openedMenus.indexOf(index) !== -1;      if (isOpened) {        this.closeMenu(index);        this.$emit('close', index, indexPath);      } else {        this.openMenu(index, indexPath);        this.$emit('open', index, indexPath);      }    },    handleItemClick: function handleItemClick(item) {      var _this = this;      var index = item.index,          indexPath = item.indexPath;      var oldActiveIndex = this.activeIndex;      var hasIndex = item.index !== null;      if (hasIndex) {        this.activeIndex = item.index;      }      this.$emit('select', index, indexPath, item);      if (this.mode === 'horizontal' || this.collapse) {        this.openedMenus = [];      }      if (this.router && hasIndex) {        this.routeToItem(item, function (error) {          _this.activeIndex = oldActiveIndex;          if (error) {            // vue-router 3.1.0+ push/replace cause NavigationDuplicated error             // https://github.com/ElemeFE/element/issues/17044            if (error.name === 'NavigationDuplicated') return;            console.error(error);          }        });      }    },    // 初始化展开菜单    // initialize opened menu    initOpenedMenu: function initOpenedMenu() {      var _this2 = this;      var index = this.activeIndex;      var activeItem = this.items[index];      if (!activeItem || this.mode === 'horizontal' || this.collapse) return;      var indexPath = activeItem.indexPath;      // 展开该菜单项的路径上所有子菜单      // expand all submenus of the menu item      indexPath.forEach(function (index) {        var submenu = _this2.submenus[index];        submenu && _this2.openMenu(index, submenu.indexPath);      });    },    routeToItem: function routeToItem(item, onError) {      var route = item.route || item.index;      try {        this.$router.push(route, function () {}, onError);      } catch (e) {        console.error(e);      }    },    open: function open(index) {      var _this3 = this;      var indexPath = this.submenus[index.toString()].indexPath;      indexPath.forEach(function (i) {        return _this3.openMenu(i, indexPath);      });    },    close: function close(index) {      this.closeMenu(index);    }  },  mounted: function mounted() {    this.initOpenedMenu();    this.$on('item-click', this.handleItemClick);    this.$on('submenu-click', this.handleSubmenuClick);    if (this.mode === 'horizontal') {      new aria_menubar(this.$el); // eslint-disable-line    }    this.$watch('items', this.updateActiveIndex);  }});// CONCATENATED MODULE: ./packages/menu/src/menu.vue?vue&type=script&lang=js& /* harmony default export */ var src_menuvue_type_script_lang_js_ = (menuvue_type_script_lang_js_); // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.jsvar componentNormalizer = __webpack_require__(0);// CONCATENATED MODULE: ./packages/menu/src/menu.vuevar menu_render, staticRenderFns/* normalize component */var component = Object(componentNormalizer["a" /* default */])(  src_menuvue_type_script_lang_js_,  menu_render,  staticRenderFns,  false,  null,  null,  null  )/* hot reload */if (false) { var api; }component.options.__file = "packages/menu/src/menu.vue"/* harmony default export */ var menu = (component.exports);// CONCATENATED MODULE: ./packages/menu/index.js/* istanbul ignore next */menu.install = function (Vue) {  Vue.component(menu.name, menu);};/* harmony default export */ var packages_menu = __webpack_exports__["default"] = (menu);/***/ })/******/ });
 |